@ant-design/agentic-ui 2.31.3 → 2.31.4

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 (40) 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/style.js +2 -2
  6. package/dist/Components/ActionIconBox/style.js +3 -3
  7. package/dist/Components/ActionItemBox/style.js +16 -16
  8. package/dist/Components/Button/IconButton/style.js +33 -33
  9. package/dist/Components/Button/ToggleButton/style.js +33 -33
  10. package/dist/Components/Loading/style.js +5 -5
  11. package/dist/Components/VisualList/style.js +5 -5
  12. package/dist/Components/lotties/TextLoading/style.js +2 -2
  13. package/dist/MarkdownEditor/editor/components/CommentList/style.js +3 -3
  14. package/dist/MarkdownEditor/editor/parser/parse/parseTable.js +2 -1
  15. package/dist/MarkdownEditor/editor/style.js +4 -4
  16. package/dist/MarkdownEditor/editor/utils/markdownToHtml.js +2 -1
  17. package/dist/MarkdownEditor/style.js +26 -26
  18. package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +1 -1
  19. package/dist/MarkdownInputField/AttachmentButton/style.js +5 -5
  20. package/dist/MarkdownInputField/FileMapView/style.js +2 -2
  21. package/dist/MarkdownInputField/style.js +6 -6
  22. package/dist/MarkdownInputField/types/MarkdownInputFieldProps.d.ts +10 -0
  23. package/dist/MarkdownRenderer/markdownReactShared.js +2 -1
  24. package/dist/MarkdownRenderer/renderers/CodeRenderer.js +8 -14
  25. package/dist/Plugins/chart/ChartStatistic/style.js +9 -9
  26. package/dist/Plugins/chart/DonutChart/style.js +3 -3
  27. package/dist/Plugins/chart/components/ChartContainer/style.js +3 -3
  28. package/dist/Plugins/chart/components/ChartFilter/style.js +22 -22
  29. package/dist/Plugins/chart/components/ChartToolBar/style.js +4 -4
  30. package/dist/Plugins/code/components/CodeRenderer.js +6 -5
  31. package/dist/Plugins/code/components/CodeToolbar.d.ts +0 -1
  32. package/dist/Plugins/code/components/CodeToolbar.js +6 -12
  33. package/dist/Schema/SchemaEditor/style.js +26 -26
  34. package/dist/ThoughtChainList/style.js +5 -5
  35. package/dist/ToolUseBar/style.js +8 -8
  36. package/dist/ToolUseBarThink/style.js +1 -1
  37. package/dist/Utils/rehypeSanitizeUserHtml.d.ts +11 -0
  38. package/dist/Utils/rehypeSanitizeUserHtml.js +182 -0
  39. package/dist/Workspace/RealtimeFollow/style.js +11 -11
  40. package/package.json +1 -1
