@zero-library/chat-agent 2.1.13 → 2.1.15
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/README.md +1 -3
- package/dist/index.cjs.js +82 -90
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +29 -33
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +82 -27
- package/dist/index.d.ts +82 -27
- package/dist/index.esm.js +82 -90
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/index.css
CHANGED
|
@@ -53,8 +53,37 @@
|
|
|
53
53
|
padding: 10px;
|
|
54
54
|
border-radius: 4px;
|
|
55
55
|
}
|
|
56
|
+
.styles_module_think.ant-collapse {
|
|
57
|
+
margin-bottom: 16px;
|
|
58
|
+
}
|
|
59
|
+
.styles_module_think.ant-collapse .ant-collapse-header {
|
|
60
|
+
color: #8f91a8;
|
|
61
|
+
}
|
|
62
|
+
.styles_module_think.ant-collapse .ant-collapse-content {
|
|
63
|
+
color: #8f91a8;
|
|
64
|
+
}
|
|
65
|
+
.styles_module_think.ant-collapse .ant-collapse-content .ant-collapse-content-box {
|
|
66
|
+
padding: 0 10px 0 24px;
|
|
67
|
+
}
|
|
56
68
|
|
|
57
69
|
/* src/components/styles.module.less */
|
|
70
|
+
.styles_module_loadingMessage {
|
|
71
|
+
background-image:
|
|
72
|
+
linear-gradient(
|
|
73
|
+
90deg,
|
|
74
|
+
#ff6b23 0%,
|
|
75
|
+
#af3cb8 31%,
|
|
76
|
+
#53b6ff 89%);
|
|
77
|
+
background-size: 100% 2px;
|
|
78
|
+
background-repeat: no-repeat;
|
|
79
|
+
background-position: bottom;
|
|
80
|
+
padding-bottom: 2px;
|
|
81
|
+
}
|
|
82
|
+
@keyframes styles_module_spin {
|
|
83
|
+
to {
|
|
84
|
+
transform: rotate(360deg);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
58
87
|
.styles_module_chatAttachments > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-text {
|
|
59
88
|
display: none;
|
|
60
89
|
}
|
|
@@ -91,18 +120,6 @@
|
|
|
91
120
|
}
|
|
92
121
|
|
|
93
122
|
/* src/ui/common/styles.module.less */
|
|
94
|
-
.styles_module_loadingMessage {
|
|
95
|
-
background-image:
|
|
96
|
-
linear-gradient(
|
|
97
|
-
90deg,
|
|
98
|
-
#ff6b23 0%,
|
|
99
|
-
#af3cb8 31%,
|
|
100
|
-
#53b6ff 89%);
|
|
101
|
-
background-size: 100% 2px;
|
|
102
|
-
background-repeat: no-repeat;
|
|
103
|
-
background-position: bottom;
|
|
104
|
-
padding-bottom: 2px;
|
|
105
|
-
}
|
|
106
123
|
.styles_module_nsConversationListPanel {
|
|
107
124
|
width: 360px;
|
|
108
125
|
}
|
|
@@ -130,27 +147,6 @@
|
|
|
130
147
|
.styles_module_nsBubbleList.ant-bubble-list .ant-bubble.ant-bubble-end .ant-bubble-content-filled {
|
|
131
148
|
background-color: var(--ant-color-primary-bg);
|
|
132
149
|
}
|
|
133
|
-
.styles_module_nsBubbleList.ant-bubble-list .ant-bubble .ant-bubble-content .ant-typography {
|
|
134
|
-
font-size: 16px;
|
|
135
|
-
}
|
|
136
|
-
.styles_module_nsBubbleList.ant-bubble-list .ant-bubble .ant-bubble-content > .ant-collapse {
|
|
137
|
-
margin-bottom: 16px;
|
|
138
|
-
}
|
|
139
|
-
.styles_module_nsBubbleList.ant-bubble-list .ant-bubble .ant-bubble-content > .ant-collapse .ant-collapse-header {
|
|
140
|
-
color: #8f91a8;
|
|
141
|
-
}
|
|
142
|
-
.styles_module_nsBubbleList.ant-bubble-list .ant-bubble .ant-bubble-content > .ant-collapse .ant-collapse-content {
|
|
143
|
-
color: #8f91a8;
|
|
144
|
-
margin-top: -10px;
|
|
145
|
-
}
|
|
146
|
-
.styles_module_nsBubbleList.ant-bubble-list .ant-bubble .ant-bubble-content > .ant-collapse .ant-collapse-content .ant-collapse-content-box {
|
|
147
|
-
padding: 0 10px 0 24px;
|
|
148
|
-
}
|
|
149
|
-
@keyframes styles_module_spin {
|
|
150
|
-
to {
|
|
151
|
-
transform: rotate(360deg);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
150
|
.styles_module_nsChatHeader {
|
|
155
151
|
padding: 8px 16px;
|
|
156
152
|
border-bottom: 1px solid #eee;
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/common/markdownAlert/styles.module.less","../src/components/styles.module.less","../src/ui/common/styles.module.less","../src/ui/layouts/styles.module.less"],"sourcesContent":[".appCard {\n width: 180px;\n border-radius: 10px;\n border: 1px solid #d7d7d7;\n background-color: #fafafa;\n font-size: 16px;\n cursor: pointer;\n margin: 8px;\n padding: 12px 8px;\n}\n.appCard > div {\n max-width: 100%;\n}\n.appCard > img {\n height: 30px;\n}\n.fileView {\n width: 200px;\n padding: 4px 8px;\n cursor: pointer;\n background-color: #f5f3f3;\n border-radius: 6px;\n}\n.fileEdit {\n margin: 12px 0;\n border-radius: 6px;\n border: 1px solid #f2f2f2;\n}\n.fileEdit .fileEditHeader {\n padding: 2px 8px;\n background-color: #f2f2f2;\n}\n.fileEdit .fileEditContent {\n padding: 8px;\n background-color: #fafafa;\n}\n.quoteList {\n min-width: 300px;\n}\n.quoteList:global.ant-collapse .ant-collapse-item .ant-collapse-header {\n padding: 12px 0;\n color: #8f91a8;\n}\n.quoteList:global.ant-collapse .ant-collapse-item .ant-collapse-content {\n color: #8f91a8;\n background-color: #f2f2f2;\n}\n.mdEdit {\n margin: 10px 0;\n background-color: rgba(242, 242, 242, 0.2);\n border: 1px solid #f2f2f2;\n padding: 10px;\n border-radius: 4px;\n}\n",".chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-text {\n display: none;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-circle {\n animation: spin 2s linear infinite;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content {\n gap: 4px;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc {\n width: 15px;\n height: 15px;\n border: 2px solid transparent;\n border-color: #1890ff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n box-sizing: border-box;\n position: relative;\n clip-path: inset(0 0 30% 0);\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc .ant-attachment-list-card-ellipsis-prefix {\n display: none;\n}\n.chatSender:global.ant-sender:focus-within {\n box-shadow: none;\n}\n.chatQuoteMsg {\n margin-top: 4px;\n}\n.chatQuoteMsg:global.ant-bubble > .ant-bubble-content {\n min-height: auto;\n background-color: var(--ant-color-fill-tertiary) !important;\n color: var(--ant-color-text-tertiary);\n}\n",".loadingMessage {\n background-image: linear-gradient(90deg, #ff6b23 0%, #af3cb8 31%, #53b6ff 89%);\n background-size: 100% 2px;\n background-repeat: no-repeat;\n background-position: bottom;\n padding-bottom: 2px;\n}\n.nsConversationListPanel {\n width: 360px;\n}\n.nsConversations {\n padding: 0 24px;\n}\n.nsConversations :global .ant-conversations-group-title {\n padding: 0;\n}\n.nsConversations :global .ant-conversations-group-title .ant-typography {\n color: #878aab;\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item {\n padding-left: 16px;\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item .ant-conversations-label {\n color: rgba(0, 0, 0, 0.88);\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item.ant-conversations-item-active .ant-conversations-label {\n color: var(--ant-color-primary);\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble.ant-bubble-start .ant-bubble-content-filled {\n background-color: transparent;\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble.ant-bubble-end .ant-bubble-content-filled {\n background-color: var(--ant-color-primary-bg);\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble .ant-bubble-content .ant-typography {\n font-size: 16px;\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble .ant-bubble-content > .ant-collapse {\n margin-bottom: 16px;\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble .ant-bubble-content > .ant-collapse .ant-collapse-header {\n color: #8f91a8;\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble .ant-bubble-content > .ant-collapse .ant-collapse-content {\n color: #8f91a8;\n margin-top: -10px;\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble .ant-bubble-content > .ant-collapse .ant-collapse-content .ant-collapse-content-box {\n padding: 0 10px 0 24px;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n.nsChatHeader {\n padding: 8px 16px;\n border-bottom: 1px solid #eee;\n}\n.nsChatHeader .nsChatTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsChatHeader .nsChatHeaderPopover {\n max-height: 500px;\n width: 300px;\n display: flex;\n flex-direction: column;\n}\n.nsChatHeader .nsChatHeaderPopover :global .ant-popover-inner-content {\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.chatWelcomeWrap :global .ant-prompts .ant-prompts-list {\n overflow: auto;\n}\n.chatWelcomeWrap .chatWelcome :global .ant-welcome-icon > img {\n border-radius: 10px;\n max-width: initial;\n}\n.chatWelcomeWrap .chatWelcomePrompts {\n width: 300px;\n}\n.nsSenderListTitle {\n width: 300px;\n}\n.nsSenderList :global .ant-list-items {\n max-height: 350px;\n overflow-y: auto;\n margin-right: -12px;\n padding-right: 12px;\n}\n.nsSenderList.historyList :global .ant-list-items {\n max-height: initial;\n}\n.nsSenderList .nsSenderListItem {\n background-color: #f6f6f6;\n color: #6b6b6b !important;\n border-radius: 5px;\n width: 300px;\n padding: 6px 12px !important;\n margin-top: 12px;\n font-size: 14px;\n cursor: pointer;\n}\n.nsSenderList .nsSenderListFooter {\n font-size: 12px;\n}\n.nsChatUserName {\n font-size: 16px;\n font-weight: bold;\n}\n.nsSenderReferenceHeaderTitle:global > .ant-sender-header-title {\n overflow: hidden;\n}\n.nsSenderReferenceHeaderContent {\n padding: 0 !important;\n}\n.nsAvatarListContainer {\n height: 300px;\n padding: 30px 48px 30px 24px;\n overflow-y: auto;\n margin-right: -24px;\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem:hover {\n opacity: 90%;\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem .nsAvatarListItemIcon.nsAvatarListItemIconActive {\n outline: 2px solid var(--ant-color-primary);\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem .nsAvatarListItemName {\n font-size: 12px;\n}\n",".nsPreviewHeader {\n padding: 16px 24px;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\n}\n.nsPreviewHeader .nsPreviewHeaderTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsChatSenderHeader {\n margin-bottom: 16px;\n padding: 24px;\n font-size: 24px;\n text-align: center;\n}\n.nsDisclaimerNotice {\n font-size: 12px;\n text-align: center;\n color: #bfbfbf;\n}\n.nsChatLayout {\n background-color: #fff;\n}\n.nsChatLayout .nsChatBody {\n padding: 8px 0;\n}\n.nsBodyWidth {\n margin: 0 auto;\n max-width: 896px;\n min-width: 320px;\n width: calc(100% - 24px);\n}\n"],"mappings":";AAAA,CAACA;AACC,SAAO;AACP,iBAAe;AACf,UAAQ,IAAI,MAAM;AAClB,oBAAkB;AAClB,aAAW;AACX,UAAQ;AACR,UAAQ;AACR,WAAS,KAAK;AAChB;AACA,CAVCA,sBAUQ,EAAE;AACT,aAAW;AACb;AACA,CAbCA,sBAaQ,EAAE;AACT,UAAQ;AACV;AACA,CAACC;AACC,SAAO;AACP,WAAS,IAAI;AACb,UAAQ;AACR,oBAAkB;AAClB,iBAAe;AACjB;AACA,CAACC;AACC,UAAQ,KAAK;AACb,iBAAe;AACf,UAAQ,IAAI,MAAM;AACpB;AACA,CALCA,uBAKS,CAACC;AACT,WAAS,IAAI;AACb,oBA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3E,WAAS,IAAI,MAAM,IAAI;AACzB;AACA,CAZCJ,oCAYsB,CANCC,2BAMa,CANCC,+BAMiB,CAACG;AACtD,aAAW;AACb;;;ACrIA,CAACC;AACC,WAAS,KAAK;AACd,cAAY,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACtC;AACA,CAJCA,8BAIgB,CAACC;AAChB,aAAW;AACX,eAAa;AACf;AACA,CAACC;AACC,iBAAe;AACf,WAAS;AACT,aAAW;AACX,cAAY;AACd;AACA,CAACC;AACC,aAAW;AACX,cAAY;AACZ,SAAO;AACT;AACA,CAACC;AACC,oBAAkB;AACpB;AACA,CAHCA,2BAGa,CAACC;AACb,WAAS,IAAI;AACf;AACA,CAACC;AACC,UAAQ,EAAE;AACV,aAAW;AACX,aAAW;AACX,SAAO,KAAK,KAAK,EAAE;AACrB;","names":["appCard","fileView","fileEdit","fileEditHeader","fileEditContent","quoteList","mdEdit","chatAttachments","chatSender","chatQuoteMsg","loadingMessage","nsConversationListPanel","nsConversations","nsBubbleList","spin","nsChatHeader","nsChatTitle","nsChatHeaderPopover","chatWelcomeWrap","chatWelcome","chatWelcomePrompts","nsSenderListTitle","nsSenderList","historyList","nsSenderListItem","nsSenderListFooter","nsChatUserName","nsSenderReferenceHeaderTitle","nsSenderReferenceHeaderContent","nsAvatarListContainer","nsAvatarList","nsAvatarListItem","nsAvatarListItemIcon","nsAvatarListItemIconActive","nsAvatarListItemName","nsPreviewHeader","nsPreviewHeaderTitle","nsChatSenderHeader","nsDisclaimerNotice","nsChatLayout","nsChatBody","nsBodyWidth"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/common/markdownAlert/styles.module.less","../src/components/styles.module.less","../src/ui/common/styles.module.less","../src/ui/layouts/styles.module.less"],"sourcesContent":[".appCard {\n width: 180px;\n border-radius: 10px;\n border: 1px solid #d7d7d7;\n background-color: #fafafa;\n font-size: 16px;\n cursor: pointer;\n margin: 8px;\n padding: 12px 8px;\n}\n.appCard > div {\n max-width: 100%;\n}\n.appCard > img {\n height: 30px;\n}\n.fileView {\n width: 200px;\n padding: 4px 8px;\n cursor: pointer;\n background-color: #f5f3f3;\n border-radius: 6px;\n}\n.fileEdit {\n margin: 12px 0;\n border-radius: 6px;\n border: 1px solid #f2f2f2;\n}\n.fileEdit .fileEditHeader {\n padding: 2px 8px;\n background-color: #f2f2f2;\n}\n.fileEdit .fileEditContent {\n padding: 8px;\n background-color: #fafafa;\n}\n.quoteList {\n min-width: 300px;\n}\n.quoteList:global.ant-collapse .ant-collapse-item .ant-collapse-header {\n padding: 12px 0;\n color: #8f91a8;\n}\n.quoteList:global.ant-collapse .ant-collapse-item .ant-collapse-content {\n color: #8f91a8;\n background-color: #f2f2f2;\n}\n.mdEdit {\n margin: 10px 0;\n background-color: rgba(242, 242, 242, 0.2);\n border: 1px solid #f2f2f2;\n padding: 10px;\n border-radius: 4px;\n}\n.think:global.ant-collapse {\n margin-bottom: 16px;\n}\n.think:global.ant-collapse .ant-collapse-header {\n color: #8f91a8;\n}\n.think:global.ant-collapse .ant-collapse-content {\n color: #8f91a8;\n}\n.think:global.ant-collapse .ant-collapse-content .ant-collapse-content-box {\n padding: 0 10px 0 24px;\n}\n",".loadingMessage {\n background-image: linear-gradient(90deg, #ff6b23 0%, #af3cb8 31%, #53b6ff 89%);\n background-size: 100% 2px;\n background-repeat: no-repeat;\n background-position: bottom;\n padding-bottom: 2px;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-text {\n display: none;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-circle {\n animation: spin 2s linear infinite;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content {\n gap: 4px;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc {\n width: 15px;\n height: 15px;\n border: 2px solid transparent;\n border-color: #1890ff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n box-sizing: border-box;\n position: relative;\n clip-path: inset(0 0 30% 0);\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc .ant-attachment-list-card-ellipsis-prefix {\n display: none;\n}\n.chatSender:global.ant-sender:focus-within {\n box-shadow: none;\n}\n.chatQuoteMsg {\n margin-top: 4px;\n}\n.chatQuoteMsg:global.ant-bubble > .ant-bubble-content {\n min-height: auto;\n background-color: var(--ant-color-fill-tertiary) !important;\n color: var(--ant-color-text-tertiary);\n}\n",".nsConversationListPanel {\n width: 360px;\n}\n.nsConversations {\n padding: 0 24px;\n}\n.nsConversations :global .ant-conversations-group-title {\n padding: 0;\n}\n.nsConversations :global .ant-conversations-group-title .ant-typography {\n color: #878aab;\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item {\n padding-left: 16px;\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item .ant-conversations-label {\n color: rgba(0, 0, 0, 0.88);\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item.ant-conversations-item-active .ant-conversations-label {\n color: var(--ant-color-primary);\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble.ant-bubble-start .ant-bubble-content-filled {\n background-color: transparent;\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble.ant-bubble-end .ant-bubble-content-filled {\n background-color: var(--ant-color-primary-bg);\n}\n.nsChatHeader {\n padding: 8px 16px;\n border-bottom: 1px solid #eee;\n}\n.nsChatHeader .nsChatTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsChatHeader .nsChatHeaderPopover {\n max-height: 500px;\n width: 300px;\n display: flex;\n flex-direction: column;\n}\n.nsChatHeader .nsChatHeaderPopover :global .ant-popover-inner-content {\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.chatWelcomeWrap :global .ant-prompts .ant-prompts-list {\n overflow: auto;\n}\n.chatWelcomeWrap .chatWelcome :global .ant-welcome-icon > img {\n border-radius: 10px;\n max-width: initial;\n}\n.chatWelcomeWrap .chatWelcomePrompts {\n width: 300px;\n}\n.nsSenderListTitle {\n width: 300px;\n}\n.nsSenderList :global .ant-list-items {\n max-height: 350px;\n overflow-y: auto;\n margin-right: -12px;\n padding-right: 12px;\n}\n.nsSenderList.historyList :global .ant-list-items {\n max-height: initial;\n}\n.nsSenderList .nsSenderListItem {\n background-color: #f6f6f6;\n color: #6b6b6b !important;\n border-radius: 5px;\n width: 300px;\n padding: 6px 12px !important;\n margin-top: 12px;\n font-size: 14px;\n cursor: pointer;\n}\n.nsSenderList .nsSenderListFooter {\n font-size: 12px;\n}\n.nsChatUserName {\n font-size: 16px;\n font-weight: bold;\n}\n.nsSenderReferenceHeaderTitle:global > .ant-sender-header-title {\n overflow: hidden;\n}\n.nsSenderReferenceHeaderContent {\n padding: 0 !important;\n}\n.nsAvatarListContainer {\n height: 300px;\n padding: 30px 48px 30px 24px;\n overflow-y: auto;\n margin-right: -24px;\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem:hover {\n opacity: 90%;\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem .nsAvatarListItemIcon.nsAvatarListItemIconActive {\n outline: 2px solid var(--ant-color-primary);\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem .nsAvatarListItemName {\n font-size: 12px;\n}\n",".nsPreviewHeader {\n padding: 16px 24px;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\n}\n.nsPreviewHeader .nsPreviewHeaderTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsChatSenderHeader {\n margin-bottom: 16px;\n padding: 24px;\n font-size: 24px;\n text-align: center;\n}\n.nsDisclaimerNotice {\n font-size: 12px;\n text-align: center;\n color: #bfbfbf;\n}\n.nsChatLayout {\n background-color: #fff;\n}\n.nsChatLayout .nsChatBody {\n padding: 8px 0;\n}\n.nsBodyWidth {\n margin: 0 auto;\n max-width: 896px;\n min-width: 320px;\n width: calc(100% - 24px);\n}\n"],"mappings":";AAAA,CAACA;AACC,SAAO;AACP,iBAAe;AACf,UAAQ,IAAI,MAAM;AAClB,oBAAkB;AAClB,aAAW;AACX,UAAQ;AACR,UAAQ;AACR,WAAS,KAAK;AAChB;AACA,CAVCA,sBAUQ,EAAE;AACT,aAAW;AACb;AACA,CAbCA,sBAaQ,EAAE;AACT,UAAQ;AACV;AACA,CAACC;AACC,SAAO;AACP,WAAS,IAAI;AACb,UAAQ;AACR,oBAAkB;AAClB,iBAAe;AACjB;AACA,CAACC;AACC,UAAQ,KAAK;AACb,iBAAe;AACf,UAAQ,IAAI,MAAM;AACpB;AACA,CALCA,uBAKS,CAACC;AACT,WAAS,IAAI;AACb,oBAAkB;AACpB;AACA,CATCD,uBASS,CAACE;AACT,WAAS;AACT,oBAAkB;AACpB;AACA,CAACC;AACC,aAAW;AACb;AACA,CAHCA,uBAGgB,CAAC,aAAa,CAAC,kBAAkB,CAAC;AACjD,WAAS,KAAK;AACd,SAAO;AACT;AACA,CAPCA,uBAOgB,CAJC,aAIa,CAJC,kBAIkB,CAAC;AACjD,SAAO;AACP,oBAAkB;AACpB;AACA,CAACC;AACC,UAAQ,KAAK;AACb,oBAAkB,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;AACtC,UAAQ,IAAI,MAAM;AAClB,WAAS;AACT,iBAAe;AACjB;AACA,CAACC,mBAAY,CAfK;AAgBhB,iBAAe;AACjB;AACA,CAHCA,mBAGY,CAlBK,aAkBS,CAlBwB;AAmBjD,SAAO;AACT;AACA,CANCA,mBAMY,CArBK,aAqBS,CAjBwB;AAkBjD,SAAO;AACT;AACA,CATCA,mBASY,CAxBK,aAwBS,CApBwB,qBAoBF,CAAC;AAChD,WAAS,EAAE,KAAK,EAAE;AACpB;;;ACjEA,CAACC;AACC;AAAA,IAAkB;AAAA,MAAgB,KAAhB;AAAA,MAAu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ACA,CAACC;AACC,WAAS;AACX;AACA,CAACC;AACC,UAAQ;AACR,WAAS,KAAK,KAAK,KAAK;AACxB,cAAY;AACZ,gBAAc;AAChB;AACA,CANCA,oCAMsB,CAACC,2BAAa,CAACC,8BAAgB;AACpD,WAAS;AACX;AACA,CATCF,oCASsB,CAHCC,2BAGa,CAHCC,+BAGiB,CAACC,kCAAoB,CAACC;AAC3E,WAAS,IAAI,MAAM,IAAI;AACzB;AACA,CAZCJ,oCAYsB,CANCC,2BAMa,CANCC,+BAMiB,CAACG;AACtD,aAAW;AACb;;;ACzGA,CAACC;AACC,WAAS,KAAK;AACd,cAAY,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACtC;AACA,CAJCA,8BAIgB,CAACC;AAChB,aAAW;AACX,eAAa;AACf;AACA,CAACC;AACC,iBAAe;AACf,WAAS;AACT,aAAW;AACX,cAAY;AACd;AACA,CAACC;AACC,aAAW;AACX,cAAY;AACZ,SAAO;AACT;AACA,CAACC;AACC,oBAAkB;AACpB;AACA,CAHCA,2BAGa,CAACC;AACb,WAAS,IAAI;AACf;AACA,CAACC;AACC,UAAQ,EAAE;AACV,aAAW;AACX,aAAW;AACX,SAAO,KAAK,KAAK,EAAE;AACrB;","names":["appCard","fileView","fileEdit","fileEditHeader","fileEditContent","quoteList","mdEdit","think","loadingMessage","spin","chatAttachments","chatSender","chatQuoteMsg","nsConversationListPanel","nsConversations","nsBubbleList","nsChatHeader","nsChatTitle","nsChatHeaderPopover","chatWelcomeWrap","chatWelcome","chatWelcomePrompts","nsSenderListTitle","nsSenderList","historyList","nsSenderListItem","nsSenderListFooter","nsChatUserName","nsSenderReferenceHeaderTitle","nsSenderReferenceHeaderContent","nsAvatarListContainer","nsAvatarList","nsAvatarListItem","nsAvatarListItemIcon","nsAvatarListItemIconActive","nsAvatarListItemName","nsPreviewHeader","nsPreviewHeaderTitle","nsChatSenderHeader","nsDisclaimerNotice","nsChatLayout","nsChatBody","nsBodyWidth"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -207,7 +207,7 @@ interface ConversationMessage {
|
|
|
207
207
|
*/
|
|
208
208
|
conversationId: string;
|
|
209
209
|
conversationTitle?: string;
|
|
210
|
-
type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END';
|
|
210
|
+
type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END' | 'RUN_ERROR';
|
|
211
211
|
/**
|
|
212
212
|
* Id,消息ID
|
|
213
213
|
*/
|
|
@@ -443,6 +443,11 @@ interface AgentCharacter {
|
|
|
443
443
|
*/
|
|
444
444
|
sex: number;
|
|
445
445
|
}
|
|
446
|
+
/**
|
|
447
|
+
* 创建聊天服务
|
|
448
|
+
* @param request - 请求函数实例
|
|
449
|
+
* @returns 聊天服务对象
|
|
450
|
+
*/
|
|
446
451
|
declare const createChatService: (request: ReturnType<typeof createRequest>) => {
|
|
447
452
|
conversationsQuery: (params: ConversationsQuery) => Promise<R<PageRes<ConversationType>>>;
|
|
448
453
|
conversationCreate: (params: ConversationCreate) => Promise<R<string>>;
|
|
@@ -463,38 +468,38 @@ declare const createChatService: (request: ReturnType<typeof createRequest>) =>
|
|
|
463
468
|
fileUpload: (formData: FormData) => Promise<R<InputFile>>;
|
|
464
469
|
};
|
|
465
470
|
|
|
471
|
+
/**
|
|
472
|
+
* 会话成员类型枚举
|
|
473
|
+
* - 'agent': AI 智能体
|
|
474
|
+
* - 'user': 用户
|
|
475
|
+
* - 'other': 其他成员(如专家等)
|
|
476
|
+
*/
|
|
466
477
|
type ConversationMemberEnum = 'agent' | 'user' | 'other';
|
|
467
478
|
|
|
479
|
+
/**
|
|
480
|
+
* 文档类型接口
|
|
481
|
+
*/
|
|
468
482
|
interface DocType {
|
|
469
|
-
/**
|
|
470
|
-
* 内容
|
|
471
|
-
*/
|
|
483
|
+
/** 文档内容 */
|
|
472
484
|
content: string;
|
|
473
|
-
/**
|
|
474
|
-
* 文档ID
|
|
475
|
-
*/
|
|
485
|
+
/** 文档唯一标识 */
|
|
476
486
|
docId: string;
|
|
477
|
-
/**
|
|
478
|
-
* 关键字
|
|
479
|
-
*/
|
|
487
|
+
/** 文档关键字列表 */
|
|
480
488
|
keywords?: string[];
|
|
481
|
-
/**
|
|
482
|
-
* 位置
|
|
483
|
-
*/
|
|
489
|
+
/** 文档位置 */
|
|
484
490
|
position?: number;
|
|
485
|
-
/**
|
|
486
|
-
* 分段ID
|
|
487
|
-
*/
|
|
491
|
+
/** 文档分段ID */
|
|
488
492
|
sid?: string;
|
|
489
|
-
/**
|
|
490
|
-
* 令牌数
|
|
491
|
-
*/
|
|
493
|
+
/** 文档令牌数量 */
|
|
492
494
|
tokens?: number;
|
|
493
|
-
/**
|
|
494
|
-
* 字数
|
|
495
|
-
*/
|
|
495
|
+
/** 文档字数 */
|
|
496
496
|
wordCount?: number;
|
|
497
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* 创建文件服务
|
|
500
|
+
* @param request - 请求函数实例
|
|
501
|
+
* @returns 文件服务对象
|
|
502
|
+
*/
|
|
498
503
|
declare const createFileService: (request: ReturnType<typeof createRequest>) => {
|
|
499
504
|
docQuery: (paramsStr: string) => Promise<R<DocType>>;
|
|
500
505
|
fileCreate: (fileContent: string, fileName?: string, targetFormat?: string) => Promise<void>;
|
|
@@ -574,44 +579,85 @@ interface ChatServices {
|
|
|
574
579
|
request?: ReturnType<typeof createChatService> & ReturnType<typeof createFileService>;
|
|
575
580
|
}
|
|
576
581
|
|
|
582
|
+
/**
|
|
583
|
+
* 附件组件属性接口
|
|
584
|
+
*/
|
|
577
585
|
interface AttachmentsProps {
|
|
586
|
+
/** 文件上传函数,接收 FormData 并返回上传结果 */
|
|
578
587
|
fileUpload: (formData: FormData) => Promise<R<InputFile>>;
|
|
588
|
+
/** 文件上传配置列表,定义允许的文件类型和大小限制 */
|
|
579
589
|
fileUploadConfig?: FileUploadConfig[];
|
|
590
|
+
/** 额外的上传参数,会附加到 FormData 中 */
|
|
580
591
|
extraParams?: ObjectType<string | undefined>;
|
|
592
|
+
/** 当前文件列表 */
|
|
581
593
|
fileList?: InputFile[];
|
|
594
|
+
/** 文件列表变化回调函数 */
|
|
582
595
|
onChange: (fileList: InputFile[]) => void;
|
|
583
596
|
}
|
|
597
|
+
/**
|
|
598
|
+
* 附件上传组件
|
|
599
|
+
* 支持多文件上传、文件类型验证、文件大小限制等功能
|
|
600
|
+
*/
|
|
584
601
|
declare const _default$3: react.ForwardRefExoticComponent<AttachmentsProps & react.RefAttributes<unknown>>;
|
|
585
602
|
|
|
603
|
+
/**
|
|
604
|
+
* ChatSender 组件暴露的方法接口
|
|
605
|
+
*/
|
|
586
606
|
interface ChatSenderHandle {
|
|
607
|
+
/** 聚焦输入框 */
|
|
587
608
|
focus: (options?: {
|
|
588
609
|
cursor?: 'start' | 'end';
|
|
589
610
|
}) => void;
|
|
590
611
|
}
|
|
612
|
+
/**
|
|
613
|
+
* 文件上传配置接口
|
|
614
|
+
*/
|
|
591
615
|
interface FileUpload {
|
|
616
|
+
/** 上传时的额外参数 */
|
|
592
617
|
params?: ObjectType<any>;
|
|
618
|
+
/** 文件上传配置列表 */
|
|
593
619
|
config: FileUploadConfig[];
|
|
620
|
+
/** 文件上传请求函数 */
|
|
594
621
|
request: AttachmentsProps['fileUpload'];
|
|
595
622
|
}
|
|
596
|
-
|
|
623
|
+
/**
|
|
624
|
+
* ChatSender 组件属性接口
|
|
625
|
+
*/
|
|
626
|
+
interface SenderProps {
|
|
627
|
+
/** 输入框占位符 */
|
|
597
628
|
placeholder?: string;
|
|
629
|
+
/** 输入框内容 */
|
|
598
630
|
content?: string;
|
|
631
|
+
/** 文件列表 */
|
|
599
632
|
fileList?: InputFile[];
|
|
633
|
+
/** 是否打开文件选择头部 */
|
|
600
634
|
headerOpen?: boolean;
|
|
635
|
+
/** 是否正在发送消息 */
|
|
601
636
|
loading?: boolean;
|
|
637
|
+
/** 内容变化回调 */
|
|
602
638
|
onContentChange: (value: string) => void;
|
|
639
|
+
/** 文件列表变化回调 */
|
|
603
640
|
onFileListChange: (files: InputFile[]) => void;
|
|
641
|
+
/** 头部打开状态变化回调 */
|
|
604
642
|
onHeaderOpenChange: (open: boolean) => void;
|
|
643
|
+
/** 发送消息回调 */
|
|
605
644
|
onSend: () => void;
|
|
645
|
+
/** 取消发送回调 */
|
|
606
646
|
onCancel?: () => void;
|
|
647
|
+
/** 输入框聚焦回调 */
|
|
607
648
|
onFocus?: () => void;
|
|
649
|
+
/** 头部额外内容 */
|
|
608
650
|
extraHeader?: React.ReactNode;
|
|
651
|
+
/** 底部额外内容 */
|
|
609
652
|
extraFooter?: React.ReactNode;
|
|
653
|
+
/** 底部下方额外内容 */
|
|
610
654
|
extraFooterBelow?: React.ReactNode;
|
|
655
|
+
/** 发送按钮属性 */
|
|
611
656
|
sendBtnProps?: ButtonProps;
|
|
657
|
+
/** 文件上传配置 */
|
|
612
658
|
fileUpload?: FileUpload;
|
|
613
659
|
}
|
|
614
|
-
declare const _default$2: react.ForwardRefExoticComponent<
|
|
660
|
+
declare const _default$2: react.ForwardRefExoticComponent<SenderProps & react.RefAttributes<ChatSenderHandle>>;
|
|
615
661
|
|
|
616
662
|
interface ChatConfig {
|
|
617
663
|
receiverType?: number;
|
|
@@ -642,10 +688,19 @@ interface ChatProps {
|
|
|
642
688
|
}
|
|
643
689
|
declare const _default$1: react.ForwardRefExoticComponent<ChatProps & react.RefAttributes<ChatHandle>>;
|
|
644
690
|
|
|
645
|
-
|
|
691
|
+
/**
|
|
692
|
+
* MessageRender 组件属性接口
|
|
693
|
+
*/
|
|
694
|
+
interface MessageRenderProps {
|
|
695
|
+
/** 消息对象 */
|
|
646
696
|
message: ConversationMessage;
|
|
697
|
+
/** 消息气泡位置 */
|
|
647
698
|
placement: BubbleProps['placement'];
|
|
648
699
|
}
|
|
649
|
-
|
|
700
|
+
/**
|
|
701
|
+
* 消息渲染组件
|
|
702
|
+
* 用于渲染聊天消息内容,包括文本、文件附件和引用消息
|
|
703
|
+
*/
|
|
704
|
+
declare const _default: ({ message, placement }: MessageRenderProps) => react_jsx_runtime.JSX.Element;
|
|
650
705
|
|
|
651
|
-
export { type AgentInfo, _default$3 as Attachments, type ChatConfig, _default$1 as ChatCopilot, type ChatHandle, type ChatHooks, type ChatLayout, type ChatParams, type ChatProps, _default$2 as ChatSender, type ConversationStrategy, type InputFile, _default as MessageRender, type ReferencesType };
|
|
706
|
+
export { type AgentInfo, _default$3 as Attachments, type AttachmentsProps, type ChatConfig, _default$1 as ChatCopilot, type ChatHandle, type ChatHooks, type ChatLayout, type ChatParams, type ChatProps, _default$2 as ChatSender, type ConversationStrategy, type InputFile, _default as MessageRender, type MessageRenderProps, type ReferencesType, type SenderProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -207,7 +207,7 @@ interface ConversationMessage {
|
|
|
207
207
|
*/
|
|
208
208
|
conversationId: string;
|
|
209
209
|
conversationTitle?: string;
|
|
210
|
-
type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END';
|
|
210
|
+
type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END' | 'RUN_ERROR';
|
|
211
211
|
/**
|
|
212
212
|
* Id,消息ID
|
|
213
213
|
*/
|
|
@@ -443,6 +443,11 @@ interface AgentCharacter {
|
|
|
443
443
|
*/
|
|
444
444
|
sex: number;
|
|
445
445
|
}
|
|
446
|
+
/**
|
|
447
|
+
* 创建聊天服务
|
|
448
|
+
* @param request - 请求函数实例
|
|
449
|
+
* @returns 聊天服务对象
|
|
450
|
+
*/
|
|
446
451
|
declare const createChatService: (request: ReturnType<typeof createRequest>) => {
|
|
447
452
|
conversationsQuery: (params: ConversationsQuery) => Promise<R<PageRes<ConversationType>>>;
|
|
448
453
|
conversationCreate: (params: ConversationCreate) => Promise<R<string>>;
|
|
@@ -463,38 +468,38 @@ declare const createChatService: (request: ReturnType<typeof createRequest>) =>
|
|
|
463
468
|
fileUpload: (formData: FormData) => Promise<R<InputFile>>;
|
|
464
469
|
};
|
|
465
470
|
|
|
471
|
+
/**
|
|
472
|
+
* 会话成员类型枚举
|
|
473
|
+
* - 'agent': AI 智能体
|
|
474
|
+
* - 'user': 用户
|
|
475
|
+
* - 'other': 其他成员(如专家等)
|
|
476
|
+
*/
|
|
466
477
|
type ConversationMemberEnum = 'agent' | 'user' | 'other';
|
|
467
478
|
|
|
479
|
+
/**
|
|
480
|
+
* 文档类型接口
|
|
481
|
+
*/
|
|
468
482
|
interface DocType {
|
|
469
|
-
/**
|
|
470
|
-
* 内容
|
|
471
|
-
*/
|
|
483
|
+
/** 文档内容 */
|
|
472
484
|
content: string;
|
|
473
|
-
/**
|
|
474
|
-
* 文档ID
|
|
475
|
-
*/
|
|
485
|
+
/** 文档唯一标识 */
|
|
476
486
|
docId: string;
|
|
477
|
-
/**
|
|
478
|
-
* 关键字
|
|
479
|
-
*/
|
|
487
|
+
/** 文档关键字列表 */
|
|
480
488
|
keywords?: string[];
|
|
481
|
-
/**
|
|
482
|
-
* 位置
|
|
483
|
-
*/
|
|
489
|
+
/** 文档位置 */
|
|
484
490
|
position?: number;
|
|
485
|
-
/**
|
|
486
|
-
* 分段ID
|
|
487
|
-
*/
|
|
491
|
+
/** 文档分段ID */
|
|
488
492
|
sid?: string;
|
|
489
|
-
/**
|
|
490
|
-
* 令牌数
|
|
491
|
-
*/
|
|
493
|
+
/** 文档令牌数量 */
|
|
492
494
|
tokens?: number;
|
|
493
|
-
/**
|
|
494
|
-
* 字数
|
|
495
|
-
*/
|
|
495
|
+
/** 文档字数 */
|
|
496
496
|
wordCount?: number;
|
|
497
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* 创建文件服务
|
|
500
|
+
* @param request - 请求函数实例
|
|
501
|
+
* @returns 文件服务对象
|
|
502
|
+
*/
|
|
498
503
|
declare const createFileService: (request: ReturnType<typeof createRequest>) => {
|
|
499
504
|
docQuery: (paramsStr: string) => Promise<R<DocType>>;
|
|
500
505
|
fileCreate: (fileContent: string, fileName?: string, targetFormat?: string) => Promise<void>;
|
|
@@ -574,44 +579,85 @@ interface ChatServices {
|
|
|
574
579
|
request?: ReturnType<typeof createChatService> & ReturnType<typeof createFileService>;
|
|
575
580
|
}
|
|
576
581
|
|
|
582
|
+
/**
|
|
583
|
+
* 附件组件属性接口
|
|
584
|
+
*/
|
|
577
585
|
interface AttachmentsProps {
|
|
586
|
+
/** 文件上传函数,接收 FormData 并返回上传结果 */
|
|
578
587
|
fileUpload: (formData: FormData) => Promise<R<InputFile>>;
|
|
588
|
+
/** 文件上传配置列表,定义允许的文件类型和大小限制 */
|
|
579
589
|
fileUploadConfig?: FileUploadConfig[];
|
|
590
|
+
/** 额外的上传参数,会附加到 FormData 中 */
|
|
580
591
|
extraParams?: ObjectType<string | undefined>;
|
|
592
|
+
/** 当前文件列表 */
|
|
581
593
|
fileList?: InputFile[];
|
|
594
|
+
/** 文件列表变化回调函数 */
|
|
582
595
|
onChange: (fileList: InputFile[]) => void;
|
|
583
596
|
}
|
|
597
|
+
/**
|
|
598
|
+
* 附件上传组件
|
|
599
|
+
* 支持多文件上传、文件类型验证、文件大小限制等功能
|
|
600
|
+
*/
|
|
584
601
|
declare const _default$3: react.ForwardRefExoticComponent<AttachmentsProps & react.RefAttributes<unknown>>;
|
|
585
602
|
|
|
603
|
+
/**
|
|
604
|
+
* ChatSender 组件暴露的方法接口
|
|
605
|
+
*/
|
|
586
606
|
interface ChatSenderHandle {
|
|
607
|
+
/** 聚焦输入框 */
|
|
587
608
|
focus: (options?: {
|
|
588
609
|
cursor?: 'start' | 'end';
|
|
589
610
|
}) => void;
|
|
590
611
|
}
|
|
612
|
+
/**
|
|
613
|
+
* 文件上传配置接口
|
|
614
|
+
*/
|
|
591
615
|
interface FileUpload {
|
|
616
|
+
/** 上传时的额外参数 */
|
|
592
617
|
params?: ObjectType<any>;
|
|
618
|
+
/** 文件上传配置列表 */
|
|
593
619
|
config: FileUploadConfig[];
|
|
620
|
+
/** 文件上传请求函数 */
|
|
594
621
|
request: AttachmentsProps['fileUpload'];
|
|
595
622
|
}
|
|
596
|
-
|
|
623
|
+
/**
|
|
624
|
+
* ChatSender 组件属性接口
|
|
625
|
+
*/
|
|
626
|
+
interface SenderProps {
|
|
627
|
+
/** 输入框占位符 */
|
|
597
628
|
placeholder?: string;
|
|
629
|
+
/** 输入框内容 */
|
|
598
630
|
content?: string;
|
|
631
|
+
/** 文件列表 */
|
|
599
632
|
fileList?: InputFile[];
|
|
633
|
+
/** 是否打开文件选择头部 */
|
|
600
634
|
headerOpen?: boolean;
|
|
635
|
+
/** 是否正在发送消息 */
|
|
601
636
|
loading?: boolean;
|
|
637
|
+
/** 内容变化回调 */
|
|
602
638
|
onContentChange: (value: string) => void;
|
|
639
|
+
/** 文件列表变化回调 */
|
|
603
640
|
onFileListChange: (files: InputFile[]) => void;
|
|
641
|
+
/** 头部打开状态变化回调 */
|
|
604
642
|
onHeaderOpenChange: (open: boolean) => void;
|
|
643
|
+
/** 发送消息回调 */
|
|
605
644
|
onSend: () => void;
|
|
645
|
+
/** 取消发送回调 */
|
|
606
646
|
onCancel?: () => void;
|
|
647
|
+
/** 输入框聚焦回调 */
|
|
607
648
|
onFocus?: () => void;
|
|
649
|
+
/** 头部额外内容 */
|
|
608
650
|
extraHeader?: React.ReactNode;
|
|
651
|
+
/** 底部额外内容 */
|
|
609
652
|
extraFooter?: React.ReactNode;
|
|
653
|
+
/** 底部下方额外内容 */
|
|
610
654
|
extraFooterBelow?: React.ReactNode;
|
|
655
|
+
/** 发送按钮属性 */
|
|
611
656
|
sendBtnProps?: ButtonProps;
|
|
657
|
+
/** 文件上传配置 */
|
|
612
658
|
fileUpload?: FileUpload;
|
|
613
659
|
}
|
|
614
|
-
declare const _default$2: react.ForwardRefExoticComponent<
|
|
660
|
+
declare const _default$2: react.ForwardRefExoticComponent<SenderProps & react.RefAttributes<ChatSenderHandle>>;
|
|
615
661
|
|
|
616
662
|
interface ChatConfig {
|
|
617
663
|
receiverType?: number;
|
|
@@ -642,10 +688,19 @@ interface ChatProps {
|
|
|
642
688
|
}
|
|
643
689
|
declare const _default$1: react.ForwardRefExoticComponent<ChatProps & react.RefAttributes<ChatHandle>>;
|
|
644
690
|
|
|
645
|
-
|
|
691
|
+
/**
|
|
692
|
+
* MessageRender 组件属性接口
|
|
693
|
+
*/
|
|
694
|
+
interface MessageRenderProps {
|
|
695
|
+
/** 消息对象 */
|
|
646
696
|
message: ConversationMessage;
|
|
697
|
+
/** 消息气泡位置 */
|
|
647
698
|
placement: BubbleProps['placement'];
|
|
648
699
|
}
|
|
649
|
-
|
|
700
|
+
/**
|
|
701
|
+
* 消息渲染组件
|
|
702
|
+
* 用于渲染聊天消息内容,包括文本、文件附件和引用消息
|
|
703
|
+
*/
|
|
704
|
+
declare const _default: ({ message, placement }: MessageRenderProps) => react_jsx_runtime.JSX.Element;
|
|
650
705
|
|
|
651
|
-
export { type AgentInfo, _default$3 as Attachments, type ChatConfig, _default$1 as ChatCopilot, type ChatHandle, type ChatHooks, type ChatLayout, type ChatParams, type ChatProps, _default$2 as ChatSender, type ConversationStrategy, type InputFile, _default as MessageRender, type ReferencesType };
|
|
706
|
+
export { type AgentInfo, _default$3 as Attachments, type AttachmentsProps, type ChatConfig, _default$1 as ChatCopilot, type ChatHandle, type ChatHooks, type ChatLayout, type ChatParams, type ChatProps, _default$2 as ChatSender, type ConversationStrategy, type InputFile, _default as MessageRender, type MessageRenderProps, type ReferencesType, type SenderProps };
|