@ant-design/agentic-ui 2.31.3 → 2.31.5

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.
Files changed (60) hide show
  1. package/dist/AILabel/style.js +3 -3
  2. package/dist/AgenticLayout/style.js +1 -1
  3. package/dist/AnswerAlert/style.js +2 -2
  4. package/dist/Bubble/MessagesContent/VoiceButton/style.js +1 -1
  5. package/dist/Bubble/MessagesContent/index.js +2 -1
  6. package/dist/Bubble/MessagesContent/style.js +2 -2
  7. package/dist/Components/ActionIconBox/style.js +3 -3
  8. package/dist/Components/ActionItemBox/style.js +16 -16
  9. package/dist/Components/Button/IconButton/style.js +33 -33
  10. package/dist/Components/Button/ToggleButton/style.js +33 -33
  11. package/dist/Components/Loading/style.js +5 -5
  12. package/dist/Components/VisualList/style.js +5 -5
  13. package/dist/Components/lotties/TextLoading/style.js +2 -2
  14. package/dist/History/components/HistoryActionsBox.js +1 -1
  15. package/dist/History/hooks/useHistory.js +1 -1
  16. package/dist/History/index.js +2 -1
  17. package/dist/Hooks/useLanguage.d.ts +0 -1
  18. package/dist/I18n/locales.d.ts +0 -1
  19. package/dist/I18n/locales.js +0 -2
  20. package/dist/MarkdownEditor/editor/components/CommentList/style.js +3 -3
  21. package/dist/MarkdownEditor/editor/parser/parse/parseTable.js +2 -1
  22. package/dist/MarkdownEditor/editor/style.js +4 -4
  23. package/dist/MarkdownEditor/editor/utils/index.d.ts +1 -8
  24. package/dist/MarkdownEditor/editor/utils/index.js +3 -29
  25. package/dist/MarkdownEditor/editor/utils/markdownToHtml.js +2 -1
  26. package/dist/MarkdownEditor/editor/utils/sideEffects.d.ts +9 -0
  27. package/dist/MarkdownEditor/editor/utils/sideEffects.js +27 -0
  28. package/dist/MarkdownEditor/style.js +26 -26
  29. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +1 -1
  30. package/dist/MarkdownInputField/AttachmentButton/style.js +5 -5
  31. package/dist/MarkdownInputField/FileMapView/style.js +2 -2
  32. package/dist/MarkdownInputField/style.js +6 -6
  33. package/dist/MarkdownInputField/types/MarkdownInputFieldProps.d.ts +10 -0
  34. package/dist/MarkdownRenderer/markdownReactShared.js +2 -1
  35. package/dist/MarkdownRenderer/renderers/CodeRenderer.js +10 -17
  36. package/dist/Plugins/chart/ChartStatistic/style.js +9 -9
  37. package/dist/Plugins/chart/DonutChart/style.js +3 -3
  38. package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +0 -2
  39. package/dist/Plugins/chart/components/ChartContainer/style.js +3 -3
  40. package/dist/Plugins/chart/components/ChartFilter/style.js +22 -22
  41. package/dist/Plugins/chart/components/ChartToolBar/style.js +4 -4
  42. package/dist/Plugins/code/components/CodeContainer.d.ts +1 -2
  43. package/dist/Plugins/code/components/CodeContainer.js +3 -3
  44. package/dist/Plugins/code/components/CodeRenderer.js +8 -7
  45. package/dist/Plugins/code/components/CodeToolbar.d.ts +0 -1
  46. package/dist/Plugins/code/components/CodeToolbar.js +7 -13
  47. package/dist/Schema/SchemaEditor/style.js +26 -26
  48. package/dist/TaskList/TaskList.js +2 -1
  49. package/dist/ThoughtChainList/TableSql.js +1 -1
  50. package/dist/ThoughtChainList/TitleInfo.js +1 -1
  51. package/dist/ThoughtChainList/ToolCall.js +1 -1
  52. package/dist/ThoughtChainList/style.js +5 -5
  53. package/dist/ToolUseBar/style.js +8 -8
  54. package/dist/ToolUseBarThink/style.js +1 -1
  55. package/dist/Utils/rehypeSanitizeUserHtml.d.ts +11 -0
  56. package/dist/Utils/rehypeSanitizeUserHtml.js +182 -0
  57. package/dist/Workspace/RealtimeFollow/style.js +11 -11
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +1 -1
  60. package/package.json +5 -2
