@ant-design/agentic-ui 2.29.30 → 2.29.32
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.d.ts +2 -0
- package/dist/Bubble/AIBubble.js +11 -11
- package/dist/Bubble/Avatar/index.js +3 -3
- package/dist/Bubble/List/PureBubbleList.js +3 -3
- package/dist/Bubble/List/index.js +3 -3
- package/dist/Bubble/PureBubble.js +9 -9
- package/dist/Bubble/Title.js +3 -3
- package/dist/Bubble/UserBubble.js +9 -9
- package/dist/Components/ActionIconBox/index.js +3 -3
- package/dist/Components/TextAnimate/index.js +1 -0
- package/dist/Components/lotties/TextLoading/index.js +2 -2
- package/dist/MarkdownEditor/editor/elements/CommentLeaf/index.d.ts +5 -0
- package/dist/MarkdownEditor/editor/elements/CommentLeaf/index.js +2 -1
- package/dist/MarkdownEditor/editor/plugins/elements.js +34 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/arrow.js +3 -3
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/backspace.js +2 -3
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/match.d.ts +2 -2
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/match.js +14 -11
- package/dist/MarkdownEditor/editor/plugins/useHighlight.js +2 -1
- package/dist/MarkdownEditor/editor/plugins/useKeyboard.js +12 -5
- package/dist/MarkdownEditor/editor/plugins/withListsPlugin.js +7 -9
- package/dist/MarkdownEditor/editor/tools/InsertAutocomplete.js +5 -4
- package/dist/MarkdownEditor/editor/tools/ToolBar/BaseBar.js +5 -5
- package/dist/MarkdownEditor/editor/tools/ToolBar/FloatBar.js +3 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/ReadonlyBaseBar.js +4 -4
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/ClearFormatButton.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/ColorPickerButton.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/FormatButton.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/FormattingTools.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/HeadingDropdown.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/LinkButton.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/components/UndoRedoButtons.js +3 -3
- package/dist/MarkdownEditor/editor/tools/ToolBar/floatBarStyle.js +1 -1
- package/dist/MarkdownEditor/editor/tools/ToolBar/toolBarStyle.js +1 -1
- package/dist/MarkdownEditor/editor/utils/editorUtils.js +8 -6
- package/dist/MarkdownEditor/editor/utils/isMarkdown.js +4 -4
- package/dist/MarkdownEditor/editor/utils/keyboard.js +3 -2
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem.js +11 -42
- package/dist/MarkdownInputField/QuickActions/index.js +2 -2
- package/dist/MarkdownInputField/RefinePromptButton/env.d.ts +4 -0
- package/dist/MarkdownInputField/RefinePromptButton/env.js +5 -0
- package/dist/MarkdownInputField/RefinePromptButton/index.js +2 -1
- package/dist/Plugins/chart/BarChart/index.js +6 -6
- package/dist/Plugins/chart/ChartMark/Area.js +2 -1
- package/dist/Plugins/chart/ChartMark/Bar.js +2 -1
- package/dist/Plugins/chart/ChartMark/Column.js +2 -1
- package/dist/Plugins/chart/ChartMark/Line.js +2 -1
- package/dist/Plugins/chart/ChartMark/Pie.js +2 -1
- package/dist/Plugins/chart/ChartRender.js +9 -1
- package/dist/Plugins/chart/DonutChart/index.js +2 -1
- package/dist/Plugins/chart/env.d.ts +4 -0
- package/dist/Plugins/chart/env.js +5 -0
- package/dist/Plugins/code/components/AceEditor.js +2 -0
- package/dist/Plugins/code/index.d.ts +1 -0
- package/dist/Plugins/code/index.js +1 -1
- package/dist/Plugins/mermaid/Mermaid.js +2 -2
- package/dist/Plugins/mermaid/env.d.ts +4 -0
- package/dist/Plugins/mermaid/env.js +5 -0
- package/dist/ToolUseBar/BarItem/Content.js +13 -13
- package/dist/ToolUseBar/BarItem/index.js +7 -7
- package/dist/WelcomeMessage/index.js +4 -4
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
26
26
|
import { CategoryScale, Chart as ChartJS, Filler, Legend, LinearScale, LineElement, PointElement, Title, Tooltip } from "chart.js";
|
|
27
27
|
import React, { useImperativeHandle, useRef } from "react";
|
|
28
28
|
import { Line } from "react-chartjs-2";
|
|
29
|
+
import { isWindowDefined } from "../env";
|
|
29
30
|
import { Container } from "./Container";
|
|
30
31
|
var chartMarkAreaRegistered = false;
|
|
31
32
|
export var Area = function Area(props) {
|
|
@@ -33,7 +34,7 @@ export var Area = function Area(props) {
|
|
|
33
34
|
if (chartMarkAreaRegistered) {
|
|
34
35
|
return undefined;
|
|
35
36
|
}
|
|
36
|
-
if (
|
|
37
|
+
if (!isWindowDefined()) {
|
|
37
38
|
return undefined;
|
|
38
39
|
}
|
|
39
40
|
ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, Filler, Title, Tooltip, Legend);
|
|
@@ -26,6 +26,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
26
26
|
import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, Title, Tooltip } from "chart.js";
|
|
27
27
|
import React, { useImperativeHandle, useRef } from "react";
|
|
28
28
|
import { Bar as ChartBar } from "react-chartjs-2";
|
|
29
|
+
import { isWindowDefined } from "../env";
|
|
29
30
|
import { stringFormatNumber } from "../utils";
|
|
30
31
|
import { Container } from "./Container";
|
|
31
32
|
var chartMarkBarRegistered = false;
|
|
@@ -34,7 +35,7 @@ export var Bar = function Bar(props) {
|
|
|
34
35
|
if (chartMarkBarRegistered) {
|
|
35
36
|
return undefined;
|
|
36
37
|
}
|
|
37
|
-
if (
|
|
38
|
+
if (!isWindowDefined()) {
|
|
38
39
|
return undefined;
|
|
39
40
|
}
|
|
40
41
|
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend);
|
|
@@ -26,6 +26,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
26
26
|
import { BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, Title, Tooltip } from "chart.js";
|
|
27
27
|
import React, { useImperativeHandle, useRef } from "react";
|
|
28
28
|
import { Bar as ChartBar } from "react-chartjs-2";
|
|
29
|
+
import { isWindowDefined } from "../env";
|
|
29
30
|
import { stringFormatNumber } from "../utils";
|
|
30
31
|
import { Container } from "./Container";
|
|
31
32
|
var chartMarkColumnRegistered = false;
|
|
@@ -34,7 +35,7 @@ export var Column = function Column(props) {
|
|
|
34
35
|
if (chartMarkColumnRegistered) {
|
|
35
36
|
return undefined;
|
|
36
37
|
}
|
|
37
|
-
if (
|
|
38
|
+
if (!isWindowDefined()) {
|
|
38
39
|
return undefined;
|
|
39
40
|
}
|
|
40
41
|
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend);
|
|
@@ -26,6 +26,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
26
26
|
import { CategoryScale, Chart as ChartJS, Legend, LinearScale, LineElement, PointElement, Title, Tooltip } from "chart.js";
|
|
27
27
|
import React, { useImperativeHandle, useRef } from "react";
|
|
28
28
|
import { Line as ChartLine } from "react-chartjs-2";
|
|
29
|
+
import { isWindowDefined } from "../env";
|
|
29
30
|
import { stringFormatNumber } from "../utils";
|
|
30
31
|
import { Container } from "./Container";
|
|
31
32
|
var chartMarkLineRegistered = false;
|
|
@@ -34,7 +35,7 @@ export var Line = function Line(props) {
|
|
|
34
35
|
if (chartMarkLineRegistered) {
|
|
35
36
|
return undefined;
|
|
36
37
|
}
|
|
37
|
-
if (
|
|
38
|
+
if (!isWindowDefined()) {
|
|
38
39
|
return undefined;
|
|
39
40
|
}
|
|
40
41
|
ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend);
|
|
@@ -2,6 +2,7 @@ import { ArcElement, Chart as ChartJS, Legend, Tooltip } from "chart.js";
|
|
|
2
2
|
import React, { useImperativeHandle, useRef } from "react";
|
|
3
3
|
import { Doughnut } from "react-chartjs-2";
|
|
4
4
|
import { defaultColorList } from "../const";
|
|
5
|
+
import { isWindowDefined } from "../env";
|
|
5
6
|
import { Container } from "./Container";
|
|
6
7
|
var chartMarkPieRegistered = false;
|
|
7
8
|
export var Pie = function Pie(props) {
|
|
@@ -9,7 +10,7 @@ export var Pie = function Pie(props) {
|
|
|
9
10
|
if (chartMarkPieRegistered) {
|
|
10
11
|
return undefined;
|
|
11
12
|
}
|
|
12
|
-
if (
|
|
13
|
+
if (!isWindowDefined()) {
|
|
13
14
|
return undefined;
|
|
14
15
|
}
|
|
15
16
|
ChartJS.register(ArcElement, Tooltip, Legend);
|
|
@@ -678,6 +678,13 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
|
|
|
678
678
|
return k + 1;
|
|
679
679
|
});
|
|
680
680
|
}, 800));
|
|
681
|
+
// 卸载时取消未执行的防抖,避免在测试或 SSR 环境下 teardown 后回调触发 setState
|
|
682
|
+
React.useEffect(function() {
|
|
683
|
+
return function() {
|
|
684
|
+
var _debouncedUpdateRenderKeyRef_current_cancel, _debouncedUpdateRenderKeyRef_current;
|
|
685
|
+
(_debouncedUpdateRenderKeyRef_current = debouncedUpdateRenderKeyRef.current) === null || _debouncedUpdateRenderKeyRef_current === void 0 ? void 0 : (_debouncedUpdateRenderKeyRef_current_cancel = _debouncedUpdateRenderKeyRef_current.cancel) === null || _debouncedUpdateRenderKeyRef_current_cancel === void 0 ? void 0 : _debouncedUpdateRenderKeyRef_current_cancel.call(_debouncedUpdateRenderKeyRef_current);
|
|
686
|
+
};
|
|
687
|
+
}, []);
|
|
681
688
|
var renderDescriptionsFallback = React.useMemo(function() {
|
|
682
689
|
var _config_columns;
|
|
683
690
|
var columnCount = (config === null || config === void 0 ? void 0 : (_config_columns = config.columns) === null || _config_columns === void 0 ? void 0 : _config_columns.length) || 0;
|
|
@@ -833,6 +840,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
|
|
|
833
840
|
var filterByChanged = prevDataRef.current.filterBy !== filterBy;
|
|
834
841
|
var hasChanged = prevDataRef.current.dataHash !== dataHash || configChanged || groupByChanged || colorLegendChanged || filterByChanged;
|
|
835
842
|
if (hasChanged) {
|
|
843
|
+
var dataHashChanged = prevDataRef.current.dataHash !== dataHash;
|
|
836
844
|
// 更新缓存
|
|
837
845
|
prevDataRef.current = {
|
|
838
846
|
dataHash: dataHash,
|
|
@@ -842,7 +850,7 @@ import { debounce, getDataHash, isConfigEqual, isNotEmpty, toNumber } from "./ut
|
|
|
842
850
|
filterBy: filterBy
|
|
843
851
|
};
|
|
844
852
|
// 对于流式数据,使用防抖更新,避免频繁渲染
|
|
845
|
-
if (
|
|
853
|
+
if (dataHashChanged) {
|
|
846
854
|
debouncedUpdateRenderKeyRef.current();
|
|
847
855
|
} else {
|
|
848
856
|
// 配置变化时立即更新
|
|
@@ -150,6 +150,7 @@ import classNames from "clsx";
|
|
|
150
150
|
import React, { useContext, useMemo, useRef, useState } from "react";
|
|
151
151
|
import { Doughnut } from "react-chartjs-2";
|
|
152
152
|
import { ChartContainer, ChartFilter, ChartStatistic, ChartToolBar, downloadChart } from "../components";
|
|
153
|
+
import { isWindowDefined } from "../env";
|
|
153
154
|
import { defaultColorList } from "../const";
|
|
154
155
|
import { resolveCssVariable } from "../utils";
|
|
155
156
|
import { SINGLE_MODE_DESKTOP_CUTOUT, SINGLE_MODE_MOBILE_CUTOUT } from "./constants";
|
|
@@ -221,7 +222,7 @@ import { useStyle } from "./style";
|
|
|
221
222
|
if (donutChartComponentsRegistered) {
|
|
222
223
|
return undefined;
|
|
223
224
|
}
|
|
224
|
-
if (
|
|
225
|
+
if (!isWindowDefined()) {
|
|
225
226
|
return undefined;
|
|
226
227
|
}
|
|
227
228
|
ChartJS.register(ArcElement, Tooltip, Legend);
|
|
@@ -482,6 +482,7 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
482
482
|
if (readonly) return;
|
|
483
483
|
clearTimeout(debounceTimer.current);
|
|
484
484
|
debounceTimer.current = window.setTimeout(function() {
|
|
485
|
+
if (typeof window === 'undefined') return;
|
|
485
486
|
onUpdate({
|
|
486
487
|
value: codeEditor.getValue()
|
|
487
488
|
});
|
|
@@ -552,6 +553,7 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
552
553
|
// 配置编辑器事件
|
|
553
554
|
setupEditorEvents(codeEditor);
|
|
554
555
|
return function() {
|
|
556
|
+
clearTimeout(debounceTimer.current);
|
|
555
557
|
codeEditor.destroy();
|
|
556
558
|
};
|
|
557
559
|
}, [
|
|
@@ -31,7 +31,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
31
31
|
import { BaseMarkdownEditor } from "../../MarkdownEditor";
|
|
32
32
|
import { useEditorStore } from "../../MarkdownEditor/editor/store";
|
|
33
33
|
import { CodeRenderer } from "./components";
|
|
34
|
-
function csvToMarkdownTable(csv) {
|
|
34
|
+
export function csvToMarkdownTable(csv) {
|
|
35
35
|
if (!csv) return '';
|
|
36
36
|
// 处理不同换行符
|
|
37
37
|
var lines = csv.replace(/\r\n/g, '\n').replace(/\r/g, '\n').split('\n');
|
|
@@ -127,6 +127,7 @@ function _ts_generator(thisArg, body) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
import React, { lazy, Suspense } from "react";
|
|
130
|
+
import { isBrowser } from "./env";
|
|
130
131
|
import { MermaidFallback } from "./MermaidFallback";
|
|
131
132
|
import { MermaidRendererImpl } from "./MermaidRendererImpl";
|
|
132
133
|
import { loadMermaid } from "./utils";
|
|
@@ -190,8 +191,7 @@ import { loadMermaid } from "./utils";
|
|
|
190
191
|
* - 居中显示图表
|
|
191
192
|
* - 自动生成唯一ID
|
|
192
193
|
*/ export var Mermaid = function Mermaid(props) {
|
|
193
|
-
|
|
194
|
-
if (!isBrowser) {
|
|
194
|
+
if (!isBrowser()) {
|
|
195
195
|
return null;
|
|
196
196
|
}
|
|
197
197
|
return /*#__PURE__*/ React.createElement(Suspense, {
|
|
@@ -27,7 +27,7 @@ function _object_spread(target) {
|
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
29
|
import { Api, ChevronUp, X } from "@sofa-design/icons";
|
|
30
|
-
import
|
|
30
|
+
import classNames from "clsx";
|
|
31
31
|
import { AnimatePresence, motion } from "framer-motion";
|
|
32
32
|
import React, { memo, useMemo } from "react";
|
|
33
33
|
import { useRefFunction } from "../../Hooks/useRefFunction";
|
|
@@ -35,14 +35,14 @@ var ToolImageComponent = function ToolImageComponent(param) {
|
|
|
35
35
|
var tool = param.tool, prefixCls = param.prefixCls, hashId = param.hashId;
|
|
36
36
|
var toolImageWrapperClassName = useMemo(function() {
|
|
37
37
|
var _obj;
|
|
38
|
-
return
|
|
38
|
+
return classNames("".concat(prefixCls, "-tool-image-wrapper"), hashId, (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-tool-image-wrapper-rotating"), tool.status === 'loading'), _define_property(_obj, "".concat(prefixCls, "-tool-image-wrapper-loading"), tool.status === 'loading'), _obj));
|
|
39
39
|
}, [
|
|
40
40
|
prefixCls,
|
|
41
41
|
hashId,
|
|
42
42
|
tool.status
|
|
43
43
|
]);
|
|
44
44
|
var toolImageClassName = useMemo(function() {
|
|
45
|
-
return
|
|
45
|
+
return classNames("".concat(prefixCls, "-tool-image"), hashId);
|
|
46
46
|
}, [
|
|
47
47
|
prefixCls,
|
|
48
48
|
hashId
|
|
@@ -98,14 +98,14 @@ export var ToolImage = /*#__PURE__*/ memo(ToolImageComponent);
|
|
|
98
98
|
var ToolHeaderRightComponent = function ToolHeaderRightComponent(param) {
|
|
99
99
|
var tool = param.tool, prefixCls = param.prefixCls, hashId = param.hashId, light = param.light;
|
|
100
100
|
var toolHeaderRightClassName = useMemo(function() {
|
|
101
|
-
return
|
|
101
|
+
return classNames("".concat(prefixCls, "-tool-header-right"), _define_property({}, "".concat(prefixCls, "-tool-header-right-light"), light), hashId);
|
|
102
102
|
}, [
|
|
103
103
|
prefixCls,
|
|
104
104
|
hashId,
|
|
105
105
|
light
|
|
106
106
|
]);
|
|
107
107
|
var toolNameClassName = useMemo(function() {
|
|
108
|
-
return
|
|
108
|
+
return classNames("".concat(prefixCls, "-tool-name"), hashId, _define_property({}, "".concat(prefixCls, "-tool-name-loading"), tool.status === 'loading'));
|
|
109
109
|
}, [
|
|
110
110
|
prefixCls,
|
|
111
111
|
hashId,
|
|
@@ -113,7 +113,7 @@ var ToolHeaderRightComponent = function ToolHeaderRightComponent(param) {
|
|
|
113
113
|
]);
|
|
114
114
|
var toolTargetClassName = useMemo(function() {
|
|
115
115
|
var _obj;
|
|
116
|
-
return
|
|
116
|
+
return classNames("".concat(prefixCls, "-tool-target"), hashId, (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-tool-target-loading"), tool.status === 'loading'), _define_property(_obj, "".concat(prefixCls, "-tool-target-light"), light), _obj));
|
|
117
117
|
}, [
|
|
118
118
|
prefixCls,
|
|
119
119
|
hashId,
|
|
@@ -175,7 +175,7 @@ export var ToolHeaderRight = /*#__PURE__*/ memo(ToolHeaderRightComponent);
|
|
|
175
175
|
var ToolTimeComponent = function ToolTimeComponent(param) {
|
|
176
176
|
var tool = param.tool, prefixCls = param.prefixCls, hashId = param.hashId;
|
|
177
177
|
var toolTimeClassName = useMemo(function() {
|
|
178
|
-
return
|
|
178
|
+
return classNames("".concat(prefixCls, "-tool-time"), hashId);
|
|
179
179
|
}, [
|
|
180
180
|
prefixCls,
|
|
181
181
|
hashId
|
|
@@ -195,7 +195,7 @@ export var ToolTime = /*#__PURE__*/ memo(ToolTimeComponent);
|
|
|
195
195
|
var ToolExpandComponent = function ToolExpandComponent(param) {
|
|
196
196
|
var showContent = param.showContent, expanded = param.expanded, prefixCls = param.prefixCls, hashId = param.hashId, onExpandClick = param.onExpandClick;
|
|
197
197
|
var toolExpandClassName = useMemo(function() {
|
|
198
|
-
return
|
|
198
|
+
return classNames("".concat(prefixCls, "-tool-expand"), hashId);
|
|
199
199
|
}, [
|
|
200
200
|
prefixCls,
|
|
201
201
|
hashId
|
|
@@ -234,7 +234,7 @@ export var ToolExpand = /*#__PURE__*/ memo(ToolExpandComponent);
|
|
|
234
234
|
var ToolContentComponent = function ToolContentComponent(param) {
|
|
235
235
|
var tool = param.tool, prefixCls = param.prefixCls, hashId = param.hashId, light = param.light, showContent = param.showContent, expanded = param.expanded;
|
|
236
236
|
var toolContainerClassName = useMemo(function() {
|
|
237
|
-
return
|
|
237
|
+
return classNames("".concat(prefixCls, "-tool-container"), hashId, _define_property({}, "".concat(prefixCls, "-tool-container-light"), light));
|
|
238
238
|
}, [
|
|
239
239
|
prefixCls,
|
|
240
240
|
hashId,
|
|
@@ -242,25 +242,25 @@ var ToolContentComponent = function ToolContentComponent(param) {
|
|
|
242
242
|
]);
|
|
243
243
|
// 缓存错误样式类名
|
|
244
244
|
var errorClassName = useMemo(function() {
|
|
245
|
-
return
|
|
245
|
+
return classNames("".concat(prefixCls, "-tool-content-error"), hashId);
|
|
246
246
|
}, [
|
|
247
247
|
prefixCls,
|
|
248
248
|
hashId
|
|
249
249
|
]);
|
|
250
250
|
var errorIconClassName = useMemo(function() {
|
|
251
|
-
return
|
|
251
|
+
return classNames("".concat(prefixCls, "-tool-content-error-icon"), hashId);
|
|
252
252
|
}, [
|
|
253
253
|
prefixCls,
|
|
254
254
|
hashId
|
|
255
255
|
]);
|
|
256
256
|
var errorTextClassName = useMemo(function() {
|
|
257
|
-
return
|
|
257
|
+
return classNames("".concat(prefixCls, "-tool-content-error-text"), hashId);
|
|
258
258
|
}, [
|
|
259
259
|
prefixCls,
|
|
260
260
|
hashId
|
|
261
261
|
]);
|
|
262
262
|
var contentClassName = useMemo(function() {
|
|
263
|
-
return
|
|
263
|
+
return classNames("".concat(prefixCls, "-tool-content"), hashId);
|
|
264
264
|
}, [
|
|
265
265
|
prefixCls,
|
|
266
266
|
hashId
|
|
@@ -64,7 +64,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
64
64
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
65
65
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
66
66
|
}
|
|
67
|
-
import
|
|
67
|
+
import classNames from "clsx";
|
|
68
68
|
import { useMergedState } from "rc-util";
|
|
69
69
|
import React, { memo, useMemo } from "react";
|
|
70
70
|
import { useRefFunction } from "../../Hooks/useRefFunction";
|
|
@@ -88,7 +88,7 @@ var ToolUseBarItemComponent = function ToolUseBarItemComponent(param) {
|
|
|
88
88
|
// 使用 useMemo 优化样式类名
|
|
89
89
|
var toolClassName = useMemo(function() {
|
|
90
90
|
var _obj;
|
|
91
|
-
return
|
|
91
|
+
return classNames("".concat(prefixCls, "-tool ").concat(hashId), (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-tool-success"), tool.status === 'success'), _define_property(_obj, "".concat(prefixCls, "-tool-loading"), tool.status === 'loading'), _define_property(_obj, "".concat(prefixCls, "-tool-loading-light"), tool.status === 'loading' && light), _define_property(_obj, "".concat(prefixCls, "-tool-error"), tool.status === 'error'), _define_property(_obj, "".concat(prefixCls, "-tool-idle"), tool.status === 'idle'), _define_property(_obj, "".concat(prefixCls, "-tool-active"), isActive && !expanded), _define_property(_obj, "".concat(prefixCls, "-tool-expanded"), expanded), _define_property(_obj, "".concat(prefixCls, "-tool-light"), light), _obj));
|
|
92
92
|
}, [
|
|
93
93
|
prefixCls,
|
|
94
94
|
hashId,
|
|
@@ -98,13 +98,13 @@ var ToolUseBarItemComponent = function ToolUseBarItemComponent(param) {
|
|
|
98
98
|
expanded
|
|
99
99
|
]);
|
|
100
100
|
var toolBarClassName = useMemo(function() {
|
|
101
|
-
return
|
|
101
|
+
return classNames("".concat(prefixCls, "-tool-bar"), hashId);
|
|
102
102
|
}, [
|
|
103
103
|
prefixCls,
|
|
104
104
|
hashId
|
|
105
105
|
]);
|
|
106
106
|
var toolHeaderClassName = useMemo(function() {
|
|
107
|
-
return
|
|
107
|
+
return classNames("".concat(prefixCls, "-tool-header"), hashId);
|
|
108
108
|
}, [
|
|
109
109
|
prefixCls,
|
|
110
110
|
hashId
|
|
@@ -152,9 +152,9 @@ var ToolUseBarItemComponent = function ToolUseBarItemComponent(param) {
|
|
|
152
152
|
return /*#__PURE__*/ React.createElement("div", {
|
|
153
153
|
key: tool.id,
|
|
154
154
|
"data-testid": "ToolUserItem",
|
|
155
|
-
className:
|
|
155
|
+
className: classNames(toolClassName, _define_property({}, "".concat(prefixCls, "-tool-collapsed"), !showContent))
|
|
156
156
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
157
|
-
className:
|
|
157
|
+
className: classNames(toolBarClassName, _define_property({}, "".concat(prefixCls, "-tool-bar-collapsed"), !showContent)),
|
|
158
158
|
"data-testid": "tool-user-item-tool-bar",
|
|
159
159
|
onClick: handleClick
|
|
160
160
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
@@ -170,7 +170,7 @@ var ToolUseBarItemComponent = function ToolUseBarItemComponent(param) {
|
|
|
170
170
|
hashId: hashId,
|
|
171
171
|
light: light
|
|
172
172
|
}), tool.time || showContent ? /*#__PURE__*/ React.createElement("div", {
|
|
173
|
-
className:
|
|
173
|
+
className: classNames("".concat(prefixCls, "-tool-time-expand"), hashId)
|
|
174
174
|
}, /*#__PURE__*/ React.createElement(ToolTime, {
|
|
175
175
|
tool: tool,
|
|
176
176
|
prefixCls: prefixCls,
|
|
@@ -69,7 +69,7 @@ function _object_spread_props(target, source) {
|
|
|
69
69
|
return target;
|
|
70
70
|
}
|
|
71
71
|
import { ConfigProvider } from "antd";
|
|
72
|
-
import
|
|
72
|
+
import clsx from "clsx";
|
|
73
73
|
import React, { useContext } from "react";
|
|
74
74
|
import { TextAnimate } from "../Components/TextAnimate";
|
|
75
75
|
import { TypingAnimation } from "../Components/TypingAnimation";
|
|
@@ -120,18 +120,18 @@ import { useStyle } from "./style";
|
|
|
120
120
|
var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
121
121
|
var _ref = customStyle || {}, ref = _object_destructuring_empty(_ref), restStyle = _extends({}, _ref);
|
|
122
122
|
return wrapSSR(/*#__PURE__*/ React.createElement("div", {
|
|
123
|
-
className:
|
|
123
|
+
className: clsx(prefixCls, hashId, rootClassName),
|
|
124
124
|
style: restStyle
|
|
125
125
|
}, title && /*#__PURE__*/ React.createElement(TypingAnimation, _object_spread_props(_object_spread({
|
|
126
126
|
as: "div"
|
|
127
127
|
}, titleAnimateProps), {
|
|
128
|
-
className:
|
|
128
|
+
className: clsx("".concat(prefixCls, "-title"), classNames === null || classNames === void 0 ? void 0 : classNames.title)
|
|
129
129
|
}), title), description && /*#__PURE__*/ React.createElement(TextAnimate, _object_spread_props(_object_spread({
|
|
130
130
|
as: "div",
|
|
131
131
|
animation: "blurInUp",
|
|
132
132
|
by: "character",
|
|
133
133
|
once: true
|
|
134
134
|
}, descriptionAnimateProps), {
|
|
135
|
-
className:
|
|
135
|
+
className: clsx("".concat(prefixCls, "-description"), classNames === null || classNames === void 0 ? void 0 : classNames.description)
|
|
136
136
|
}), description)));
|
|
137
137
|
};
|