@ant-design/agentic-ui 2.30.9 → 2.30.11
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/ChatLayout/style.js +16 -13
- package/dist/Components/ActionIconBox/index.js +4 -0
- package/dist/Components/Button/IconButton/style.js +1 -1
- package/dist/Components/Button/ToggleButton/style.js +1 -1
- package/dist/Constants/mobile.d.ts +2 -2
- package/dist/Constants/mobile.js +1 -1
- package/dist/History/style.js +2 -2
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +2 -1
- package/dist/MarkdownEditor/editor/Editor.js +22 -6
- package/dist/MarkdownEditor/editor/elements/Paragraph/index.js +27 -5
- package/dist/MarkdownEditor/editor/style.js +7 -3
- package/dist/MarkdownEditor/editor/tools/JinjaTemplatePanel/index.js +2 -2
- package/dist/MarkdownEditor/editor/utils/findMatchingClose.js +38 -18
- package/dist/MarkdownEditor/style.js +13 -2
- package/dist/MarkdownEditor/types.d.ts +11 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileIcon.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +3 -3
- package/dist/MarkdownInputField/FileMapView/style.js +3 -2
- package/dist/MarkdownInputField/SkillModeBar/style.js +1 -1
- package/dist/MarkdownInputField/style.js +1 -1
- package/dist/MarkdownRenderer/MarkdownRenderer.js +3 -2
- package/dist/MarkdownRenderer/index.d.ts +1 -1
- package/dist/MarkdownRenderer/markdownReactShared.d.ts +35 -28
- package/dist/MarkdownRenderer/markdownReactShared.js +181 -60
- package/dist/MarkdownRenderer/renderers/MermaidRenderer.d.ts +2 -2
- package/dist/MarkdownRenderer/renderers/MermaidRenderer.js +162 -5
- package/dist/MarkdownRenderer/streaming/useStreamingMarkdownReact.js +3 -2
- package/dist/MarkdownRenderer/types.d.ts +21 -0
- package/dist/MarkdownRenderer/useStreaming.js +50 -15
- package/dist/Plugins/mermaid/Mermaid.d.ts +2 -28
- package/dist/Plugins/mermaid/Mermaid.js +13 -30
- package/dist/Plugins/mermaid/MermaidFallback.d.ts +5 -2
- package/dist/Plugins/mermaid/MermaidFallback.js +13 -10
- package/dist/Plugins/mermaid/MermaidRendererImpl.d.ts +0 -4
- package/dist/Plugins/mermaid/MermaidRendererImpl.js +15 -22
- package/dist/Plugins/mermaid/style.d.ts +0 -5
- package/dist/Plugins/mermaid/style.js +18 -71
- package/dist/ThoughtChainList/style.js +1 -1
- package/dist/ToolUseBarThink/style.js +1 -1
- package/dist/Workspace/Browser/index.d.ts +6 -0
- package/dist/Workspace/Browser/index.js +22 -13
- package/dist/Workspace/Browser/style.js +14 -15
- package/dist/Workspace/File/FileComponent.js +4 -4
- package/dist/Workspace/File/PreviewComponent.js +4 -4
- package/dist/Workspace/File/style.js +33 -39
- package/dist/Workspace/RealtimeFollow/style.js +78 -85
- package/dist/Workspace/style.js +41 -53
- package/package.json +3 -3
|
@@ -53,7 +53,6 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
import { useEditorStyleRegister } from "../../Hooks/useStyle";
|
|
54
54
|
var genStyle = function genStyle(token) {
|
|
55
55
|
return _define_property({}, token.componentCls, {
|
|
56
|
-
// 主容器样式
|
|
57
56
|
marginBottom: '0.75em',
|
|
58
57
|
cursor: 'default',
|
|
59
58
|
userSelect: 'none',
|
|
@@ -68,23 +67,21 @@ var genStyle = function genStyle(token) {
|
|
|
68
67
|
justifyContent: 'center',
|
|
69
68
|
alignItems: 'center',
|
|
70
69
|
flexDirection: 'column',
|
|
71
|
-
// 增加隔离:防止内容溢出影响其他元素
|
|
72
70
|
position: 'relative',
|
|
73
71
|
isolation: 'isolate',
|
|
74
72
|
contain: 'layout style paint',
|
|
75
73
|
overflow: 'hidden',
|
|
76
|
-
|
|
74
|
+
transition: 'height 0.3s ease, min-height 0.3s ease',
|
|
77
75
|
'& [data-mermaid-container="true"]': {
|
|
78
76
|
width: '100%',
|
|
79
77
|
display: 'flex',
|
|
80
78
|
justifyContent: 'center',
|
|
81
|
-
// 增加隔离样式
|
|
82
79
|
position: 'relative',
|
|
83
80
|
isolation: 'isolate',
|
|
84
81
|
contain: 'layout style paint',
|
|
85
|
-
overflow: 'hidden'
|
|
82
|
+
overflow: 'hidden',
|
|
83
|
+
transition: 'opacity 0.3s ease, height 0.3s ease, min-height 0.3s ease, max-height 0.3s ease'
|
|
86
84
|
},
|
|
87
|
-
// SVG 包装器样式(用于动态创建的 wrapper)
|
|
88
85
|
'& [data-mermaid-wrapper]': {
|
|
89
86
|
position: 'relative',
|
|
90
87
|
width: '100%',
|
|
@@ -97,87 +94,47 @@ var genStyle = function genStyle(token) {
|
|
|
97
94
|
alignItems: 'center',
|
|
98
95
|
minHeight: '200px'
|
|
99
96
|
},
|
|
100
|
-
// SVG 元素样式
|
|
101
97
|
'& [data-mermaid-svg="true"]': {
|
|
102
98
|
maxWidth: '100%',
|
|
103
99
|
height: 'auto',
|
|
104
100
|
overflow: 'hidden'
|
|
105
101
|
},
|
|
106
|
-
// SVG 内部元素样式
|
|
107
|
-
'& [data-mermaid-internal="true"]': {
|
|
108
|
-
},
|
|
109
|
-
// 加载状态样式
|
|
110
|
-
'&-loading': {
|
|
111
|
-
textAlign: 'center',
|
|
112
|
-
color: '#6B7280',
|
|
113
|
-
padding: '0.5rem',
|
|
114
|
-
position: 'relative',
|
|
115
|
-
zIndex: 1,
|
|
116
|
-
width: '100%',
|
|
117
|
-
display: 'flex',
|
|
118
|
-
justifyContent: 'center',
|
|
119
|
-
alignItems: 'center',
|
|
120
|
-
minHeight: '200px',
|
|
121
|
-
// Skeleton 样式优化
|
|
122
|
-
'& .ant-skeleton': {
|
|
123
|
-
width: '100%',
|
|
124
|
-
maxWidth: '800px'
|
|
125
|
-
},
|
|
126
|
-
'& .ant-skeleton-image': {
|
|
127
|
-
width: '100%',
|
|
128
|
-
minHeight: '200px',
|
|
129
|
-
borderRadius: '12px'
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
// 错误状态样式
|
|
133
102
|
'&-error': {
|
|
134
103
|
textAlign: 'center',
|
|
135
104
|
color: 'rgba(239, 68, 68, 0.8)',
|
|
136
105
|
padding: '0.5rem',
|
|
137
106
|
flex: 1,
|
|
138
|
-
// 错误信息也增加隔离
|
|
139
107
|
position: 'relative',
|
|
140
108
|
zIndex: 1,
|
|
141
109
|
wordBreak: 'break-word',
|
|
142
110
|
maxWidth: '100%',
|
|
143
111
|
height: '100%',
|
|
144
|
-
width: '100%'
|
|
112
|
+
width: '100%',
|
|
113
|
+
animation: 'agenticMermaidFadeIn 0.3s ease'
|
|
145
114
|
},
|
|
146
|
-
// 空状态样式
|
|
147
115
|
'&-empty': {
|
|
148
|
-
textAlign: '
|
|
116
|
+
textAlign: 'left',
|
|
149
117
|
color: '#6B7280',
|
|
150
|
-
padding: '0.5rem',
|
|
118
|
+
padding: '0.75rem 1.5rem',
|
|
151
119
|
position: 'relative',
|
|
152
120
|
zIndex: 1,
|
|
153
121
|
flex: 1,
|
|
154
122
|
height: '100%',
|
|
155
|
-
width: '100%'
|
|
156
|
-
},
|
|
157
|
-
// Fallback 组件样式
|
|
158
|
-
'&-fallback': {
|
|
159
|
-
marginBottom: '0.75em',
|
|
160
|
-
padding: '0.75rem 0',
|
|
161
|
-
display: 'flex',
|
|
162
|
-
justifyContent: 'center',
|
|
163
|
-
alignItems: 'center',
|
|
164
|
-
color: '#6B7280',
|
|
165
123
|
width: '100%',
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
124
|
+
fontFamily: "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",
|
|
125
|
+
fontSize: '0.875em',
|
|
126
|
+
lineHeight: 1.7,
|
|
127
|
+
animation: 'agenticMermaidFadeIn 0.3s ease'
|
|
128
|
+
},
|
|
129
|
+
'@keyframes agenticMermaidFadeIn': {
|
|
130
|
+
from: {
|
|
131
|
+
opacity: 0
|
|
171
132
|
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
minHeight: '200px',
|
|
175
|
-
borderRadius: '12px'
|
|
133
|
+
to: {
|
|
134
|
+
opacity: 1
|
|
176
135
|
}
|
|
177
136
|
},
|
|
178
|
-
// SVG 渲染优化样式
|
|
179
137
|
'& svg': {
|
|
180
|
-
// 节点样式
|
|
181
138
|
'& .node': {
|
|
182
139
|
'& rect, & circle, & ellipse, & polygon': {
|
|
183
140
|
stroke: '#333',
|
|
@@ -185,37 +142,27 @@ var genStyle = function genStyle(token) {
|
|
|
185
142
|
fill: '#fff'
|
|
186
143
|
}
|
|
187
144
|
},
|
|
188
|
-
// 强制设置所有文字样式
|
|
189
145
|
'& text': {
|
|
190
|
-
// 确保文字不会被裁剪
|
|
191
146
|
dominantBaseline: 'middle',
|
|
192
147
|
textAnchor: 'middle'
|
|
193
148
|
},
|
|
194
|
-
// 节点标签 - 更大的字体
|
|
195
149
|
'& .nodeLabel': {
|
|
196
150
|
fontWeight: 500,
|
|
197
151
|
fill: '#333 !important'
|
|
198
152
|
},
|
|
199
|
-
// 边标签 - 稍小一些但仍然清晰
|
|
200
153
|
'& .edgeLabel': {
|
|
201
154
|
fill: '#666 !important'
|
|
202
155
|
},
|
|
203
|
-
// 专门针对流程图的文字
|
|
204
156
|
'& .flowchart-label': {
|
|
205
157
|
fill: '#333 !important'
|
|
206
158
|
},
|
|
207
|
-
// 针对不同类型的标签
|
|
208
159
|
'& .label': {
|
|
209
160
|
fill: '#333 !important'
|
|
210
161
|
}
|
|
211
162
|
}
|
|
212
163
|
});
|
|
213
164
|
};
|
|
214
|
-
|
|
215
|
-
* Mermaid 插件样式 Hook
|
|
216
|
-
* @param prefixCls - 样式类名前缀
|
|
217
|
-
* @returns 样式相关的 wrapSSR 和 hashId
|
|
218
|
-
*/ export function useStyle(prefixCls) {
|
|
165
|
+
export function useStyle(prefixCls) {
|
|
219
166
|
return useEditorStyleRegister('agentic-plugin-mermaid', function(token) {
|
|
220
167
|
var editorToken = _object_spread_props(_object_spread({}, token), {
|
|
221
168
|
componentCls: ".".concat(prefixCls)
|
|
@@ -87,7 +87,7 @@ var genStyle = function genStyle(token) {
|
|
|
87
87
|
zIndex: 1,
|
|
88
88
|
backgroundSize: '150%',
|
|
89
89
|
backgroundPosition: '0 0',
|
|
90
|
-
backgroundImage: "conic-gradient(\n from var(--angle) at 50% 50%,\n rgba(46, 255, 127, 0.7) 0deg,\n rgba(120, 133, 255, 1) 90deg,\n rgba(255, 0, 153, 0.4) 180deg,\n rgba(0, 221, 255, 0.62) 270deg,\n rgba(46, 255, 127, 0.7) 360deg\n )",
|
|
90
|
+
backgroundImage: "conic-gradient(\n from var(--angle, 0deg) at 50% 50%,\n rgba(46, 255, 127, 0.7) 0deg,\n rgba(120, 133, 255, 1) 90deg,\n rgba(255, 0, 153, 0.4) 180deg,\n rgba(0, 221, 255, 0.62) 270deg,\n rgba(46, 255, 127, 0.7) 360deg\n )",
|
|
91
91
|
animationName: 'spin',
|
|
92
92
|
animationDuration: '2s',
|
|
93
93
|
animationTimingFunction: 'linear',
|
|
@@ -20,6 +20,7 @@ export interface BrowserItemProps {
|
|
|
20
20
|
itemStyle?: React.CSSProperties;
|
|
21
21
|
className?: string;
|
|
22
22
|
onLocate?: (item: BrowserItem) => void;
|
|
23
|
+
onOpen?: (item: BrowserItem) => void;
|
|
23
24
|
}
|
|
24
25
|
export declare const BrowserItemComponent: React.FC<BrowserItemProps>;
|
|
25
26
|
export interface BrowserHeaderProps {
|
|
@@ -38,6 +39,7 @@ export interface BrowserListProps {
|
|
|
38
39
|
loading?: boolean;
|
|
39
40
|
loadingText?: string;
|
|
40
41
|
onLocate?: (item: BrowserItem) => void;
|
|
42
|
+
onOpen?: (item: BrowserItem) => void;
|
|
41
43
|
}
|
|
42
44
|
export declare const BrowserList: React.FC<BrowserListProps>;
|
|
43
45
|
export type BrowserProps = {
|
|
@@ -57,6 +59,10 @@ export type BrowserProps = {
|
|
|
57
59
|
emptyText?: string;
|
|
58
60
|
loadingText?: string;
|
|
59
61
|
onLocate?: (item: BrowserItem) => void;
|
|
62
|
+
/**
|
|
63
|
+
* 点击链接时的回调,提供后将拦截默认的新标签页打开行为
|
|
64
|
+
*/
|
|
65
|
+
onOpen?: (item: BrowserItem) => void;
|
|
60
66
|
};
|
|
61
67
|
declare const Browser: React.FC<BrowserProps>;
|
|
62
68
|
export default Browser;
|
|
@@ -147,10 +147,15 @@ var useBrowserContext = function useBrowserContext() {
|
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
149
|
export var BrowserItemComponent = function BrowserItemComponent(param) {
|
|
150
|
-
var item = param.item, _param_itemStyle = param.itemStyle, itemStyle = _param_itemStyle === void 0 ? SUGGESTION_ITEM_STYLE : _param_itemStyle, className = param.className, onLocate = param.onLocate;
|
|
150
|
+
var item = param.item, _param_itemStyle = param.itemStyle, itemStyle = _param_itemStyle === void 0 ? SUGGESTION_ITEM_STYLE : _param_itemStyle, className = param.className, onLocate = param.onLocate, onOpen = param.onOpen;
|
|
151
151
|
var _useBrowserContext = useBrowserContext(), prefixCls = _useBrowserContext.prefixCls, wrapSSR = _useBrowserContext.wrapSSR, hashId = _useBrowserContext.hashId;
|
|
152
152
|
var locale = useContext(I18nContext).locale;
|
|
153
|
-
var
|
|
153
|
+
var handleOpen = function handleOpen(e) {
|
|
154
|
+
if (onOpen) {
|
|
155
|
+
e.preventDefault();
|
|
156
|
+
onOpen(item);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
154
159
|
window.open(item.url, '_blank', 'noopener,noreferrer');
|
|
155
160
|
};
|
|
156
161
|
var handleLocate = function handleLocate(e) {
|
|
@@ -185,12 +190,13 @@ export var BrowserItemComponent = function BrowserItemComponent(param) {
|
|
|
185
190
|
rel: "noreferrer",
|
|
186
191
|
style: {
|
|
187
192
|
color: 'inherit'
|
|
188
|
-
}
|
|
193
|
+
},
|
|
194
|
+
onClick: handleOpen
|
|
189
195
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
190
196
|
className: classNames("".concat(prefixCls, "-result-item-title"), hashId)
|
|
191
197
|
}, item.title)))), /*#__PURE__*/ React.createElement("div", {
|
|
192
198
|
className: classNames("".concat(prefixCls, "-result-item-site"), hashId),
|
|
193
|
-
onClick:
|
|
199
|
+
onClick: handleOpen
|
|
194
200
|
}, renderSiteAvatar(item.site, item.icon), /*#__PURE__*/ React.createElement(Tooltip, {
|
|
195
201
|
title: item.site,
|
|
196
202
|
mouseEnterDelay: 1
|
|
@@ -207,7 +213,7 @@ export var BrowserHeader = function BrowserHeader(param) {
|
|
|
207
213
|
type: "text",
|
|
208
214
|
icon: /*#__PURE__*/ React.createElement(ArrowLeft, {
|
|
209
215
|
style: {
|
|
210
|
-
color: 'var(--color-gray-text-quaternary)'
|
|
216
|
+
color: 'var(--color-gray-text-quaternary, var(--color-gray-text-light, #767e8b))'
|
|
211
217
|
}
|
|
212
218
|
}),
|
|
213
219
|
onClick: onBack
|
|
@@ -219,7 +225,7 @@ export var BrowserHeader = function BrowserHeader(param) {
|
|
|
219
225
|
}, activeLabel))));
|
|
220
226
|
};
|
|
221
227
|
export var BrowserList = function BrowserList(param) {
|
|
222
|
-
var items = param.items, activeLabel = param.activeLabel, onBack = param.onBack, customHeader = param.customHeader, _param_showHeader = param.showHeader, showHeader = _param_showHeader === void 0 ? true : _param_showHeader, countFormatter = param.countFormatter, emptyText = param.emptyText, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, loadingText = param.loadingText, onLocate = param.onLocate;
|
|
228
|
+
var items = param.items, activeLabel = param.activeLabel, onBack = param.onBack, customHeader = param.customHeader, _param_showHeader = param.showHeader, showHeader = _param_showHeader === void 0 ? true : _param_showHeader, countFormatter = param.countFormatter, emptyText = param.emptyText, _param_loading = param.loading, loading = _param_loading === void 0 ? false : _param_loading, loadingText = param.loadingText, onLocate = param.onLocate, onOpen = param.onOpen;
|
|
223
229
|
var _useBrowserContext = useBrowserContext(), prefixCls = _useBrowserContext.prefixCls, wrapSSR = _useBrowserContext.wrapSSR, hashId = _useBrowserContext.hashId;
|
|
224
230
|
var locale = useContext(I18nContext).locale;
|
|
225
231
|
var safeItems = Array.isArray(items) ? items : [];
|
|
@@ -266,17 +272,19 @@ export var BrowserList = function BrowserList(param) {
|
|
|
266
272
|
item: item,
|
|
267
273
|
className: classNames("".concat(prefixCls, "-result-item"), hashId),
|
|
268
274
|
itemStyle: SUGGESTION_ITEM_STYLE,
|
|
269
|
-
onLocate: onLocate
|
|
275
|
+
onLocate: onLocate,
|
|
276
|
+
onOpen: onOpen
|
|
270
277
|
});
|
|
271
278
|
},
|
|
272
279
|
footer: null
|
|
273
280
|
})));
|
|
274
281
|
};
|
|
275
282
|
var Browser = function Browser(param) {
|
|
276
|
-
var suggestions = param.suggestions, request = param.request, suggestionIcon = param.suggestionIcon, countFormatter = param.countFormatter, emptyText = param.emptyText, loadingText = param.loadingText, onLocate = param.onLocate;
|
|
277
|
-
var
|
|
278
|
-
var
|
|
279
|
-
var
|
|
283
|
+
var suggestions = param.suggestions, request = param.request, suggestionIcon = param.suggestionIcon, countFormatter = param.countFormatter, emptyText = param.emptyText, loadingText = param.loadingText, onLocate = param.onLocate, onOpen = param.onOpen;
|
|
284
|
+
var isSingleSuggestion = suggestions.length === 1;
|
|
285
|
+
var _useState = _sliced_to_array(useState(isSingleSuggestion ? 'results' : 'suggestions'), 2), currentView = _useState[0], setCurrentView = _useState[1];
|
|
286
|
+
var _useState1 = _sliced_to_array(useState(isSingleSuggestion ? suggestions[0] : null), 2), activeSuggestion = _useState1[0], setActiveSuggestion = _useState1[1];
|
|
287
|
+
var _useState2 = _sliced_to_array(useState(isSingleSuggestion ? suggestions[0].label : ''), 2), activeLabel = _useState2[0], setActiveLabel = _useState2[1];
|
|
280
288
|
var locale = useContext(I18nContext).locale;
|
|
281
289
|
var _useBrowserContext = useBrowserContext(), prefixCls = _useBrowserContext.prefixCls, wrapSSR = _useBrowserContext.wrapSSR, hashId = _useBrowserContext.hashId;
|
|
282
290
|
var _useMemo = useMemo(function() {
|
|
@@ -336,14 +344,15 @@ var Browser = function Browser(param) {
|
|
|
336
344
|
})), currentView === 'results' && /*#__PURE__*/ React.createElement(BrowserList, {
|
|
337
345
|
items: results,
|
|
338
346
|
activeLabel: activeLabel,
|
|
339
|
-
onBack: function
|
|
347
|
+
onBack: isSingleSuggestion ? undefined : function() {
|
|
340
348
|
return setCurrentView('suggestions');
|
|
341
349
|
},
|
|
342
350
|
countFormatter: countFormatter,
|
|
343
351
|
emptyText: emptyText,
|
|
344
352
|
loading: loading,
|
|
345
353
|
loadingText: loadingText,
|
|
346
|
-
onLocate: onLocate
|
|
354
|
+
onLocate: onLocate,
|
|
355
|
+
onOpen: onOpen
|
|
347
356
|
})));
|
|
348
357
|
};
|
|
349
358
|
export default Browser;
|
|
@@ -64,7 +64,7 @@ var fadeInUp = new Keyframes('fadeInUp', {
|
|
|
64
64
|
});
|
|
65
65
|
var genStyle = function genStyle(token) {
|
|
66
66
|
var componentCls = token.componentCls;
|
|
67
|
-
var _obj, _obj1, _obj2;
|
|
67
|
+
var _obj, _obj1, _obj2, _obj3;
|
|
68
68
|
return _define_property({}, componentCls, {
|
|
69
69
|
'&-suggestion': (_obj1 = {
|
|
70
70
|
'&:hover': {
|
|
@@ -94,21 +94,20 @@ var genStyle = function genStyle(token) {
|
|
|
94
94
|
font: 'var(--font-text-body-sm)',
|
|
95
95
|
letterSpacing: 'var(--letter-spacing-body-sm, normal)',
|
|
96
96
|
color: 'var(--color-gray-text-secondary)'
|
|
97
|
-
}), _obj)), _define_property(_obj1,
|
|
97
|
+
}), _obj)), _define_property(_obj1, "".concat(token.antCls, "-tag"), {
|
|
98
98
|
marginInlineEnd: '0'
|
|
99
99
|
}), _obj1),
|
|
100
|
-
'&-header':
|
|
100
|
+
'&-header': (_obj2 = {
|
|
101
101
|
display: 'flex',
|
|
102
102
|
alignItems: 'center',
|
|
103
103
|
justifyContent: 'space-between',
|
|
104
104
|
height: '48px',
|
|
105
105
|
width: 'calc(100% - 20px)',
|
|
106
106
|
padding: '8px',
|
|
107
|
-
margin: '4px'
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}, "".concat(componentCls, "-header-left"), _define_property({
|
|
107
|
+
margin: '4px'
|
|
108
|
+
}, _define_property(_obj2, "".concat(token.antCls, "-tag"), {
|
|
109
|
+
marginInlineEnd: '0'
|
|
110
|
+
}), _define_property(_obj2, "".concat(componentCls, "-header-left"), _define_property({
|
|
112
111
|
display: 'flex',
|
|
113
112
|
alignItems: 'center',
|
|
114
113
|
gap: '4px',
|
|
@@ -125,12 +124,12 @@ var genStyle = function genStyle(token) {
|
|
|
125
124
|
textOverflow: 'ellipsis',
|
|
126
125
|
whiteSpace: 'nowrap',
|
|
127
126
|
color: 'var(--color-gray-text-default)'
|
|
128
|
-
})),
|
|
127
|
+
})), _obj2),
|
|
129
128
|
'&-header-wrapper': {
|
|
130
129
|
marginLeft: '-12px',
|
|
131
130
|
marginRight: '-12px'
|
|
132
131
|
},
|
|
133
|
-
'&-result-item': (
|
|
132
|
+
'&-result-item': (_obj3 = {
|
|
134
133
|
width: '100%',
|
|
135
134
|
overflow: 'hidden',
|
|
136
135
|
padding: '4px',
|
|
@@ -142,7 +141,7 @@ var genStyle = function genStyle(token) {
|
|
|
142
141
|
borderRadius: '12px',
|
|
143
142
|
background: 'var(--color-gray-control-fill-hover)'
|
|
144
143
|
}
|
|
145
|
-
}, _define_property(
|
|
144
|
+
}, _define_property(_obj3, "".concat(componentCls, "-result-item-title"), {
|
|
146
145
|
fontSize: '12px',
|
|
147
146
|
color: 'var(--color-gray-text-default)',
|
|
148
147
|
display: 'block',
|
|
@@ -150,17 +149,17 @@ var genStyle = function genStyle(token) {
|
|
|
150
149
|
overflow: 'hidden',
|
|
151
150
|
textOverflow: 'ellipsis',
|
|
152
151
|
whiteSpace: 'nowrap'
|
|
153
|
-
}), _define_property(
|
|
152
|
+
}), _define_property(_obj3, "".concat(componentCls, "-result-item-title-wrapper"), {
|
|
154
153
|
overflow: 'hidden',
|
|
155
154
|
textOverflow: 'ellipsis',
|
|
156
155
|
whiteSpace: 'nowrap',
|
|
157
156
|
fontSize: '14px',
|
|
158
157
|
color: 'var(--color-gray-text-default)'
|
|
159
|
-
}), _define_property(
|
|
158
|
+
}), _define_property(_obj3, "".concat(componentCls, "-result-item-site-text"), {
|
|
160
159
|
font: 'var(--font-text-paragraph-sm)',
|
|
161
160
|
letterSpacing: 'var(--letter-spacing-paragraph-sm, normal)',
|
|
162
161
|
color: 'var(--color-gray-text-light)'
|
|
163
|
-
}), _define_property(
|
|
162
|
+
}), _define_property(_obj3, "".concat(componentCls, "-result-item-site"), {
|
|
164
163
|
display: 'flex',
|
|
165
164
|
alignItems: 'center',
|
|
166
165
|
gap: '4px',
|
|
@@ -169,7 +168,7 @@ var genStyle = function genStyle(token) {
|
|
|
169
168
|
whiteSpace: 'nowrap',
|
|
170
169
|
fontSize: '12px',
|
|
171
170
|
cursor: 'pointer'
|
|
172
|
-
}),
|
|
171
|
+
}), _obj3)
|
|
173
172
|
});
|
|
174
173
|
};
|
|
175
174
|
export function useBrowserStyle(prefixCls) {
|
|
@@ -505,18 +505,18 @@ var FileItemComponent = function FileItemComponent(param) {
|
|
|
505
505
|
ellipsis: {
|
|
506
506
|
tooltip: fileWithId.name
|
|
507
507
|
}
|
|
508
|
-
}, fileWithId.name)), /*#__PURE__*/ React.createElement("div", {
|
|
508
|
+
}, fileWithId.name)), (fileWithId.renderDetails || fileTypeInfo.displayType || fileWithId.size || fileWithId.lastModified) && /*#__PURE__*/ React.createElement("div", {
|
|
509
509
|
className: classNames("".concat(finalPrefixCls, "-item-details"), hashId)
|
|
510
510
|
}, fileWithId.renderDetails ? fileWithId.renderDetails(renderContext) : /*#__PURE__*/ React.createElement(Typography.Text, {
|
|
511
511
|
type: "secondary",
|
|
512
512
|
ellipsis: true
|
|
513
|
-
}, /*#__PURE__*/ React.createElement("span", {
|
|
513
|
+
}, fileTypeInfo.displayType && /*#__PURE__*/ React.createElement("span", {
|
|
514
514
|
className: classNames("".concat(finalPrefixCls, "-item-type"), hashId)
|
|
515
|
-
}, fileTypeInfo.displayType
|
|
515
|
+
}, fileTypeInfo.displayType), fileWithId.size && /*#__PURE__*/ React.createElement(React.Fragment, null, fileTypeInfo.displayType && /*#__PURE__*/ React.createElement("span", {
|
|
516
516
|
className: classNames("".concat(finalPrefixCls, "-item-separator"), hashId)
|
|
517
517
|
}, "|"), /*#__PURE__*/ React.createElement("span", {
|
|
518
518
|
className: classNames("".concat(finalPrefixCls, "-item-size"), hashId)
|
|
519
|
-
}, formatFileSize(fileWithId.size))), fileWithId.lastModified && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", {
|
|
519
|
+
}, formatFileSize(fileWithId.size))), fileWithId.lastModified && /*#__PURE__*/ React.createElement(React.Fragment, null, (fileTypeInfo.displayType || fileWithId.size) && /*#__PURE__*/ React.createElement("span", {
|
|
520
520
|
className: classNames("".concat(finalPrefixCls, "-item-separator"), hashId)
|
|
521
521
|
}, "|"), /*#__PURE__*/ React.createElement("span", {
|
|
522
522
|
className: classNames("".concat(finalPrefixCls, "-item-time"), hashId)
|
|
@@ -309,18 +309,18 @@ var PlaceholderContent = function PlaceholderContent(param) {
|
|
|
309
309
|
font: 'var(--font-text-h6-base)',
|
|
310
310
|
color: 'var(--color-gray-text-default)'
|
|
311
311
|
}
|
|
312
|
-
}, file.name)), /*#__PURE__*/ React.createElement("div", {
|
|
312
|
+
}, file.name)), (fileTypeProcessor.inferFileType(file).displayType || file.size || file.lastModified) && /*#__PURE__*/ React.createElement("div", {
|
|
313
313
|
className: classNames("".concat(filePrefixCls, "-item-details"), hashId)
|
|
314
314
|
}, /*#__PURE__*/ React.createElement(Typography.Text, {
|
|
315
315
|
type: "secondary",
|
|
316
316
|
ellipsis: true
|
|
317
|
-
}, /*#__PURE__*/ React.createElement("span", {
|
|
317
|
+
}, fileTypeProcessor.inferFileType(file).displayType && /*#__PURE__*/ React.createElement("span", {
|
|
318
318
|
className: classNames("".concat(filePrefixCls, "-item-type"), hashId)
|
|
319
|
-
}, fileTypeProcessor.inferFileType(file).displayType
|
|
319
|
+
}, fileTypeProcessor.inferFileType(file).displayType), file.size && /*#__PURE__*/ React.createElement(React.Fragment, null, fileTypeProcessor.inferFileType(file).displayType && /*#__PURE__*/ React.createElement("span", {
|
|
320
320
|
className: classNames("".concat(filePrefixCls, "-item-separator"), hashId)
|
|
321
321
|
}, "|"), /*#__PURE__*/ React.createElement("span", {
|
|
322
322
|
className: classNames("".concat(filePrefixCls, "-item-size"), hashId)
|
|
323
|
-
}, formatFileSize(file.size))), file.lastModified && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", {
|
|
323
|
+
}, formatFileSize(file.size))), file.lastModified && /*#__PURE__*/ React.createElement(React.Fragment, null, (fileTypeProcessor.inferFileType(file).displayType || file.size) && /*#__PURE__*/ React.createElement("span", {
|
|
324
324
|
className: classNames("".concat(filePrefixCls, "-item-separator"), hashId)
|
|
325
325
|
}, "|"), /*#__PURE__*/ React.createElement("span", {
|
|
326
326
|
className: classNames("".concat(filePrefixCls, "-item-time"), hashId)
|
|
@@ -52,8 +52,8 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
import { useEditorStyleRegister } from "../../Hooks/useStyle";
|
|
54
54
|
var genStyle = function genStyle(token) {
|
|
55
|
-
var _obj, _obj1, _obj2, _obj3, _obj4, _obj5, _obj6;
|
|
56
|
-
return
|
|
55
|
+
var _obj, _obj1, _obj2, _obj3, _obj4, _obj5, _obj6, _obj7;
|
|
56
|
+
return _obj7 = {
|
|
57
57
|
// 定位高亮动画关键帧
|
|
58
58
|
'@keyframes flash-shadow': {
|
|
59
59
|
'0%,100%': {
|
|
@@ -64,7 +64,7 @@ var genStyle = function genStyle(token) {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}, // 文件组件样式
|
|
67
|
-
_define_property(
|
|
67
|
+
_define_property(_obj7, "".concat(token.componentCls, "-container"), // 分组展示模式
|
|
68
68
|
_define_property({
|
|
69
69
|
height: '100%',
|
|
70
70
|
display: 'flex',
|
|
@@ -126,7 +126,7 @@ var genStyle = function genStyle(token) {
|
|
|
126
126
|
}), // 分组内容区域
|
|
127
127
|
_define_property(_obj, "&-content", {
|
|
128
128
|
paddingLeft: '12px'
|
|
129
|
-
}), _obj)))), _define_property(
|
|
129
|
+
}), _obj)))), _define_property(_obj7, "".concat(token.componentCls, "-item"), (_obj3 = {
|
|
130
130
|
display: 'flex',
|
|
131
131
|
alignItems: 'center',
|
|
132
132
|
gap: '4px',
|
|
@@ -212,16 +212,16 @@ var genStyle = function genStyle(token) {
|
|
|
212
212
|
pointerEvents: 'none',
|
|
213
213
|
transition: 'opacity 0.2s ease, visibility 0.2s ease'
|
|
214
214
|
}, // 保持图标按钮颜色一致
|
|
215
|
-
_define_property(_obj1, ".
|
|
215
|
+
_define_property(_obj1, "".concat(token.antCls, "-btn, ").concat(token.antCls, "-btn .anticon"), {
|
|
216
216
|
color: 'var(--color-gray-text-light)'
|
|
217
|
-
}), _define_property(_obj1, ".
|
|
217
|
+
}), _define_property(_obj1, "".concat(token.antCls, "-btn:hover, ").concat(token.antCls, "-btn:focus, ").concat(token.antCls, "-btn:active, ").concat(token.antCls, "-btn:hover .anticon, ").concat(token.antCls, "-btn:focus .anticon, ").concat(token.antCls, "-btn:active .anticon"), {
|
|
218
218
|
color: 'var(--color-gray-text-light)'
|
|
219
219
|
}), _obj1)), _define_property(_obj3, "&-action-btn", (_obj2 = {}, _define_property(_obj2, ".anticon", {
|
|
220
220
|
color: 'var(--color-gray-text-light)'
|
|
221
221
|
}), _define_property(_obj2, '&:hover .anticon, &:focus .anticon, &:active .anticon', {
|
|
222
222
|
color: 'var(--color-gray-text-light)'
|
|
223
223
|
}), _obj2)), _obj3)), // 空状态
|
|
224
|
-
_define_property(
|
|
224
|
+
_define_property(_obj7, "".concat(token.componentCls, "-empty"), {
|
|
225
225
|
display: 'flex',
|
|
226
226
|
alignItems: 'center',
|
|
227
227
|
justifyContent: 'center',
|
|
@@ -229,7 +229,7 @@ var genStyle = function genStyle(token) {
|
|
|
229
229
|
padding: 24,
|
|
230
230
|
minHeight: 200,
|
|
231
231
|
flex: 1
|
|
232
|
-
}), _define_property(
|
|
232
|
+
}), _define_property(_obj7, "".concat(token.componentCls, "-preview"), (_obj5 = {
|
|
233
233
|
display: 'flex',
|
|
234
234
|
flexDirection: 'column',
|
|
235
235
|
height: '100%',
|
|
@@ -301,9 +301,9 @@ var genStyle = function genStyle(token) {
|
|
|
301
301
|
alignItems: 'center',
|
|
302
302
|
gap: '8px'
|
|
303
303
|
}, // 保持预览头部操作按钮的图标颜色一致
|
|
304
|
-
_define_property(_obj4, ".
|
|
304
|
+
_define_property(_obj4, "".concat(token.antCls, "-btn, ").concat(token.antCls, "-btn .anticon"), {
|
|
305
305
|
color: '#767E8B'
|
|
306
|
-
}), _define_property(_obj4, ".
|
|
306
|
+
}), _define_property(_obj4, "".concat(token.antCls, "-btn:hover, ").concat(token.antCls, "-btn:focus, ").concat(token.antCls, "-btn:active, ").concat(token.antCls, "-btn:hover .anticon, ").concat(token.antCls, "-btn:focus .anticon, ").concat(token.antCls, "-btn:active .anticon"), {
|
|
307
307
|
color: '#767E8B'
|
|
308
308
|
}), _obj4)), // 预览内容区域
|
|
309
309
|
_define_property(_obj5, "&-content", {
|
|
@@ -414,45 +414,39 @@ var genStyle = function genStyle(token) {
|
|
|
414
414
|
}), // 不可预览说明文案
|
|
415
415
|
_define_property(_obj5, "&-unsupported-text", {
|
|
416
416
|
font: 'var(--font-text-body-sm)',
|
|
417
|
-
color: 'var(--color-text-secondary)'
|
|
418
|
-
}), _obj5)),
|
|
419
|
-
|
|
420
|
-
'
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
'.anticon': {
|
|
437
|
-
color: 'var(--color-gray-text-secondary)',
|
|
438
|
-
fontSize: 16
|
|
439
|
-
}
|
|
440
|
-
}), // 成功消息图标样式
|
|
441
|
-
_define_property(_obj6, "".concat(token.componentCls, "-success-icon"), {
|
|
417
|
+
color: 'var(--color-text-secondary, var(--color-gray-text-secondary))'
|
|
418
|
+
}), _obj5)), _define_property(_obj7, "".concat(token.componentCls, "-search"), (_obj6 = {}, _define_property(_obj6, "".concat(token.antCls, "-input-outlined"), {
|
|
419
|
+
borderRadius: 'var(--radius-control-base)',
|
|
420
|
+
borderColor: 'transparent',
|
|
421
|
+
background: 'var(--color-gray-bg-card-light)',
|
|
422
|
+
boxShadow: 'var(--shadow-border-base)',
|
|
423
|
+
marginBottom: 8
|
|
424
|
+
}), _define_property(_obj6, "".concat(token.antCls, "-input-outlined:hover, ").concat(token.antCls, "-input-outlined:focus-within"), {
|
|
425
|
+
borderColor: 'var(--color-primary-control-fill-primary-active)'
|
|
426
|
+
}), _define_property(_obj6, "".concat(token.antCls, "-input-affix-wrapper >input").concat(token.antCls, "-input"), {
|
|
427
|
+
color: 'var(--color-gray-text-default)',
|
|
428
|
+
font: 'var(--font-text-body-base)',
|
|
429
|
+
letterSpacing: 'var(--letter-spacing-body-base, normal)'
|
|
430
|
+
}), // 搜索图标样式
|
|
431
|
+
_define_property(_obj6, '.anticon', {
|
|
432
|
+
color: 'var(--color-gray-text-secondary)',
|
|
433
|
+
fontSize: 16
|
|
434
|
+
}), _obj6)), // 成功消息图标样式
|
|
435
|
+
_define_property(_obj7, "".concat(token.componentCls, "-success-icon"), {
|
|
442
436
|
fontSize: 16,
|
|
443
437
|
marginRight: 8,
|
|
444
438
|
color: 'var(--color-green-control-fill-primary)'
|
|
445
439
|
}), // 成功消息文本样式
|
|
446
|
-
_define_property(
|
|
440
|
+
_define_property(_obj7, "".concat(token.componentCls, "-message-text"), {
|
|
447
441
|
font: 'var(--font-text-body-emphasized-base)',
|
|
448
442
|
color: 'var(--color-gray-text-default)'
|
|
449
443
|
}), // 分组内容容器(用于motion.div)
|
|
450
|
-
_define_property(
|
|
444
|
+
_define_property(_obj7, "".concat(token.componentCls, "-group-content"), {
|
|
451
445
|
overflow: 'hidden'
|
|
452
446
|
}), // 隐藏的图片预览组件
|
|
453
|
-
_define_property(
|
|
447
|
+
_define_property(_obj7, "".concat(token.componentCls, "-hidden-image"), {
|
|
454
448
|
display: 'none'
|
|
455
|
-
}),
|
|
449
|
+
}), _obj7;
|
|
456
450
|
};
|
|
457
451
|
export function useFileStyle(prefixCls) {
|
|
458
452
|
return useEditorStyleRegister('WorkspaceFile', function(token) {
|