@@ -57,7 +57,7 @@ var genStyle = function genStyle(token) {
57
57
  _define_property(_obj1, "".concat(token.componentCls), {
58
58
  display: 'flex',
59
59
  flexDirection: 'column',
60
- background: '#ffffff',
60
+ background: 'var(--color-gray-bg-card-white)',
61
61
  borderRadius: '8px',
62
62
  overflow: 'hidden',
63
63
  fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'
@@ -65,7 +65,7 @@ var genStyle = function genStyle(token) {
65
65
  display: 'flex',
66
66
  flex: 1,
67
67
  gap: '4px',
68
- background: '#FDFEFF',
68
+ background: 'var(--color-gray-bg-page-light)',
69
69
  minHeight: 0
70
70
  }), _define_property(_obj1, "".concat(token.componentCls, "-left"), {
71
71
  display: 'flex',
@@ -89,7 +89,7 @@ var genStyle = function genStyle(token) {
89
89
  flexDirection: 'column',
90
90
  gap: '8px',
91
91
  padding: '12px',
92
- background: '#FDFEFF',
92
+ background: 'var(--color-gray-bg-page-light)',
93
93
  border: '1px solid rgba(9, 30, 66, 0.07)',
94
94
  borderRadius: '8px'
95
95
  }), _define_property(_obj1, "".concat(token.componentCls, "-html-header"), {
@@ -100,14 +100,14 @@ var genStyle = function genStyle(token) {
100
100
  margin: 0,
101
101
  fontSize: 'var(--font-size-base)',
102
102
  fontWeight: 600,
103
- color: '#495057'
103
+ color: 'var(--color-gray-text-default)'
104
104
  }), _define_property(_obj1, "".concat(token.componentCls, "-html-header button"), {
105
105
  display: 'flex',
106
106
  alignItems: 'center',
107
107
  gap: '4px',
108
108
  padding: '3px 8px',
109
109
  fontSize: 'var(--font-size-sm)',
110
- color: '#626F86'
110
+ color: 'var(--color-gray-text-secondary)'
111
111
  }), _define_property(_obj1, "".concat(token.componentCls, "-html-content"), {
112
112
  flex: 1,
113
113
  minHeight: 0,
@@ -122,7 +122,7 @@ var genStyle = function genStyle(token) {
122
122
  flexDirection: 'column',
123
123
  gap: '8px',
124
124
  padding: '12px',
125
- background: '#FDFEFF',
125
+ background: 'var(--color-gray-bg-page-light)',
126
126
  border: '1px solid rgba(9, 30, 66, 0.07)',
127
127
  borderRadius: '8px'
128
128
  }), _define_property(_obj1, "".concat(token.componentCls, "-json-header"), {
@@ -133,14 +133,14 @@ var genStyle = function genStyle(token) {
133
133
  margin: 0,
134
134
  fontSize: 'var(--font-size-base)',
135
135
  fontWeight: 600,
136
- color: '#495057'
136
+ color: 'var(--color-gray-text-default)'
137
137
  }), _define_property(_obj1, "".concat(token.componentCls, "-json-header button"), {
138
138
  display: 'flex',
139
139
  alignItems: 'center',
140
140
  gap: '4px',
141
141
  padding: '3px 8px',
142
142
  fontSize: 'var(--font-size-sm)',
143
- color: '#626F86'
143
+ color: 'var(--color-gray-text-secondary)'
144
144
  }), _define_property(_obj1, "".concat(token.componentCls, "-json-content"), {
145
145
  flex: 1,
146
146
  minHeight: 0,
@@ -156,7 +156,7 @@ var genStyle = function genStyle(token) {
156
156
  minHeight: 0,
157
157
  border: '1px solid rgba(9, 30, 66, 0.07)',
158
158
  borderRadius: '8px',
159
- background: '#fff',
159
+ background: 'var(--color-gray-bg-card-white)',
160
160
  boxShadow: '0px 1.5px 2px -1px rgba(0, 19, 41, 0.07)'
161
161
  }), _define_property(_obj1, "".concat(token.componentCls, "-preview-header"), {
162
162
  padding: '12px',
@@ -167,14 +167,14 @@ var genStyle = function genStyle(token) {
167
167
  margin: 0,
168
168
  fontSize: 'var(--font-size-base)',
169
169
  fontWeight: 600,
170
- color: '#2c3e5d'
170
+ color: 'var(--color-gray-text-default)'
171
171
  }), _define_property(_obj1, "".concat(token.componentCls, "-error"), {
172
- background: '#fff5f5',
173
- border: '1px solid #fed7d7',
172
+ background: 'var(--color-red-bg-page-light)',
173
+ border: '1px solid var(--color-red-border-light)',
174
174
  borderRadius: '4px',
175
175
  padding: '8px 12px',
176
176
  fontSize: 'var(--font-size-sm)',
177
- color: '#c53030',
177
+ color: 'var(--color-red-text-default)',
178
178
  maxWidth: '300px',
179
179
  wordBreak: 'break-word'
180
180
  }), _define_property(_obj1, "".concat(token.componentCls, "-preview-content"), {
@@ -184,7 +184,7 @@ var genStyle = function genStyle(token) {
184
184
  flex: 1,
185
185
  padding: '16px',
186
186
  overflow: 'auto',
187
- background: '#ffffff',
187
+ background: 'var(--color-gray-bg-card-white)',
188
188
  borderRadius: '0 0 8px 8px'
189
189
  }), _define_property(_obj1, "".concat(token.componentCls, "-preview-content-empty"), {
190
190
  display: 'flex',
@@ -194,14 +194,14 @@ var genStyle = function genStyle(token) {
194
194
  }), _define_property(_obj1, "".concat(token.componentCls, "-preview-content-empty p"), {
195
195
  fontSize: 'var(--font-size-base)',
196
196
  textAlign: 'center',
197
- color: '#8590A2'
197
+ color: 'var(--color-gray-text-light)'
198
198
  }), _define_property(_obj1, "".concat(token.componentCls, "-fallback"), {
199
199
  display: 'flex',
200
200
  flexDirection: 'column',
201
201
  alignItems: 'center',
202
202
  justifyContent: 'center',
203
203
  height: '100%',
204
- color: '#6c757d',
204
+ color: 'var(--color-gray-text-secondary)',
205
205
  textAlign: 'center'
206
206
  }), _define_property(_obj1, "".concat(token.componentCls, "-fallback p"), {
207
207
  margin: '4px 0',
@@ -211,41 +211,41 @@ var genStyle = function genStyle(token) {
211
211
  flexDirection: 'column'
212
212
  }), _define_property(_obj, "".concat(token.componentCls, "-left"), {
213
213
  borderRight: 'none',
214
- borderBottom: '1px solid #e1e5e9'
214
+ borderBottom: '1px solid var(--color-gray-border-light)'
215
215
  }), _define_property(_obj, "".concat(token.componentCls, "-html, ").concat(token.componentCls, "-json"), {
216
216
  minHeight: '200px'
217
217
  }), _obj)), // 滚动条样式
218
218
  _define_property(_obj1, "".concat(token.componentCls, "-preview-content::-webkit-scrollbar"), {
219
219
  width: '6px'
220
220
  }), _define_property(_obj1, "".concat(token.componentCls, "-preview-content::-webkit-scrollbar-track"), {
221
- background: '#f1f1f1',
221
+ background: 'var(--color-gray-control-fill-secondary)',
222
222
  borderRadius: '3px'
223
223
  }), _define_property(_obj1, "".concat(token.componentCls, "-preview-content::-webkit-scrollbar-thumb"), {
224
- background: '#c1c1c1',
224
+ background: 'var(--color-gray-text-light)',
225
225
  borderRadius: '3px'
226
226
  }), _define_property(_obj1, "".concat(token.componentCls, "-preview-content::-webkit-scrollbar-thumb:hover"), {
227
- background: '#a8a8a8'
227
+ background: 'var(--color-gray-text-secondary)'
228
228
  }), // 编辑器主题适配
229
229
  _define_property(_obj1, "".concat(token.componentCls, " .ace_editor"), {
230
230
  borderRadius: '8px',
231
231
  background: 'rgba(9, 30, 66, 0.03)',
232
- color: '#343a45'
232
+ color: 'var(--color-gray-text-default)'
233
233
  }), _define_property(_obj1, "".concat(token.componentCls, " .ace_editor.ace_dark"), {
234
- background: '#2d3748',
235
- color: '#e2e8f0'
234
+ background: 'var(--color-gray-bg-page-dark)',
235
+ color: 'var(--color-gray-text-light)'
236
236
  }), // 加载状态
237
237
  _define_property(_obj1, "".concat(token.componentCls, "-loading"), {
238
238
  display: 'flex',
239
239
  alignItems: 'center',
240
240
  justifyContent: 'center',
241
241
  height: '100%',
242
- color: '#6c757d'
242
+ color: 'var(--color-gray-text-secondary)'
243
243
  }), _define_property(_obj1, "".concat(token.componentCls, "-loading::after"), {
244
244
  content: "''",
245
245
  width: '20px',
246
246
  height: '20px',
247
- border: '2px solid #e1e5e9',
248
- borderTop: '2px solid #3182ce',
247
+ border: '2px solid var(--color-gray-border-light)',
248
+ borderTop: '2px solid var(--color-primary-control-fill-primary)',
249
249
  borderRadius: '50%',
250
250
  animationName: 'spin',
251
251
  animationDuration: '1s',
@@ -157,7 +157,8 @@ export var TaskList = /*#__PURE__*/ memo(function(param) {
157
157
  text = tpl.replace('${taskName}', taskName);
158
158
  } else if (hasError) {
159
159
  status = 'error';
160
- text = (locale === null || locale === void 0 ? void 0 : locale['taskList.taskAborted']) || '任务已取消';
160
+ var tpl1 = (locale === null || locale === void 0 ? void 0 : locale['taskList.taskInProgress']) || '正在进行任务';
161
+ text = tpl1.replace('${taskName}', '');
161
162
  }
162
163
  return {
163
164
  summaryStatus: status,
@@ -102,7 +102,7 @@ import { Button, Table, Typography } from "antd";
102
102
  import copy from "copy-to-clipboard";
103
103
  import React, { useContext, useMemo } from "react";
104
104
  import { I18nContext } from "../I18n";
105
- import { ActionIconBox } from "../index";
105
+ import { ActionIconBox } from "../Components/ActionIconBox";
106
106
  import { MarkdownEditor, parserSlateNodeToMarkdown } from "../MarkdownEditor";
107
107
  import { CostMillis } from "./CostMillis";
108
108
  /**
@@ -4,7 +4,7 @@ import classNames from "clsx";
4
4
  import { motion } from "framer-motion";
5
5
  import React, { useContext, useMemo } from "react";
6
6
  import { I18nContext } from "../I18n";
7
- import { ActionIconBox } from "../index";
7
+ import { ActionIconBox } from "../Components/ActionIconBox";
8
8
  import { CostMillis } from "./CostMillis";
9
9
  import { FlipText } from "./FlipText";
10
10
  /**
@@ -102,7 +102,7 @@ import { Button, Typography } from "antd";
102
102
  import copy from "copy-to-clipboard";
103
103
  import React, { useContext, useMemo } from "react";
104
104
  import { I18nContext } from "../I18n";
105
- import { ActionIconBox } from "../index";
105
+ import { ActionIconBox } from "../Components/ActionIconBox";
106
106
  import { MarkdownEditor, parserSlateNodeToMarkdown } from "../MarkdownEditor";
107
107
  import { CostMillis } from "./CostMillis";
108
108
  import { DotLoading } from "./DotAni";
@@ -128,7 +128,7 @@ var genStyle = function genStyle(token) {
128
128
  '&-icon': {
129
129
  width: 15,
130
130
  height: 15,
131
- color: token.colorSuccess || '#0CE0AD'
131
+ color: 'var(--color-green-text-default)'
132
132
  },
133
133
  '&&-collapse': {
134
134
  borderRadius: '6px 12px 12px 12px'
@@ -162,7 +162,7 @@ var genStyle = function genStyle(token) {
162
162
  }
163
163
  },
164
164
  '&-content-wrapper': {
165
- backgroundColor: token.colorBgContainer || '#FFF',
165
+ backgroundColor: 'var(--color-gray-bg-card-white)',
166
166
  position: 'relative',
167
167
  borderRadius: '6px 12px 12px 12px',
168
168
  zIndex: 9
@@ -209,7 +209,7 @@ var genStyle = function genStyle(token) {
209
209
  }),
210
210
  '& code[class*="language-"], pre[class*="language-"]': {
211
211
  whiteSpace: 'break-spaces!important',
212
- color: 'rgb(102, 111, 141)',
212
+ color: 'var(--color-gray-a9)',
213
213
  fontFamily: 'SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Segoe UI-MONOSPACE'
214
214
  },
215
215
  '&-info': {
@@ -227,7 +227,7 @@ var genStyle = function genStyle(token) {
227
227
  flexWrap: 'wrap',
228
228
  '&-tag': {
229
229
  padding: '0px 6px',
230
- background: 'radial-gradient(22% 66% at 96% 113%, rgba(255, 255, 245, 0.52) 0%, rgba(230, 238, 255, 0) 100%), radial-gradient(14% 234% at 100% 50%, rgba(162, 255, 255, 0.28) 0%, rgba(153, 202, 255, 0.1193) 13%, rgba(229, 189, 255, 0.0826) 38%, rgba(235, 255, 245, 0) 100%), #FFFFFF',
230
+ background: 'radial-gradient(22% 66% at 96% 113%, rgba(255, 255, 245, 0.52) 0%, rgba(230, 238, 255, 0) 100%), radial-gradient(14% 234% at 100% 50%, rgba(162, 255, 255, 0.28) 0%, rgba(153, 202, 255, 0.1193) 13%, rgba(229, 189, 255, 0.0826) 38%, rgba(235, 255, 245, 0) 100%), var(--color-gray-bg-card-white)',
231
231
  border: '1px solid rgba(227, 230, 234, 0.65)',
232
232
  lineHeight: '26px'
233
233
  },
@@ -248,7 +248,7 @@ var genStyle = function genStyle(token) {
248
248
  lineHeight: '2em',
249
249
  flexWrap: 'wrap',
250
250
  letterSpacing: '0px',
251
- color: 'rgba(0, 0, 0, 0.85)'
251
+ color: 'var(--color-gray-text-default)'
252
252
  },
253
253
  '&-action': {
254
254
  opacity: 0,
@@ -179,7 +179,7 @@ var genStyle = function genStyle(token) {
179
179
  cursor: 'pointer',
180
180
  transition: 'all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)',
181
181
  '&:hover': {
182
- color: '#959DA8'
182
+ color: 'var(--color-gray-text-light)'
183
183
  }
184
184
  },
185
185
  '&-tool-name': {
@@ -193,7 +193,7 @@ var genStyle = function genStyle(token) {
193
193
  lineClamp: 1,
194
194
  '&-loading': {
195
195
  position: 'relative',
196
- color: '#000'
196
+ color: 'var(--color-gray-text-default)'
197
197
  }
198
198
  },
199
199
  '&-tool-image-wrapper': {
@@ -279,7 +279,7 @@ var genStyle = function genStyle(token) {
279
279
  },
280
280
  '&-loading': {
281
281
  position: 'relative',
282
- color: '#000'
282
+ color: 'var(--color-gray-text-default)'
283
283
  }
284
284
  },
285
285
  '&-tool-time-expand': {
@@ -299,7 +299,7 @@ var genStyle = function genStyle(token) {
299
299
  borderRadius: '12px',
300
300
  background: 'var(--color-gray-control-fill-active)',
301
301
  padding: '4px 6px',
302
- color: '#767E8B',
302
+ color: 'var(--color-gray-text-secondary)',
303
303
  gap: '8px',
304
304
  zIndex: 1
305
305
  },
@@ -336,7 +336,7 @@ var genStyle = function genStyle(token) {
336
336
  fontWeight: 'normal',
337
337
  lineHeight: '160%',
338
338
  letterSpacing: 'normal',
339
- color: '#767E8B'
339
+ color: 'var(--color-gray-text-secondary)'
340
340
  },
341
341
  '&-tool-content-expand': {
342
342
  display: 'flex',
@@ -362,7 +362,7 @@ var genStyle = function genStyle(token) {
362
362
  width: '100%',
363
363
  borderRadius: 'var(--radius-control-base)',
364
364
  background: 'var(--color-yellow-bg-tip, rgba(250, 173, 20, 0.08))',
365
- color: 'var(--color-yellow-text-secondary, #ad6800)',
365
+ color: 'var(--color-yellow-text-secondary)',
366
366
  padding: '8px',
367
367
  fontSize: 'var(--font-size-base)',
368
368
  alignItems: 'center',
@@ -372,12 +372,12 @@ 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, #ad6800)'
375
+ color: 'var(--color-yellow-text-secondary)'
376
376
  },
377
377
  '&-tool-error': {
378
378
  '&-tool-image-wrapper': {
379
379
  '& .anticon': {
380
- color: '#F15B50'
380
+ color: 'var(--color-red-text-default)'
381
381
  }
382
382
  }
383
383
  }
@@ -211,7 +211,7 @@ var genStyle = function genStyle(token) {
211
211
  background: 'var(--color-gray-bg-card-white)',
212
212
  zIndex: 0,
213
213
  position: 'relative',
214
- color: '#767E8B',
214
+ color: 'var(--color-gray-text-secondary)',
215
215
  fontSize: 'var(--font-size-lg)',
216
216
  '& > svg, & > *:first-child': {
217
217
  position: 'relative',
@@ -0,0 +1,11 @@
1
+ /**
2
+ * rehype 插件:清理用户输入中的危险 HTML,防止页面布局错乱和 XSS 攻击。
3
+ *
4
+ * 在 rehypeRaw 之后使用,对 hast 树执行:
5
+ * 1. 移除 doctype 声明
6
+ * 2. 完全移除危险元素(script、style 等)及其子节点
7
+ * 3. 解包结构性元素(html、head、body 等),保留子节点
8
+ * 4. 保留 GFM 任务列表的 input[type=checkbox],移除其他 input
9
+ * 5. 清理所有元素的危险属性(on* 事件、javascript: URL)
10
+ */
11
+ export declare const rehypeSanitizeUserHtml: () => (tree: any) => any;
@@ -0,0 +1,182 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_without_holes(arr) {
7
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
8
+ }
9
+ function _iterable_to_array(iter) {
10
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11
+ }
12
+ function _non_iterable_spread() {
13
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14
+ }
15
+ function _to_consumable_array(arr) {
16
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
17
+ }
18
+ function _unsupported_iterable_to_array(o, minLen) {
19
+ if (!o) return;
20
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
21
+ var n = Object.prototype.toString.call(o).slice(8, -1);
22
+ if (n === "Object" && o.constructor) n = o.constructor.name;
23
+ if (n === "Map" || n === "Set") return Array.from(n);
24
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
25
+ }
26
+ /**
27
+ * rehype 插件:清理用户输入中的危险 HTML,防止页面布局错乱和 XSS 攻击。
28
+ *
29
+ * 在 rehypeRaw 之后使用,对 hast 树执行:
30
+ * 1. 移除 doctype 声明
31
+ * 2. 完全移除危险元素(script、style 等)及其子节点
32
+ * 3. 解包结构性元素(html、head、body 等),保留子节点
33
+ * 4. 保留 GFM 任务列表的 input[type=checkbox],移除其他 input
34
+ * 5. 清理所有元素的危险属性(on* 事件、javascript: URL)
35
+ */ /** 应完全移除(含子节点)的危险 HTML 标签 */ var STRIP_ELEMENTS = new Set([
36
+ 'script',
37
+ 'noscript',
38
+ 'style',
39
+ 'meta',
40
+ 'title',
41
+ 'link',
42
+ 'base',
43
+ 'object',
44
+ 'embed',
45
+ 'applet',
46
+ 'frame',
47
+ 'frameset'
48
+ ]);
49
+ /** 应解包(移除标签但保留子节点)的结构性/表单 HTML 标签 */ var UNWRAP_ELEMENTS = new Set([
50
+ 'html',
51
+ 'head',
52
+ 'body',
53
+ 'form',
54
+ 'button',
55
+ 'select',
56
+ 'textarea',
57
+ 'option',
58
+ 'optgroup',
59
+ 'fieldset',
60
+ 'legend'
61
+ ]);
62
+ var DANGEROUS_URL_SCHEMES = [
63
+ 'javascript:',
64
+ 'vbscript:'
65
+ ];
66
+ var sanitizeElementProperties = function sanitizeElementProperties(properties) {
67
+ if (!properties) return;
68
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
69
+ try {
70
+ var _loop = function() {
71
+ var key = _step.value;
72
+ if (key.startsWith('on')) {
73
+ delete properties[key];
74
+ return "continue";
75
+ }
76
+ var value = properties[key];
77
+ if (typeof value === 'string') {
78
+ var lower = value.toLowerCase().trimStart();
79
+ if (DANGEROUS_URL_SCHEMES.some(function(s) {
80
+ return lower.startsWith(s);
81
+ })) {
82
+ delete properties[key];
83
+ }
84
+ }
85
+ };
86
+ for(var _iterator = Object.keys(properties)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
87
+ } catch (err) {
88
+ _didIteratorError = true;
89
+ _iteratorError = err;
90
+ } finally{
91
+ try {
92
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
93
+ _iterator.return();
94
+ }
95
+ } finally{
96
+ if (_didIteratorError) {
97
+ throw _iteratorError;
98
+ }
99
+ }
100
+ }
101
+ };
102
+ /** 判断 input 元素是否为 GFM 任务列表 checkbox,应予保留 */ var isTaskListCheckbox = function isTaskListCheckbox(node) {
103
+ var _node_properties;
104
+ return ((_node_properties = node.properties) === null || _node_properties === void 0 ? void 0 : _node_properties.type) === 'checkbox';
105
+ };
106
+ /**
107
+ * 递归清理 hast 节点。
108
+ * @returns null = 移除节点 | 数组 = 解包子节点 | 节点对象 = 保留
109
+ */ var sanitizeHastNode = function sanitizeHastNode1(node) {
110
+ if (node.type === 'doctype') return null;
111
+ if (node.type === 'element') {
112
+ if (STRIP_ELEMENTS.has(node.tagName)) return null;
113
+ // input: 保留 GFM 任务列表 checkbox,移除其他 input
114
+ if (node.tagName === 'input' && !isTaskListCheckbox(node)) {
115
+ return null;
116
+ }
117
+ sanitizeElementProperties(node.properties);
118
+ if (UNWRAP_ELEMENTS.has(node.tagName)) {
119
+ var kept = [];
120
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
121
+ try {
122
+ for(var _iterator = (node.children || [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
123
+ var child = _step.value;
124
+ var _kept;
125
+ var result = sanitizeHastNode(child);
126
+ if (result === null) continue;
127
+ if (Array.isArray(result)) (_kept = kept).push.apply(_kept, _to_consumable_array(result));
128
+ else kept.push(result);
129
+ }
130
+ } catch (err) {
131
+ _didIteratorError = true;
132
+ _iteratorError = err;
133
+ } finally{
134
+ try {
135
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
136
+ _iterator.return();
137
+ }
138
+ } finally{
139
+ if (_didIteratorError) {
140
+ throw _iteratorError;
141
+ }
142
+ }
143
+ }
144
+ return kept.length > 0 ? kept : null;
145
+ }
146
+ }
147
+ if (node.children) {
148
+ var newChildren = [];
149
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
150
+ try {
151
+ for(var _iterator1 = node.children[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
152
+ var child1 = _step1.value;
153
+ var _newChildren;
154
+ var result1 = sanitizeHastNode(child1);
155
+ if (result1 === null) continue;
156
+ if (Array.isArray(result1)) (_newChildren = newChildren).push.apply(_newChildren, _to_consumable_array(result1));
157
+ else newChildren.push(result1);
158
+ }
159
+ } catch (err) {
160
+ _didIteratorError1 = true;
161
+ _iteratorError1 = err;
162
+ } finally{
163
+ try {
164
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
165
+ _iterator1.return();
166
+ }
167
+ } finally{
168
+ if (_didIteratorError1) {
169
+ throw _iteratorError1;
170
+ }
171
+ }
172
+ }
173
+ node.children = newChildren;
174
+ }
175
+ return node;
176
+ };
177
+ export var rehypeSanitizeUserHtml = function rehypeSanitizeUserHtml() {
178
+ return function(tree) {
179
+ sanitizeHastNode(tree);
180
+ return tree;
181
+ };
182
+ };
@@ -75,12 +75,12 @@ var genStyle = function genStyle(token) {
75
75
  border: 'none',
76
76
  background: 'none',
77
77
  cursor: 'pointer',
78
- color: '#767e8b',
78
+ color: 'var(--color-gray-text-secondary)',
79
79
  transition: 'all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)',
80
80
  borderRadius: 'var(--radius-control-base)',
81
81
  backdropFilter: 'blur(20px)',
82
82
  '&:hover': {
83
- background: '#f0f0f0'
83
+ background: 'var(--color-gray-control-fill-active)'
84
84
  }
85
85
  }), // 返回图标
86
86
  _define_property(_obj3, "&-back-icon", {
@@ -111,17 +111,17 @@ var genStyle = function genStyle(token) {
111
111
  }, _define_property(_obj1, "&--html", {
112
112
  width: '40px',
113
113
  height: '40px',
114
- color: '#00B5FD',
114
+ color: 'var(--color-blue-text-default)',
115
115
  background: 'linear-gradient(180deg, rgba(0, 181, 253, 0.15), rgba(0, 181, 253, 0.08))'
116
116
  }), _define_property(_obj1, "&--md", {
117
117
  width: '40px',
118
118
  height: '40px',
119
- color: '#FF7A00',
119
+ color: 'var(--color-orange-text-default)',
120
120
  background: 'linear-gradient(180deg, rgba(35, 214, 220, 0.15), rgba(35, 214, 220, 0.08))'
121
121
  }), _define_property(_obj1, "&--default", {
122
122
  width: '40px',
123
123
  height: '40px',
124
- background: 'linear-gradient(180deg, #EAEEF4, #F4F6F9)'
124
+ background: 'linear-gradient(180deg, var(--color-gray-bg-page-light), var(--color-gray-bg-page))'
125
125
  }), _obj1)), _define_property(_obj3, "&-content", {
126
126
  display: 'flex',
127
127
  alignItems: 'center',
@@ -202,20 +202,20 @@ var genStyle = function genStyle(token) {
202
202
  background: 'transparent'
203
203
  },
204
204
  '.ace-tm .ace_gutter-active-line': {
205
- color: '#FFFFFF',
205
+ color: 'var(--color-gray-bg-card-white)',
206
206
  background: 'transparent'
207
207
  },
208
208
  '.ace-tm .ace_comment': {
209
209
  color: 'rgba(255, 255, 255, 0.27)'
210
210
  },
211
211
  '.ace-tm .ace_keyword': {
212
- color: '#E873BB'
212
+ color: 'var(--color-sub5-text-default)'
213
213
  },
214
214
  '.ace_identifier, .ace_paren': {
215
- color: '#FFFFFF'
215
+ color: 'var(--color-gray-bg-card-white)'
216
216
  },
217
217
  '.ace-tm .ace_constant.ace_numeric': {
218
- color: '#84DC18'
218
+ color: 'var(--color-green-text-default)'
219
219
  },
220
220
  '.code-editor-container': {
221
221
  marginTop: 0,
@@ -230,7 +230,7 @@ var genStyle = function genStyle(token) {
230
230
  background: 'transparent'
231
231
  }
232
232
  }, "".concat(token.antCls, "-empty-description"), {
233
- color: '#d9d9d9'
233
+ color: 'var(--color-gray-text-light)'
234
234
  })), _obj4)), _define_property(_obj7, "&--markdown", _define_property({}, "".concat(token.antCls, '-agentic-md-editor-content div[data-be="paragraph"]:last-child'), {
235
235
  paddingBottom: '16px',
236
236
  color: 'var(--color-gray-text-light)',
@@ -298,7 +298,7 @@ var genStyle = function genStyle(token) {
298
298
  background: 'rgba(255, 255, 255, 0.6)'
299
299
  }), _define_property(_obj6, "&--error", {
300
300
  background: 'rgba(255, 245, 245, 0.6)',
301
- color: '#cb1e1e'
301
+ color: 'var(--color-red-text-default)'
302
302
  }), _obj6)), _define_property(_obj7, "&-empty", {
303
303
  display: 'flex',
304
304
  alignItems: 'center',
package/dist/index.d.ts CHANGED
@@ -100,4 +100,4 @@ export * from './Utils/proxySandbox/SecurityContextManager';
100
100
  * @description 原始 SDK 导出,一般用户无需直接使用
101
101
  * @deprecated @since 2.30.0 建议直接从 @schema-element-editor/host-sdk 导入
102
102
  */
103
- export * from '@schema-element-editor/host-sdk';
103
+ export { createSchemaElementEditorBridge, useSchemaElementEditor, type MethodLevelConfig, type PostMessageSourceConfig, type PostMessageTypeConfig, type ReactSchemaElementEditorConfig, type SchemaElementEditorBridge, type SchemaElementEditorConfig, type SchemaElementEditorRecording, type SchemaValue, } from '@schema-element-editor/host-sdk';
package/dist/index.js CHANGED
@@ -116,4 +116,4 @@ export * from "./Utils/proxySandbox/SecurityContextManager";
116
116
  * Schema Element Editor Chrome 插件底层 SDK
117
117
  * @description 原始 SDK 导出,一般用户无需直接使用
118
118
  * @deprecated @since 2.30.0 建议直接从 @schema-element-editor/host-sdk 导入
119
- */ export * from "@schema-element-editor/host-sdk";
119
+ */ export { createSchemaElementEditorBridge, useSchemaElementEditor } from "@schema-element-editor/host-sdk";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/agentic-ui",
3
- "version": "2.31.3",
3
+ "version": "2.31.5",
4
4
  "description": "面向智能体的 UI 组件库,提供多步推理可视化、工具调用展示、任务执行协同等 Agentic UI 能力",
5
5
  "repository": "git@github.com:ant-design/agentic-ui.git",
6
6
  "license": "MIT",
@@ -10,7 +10,10 @@
10
10
  "sideEffects": [
11
11
  "**/*.css",
12
12
  "**/*.less",
13
- "**/*.scss"
13
+ "**/*.scss",
14
+ "./dist/MarkdownEditor/editor/utils/sideEffects.js",
15
+ "./dist/Utils/proxySandbox/index.js",
16
+ "./dist/Plugins/chart/components/index.js"
14
17
  ],
15
18
  "exports": {
16
19
  ".": {