@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.
- package/dist/AILabel/style.js +3 -3
- package/dist/AgenticLayout/style.js +1 -1
- package/dist/AnswerAlert/style.js +2 -2
- package/dist/Bubble/MessagesContent/VoiceButton/style.js +1 -1
- package/dist/Bubble/MessagesContent/style.js +2 -2
- package/dist/Components/ActionIconBox/style.js +3 -3
- package/dist/Components/ActionItemBox/style.js +16 -16
- package/dist/Components/Button/IconButton/style.js +33 -33
- package/dist/Components/Button/ToggleButton/style.js +33 -33
- package/dist/Components/Loading/style.js +5 -5
- package/dist/Components/VisualList/style.js +5 -5
- package/dist/Components/lotties/TextLoading/style.js +2 -2
- package/dist/MarkdownEditor/editor/components/CommentList/style.js +3 -3
- package/dist/MarkdownEditor/editor/parser/parse/parseTable.js +2 -1
- package/dist/MarkdownEditor/editor/style.js +4 -4
- package/dist/MarkdownEditor/editor/utils/markdownToHtml.js +2 -1
- package/dist/MarkdownEditor/style.js +26 -26
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/style.js +5 -5
- package/dist/MarkdownInputField/FileMapView/style.js +2 -2
- package/dist/MarkdownInputField/style.js +6 -6
- package/dist/MarkdownInputField/types/MarkdownInputFieldProps.d.ts +10 -0
- package/dist/MarkdownRenderer/markdownReactShared.js +2 -1
- package/dist/MarkdownRenderer/renderers/CodeRenderer.js +8 -14
- package/dist/Plugins/chart/ChartStatistic/style.js +9 -9
- package/dist/Plugins/chart/DonutChart/style.js +3 -3
- package/dist/Plugins/chart/components/ChartContainer/style.js +3 -3
- package/dist/Plugins/chart/components/ChartFilter/style.js +22 -22
- package/dist/Plugins/chart/components/ChartToolBar/style.js +4 -4
- package/dist/Plugins/code/components/CodeRenderer.js +6 -5
- package/dist/Plugins/code/components/CodeToolbar.d.ts +0 -1
- package/dist/Plugins/code/components/CodeToolbar.js +6 -12
- package/dist/Schema/SchemaEditor/style.js +26 -26
- package/dist/ThoughtChainList/style.js +5 -5
- package/dist/ToolUseBar/style.js +8 -8
- package/dist/ToolUseBarThink/style.js +1 -1
- package/dist/Utils/rehypeSanitizeUserHtml.d.ts +11 -0
- package/dist/Utils/rehypeSanitizeUserHtml.js +182 -0
- package/dist/Workspace/RealtimeFollow/style.js +11 -11
- package/package.json +1 -1
|
@@ -65,10 +65,10 @@ var genStyle = function genStyle(token) {
|
|
|
65
65
|
alignItems: 'center',
|
|
66
66
|
gap: '8px'
|
|
67
67
|
}, "".concat(token.componentCls, "-region-dropdown-btn"), _define_property({
|
|
68
|
-
border: '1px solid
|
|
68
|
+
border: '1px solid var(--color-gray-border-light)',
|
|
69
69
|
borderRadius: '6px',
|
|
70
|
-
backgroundColor: '
|
|
71
|
-
color: '
|
|
70
|
+
backgroundColor: 'var(--color-gray-bg-card-white)',
|
|
71
|
+
color: 'var(--color-gray-text-secondary)',
|
|
72
72
|
fontSize: '14px',
|
|
73
73
|
display: 'flex',
|
|
74
74
|
alignItems: 'center',
|
|
@@ -78,17 +78,17 @@ var genStyle = function genStyle(token) {
|
|
|
78
78
|
height: '32px',
|
|
79
79
|
padding: '0 12px',
|
|
80
80
|
'&:hover': _define_property({
|
|
81
|
-
borderColor: '
|
|
82
|
-
color: '
|
|
83
|
-
backgroundColor: '
|
|
81
|
+
borderColor: 'var(--color-gray-text-light)',
|
|
82
|
+
color: 'var(--color-gray-text-default)',
|
|
83
|
+
backgroundColor: 'var(--color-gray-bg-page-light)'
|
|
84
84
|
}, "".concat(token.componentCls, "-dropdown-icon"), {
|
|
85
|
-
color: '
|
|
85
|
+
color: 'var(--color-gray-text-light)'
|
|
86
86
|
})
|
|
87
87
|
}, "".concat(token.componentCls, "-dropdown-icon"), {
|
|
88
88
|
fontSize: '12px',
|
|
89
|
-
color: '
|
|
89
|
+
color: 'var(--color-gray-text-secondary)'
|
|
90
90
|
}))), _define_property(_obj1, "".concat(token.componentCls, "-segmented-filter"), {
|
|
91
|
-
backgroundColor: '
|
|
91
|
+
backgroundColor: 'var(--color-gray-control-fill-hover)',
|
|
92
92
|
height: '32px',
|
|
93
93
|
display: 'flex',
|
|
94
94
|
alignItems: 'center',
|
|
@@ -111,8 +111,8 @@ var genStyle = function genStyle(token) {
|
|
|
111
111
|
},
|
|
112
112
|
'.ant-segmented-item-selected': {
|
|
113
113
|
borderRadius: '8px',
|
|
114
|
-
backgroundColor: '
|
|
115
|
-
border: '1px solid
|
|
114
|
+
backgroundColor: 'var(--color-gray-bg-card-white) !important',
|
|
115
|
+
border: '1px solid var(--color-gray-border-light) !important',
|
|
116
116
|
boxShadow: '0px 0px 1px 0px rgba(0, 19, 41, 0.2), 0px 1.5px 4px -1px rgba(0, 19, 41, 0.04)',
|
|
117
117
|
'.ant-segmented-item-label': {
|
|
118
118
|
fontFamily: 'PingFang SC',
|
|
@@ -121,26 +121,26 @@ var genStyle = function genStyle(token) {
|
|
|
121
121
|
lineHeight: '20px',
|
|
122
122
|
letterSpacing: '0em',
|
|
123
123
|
fontVariationSettings: '"opsz" auto',
|
|
124
|
-
/* gray/gray-文本-默认 */ /* 样式描述:--gray-a12 */ color: '
|
|
124
|
+
/* gray/gray-文本-默认 */ /* 样式描述:--gray-a12 */ color: 'var(--color-gray-text-default) !important'
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}), _define_property(_obj1, // Dark theme styles
|
|
129
129
|
'&-dark', (_obj = {}, _define_property(_obj, "".concat(token.componentCls, "-region-filter"), _define_property({}, "".concat(token.componentCls, "-region-dropdown-btn"), _define_property({
|
|
130
|
-
border: '1px solid
|
|
131
|
-
backgroundColor: '
|
|
130
|
+
border: '1px solid var(--color-gray-border-dark)',
|
|
131
|
+
backgroundColor: 'var(--color-gray-bg-page-dark)',
|
|
132
132
|
color: 'rgba(255, 255, 255, 0.85)',
|
|
133
133
|
'&:hover': _define_property({
|
|
134
|
-
borderColor: '
|
|
135
|
-
color: '
|
|
136
|
-
backgroundColor: '
|
|
134
|
+
borderColor: 'var(--color-gray-text-light)',
|
|
135
|
+
color: 'var(--color-gray-bg-card-white)',
|
|
136
|
+
backgroundColor: 'var(--color-gray-bg-page-dark)'
|
|
137
137
|
}, "".concat(token.componentCls, "-dropdown-icon"), {
|
|
138
138
|
color: 'rgba(255, 255, 255, 0.8)'
|
|
139
139
|
})
|
|
140
140
|
}, "".concat(token.componentCls, "-dropdown-icon"), {
|
|
141
141
|
color: 'rgba(255, 255, 255, 0.65)'
|
|
142
142
|
}))), _define_property(_obj, "".concat(token.componentCls, "-segmented-filter"), {
|
|
143
|
-
backgroundColor: '
|
|
143
|
+
backgroundColor: 'var(--color-gray-bg-page-dark)',
|
|
144
144
|
'&.custom-segmented': {
|
|
145
145
|
'.ant-segmented-item': {
|
|
146
146
|
'.ant-segmented-item-label': {
|
|
@@ -148,14 +148,14 @@ var genStyle = function genStyle(token) {
|
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
'.ant-segmented-item-selected': {
|
|
151
|
-
backgroundColor: '
|
|
152
|
-
border: '1px solid
|
|
151
|
+
backgroundColor: 'var(--color-gray-bg-card-white) !important',
|
|
152
|
+
border: '1px solid var(--color-gray-border-dark) !important',
|
|
153
153
|
'.ant-segmented-item-label': {
|
|
154
|
-
color: '
|
|
154
|
+
color: 'var(--color-gray-text-default) !important'
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
'.ant-segmented-thumb': {
|
|
158
|
-
backgroundColor: '
|
|
158
|
+
backgroundColor: 'var(--color-gray-bg-page-dark) !important'
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
}), _obj)), // Compact variant for toolbar integration
|
|
@@ -65,7 +65,7 @@ var genStyle = function genStyle(token) {
|
|
|
65
65
|
lineHeight: '24px',
|
|
66
66
|
letterSpacing: '0em',
|
|
67
67
|
fontVariationSettings: '"opsz" auto',
|
|
68
|
-
color: '
|
|
68
|
+
color: 'var(--color-gray-text-default)',
|
|
69
69
|
flex: 1,
|
|
70
70
|
overflow: 'hidden',
|
|
71
71
|
textOverflow: 'ellipsis',
|
|
@@ -80,7 +80,7 @@ var genStyle = function genStyle(token) {
|
|
|
80
80
|
gap: '8px'
|
|
81
81
|
}, _define_property(_obj, "".concat(token.componentCls, "-time-icon"), {
|
|
82
82
|
fontSize: '14px',
|
|
83
|
-
color: '
|
|
83
|
+
color: 'var(--color-primary-text-default)',
|
|
84
84
|
marginRight: '2px'
|
|
85
85
|
}), _define_property(_obj, "".concat(token.componentCls, "-data-time"), {
|
|
86
86
|
fontFamily: 'PingFang SC',
|
|
@@ -109,12 +109,12 @@ var genStyle = function genStyle(token) {
|
|
|
109
109
|
}
|
|
110
110
|
}), _obj)), _define_property(_obj3, // Dark theme styles
|
|
111
111
|
'&-dark', (_obj2 = {}, _define_property(_obj2, "".concat(token.componentCls, "-header-title"), {
|
|
112
|
-
color: '
|
|
112
|
+
color: 'var(--color-gray-bg-card-white)',
|
|
113
113
|
overflow: 'hidden',
|
|
114
114
|
textOverflow: 'ellipsis',
|
|
115
115
|
whiteSpace: 'nowrap'
|
|
116
116
|
}), _define_property(_obj2, "".concat(token.componentCls, "-header-actions"), (_obj1 = {}, _define_property(_obj1, "".concat(token.componentCls, "-time-icon"), {
|
|
117
|
-
color: '
|
|
117
|
+
color: 'var(--color-gray-bg-card-white)'
|
|
118
118
|
}), _define_property(_obj1, "".concat(token.componentCls, "-data-time"), {
|
|
119
119
|
color: 'rgba(255, 255, 255, 0.65)'
|
|
120
120
|
}), _define_property(_obj1, "".concat(token.componentCls, "-download-btn, ").concat(token.componentCls, "-copy-btn"), {
|
|
@@ -103,6 +103,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
103
103
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
104
104
|
import { MarkdownEditor } from "../../../MarkdownEditor";
|
|
105
105
|
import { useEditorStore } from "../../../MarkdownEditor/editor/store";
|
|
106
|
+
import { useDetectTheme } from "../../chart/hooks";
|
|
106
107
|
import { useCodeEditorState, useRenderConditions, useToolbarConfig } from "../hooks";
|
|
107
108
|
import { openHtmlLocalPreview, openMarkdownLocalPreview } from "../utils/localPreview";
|
|
108
109
|
import { AceEditor, AceEditorContainer, CodeContainer, CodeToolbar, HtmlPreview, ThinkBlock } from "./index";
|
|
@@ -159,8 +160,9 @@ import { AceEditor, AceEditorContainer, CodeContainer, CodeToolbar, HtmlPreview,
|
|
|
159
160
|
var _useEditorStore = useEditorStore(), editorProps = _useEditorStore.editorProps, readonly = _useEditorStore.readonly;
|
|
160
161
|
// 使用状态管理Hook
|
|
161
162
|
var _useCodeEditorState = useCodeEditorState(props.element), state = _useCodeEditorState.state, update = _useCodeEditorState.update, path = _useCodeEditorState.path, handleCloseClick = _useCodeEditorState.handleCloseClick, handleHtmlPreviewClose = _useCodeEditorState.handleHtmlPreviewClose, handleShowBorderChange = _useCodeEditorState.handleShowBorderChange, handleHideChange = _useCodeEditorState.handleHideChange;
|
|
162
|
-
var
|
|
163
|
-
var
|
|
163
|
+
var detectedTheme = useDetectTheme();
|
|
164
|
+
var theme = detectedTheme === 'dark' ? 'chaos' : 'github';
|
|
165
|
+
var _useState = _sliced_to_array(useState(true), 2), isExpanded = _useState[0], setIsExpanded = _useState[1];
|
|
164
166
|
// 选中状态管理
|
|
165
167
|
var _React_useState = _sliced_to_array(React.useState(false), 2), isSelected = _React_useState[0], setIsSelected = _React_useState[1];
|
|
166
168
|
// 视图模式状态管理(用于HTML和Markdown)
|
|
@@ -173,13 +175,13 @@ import { AceEditor, AceEditorContainer, CodeContainer, CodeToolbar, HtmlPreview,
|
|
|
173
175
|
var hasJavaScript = language === 'html' && containsJavaScript(htmlValue);
|
|
174
176
|
// 如果禁用了 HTML 预览或包含 JavaScript,强制使用代码模式
|
|
175
177
|
var shouldDisablePreview = disableHtmlPreview || hasJavaScript;
|
|
176
|
-
var
|
|
178
|
+
var _useState1 = _sliced_to_array(useState(function() {
|
|
177
179
|
// 如果禁用了 HTML 预览或包含 JavaScript,强制使用代码模式
|
|
178
180
|
if (shouldDisablePreview && language === 'html') {
|
|
179
181
|
return 'code';
|
|
180
182
|
}
|
|
181
183
|
return language === 'html' || language === 'markdown' ? 'preview' : 'code';
|
|
182
|
-
}), 2), viewMode =
|
|
184
|
+
}), 2), viewMode = _useState1[0], setViewMode = _useState1[1];
|
|
183
185
|
// 使用Ace编辑器Hook
|
|
184
186
|
var _AceEditor = AceEditor({
|
|
185
187
|
element: props.element,
|
|
@@ -307,7 +309,6 @@ import { AceEditor, AceEditorContainer, CodeContainer, CodeToolbar, HtmlPreview,
|
|
|
307
309
|
onEditorClick: focusEditor
|
|
308
310
|
}, !props.element.frontmatter && !((_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.hideToolBar) && /*#__PURE__*/ React.createElement(CodeToolbar, _object_spread({
|
|
309
311
|
theme: theme,
|
|
310
|
-
setTheme: setTheme,
|
|
311
312
|
isExpanded: isExpanded,
|
|
312
313
|
onExpandToggle: function onExpandToggle() {
|
|
313
314
|
return setIsExpanded(!isExpanded);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 提供代码块的各种操作功能,包括语言切换、复制、运行等
|
|
4
4
|
* @author Code Plugin Team
|
|
5
5
|
*/ import { CloseCircleOutlined } from "@ant-design/icons";
|
|
6
|
-
import { ArrowUpRight, ChevronsUpDown, Copy
|
|
6
|
+
import { ArrowUpRight, ChevronsUpDown, Copy } from "@sofa-design/icons";
|
|
7
7
|
import { Segmented } from "antd";
|
|
8
8
|
import copy from "copy-to-clipboard";
|
|
9
9
|
import React, { useContext, useMemo } from "react";
|
|
@@ -77,14 +77,14 @@ import { LoadImage } from "./LoadImage";
|
|
|
77
77
|
* ```
|
|
78
78
|
*/ export var CodeToolbar = function CodeToolbar(props) {
|
|
79
79
|
var _ref;
|
|
80
|
-
var _editorProps_codeProps, _editorProps_codeProps1, _element_language, _element_language1, _i18n_locale, _i18n_locale1, _i18n_locale2, _i18n_locale3
|
|
80
|
+
var _editorProps_codeProps, _editorProps_codeProps1, _element_language, _element_language1, _i18n_locale, _i18n_locale1, _i18n_locale2, _i18n_locale3;
|
|
81
81
|
// 获取国际化上下文
|
|
82
82
|
var i18n = useContext(I18nContext);
|
|
83
83
|
// 获取编辑器配置
|
|
84
84
|
var editorProps = useEditorStore().editorProps;
|
|
85
85
|
var disableHtmlPreview = (_ref = (_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.disableHtmlPreview) !== null && _ref !== void 0 ? _ref : false;
|
|
86
86
|
var viewModeLabels = (_editorProps_codeProps1 = editorProps.codeProps) === null || _editorProps_codeProps1 === void 0 ? void 0 : _editorProps_codeProps1.viewModeLabels;
|
|
87
|
-
var element = props.element, readonly = props.readonly, onCloseClick = props.onCloseClick, languageSelectorProps = props.languageSelectorProps, onViewModeToggle = props.onViewModeToggle, theme = props.theme, isExpanded = props.isExpanded, onExpandToggle = props.onExpandToggle,
|
|
87
|
+
var element = props.element, readonly = props.readonly, onCloseClick = props.onCloseClick, languageSelectorProps = props.languageSelectorProps, onViewModeToggle = props.onViewModeToggle, theme = props.theme, isExpanded = props.isExpanded, onExpandToggle = props.onExpandToggle, _props_viewMode = props.viewMode, viewMode = _props_viewMode === void 0 ? 'code' : _props_viewMode, onLocalPreview = props.onLocalPreview;
|
|
88
88
|
// 检测 HTML 代码中是否包含 JavaScript
|
|
89
89
|
var hasJavaScript = useMemo(function() {
|
|
90
90
|
var _element_language;
|
|
@@ -187,14 +187,8 @@ import { LoadImage } from "./LoadImage";
|
|
|
187
187
|
return onViewModeToggle === null || onViewModeToggle === void 0 ? void 0 : onViewModeToggle(value);
|
|
188
188
|
}
|
|
189
189
|
}) : null, /*#__PURE__*/ React.createElement(ActionIconBox, {
|
|
190
|
-
title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale1 = i18n.locale) === null || _i18n_locale1 === void 0 ? void 0 : _i18n_locale1.theme) || '主题',
|
|
191
190
|
theme: theme === 'chaos' ? 'dark' : 'light',
|
|
192
|
-
|
|
193
|
-
setTheme(theme === 'github' ? 'chaos' : 'github');
|
|
194
|
-
}
|
|
195
|
-
}, /*#__PURE__*/ React.createElement(Moon, null)), /*#__PURE__*/ React.createElement(ActionIconBox, {
|
|
196
|
-
theme: theme === 'chaos' ? 'dark' : 'light',
|
|
197
|
-
title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale2 = i18n.locale) === null || _i18n_locale2 === void 0 ? void 0 : _i18n_locale2.copy) || '复制',
|
|
191
|
+
title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale1 = i18n.locale) === null || _i18n_locale1 === void 0 ? void 0 : _i18n_locale1.copy) || '复制',
|
|
198
192
|
style: {
|
|
199
193
|
fontSize: '1em',
|
|
200
194
|
lineHeight: '1.75em',
|
|
@@ -211,13 +205,13 @@ import { LoadImage } from "./LoadImage";
|
|
|
211
205
|
}
|
|
212
206
|
}
|
|
213
207
|
}, /*#__PURE__*/ React.createElement(Copy, null)), /*#__PURE__*/ React.createElement(ActionIconBox, {
|
|
214
|
-
title: (i18n === null || i18n === void 0 ? void 0 : (
|
|
208
|
+
title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale2 = i18n.locale) === null || _i18n_locale2 === void 0 ? void 0 : _i18n_locale2.expandCollapse) || '展开/收起',
|
|
215
209
|
theme: theme === 'chaos' ? 'dark' : 'light',
|
|
216
210
|
onClick: function onClick() {
|
|
217
211
|
onExpandToggle === null || onExpandToggle === void 0 ? void 0 : onExpandToggle();
|
|
218
212
|
}
|
|
219
213
|
}, /*#__PURE__*/ React.createElement(ChevronsUpDown, null)), ((element === null || element === void 0 ? void 0 : element.language) === 'html' || (element === null || element === void 0 ? void 0 : element.language) === 'markdown') && onLocalPreview && /*#__PURE__*/ React.createElement(ActionIconBox, {
|
|
220
|
-
title: (i18n === null || i18n === void 0 ? void 0 : (
|
|
214
|
+
title: (i18n === null || i18n === void 0 ? void 0 : (_i18n_locale3 = i18n.locale) === null || _i18n_locale3 === void 0 ? void 0 : _i18n_locale3.localPreview) || '本地预览',
|
|
221
215
|
theme: theme === 'chaos' ? 'dark' : 'light',
|
|
222
216
|
onClick: function onClick(e) {
|
|
223
217
|
e.stopPropagation();
|
|
@@ -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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
170
|
+
color: 'var(--color-gray-text-default)'
|
|
171
171
|
}), _define_property(_obj1, "".concat(token.componentCls, "-error"), {
|
|
172
|
-
background: '
|
|
173
|
-
border: '1px solid
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
232
|
+
color: 'var(--color-gray-text-default)'
|
|
233
233
|
}), _define_property(_obj1, "".concat(token.componentCls, " .ace_editor.ace_dark"), {
|
|
234
|
-
background: '
|
|
235
|
-
color: '
|
|
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: '
|
|
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
|
|
248
|
-
borderTop: '2px solid
|
|
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',
|
|
@@ -128,7 +128,7 @@ var genStyle = function genStyle(token) {
|
|
|
128
128
|
'&-icon': {
|
|
129
129
|
width: 15,
|
|
130
130
|
height: 15,
|
|
131
|
-
color:
|
|
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:
|
|
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: '
|
|
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%),
|
|
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: '
|
|
251
|
+
color: 'var(--color-gray-text-default)'
|
|
252
252
|
},
|
|
253
253
|
'&-action': {
|
|
254
254
|
opacity: 0,
|
package/dist/ToolUseBar/style.js
CHANGED
|
@@ -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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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
|
|
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
|
|
375
|
+
color: 'var(--color-yellow-text-secondary)'
|
|
376
376
|
},
|
|
377
377
|
'&-tool-error': {
|
|
378
378
|
'&-tool-image-wrapper': {
|
|
379
379
|
'& .anticon': {
|
|
380
|
-
color: '
|
|
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: '
|
|
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;
|