@ant-design/agentic-ui 2.30.28 → 2.30.30
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/AgentRunBar/icons/StopIcon.d.ts +11 -1
- package/dist/AgentRunBar/icons/StopIcon.js +50 -4
- package/dist/AnswerAlert/style.js +3 -3
- package/dist/Bubble/List/style.js +1 -0
- package/dist/Bubble/style.js +15 -12
- package/dist/ChatLayout/style.js +4 -3
- package/dist/Components/ActionItemBox/style.js +11 -11
- package/dist/Hooks/useLanguage.d.ts +2 -0
- package/dist/I18n/locales.d.ts +2 -0
- package/dist/I18n/locales.js +4 -0
- package/dist/MarkdownEditor/BaseMarkdownEditor.d.ts +1 -0
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +8 -4
- package/dist/MarkdownEditor/editor/parser/parse/parseHtml.d.ts +5 -0
- package/dist/MarkdownEditor/editor/parser/parse/parseHtml.js +29 -3
- package/dist/MarkdownEditor/editor/style.js +7 -1
- package/dist/MarkdownEditor/style.js +7 -2
- package/dist/MarkdownEditor/utils/sanitizeChromeStyle.d.ts +6 -0
- package/dist/MarkdownEditor/utils/sanitizeChromeStyle.js +87 -0
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +12 -5
- package/dist/MarkdownInputField/FileMapView/style.js +1 -1
- package/dist/MarkdownInputField/MarkdownInputField.js +6 -3
- package/dist/MarkdownInputField/SendButton/index.js +48 -17
- package/dist/MarkdownInputField/SendButton/style.js +9 -6
- package/dist/MarkdownInputField/style.js +9 -3
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +4 -0
- package/dist/Plugins/code/components/AceEditor.js +12 -4
- package/dist/Plugins/code/components/CodeContainer.js +4 -4
- package/dist/ToolUseBar/style.js +3 -3
- package/dist/ToolUseBarThink/style.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
/** 停止图标外圈浅色盘(与发送按钮语义一致,可被 props 覆盖) */
|
|
3
|
+
export declare const STOP_ICON_DISK_FILL = "var(--color-gray-bg-card-white, var(--color-bg-container, #ffffff))";
|
|
4
|
+
/** 停止图标内圈晕环主色 */
|
|
5
|
+
export declare const STOP_ICON_HALO_FILL = "var(--color-primary-control-fill-primary, var(--color-primary, #1677ff))";
|
|
6
|
+
export type StopIconProps = React.SVGProps<SVGSVGElement> & {
|
|
7
|
+
/** 外圈浅色盘(默认语义 token,可被覆盖) */
|
|
8
|
+
diskFill?: string;
|
|
9
|
+
/** 半透明晕圈(默认主色 token) */
|
|
10
|
+
haloFill?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function StopIcon({ diskFill, haloFill, style, ...props }: StopIconProps): React.JSX.Element;
|
|
@@ -26,8 +26,51 @@ function _object_spread(target) {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
+
function _object_without_properties(source, excluded) {
|
|
30
|
+
if (source == null) return {};
|
|
31
|
+
var target = {}, sourceKeys, key, i;
|
|
32
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
33
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
34
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
35
|
+
key = sourceKeys[i];
|
|
36
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
37
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
38
|
+
target[key] = source[key];
|
|
39
|
+
}
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
target = _object_without_properties_loose(source, excluded);
|
|
43
|
+
if (Object.getOwnPropertySymbols) {
|
|
44
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
+
key = sourceKeys[i];
|
|
47
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
48
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
49
|
+
target[key] = source[key];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
function _object_without_properties_loose(source, excluded) {
|
|
55
|
+
if (source == null) return {};
|
|
56
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
57
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
58
|
+
key = sourceKeys[i];
|
|
59
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
61
|
+
target[key] = source[key];
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
29
65
|
import * as React from "react";
|
|
30
|
-
export
|
|
66
|
+
/** 停止图标外圈浅色盘(与发送按钮语义一致,可被 props 覆盖) */ export var STOP_ICON_DISK_FILL = 'var(--color-gray-bg-card-white, var(--color-bg-container, #ffffff))';
|
|
67
|
+
/** 停止图标内圈晕环主色 */ export var STOP_ICON_HALO_FILL = 'var(--color-primary-control-fill-primary, var(--color-primary, #1677ff))';
|
|
68
|
+
export function StopIcon(_0) {
|
|
69
|
+
var _0_diskFill = _0.diskFill, diskFill = _0_diskFill === void 0 ? STOP_ICON_DISK_FILL : _0_diskFill, _0_haloFill = _0.haloFill, haloFill = _0_haloFill === void 0 ? STOP_ICON_HALO_FILL : _0_haloFill, style = _0.style, props = _object_without_properties(_0, [
|
|
70
|
+
"diskFill",
|
|
71
|
+
"haloFill",
|
|
72
|
+
"style"
|
|
73
|
+
]);
|
|
31
74
|
return /*#__PURE__*/ React.createElement("svg", _object_spread({
|
|
32
75
|
xmlns: "http://www.w3.org/2000/svg",
|
|
33
76
|
fill: "none",
|
|
@@ -35,15 +78,18 @@ export function StopIcon(props) {
|
|
|
35
78
|
height: 32,
|
|
36
79
|
role: "img",
|
|
37
80
|
"aria-label": "StopIcon",
|
|
38
|
-
viewBox: "0 0 32 32"
|
|
81
|
+
viewBox: "0 0 32 32",
|
|
82
|
+
style: _object_spread({
|
|
83
|
+
color: haloFill
|
|
84
|
+
}, style)
|
|
39
85
|
}, props), /*#__PURE__*/ React.createElement("g", null, /*#__PURE__*/ React.createElement("g", null, /*#__PURE__*/ React.createElement("path", {
|
|
40
86
|
d: "M32,16Q32,16.3928,31.9807,16.7851Q31.9615,17.1774,31.923,17.5683Q31.8845,17.9592,31.8268,18.3477Q31.7692,18.7362,31.6926,19.1214Q31.6159,19.5067,31.5205,19.8877Q31.4251,20.2687,31.311,20.6446Q31.197,21.0204,31.0647,21.3902Q30.9324,21.7601,30.7821,22.1229Q30.6318,22.4858,30.4638,22.8409Q30.2959,23.1959,30.1107,23.5423Q29.9256,23.8887,29.7237,24.2256Q29.5217,24.5625,29.3035,24.8891Q29.0853,25.2157,28.8513,25.5312Q28.6173,25.8467,28.3682,26.1503Q28.119,26.4539,27.8552,26.7449Q27.5914,27.036,27.3137,27.3137Q27.036,27.5914,26.7449,27.8552Q26.4539,28.119,26.1503,28.3682Q25.8467,28.6173,25.5312,28.8513Q25.2157,29.0853,24.8891,29.3035Q24.5625,29.5217,24.2256,29.7237Q23.8887,29.9256,23.5423,30.1107Q23.1959,30.2959,22.8409,30.4638Q22.4858,30.6318,22.1229,30.7821Q21.7601,30.9324,21.3902,31.0647Q21.0204,31.197,20.6446,31.311Q20.2687,31.4251,19.8877,31.5205Q19.5067,31.6159,19.1214,31.6926Q18.7362,31.7692,18.3477,31.8268Q17.9592,31.8845,17.5683,31.923Q17.1774,31.9615,16.7851,31.9807Q16.3928,32,16,32Q15.6072,32,15.2149,31.9807Q14.8226,31.9615,14.4317,31.923Q14.0408,31.8845,13.6523,31.8268Q13.2638,31.7692,12.8786,31.6926Q12.4933,31.6159,12.1123,31.5205Q11.7313,31.4251,11.3554,31.311Q10.9796,31.197,10.6098,31.0647Q10.2399,30.9324,9.87706,30.7821Q9.51418,30.6318,9.15912,30.4638Q8.80405,30.2959,8.45765,30.1107Q8.11125,29.9256,7.77436,29.7237Q7.43746,29.5217,7.11088,29.3035Q6.78429,29.0853,6.46881,28.8513Q6.15333,28.6173,5.84971,28.3682Q5.54609,28.119,5.25506,27.8552Q4.96403,27.5914,4.68629,27.3137Q4.40856,27.036,4.14478,26.7449Q3.88101,26.4539,3.63183,26.1503Q3.38266,25.8467,3.14868,25.5312Q2.9147,25.2157,2.69649,24.8891Q2.47827,24.5625,2.27634,24.2256Q2.07441,23.8887,1.88926,23.5423Q1.70411,23.1959,1.53617,22.8409Q1.36824,22.4858,1.21793,22.1229Q1.06762,21.7601,0.935295,21.3902Q0.802972,21.0204,0.688955,20.6446Q0.574937,20.2687,0.4795,19.8877Q0.384063,19.5067,0.307435,19.1214Q0.230808,18.7362,0.173176,18.3477Q0.115543,17.9592,0.0770444,17.5683Q0.0385454,17.1774,0.0192727,16.7851Q0,16.3928,0,16Q0,15.6072,0.0192727,15.2149Q0.0385454,14.8226,0.0770444,14.4317Q0.115543,14.0408,0.173176,13.6523Q0.230808,13.2638,0.307435,12.8786Q0.384063,12.4933,0.4795,12.1123Q0.574937,11.7313,0.688955,11.3554Q0.802972,10.9796,0.935295,10.6098Q1.06762,10.2399,1.21793,9.87706Q1.36824,9.51418,1.53617,9.15912Q1.70411,8.80405,1.88926,8.45765Q2.07441,8.11125,2.27634,7.77436Q2.47827,7.43746,2.69649,7.11088Q2.9147,6.78429,3.14868,6.46881Q3.38266,6.15333,3.63183,5.84971Q3.88101,5.54609,4.14478,5.25506Q4.40856,4.96403,4.68629,4.68629Q4.96403,4.40856,5.25506,4.14478Q5.54609,3.88101,5.84971,3.63183Q6.15333,3.38266,6.46881,3.14868Q6.78429,2.9147,7.11088,2.69649Q7.43746,2.47827,7.77436,2.27634Q8.11125,2.07441,8.45765,1.88926Q8.80405,1.70411,9.15912,1.53617Q9.51418,1.36824,9.87706,1.21793Q10.2399,1.06762,10.6098,0.935295Q10.9796,0.802972,11.3554,0.688955Q11.7313,0.574937,12.1123,0.4795Q12.4933,0.384063,12.8786,0.307435Q13.2638,0.230808,13.6523,0.173176Q14.0408,0.115543,14.4317,0.0770444Q14.8226,0.0385454,15.2149,0.0192727Q15.6072,0,16,0Q16.3928,0,16.7851,0.0192727Q17.1774,0.0385454,17.5683,0.0770444Q17.9592,0.115543,18.3477,0.173176Q18.7362,0.230808,19.1214,0.307435Q19.5067,0.384063,19.8877,0.4795Q20.2687,0.574937,20.6446,0.688955Q21.0204,0.802972,21.3902,0.935295Q21.7601,1.06762,22.1229,1.21793Q22.4858,1.36824,22.8409,1.53617Q23.1959,1.70411,23.5423,1.88926Q23.8887,2.07441,24.2256,2.27634Q24.5625,2.47827,24.8891,2.69649Q25.2157,2.9147,25.5312,3.14868Q25.8467,3.38266,26.1503,3.63183Q26.4539,3.88101,26.7449,4.14478Q27.036,4.40856,27.3137,4.68629Q27.5914,4.96403,27.8552,5.25506Q28.119,5.54609,28.3682,5.84971Q28.6173,6.15333,28.8513,6.46881Q29.0853,6.78429,29.3035,7.11088Q29.5217,7.43746,29.7237,7.77436Q29.9256,8.11125,30.1107,8.45765Q30.2959,8.80405,30.4638,9.15912Q30.6318,9.51418,30.7821,9.87706Q30.9324,10.2399,31.0647,10.6098Q31.197,10.9796,31.311,11.3554Q31.4251,11.7313,31.5205,12.1123Q31.6159,12.4933,31.6926,12.8786Q31.7692,13.2638,31.8268,13.6523Q31.8845,14.0408,31.923,14.4317Q31.9615,14.8226,31.9807,15.2149Q32,15.6072,32,16Z",
|
|
41
|
-
fill:
|
|
87
|
+
fill: diskFill,
|
|
42
88
|
fillOpacity: "1"
|
|
43
89
|
}), /*#__PURE__*/ React.createElement("path", {
|
|
44
90
|
d: "M32,16Q32,16.3928,31.9807,16.7851Q31.9615,17.1774,31.923,17.5683Q31.8845,17.9592,31.8268,18.3477Q31.7692,18.7362,31.6926,19.1214Q31.6159,19.5067,31.5205,19.8877Q31.4251,20.2687,31.311,20.6446Q31.197,21.0204,31.0647,21.3902Q30.9324,21.7601,30.7821,22.1229Q30.6318,22.4858,30.4638,22.8409Q30.2959,23.1959,30.1107,23.5423Q29.9256,23.8887,29.7237,24.2256Q29.5217,24.5625,29.3035,24.8891Q29.0853,25.2157,28.8513,25.5312Q28.6173,25.8467,28.3682,26.1503Q28.119,26.4539,27.8552,26.7449Q27.5914,27.036,27.3137,27.3137Q27.036,27.5914,26.7449,27.8552Q26.4539,28.119,26.1503,28.3682Q25.8467,28.6173,25.5312,28.8513Q25.2157,29.0853,24.8891,29.3035Q24.5625,29.5217,24.2256,29.7237Q23.8887,29.9256,23.5423,30.1107Q23.1959,30.2959,22.8409,30.4638Q22.4858,30.6318,22.1229,30.7821Q21.7601,30.9324,21.3902,31.0647Q21.0204,31.197,20.6446,31.311Q20.2687,31.4251,19.8877,31.5205Q19.5067,31.6159,19.1214,31.6926Q18.7362,31.7692,18.3477,31.8268Q17.9592,31.8845,17.5683,31.923Q17.1774,31.9615,16.7851,31.9807Q16.3928,32,16,32Q15.6072,32,15.2149,31.9807Q14.8226,31.9615,14.4317,31.923Q14.0408,31.8845,13.6523,31.8268Q13.2638,31.7692,12.8786,31.6926Q12.4933,31.6159,12.1123,31.5205Q11.7313,31.4251,11.3554,31.311Q10.9796,31.197,10.6098,31.0647Q10.2399,30.9324,9.87706,30.7821Q9.51418,30.6318,9.15912,30.4638Q8.80405,30.2959,8.45765,30.1107Q8.11125,29.9256,7.77436,29.7237Q7.43746,29.5217,7.11088,29.3035Q6.78429,29.0853,6.46881,28.8513Q6.15333,28.6173,5.84971,28.3682Q5.54609,28.119,5.25506,27.8552Q4.96403,27.5914,4.68629,27.3137Q4.40856,27.036,4.14478,26.7449Q3.88101,26.4539,3.63183,26.1503Q3.38266,25.8467,3.14868,25.5312Q2.9147,25.2157,2.69649,24.8891Q2.47827,24.5625,2.27634,24.2256Q2.07441,23.8887,1.88926,23.5423Q1.70411,23.1959,1.53617,22.8409Q1.36824,22.4858,1.21793,22.1229Q1.06762,21.7601,0.935295,21.3902Q0.802972,21.0204,0.688955,20.6446Q0.574937,20.2687,0.4795,19.8877Q0.384063,19.5067,0.307435,19.1214Q0.230808,18.7362,0.173176,18.3477Q0.115543,17.9592,0.0770444,17.5683Q0.0385454,17.1774,0.0192727,16.7851Q0,16.3928,0,16Q0,15.6072,0.0192727,15.2149Q0.0385454,14.8226,0.0770444,14.4317Q0.115543,14.0408,0.173176,13.6523Q0.230808,13.2638,0.307435,12.8786Q0.384063,12.4933,0.4795,12.1123Q0.574937,11.7313,0.688955,11.3554Q0.802972,10.9796,0.935295,10.6098Q1.06762,10.2399,1.21793,9.87706Q1.36824,9.51418,1.53617,9.15912Q1.70411,8.80405,1.88926,8.45765Q2.07441,8.11125,2.27634,7.77436Q2.47827,7.43746,2.69649,7.11088Q2.9147,6.78429,3.14868,6.46881Q3.38266,6.15333,3.63183,5.84971Q3.88101,5.54609,4.14478,5.25506Q4.40856,4.96403,4.68629,4.68629Q4.96403,4.40856,5.25506,4.14478Q5.54609,3.88101,5.84971,3.63183Q6.15333,3.38266,6.46881,3.14868Q6.78429,2.9147,7.11088,2.69649Q7.43746,2.47827,7.77436,2.27634Q8.11125,2.07441,8.45765,1.88926Q8.80405,1.70411,9.15912,1.53617Q9.51418,1.36824,9.87706,1.21793Q10.2399,1.06762,10.6098,0.935295Q10.9796,0.802972,11.3554,0.688955Q11.7313,0.574937,12.1123,0.4795Q12.4933,0.384063,12.8786,0.307435Q13.2638,0.230808,13.6523,0.173176Q14.0408,0.115543,14.4317,0.0770444Q14.8226,0.0385454,15.2149,0.0192727Q15.6072,0,16,0Q16.3928,0,16.7851,0.0192727Q17.1774,0.0385454,17.5683,0.0770444Q17.9592,0.115543,18.3477,0.173176Q18.7362,0.230808,19.1214,0.307435Q19.5067,0.384063,19.8877,0.4795Q20.2687,0.574937,20.6446,0.688955Q21.0204,0.802972,21.3902,0.935295Q21.7601,1.06762,22.1229,1.21793Q22.4858,1.36824,22.8409,1.53617Q23.1959,1.70411,23.5423,1.88926Q23.8887,2.07441,24.2256,2.27634Q24.5625,2.47827,24.8891,2.69649Q25.2157,2.9147,25.5312,3.14868Q25.8467,3.38266,26.1503,3.63183Q26.4539,3.88101,26.7449,4.14478Q27.036,4.40856,27.3137,4.68629Q27.5914,4.96403,27.8552,5.25506Q28.119,5.54609,28.3682,5.84971Q28.6173,6.15333,28.8513,6.46881Q29.0853,6.78429,29.3035,7.11088Q29.5217,7.43746,29.7237,7.77436Q29.9256,8.11125,30.1107,8.45765Q30.2959,8.80405,30.4638,9.15912Q30.6318,9.51418,30.7821,9.87706Q30.9324,10.2399,31.0647,10.6098Q31.197,10.9796,31.311,11.3554Q31.4251,11.7313,31.5205,12.1123Q31.6159,12.4933,31.6926,12.8786Q31.7692,13.2638,31.8268,13.6523Q31.8845,14.0408,31.923,14.4317Q31.9615,14.8226,31.9807,15.2149Q32,15.6072,32,16ZM30,16Q30,15.6563,29.9831,15.3131Q29.9663,14.9698,29.9326,14.6278Q29.8989,14.2857,29.8485,13.9458Q29.798,13.6058,29.731,13.2687Q29.6639,12.9317,29.5804,12.5983Q29.4969,12.2649,29.3972,11.936Q29.2974,11.6071,29.1816,11.2835Q29.0658,10.96,28.9343,10.6424Q28.8028,10.3249,28.6558,10.0142Q28.5089,9.70354,28.3469,9.40044Q28.1849,9.09735,28.0082,8.80256Q27.8315,8.50778,27.6406,8.22202Q27.4496,7.93626,27.2449,7.66021Q27.0402,7.38416,26.8221,7.11849Q26.6041,6.85282,26.3733,6.59817Q26.1425,6.34352,25.8995,6.1005Q25.6565,5.85749,25.4018,5.62668Q25.1472,5.39588,24.8815,5.17785Q24.6158,4.95982,24.3398,4.75509Q24.0637,4.55036,23.778,4.35942Q23.4922,4.16849,23.1974,3.9918Q22.9027,3.81511,22.5996,3.6531Q22.2965,3.49109,21.9858,3.34415Q21.6751,3.19721,21.3576,3.06569Q21.04,2.93417,20.7165,2.81838Q20.3929,2.7026,20.064,2.60283Q19.7351,2.50307,19.4017,2.41956Q19.0683,2.33605,18.7313,2.26901Q18.3942,2.20196,18.0542,2.15153Q17.7143,2.1011,17.3722,2.06741Q17.0302,2.03373,16.6869,2.01686Q16.3437,2,16,2Q15.6563,2,15.3131,2.01686Q14.9698,2.03373,14.6278,2.06741Q14.2857,2.1011,13.9458,2.15153Q13.6058,2.20196,13.2687,2.26901Q12.9317,2.33605,12.5983,2.41956Q12.2649,2.50307,11.936,2.60284Q11.6071,2.7026,11.2835,2.81838Q10.96,2.93417,10.6424,3.06569Q10.3249,3.19721,10.0142,3.34415Q9.70354,3.49109,9.40044,3.6531Q9.09735,3.81511,8.80256,3.9918Q8.50778,4.16849,8.22202,4.35943Q7.93626,4.55036,7.66021,4.75509Q7.38416,4.95982,7.11849,5.17785Q6.85282,5.39588,6.59817,5.62668Q6.34352,5.85749,6.1005,6.1005Q5.85749,6.34352,5.62668,6.59817Q5.39588,6.85282,5.17785,7.11849Q4.95982,7.38416,4.75509,7.66021Q4.55036,7.93626,4.35942,8.22202Q4.16849,8.50778,3.9918,8.80256Q3.81511,9.09735,3.6531,9.40044Q3.49109,9.70354,3.34415,10.0142Q3.19721,10.3249,3.06569,10.6424Q2.93417,10.96,2.81838,11.2835Q2.7026,11.6071,2.60283,11.936Q2.50307,12.2649,2.41956,12.5983Q2.33605,12.9317,2.26901,13.2687Q2.20196,13.6058,2.15153,13.9458Q2.1011,14.2857,2.06741,14.6278Q2.03373,14.9698,2.01686,15.3131Q2,15.6563,2,16Q2,16.3437,2.01686,16.6869Q2.03373,17.0302,2.06741,17.3722Q2.1011,17.7143,2.15153,18.0542Q2.20196,18.3942,2.26901,18.7313Q2.33605,19.0683,2.41956,19.4017Q2.50307,19.7351,2.60283,20.064Q2.7026,20.3929,2.81838,20.7165Q2.93417,21.04,3.06569,21.3576Q3.19721,21.6751,3.34415,21.9858Q3.49109,22.2965,3.6531,22.5996Q3.81511,22.9027,3.9918,23.1974Q4.16849,23.4922,4.35943,23.778Q4.55036,24.0637,4.75509,24.3398Q4.95982,24.6158,5.17785,24.8815Q5.39588,25.1472,5.62668,25.4018Q5.85749,25.6565,6.1005,25.8995Q6.34352,26.1425,6.59817,26.3733Q6.85282,26.6041,7.11849,26.8221Q7.38416,27.0402,7.66021,27.2449Q7.93626,27.4496,8.22202,27.6406Q8.50778,27.8315,8.80256,28.0082Q9.09735,28.1849,9.40044,28.3469Q9.70354,28.5089,10.0142,28.6558Q10.3249,28.8028,10.6424,28.9343Q10.96,29.0658,11.2835,29.1816Q11.6071,29.2974,11.936,29.3972Q12.2649,29.4969,12.5983,29.5804Q12.9317,29.6639,13.2687,29.731Q13.6058,29.798,13.9458,29.8485Q14.2857,29.8989,14.6278,29.9326Q14.9698,29.9663,15.3131,29.9831Q15.6563,30,16,30Q16.3437,30,16.6869,29.9831Q17.0302,29.9663,17.3722,29.9326Q17.7143,29.8989,18.0542,29.8485Q18.3942,29.798,18.7313,29.731Q19.0683,29.6639,19.4017,29.5804Q19.7351,29.4969,20.064,29.3972Q20.3929,29.2974,20.7165,29.1816Q21.04,29.0658,21.3576,28.9343Q21.6751,28.8028,21.9858,28.6558Q22.2965,28.5089,22.5996,28.3469Q22.9027,28.1849,23.1974,28.0082Q23.4922,27.8315,23.778,27.6406Q24.0637,27.4496,24.3398,27.2449Q24.6158,27.0402,24.8815,26.8221Q25.1472,26.6041,25.4018,26.3733Q25.6565,26.1425,25.8995,25.8995Q26.1425,25.6565,26.3733,25.4018Q26.6041,25.1472,26.8221,24.8815Q27.0402,24.6158,27.2449,24.3398Q27.4496,24.0637,27.6406,23.778Q27.8315,23.4922,28.0082,23.1974Q28.1849,22.9027,28.3469,22.5996Q28.5089,22.2965,28.6558,21.9858Q28.8028,21.6751,28.9343,21.3576Q29.0658,21.04,29.1816,20.7165Q29.2974,20.3929,29.3972,20.064Q29.4969,19.7351,29.5804,19.4017Q29.6639,19.0683,29.731,18.7313Q29.798,18.3942,29.8485,18.0542Q29.8989,17.7143,29.9326,17.3722Q29.9663,17.0302,29.9831,16.6869Q30,16.3437,30,16Z",
|
|
45
91
|
fillRule: "evenodd",
|
|
46
|
-
fill:
|
|
92
|
+
fill: haloFill,
|
|
47
93
|
fillOpacity: "0.12939999997615814"
|
|
48
94
|
})), /*#__PURE__*/ React.createElement("g", null, /*#__PURE__*/ React.createElement("path", {
|
|
49
95
|
className: "stop-icon-ring",
|
|
@@ -124,11 +124,11 @@ var genStyle = function genStyle(token) {
|
|
|
124
124
|
backgroundColor: 'var(--color-green-control-fill-active)'
|
|
125
125
|
}
|
|
126
126
|
})), _define_property(_obj1, "".concat(token.componentCls, "-warning"), _define_property({
|
|
127
|
-
color: 'var(--color-yellow-text-secondary)',
|
|
128
|
-
backgroundColor: 'var(--color-yellow-bg-tip)',
|
|
127
|
+
color: 'var(--color-yellow-text-secondary, #ad6800)',
|
|
128
|
+
backgroundColor: 'var(--color-yellow-bg-tip, rgba(250, 173, 20, 0.08))',
|
|
129
129
|
boxShadow: 'none'
|
|
130
130
|
}, "".concat(token.componentCls, "-close-icon"), {
|
|
131
|
-
color: '
|
|
131
|
+
color: 'var(--color-yellow-text-secondary, #ad6800)',
|
|
132
132
|
'&:hover': {
|
|
133
133
|
backgroundColor: 'var(--color-yellow-control-fill-active)'
|
|
134
134
|
}
|
package/dist/Bubble/style.js
CHANGED
|
@@ -146,17 +146,20 @@ var genStyle = function genStyle(token, classNames) {
|
|
|
146
146
|
},
|
|
147
147
|
'&-standalone': {
|
|
148
148
|
maxWidth: 'min(860px,100%)'
|
|
149
|
-
},
|
|
150
|
-
'*': {
|
|
151
|
-
whiteSpace: 'pre-wrap',
|
|
152
|
-
textWrap: 'wrap',
|
|
153
|
-
wordWrap: 'break-word'
|
|
154
|
-
},
|
|
155
|
-
video: {
|
|
156
|
-
borderRadius: '12px',
|
|
157
|
-
overflow: 'auto'
|
|
158
149
|
}
|
|
159
|
-
},
|
|
150
|
+
}, // 换行仅作用于 Markdown 正文节点(不再对 bubble-content 使用 `*`)
|
|
151
|
+
_define_property(_obj, "& ".concat(token.antCls, '-agentic-md-editor-content div[data-be="paragraph"],\n & ').concat(token.antCls, "-agentic-md-editor-content h1,\n & ").concat(token.antCls, "-agentic-md-editor-content h2,\n & ").concat(token.antCls, "-agentic-md-editor-content h3,\n & ").concat(token.antCls, "-agentic-md-editor-content h4,\n & ").concat(token.antCls, "-agentic-md-editor-content h5,\n & ").concat(token.antCls, "-agentic-md-editor-content h6,\n & ").concat(token.antCls, "-agentic-md-editor-content li,\n & ").concat(token.antCls, "-agentic-md-editor-content blockquote"), {
|
|
152
|
+
whiteSpace: 'normal',
|
|
153
|
+
wordBreak: 'normal',
|
|
154
|
+
textWrap: 'wrap',
|
|
155
|
+
overflowWrap: 'break-word'
|
|
156
|
+
}), _define_property(_obj, "& ".concat(token.antCls, '-agentic-md-editor-content div[data-be="code"]'), {
|
|
157
|
+
whiteSpace: 'pre-wrap',
|
|
158
|
+
wordBreak: 'break-all'
|
|
159
|
+
}), _define_property(_obj, "video", {
|
|
160
|
+
borderRadius: '12px',
|
|
161
|
+
overflow: 'auto'
|
|
162
|
+
}), _define_property(_obj, "& ".concat(token.antCls, '-agentic-md-editor-content div[data-be="code"]'), {
|
|
160
163
|
borderRadius: '12px',
|
|
161
164
|
overflow: 'auto'
|
|
162
165
|
}), _define_property(_obj, 'div[data-be="paragraph"]', {
|
|
@@ -189,8 +192,8 @@ var genStyle = function genStyle(token, classNames) {
|
|
|
189
192
|
'&-bubble-content-right': (_obj1 = {
|
|
190
193
|
maxWidth: '75%',
|
|
191
194
|
borderRadius: '16px 16px 2px 16px',
|
|
192
|
-
background: 'var(--color-primary-control-fill-secondary-active)',
|
|
193
|
-
color: 'var(--color-gray-text-default)',
|
|
195
|
+
background: 'var(--color-primary-control-fill-tag, var(--color-primary-control-fill-secondary-active, rgba(230, 244, 255, 0.92)))',
|
|
196
|
+
color: 'var(--color-gray-text-default, rgba(20, 22, 28, 0.88))',
|
|
194
197
|
boxShadow: 'none'
|
|
195
198
|
}, // inline-code 基础规则用 code.cls(元素+类)选择器,需匹配相同结构才能覆盖
|
|
196
199
|
_define_property(_obj1, "& code".concat(token.antCls, "-agentic-md-editor-content-inline-code"), {
|
package/dist/ChatLayout/style.js
CHANGED
|
@@ -52,7 +52,7 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
import { MOBILE_BREAKPOINT, MOBILE_PADDING } from "../Constants/mobile";
|
|
54
54
|
import { resetComponent, useEditorStyleRegister } from "../Hooks/useStyle";
|
|
55
|
-
var RADIUS_XL = 'var(--radius-xl, var(--radius-card-lg, 16px))';
|
|
55
|
+
var RADIUS_XL = 'var(--radius-xl, var(--radius-chat-layout-footer, var(--radius-card-lg, 16px)))';
|
|
56
56
|
var COLOR_GRAY_BG_ACTIVE = 'var(--color-gray-bg-active, var(--color-gray-control-fill-active, rgba(20, 22, 28, 0.12)))';
|
|
57
57
|
var COLOR_GRAY_BORDER_DEFAULT = 'var(--color-gray-border-default, var(--color-gray-border-light, rgba(20, 22, 28, 0.12)))';
|
|
58
58
|
var genStyle = function genStyle(token) {
|
|
@@ -188,7 +188,7 @@ var genStyle = function genStyle(token) {
|
|
|
188
188
|
}
|
|
189
189
|
},
|
|
190
190
|
'> div': {
|
|
191
|
-
maxWidth: '
|
|
191
|
+
maxWidth: 'var(--agentic-chat-layout-content-max-width, 980px)',
|
|
192
192
|
margin: '0 auto'
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -206,7 +206,8 @@ var genStyle = function genStyle(token) {
|
|
|
206
206
|
bottom: 0,
|
|
207
207
|
zIndex: 100,
|
|
208
208
|
borderBottomLeftRadius: RADIUS_XL,
|
|
209
|
-
borderBottomRightRadius: RADIUS_XL
|
|
209
|
+
borderBottomRightRadius: RADIUS_XL,
|
|
210
|
+
'--radius-xl': '12px'
|
|
210
211
|
},
|
|
211
212
|
'&-footer-background': {
|
|
212
213
|
position: 'absolute',
|
|
@@ -63,7 +63,7 @@ var genStyle = function genStyle(token) {
|
|
|
63
63
|
gap: '12px',
|
|
64
64
|
justifyContent: 'space-between',
|
|
65
65
|
transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
|
|
66
|
-
backgroundColor: '#
|
|
66
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
67
67
|
boxShadow: 'var(--shadow-border-base)',
|
|
68
68
|
minHeight: 32,
|
|
69
69
|
'&-overflow-container': {
|
|
@@ -72,7 +72,7 @@ var genStyle = function genStyle(token) {
|
|
|
72
72
|
top: 0,
|
|
73
73
|
bottom: 0,
|
|
74
74
|
pointerEvents: 'none',
|
|
75
|
-
background:
|
|
75
|
+
background: "linear-gradient(to right, transparent 0%, var(--color-gray-bg-card-white, #ffffff) 100%)",
|
|
76
76
|
borderRadius: 12,
|
|
77
77
|
width: 72,
|
|
78
78
|
height: '100%',
|
|
@@ -120,18 +120,18 @@ var genStyle = function genStyle(token) {
|
|
|
120
120
|
backgroundImage: 'none'
|
|
121
121
|
},
|
|
122
122
|
'&-disabled': {
|
|
123
|
-
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
123
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
124
124
|
color: 'var(--color-gray-text-disabled)',
|
|
125
125
|
cursor: 'not-allowed',
|
|
126
126
|
backgroundImage: 'none',
|
|
127
127
|
boxShadow: 'var(--shadow-border-base)'
|
|
128
128
|
},
|
|
129
129
|
'&-disabled:hover': {
|
|
130
|
-
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
130
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
131
131
|
backgroundImage: 'none'
|
|
132
132
|
},
|
|
133
133
|
'&-disabled:active': {
|
|
134
|
-
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
134
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
135
135
|
backgroundImage: 'none'
|
|
136
136
|
},
|
|
137
137
|
'& svg': {
|
|
@@ -147,7 +147,7 @@ var genStyle = function genStyle(token) {
|
|
|
147
147
|
overscrollBehaviorY: 'contain',
|
|
148
148
|
touchAction: 'pan-y',
|
|
149
149
|
WebkitOverflowScrolling: 'touch',
|
|
150
|
-
background: 'var(--color-gray-bg-card-white)',
|
|
150
|
+
background: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
151
151
|
borderRadius: 'var(--radius-card-base)',
|
|
152
152
|
marginBottom: 8,
|
|
153
153
|
zIndex: 1000,
|
|
@@ -264,7 +264,7 @@ var genStyle = function genStyle(token) {
|
|
|
264
264
|
'&-container': {
|
|
265
265
|
borderRadius: 'var(--radius-control-base)',
|
|
266
266
|
position: 'relative',
|
|
267
|
-
backgroundColor: '#
|
|
267
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
268
268
|
alignItems: 'center',
|
|
269
269
|
width: '100%',
|
|
270
270
|
cursor: 'pointer',
|
|
@@ -317,19 +317,19 @@ var genStyle = function genStyle(token) {
|
|
|
317
317
|
backgroundImage: 'none'
|
|
318
318
|
}), // disabled state: base + suppress hover/active
|
|
319
319
|
_define_property(_obj2, '&-disabled', {
|
|
320
|
-
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
320
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
321
321
|
color: 'var(--color-gray-text-disabled)',
|
|
322
322
|
cursor: 'not-allowed',
|
|
323
323
|
backgroundImage: 'none'
|
|
324
324
|
}), _define_property(_obj2, '&-disabled:hover', {
|
|
325
|
-
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
325
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
326
326
|
backgroundImage: 'none'
|
|
327
327
|
}), _define_property(_obj2, '&-disabled:active', {
|
|
328
|
-
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
328
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
329
329
|
backgroundImage: 'none'
|
|
330
330
|
}), // when container is active but inner item is disabled, keep disabled bg
|
|
331
331
|
_define_property(_obj2, '&-container-hover-bg:active ' + token.componentCls + '-disabled', {
|
|
332
|
-
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
332
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
333
333
|
backgroundImage: 'none'
|
|
334
334
|
}), // disabled text color for inner content
|
|
335
335
|
_define_property(_obj2, "&-disabled ".concat(token.componentCls, "-content-title"), {
|
|
@@ -364,6 +364,8 @@ export declare function useLanguage(): {
|
|
|
364
364
|
'input.sendButtonTooltip.newline': string;
|
|
365
365
|
'input.sendButtonTooltip.send.mod': string;
|
|
366
366
|
'input.sendButtonTooltip.newline.mod': string;
|
|
367
|
+
'input.sendButtonAriaLabel.send': string;
|
|
368
|
+
'input.sendButtonAriaLabel.stop': string;
|
|
367
369
|
'input.typing.hint': string;
|
|
368
370
|
'common.name': string;
|
|
369
371
|
'common.updateTime': string;
|
package/dist/I18n/locales.d.ts
CHANGED
|
@@ -326,6 +326,8 @@ export declare const cnLabels: {
|
|
|
326
326
|
'input.sendButtonTooltip.newline': string;
|
|
327
327
|
'input.sendButtonTooltip.send.mod': string;
|
|
328
328
|
'input.sendButtonTooltip.newline.mod': string;
|
|
329
|
+
'input.sendButtonAriaLabel.send': string;
|
|
330
|
+
'input.sendButtonAriaLabel.stop': string;
|
|
329
331
|
'input.typing.hint': string;
|
|
330
332
|
'common.name': string;
|
|
331
333
|
'common.updateTime': string;
|
package/dist/I18n/locales.js
CHANGED
|
@@ -346,6 +346,8 @@
|
|
|
346
346
|
'input.sendButtonTooltip.newline': '按 Shift+Enter 键换行',
|
|
347
347
|
'input.sendButtonTooltip.send.mod': '按 Cmd/Ctrl+Enter 键发送',
|
|
348
348
|
'input.sendButtonTooltip.newline.mod': '按 Enter 键换行',
|
|
349
|
+
'input.sendButtonAriaLabel.send': '发送消息',
|
|
350
|
+
'input.sendButtonAriaLabel.stop': '停止生成',
|
|
349
351
|
'input.typing.hint': 'AI 正在回复中,请稍候...',
|
|
350
352
|
// Other translations
|
|
351
353
|
'common.name': '名称',
|
|
@@ -804,6 +806,8 @@
|
|
|
804
806
|
'input.sendButtonTooltip.newline': 'Press Shift+Enter for new line',
|
|
805
807
|
'input.sendButtonTooltip.send.mod': 'Press Cmd/Ctrl+Enter to send',
|
|
806
808
|
'input.sendButtonTooltip.newline.mod': 'Press Enter for new line',
|
|
809
|
+
'input.sendButtonAriaLabel.send': 'Send message',
|
|
810
|
+
'input.sendButtonAriaLabel.stop': 'Stop generating',
|
|
807
811
|
'input.typing.hint': 'AI is replying, please wait...',
|
|
808
812
|
// Other translations
|
|
809
813
|
'common.name': 'Name',
|
|
@@ -3,6 +3,7 @@ import { parserMdToSchema } from './editor/parser/parserMdToSchema';
|
|
|
3
3
|
import { EditorUtils } from './editor/utils/editorUtils';
|
|
4
4
|
import { MarkdownEditorProps } from './types';
|
|
5
5
|
export { EditorUtils, parserMdToSchema };
|
|
6
|
+
export { sanitizeEditorChromeStyle } from './utils/sanitizeChromeStyle';
|
|
6
7
|
export * from './editor/elements';
|
|
7
8
|
export * from './editor/utils';
|
|
8
9
|
export * from './el';
|
|
@@ -175,8 +175,10 @@ import { useSystemKeyboard } from "./editor/utils/keyboard";
|
|
|
175
175
|
import { PluginContext } from "./plugin";
|
|
176
176
|
import { useStyle } from "./style";
|
|
177
177
|
import { exportHtml } from "./utils/exportHtml";
|
|
178
|
+
import { sanitizeEditorChromeStyle } from "./utils/sanitizeChromeStyle";
|
|
178
179
|
// 原生表格功能已集成到编辑器中
|
|
179
180
|
export { EditorUtils, parserMdToSchema };
|
|
181
|
+
export { sanitizeEditorChromeStyle } from "./utils/sanitizeChromeStyle";
|
|
180
182
|
export * from "./editor/elements";
|
|
181
183
|
export * from "./editor/utils";
|
|
182
184
|
export * from "./el";
|
|
@@ -202,9 +204,9 @@ var I18nBoundary = function I18nBoundary(param) {
|
|
|
202
204
|
/** 基于 Slate.js 的 Markdown 编辑器核心组件,readonly + renderMode='markdown' 时走轻量 MarkdownRenderer */ export var BaseMarkdownEditor = function BaseMarkdownEditor(props) {
|
|
203
205
|
var _ref, _ref1, _props_streaming, _props_readonly;
|
|
204
206
|
var _props_jinja, _effectiveJinja_templatePanel, _props_floatBar, _props_floatBar1, _props_textAreaProps;
|
|
205
|
-
var initValue = props.initValue, width = props.width, _props_toolBar = props.toolBar, toolBar = _props_toolBar === void 0 ? {} : _props_toolBar, editorRef = props.editorRef, _props_toc = props.toc, toc = _props_toc === void 0 ? false : _props_toc, readonly = props.readonly, lazy = props.lazy,
|
|
207
|
+
var initValue = props.initValue, width = props.width, _props_toolBar = props.toolBar, toolBar = _props_toolBar === void 0 ? {} : _props_toolBar, editorRef = props.editorRef, _props_toc = props.toc, toc = _props_toc === void 0 ? false : _props_toc, readonly = props.readonly, lazy = props.lazy, rawStyle = props.style, tmp = props.contentStyle, rawContentStyle = tmp === void 0 ? {
|
|
206
208
|
height: '100%'
|
|
207
|
-
} :
|
|
209
|
+
} : tmp, editorStyle = props.editorStyle, height = props.height, children = props.children, renderMode = props.renderMode, renderType = props.renderType, rest = _object_without_properties(props, [
|
|
208
210
|
"initValue",
|
|
209
211
|
"width",
|
|
210
212
|
"toolBar",
|
|
@@ -220,6 +222,8 @@ var I18nBoundary = function I18nBoundary(param) {
|
|
|
220
222
|
"renderMode",
|
|
221
223
|
"renderType"
|
|
222
224
|
]);
|
|
225
|
+
var contentStyle = sanitizeEditorChromeStyle(rawContentStyle);
|
|
226
|
+
var rootStyle = sanitizeEditorChromeStyle(rawStyle);
|
|
223
227
|
var effectiveRenderMode = (_ref = renderMode !== null && renderMode !== void 0 ? renderMode : renderType) !== null && _ref !== void 0 ? _ref : 'slate';
|
|
224
228
|
// 是否挂载
|
|
225
229
|
var _useState = _sliced_to_array(useState(false), 2), editorMountStatus = _useState[0], setMountedStatus = _useState[1];
|
|
@@ -393,7 +397,7 @@ var I18nBoundary = function I18nBoundary(param) {
|
|
|
393
397
|
style: _object_spread({
|
|
394
398
|
width: width || '100%',
|
|
395
399
|
height: height || 'auto'
|
|
396
|
-
},
|
|
400
|
+
}, rootStyle),
|
|
397
401
|
ref: markdownContainerRef
|
|
398
402
|
}, /*#__PURE__*/ React.createElement(MarkdownRenderer, {
|
|
399
403
|
content: initValue || '',
|
|
@@ -452,7 +456,7 @@ var I18nBoundary = function I18nBoundary(param) {
|
|
|
452
456
|
style: _object_spread({
|
|
453
457
|
width: width || '100%',
|
|
454
458
|
height: height || 'auto'
|
|
455
|
-
},
|
|
459
|
+
}, rootStyle)
|
|
456
460
|
}, !readonly && (toolBar === null || toolBar === void 0 ? void 0 : toolBar.enable) === true ? /*#__PURE__*/ React.createElement("div", {
|
|
457
461
|
className: classNames("".concat(baseClassName, "-toolbar-container"), _define_property({}, "".concat(baseClassName, "-min-toolbar"), toolBar.min))
|
|
458
462
|
}, /*#__PURE__*/ React.createElement(ToolBar, {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 将成对的别名标签 `<think>`…`</think>` 归一为与 `preprocessSpecialTags(..., 'think')` 契约一致的规范标签。
|
|
3
|
+
* 否则 `preprocessThinkTags` 无法把思考区内的 ``` 围栏换成 【CODE_BLOCK】,内层 JSON 会变成顶层独立 code 节点。
|
|
4
|
+
*/
|
|
5
|
+
export declare function normalizeThinkTagAliases(markdown: string): string;
|
|
1
6
|
/**
|
|
2
7
|
* 解码 URI 组件,处理错误情况
|
|
3
8
|
*/
|
|
@@ -116,6 +116,30 @@ import json5 from "json5";
|
|
|
116
116
|
import { htmlToFragmentList } from "../../plugins/insertParsedHtmlNodes";
|
|
117
117
|
import { EditorUtils } from "../../utils";
|
|
118
118
|
import partialJsonParse from "../json-parse";
|
|
119
|
+
/**
|
|
120
|
+
* 规范标签名必须与 `preprocessSpecialTags(markdown, 'think')` 一致:该函数用 `<${tagName}>` / `</${tagName}>`,
|
|
121
|
+
* 即字面量 `<think>`…`</think>`,再包成 `` ```think ``。若此处改名须同步改 `parserSlateNodeToMarkdown` 里 think 序列化。
|
|
122
|
+
*/ var THINK_TAG_CANONICAL_OPEN = '<think>';
|
|
123
|
+
var THINK_TAG_CANONICAL_CLOSE = '</think>';
|
|
124
|
+
/** 部分模型输出的外壳别名;拼接避免与规范标签在源码中混淆 */ var REDACTED_THINKING_ALIAS_OPEN = '<' + 'redacted_' + 'thinking' + '>';
|
|
125
|
+
var REDACTED_THINKING_ALIAS_CLOSE = '</' + 'redacted_' + 'thinking' + '>';
|
|
126
|
+
var escapeRegExp = function escapeRegExp(value) {
|
|
127
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
128
|
+
};
|
|
129
|
+
/** 仅替换「成对」别名标签,避免正文里偶然出现的孤立字面量被误换 */ var REDACTED_THINKING_ALIAS_PAIR_REGEX = new RegExp("".concat(escapeRegExp(REDACTED_THINKING_ALIAS_OPEN), "([\\s\\S]*?)").concat(escapeRegExp(REDACTED_THINKING_ALIAS_CLOSE)), 'gi');
|
|
130
|
+
var FIND_THINK_CANONICAL_BLOCK_RE = new RegExp("^\\s*".concat(escapeRegExp(THINK_TAG_CANONICAL_OPEN), "([\\s\\S]*?)").concat(escapeRegExp(THINK_TAG_CANONICAL_CLOSE), "\\s*$"), 'i');
|
|
131
|
+
var FIND_THINK_ALIAS_BLOCK_RE = new RegExp("^\\s*".concat(escapeRegExp(REDACTED_THINKING_ALIAS_OPEN), "([\\s\\S]*?)").concat(escapeRegExp(REDACTED_THINKING_ALIAS_CLOSE), "\\s*$"), 'i');
|
|
132
|
+
/**
|
|
133
|
+
* 将成对的别名标签 `<think>`…`</think>` 归一为与 `preprocessSpecialTags(..., 'think')` 契约一致的规范标签。
|
|
134
|
+
* 否则 `preprocessThinkTags` 无法把思考区内的 ``` 围栏换成 【CODE_BLOCK】,内层 JSON 会变成顶层独立 code 节点。
|
|
135
|
+
*/ export function normalizeThinkTagAliases(markdown) {
|
|
136
|
+
if (!markdown || markdown.indexOf(REDACTED_THINKING_ALIAS_OPEN) === -1) {
|
|
137
|
+
return markdown;
|
|
138
|
+
}
|
|
139
|
+
return markdown.replace(REDACTED_THINKING_ALIAS_PAIR_REGEX, function(_match, inner) {
|
|
140
|
+
return "".concat(THINK_TAG_CANONICAL_OPEN).concat(inner).concat(THINK_TAG_CANONICAL_CLOSE);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
119
143
|
/**
|
|
120
144
|
* 解码 URI 组件,处理错误情况
|
|
121
145
|
*/ export var decodeURIComponentUrl = function decodeURIComponentUrl(url) {
|
|
@@ -132,8 +156,7 @@ import partialJsonParse from "../json-parse";
|
|
|
132
156
|
* @returns think 标签的内容,如果不是 think 标签则返回 null
|
|
133
157
|
*/ var findThinkElement = function findThinkElement(str) {
|
|
134
158
|
try {
|
|
135
|
-
|
|
136
|
-
var thinkMatch = str.match(/^\s*<think>([\s\S]*?)<\/think>\s*$/);
|
|
159
|
+
var thinkMatch = str.match(FIND_THINK_CANONICAL_BLOCK_RE) || str.match(FIND_THINK_ALIAS_BLOCK_RE);
|
|
137
160
|
if (thinkMatch) {
|
|
138
161
|
return {
|
|
139
162
|
content: thinkMatch[1].trim()
|
|
@@ -141,6 +164,9 @@ import partialJsonParse from "../json-parse";
|
|
|
141
164
|
}
|
|
142
165
|
return null;
|
|
143
166
|
} catch (e) {
|
|
167
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
168
|
+
console.warn('[parseHtml] findThinkElement failed', e);
|
|
169
|
+
}
|
|
144
170
|
return null;
|
|
145
171
|
}
|
|
146
172
|
};
|
|
@@ -833,7 +859,7 @@ import partialJsonParse from "../json-parse";
|
|
|
833
859
|
* @param markdown - 原始 Markdown 字符串
|
|
834
860
|
* @returns 处理后的 Markdown 字符串
|
|
835
861
|
*/ export function preprocessThinkTags(markdown) {
|
|
836
|
-
return preprocessSpecialTags(markdown, 'think');
|
|
862
|
+
return preprocessSpecialTags(normalizeThinkTagAliases(markdown), 'think');
|
|
837
863
|
}
|
|
838
864
|
/**
|
|
839
865
|
* 预处理所有非标准 HTML 标签,提取其内容(删除标签本身)
|
|
@@ -214,7 +214,7 @@ var genStyle = function genStyle(token) {
|
|
|
214
214
|
'&::before': {
|
|
215
215
|
cursor: 'text',
|
|
216
216
|
content: 'attr(data-slate-placeholder)',
|
|
217
|
-
color: 'rgba(
|
|
217
|
+
color: 'var(--color-gray-text-disabled, rgba(20, 22, 28, 0.25))',
|
|
218
218
|
display: 'inline-block',
|
|
219
219
|
position: 'absolute',
|
|
220
220
|
width: 'max-content',
|
|
@@ -235,6 +235,12 @@ var genStyle = function genStyle(token) {
|
|
|
235
235
|
}
|
|
236
236
|
}), _define_property(_obj, '&> *:first-child', {
|
|
237
237
|
marginTop: 0
|
|
238
|
+
}), _define_property(_obj, '* :not(div[data-be="paragraph"]):last-child', {
|
|
239
|
+
marginBottom: '0 !important'
|
|
240
|
+
}), _define_property(_obj, '* :not(div[data-be="paragraph"]):first-child', {
|
|
241
|
+
marginTop: '0 !important'
|
|
242
|
+
}), _define_property(_obj, '&-readonly', {
|
|
243
|
+
'--agentic-ui-table-cell-min-width': 'unset'
|
|
238
244
|
}), _define_property(_obj, '&-report', {
|
|
239
245
|
fontSize: '16px'
|
|
240
246
|
}), _define_property(_obj, '& > .link', {
|
|
@@ -311,6 +311,7 @@ var genTableStyle = function genTableStyle(token, mobileBreakpoint, mobilePaddin
|
|
|
311
311
|
var genStyle = function genStyle(token) {
|
|
312
312
|
var _obj, _obj1;
|
|
313
313
|
return _define_property({}, token.componentCls, _object_spread((_obj1 = {
|
|
314
|
+
'--agentic-ui-table-cell-padding': 'var(--agentic-ui-editor-table-cell-padding-default, 6px 8px)',
|
|
314
315
|
boxSizing: 'border-box',
|
|
315
316
|
height: 'max-content',
|
|
316
317
|
maxWidth: '100%',
|
|
@@ -366,7 +367,10 @@ var genStyle = function genStyle(token) {
|
|
|
366
367
|
}, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
|
|
367
368
|
padding: 'var(--agentic-ui-content-padding, 4px 4px)'
|
|
368
369
|
}),
|
|
369
|
-
'&-content': {
|
|
370
|
+
'&-content': {
|
|
371
|
+
'--margin-4x': 'var(--agentic-ui-editor-margin-4x, 6px)',
|
|
372
|
+
'--margin-2x': 'var(--agentic-ui-editor-margin-2x, 4px)'
|
|
373
|
+
},
|
|
370
374
|
'&-focus': {
|
|
371
375
|
height: 64
|
|
372
376
|
}
|
|
@@ -511,8 +515,9 @@ var genStyle = function genStyle(token) {
|
|
|
511
515
|
borderRadius: 'var(--radius-control-sm)',
|
|
512
516
|
background: 'var(--color-primary-bg-tip)',
|
|
513
517
|
'[data-tag-popup-input]': {
|
|
518
|
+
color: 'var(--color-primary-text-default, rgba(20, 22, 28, 0.88))',
|
|
514
519
|
'&:not([data-composition]).empty::before': {
|
|
515
|
-
color: 'var(--color-
|
|
520
|
+
color: 'var(--color-gray-text-light, rgba(80, 94, 119, 0.53))',
|
|
516
521
|
content: 'attr(title)',
|
|
517
522
|
userSelect: 'none',
|
|
518
523
|
position: 'absolute',
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
var PADDING_KEYS = [
|
|
30
|
+
'padding',
|
|
31
|
+
'paddingTop',
|
|
32
|
+
'paddingRight',
|
|
33
|
+
'paddingBottom',
|
|
34
|
+
'paddingLeft'
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* 清理会产生无效内联声明的样式值(如 `padding-top: ;`、`--foo: ;`)。
|
|
38
|
+
* 用于 BaseMarkdownEditor 根 `style` 与 `contentStyle`。
|
|
39
|
+
*/ export function sanitizeEditorChromeStyle(style) {
|
|
40
|
+
if (!style) return {};
|
|
41
|
+
var out = _object_spread({}, style);
|
|
42
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
43
|
+
try {
|
|
44
|
+
for(var _iterator = PADDING_KEYS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
45
|
+
var k = _step.value;
|
|
46
|
+
if (out[k] === '') {
|
|
47
|
+
delete out[k];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} catch (err) {
|
|
51
|
+
_didIteratorError = true;
|
|
52
|
+
_iteratorError = err;
|
|
53
|
+
} finally{
|
|
54
|
+
try {
|
|
55
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
56
|
+
_iterator.return();
|
|
57
|
+
}
|
|
58
|
+
} finally{
|
|
59
|
+
if (_didIteratorError) {
|
|
60
|
+
throw _iteratorError;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
65
|
+
try {
|
|
66
|
+
for(var _iterator1 = Object.keys(out)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
67
|
+
var key = _step1.value;
|
|
68
|
+
if (key.startsWith('--') && out[key] === '') {
|
|
69
|
+
delete out[key];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} catch (err) {
|
|
73
|
+
_didIteratorError1 = true;
|
|
74
|
+
_iteratorError1 = err;
|
|
75
|
+
} finally{
|
|
76
|
+
try {
|
|
77
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
78
|
+
_iterator1.return();
|
|
79
|
+
}
|
|
80
|
+
} finally{
|
|
81
|
+
if (_didIteratorError1) {
|
|
82
|
+
throw _iteratorError1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
@@ -207,10 +207,18 @@ var genStyle = function genStyle(token) {
|
|
|
207
207
|
display: 'flex',
|
|
208
208
|
alignItems: 'center',
|
|
209
209
|
gap: 4,
|
|
210
|
+
minWidth: 0,
|
|
211
|
+
maxWidth: '100%',
|
|
212
|
+
overflow: 'hidden',
|
|
213
|
+
whiteSpace: 'nowrap',
|
|
214
|
+
textOverflow: 'ellipsis',
|
|
210
215
|
'&-error': {
|
|
211
216
|
color: 'var(--color-red-a10)',
|
|
217
|
+
minWidth: 0,
|
|
212
218
|
maxWidth: '100%',
|
|
213
|
-
overflow: '
|
|
219
|
+
overflow: 'hidden',
|
|
220
|
+
whiteSpace: 'nowrap',
|
|
221
|
+
textOverflow: 'ellipsis'
|
|
214
222
|
},
|
|
215
223
|
'&-item:not(:last-child)': {
|
|
216
224
|
lineHeight: '9px',
|
|
@@ -263,16 +271,15 @@ var genStyle = function genStyle(token) {
|
|
|
263
271
|
}
|
|
264
272
|
},
|
|
265
273
|
'&-item-meta-placeholder': (_obj = {
|
|
266
|
-
background: 'var(--color-
|
|
274
|
+
background: 'var(--color-gray-bg-card-light, #f7f9fc) !important'
|
|
267
275
|
}, _define_property(_obj, "".concat(token.componentCls, "-item-file-name-text"), {
|
|
268
|
-
color: 'var(--color-text-
|
|
276
|
+
color: 'var(--color-gray-text-light, rgba(80, 94, 119, 0.53)) !important'
|
|
269
277
|
}), _define_property(_obj, "".concat(token.componentCls, "-item-file-size"), {
|
|
270
|
-
color: 'var(--color-text-
|
|
278
|
+
color: 'var(--color-gray-text-light, rgba(80, 94, 119, 0.53)) !important'
|
|
271
279
|
}), _obj)
|
|
272
280
|
}), _define_property(_obj1, "".concat(token.componentCls, "-container"), {
|
|
273
281
|
position: 'relative',
|
|
274
282
|
background: 'var(--color-gray-bg-page)',
|
|
275
|
-
borderBottom: '1px solid rgba(0, 16, 64, 0.0627)',
|
|
276
283
|
'&-empty': {
|
|
277
284
|
border: 'none'
|
|
278
285
|
}
|
|
@@ -211,6 +211,9 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
211
211
|
]);
|
|
212
212
|
var _ref;
|
|
213
213
|
var _props_skillMode, _props_enlargeable, _props_refinePrompt, _props_enlargeable1, _props_enlargeable2, _props_toolsRender;
|
|
214
|
+
var _ref1 = markdownProps !== null && markdownProps !== void 0 ? markdownProps : {}, markdownContentStyle = _ref1.contentStyle, markdownPropsRest = _object_without_properties(_ref1, [
|
|
215
|
+
"contentStyle"
|
|
216
|
+
]);
|
|
214
217
|
// 默认关闭文件上传,需显式传入 attachment.enable: true 开启
|
|
215
218
|
var attachment = _object_spread({}, DEFAULT_ATTACHMENT, props.attachment);
|
|
216
219
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
@@ -426,11 +429,11 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
426
429
|
enable: false
|
|
427
430
|
},
|
|
428
431
|
readonly: editorReadonly,
|
|
429
|
-
contentStyle: {
|
|
432
|
+
contentStyle: _object_spread({
|
|
430
433
|
alignItems: 'flex-start',
|
|
431
434
|
padding: 'var(--padding-3x)',
|
|
432
435
|
paddingRight: computedRightPadding || 'var(--padding-3x)'
|
|
433
|
-
},
|
|
436
|
+
}, markdownContentStyle),
|
|
434
437
|
textAreaProps: {
|
|
435
438
|
enable: true,
|
|
436
439
|
placeholder: props.placeholder
|
|
@@ -486,7 +489,7 @@ var MarkdownInputFieldComponent = function MarkdownInputFieldComponent(_0) {
|
|
|
486
489
|
],
|
|
487
490
|
plainTextOnly: true
|
|
488
491
|
}, props.pasteConfig)
|
|
489
|
-
},
|
|
492
|
+
}, markdownPropsRest), (props === null || props === void 0 ? void 0 : props.quickActionRender) || ((_props_refinePrompt = props.refinePrompt) === null || _props_refinePrompt === void 0 ? void 0 : _props_refinePrompt.enable) || ((_props_enlargeable1 = props.enlargeable) === null || _props_enlargeable1 === void 0 ? void 0 : _props_enlargeable1.enable) ? /*#__PURE__*/ React.createElement(QuickActions, {
|
|
490
493
|
ref: quickActionsRef,
|
|
491
494
|
value: value,
|
|
492
495
|
fileMap: fileMap,
|
|
@@ -26,6 +26,30 @@ function _object_spread(target) {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
29
53
|
function _object_without_properties(source, excluded) {
|
|
30
54
|
if (source == null) return {};
|
|
31
55
|
var target = {}, sourceKeys, key, i;
|
|
@@ -67,7 +91,7 @@ import classNames from "clsx";
|
|
|
67
91
|
import { motion } from "framer-motion";
|
|
68
92
|
import React, { useContext, useEffect } from "react";
|
|
69
93
|
import { ErrorBoundary } from "react-error-boundary";
|
|
70
|
-
import { StopIcon } from "../../AgentRunBar/icons";
|
|
94
|
+
import { STOP_ICON_DISK_FILL, STOP_ICON_HALO_FILL, StopIcon } from "../../AgentRunBar/icons";
|
|
71
95
|
import { I18nContext } from "../../I18n";
|
|
72
96
|
import { useStyle } from "./style";
|
|
73
97
|
/**
|
|
@@ -76,31 +100,30 @@ import { useStyle } from "./style";
|
|
|
76
100
|
var _ref;
|
|
77
101
|
return (_ref = sendButtonProps === null || sendButtonProps === void 0 ? void 0 : sendButtonProps.disabled) !== null && _ref !== void 0 ? _ref : fileUploadStatus === 'uploading';
|
|
78
102
|
}
|
|
79
|
-
var
|
|
80
|
-
icon: '#
|
|
81
|
-
iconHover: '#
|
|
82
|
-
background: '#
|
|
83
|
-
backgroundHover: '#
|
|
103
|
+
/** 未传入 `colors` 时使用 CSS 语义变量(与原先全局 SVG 覆盖一致) */ var SEND_BUTTON_THEME_COLORS = {
|
|
104
|
+
icon: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
105
|
+
iconHover: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
106
|
+
background: 'var(--color-primary-control-fill-primary, #1677ff)',
|
|
107
|
+
backgroundHover: 'var(--color-primary-control-fill-primary, #1677ff)'
|
|
84
108
|
};
|
|
85
109
|
function SendIcon(props) {
|
|
86
110
|
var _ref, _ref1, _ref2, _ref3;
|
|
87
|
-
var hover = props.hover, typing = props.typing,
|
|
111
|
+
var hover = props.hover, typing = props.typing, colors = props.colors, rest = _object_without_properties(props, [
|
|
88
112
|
"hover",
|
|
89
113
|
"typing",
|
|
90
|
-
"onInit",
|
|
91
114
|
"colors"
|
|
92
115
|
]);
|
|
93
|
-
useEffect(function() {
|
|
94
|
-
onInit === null || onInit === void 0 ? void 0 : onInit();
|
|
95
|
-
}, []);
|
|
96
116
|
if (typing) {
|
|
97
|
-
return /*#__PURE__*/ React.createElement(StopIcon, rest)
|
|
117
|
+
return /*#__PURE__*/ React.createElement(StopIcon, _object_spread_props(_object_spread({}, rest), {
|
|
118
|
+
diskFill: STOP_ICON_DISK_FILL,
|
|
119
|
+
haloFill: STOP_ICON_HALO_FILL
|
|
120
|
+
}));
|
|
98
121
|
}
|
|
99
122
|
var currentColors = {
|
|
100
|
-
icon: (_ref = colors === null || colors === void 0 ? void 0 : colors.icon) !== null && _ref !== void 0 ? _ref :
|
|
101
|
-
iconHover: (_ref1 = colors === null || colors === void 0 ? void 0 : colors.iconHover) !== null && _ref1 !== void 0 ? _ref1 :
|
|
102
|
-
background: (_ref2 = colors === null || colors === void 0 ? void 0 : colors.background) !== null && _ref2 !== void 0 ? _ref2 :
|
|
103
|
-
backgroundHover: (_ref3 = colors === null || colors === void 0 ? void 0 : colors.backgroundHover) !== null && _ref3 !== void 0 ? _ref3 :
|
|
123
|
+
icon: (_ref = colors === null || colors === void 0 ? void 0 : colors.icon) !== null && _ref !== void 0 ? _ref : SEND_BUTTON_THEME_COLORS.icon,
|
|
124
|
+
iconHover: (_ref1 = colors === null || colors === void 0 ? void 0 : colors.iconHover) !== null && _ref1 !== void 0 ? _ref1 : SEND_BUTTON_THEME_COLORS.iconHover,
|
|
125
|
+
background: (_ref2 = colors === null || colors === void 0 ? void 0 : colors.background) !== null && _ref2 !== void 0 ? _ref2 : SEND_BUTTON_THEME_COLORS.background,
|
|
126
|
+
backgroundHover: (_ref3 = colors === null || colors === void 0 ? void 0 : colors.backgroundHover) !== null && _ref3 !== void 0 ? _ref3 : SEND_BUTTON_THEME_COLORS.backgroundHover
|
|
104
127
|
};
|
|
105
128
|
return /*#__PURE__*/ React.createElement("svg", _object_spread({
|
|
106
129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -179,10 +202,13 @@ function SendIcon(props) {
|
|
|
179
202
|
* - 支持自定义颜色配置
|
|
180
203
|
* - 在SSR环境下不渲染
|
|
181
204
|
*/ export var SendButton = function SendButton(props) {
|
|
205
|
+
var _ref, _ref1;
|
|
182
206
|
var isSendable = props.isSendable, disabled = props.disabled, typing = props.typing, onClick = props.onClick, style = props.style, colors = props.colors, _props_triggerSendKey = props.triggerSendKey, triggerSendKey = _props_triggerSendKey === void 0 ? 'Enter' : _props_triggerSendKey;
|
|
183
207
|
useEffect(function() {
|
|
184
208
|
var _props_onInit;
|
|
185
209
|
(_props_onInit = props.onInit) === null || _props_onInit === void 0 ? void 0 : _props_onInit.call(props);
|
|
210
|
+
// 仅在挂载时触发一次,避免引用变化导致重复打点
|
|
211
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- onInit intentionally once on mount
|
|
186
212
|
}, []);
|
|
187
213
|
var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
|
|
188
214
|
var locale = useContext(I18nContext).locale;
|
|
@@ -200,6 +226,9 @@ function SendIcon(props) {
|
|
|
200
226
|
textAlign: 'left'
|
|
201
227
|
}
|
|
202
228
|
}, /*#__PURE__*/ React.createElement("div", null, sendText), /*#__PURE__*/ React.createElement("div", null, newlineText));
|
|
229
|
+
var ariaLabelSend = (_ref = locale === null || locale === void 0 ? void 0 : locale['input.sendButtonAriaLabel.send']) !== null && _ref !== void 0 ? _ref : '发送消息';
|
|
230
|
+
var ariaLabelStop = (_ref1 = locale === null || locale === void 0 ? void 0 : locale['input.sendButtonAriaLabel.stop']) !== null && _ref1 !== void 0 ? _ref1 : '停止生成';
|
|
231
|
+
var sendButtonAriaLabel = typing ? ariaLabelStop : ariaLabelSend;
|
|
203
232
|
var _obj;
|
|
204
233
|
return wrapSSR(/*#__PURE__*/ React.createElement(Tooltip, {
|
|
205
234
|
arrow: false,
|
|
@@ -207,6 +236,8 @@ function SendIcon(props) {
|
|
|
207
236
|
mouseEnterDelay: 0.5
|
|
208
237
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
209
238
|
"data-testid": "send-button",
|
|
239
|
+
"aria-label": sendButtonAriaLabel,
|
|
240
|
+
"aria-disabled": disabled ? true : undefined,
|
|
210
241
|
onClick: function onClick1() {
|
|
211
242
|
if (!disabled) {
|
|
212
243
|
onClick();
|
|
@@ -222,7 +253,7 @@ function SendIcon(props) {
|
|
|
222
253
|
}
|
|
223
254
|
},
|
|
224
255
|
style: style,
|
|
225
|
-
className: classNames(baseCls, hashId, (_obj = {}, _define_property(_obj, "".concat(baseCls, "-compact"), props.compact), _define_property(_obj, "".concat(baseCls, "-disabled"), disabled), _define_property(_obj, "".concat(baseCls, "-typing"), typing), _obj))
|
|
256
|
+
className: classNames(baseCls, hashId, (_obj = {}, _define_property(_obj, "".concat(baseCls, "-compact"), props.compact), _define_property(_obj, "".concat(baseCls, "-disabled"), disabled || !isSendable), _define_property(_obj, "".concat(baseCls, "-typing"), typing), _obj))
|
|
226
257
|
}, /*#__PURE__*/ React.createElement(ErrorBoundary, {
|
|
227
258
|
fallback: /*#__PURE__*/ React.createElement("div", null)
|
|
228
259
|
}, /*#__PURE__*/ React.createElement(SendIcon, {
|
|
@@ -62,7 +62,8 @@ var pauseIconRotate = new Keyframes('pauseIconRotate', {
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
var genStyle = function genStyle(token) {
|
|
65
|
-
|
|
65
|
+
var _obj;
|
|
66
|
+
return _obj = {}, _define_property(_obj, token.componentCls, {
|
|
66
67
|
fontSize: '32px',
|
|
67
68
|
height: 32,
|
|
68
69
|
display: 'flex',
|
|
@@ -70,10 +71,6 @@ var genStyle = function genStyle(token) {
|
|
|
70
71
|
lineHeight: '32px',
|
|
71
72
|
cursor: 'pointer',
|
|
72
73
|
marginLeft: 4,
|
|
73
|
-
'&&-disabled': {
|
|
74
|
-
cursor: 'not-allowed',
|
|
75
|
-
opacity: 1
|
|
76
|
-
},
|
|
77
74
|
// 旋转动画样式
|
|
78
75
|
'.pause-icon-ring': {
|
|
79
76
|
transition: 'transform 0.1s ',
|
|
@@ -83,7 +80,13 @@ var genStyle = function genStyle(token) {
|
|
|
83
80
|
animationTimingFunction: 'linear',
|
|
84
81
|
animationIterationCount: 'infinite'
|
|
85
82
|
}
|
|
86
|
-
})
|
|
83
|
+
}), // 使用完整 modifier 类名,避免嵌套 `&&-disabled` 与 BEM 类名拼接不一致导致 cursor 等未生效
|
|
84
|
+
_define_property(_obj, "".concat(token.componentCls, "-disabled"), {
|
|
85
|
+
cursor: 'not-allowed',
|
|
86
|
+
// 发送图标圆形 fill 使用 var(--color-primary-control-fill-primary),禁用时改为灰色语义
|
|
87
|
+
'--color-primary-control-fill-primary': '#8c8c8c',
|
|
88
|
+
'--color-gray-bg-card-white': 'black'
|
|
89
|
+
}), _obj;
|
|
87
90
|
};
|
|
88
91
|
/**
|
|
89
92
|
* Probubble
|
|
@@ -120,6 +120,7 @@ var genStyle = function genStyle(token) {
|
|
|
120
120
|
alignItems: 'center',
|
|
121
121
|
justifyContent: 'center',
|
|
122
122
|
padding: INPUT_FIELD_PADDING.NONE,
|
|
123
|
+
background: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
123
124
|
borderRadius: '12px',
|
|
124
125
|
minHeight: '48px',
|
|
125
126
|
maxWidth: 980,
|
|
@@ -158,7 +159,7 @@ var genStyle = function genStyle(token) {
|
|
|
158
159
|
boxSizing: 'border-box'
|
|
159
160
|
},
|
|
160
161
|
'&-content-wrapper': {
|
|
161
|
-
backgroundColor: '#
|
|
162
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
162
163
|
display: 'flex',
|
|
163
164
|
flexDirection: 'column',
|
|
164
165
|
width: '100%',
|
|
@@ -168,7 +169,7 @@ var genStyle = function genStyle(token) {
|
|
|
168
169
|
'&-editor': {
|
|
169
170
|
boxSizing: 'border-box',
|
|
170
171
|
borderRadius: 'inherit',
|
|
171
|
-
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
172
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
172
173
|
width: '100%',
|
|
173
174
|
zIndex: 9,
|
|
174
175
|
maxHeight: 400,
|
|
@@ -191,6 +192,10 @@ var genStyle = function genStyle(token) {
|
|
|
191
192
|
height: "".concat(DEFAULT_INPUT_CODE_BLOCK_HEIGHT, "px !important"),
|
|
192
193
|
minHeight: "".concat(DEFAULT_INPUT_CODE_BLOCK_HEIGHT, "px !important")
|
|
193
194
|
},
|
|
195
|
+
'& [data-be="code"]': {
|
|
196
|
+
background: 'var(--color-gray-bg-card-light, #f7f9fc) !important',
|
|
197
|
+
color: 'var(--color-gray-text-default, rgba(20, 22, 28, 0.88)) !important'
|
|
198
|
+
},
|
|
194
199
|
'&-editor-content': _define_property({
|
|
195
200
|
display: 'flex',
|
|
196
201
|
flexDirection: 'column',
|
|
@@ -249,7 +254,8 @@ var genStyle = function genStyle(token) {
|
|
|
249
254
|
borderRadius: 0
|
|
250
255
|
},
|
|
251
256
|
'&-tools-wrapper': _define_property({
|
|
252
|
-
|
|
257
|
+
height: '32px',
|
|
258
|
+
backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
|
|
253
259
|
display: 'flex',
|
|
254
260
|
boxSizing: 'border-box',
|
|
255
261
|
borderRadius: 0,
|
|
@@ -365,6 +365,8 @@ declare class ChartErrorBoundary extends React.Component<ChartErrorBoundaryProps
|
|
|
365
365
|
'input.sendButtonTooltip.newline': string;
|
|
366
366
|
'input.sendButtonTooltip.send.mod': string;
|
|
367
367
|
'input.sendButtonTooltip.newline.mod': string;
|
|
368
|
+
'input.sendButtonAriaLabel.send': string;
|
|
369
|
+
'input.sendButtonAriaLabel.stop': string;
|
|
368
370
|
'input.typing.hint': string;
|
|
369
371
|
'common.name': string;
|
|
370
372
|
'common.updateTime': string;
|
|
@@ -788,6 +790,8 @@ declare class ChartErrorBoundary extends React.Component<ChartErrorBoundaryProps
|
|
|
788
790
|
'input.sendButtonTooltip.newline': string;
|
|
789
791
|
'input.sendButtonTooltip.send.mod': string;
|
|
790
792
|
'input.sendButtonTooltip.newline.mod': string;
|
|
793
|
+
'input.sendButtonAriaLabel.send': string;
|
|
794
|
+
'input.sendButtonAriaLabel.stop': string;
|
|
791
795
|
'input.typing.hint': string;
|
|
792
796
|
'common.name': string;
|
|
793
797
|
'common.updateTime': string;
|
|
@@ -292,7 +292,7 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
292
292
|
"isSelected",
|
|
293
293
|
"onSelectionChange"
|
|
294
294
|
]);
|
|
295
|
-
var _editorProps_codeProps, _editorProps_codeProps1;
|
|
295
|
+
var _editorProps_codeProps, _element_otherProps, _editorProps_codeProps1;
|
|
296
296
|
var _useEditorStore = useEditorStore(), store = _useEditorStore.store, editorProps = _useEditorStore.editorProps, readonly = _useEditorStore.readonly;
|
|
297
297
|
// 各种引用
|
|
298
298
|
var codeRef = useRef(element.value || '');
|
|
@@ -498,11 +498,13 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
498
498
|
// element.language 同样不列为依赖,语言切换由独立的 effect 处理,避免流式渲染中 language
|
|
499
499
|
// 逐字符变化时触发编辑器销毁重建。
|
|
500
500
|
useEffect(function() {
|
|
501
|
+
var _element_otherProps;
|
|
501
502
|
if (process.env.NODE_ENV === 'test') return;
|
|
502
503
|
if (!aceLoaded || !aceModuleRef.current || !dom.current) return;
|
|
503
504
|
var codeProps = editorProps.codeProps || {};
|
|
504
505
|
var value = element.value || '';
|
|
505
|
-
|
|
506
|
+
var shouldFormatJsonInAce = element.language === 'json' && ((_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.finished) !== false;
|
|
507
|
+
if (shouldFormatJsonInAce) {
|
|
506
508
|
try {
|
|
507
509
|
value = JSON.stringify(partialParse(value), null, 2);
|
|
508
510
|
} catch (e) {}
|
|
@@ -611,8 +613,12 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
611
613
|
]);
|
|
612
614
|
// 监听外部值变化
|
|
613
615
|
useEffect(function() {
|
|
616
|
+
var _element_otherProps;
|
|
614
617
|
var value = element.value || '';
|
|
615
|
-
|
|
618
|
+
// 流式 JSON:partialParse + JSON.stringify 会随不完整结构变化而整块改写,
|
|
619
|
+
// 与 Slate 原文的 startsWith 关系断裂,反复 setValue 造成闪动;闭合后再格式化。
|
|
620
|
+
var shouldFormatJsonInAce = element.language === 'json' && ((_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.finished) !== false;
|
|
621
|
+
if (shouldFormatJsonInAce) {
|
|
616
622
|
try {
|
|
617
623
|
value = JSON.stringify(partialParse(value), null, 2);
|
|
618
624
|
} catch (e) {}
|
|
@@ -639,7 +645,9 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
639
645
|
editor.clearSelection();
|
|
640
646
|
}
|
|
641
647
|
}, [
|
|
642
|
-
element.value
|
|
648
|
+
element.value,
|
|
649
|
+
element.language,
|
|
650
|
+
(_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.finished
|
|
643
651
|
]);
|
|
644
652
|
// 监听主题变化
|
|
645
653
|
useEffect(function() {
|
|
@@ -34,10 +34,10 @@ export function CodeContainer(param) {
|
|
|
34
34
|
style: {
|
|
35
35
|
padding: hide ? 1 : 1,
|
|
36
36
|
marginBottom: hide ? 0 : undefined,
|
|
37
|
-
boxShadow: 'var(--shadow-control-base)',
|
|
38
|
-
borderRadius: 'var(--radius-card-base)',
|
|
39
|
-
backgroundColor: showBorder ? 'rgba(59, 130, 246, 0.1)' : hide ? 'transparent' : theme === 'chaos' ? 'var(--color-gray-text-default)' : '
|
|
40
|
-
color: theme === 'chaos' ? '#FFFFFF' : 'var(--color-gray-text-default)',
|
|
37
|
+
boxShadow: 'var(--shadow-control-base, 0 1px 2px rgba(20, 22, 28, 0.06))',
|
|
38
|
+
borderRadius: 'var(--radius-card-base, 12px)',
|
|
39
|
+
backgroundColor: showBorder ? 'rgba(59, 130, 246, 0.1)' : hide ? 'transparent' : theme === 'chaos' ? 'var(--color-gray-text-default, rgba(20, 22, 28, 0.88))' : 'var(--color-gray-bg-page-light, #fafafa)',
|
|
40
|
+
color: theme === 'chaos' ? '#FFFFFF' : 'var(--color-gray-text-default, rgba(20, 22, 28, 0.88))',
|
|
41
41
|
height: hide ? 0 : 'auto',
|
|
42
42
|
opacity: hide ? 0 : 1
|
|
43
43
|
},
|
package/dist/ToolUseBar/style.js
CHANGED
|
@@ -361,8 +361,8 @@ var genStyle = function genStyle(token) {
|
|
|
361
361
|
display: 'flex',
|
|
362
362
|
width: '100%',
|
|
363
363
|
borderRadius: 'var(--radius-control-base)',
|
|
364
|
-
background: 'var(--color-yellow-bg-tip)',
|
|
365
|
-
color: '#
|
|
364
|
+
background: 'var(--color-yellow-bg-tip, rgba(250, 173, 20, 0.08))',
|
|
365
|
+
color: 'var(--color-yellow-text-secondary, #ad6800)',
|
|
366
366
|
padding: '8px',
|
|
367
367
|
fontSize: 'var(--font-size-base)',
|
|
368
368
|
alignItems: 'center',
|
|
@@ -372,7 +372,7 @@ var genStyle = function genStyle(token) {
|
|
|
372
372
|
alignItems: 'center',
|
|
373
373
|
font: 'var(--font-text-body-emphasized-base)',
|
|
374
374
|
letterSpacing: 'var(--letter-spacing-body-emphasized-base, normal)',
|
|
375
|
-
color: 'var(--color-yellow-text-secondary)'
|
|
375
|
+
color: 'var(--color-yellow-text-secondary, #ad6800)'
|
|
376
376
|
},
|
|
377
377
|
'&-tool-error': {
|
|
378
378
|
'&-tool-image-wrapper': {
|