@ant-design/agentic-ui 2.29.59 → 2.30.0
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/Bubble/List/index.d.ts +7 -0
- package/dist/Bubble/List/index.js +10 -1
- package/dist/Bubble/MessagesContent/MarkdownPreview.js +27 -3
- package/dist/Bubble/UserBubble.js +3 -1
- package/dist/Bubble/type.d.ts +7 -0
- package/dist/Hooks/useLanguage.d.ts +1 -0
- package/dist/I18n/locales.d.ts +1 -0
- package/dist/I18n/locales.js +3 -1
- package/dist/MarkdownEditor/plugin.d.ts +15 -0
- package/dist/MarkdownEditor/style.js +156 -326
- package/dist/MarkdownEditor/types.d.ts +9 -0
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.js +1 -1
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldRefs.js +10 -3
- package/dist/MarkdownRenderer/AnimationText.d.ts +22 -0
- package/dist/MarkdownRenderer/AnimationText.js +124 -0
- package/dist/MarkdownRenderer/CharacterQueue.d.ts +36 -0
- package/dist/MarkdownRenderer/CharacterQueue.js +188 -0
- package/dist/MarkdownRenderer/MarkdownRenderer.d.ts +13 -0
- package/dist/MarkdownRenderer/MarkdownRenderer.js +348 -0
- package/dist/MarkdownRenderer/index.d.ts +11 -0
- package/dist/MarkdownRenderer/index.js +9 -0
- package/dist/MarkdownRenderer/renderers/ChartRenderer.d.ts +12 -0
- package/dist/MarkdownRenderer/renderers/ChartRenderer.js +395 -0
- package/dist/MarkdownRenderer/renderers/CodeRenderer.d.ts +7 -0
- package/dist/MarkdownRenderer/renderers/CodeRenderer.js +218 -0
- package/dist/MarkdownRenderer/renderers/MermaidRenderer.d.ts +7 -0
- package/dist/MarkdownRenderer/renderers/MermaidRenderer.js +43 -0
- package/dist/MarkdownRenderer/renderers/SchemaRenderer.d.ts +15 -0
- package/dist/MarkdownRenderer/renderers/SchemaRenderer.js +115 -0
- package/dist/MarkdownRenderer/renderers/index.d.ts +4 -0
- package/dist/MarkdownRenderer/renderers/index.js +4 -0
- package/dist/MarkdownRenderer/style.d.ts +16 -0
- package/dist/MarkdownRenderer/style.js +46 -0
- package/dist/MarkdownRenderer/types.d.ts +74 -0
- package/dist/MarkdownRenderer/types.js +1 -0
- package/dist/MarkdownRenderer/useMarkdownToReact.d.ts +23 -0
- package/dist/MarkdownRenderer/useMarkdownToReact.js +1240 -0
- package/dist/MarkdownRenderer/useStreaming.d.ts +29 -0
- package/dist/MarkdownRenderer/useStreaming.js +392 -0
- package/dist/Plugins/chart/AreaChart/index.js +4 -2
- package/dist/Plugins/chart/LineChart/index.js +4 -2
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +8 -0
- package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.js +31 -6
- package/dist/Plugins/mermaid/style.js +0 -3
- package/dist/TaskList/TaskList.js +3 -12
- package/dist/TaskList/components/TaskListItem.js +3 -12
- package/dist/ThoughtChainList/ThoughtChainListItem.js +2 -4
- package/dist/ThoughtChainList/index.js +4 -21
- package/dist/ToolUseBarThink/index.js +20 -59
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/package.json +2 -2
|
@@ -52,9 +52,152 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
import { MOBILE_BREAKPOINT, MOBILE_PADDING } from "../Constants/mobile";
|
|
54
54
|
import { resetComponent, useEditorStyleRegister } from "../Hooks/useStyle";
|
|
55
|
+
// ── Table ──────────────────────────────────────────────────────────────────
|
|
56
|
+
var TABLE_BORDER = '1px solid var(--agentic-ui-table-border-color, #E7E9E8)';
|
|
57
|
+
var TABLE_RADIUS = 'var(--agentic-ui-table-border-radius, 8px)';
|
|
58
|
+
var TABLE_CELL = {
|
|
59
|
+
verticalAlign: 'top',
|
|
60
|
+
padding: 'var(--agentic-ui-table-cell-padding, 16px 12px)',
|
|
61
|
+
textAlign: 'left',
|
|
62
|
+
lineHeight: '24px',
|
|
63
|
+
fontSize: '1em',
|
|
64
|
+
minWidth: 'var(--agentic-ui-table-cell-min-width, 120px)',
|
|
65
|
+
width: 'var(--agentic-ui-table-cell-min-width, 120px)',
|
|
66
|
+
whiteSpace: 'nowrap',
|
|
67
|
+
overflow: 'hidden',
|
|
68
|
+
textOverflow: 'ellipsis',
|
|
69
|
+
zIndex: 1,
|
|
70
|
+
background: 'inherit'
|
|
71
|
+
};
|
|
72
|
+
var genTableStyle = function genTableStyle(token, mobileBreakpoint, mobilePadding) {
|
|
73
|
+
var tableCls = "".concat(token.componentCls, "-content-table");
|
|
74
|
+
var _obj, _obj1;
|
|
75
|
+
return _obj1 = {}, _define_property(_obj1, tableCls, {
|
|
76
|
+
width: '100%',
|
|
77
|
+
overflow: 'auto',
|
|
78
|
+
flex: 1,
|
|
79
|
+
minWidth: 0,
|
|
80
|
+
position: 'relative',
|
|
81
|
+
'&-container': _define_property({
|
|
82
|
+
maxWidth: '100%',
|
|
83
|
+
minWidth: 0,
|
|
84
|
+
outline: 'none',
|
|
85
|
+
position: 'relative',
|
|
86
|
+
marginBottom: 12
|
|
87
|
+
}, "&:hover ".concat(tableCls, "-readonly-table-actions"), {
|
|
88
|
+
opacity: 1,
|
|
89
|
+
transform: 'translateX(50%)',
|
|
90
|
+
top: -24
|
|
91
|
+
}),
|
|
92
|
+
'&-editor-table': {
|
|
93
|
+
marginTop: '1em'
|
|
94
|
+
},
|
|
95
|
+
'&-readonly-table-actions': {
|
|
96
|
+
opacity: 0,
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
top: 20,
|
|
99
|
+
display: 'flex',
|
|
100
|
+
gap: 8,
|
|
101
|
+
right: '50%',
|
|
102
|
+
zIndex: 1000,
|
|
103
|
+
backgroundColor: 'var(--color-gray-bg-page-light)',
|
|
104
|
+
borderRadius: 'var(--radius-control-base)',
|
|
105
|
+
padding: '4px 8px',
|
|
106
|
+
boxShadow: 'var(--shadow-control-base)',
|
|
107
|
+
border: 'none',
|
|
108
|
+
transform: 'translateX(50%)',
|
|
109
|
+
transition: 'all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
110
|
+
},
|
|
111
|
+
table: (_obj = {
|
|
112
|
+
borderCollapse: 'separate',
|
|
113
|
+
borderSpacing: 0,
|
|
114
|
+
width: 'max-content',
|
|
115
|
+
tableLayout: 'fixed',
|
|
116
|
+
margin: '16px 0',
|
|
117
|
+
maxWidth: '100%',
|
|
118
|
+
position: 'relative',
|
|
119
|
+
fontVariant: 'tabular-nums',
|
|
120
|
+
borderRadius: TABLE_RADIUS,
|
|
121
|
+
border: TABLE_BORDER
|
|
122
|
+
}, // readonly:overflow: hidden,不影响编辑态 UI
|
|
123
|
+
_define_property(_obj, "&".concat(tableCls, "-readonly-table"), {
|
|
124
|
+
width: '100%',
|
|
125
|
+
tableLayout: 'auto',
|
|
126
|
+
overflow: 'hidden',
|
|
127
|
+
border: TABLE_BORDER
|
|
128
|
+
}), _define_property(_obj, "th", _object_spread_props(_object_spread({}, TABLE_CELL), {
|
|
129
|
+
backgroundColor: 'var(--agentic-ui-table-header-bg, #f7f7f9)',
|
|
130
|
+
border: 'none',
|
|
131
|
+
borderBottom: TABLE_BORDER,
|
|
132
|
+
borderLeft: 'none',
|
|
133
|
+
borderTop: 'none',
|
|
134
|
+
fontWeight: 600
|
|
135
|
+
})), _define_property(_obj, 'th:not(:first-child)', {
|
|
136
|
+
borderLeft: TABLE_BORDER
|
|
137
|
+
}), _define_property(_obj, "td", _object_spread_props(_object_spread({}, TABLE_CELL), {
|
|
138
|
+
borderBottom: TABLE_BORDER,
|
|
139
|
+
borderLeft: TABLE_BORDER,
|
|
140
|
+
'div[data-be="paragraph"]': {
|
|
141
|
+
margin: 0,
|
|
142
|
+
textWrap: 'auto'
|
|
143
|
+
}
|
|
144
|
+
})), _define_property(_obj, 'td:first-child', {
|
|
145
|
+
borderLeft: 'none'
|
|
146
|
+
}), _define_property(_obj, 'tr:last-child td', {
|
|
147
|
+
borderBottom: 'none'
|
|
148
|
+
}), _define_property(_obj, 'tr td:first-child', {
|
|
149
|
+
fontWeight: 600
|
|
150
|
+
}), _define_property(_obj, 'tbody tr:hover', {
|
|
151
|
+
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))'
|
|
152
|
+
}), _define_property(_obj, "@media (max-width: ".concat(mobileBreakpoint, ")"), {
|
|
153
|
+
'th, td': {
|
|
154
|
+
padding: mobilePadding
|
|
155
|
+
}
|
|
156
|
+
}), _obj)
|
|
157
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-table-td"), _define_property({
|
|
158
|
+
padding: '8px',
|
|
159
|
+
verticalAlign: 'middle',
|
|
160
|
+
wordWrap: 'break-word',
|
|
161
|
+
wordBreak: 'break-all',
|
|
162
|
+
overflow: 'hidden',
|
|
163
|
+
textOverflow: 'ellipsis',
|
|
164
|
+
whiteSpace: 'pre-wrap',
|
|
165
|
+
'&[data-select="true"]:after': {
|
|
166
|
+
content: '" "',
|
|
167
|
+
position: 'absolute',
|
|
168
|
+
top: 0,
|
|
169
|
+
left: 0,
|
|
170
|
+
right: 0,
|
|
171
|
+
bottom: 0,
|
|
172
|
+
zIndex: 2,
|
|
173
|
+
pointerEvents: 'none',
|
|
174
|
+
backgroundColor: 'var(--color-primary-control-fill-secondary-hover)'
|
|
175
|
+
}
|
|
176
|
+
}, "@media (max-width: ".concat(mobileBreakpoint, ")"), {
|
|
177
|
+
padding: '2px'
|
|
178
|
+
})), _define_property(_obj1, "".concat(token.componentCls, "-table-row-index"), {
|
|
179
|
+
display: 'table-row'
|
|
180
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index"), {
|
|
181
|
+
width: 12,
|
|
182
|
+
maxWidth: 12,
|
|
183
|
+
padding: 0,
|
|
184
|
+
position: 'relative',
|
|
185
|
+
verticalAlign: 'middle',
|
|
186
|
+
backgroundColor: 'var(--color-gray-control-fill-secondary)',
|
|
187
|
+
'&:hover': {
|
|
188
|
+
backgroundColor: 'var(--color-gray-control-fill-secondary-hover)'
|
|
189
|
+
}
|
|
190
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-table-cell-index-spacer"), {
|
|
191
|
+
cursor: 'pointer',
|
|
192
|
+
backgroundColor: 'var(--color-gray-control-fill-secondary)',
|
|
193
|
+
'&:hover': {
|
|
194
|
+
backgroundColor: 'var(--color-gray-control-fill-secondary-hover)'
|
|
195
|
+
}
|
|
196
|
+
}), _obj1;
|
|
197
|
+
};
|
|
55
198
|
var genStyle = function genStyle(token) {
|
|
56
|
-
var _obj, _obj1
|
|
57
|
-
return _define_property({}, token.componentCls, (
|
|
199
|
+
var _obj, _obj1;
|
|
200
|
+
return _define_property({}, token.componentCls, _object_spread((_obj1 = {
|
|
58
201
|
boxSizing: 'border-box',
|
|
59
202
|
height: 'max-content',
|
|
60
203
|
maxWidth: '100%',
|
|
@@ -114,7 +257,7 @@ var genStyle = function genStyle(token) {
|
|
|
114
257
|
'&-focus': {
|
|
115
258
|
height: 64
|
|
116
259
|
}
|
|
117
|
-
}, _define_property(
|
|
260
|
+
}, _define_property(_obj1, "".concat(token.componentCls, "-list"), (_obj = {
|
|
118
261
|
listStyle: 'disc',
|
|
119
262
|
marginBottom: '0',
|
|
120
263
|
marginTop: '0',
|
|
@@ -183,12 +326,12 @@ var genStyle = function genStyle(token) {
|
|
|
183
326
|
listStyle: 'none !important',
|
|
184
327
|
paddingLeft: '0'
|
|
185
328
|
}), _obj)), // --- LinkCard (BEM: block__element) ---
|
|
186
|
-
_define_property(
|
|
329
|
+
_define_property(_obj1, "".concat(token.componentCls, "-link-card"), {
|
|
187
330
|
cursor: 'pointer',
|
|
188
331
|
position: 'relative',
|
|
189
332
|
display: 'flex',
|
|
190
333
|
alignItems: 'center'
|
|
191
|
-
}), _define_property(
|
|
334
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-link-card__container"), {
|
|
192
335
|
padding: 12,
|
|
193
336
|
border: '1px solid #f0f0f0',
|
|
194
337
|
borderRadius: '0.5em',
|
|
@@ -211,7 +354,7 @@ var genStyle = function genStyle(token) {
|
|
|
211
354
|
color: '#1667ff'
|
|
212
355
|
}
|
|
213
356
|
}
|
|
214
|
-
}), _define_property(
|
|
357
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-link-card__content"), {
|
|
215
358
|
display: 'flex',
|
|
216
359
|
alignItems: 'center',
|
|
217
360
|
gap: 12,
|
|
@@ -219,14 +362,14 @@ var genStyle = function genStyle(token) {
|
|
|
219
362
|
fontSize: 16,
|
|
220
363
|
flex: 1,
|
|
221
364
|
minWidth: 0
|
|
222
|
-
}), _define_property(
|
|
365
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-link-card__title"), {
|
|
223
366
|
overflow: 'ellipsis',
|
|
224
367
|
textOverflow: 'ellipsis',
|
|
225
368
|
textWrap: 'nowrap',
|
|
226
369
|
textDecoration: 'none',
|
|
227
370
|
display: 'block',
|
|
228
371
|
color: '#262626'
|
|
229
|
-
}), _define_property(
|
|
372
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-link-card__description"), {
|
|
230
373
|
flex: 1,
|
|
231
374
|
minWidth: 0,
|
|
232
375
|
marginTop: 4,
|
|
@@ -235,16 +378,16 @@ var genStyle = function genStyle(token) {
|
|
|
235
378
|
fontSize: 12,
|
|
236
379
|
color: 'rgba(0,0,0,0.45)',
|
|
237
380
|
justifyContent: 'space-between'
|
|
238
|
-
}), _define_property(
|
|
381
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-link-card__collaborators"), {
|
|
239
382
|
flex: 1,
|
|
240
383
|
minWidth: 0,
|
|
241
384
|
display: 'flex',
|
|
242
385
|
justifyContent: 'space-between'
|
|
243
|
-
}), _define_property(
|
|
386
|
+
}), _define_property(_obj1, "".concat(token.componentCls, "-link-card__update-time"), {
|
|
244
387
|
color: 'rgba(0,0,0,0.45)',
|
|
245
388
|
fontSize: 12
|
|
246
389
|
}), // --- TagPopup ---
|
|
247
|
-
_define_property(
|
|
390
|
+
_define_property(_obj1, "".concat(token.componentCls, "-tag-popup"), {
|
|
248
391
|
position: 'relative',
|
|
249
392
|
cursor: 'pointer',
|
|
250
393
|
padding: '0px 4px',
|
|
@@ -290,7 +433,7 @@ var genStyle = function genStyle(token) {
|
|
|
290
433
|
'&-loading': {
|
|
291
434
|
}
|
|
292
435
|
}), // --- Mermaid ---
|
|
293
|
-
_define_property(
|
|
436
|
+
_define_property(_obj1, "".concat(token.componentCls, "-mermaid"), {
|
|
294
437
|
// 基础容器样式
|
|
295
438
|
height: '240px',
|
|
296
439
|
minWidth: '300px',
|
|
@@ -364,320 +507,7 @@ var genStyle = function genStyle(token) {
|
|
|
364
507
|
fontSize: '12px'
|
|
365
508
|
}
|
|
366
509
|
}
|
|
367
|
-
}),
|
|
368
|
-
// 表格样式使用 CSS 变量 + fallback,支持通过父级 style 或 ConfigProvider 覆盖:
|
|
369
|
-
// --agentic-ui-table-border-radius, --agentic-ui-table-border-color,
|
|
370
|
-
// --agentic-ui-table-header-bg, --agentic-ui-table-hover-bg,
|
|
371
|
-
// --agentic-ui-table-cell-bg, --agentic-ui-table-cell-min-width,
|
|
372
|
-
// --agentic-ui-table-cell-padding
|
|
373
|
-
_define_property(_obj2, "".concat(token.componentCls, "-content-table"), {
|
|
374
|
-
width: '100%',
|
|
375
|
-
overflow: 'auto',
|
|
376
|
-
flex: 1,
|
|
377
|
-
minWidth: 0,
|
|
378
|
-
position: 'relative',
|
|
379
|
-
'&-container': _define_property({
|
|
380
|
-
display: 'flex',
|
|
381
|
-
gap: 1,
|
|
382
|
-
maxWidth: '100%',
|
|
383
|
-
minWidth: 0,
|
|
384
|
-
outline: 'none',
|
|
385
|
-
position: 'relative',
|
|
386
|
-
marginBottom: 12
|
|
387
|
-
}, "&:hover ".concat(token.componentCls, "-content-table-readonly-table-actions"), {
|
|
388
|
-
opacity: 1,
|
|
389
|
-
transform: 'translateX(50%)',
|
|
390
|
-
top: -24
|
|
391
|
-
}),
|
|
392
|
-
'&-editor-table': {
|
|
393
|
-
marginTop: '1em'
|
|
394
|
-
},
|
|
395
|
-
'&-readonly-table-actions': {
|
|
396
|
-
opacity: 0,
|
|
397
|
-
position: 'absolute',
|
|
398
|
-
top: 20,
|
|
399
|
-
display: 'flex',
|
|
400
|
-
gap: 8,
|
|
401
|
-
right: '50%',
|
|
402
|
-
zIndex: 1000,
|
|
403
|
-
backgroundColor: 'var(--color-gray-bg-page-light)',
|
|
404
|
-
borderRadius: 'var(--radius-control-base)',
|
|
405
|
-
padding: '4px 8px',
|
|
406
|
-
boxShadow: 'var(--shadow-control-base)',
|
|
407
|
-
border: 'none',
|
|
408
|
-
transform: 'translateX(50%)',
|
|
409
|
-
transition: 'all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
410
|
-
},
|
|
411
|
-
table: (_obj1 = {
|
|
412
|
-
borderCollapse: 'separate',
|
|
413
|
-
borderSpacing: 0,
|
|
414
|
-
width: 'max-content',
|
|
415
|
-
tableLayout: 'fixed',
|
|
416
|
-
margin: '16px 0',
|
|
417
|
-
maxWidth: '100%'
|
|
418
|
-
}, _define_property(_obj1, "&".concat(token.componentCls, "-content-table-readonly-table"), {
|
|
419
|
-
width: '100%',
|
|
420
|
-
minWidth: 'max-content'
|
|
421
|
-
}), _define_property(_obj1, "position", 'relative'), _define_property(_obj1, "fontVariant", 'tabular-nums'), _define_property(_obj1, "borderRadius", 'var(--agentic-ui-table-border-radius, 8px)'), _define_property(_obj1, "border", '1px solid var(--agentic-ui-table-border-color, #E7E9E8)'), _define_property(_obj1, "&".concat(token.componentCls, "-content-table-readonly-pure"), {
|
|
422
|
-
border: 'none',
|
|
423
|
-
borderRadius: 'none',
|
|
424
|
-
'tr:not(.config-tr) td:not(.config-td)': {
|
|
425
|
-
borderLeft: 'none'
|
|
426
|
-
},
|
|
427
|
-
'tr:not(.config-tr):last-child td:not(.config-td)': {
|
|
428
|
-
borderBottom: '1px solid var(--agentic-ui-table-border-color, #E7E9E8)'
|
|
429
|
-
},
|
|
430
|
-
'tr:not(.config-tr):first-child th:first-child:not(.config-td):not([colspan]):not([rowspan]), tr:not(.config-tr):first-child td:first-child:not(.config-td):not([colspan]):not([rowspan])': {
|
|
431
|
-
borderTopLeftRadius: 'unset'
|
|
432
|
-
},
|
|
433
|
-
'tr:not(.config-tr):first-child th:last-child:not(.config-td):not([colspan]):not([rowspan]), tr:not(.config-tr):first-child td:last-child:not(.config-td):not([colspan]):not([rowspan])': {
|
|
434
|
-
borderTopRightRadius: 'unset'
|
|
435
|
-
},
|
|
436
|
-
'tr:not(.config-tr):last-child td:first-child:not(.config-td):not([colspan]):not([rowspan]), tr:not(.config-tr):last-child th:first-child:not(.config-td):not([colspan]):not([rowspan])': {
|
|
437
|
-
borderBottomLeftRadius: 'unset'
|
|
438
|
-
},
|
|
439
|
-
'tr:not(.config-tr):last-child td:last-child:not(.config-td):not([colspan]):not([rowspan]), tr:not(.config-tr):last-child th:last-child:not(.config-td):not([colspan]):not([rowspan])': {
|
|
440
|
-
borderBottomRightRadius: 'unset'
|
|
441
|
-
}
|
|
442
|
-
}), _define_property(_obj1, 'th.config-th,td.config-td', {
|
|
443
|
-
borderBottom: '1px solid var(--agentic-ui-table-border-color, #E7E9E8)',
|
|
444
|
-
borderLeft: '1px solid var(--agentic-ui-table-border-color, #E7E9E8)'
|
|
445
|
-
}), _define_property(_obj1, 'tr td.config-td:first-child', {
|
|
446
|
-
borderLeft: 'none'
|
|
447
|
-
}), _define_property(_obj1, 'th:not(.config-td)', {
|
|
448
|
-
backgroundColor: 'var(--agentic-ui-table-header-bg, #f7f7f9)',
|
|
449
|
-
borderBottom: '1px solid var(--agentic-ui-table-border-color, #E7E9E8)',
|
|
450
|
-
textWrap: 'nowrap',
|
|
451
|
-
verticalAlign: 'top',
|
|
452
|
-
padding: 'var(--agentic-ui-table-cell-padding, 16px 12px)',
|
|
453
|
-
textAlign: 'left',
|
|
454
|
-
lineHeight: '24px',
|
|
455
|
-
fontSize: '1em',
|
|
456
|
-
fontWeight: 600,
|
|
457
|
-
borderTop: 'none',
|
|
458
|
-
minWidth: 'var(--agentic-ui-table-cell-min-width, 120px)',
|
|
459
|
-
width: 'var(--agentic-ui-table-cell-min-width, 120px)',
|
|
460
|
-
whiteSpace: 'nowrap',
|
|
461
|
-
overflow: 'hidden',
|
|
462
|
-
textOverflow: 'ellipsis',
|
|
463
|
-
zIndex: 1,
|
|
464
|
-
background: 'inherit'
|
|
465
|
-
}), _define_property(_obj1, 'td:not(.config-td)', {
|
|
466
|
-
verticalAlign: 'top',
|
|
467
|
-
padding: 'var(--agentic-ui-table-cell-padding, 16px 12px)',
|
|
468
|
-
textAlign: 'left',
|
|
469
|
-
position: 'relative',
|
|
470
|
-
lineHeight: '24px',
|
|
471
|
-
fontSize: '1em',
|
|
472
|
-
minWidth: 'var(--agentic-ui-table-cell-min-width, 120px)',
|
|
473
|
-
width: 'var(--agentic-ui-table-cell-min-width, 120px)',
|
|
474
|
-
whiteSpace: 'nowrap',
|
|
475
|
-
overflow: 'hidden',
|
|
476
|
-
textOverflow: 'ellipsis',
|
|
477
|
-
zIndex: 1,
|
|
478
|
-
background: 'inherit',
|
|
479
|
-
'div[data-be="paragraph"]': {
|
|
480
|
-
margin: 0,
|
|
481
|
-
textWrap: 'auto'
|
|
482
|
-
}
|
|
483
|
-
}), _define_property(_obj1, 'tr:not(.config-tr)', {
|
|
484
|
-
background: 'inherit',
|
|
485
|
-
'&:first-child td:not(.config-td)': {
|
|
486
|
-
borderTop: 'none'
|
|
487
|
-
},
|
|
488
|
-
'td:not(.config-td)': {
|
|
489
|
-
borderBottom: '1px solid var(--agentic-ui-table-border-color, #E7E9E8)',
|
|
490
|
-
borderLeft: '1px solid var(--agentic-ui-table-border-color, #E7E9E8)',
|
|
491
|
-
'&:first-child': {
|
|
492
|
-
fontSize: '1em',
|
|
493
|
-
lineHeight: '24px',
|
|
494
|
-
fontWeight: 600
|
|
495
|
-
}
|
|
496
|
-
},
|
|
497
|
-
'td:first-child:not(.config-td)': {
|
|
498
|
-
borderLeft: 'none'
|
|
499
|
-
},
|
|
500
|
-
'&:last-child td:not(.config-td)': {
|
|
501
|
-
borderBottom: 'none'
|
|
502
|
-
}
|
|
503
|
-
}), _define_property(_obj1, 'tbody tr:not(.config-tr):hover', {
|
|
504
|
-
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))'
|
|
505
|
-
}), // 表格圆角处理
|
|
506
|
-
_define_property(_obj1, 'th:not(.config-td), td:not(.config-td)', {
|
|
507
|
-
borderRadius: '0'
|
|
508
|
-
}), _define_property(_obj1, 'tr:not(.config-tr):first-child th:first-child:not(.config-td):not([colspan]):not([rowspan]), tr:not(.config-tr):first-child td:first-child:not(.config-td):not([colspan]):not([rowspan])', {
|
|
509
|
-
borderTopLeftRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
510
|
-
}), _define_property(_obj1, 'tr:not(.config-tr):first-child th:last-child:not(.config-td):not([colspan]):not([rowspan]), tr:not(.config-tr):first-child td:last-child:not(.config-td):not([colspan]):not([rowspan])', {
|
|
511
|
-
borderTopRightRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
512
|
-
}), _define_property(_obj1, 'tr:not(.config-tr):last-child td:first-child:not(.config-td):not([colspan]):not([rowspan]), tr:not(.config-tr):last-child th:first-child:not(.config-td):not([colspan]):not([rowspan])', {
|
|
513
|
-
borderBottomLeftRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
514
|
-
}), _define_property(_obj1, 'tr:not(.config-tr):last-child td:last-child:not(.config-td):not([colspan]):not([rowspan]), tr:not(.config-tr):last-child th:last-child:not(.config-td):not([colspan]):not([rowspan])', {
|
|
515
|
-
borderBottomRightRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
516
|
-
}), // 处理合并单元格的圆角
|
|
517
|
-
_define_property(_obj1, 'tr:not(.config-tr):first-child th:not(.config-td)[colspan]:first-child, tr:not(.config-tr):first-child td:not(.config-td)[colspan]:first-child,tr:not(.config-tr):first-child th:not(.config-td)[rowspan]:first-child, tr:not(.config-tr):first-child td:not(.config-td)[rowspan]:first-child', {
|
|
518
|
-
borderTopLeftRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
519
|
-
}), _define_property(_obj1, 'tr:not(.config-tr):first-child th:not(.config-td)[colspan]:last-child, tr:not(.config-tr):first-child td:not(.config-td)[colspan]:last-child,tr:not(.config-tr):first-child th:not(.config-td)[rowspan]:last-child, tr:not(.config-tr):first-child td:not(.config-td)[rowspan]:last-child', {
|
|
520
|
-
borderTopRightRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
521
|
-
}), _define_property(_obj1, 'tr:not(.config-tr):last-child td:not(.config-td)[colspan]:first-child, tr:not(.config-tr):last-child th:not(.config-td)[colspan]:first-child,tr:not(.config-tr):last-child td:not(.config-td)[rowspan]:first-child, tr:not(.config-tr):last-child th:not(.config-td)[rowspan]:first-child', {
|
|
522
|
-
borderBottomLeftRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
523
|
-
}), _define_property(_obj1, 'tr:not(.config-tr):last-child td:not(.config-td)[colspan]:last-child, tr:not(.config-tr):last-child th:not(.config-td)[colspan]:last-child,tr:not(.config-tr):last-child td:not(.config-td)[rowspan]:last-child, tr:not(.config-tr):last-child th:not(.config-td)[rowspan]:last-child', {
|
|
524
|
-
borderBottomRightRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
525
|
-
}), _define_property(_obj1, 'tr:not(.config-tr):first-child:last-child th:not(.config-td)[colspan]:first-child:last-child, tr:not(.config-tr):first-child:last-child td:not(.config-td)[colspan]:first-child:last-child', {
|
|
526
|
-
borderRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
527
|
-
}), _define_property(_obj1, 'th:not(.config-td)[rowspan]:first-child:last-child, td:not(.config-td)[rowspan]:first-child:last-child', {
|
|
528
|
-
borderTopLeftRadius: 'var(--agentic-ui-table-border-radius, 8px)',
|
|
529
|
-
borderBottomLeftRadius: 'var(--agentic-ui-table-border-radius, 8px)'
|
|
530
|
-
}), _define_property(_obj1, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
|
|
531
|
-
'th:not(.config-td), td:not(.config-td)': {
|
|
532
|
-
padding: "".concat(MOBILE_PADDING)
|
|
533
|
-
}
|
|
534
|
-
}), _obj1),
|
|
535
|
-
'table.htCore': {
|
|
536
|
-
boxSizing: 'content-box',
|
|
537
|
-
'*': {
|
|
538
|
-
boxSizing: 'content-box'
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}), // --- Table Td ---
|
|
542
|
-
_define_property(_obj2, "".concat(token.componentCls, "-table-td"), _define_property({
|
|
543
|
-
padding: '8px',
|
|
544
|
-
verticalAlign: 'middle',
|
|
545
|
-
wordWrap: 'break-word',
|
|
546
|
-
wordBreak: 'break-all',
|
|
547
|
-
overflow: 'hidden',
|
|
548
|
-
textOverflow: 'ellipsis',
|
|
549
|
-
whiteSpace: 'pre-wrap',
|
|
550
|
-
'&[data-select="true"]:after': {
|
|
551
|
-
content: '" "',
|
|
552
|
-
position: 'absolute',
|
|
553
|
-
top: '0',
|
|
554
|
-
left: '0',
|
|
555
|
-
right: '0',
|
|
556
|
-
bottom: '0',
|
|
557
|
-
zIndex: 2,
|
|
558
|
-
pointerEvents: 'none',
|
|
559
|
-
backgroundColor: 'var(--color-primary-control-fill-secondary-hover)'
|
|
560
|
-
}
|
|
561
|
-
}, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
|
|
562
|
-
padding: '2px'
|
|
563
|
-
})), // --- Table Row Index ---
|
|
564
|
-
_define_property(_obj2, "".concat(token.componentCls, "-table-row-index"), {
|
|
565
|
-
display: 'table-row'
|
|
566
|
-
}), // --- Table Cell Index ---
|
|
567
|
-
_define_property(_obj2, "".concat(token.componentCls, "-table-cell-index"), {
|
|
568
|
-
width: '12px',
|
|
569
|
-
maxWidth: 12,
|
|
570
|
-
padding: 0,
|
|
571
|
-
position: 'relative',
|
|
572
|
-
verticalAlign: 'middle',
|
|
573
|
-
contentEditable: false,
|
|
574
|
-
backgroundColor: 'var(--color-gray-control-fill-secondary)',
|
|
575
|
-
'&:hover': {
|
|
576
|
-
backgroundColor: 'var(--color-gray-control-fill-secondary-hover)'
|
|
577
|
-
}
|
|
578
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-action-buttons"), {
|
|
579
|
-
position: 'absolute',
|
|
580
|
-
top: '4px',
|
|
581
|
-
left: '-24px',
|
|
582
|
-
zIndex: 1000,
|
|
583
|
-
alignItems: 'center',
|
|
584
|
-
flexDirection: 'column',
|
|
585
|
-
gap: '2px',
|
|
586
|
-
opacity: 0,
|
|
587
|
-
display: 'none',
|
|
588
|
-
transition: 'opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
589
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-action-buttons-visible"), {
|
|
590
|
-
opacity: 1,
|
|
591
|
-
display: 'flex'
|
|
592
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-action-button"), {
|
|
593
|
-
padding: '2px',
|
|
594
|
-
display: 'flex',
|
|
595
|
-
alignItems: 'center',
|
|
596
|
-
zIndex: 1000,
|
|
597
|
-
justifyContent: 'center',
|
|
598
|
-
fontSize: 12,
|
|
599
|
-
border: '1px solid var(--agentic-ui-table-border-color, #E7E9E8)',
|
|
600
|
-
width: '20px',
|
|
601
|
-
height: '20px',
|
|
602
|
-
cursor: 'pointer',
|
|
603
|
-
backgroundPosition: '50%',
|
|
604
|
-
backgroundRepeat: 'no-repeat',
|
|
605
|
-
transition: 'color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)',
|
|
606
|
-
borderRadius: '4px',
|
|
607
|
-
background: 'var(--color-gray-bg-card-white)',
|
|
608
|
-
boxShadow: 'var(--shadow-border-base)',
|
|
609
|
-
color: 'var(--color-gray-text-secondary)',
|
|
610
|
-
'&:hover': {
|
|
611
|
-
backgroundColor: '#FFF',
|
|
612
|
-
boxShadow: 'var(--shadow-control-lg)'
|
|
613
|
-
}
|
|
614
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-delete-icon"), {
|
|
615
|
-
'&:hover': {
|
|
616
|
-
color: '#ff4d4f'
|
|
617
|
-
}
|
|
618
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-insert-row-before"), {
|
|
619
|
-
'&:hover': {
|
|
620
|
-
color: '#52c41a'
|
|
621
|
-
}
|
|
622
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-insert-row-after"), {
|
|
623
|
-
'&:hover': {
|
|
624
|
-
color: '#52c41a'
|
|
625
|
-
}
|
|
626
|
-
}), // --- Table Cell Index Spacer ---
|
|
627
|
-
_define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-spacer"), {
|
|
628
|
-
contentEditable: false,
|
|
629
|
-
cursor: 'pointer',
|
|
630
|
-
backgroundColor: 'var(--color-gray-control-fill-secondary)',
|
|
631
|
-
'&:hover': {
|
|
632
|
-
backgroundColor: 'var(--color-gray-control-fill-secondary-hover)'
|
|
633
|
-
}
|
|
634
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-spacer-action-buttons"), {
|
|
635
|
-
position: 'absolute',
|
|
636
|
-
top: '-28px',
|
|
637
|
-
right: '50%',
|
|
638
|
-
transform: 'translateX(50%)',
|
|
639
|
-
zIndex: 10,
|
|
640
|
-
display: 'flex',
|
|
641
|
-
alignItems: 'center',
|
|
642
|
-
gap: '2px',
|
|
643
|
-
opacity: 0,
|
|
644
|
-
transition: 'opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)'
|
|
645
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-spacer-action-buttons-visible"), {
|
|
646
|
-
opacity: 1
|
|
647
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-spacer-action-button"), {
|
|
648
|
-
padding: '2px',
|
|
649
|
-
display: 'flex',
|
|
650
|
-
alignItems: 'center',
|
|
651
|
-
justifyContent: 'center',
|
|
652
|
-
fontSize: 12,
|
|
653
|
-
border: '1px solid var(--agentic-ui-table-border-color, #E7E9E8)',
|
|
654
|
-
width: '20px',
|
|
655
|
-
height: '20px',
|
|
656
|
-
cursor: 'pointer',
|
|
657
|
-
backgroundPosition: '50%',
|
|
658
|
-
backgroundRepeat: 'no-repeat',
|
|
659
|
-
transition: 'color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)',
|
|
660
|
-
borderRadius: '4px',
|
|
661
|
-
background: 'var(--color-gray-bg-card-white)',
|
|
662
|
-
boxShadow: 'var(--shadow-border-base)',
|
|
663
|
-
color: 'var(--color-gray-text-secondary)',
|
|
664
|
-
'&:hover': {
|
|
665
|
-
backgroundColor: '#FFF',
|
|
666
|
-
boxShadow: 'var(--shadow-control-lg)'
|
|
667
|
-
}
|
|
668
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-spacer-delete-icon"), {
|
|
669
|
-
'&:hover': {
|
|
670
|
-
color: '#ff4d4f'
|
|
671
|
-
}
|
|
672
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-spacer-insert-column-before"), {
|
|
673
|
-
'&:hover': {
|
|
674
|
-
color: '#52c41a'
|
|
675
|
-
}
|
|
676
|
-
}), _define_property(_obj2, "".concat(token.componentCls, "-table-cell-index-spacer-insert-column-after"), {
|
|
677
|
-
'&:hover': {
|
|
678
|
-
color: '#52c41a'
|
|
679
|
-
}
|
|
680
|
-
}), _obj2));
|
|
510
|
+
}), _obj1), genTableStyle(token, MOBILE_BREAKPOINT, MOBILE_PADDING)));
|
|
681
511
|
};
|
|
682
512
|
/**
|
|
683
513
|
* BubbleChat
|
|
@@ -4,6 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { BaseEditor, Editor, Selection } from 'slate';
|
|
5
5
|
import { HistoryEditor } from 'slate-history';
|
|
6
6
|
import { ReactEditor, RenderElementProps } from 'slate-react';
|
|
7
|
+
import type { RenderMode } from '../MarkdownRenderer/types';
|
|
7
8
|
import { TagPopupProps } from './editor/elements/TagPopup';
|
|
8
9
|
import { EditorStore } from './editor/store';
|
|
9
10
|
import { InsertAutocompleteProps } from './editor/tools/InsertAutocomplete';
|
|
@@ -613,4 +614,12 @@ export type MarkdownEditorProps = {
|
|
|
613
614
|
* @description 配置附件上传功能
|
|
614
615
|
*/
|
|
615
616
|
attachment?: Record<string, unknown>;
|
|
617
|
+
/**
|
|
618
|
+
* 渲染模式
|
|
619
|
+
* @description 仅在 readonly 模式下生效
|
|
620
|
+
* - 'slate': 使用 Slate 编辑器渲染(默认,向后兼容)
|
|
621
|
+
* - 'markdown': 使用轻量 MarkdownRenderer 渲染(无 Slate 实例,性能更优)
|
|
622
|
+
* @default 'slate'
|
|
623
|
+
*/
|
|
624
|
+
renderMode?: RenderMode;
|
|
616
625
|
};
|
|
@@ -140,7 +140,7 @@ export var SupportedFileFormats = {
|
|
|
140
140
|
]
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
var DEFAULT_FORMAT_MESSAGE = '
|
|
143
|
+
var DEFAULT_FORMAT_MESSAGE = '每个文件不超过 ${maxSize},支持 ${extensions}等格式。';
|
|
144
144
|
var buildFormatMessage = function buildFormatMessage(format, locale) {
|
|
145
145
|
var _ref;
|
|
146
146
|
var _format_extensions;
|
|
@@ -69,6 +69,7 @@ import { useEffect, useImperativeHandle, useRef } from "react";
|
|
|
69
69
|
props.value
|
|
70
70
|
]);
|
|
71
71
|
// 通过 ref 暴露编辑器实例,包装 store.setMDContent 以同步 value 状态,确保发送按钮正确响应
|
|
72
|
+
// 使用 Proxy 包装 store,仅覆盖 setMDContent,保留 getMDContent、clearContent、focus 等全部方法
|
|
72
73
|
useImperativeHandle(props.inputRef, function() {
|
|
73
74
|
var editor = markdownEditorRef.current;
|
|
74
75
|
var syncValueAndSetMDContent = function syncValueAndSetMDContent(md, plugins, options) {
|
|
@@ -85,10 +86,16 @@ import { useEffect, useImperativeHandle, useRef } from "react";
|
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
88
|
}
|
|
89
|
+
var storeProxy = new Proxy(editor.store, {
|
|
90
|
+
get: function get(target, prop) {
|
|
91
|
+
if (prop === 'setMDContent') {
|
|
92
|
+
return syncValueAndSetMDContent;
|
|
93
|
+
}
|
|
94
|
+
return Reflect.get(target, prop);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
88
97
|
return _object_spread_props(_object_spread({}, editor), {
|
|
89
|
-
store:
|
|
90
|
-
setMDContent: syncValueAndSetMDContent
|
|
91
|
-
})
|
|
98
|
+
store: storeProxy
|
|
92
99
|
});
|
|
93
100
|
}, [
|
|
94
101
|
props.setValue
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AnimationConfig {
|
|
3
|
+
/** 淡入动画持续时间(ms),默认 200 */
|
|
4
|
+
fadeDuration?: number;
|
|
5
|
+
/** 缓动函数,默认 ease-in-out */
|
|
6
|
+
easing?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AnimationTextProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
animationConfig?: AnimationConfig;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 流式文字淡入动画组件。
|
|
14
|
+
*
|
|
15
|
+
* 移植自 @ant-design/x-markdown 的 AnimationText。
|
|
16
|
+
* 追踪 children 的文本变化,只给新增的部分加淡入动画 span,
|
|
17
|
+
* 已有的部分保持不动——不会触发整段重绘。
|
|
18
|
+
*
|
|
19
|
+
* 仅对纯文本增量有效;如果内容不是简单追加(删除/替换),直接替换所有 chunks。
|
|
20
|
+
*/
|
|
21
|
+
declare const AnimationText: React.NamedExoticComponent<AnimationTextProps>;
|
|
22
|
+
export default AnimationText;
|