@@ -70,7 +70,7 @@ var genStyle = function genStyle(token) {
70
70
  animationIterationCount: 'infinite',
71
71
  // 亮色主题:深色文字 + 亮色光泽(适用于白色背景)
72
72
  '&-light': {
73
- color: '#00000066',
73
+ color: 'var(--color-gray-text-default)',
74
74
  backgroundImage: "linear-gradient(\n 120deg,\n rgba(255, 255, 255, 0.8) 40%,\n rgba(15, 14, 14, 0.8) 50%,\n rgba(255, 255, 255, 0.8) 60%\n )",
75
75
  backgroundSize: '200% 100%',
76
76
  WebkitBackgroundClip: 'text',
@@ -78,7 +78,7 @@ var genStyle = function genStyle(token) {
78
78
  },
79
79
  // 暗色主题:浅色文字 + 深色光泽(适用于黑色背景)
80
80
  '&-dark': {
81
- color: '#ffffff40',
81
+ color: 'var(--color-gray-text-light)',
82
82
  backgroundImage: "linear-gradient(\n 120deg,\n rgba(255, 255, 255, 0) 40%,\n rgba(255, 255, 255, 0.8) 50%,\n rgba(255, 255, 255, 0) 60%\n )",
83
83
  backgroundSize: '200% 100%',
84
84
  WebkitBackgroundClip: 'text',
@@ -65,7 +65,7 @@ var genStyle = function genStyle(token) {
65
65
  gap: 8,
66
66
  borderLeft: '1px solid rgba(0,0,0,0.04)',
67
67
  maxWidth: '300px',
68
- backgroundColor: '#fff',
68
+ backgroundColor: 'var(--color-gray-bg-card-white)',
69
69
  height: '100vh',
70
70
  '&-item': {
71
71
  padding: '12px',
@@ -76,7 +76,7 @@ var genStyle = function genStyle(token) {
76
76
  flexDirection: 'column',
77
77
  gap: 8,
78
78
  '&:hover': {
79
- backgroundColor: '#f9f9f9'
79
+ backgroundColor: 'var(--color-gray-bg-page-light)'
80
80
  },
81
81
  '&-header': {
82
82
  display: 'flex',
@@ -94,7 +94,7 @@ var genStyle = function genStyle(token) {
94
94
  alignItems: 'center'
95
95
  },
96
96
  '&-time': {
97
- color: '#bfbfbf',
97
+ color: 'var(--color-gray-text-disabled)',
98
98
  fontSize: '12px'
99
99
  },
100
100
  '&-action': {
@@ -60,6 +60,7 @@ import remarkGfm from "remark-gfm";
60
60
  import remarkMath from "remark-math";
61
61
  import remarkParse from "remark-parse";
62
62
  import remarkRehype from "remark-rehype";
63
+ import { rehypeSanitizeUserHtml } from "../../../../Utils/rehypeSanitizeUserHtml";
63
64
  import { convertParagraphToImage, fixStrongWithSpecialChars } from "../remarkParse";
64
65
  //@ts-ignore
65
66
  import rehypeKatex from "rehype-katex";
@@ -75,7 +76,7 @@ var stringifyObj = remark().use(remarkParse).use(fixStrongWithSpecialChars).use(
75
76
  }).use(remarkRehype, {
76
77
  allowDangerousHtml: true,
77
78
  handlers: REMARK_REHYPE_DIRECTIVE_HANDLERS
78
- }).use(rehypeRaw).use(rehypeKatex).use(remarkGfm, {
79
+ }).use(rehypeRaw).use(rehypeSanitizeUserHtml).use(rehypeKatex).use(remarkGfm, {
79
80
  singleTilde: false
80
81
  }) // 禁用单波浪线删除线
81
82
  .use(remarkFrontmatter, [
@@ -199,7 +199,7 @@ var genStyle = function genStyle(token) {
199
199
  wordWrap: 'break-word',
200
200
  fontSize: '15px'
201
201
  }, // Jinja 语法高亮,仅通过 CSS 变量定制(在 .ant-agentic-md-editor-content 上覆盖)
202
- _define_property(_obj, JINJA_CSS_VAR.variable, 'var(--color-primary-control-fill-primary, #1677ff)'), _define_property(_obj, JINJA_CSS_VAR.tag, 'var(--color-orange-6, #d46b08)'), _define_property(_obj, JINJA_CSS_VAR.comment, 'var(--color-text-tertiary, rgba(0,0,0,0.25))'), _define_property(_obj, JINJA_CSS_VAR.keyword, '#5c4033'), _define_property(_obj, JINJA_CSS_VAR.string, 'var(--color-green-10, #10af74)'), _define_property(_obj, JINJA_CSS_VAR.number, 'var(--color-primary-10, #066ced)'), _define_property(_obj, JINJA_CSS_VAR.filter, 'var(--color-primary-8, #689ef0)'), _define_property(_obj, JINJA_CSS_VAR.variableName, 'var(--color-green-10, #10af74)'), _define_property(_obj, JINJA_CSS_VAR.placeholder, 'var(--color-primary-control-fill-primary, #1677ff)'), _define_property(_obj, JINJA_CSS_VAR.placeholderBg, 'var(--color-primary-bg-tip, rgba(0,102,255,0.08))'), _define_property(_obj, JINJA_CSS_VAR.delimiter, '#d4b84b'), _define_property(_obj, '::-webkit-scrollbar', {
202
+ _define_property(_obj, JINJA_CSS_VAR.variable, 'var(--color-primary-control-fill-primary)'), _define_property(_obj, JINJA_CSS_VAR.tag, 'var(--color-orange-6, #d46b08)'), _define_property(_obj, JINJA_CSS_VAR.comment, 'var(--color-text-tertiary, rgba(0,0,0,0.25))'), _define_property(_obj, JINJA_CSS_VAR.keyword, '#5c4033'), _define_property(_obj, JINJA_CSS_VAR.string, 'var(--color-green-10, #10af74)'), _define_property(_obj, JINJA_CSS_VAR.number, 'var(--color-primary-10, #066ced)'), _define_property(_obj, JINJA_CSS_VAR.filter, 'var(--color-primary-8, #689ef0)'), _define_property(_obj, JINJA_CSS_VAR.variableName, 'var(--color-green-10, #10af74)'), _define_property(_obj, JINJA_CSS_VAR.placeholder, 'var(--color-primary-control-fill-primary)'), _define_property(_obj, JINJA_CSS_VAR.placeholderBg, 'var(--color-primary-bg-tip, rgba(0,102,255,0.08))'), _define_property(_obj, JINJA_CSS_VAR.delimiter, '#d4b84b'), _define_property(_obj, '::-webkit-scrollbar', {
203
203
  width: '8px',
204
204
  height: '8px'
205
205
  }), _define_property(_obj, '::-webkit-scrollbar-thumb', {
@@ -430,7 +430,7 @@ var genStyle = function genStyle(token) {
430
430
  marginBottom: '8px'
431
431
  },
432
432
  '&.info': {
433
- borderLeftColor: 'var(--color-info, #1677ff)',
433
+ borderLeftColor: 'var(--color-primary-control-fill-primary)',
434
434
  backgroundColor: 'var(--color-info-bg, rgba(22, 119, 255, 0.08))'
435
435
  },
436
436
  '&.warning': {
@@ -438,7 +438,7 @@ var genStyle = function genStyle(token) {
438
438
  backgroundColor: 'var(--color-warning-bg, rgba(250, 173, 20, 0.08))'
439
439
  },
440
440
  '&.success': {
441
- borderLeftColor: 'var(--color-success, #52c41a)',
441
+ borderLeftColor: 'var(--color-green-text-default)',
442
442
  backgroundColor: 'var(--color-success-bg, rgba(82, 196, 26, 0.08))'
443
443
  },
444
444
  '&.error': {
@@ -446,7 +446,7 @@ var genStyle = function genStyle(token) {
446
446
  backgroundColor: 'var(--color-error-bg, rgba(255, 77, 79, 0.08))'
447
447
  },
448
448
  '&.tip': {
449
- borderLeftColor: 'var(--color-info, #1677ff)',
449
+ borderLeftColor: 'var(--color-primary-control-fill-primary)',
450
450
  backgroundColor: 'var(--color-info-bg, rgba(22, 119, 255, 0.08))'
451
451
  }
452
452
  }), _define_property(_obj, '[data-be="media-container"], [data-be="image-container"]', {
@@ -174,6 +174,7 @@ import remarkParse from "remark-parse";
174
174
  import remarkRehype from "remark-rehype";
175
175
  import { unified } from "unified";
176
176
  import { visit } from "unist-util-visit";
177
+ import { rehypeSanitizeUserHtml } from "../../../Utils/rehypeSanitizeUserHtml";
177
178
  import { JINJA_DOLLAR_PLACEHOLDER, preprocessNormalizeLeafToContainerDirective } from "../parser/constants";
178
179
  import { remarkDirectiveContainer } from "../parser/remarkDirectiveContainer";
179
180
  import remarkDirectiveContainersOnly from "../parser/remarkDirectiveContainersOnly";
@@ -412,7 +413,7 @@ var createMarkdownProcessor = function createMarkdownProcessor(plugins, config)
412
413
  var processor = unified();
413
414
  var remarkPlugins = resolveRemarkPlugins(plugins);
414
415
  applyPlugins(processor, remarkPlugins);
415
- processor.use(rehypeRaw).use(rehypeKatex);
416
+ processor.use(rehypeRaw).use(rehypeSanitizeUserHtml).use(rehypeKatex);
416
417
  // 应用配置选项
417
418
  if (config === null || config === void 0 ? void 0 : config.openLinksInNewTab) {
418
419
  processor.use(rehypeLinkTarget());
@@ -164,7 +164,7 @@ var genTableStyle = function genTableStyle(token, mobileBreakpoint, mobilePaddin
164
164
  }), _define_property(_obj, 'tbody tr:not(.config-tr)', {
165
165
  animation: 'agenticTableRowFadeIn 0.3s ease both'
166
166
  }), _define_property(_obj, 'tbody tr:not(.config-tr):hover', {
167
- background: 'linear-gradient(var(--agentic-ui-table-hover-bg, rgba(0, 0, 0, 0.04)), var(--agentic-ui-table-hover-bg, rgba(0, 0, 0, 0.04))), linear-gradient(var(--agentic-ui-table-cell-bg, #ffffff), var(--agentic-ui-table-cell-bg, #ffffff))'
167
+ background: 'linear-gradient(var(--agentic-ui-table-hover-bg, rgba(0, 0, 0, 0.04)), var(--agentic-ui-table-hover-bg, rgba(0, 0, 0, 0.04))), linear-gradient(var(--agentic-ui-table-cell-bg, var(--color-gray-bg-card-white)), var(--agentic-ui-table-cell-bg, var(--color-gray-bg-card-white)))'
168
168
  }), _define_property(_obj, "@media (max-width: ".concat(mobileBreakpoint, ")"), {
169
169
  'th, td': {
170
170
  padding: mobilePadding
@@ -236,20 +236,20 @@ var genTableStyle = function genTableStyle(token, mobileBreakpoint, mobilePaddin
236
236
  boxShadow: 'var(--shadow-border-base)',
237
237
  color: 'var(--color-gray-text-secondary)',
238
238
  '&:hover': {
239
- backgroundColor: '#FFF',
239
+ backgroundColor: 'var(--color-gray-bg-card-white)',
240
240
  boxShadow: 'var(--shadow-control-lg)'
241
241
  }
242
242
  }), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index-delete-icon"), {
243
243
  '&:hover': {
244
- color: '#ff4d4f'
244
+ color: 'var(--color-red-text-default)'
245
245
  }
246
246
  }), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index-insert-row-before"), {
247
247
  '&:hover': {
248
- color: '#52c41a'
248
+ color: 'var(--color-green-text-default)'
249
249
  }
250
250
  }), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index-insert-row-after"), {
251
251
  '&:hover': {
252
- color: '#52c41a'
252
+ color: 'var(--color-green-text-default)'
253
253
  }
254
254
  }), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index-spacer"), {
255
255
  cursor: 'pointer',
@@ -288,20 +288,20 @@ var genTableStyle = function genTableStyle(token, mobileBreakpoint, mobilePaddin
288
288
  boxShadow: 'var(--shadow-border-base)',
289
289
  color: 'var(--color-gray-text-secondary)',
290
290
  '&:hover': {
291
- backgroundColor: '#FFF',
291
+ backgroundColor: 'var(--color-gray-bg-card-white)',
292
292
  boxShadow: 'var(--shadow-control-lg)'
293
293
  }
294
294
  }), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index-spacer-delete-icon"), {
295
295
  '&:hover': {
296
- color: '#ff4d4f'
296
+ color: 'var(--color-red-text-default)'
297
297
  }
298
298
  }), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index-spacer-insert-column-before"), {
299
299
  '&:hover': {
300
- color: '#52c41a'
300
+ color: 'var(--color-green-text-default)'
301
301
  }
302
302
  }), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index-spacer-insert-column-after"), {
303
303
  '&:hover': {
304
- color: '#52c41a'
304
+ color: 'var(--color-green-text-default)'
305
305
  }
306
306
  }), _define_property(_obj1, '@keyframes agenticTableRowFadeIn', {
307
307
  from: {
@@ -452,7 +452,7 @@ var genStyle = function genStyle(token) {
452
452
  alignItems: 'center'
453
453
  }), _define_property(_obj1, "".concat(token.componentCls, "-link-card__container"), {
454
454
  padding: 12,
455
- border: '1px solid #f0f0f0',
455
+ border: '1px solid var(--color-gray-border-light)',
456
456
  borderRadius: '0.5em',
457
457
  margin: '8px 0',
458
458
  width: '100%',
@@ -463,21 +463,21 @@ var genStyle = function genStyle(token) {
463
463
  display: 'flex',
464
464
  alignItems: 'center',
465
465
  gap: 12,
466
- color: '#262626',
466
+ color: 'var(--color-gray-text-default)',
467
467
  justifyContent: 'space-between',
468
468
  '& [data-icon-box]': {
469
469
  padding: '0 18px',
470
- color: '#6b7280',
470
+ color: 'var(--color-gray-text-light)',
471
471
  cursor: 'pointer',
472
472
  '&:hover': {
473
- color: '#1667ff'
473
+ color: 'var(--color-primary-control-fill-primary)'
474
474
  }
475
475
  }
476
476
  }), _define_property(_obj1, "".concat(token.componentCls, "-link-card__content"), {
477
477
  display: 'flex',
478
478
  alignItems: 'center',
479
479
  gap: 12,
480
- color: '#262626',
480
+ color: 'var(--color-gray-text-default)',
481
481
  fontSize: 16,
482
482
  flex: 1,
483
483
  minWidth: 0
@@ -487,7 +487,7 @@ var genStyle = function genStyle(token) {
487
487
  textWrap: 'nowrap',
488
488
  textDecoration: 'none',
489
489
  display: 'block',
490
- color: '#262626'
490
+ color: 'var(--color-gray-text-default)'
491
491
  }), _define_property(_obj1, "".concat(token.componentCls, "-link-card__description"), {
492
492
  flex: 1,
493
493
  minWidth: 0,
@@ -575,47 +575,47 @@ var genStyle = function genStyle(token) {
575
575
  fontFamily: "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",
576
576
  wordWrap: 'break-word',
577
577
  borderRadius: '12px',
578
- background: '#FFFFFF',
578
+ background: 'var(--color-gray-bg-card-white)',
579
579
  boxShadow: 'var(--shadow-control-base)',
580
580
  // SVG 渲染优化
581
581
  '& svg': {
582
582
  // 节点样式
583
583
  '& .node': {
584
584
  '& rect, & circle, & ellipse, & polygon': {
585
- stroke: '#333',
585
+ stroke: 'var(--color-gray-text-default)',
586
586
  strokeWidth: '1px',
587
- fill: '#fff'
587
+ fill: 'var(--color-gray-bg-card-white)'
588
588
  }
589
589
  },
590
590
  // 节点标签 - 更大的字体
591
591
  '& .nodeLabel': {
592
592
  fontWeight: 500,
593
- fill: '#333 !important'
593
+ fill: 'var(--color-gray-text-default) !important'
594
594
  },
595
595
  // 边标签 - 稍小一些但仍然清晰
596
596
  '& .edgeLabel': {
597
- fill: '#666 !important'
597
+ fill: 'var(--color-gray-text-secondary) !important'
598
598
  },
599
599
  // 专门针对流程图的文字
600
600
  '& .flowchart-label': {
601
- fill: '#333 !important'
601
+ fill: 'var(--color-gray-text-default) !important'
602
602
  },
603
603
  // 针对不同类型的标签
604
604
  '& .label': {
605
- fill: '#333 !important'
605
+ fill: 'var(--color-gray-text-default) !important'
606
606
  }
607
607
  },
608
608
  // 错误状态样式
609
609
  '&-error': {
610
- color: '#d73a49',
611
- background: '#ffeaea',
612
- border: '1px solid #f97583',
610
+ color: 'var(--color-red-text-default)',
611
+ background: 'var(--color-red-bg-page-light)',
612
+ border: '1px solid var(--color-red-border-default)',
613
613
  padding: '12px',
614
614
  borderRadius: '4px',
615
615
  textAlign: 'left',
616
616
  '& pre': {
617
617
  margin: '8px 0 0',
618
- background: '#f6f8fa',
618
+ background: 'var(--color-gray-bg-page-light)',
619
619
  padding: '8px',
620
620
  borderRadius: '4px',
621
621
  fontSize: '12px'
@@ -271,7 +271,7 @@ var genStyle = function genStyle(token) {
271
271
  }
272
272
  },
273
273
  '&-item-meta-placeholder': (_obj = {
274
- background: 'var(--color-gray-bg-card-light, #f7f9fc) !important'
274
+ background: 'var(--color-gray-bg-card-light) !important'
275
275
  }, _define_property(_obj, "".concat(token.componentCls, "-item-file-name-text"), {
276
276
  color: 'var(--color-gray-text-light, rgba(80, 94, 119, 0.53)) !important'
277
277
  }), _define_property(_obj, "".concat(token.componentCls, "-item-file-size"), {
@@ -74,9 +74,9 @@ var genStyle = function genStyle(token) {
74
74
  height: '56px',
75
75
  borderRadius: '12px',
76
76
  opacity: 1,
77
- background: '#FFFFFF',
77
+ background: 'var(--color-gray-bg-card-white)',
78
78
  boxSizing: 'border-box',
79
- border: '1px solid #E6ECF4',
79
+ border: '1px solid var(--color-gray-border-light)',
80
80
  padding: '8px',
81
81
  display: 'flex',
82
82
  flexDirection: 'row',
@@ -108,7 +108,7 @@ var genStyle = function genStyle(token) {
108
108
  }
109
109
  },
110
110
  '&-file-size': {
111
- color: '#B0B7C3',
111
+ color: 'var(--color-gray-text-light)',
112
112
  fontSize: '12px'
113
113
  }
114
114
  },
@@ -116,13 +116,13 @@ var genStyle = function genStyle(token) {
116
116
  width: '16px',
117
117
  height: '16px',
118
118
  opacity: 1,
119
- background: '#353E5C',
119
+ background: 'var(--color-gray-bg-page-dark)',
120
120
  fontSize: 12,
121
121
  position: 'absolute',
122
122
  top: 2,
123
123
  borderRadius: '50%',
124
124
  right: 2,
125
- color: '#FFFFFF',
125
+ color: 'var(--color-gray-bg-card-white)',
126
126
  display: 'flex',
127
127
  justifyContent: 'center',
128
128
  alignItems: 'center',
@@ -104,7 +104,7 @@ var genStyle = function genStyle(token) {
104
104
  boxShadow: 'var(--shadow-control-base)',
105
105
  border: 'var(--color-gray-border-light)',
106
106
  '&:hover': {
107
- background: '#F7F8FA',
107
+ background: 'var(--color-gray-bg-page)',
108
108
  transform: 'scale(1.05)'
109
109
  },
110
110
  '&-icon': {
@@ -184,7 +184,7 @@ var genStyle = function genStyle(token) {
184
184
  '& svg': {
185
185
  width: 48,
186
186
  height: 48,
187
- color: '#fff'
187
+ color: 'var(--color-gray-bg-card-white)'
188
188
  }
189
189
  }), _define_property(_obj1, '&-image-list-view', {
190
190
  background: 'var(--color-gray-bg-tip)',
@@ -120,7 +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
+ background: 'var(--color-gray-bg-card-white)',
124
124
  borderRadius: '12px',
125
125
  minHeight: '48px',
126
126
  maxWidth: 980,
@@ -159,7 +159,7 @@ var genStyle = function genStyle(token) {
159
159
  boxSizing: 'border-box'
160
160
  },
161
161
  '&-content-wrapper': {
162
- backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
162
+ backgroundColor: 'var(--color-gray-bg-card-white)',
163
163
  display: 'flex',
164
164
  flexDirection: 'column',
165
165
  width: '100%',
@@ -169,14 +169,14 @@ var genStyle = function genStyle(token) {
169
169
  '&-editor': {
170
170
  boxSizing: 'border-box',
171
171
  borderRadius: 'inherit',
172
- backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
172
+ backgroundColor: 'var(--color-gray-bg-card-white)',
173
173
  width: '100%',
174
174
  zIndex: 9,
175
175
  maxHeight: 400,
176
176
  height: '100%',
177
177
  overflowY: 'visible',
178
178
  cursor: 'text',
179
- scrollbarColor: 'var(--color-gray-text-tertiary, #505c716b) transparent',
179
+ scrollbarColor: 'var(--color-gray-text-secondary) transparent',
180
180
  scrollbarWidth: 'thin',
181
181
  '&&-disabled': {
182
182
  backgroundColor: 'rgba(0,0,0,0.04)',
@@ -193,7 +193,7 @@ var genStyle = function genStyle(token) {
193
193
  minHeight: "".concat(DEFAULT_INPUT_CODE_BLOCK_HEIGHT, "px !important")
194
194
  },
195
195
  '& [data-be="code"]': {
196
- background: 'var(--color-gray-bg-card-light, #f7f9fc) !important',
196
+ background: 'var(--color-gray-bg-card-light) !important',
197
197
  color: 'var(--color-gray-text-default, rgba(20, 22, 28, 0.88)) !important'
198
198
  },
199
199
  '&-editor-content': _define_property({
@@ -257,7 +257,7 @@ var genStyle = function genStyle(token) {
257
257
  // 使用 minHeight,避免在 border-box 下固定 height 与 paddingBottom
258
258
  // 争用导致内容区 < 32px、Toggle 工具与发送区纵向错位
259
259
  minHeight: '32px',
260
- backgroundColor: 'var(--color-gray-bg-card-white, #ffffff)',
260
+ backgroundColor: 'var(--color-gray-bg-card-white)',
261
261
  display: 'flex',
262
262
  boxSizing: 'border-box',
263
263
  borderRadius: 0,
@@ -449,4 +449,14 @@ export type MarkdownInputFieldProps = {
449
449
  * ```
450
450
  */
451
451
  disableHoverAnimation?: boolean;
452
+ /**
453
+ * 主题模式
454
+ * @description 控制组件的明暗主题样式
455
+ * @default 'light'
456
+ * @example
457
+ * ```tsx
458
+ * <MarkdownInputField theme="dark" />
459
+ * ```
460
+ */
461
+ theme?: 'light' | 'dark';
452
462
  };
@@ -138,6 +138,7 @@ import remarkDirectiveContainersOnly from "../MarkdownEditor/editor/parser/remar
138
138
  import { convertParagraphToImage, fixStrongWithSpecialChars, protectJinjaDollarInText } from "../MarkdownEditor/editor/parser/remarkParse";
139
139
  import { REMARK_REHYPE_DIRECTIVE_HANDLERS } from "../MarkdownEditor/editor/utils/markdownToHtml";
140
140
  import { parseChineseCurrencyToNumber } from "../Plugins/chart/utils";
141
+ import { rehypeSanitizeUserHtml } from "../Utils/rehypeSanitizeUserHtml";
141
142
  import { ToolUseBarThink } from "../ToolUseBarThink";
142
143
  import AnimationText from "./AnimationText";
143
144
  import { FncRefForMarkdown, extractFootnoteRefFromSupChildren } from "./FncRefForMarkdown";
@@ -335,7 +336,7 @@ var createHastProcessor = function createHastProcessor(extraRemarkPlugins, confi
335
336
  }).use(fixStrongWithSpecialChars).use(convertParagraphToImage).use(protectJinjaDollarInText).use(remarkMath, INLINE_MATH_WITH_SINGLE_DOLLAR).use(remarkFrontmatter, FRONTMATTER_LANGUAGES).use(remarkDirectiveContainersOnly).use(remarkDirectiveContainer, REMARK_DIRECTIVE_CONTAINER_OPTIONS).use(remarkChartFromComment).use(remarkRehypePlugin, {
336
337
  allowDangerousHtml: true,
337
338
  handlers: REMARK_REHYPE_DIRECTIVE_HANDLERS
338
- }).use(rehypeRaw).use(rehypeKatex, {
339
+ }).use(rehypeRaw).use(rehypeSanitizeUserHtml).use(rehypeKatex, {
339
340
  strict: 'ignore'
340
341
  }).use(rehypeFootnoteRef);
341
342
  if (extraRemarkPlugins) {
@@ -44,11 +44,12 @@ function _unsupported_iterable_to_array(o, minLen) {
44
44
  if (n === "Map" || n === "Set") return Array.from(n);
45
45
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
46
46
  }
47
- import { ChevronsUpDown, Copy, Moon } from "@sofa-design/icons";
47
+ import { ChevronsUpDown, Copy } from "@sofa-design/icons";
48
48
  import copy from "copy-to-clipboard";
49
49
  import React, { useCallback, useContext, useMemo, useState } from "react";
50
50
  import { ActionIconBox } from "../../Components/ActionIconBox";
51
51
  import { I18nContext } from "../../I18n";
52
+ import { useDetectTheme } from "../../Plugins/chart/hooks";
52
53
  import { CodeContainer } from "../../Plugins/code/components/CodeContainer";
53
54
  import { LoadImage } from "../../Plugins/code/components/LoadImage";
54
55
  import { langIconMap } from "../../Plugins/code/langIconMap";
@@ -67,12 +68,11 @@ var extractTextContent = function extractTextContent1(children) {
67
68
  * 代码块渲染器——复用 MarkdownEditor 的 CodeContainer 和样式体系。
68
69
  * 不依赖 Slate 上下文,提供与 CodeRenderer readonly 模式一致的视觉效果。
69
70
  */ export var CodeBlockRenderer = function CodeBlockRenderer(props) {
70
- var _i18n_locale, _i18n_locale1, _i18n_locale2;
71
+ var _i18n_locale, _i18n_locale1;
71
72
  var language = props.language, children = props.children, editorCodeProps = props.editorCodeProps;
72
- var _useState = _sliced_to_array(useState(function() {
73
- return (editorCodeProps === null || editorCodeProps === void 0 ? void 0 : editorCodeProps.theme) || 'github';
74
- }), 2), theme = _useState[0], setTheme = _useState[1];
75
- var _useState1 = _sliced_to_array(useState(true), 2), isExpanded = _useState1[0], setIsExpanded = _useState1[1];
73
+ var detectedTheme = useDetectTheme();
74
+ var theme = (editorCodeProps === null || editorCodeProps === void 0 ? void 0 : editorCodeProps.theme) || (detectedTheme === 'dark' ? 'chaos' : 'github');
75
+ var _useState = _sliced_to_array(useState(true), 2), isExpanded = _useState[0], setIsExpanded = _useState[1];
76
76
  var i18n = useContext(I18nContext);
77
77
  var code = useMemo(function() {
78
78
  return extractTextContent(children);
@@ -174,14 +174,8 @@ var extractTextContent = function extractTextContent1(children) {
174
174
  alignItems: 'center'
175
175
  }
176
176
  }, /*#__PURE__*/ React.createElement(ActionIconBox, {
177
- title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale = i18n.locale) === null || _i18n_locale === void 0 ? void 0 : _i18n_locale.theme) || '主题',
178
177
  theme: theme === 'chaos' ? 'dark' : 'light',
179
- onClick: function onClick() {
180
- return setTheme(theme === 'github' ? 'chaos' : 'github');
181
- }
182
- }, /*#__PURE__*/ React.createElement(Moon, null)), /*#__PURE__*/ React.createElement(ActionIconBox, {
183
- theme: theme === 'chaos' ? 'dark' : 'light',
184
- title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale1 = i18n.locale) === null || _i18n_locale1 === void 0 ? void 0 : _i18n_locale1.copy) || '复制',
178
+ title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale = i18n.locale) === null || _i18n_locale === void 0 ? void 0 : _i18n_locale.copy) || '复制',
185
179
  style: {
186
180
  fontSize: '1em',
187
181
  lineHeight: '1.75em',
@@ -189,7 +183,7 @@ var extractTextContent = function extractTextContent1(children) {
189
183
  },
190
184
  onClick: handleCopy
191
185
  }, /*#__PURE__*/ React.createElement(Copy, null)), /*#__PURE__*/ React.createElement(ActionIconBox, {
192
- title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale2 = i18n.locale) === null || _i18n_locale2 === void 0 ? void 0 : _i18n_locale2.expandCollapse) || '展开/收起',
186
+ title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale1 = i18n.locale) === null || _i18n_locale1 === void 0 ? void 0 : _i18n_locale1.expandCollapse) || '展开/收起',
193
187
  theme: theme === 'chaos' ? 'dark' : 'light',
194
188
  onClick: function onClick() {
195
189
  return setIsExpanded(!isExpanded);
@@ -76,36 +76,36 @@ var genStyle = function genStyle(token) {
76
76
  fontFamily: 'PingFang SC',
77
77
  fontSize: '13px',
78
78
  fontWeight: 500,
79
- color: '#2C3E5D',
79
+ color: 'var(--color-gray-text-default)',
80
80
  margin: 0
81
81
  }), _define_property(_obj, "".concat(token.componentCls, "-subtitle"), {
82
82
  fontFamily: 'PingFang SC',
83
83
  fontSize: '12px',
84
84
  fontWeight: 400,
85
- color: '#8C8C8C',
85
+ color: 'var(--color-gray-text-light)',
86
86
  margin: 0,
87
87
  lineHeight: 1.4
88
88
  }), _define_property(_obj, "".concat(token.componentCls, "-question-icon"), {
89
89
  fontSize: '14px',
90
- color: '#B3B9C4',
90
+ color: 'var(--color-gray-text-secondary)',
91
91
  fontWeight: 500
92
92
  }), _obj)), _define_property(_obj10, "".concat(token.componentCls, "-value"), (_obj1 = {
93
93
  fontFamily: 'Rubik',
94
94
  fontSize: '24px',
95
95
  fontWeight: 500,
96
96
  lineHeight: 1,
97
- color: '#2C3E5D'
97
+ color: 'var(--color-gray-text-default)'
98
98
  }, _define_property(_obj1, "".concat(token.componentCls, "-value-prefix"), {
99
99
  fontFamily: 'PingFang SC',
100
100
  fontSize: '13px',
101
101
  fontWeight: 'normal',
102
- color: '#2C3E5D',
102
+ color: 'var(--color-gray-text-default)',
103
103
  marginRight: '4px'
104
104
  }), _define_property(_obj1, "".concat(token.componentCls, "-value-suffix"), {
105
105
  fontFamily: 'PingFang SC',
106
106
  fontSize: '13px',
107
107
  fontWeight: 'normal',
108
- color: '#2C3E5D',
108
+ color: 'var(--color-gray-text-default)',
109
109
  marginLeft: '4px'
110
110
  }), _obj1)), _define_property(_obj10, // Dark theme styles
111
111
  '&-dark', (_obj4 = {}, _define_property(_obj4, "".concat(token.componentCls, "-header"), (_obj2 = {}, _define_property(_obj2, "".concat(token.componentCls, "-title"), {
@@ -118,11 +118,11 @@ var genStyle = function genStyle(token) {
118
118
  color: 'rgba(255, 255, 255, 0.65)'
119
119
  }
120
120
  }), _obj2)), _define_property(_obj4, "".concat(token.componentCls, "-value"), (_obj3 = {
121
- color: '#fff'
121
+ color: 'var(--color-gray-bg-card-white)'
122
122
  }, _define_property(_obj3, "".concat(token.componentCls, "-value-prefix"), {
123
- color: '#fff'
123
+ color: 'var(--color-gray-bg-card-white)'
124
124
  }), _define_property(_obj3, "".concat(token.componentCls, "-value-suffix"), {
125
- color: '#fff'
125
+ color: 'var(--color-gray-bg-card-white)'
126
126
  }), _obj3)), _obj4)), _define_property(_obj10, // Size variants
127
127
  '&-small', (_obj6 = {}, _define_property(_obj6, "".concat(token.componentCls, "-header"), (_obj5 = {}, _define_property(_obj5, "".concat(token.componentCls, "-title"), {
128
128
  fontSize: '12px'
@@ -138,7 +138,7 @@ var genStyle = function genStyle(token) {
138
138
  }),
139
139
  '&-legend-label': _define_property({
140
140
  flex: 1,
141
- color: '#767E8B',
141
+ color: 'var(--color-gray-text-secondary)',
142
142
  fontSize: 13,
143
143
  whiteSpace: 'nowrap',
144
144
  overflow: 'hidden',
@@ -149,7 +149,7 @@ var genStyle = function genStyle(token) {
149
149
  minWidth: '60px'
150
150
  }),
151
151
  '&-legend-value': _define_property({
152
- color: '#343A45',
152
+ color: 'var(--color-gray-text-default)',
153
153
  fontSize: 13,
154
154
  fontWeight: 500,
155
155
  marginLeft: 15,
@@ -164,7 +164,7 @@ var genStyle = function genStyle(token) {
164
164
  '&-legend-percent': _define_property({
165
165
  marginLeft: 8,
166
166
  fontSize: 12,
167
- color: '#343A45'
167
+ color: 'var(--color-gray-text-default)'
168
168
  }, "@media (max-width: 768px)", {
169
169
  marginLeft: 0,
170
170
  fontSize: 10,
@@ -64,13 +64,13 @@ var genStyle = function genStyle(token) {
64
64
  minWidth: '300px',
65
65
  // 浅色主题边框
66
66
  '&&-light-theme': {
67
- border: '1px solid #e8e8e8',
68
- backgroundColor: '#fff'
67
+ border: '1px solid var(--color-gray-border-light)',
68
+ backgroundColor: 'var(--color-gray-bg-card-white)'
69
69
  },
70
70
  // 深色主题:略浅于纯黑页面底,与雷达等图表的「卡片」层次一致
71
71
  '&&-dark-theme': {
72
72
  border: '1px solid rgba(255, 255, 255, 0.08)',
73
- backgroundColor: '#1f1f1f'
73
+ backgroundColor: 'var(--color-gray-bg-page-dark)'
74
74
  },
75
75
  // 移动端适配
76
76
  '&&-mobile': {