@ant-design/agentic-ui 2.0.17 → 2.0.20
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/FileView.js +1 -1
- package/dist/Bubble/type.d.ts +2 -2
- package/dist/ChatBootPage/ButtonTabStyle.js +2 -2
- package/dist/ChatBootPage/CaseReply.d.ts +10 -2
- package/dist/ChatBootPage/CaseReply.js +20 -2
- package/dist/ChatBootPage/CaseReplyStyle.js +51 -9
- package/dist/Components/ActionIconBox/index.js +102 -46
- package/dist/Components/Button/ToggleButton/index.js +3 -3
- package/dist/Components/Button/ToggleButton/style.js +1 -1
- package/dist/Components/GradientText/index.d.ts +8 -0
- package/dist/Components/GradientText/index.js +32 -0
- package/dist/Components/GradientText/style.d.ts +5 -0
- package/dist/Components/GradientText/style.js +76 -0
- package/dist/Components/TextAnimate/index.d.ts +56 -0
- package/dist/Components/TextAnimate/index.js +388 -0
- package/dist/Components/TextAnimate/style.d.ts +5 -0
- package/dist/Components/TextAnimate/style.js +53 -0
- package/dist/Components/TypingAnimation/index.d.ts +19 -0
- package/dist/Components/TypingAnimation/index.js +182 -0
- package/dist/Components/TypingAnimation/style.d.ts +5 -0
- package/dist/Components/TypingAnimation/style.js +59 -0
- package/dist/Components/lotties/ShinyText/index.d.ts +69 -0
- package/dist/Components/lotties/ShinyText/index.js +60 -0
- package/dist/Components/lotties/ShinyText/style.d.ts +5 -0
- package/dist/Components/lotties/ShinyText/style.js +84 -0
- package/dist/Components/lotties/index.d.ts +1 -2
- package/dist/Components/lotties/index.js +1 -2
- package/dist/MarkdownInputField/AttachmentButton/AttachmentButtonPopover.js +6 -32
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +1 -1
- package/dist/MarkdownInputField/AttachmentButton/index.js +5 -3
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.d.ts +2 -2
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +166 -152
- package/dist/MarkdownInputField/FileMapView/index.d.ts +3 -3
- package/dist/MarkdownInputField/FileMapView/index.js +12 -26
- package/dist/MarkdownInputField/FileMapView/style.js +8 -3
- package/dist/MarkdownInputField/MarkdownInputField.js +156 -174
- package/dist/MarkdownInputField/QuickActions/index.js +6 -0
- package/dist/MarkdownInputField/VoiceInput/index.js +2 -1
- package/dist/MarkdownInputField/style.js +5 -9
- package/dist/WelcomeMessage/index.d.ts +12 -2
- package/dist/WelcomeMessage/index.js +40 -4
- package/dist/WelcomeMessage/style.js +1 -0
- package/dist/Workspace/File/FileComponent.js +23 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/package.json +4 -4
|
@@ -63,8 +63,6 @@ import React, {
|
|
|
63
63
|
useRef,
|
|
64
64
|
useState
|
|
65
65
|
} from "react";
|
|
66
|
-
import { Editor, Transforms } from "slate";
|
|
67
|
-
import { ReactEditor } from "slate-react";
|
|
68
66
|
import { useRefFunction } from "../Hooks/useRefFunction";
|
|
69
67
|
import {
|
|
70
68
|
BaseMarkdownEditor
|
|
@@ -98,7 +96,7 @@ var MarkdownInputField = (_a) => {
|
|
|
98
96
|
"onFocus",
|
|
99
97
|
"isShowTopOperatingArea"
|
|
100
98
|
]);
|
|
101
|
-
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
99
|
+
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
102
100
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
103
101
|
const baseCls = getPrefixCls("agentic-md-input-field");
|
|
104
102
|
const { wrapSSR, hashId } = useStyle(baseCls);
|
|
@@ -318,30 +316,6 @@ var MarkdownInputField = (_a) => {
|
|
|
318
316
|
}
|
|
319
317
|
}
|
|
320
318
|
);
|
|
321
|
-
const handleContainerClick = useRefFunction(
|
|
322
|
-
(e) => {
|
|
323
|
-
var _a3, _b3, _c2, _d2;
|
|
324
|
-
if ((_a3 = markdownEditorRef == null ? void 0 : markdownEditorRef.current) == null ? void 0 : _a3.store.inputComposition)
|
|
325
|
-
return;
|
|
326
|
-
if (props.disabled)
|
|
327
|
-
return;
|
|
328
|
-
if ((_b3 = actionsRef.current) == null ? void 0 : _b3.contains(e.target))
|
|
329
|
-
return;
|
|
330
|
-
if ((_c2 = quickActionsRef.current) == null ? void 0 : _c2.contains(e.target))
|
|
331
|
-
return;
|
|
332
|
-
const editor = (_d2 = markdownEditorRef.current) == null ? void 0 : _d2.markdownEditorRef.current;
|
|
333
|
-
if (!editor)
|
|
334
|
-
return;
|
|
335
|
-
if (ReactEditor.isFocused(editor))
|
|
336
|
-
return;
|
|
337
|
-
ReactEditor.focus(editor);
|
|
338
|
-
Transforms.move(editor, { distance: 1, unit: "offset" });
|
|
339
|
-
Transforms.select(editor, {
|
|
340
|
-
anchor: Editor.end(editor, []),
|
|
341
|
-
focus: Editor.end(editor, [])
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
);
|
|
345
319
|
const sendActionsNode = /* @__PURE__ */ React.createElement(
|
|
346
320
|
SendActions,
|
|
347
321
|
{
|
|
@@ -404,17 +378,15 @@ var MarkdownInputField = (_a) => {
|
|
|
404
378
|
[`${baseCls}-enlarged`]: isEnlarged
|
|
405
379
|
}),
|
|
406
380
|
style: __spreadProps(__spreadValues(__spreadValues({}, props.style), enlargedStyle), {
|
|
407
|
-
|
|
408
|
-
height: isEnlarged ? `${(_k = (_j = props.enlargeable) == null ? void 0 : _j.height) != null ? _k : 980}px` : `max(${collapsedHeight}px,100%)`,
|
|
381
|
+
height: isEnlarged ? `${(_k = (_j = props.enlargeable) == null ? void 0 : _j.height) != null ? _k : 980}px` : `min(${collapsedHeightPx}px,100%)`,
|
|
409
382
|
borderRadius: borderRadius || 16,
|
|
410
|
-
maxHeight: isEnlarged ? "none" : `
|
|
383
|
+
maxHeight: isEnlarged ? "none" : `min(${collapsedHeightPx}px,100%)`,
|
|
411
384
|
transition: "height, max-height 0.3s,border-radius 0.3s,box-shadow 0.3s,transform 0.3s,opacity 0.3s,background 0.3s"
|
|
412
385
|
}),
|
|
413
386
|
tabIndex: 1,
|
|
414
387
|
onMouseEnter: () => setHover(true),
|
|
415
388
|
onMouseLeave: () => setHover(false),
|
|
416
|
-
onKeyDown: handleKeyDown
|
|
417
|
-
onClick: handleContainerClick
|
|
389
|
+
onKeyDown: handleKeyDown
|
|
418
390
|
},
|
|
419
391
|
/* @__PURE__ */ React.createElement(
|
|
420
392
|
"div",
|
|
@@ -423,7 +395,7 @@ var MarkdownInputField = (_a) => {
|
|
|
423
395
|
[`${baseCls}-hover`]: isHover
|
|
424
396
|
}),
|
|
425
397
|
style: {
|
|
426
|
-
minHeight: ((_l = props.style) == null ? void 0 : _l.minHeight) || 0,
|
|
398
|
+
minHeight: isEnlarged ? "auto" : isMultiRowLayout ? 106 : ((_l = props.style) == null ? void 0 : _l.minHeight) || 0,
|
|
427
399
|
height: "100%",
|
|
428
400
|
width: "100%"
|
|
429
401
|
}
|
|
@@ -434,170 +406,180 @@ var MarkdownInputField = (_a) => {
|
|
|
434
406
|
{
|
|
435
407
|
className: classNames(`${baseCls}-border-wrapper`, hashId),
|
|
436
408
|
style: {
|
|
437
|
-
height: isEnlarged ? "100%" : "
|
|
438
|
-
maxHeight: isEnlarged ? "100%" : "
|
|
409
|
+
height: isEnlarged ? "100%" : "100%",
|
|
410
|
+
maxHeight: isEnlarged ? "100%" : "100%",
|
|
439
411
|
borderRadius: (borderRadius || 16) - 2 || 10,
|
|
440
412
|
cursor: isLoading || props.disabled ? "not-allowed" : "auto",
|
|
441
413
|
opacity: props.disabled ? 0.5 : 1,
|
|
442
|
-
minHeight: isEnlarged ? "auto" : isMultiRowLayout ? 106 : void 0
|
|
414
|
+
minHeight: isEnlarged ? "auto" : isMultiRowLayout ? 106 : ((_m = props.style) == null ? void 0 : _m.minHeight) || 0
|
|
443
415
|
}
|
|
444
416
|
},
|
|
445
|
-
/* @__PURE__ */ React.createElement(
|
|
417
|
+
/* @__PURE__ */ React.createElement(
|
|
446
418
|
"div",
|
|
447
419
|
{
|
|
420
|
+
className: classNames(`${baseCls}-content-wrapper`, hashId),
|
|
448
421
|
style: {
|
|
449
|
-
|
|
450
|
-
flexDirection: "column",
|
|
451
|
-
borderTopLeftRadius: (borderRadius || 16) - 2 || 10,
|
|
452
|
-
borderTopRightRadius: (borderRadius || 16) - 2 || 10,
|
|
453
|
-
maxHeight: isEnlarged ? "none" : (() => {
|
|
454
|
-
var _a3, _b3;
|
|
455
|
-
const mh = (_a3 = props.style) == null ? void 0 : _a3.maxHeight;
|
|
456
|
-
const base = typeof mh === "number" ? mh : mh ? parseFloat(String(mh)) || 400 : 400;
|
|
457
|
-
const extra = ((_b3 = props.attachment) == null ? void 0 : _b3.enable) ? 90 : 0;
|
|
458
|
-
return `min(${base + extra}px)`;
|
|
459
|
-
})(),
|
|
460
|
-
height: isEnlarged ? "100%" : "auto",
|
|
461
|
-
flex: 1
|
|
462
|
-
},
|
|
463
|
-
className: classNames(`${baseCls}-editor`, hashId, {
|
|
464
|
-
[`${baseCls}-editor-hover`]: isHover,
|
|
465
|
-
[`${baseCls}-editor-disabled`]: props.disabled
|
|
466
|
-
})
|
|
467
|
-
},
|
|
468
|
-
/* @__PURE__ */ React.createElement(
|
|
469
|
-
SkillModeBar,
|
|
470
|
-
{
|
|
471
|
-
skillMode: props.skillMode,
|
|
472
|
-
onSkillModeOpenChange: props.onSkillModeOpenChange
|
|
422
|
+
minHeight: isEnlarged ? "auto" : isMultiRowLayout ? 106 : ((_n = props.style) == null ? void 0 : _n.minHeight) || 0
|
|
473
423
|
}
|
|
474
|
-
|
|
424
|
+
},
|
|
475
425
|
/* @__PURE__ */ React.createElement(
|
|
476
426
|
"div",
|
|
477
427
|
{
|
|
478
|
-
|
|
428
|
+
style: {
|
|
429
|
+
display: "flex",
|
|
430
|
+
flexDirection: "column",
|
|
431
|
+
borderTopLeftRadius: (borderRadius || 16) - 2 || 10,
|
|
432
|
+
borderTopRightRadius: (borderRadius || 16) - 2 || 10,
|
|
433
|
+
maxHeight: isEnlarged ? "none" : (() => {
|
|
434
|
+
var _a3, _b3;
|
|
435
|
+
const mh = (_a3 = props.style) == null ? void 0 : _a3.maxHeight;
|
|
436
|
+
const base = typeof mh === "number" ? mh : mh ? parseFloat(String(mh)) || 400 : 400;
|
|
437
|
+
const extra = ((_b3 = props.attachment) == null ? void 0 : _b3.enable) ? 90 : 0;
|
|
438
|
+
return `min(${base + extra}px)`;
|
|
439
|
+
})(),
|
|
440
|
+
height: isEnlarged ? "100%" : "auto",
|
|
441
|
+
flex: 1
|
|
442
|
+
},
|
|
443
|
+
className: classNames(`${baseCls}-editor`, hashId, {
|
|
444
|
+
[`${baseCls}-editor-hover`]: isHover,
|
|
445
|
+
[`${baseCls}-editor-disabled`]: props.disabled
|
|
446
|
+
})
|
|
479
447
|
},
|
|
480
|
-
attachmentList,
|
|
481
448
|
/* @__PURE__ */ React.createElement(
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
449
|
+
SkillModeBar,
|
|
450
|
+
{
|
|
451
|
+
skillMode: props.skillMode,
|
|
452
|
+
onSkillModeOpenChange: props.onSkillModeOpenChange
|
|
453
|
+
}
|
|
454
|
+
),
|
|
455
|
+
/* @__PURE__ */ React.createElement(
|
|
456
|
+
"div",
|
|
457
|
+
{
|
|
458
|
+
className: classNames(`${baseCls}-editor-content`, hashId)
|
|
459
|
+
},
|
|
460
|
+
attachmentList,
|
|
461
|
+
/* @__PURE__ */ React.createElement(
|
|
462
|
+
BaseMarkdownEditor,
|
|
463
|
+
__spreadValues({
|
|
464
|
+
editorRef: markdownEditorRef,
|
|
465
|
+
leafRender: props.leafRender,
|
|
466
|
+
style: {
|
|
467
|
+
width: "100%",
|
|
468
|
+
flex: 1,
|
|
469
|
+
padding: 0,
|
|
470
|
+
paddingRight: computedRightPadding
|
|
471
|
+
},
|
|
472
|
+
toolBar: {
|
|
473
|
+
enable: false
|
|
474
|
+
},
|
|
475
|
+
floatBar: {
|
|
476
|
+
enable: false
|
|
477
|
+
},
|
|
478
|
+
readonly: isLoading,
|
|
479
|
+
contentStyle: {
|
|
480
|
+
padding: "var(--padding-3x)"
|
|
481
|
+
},
|
|
482
|
+
textAreaProps: {
|
|
483
|
+
enable: true,
|
|
484
|
+
placeholder: props.placeholder,
|
|
485
|
+
triggerSendKey: props.triggerSendKey || "Enter"
|
|
486
|
+
},
|
|
487
|
+
tagInputProps: __spreadValues({
|
|
488
|
+
enable: true,
|
|
489
|
+
type: "dropdown"
|
|
490
|
+
}, tagInputProps),
|
|
491
|
+
initValue: props.value,
|
|
492
|
+
onChange: (value2) => {
|
|
493
|
+
var _a3;
|
|
494
|
+
setValue(value2);
|
|
495
|
+
(_a3 = props.onChange) == null ? void 0 : _a3.call(props, value2);
|
|
496
|
+
},
|
|
497
|
+
onFocus: (value2, schema, e) => {
|
|
498
|
+
onFocus == null ? void 0 : onFocus(value2, schema, e);
|
|
499
|
+
activeInput(true);
|
|
500
|
+
},
|
|
501
|
+
onBlur: (value2, schema, e) => {
|
|
502
|
+
onBlur == null ? void 0 : onBlur(value2, schema, e);
|
|
503
|
+
activeInput(false);
|
|
504
|
+
},
|
|
505
|
+
onPaste: (e) => {
|
|
506
|
+
handlePaste(e);
|
|
507
|
+
},
|
|
508
|
+
titlePlaceholderContent: props.placeholder,
|
|
509
|
+
toc: false,
|
|
510
|
+
pasteConfig: props.pasteConfig
|
|
511
|
+
}, markdownProps)
|
|
512
|
+
)
|
|
532
513
|
)
|
|
533
|
-
)
|
|
534
|
-
|
|
535
|
-
"div",
|
|
536
|
-
{
|
|
537
|
-
style: {
|
|
538
|
-
backgroundColor: "#fff",
|
|
539
|
-
display: "flex",
|
|
540
|
-
boxSizing: "border-box",
|
|
541
|
-
borderBottomLeftRadius: (borderRadius || 16) - 2 || 10,
|
|
542
|
-
borderBottomRightRadius: (borderRadius || 16) - 2 || 10,
|
|
543
|
-
flexDirection: "row",
|
|
544
|
-
alignItems: "center",
|
|
545
|
-
justifyContent: "space-between",
|
|
546
|
-
gap: 8,
|
|
547
|
-
width: "100%",
|
|
548
|
-
paddingRight: "var(--padding-card-base)",
|
|
549
|
-
paddingLeft: "var(--padding-card-base)",
|
|
550
|
-
paddingBottom: "var(--padding-card-base)"
|
|
551
|
-
}
|
|
552
|
-
},
|
|
553
|
-
/* @__PURE__ */ React.createElement(
|
|
514
|
+
),
|
|
515
|
+
props.toolsRender ? /* @__PURE__ */ React.createElement(
|
|
554
516
|
"div",
|
|
555
517
|
{
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
518
|
+
style: {
|
|
519
|
+
backgroundColor: "#fff",
|
|
520
|
+
display: "flex",
|
|
521
|
+
boxSizing: "border-box",
|
|
522
|
+
borderRadius: "inherit",
|
|
523
|
+
flexDirection: "row",
|
|
524
|
+
alignItems: "center",
|
|
525
|
+
justifyContent: "space-between",
|
|
526
|
+
gap: 8,
|
|
527
|
+
width: "100%",
|
|
528
|
+
paddingRight: "var(--padding-3x)",
|
|
529
|
+
paddingLeft: "var(--padding-3x)",
|
|
530
|
+
paddingBottom: "var(--padding-3x)"
|
|
531
|
+
}
|
|
559
532
|
},
|
|
560
|
-
|
|
533
|
+
/* @__PURE__ */ React.createElement(
|
|
534
|
+
"div",
|
|
535
|
+
{
|
|
536
|
+
ref: actionsRef,
|
|
537
|
+
contentEditable: false,
|
|
538
|
+
className: classNames(`${baseCls}-send-tools`, hashId)
|
|
539
|
+
},
|
|
540
|
+
props.toolsRender(__spreadProps(__spreadValues({
|
|
541
|
+
value,
|
|
542
|
+
fileMap,
|
|
543
|
+
onFileMapChange: setFileMap
|
|
544
|
+
}, props), {
|
|
545
|
+
isHover,
|
|
546
|
+
isLoading,
|
|
547
|
+
fileUploadStatus: fileUploadDone ? "done" : "uploading"
|
|
548
|
+
}))
|
|
549
|
+
),
|
|
550
|
+
sendActionsNode
|
|
551
|
+
) : sendActionsNode,
|
|
552
|
+
(props == null ? void 0 : props.quickActionRender) || ((_o = props.refinePrompt) == null ? void 0 : _o.enable) ? /* @__PURE__ */ React.createElement(
|
|
553
|
+
QuickActions,
|
|
554
|
+
{
|
|
555
|
+
ref: quickActionsRef,
|
|
561
556
|
value,
|
|
562
557
|
fileMap,
|
|
563
|
-
onFileMapChange: setFileMap
|
|
564
|
-
}, props), {
|
|
558
|
+
onFileMapChange: setFileMap,
|
|
565
559
|
isHover,
|
|
566
560
|
isLoading,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
setValue(text);
|
|
587
|
-
(_a3 = props.onChange) == null ? void 0 : _a3.call(props, text);
|
|
588
|
-
},
|
|
589
|
-
quickActionRender: props.quickActionRender,
|
|
590
|
-
prefixCls: baseCls,
|
|
591
|
-
hashId,
|
|
592
|
-
enlargeable: !!((_n = props.enlargeable) == null ? void 0 : _n.enable),
|
|
593
|
-
isEnlarged,
|
|
594
|
-
onEnlargeClick: handleEnlargeClick,
|
|
595
|
-
onResize: (width, rightOffset) => {
|
|
596
|
-
setTopRightPadding(width);
|
|
597
|
-
setQuickRightOffset(rightOffset);
|
|
561
|
+
disabled: props.disabled,
|
|
562
|
+
fileUploadStatus: fileUploadDone ? "done" : "uploading",
|
|
563
|
+
refinePrompt: props.refinePrompt,
|
|
564
|
+
editorRef: markdownEditorRef,
|
|
565
|
+
onValueChange: (text) => {
|
|
566
|
+
var _a3;
|
|
567
|
+
setValue(text);
|
|
568
|
+
(_a3 = props.onChange) == null ? void 0 : _a3.call(props, text);
|
|
569
|
+
},
|
|
570
|
+
quickActionRender: props.quickActionRender,
|
|
571
|
+
prefixCls: baseCls,
|
|
572
|
+
hashId,
|
|
573
|
+
enlargeable: !!((_p = props.enlargeable) == null ? void 0 : _p.enable),
|
|
574
|
+
isEnlarged,
|
|
575
|
+
onEnlargeClick: handleEnlargeClick,
|
|
576
|
+
onResize: (width, rightOffset) => {
|
|
577
|
+
setTopRightPadding(width);
|
|
578
|
+
setQuickRightOffset(rightOffset);
|
|
579
|
+
}
|
|
598
580
|
}
|
|
599
|
-
|
|
600
|
-
)
|
|
581
|
+
) : null
|
|
582
|
+
)
|
|
601
583
|
)
|
|
602
584
|
)
|
|
603
585
|
))
|
|
@@ -60,7 +60,8 @@ var VoiceInputButton = (props) => {
|
|
|
60
60
|
/* @__PURE__ */ React.createElement(
|
|
61
61
|
Tooltip,
|
|
62
62
|
{
|
|
63
|
-
mouseEnterDelay:
|
|
63
|
+
mouseEnterDelay: 2,
|
|
64
|
+
arrow: false,
|
|
64
65
|
title: recording ? (locale == null ? void 0 : locale["input.voiceInputting"]) || "语音输入中,点击可停止。" : (locale == null ? void 0 : locale["input.voiceInput"]) || "语音输入"
|
|
65
66
|
},
|
|
66
67
|
/* @__PURE__ */ React.createElement(
|
|
@@ -156,16 +156,10 @@ var genStyle = (token) => {
|
|
|
156
156
|
// 限定绘制范围,降低重绘影响
|
|
157
157
|
contain: "paint"
|
|
158
158
|
},
|
|
159
|
-
"&:focus": {
|
|
160
|
-
boxShadow: "none",
|
|
161
|
-
[`${token.componentCls}-background`]: {
|
|
162
|
-
opacity: 1
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
159
|
"&-border-wrapper": {
|
|
166
160
|
width: "100%",
|
|
167
|
-
border: "2px solid transparent",
|
|
168
161
|
zIndex: 9,
|
|
162
|
+
height: "100%",
|
|
169
163
|
boxSizing: "border-box"
|
|
170
164
|
},
|
|
171
165
|
"&-content-wrapper": {
|
|
@@ -178,6 +172,7 @@ var genStyle = (token) => {
|
|
|
178
172
|
},
|
|
179
173
|
"&-editor": {
|
|
180
174
|
boxSizing: "border-box",
|
|
175
|
+
borderRadius: "inherit",
|
|
181
176
|
backgroundColor: "var(--color-gray-bg-card-white)",
|
|
182
177
|
width: "100%",
|
|
183
178
|
zIndex: 9,
|
|
@@ -198,6 +193,7 @@ var genStyle = (token) => {
|
|
|
198
193
|
"&-editor-content": {
|
|
199
194
|
overflowY: "auto",
|
|
200
195
|
maxHeight: "inherit",
|
|
196
|
+
borderRadius: "inherit",
|
|
201
197
|
scrollbarColor: "var(--color-gray-text-tertiary) transparent",
|
|
202
198
|
scrollbarWidth: "thin"
|
|
203
199
|
},
|
|
@@ -217,10 +213,10 @@ var genStyle = (token) => {
|
|
|
217
213
|
"&-send-actions": {
|
|
218
214
|
position: "absolute",
|
|
219
215
|
userSelect: "none",
|
|
220
|
-
right:
|
|
216
|
+
right: 12,
|
|
221
217
|
boxSizing: "border-box",
|
|
222
218
|
zIndex: 99,
|
|
223
|
-
bottom:
|
|
219
|
+
bottom: 12,
|
|
224
220
|
display: "flex",
|
|
225
221
|
gap: "8px",
|
|
226
222
|
alignItems: "center",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TextAnimateProps } from '../Components/TextAnimate';
|
|
3
|
+
import { TypingAnimationProps } from '../Components/TypingAnimation';
|
|
4
|
+
export type WelcomeMessageTitleAnimateProps = Pick<TextAnimateProps, 'delay' | 'duration' | 'variants' | 'by' | 'startOnView' | 'once' | 'animation'>;
|
|
5
|
+
export type WelcomeMessageDescriptionAnimateProps = Pick<TypingAnimationProps, 'duration' | 'typeSpeed' | 'deleteSpeed' | 'delay' | 'pauseDelay' | 'loop' | 'startOnView' | 'showCursor' | 'blinkCursor' | 'cursorStyle'>;
|
|
2
6
|
/**
|
|
3
7
|
* WelcomeMessage 组件的属性接口
|
|
4
8
|
* @interface WelcomeMessageProps
|
|
@@ -7,12 +11,16 @@ export interface WelcomeMessageProps {
|
|
|
7
11
|
/** 标题 */
|
|
8
12
|
title?: React.ReactNode;
|
|
9
13
|
/** 描述 */
|
|
10
|
-
description?:
|
|
14
|
+
description?: string;
|
|
11
15
|
/** 自定义样式类名,用于各个提示项的不同部分 */
|
|
12
16
|
classNames?: {
|
|
13
17
|
title?: string;
|
|
14
18
|
description?: string;
|
|
15
19
|
};
|
|
20
|
+
/** 标题动画属性 */
|
|
21
|
+
titleAnimateProps?: WelcomeMessageTitleAnimateProps;
|
|
22
|
+
/** 描述动画属性 */
|
|
23
|
+
descriptionAnimateProps?: WelcomeMessageDescriptionAnimateProps;
|
|
16
24
|
/** 自定义样式 */
|
|
17
25
|
style?: React.CSSProperties;
|
|
18
26
|
/** 自定义根节点样式类名 */
|
|
@@ -28,10 +36,12 @@ export interface WelcomeMessageProps {
|
|
|
28
36
|
* @description 欢迎消息组件,用于显示聊天开始时的欢迎信息
|
|
29
37
|
* @param {WelcomeMessageProps} props - 组件属性
|
|
30
38
|
* @param {React.ReactNode} [props.title] - 欢迎标题
|
|
31
|
-
* @param {
|
|
39
|
+
* @param {string} [props.description] - 欢迎描述
|
|
32
40
|
* @param {Object} [props.classNames] - 自定义样式类名
|
|
33
41
|
* @param {string} [props.classNames.title] - 标题样式类名
|
|
34
42
|
* @param {string} [props.classNames.description] - 描述样式类名
|
|
43
|
+
* @param {WelcomeMessageTitleAnimateProps} [props.titleAnimateProps] - 标题动画属性
|
|
44
|
+
* @param {WelcomeMessageDescriptionAnimateProps} [props.descriptionAnimateProps] - 描述动画属性
|
|
35
45
|
* @param {React.CSSProperties} [props.style] - 自定义样式
|
|
36
46
|
* @param {string} [props.rootClassName] - 根节点样式类名
|
|
37
47
|
*
|
|
@@ -1,12 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
|
|
1
21
|
// src/WelcomeMessage/index.tsx
|
|
2
22
|
import { ConfigProvider } from "antd";
|
|
3
23
|
import classnames from "classnames";
|
|
4
24
|
import React, { useContext } from "react";
|
|
25
|
+
import { TextAnimate } from "../Components/TextAnimate";
|
|
26
|
+
import {
|
|
27
|
+
TypingAnimation
|
|
28
|
+
} from "../Components/TypingAnimation";
|
|
5
29
|
import { useStyle } from "./style";
|
|
6
30
|
var WelcomeMessage = ({
|
|
7
31
|
title,
|
|
8
32
|
description,
|
|
9
33
|
classNames,
|
|
34
|
+
titleAnimateProps,
|
|
35
|
+
descriptionAnimateProps,
|
|
10
36
|
style,
|
|
11
37
|
rootClassName
|
|
12
38
|
}) => {
|
|
@@ -14,14 +40,24 @@ var WelcomeMessage = ({
|
|
|
14
40
|
const prefixCls = getPrefixCls("agentic-welcome");
|
|
15
41
|
const { wrapSSR, hashId } = useStyle(prefixCls);
|
|
16
42
|
return wrapSSR(
|
|
17
|
-
/* @__PURE__ */ React.createElement("div", { className: classnames(prefixCls, hashId, rootClassName), style }, title && /* @__PURE__ */ React.createElement(
|
|
18
|
-
|
|
19
|
-
{
|
|
43
|
+
/* @__PURE__ */ React.createElement("div", { className: classnames(prefixCls, hashId, rootClassName), style }, title && /* @__PURE__ */ React.createElement(
|
|
44
|
+
TextAnimate,
|
|
45
|
+
__spreadProps(__spreadValues({
|
|
46
|
+
once: true
|
|
47
|
+
}, titleAnimateProps), {
|
|
48
|
+
as: "div",
|
|
49
|
+
className: classnames(`${prefixCls}-title`, classNames == null ? void 0 : classNames.title)
|
|
50
|
+
}),
|
|
51
|
+
title
|
|
52
|
+
), description && /* @__PURE__ */ React.createElement(
|
|
53
|
+
TypingAnimation,
|
|
54
|
+
__spreadProps(__spreadValues({}, descriptionAnimateProps), {
|
|
55
|
+
as: "div",
|
|
20
56
|
className: classnames(
|
|
21
57
|
`${prefixCls}-description`,
|
|
22
58
|
classNames == null ? void 0 : classNames.description
|
|
23
59
|
)
|
|
24
|
-
},
|
|
60
|
+
}),
|
|
25
61
|
description
|
|
26
62
|
))
|
|
27
63
|
);
|
|
@@ -493,6 +493,7 @@ var FileComponent = ({
|
|
|
493
493
|
const nodeIdCacheRef = useRef(
|
|
494
494
|
/* @__PURE__ */ new WeakMap()
|
|
495
495
|
);
|
|
496
|
+
const safeNodes = nodes || [];
|
|
496
497
|
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
|
|
497
498
|
const { locale } = useContext(I18nContext);
|
|
498
499
|
const prefixCls = getPrefixCls("workspace-file");
|
|
@@ -521,6 +522,28 @@ var FileComponent = ({
|
|
|
521
522
|
handleBackToList();
|
|
522
523
|
}
|
|
523
524
|
}, [resetKey]);
|
|
525
|
+
useEffect(() => {
|
|
526
|
+
if (!previewFile)
|
|
527
|
+
return;
|
|
528
|
+
const findUpdatedFile = (nodesList) => {
|
|
529
|
+
for (const node of nodesList) {
|
|
530
|
+
if ("children" in node) {
|
|
531
|
+
const found = findUpdatedFile(node.children);
|
|
532
|
+
if (found)
|
|
533
|
+
return found;
|
|
534
|
+
} else {
|
|
535
|
+
if (node.id && node.id === previewFile.id || node.name === previewFile.name && node.type === previewFile.type) {
|
|
536
|
+
return node;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return null;
|
|
541
|
+
};
|
|
542
|
+
const updatedFile = findUpdatedFile(safeNodes);
|
|
543
|
+
if (updatedFile) {
|
|
544
|
+
setPreviewFile(updatedFile);
|
|
545
|
+
}
|
|
546
|
+
}, [nodes]);
|
|
524
547
|
const handleToggleGroup = (groupId, type, collapsed) => {
|
|
525
548
|
setCollapsedGroups((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
526
549
|
[groupId]: collapsed
|
|
@@ -627,7 +650,6 @@ var FileComponent = ({
|
|
|
627
650
|
actionRef.current = null;
|
|
628
651
|
};
|
|
629
652
|
}, [actionRef, handlePreview, handleBackToList]);
|
|
630
|
-
const safeNodes = nodes || [];
|
|
631
653
|
const hasKeyword = Boolean((keyword != null ? keyword : "").trim());
|
|
632
654
|
const renderSearchInput = () => {
|
|
633
655
|
if (!showSearch)
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './Components/ActionIconBox';
|
|
|
10
10
|
export * from './Components/Button';
|
|
11
11
|
export * from './Components/LayoutHeader';
|
|
12
12
|
export * from './Components/Loading';
|
|
13
|
+
export * from './Components/lotties';
|
|
13
14
|
export * from './Components/SuggestionList';
|
|
14
15
|
export * from './Components/VisualList';
|
|
15
16
|
export * from './Hooks/useAutoScroll';
|
|
@@ -76,6 +77,9 @@ export * from './MarkdownInputField/VoiceInput';
|
|
|
76
77
|
export * from './Schema/SchemaRenderer/templateEngine';
|
|
77
78
|
export * from './Schema/validator';
|
|
78
79
|
export * from './Utils/proxySandbox';
|
|
80
|
+
export * from './Components/GradientText';
|
|
81
|
+
export * from './Components/TextAnimate';
|
|
82
|
+
export * from './Components/TypingAnimation';
|
|
79
83
|
export * from './MarkdownInputField/AttachmentButton/AttachmentFileList/AttachmentFileListItem';
|
|
80
84
|
export * from './MarkdownInputField/AttachmentButton/AttachmentFileList';
|
|
81
85
|
export * from './MarkdownInputField/AttachmentButton/utils';
|