@ant-design/agentic-ui 2.29.14 → 2.29.15
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/MarkdownEditor/editor/elements/index.js +1 -1
- package/dist/MarkdownEditor/editor/plugins/insertParsedHtmlNodes.js +22 -1
- package/dist/Plugins/chart/components/ChartFilter/ChartFilter.js +7 -41
- package/dist/TaskList/index.d.ts +1 -1
- package/dist/Workspace/Task/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -471,7 +471,7 @@ var MLeafComponent = function(props) {
|
|
|
471
471
|
"data-comment": leaf.comment ? 'comment' : undefined,
|
|
472
472
|
"data-url": leaf.url ? 'url' : undefined,
|
|
473
473
|
style: style,
|
|
474
|
-
className: prefixClassName
|
|
474
|
+
className: (prefixClassName === null || prefixClassName === void 0 ? void 0 : prefixClassName.trim()) ? prefixClassName === null || prefixClassName === void 0 ? void 0 : prefixClassName.trim() : undefined
|
|
475
475
|
}), children);
|
|
476
476
|
// 如果有评论,使用 CommentLeaf 包裹普通 DOM
|
|
477
477
|
if (hasComment) {
|
|
@@ -639,14 +639,35 @@ var blobToFile = function(blobUrl, fileName) {
|
|
|
639
639
|
});
|
|
640
640
|
})();
|
|
641
641
|
};
|
|
642
|
+
/**
|
|
643
|
+
* 从片段列表中递归移除所有媒体类型的片段(图片、视频、音频等)
|
|
644
|
+
*/ var removeMediaFragments = function(fragments) {
|
|
645
|
+
for(var i = fragments.length - 1; i >= 0; i--){
|
|
646
|
+
var fragment = fragments[i];
|
|
647
|
+
if (fragment.type === 'media') {
|
|
648
|
+
fragments.splice(i, 1);
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
if (fragment === null || fragment === void 0 ? void 0 : fragment.children) {
|
|
652
|
+
removeMediaFragments(fragment.children);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
};
|
|
642
656
|
/**
|
|
643
657
|
* 分段处理文件上传,避免阻塞主线程
|
|
644
658
|
*/ var upLoadFileBatch = function(fragmentList, editorProps) {
|
|
645
659
|
return _async_to_generator(function() {
|
|
646
|
-
var mediaFragments, collectMediaFragments, hideLoading, i, batch, progress, error;
|
|
660
|
+
var _editorProps_image, mediaFragments, collectMediaFragments, hideLoading, i, batch, progress, error;
|
|
647
661
|
return _ts_generator(this, function(_state) {
|
|
648
662
|
switch(_state.label){
|
|
649
663
|
case 0:
|
|
664
|
+
// 如果没有配置 upload,过滤掉所有媒体类型的片段
|
|
665
|
+
if (!((_editorProps_image = editorProps.image) === null || _editorProps_image === void 0 ? void 0 : _editorProps_image.upload)) {
|
|
666
|
+
removeMediaFragments(fragmentList);
|
|
667
|
+
return [
|
|
668
|
+
2
|
|
669
|
+
];
|
|
670
|
+
}
|
|
650
671
|
mediaFragments = [];
|
|
651
672
|
// 收集所有需要上传的媒体文件
|
|
652
673
|
collectMediaFragments = function(fragments) {
|
|
@@ -53,9 +53,8 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
53
53
|
}
|
|
54
54
|
import { ChevronDown } from "@sofa-design/icons";
|
|
55
55
|
import { Button, ConfigProvider, Dropdown, Segmented } from "antd";
|
|
56
|
-
import React, { useContext
|
|
56
|
+
import React, { useContext } from "react";
|
|
57
57
|
import { I18nContext } from "../../../../I18n";
|
|
58
|
-
import { debounce } from "../../utils";
|
|
59
58
|
import { useStyle } from "./style";
|
|
60
59
|
var ChartFilterComponent = function(param) {
|
|
61
60
|
var filterOptions = param.filterOptions, selectedFilter = param.selectedFilter, onFilterChange = param.onFilterChange, customOptions = param.customOptions, selectedCustomSelection = param.selectedCustomSelection, onSelectionChange = param.onSelectionChange, _param_className = param.className, className = _param_className === void 0 ? '' : _param_className, classNamesProp = param.classNames, style = param.style, styles = param.styles, _param_theme = param.theme, theme = _param_theme === void 0 ? 'light' : _param_theme, _param_variant = param.variant, variant = _param_variant === void 0 ? 'default' : _param_variant;
|
|
@@ -65,48 +64,15 @@ var ChartFilterComponent = function(param) {
|
|
|
65
64
|
var i18n = useContext(I18nContext);
|
|
66
65
|
var prefixCls = getPrefixCls('chart-filter');
|
|
67
66
|
var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
68
|
-
// 使用 useRef 保存最新的回调函数,避免防抖函数闭包问题
|
|
69
|
-
var onFilterChangeRef = useRef(onFilterChange);
|
|
70
|
-
var onSelectionChangeRef = useRef(onSelectionChange);
|
|
71
|
-
// 更新 ref,确保总是使用最新的回调
|
|
72
|
-
React.useEffect(function() {
|
|
73
|
-
onFilterChangeRef.current = onFilterChange;
|
|
74
|
-
onSelectionChangeRef.current = onSelectionChange;
|
|
75
|
-
}, [
|
|
76
|
-
onFilterChange,
|
|
77
|
-
onSelectionChange
|
|
78
|
-
]);
|
|
79
|
-
// 创建防抖的回调函数,1秒更新一次
|
|
80
|
-
var debouncedFilterChange = useMemo(function() {
|
|
81
|
-
return debounce(function(value) {
|
|
82
|
-
if (onFilterChangeRef.current) {
|
|
83
|
-
onFilterChangeRef.current(value);
|
|
84
|
-
}
|
|
85
|
-
}, 1000);
|
|
86
|
-
}, []);
|
|
87
|
-
var debouncedSelectionChange = useMemo(function() {
|
|
88
|
-
return debounce(function(region) {
|
|
89
|
-
if (onSelectionChangeRef.current) {
|
|
90
|
-
onSelectionChangeRef.current(region);
|
|
91
|
-
}
|
|
92
|
-
}, 1000);
|
|
93
|
-
}, []);
|
|
94
|
-
// 组件卸载时清理防抖函数
|
|
95
|
-
React.useEffect(function() {
|
|
96
|
-
return function() {
|
|
97
|
-
var _debouncedFilterChange_cancel, _debouncedSelectionChange_cancel;
|
|
98
|
-
debouncedFilterChange === null || debouncedFilterChange === void 0 ? void 0 : (_debouncedFilterChange_cancel = debouncedFilterChange.cancel) === null || _debouncedFilterChange_cancel === void 0 ? void 0 : _debouncedFilterChange_cancel.call(debouncedFilterChange);
|
|
99
|
-
debouncedSelectionChange === null || debouncedSelectionChange === void 0 ? void 0 : (_debouncedSelectionChange_cancel = debouncedSelectionChange.cancel) === null || _debouncedSelectionChange_cancel === void 0 ? void 0 : _debouncedSelectionChange_cancel.call(debouncedSelectionChange);
|
|
100
|
-
};
|
|
101
|
-
}, [
|
|
102
|
-
debouncedFilterChange,
|
|
103
|
-
debouncedSelectionChange
|
|
104
|
-
]);
|
|
105
67
|
var handleRegionChange = function(region) {
|
|
106
|
-
|
|
68
|
+
if (onSelectionChange) {
|
|
69
|
+
onSelectionChange(region);
|
|
70
|
+
}
|
|
107
71
|
};
|
|
108
72
|
var handleFilterChange = function(value) {
|
|
109
|
-
|
|
73
|
+
if (onFilterChange) {
|
|
74
|
+
onFilterChange(value);
|
|
75
|
+
}
|
|
110
76
|
};
|
|
111
77
|
var hasMain = Array.isArray(filterOptions) && filterOptions.length > 1;
|
|
112
78
|
var hasSecondary = Array.isArray(customOptions) && customOptions.length > 1;
|
package/dist/TaskList/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { type FC } from 'react';
|
|
|
2
2
|
type TaskStatus = 'success' | 'pending' | 'loading' | 'error';
|
|
3
3
|
export interface TaskItem {
|
|
4
4
|
key: string;
|
|
5
|
-
title?:
|
|
5
|
+
title?: React.ReactNode;
|
|
6
6
|
content?: React.ReactNode | React.ReactNode[];
|
|
7
7
|
status: TaskStatus;
|
|
8
8
|
}
|