@zero-library/chat-agent 2.0.10 → 2.1.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/README.md +3 -0
- package/dist/index.cjs.js +850 -742
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +77 -62
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +255 -41
- package/dist/index.d.ts +255 -41
- package/dist/index.esm.js +852 -744
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/index.css
CHANGED
|
@@ -1,3 +1,59 @@
|
|
|
1
|
+
/* src/ui/common/markdownAlert/styles.module.less */
|
|
2
|
+
.styles_module_appCard {
|
|
3
|
+
width: 180px;
|
|
4
|
+
border-radius: 10px;
|
|
5
|
+
border: 1px solid #d7d7d7;
|
|
6
|
+
background-color: #fafafa;
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
margin: 8px;
|
|
10
|
+
padding: 12px 8px;
|
|
11
|
+
}
|
|
12
|
+
.styles_module_appCard > div {
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
}
|
|
15
|
+
.styles_module_appCard > img {
|
|
16
|
+
height: 30px;
|
|
17
|
+
}
|
|
18
|
+
.styles_module_fileView {
|
|
19
|
+
width: 200px;
|
|
20
|
+
padding: 4px 8px;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
background-color: #f5f3f3;
|
|
23
|
+
border-radius: 6px;
|
|
24
|
+
}
|
|
25
|
+
.styles_module_fileEdit {
|
|
26
|
+
margin: 12px 0;
|
|
27
|
+
border-radius: 6px;
|
|
28
|
+
border: 1px solid #f2f2f2;
|
|
29
|
+
}
|
|
30
|
+
.styles_module_fileEdit .styles_module_fileEditHeader {
|
|
31
|
+
padding: 2px 8px;
|
|
32
|
+
background-color: #f2f2f2;
|
|
33
|
+
}
|
|
34
|
+
.styles_module_fileEdit .styles_module_fileEditContent {
|
|
35
|
+
padding: 8px;
|
|
36
|
+
background-color: #fafafa;
|
|
37
|
+
}
|
|
38
|
+
.styles_module_quoteList {
|
|
39
|
+
min-width: 300px;
|
|
40
|
+
}
|
|
41
|
+
.styles_module_quoteList.ant-collapse .ant-collapse-item .ant-collapse-header {
|
|
42
|
+
padding: 12px 0;
|
|
43
|
+
color: #8f91a8;
|
|
44
|
+
}
|
|
45
|
+
.styles_module_quoteList.ant-collapse .ant-collapse-item .ant-collapse-content {
|
|
46
|
+
color: #8f91a8;
|
|
47
|
+
background-color: #f2f2f2;
|
|
48
|
+
}
|
|
49
|
+
.styles_module_mdEdit {
|
|
50
|
+
margin: 10px 0;
|
|
51
|
+
background-color: rgba(242, 242, 242, 0.2);
|
|
52
|
+
border: 1px solid #f2f2f2;
|
|
53
|
+
padding: 10px;
|
|
54
|
+
border-radius: 4px;
|
|
55
|
+
}
|
|
56
|
+
|
|
1
57
|
/* src/ui/common/styles.module.less */
|
|
2
58
|
.styles_module_loadingMessage {
|
|
3
59
|
background-image:
|
|
@@ -65,21 +121,21 @@
|
|
|
65
121
|
transform: rotate(360deg);
|
|
66
122
|
}
|
|
67
123
|
}
|
|
68
|
-
.
|
|
124
|
+
.styles_module_nsChatHeader {
|
|
69
125
|
padding: 8px 16px;
|
|
70
126
|
border-bottom: 1px solid #eee;
|
|
71
127
|
}
|
|
72
|
-
.
|
|
128
|
+
.styles_module_nsChatHeader .styles_module_nsChatTitle {
|
|
73
129
|
font-size: 16px;
|
|
74
130
|
font-weight: bold;
|
|
75
131
|
}
|
|
76
|
-
.
|
|
132
|
+
.styles_module_nsChatHeader .styles_module_nsChatHeaderPopover {
|
|
77
133
|
max-height: 500px;
|
|
78
134
|
width: 300px;
|
|
79
135
|
display: flex;
|
|
80
136
|
flex-direction: column;
|
|
81
137
|
}
|
|
82
|
-
.
|
|
138
|
+
.styles_module_nsChatHeader .styles_module_nsChatHeaderPopover .ant-popover-inner-content {
|
|
83
139
|
min-height: 0;
|
|
84
140
|
display: flex;
|
|
85
141
|
flex-direction: column;
|
|
@@ -129,74 +185,33 @@
|
|
|
129
185
|
.styles_module_nsSenderReferenceHeaderContent {
|
|
130
186
|
padding: 0 !important;
|
|
131
187
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
border: 1px solid #d7d7d7;
|
|
138
|
-
background-color: #fafafa;
|
|
139
|
-
font-size: 16px;
|
|
140
|
-
cursor: pointer;
|
|
141
|
-
margin: 8px;
|
|
142
|
-
padding: 12px 8px;
|
|
143
|
-
}
|
|
144
|
-
.styles_module_appCard > div {
|
|
145
|
-
max-width: 100%;
|
|
146
|
-
}
|
|
147
|
-
.styles_module_appCard > img {
|
|
148
|
-
height: 30px;
|
|
149
|
-
}
|
|
150
|
-
.styles_module_fileView {
|
|
151
|
-
width: 200px;
|
|
152
|
-
padding: 4px 8px;
|
|
153
|
-
cursor: pointer;
|
|
154
|
-
background-color: #f5f3f3;
|
|
155
|
-
border-radius: 6px;
|
|
156
|
-
}
|
|
157
|
-
.styles_module_fileEdit {
|
|
158
|
-
margin: 12px 0;
|
|
159
|
-
border-radius: 6px;
|
|
160
|
-
border: 1px solid #f2f2f2;
|
|
161
|
-
}
|
|
162
|
-
.styles_module_fileEdit .styles_module_fileEditHeader {
|
|
163
|
-
padding: 2px 8px;
|
|
164
|
-
background-color: #f2f2f2;
|
|
188
|
+
.styles_module_avatarListContainer {
|
|
189
|
+
height: 300px;
|
|
190
|
+
padding: 30px 48px 30px 24px;
|
|
191
|
+
overflow-y: auto;
|
|
192
|
+
margin-right: -24px;
|
|
165
193
|
}
|
|
166
|
-
.
|
|
167
|
-
|
|
168
|
-
background-color: #fafafa;
|
|
194
|
+
.styles_module_avatarListContainer .styles_module_avatarList .styles_module_avatarListItem:hover {
|
|
195
|
+
opacity: 90%;
|
|
169
196
|
}
|
|
170
|
-
.
|
|
171
|
-
|
|
197
|
+
.styles_module_avatarListContainer .styles_module_avatarList .styles_module_avatarListItem .styles_module_avatarListItemIcon.styles_module_avatarListItemIconActive {
|
|
198
|
+
outline: 2px solid var(--ant-color-primary);
|
|
172
199
|
}
|
|
173
|
-
.
|
|
174
|
-
|
|
175
|
-
color: #8f91a8;
|
|
176
|
-
}
|
|
177
|
-
.styles_module_quoteList.ant-collapse .ant-collapse-item .ant-collapse-content {
|
|
178
|
-
color: #8f91a8;
|
|
179
|
-
background-color: #f2f2f2;
|
|
180
|
-
}
|
|
181
|
-
.styles_module_mdEdit {
|
|
182
|
-
margin: 10px 0;
|
|
183
|
-
background-color: rgba(242, 242, 242, 0.2);
|
|
184
|
-
border: 1px solid #f2f2f2;
|
|
185
|
-
padding: 10px;
|
|
186
|
-
border-radius: 4px;
|
|
200
|
+
.styles_module_avatarListContainer .styles_module_avatarList .styles_module_avatarListItem .styles_module_avatarListItemName {
|
|
201
|
+
font-size: 12px;
|
|
187
202
|
}
|
|
188
203
|
|
|
189
|
-
/* src/components/styles.less */
|
|
190
|
-
.
|
|
204
|
+
/* src/components/styles.module.less */
|
|
205
|
+
.styles_module_nsAttachments > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-text {
|
|
191
206
|
display: none;
|
|
192
207
|
}
|
|
193
|
-
.
|
|
208
|
+
.styles_module_nsAttachments > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-circle {
|
|
194
209
|
animation: spin 2s linear infinite;
|
|
195
210
|
}
|
|
196
|
-
.
|
|
211
|
+
.styles_module_nsAttachments > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content {
|
|
197
212
|
gap: 4px;
|
|
198
213
|
}
|
|
199
|
-
.
|
|
214
|
+
.styles_module_nsAttachments > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc {
|
|
200
215
|
width: 15px;
|
|
201
216
|
height: 15px;
|
|
202
217
|
border: 2px solid transparent;
|
|
@@ -207,7 +222,7 @@
|
|
|
207
222
|
position: relative;
|
|
208
223
|
clip-path: inset(0 0 30% 0);
|
|
209
224
|
}
|
|
210
|
-
.
|
|
225
|
+
.styles_module_nsAttachments > .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 {
|
|
211
226
|
display: none;
|
|
212
227
|
}
|
|
213
228
|
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/common/styles.module.less","../src/ui/common/markdownAlert/styles.module.less","../src/components/styles.less","../src/ui/layouts/styles.module.less"],"sourcesContent":[".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.conversationListPanel {\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.nsBodyWidth {\n margin: 0 auto;\n max-width: 896px;\n min-width: 320px;\n width: calc(100% - 24px) !important;\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.nsAgentHeader {\n padding: 8px 16px;\n border-bottom: 1px solid #eee;\n}\n.nsAgentHeader .nsChatTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsAgentHeader .nsChatHeaderPopover {\n max-height: 500px;\n width: 300px;\n display: flex;\n flex-direction: column;\n}\n.nsAgentHeader .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.senderListTitle {\n width: 300px;\n}\n.senderList :global .ant-list-items {\n max-height: 350px;\n overflow-y: auto;\n margin-right: -12px;\n padding-right: 12px;\n}\n.senderList.historyList :global .ant-list-items {\n max-height: initial;\n}\n.senderList .senderListItem {\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.senderList .senderListFooter {\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",".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",".nsAttachments .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-text {\n display: none;\n}\n.nsAttachments .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-circle {\n animation: spin 2s linear infinite;\n}\n.nsAttachments .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content {\n gap: 4px;\n}\n.nsAttachments .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.nsAttachments .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",".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 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"],"mappings":";AAAA,CAACA;AACC;AAAA,IAAkB;AAAA,MAAgB,KAAhB;AAAA,MAAuB,QAAQ,EAA/B;AAAA,MAAmC,QAAQ,GAA3C;AAAA,MAAgD,QAAQ;AAC1E,mBAAiB,KAAK;AACtB,qBAAmB;AACnB,uBAAqB;AACrB,kBAAgB;AAClB;AACA,CAACC;AACC,SAAO;AACT;AACA,CAACC;AACC,WAAS,EAAE;AACb;AACA,CAHCA,8BAGwB,CAAC;AACxB,WAAS;AACX;AACA,CANCA,8BAMwB,CAHC,8BAG8B,CAAC;AACvD,SAAO;AACT;AACA,CATCA,8BASwB,CAAC,uBAAuB,CAAC;AAChD,gBAAc;AAChB;AACA,CAZCA,8BAYwB,CAHC,uBAGuB,CAHC,uBAGuB,CAAC;AACxE,SAAO,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACvB;AACA,CAfCA,8BAewB,CANC,uBAMuB,CANC,sBAMsB,CAAC,8BAA8B,CAH7B;AAIxE,SAAO,IAAI;AACb;AACA,CAACC;AACC,UAAQ,EAAE;AACV,aAAW;AACX,aAAW;AACX,SAAO,KAAK,KAAK,EAAE;AACrB;AACA,CAACC,0BAAmB,CAAC,gBAAgB,CAAC,UAAU,CAAC,iBAAiB,CAAC;AACjE,oBAAkB;AACpB;AACA,CAHCA,0BAGmB,CAHC,gBAGgB,CAHC,UAGU,CAAC,eAAe,CAHG;AAIjE,oBAAkB,IAAI;AACxB;AACA,CANCA,0BAMmB,CANC,gBAMgB,CANC,WAMW,CAAC,mBAAmB,CAxBZ;AAyBvD,aAAW;AACb;AACA,CATCA,0BASmB,CATC,gBASgB,C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CAS0C,CAHC,iCAGiC,CAAC;AAChH,SAAO;AACP,UAAQ;AACR,UAAQ,IAAI,MAAM;AAClB,gBAAc;AACd,iBAAe;AACf,aAAW,KAAK,GAAG,OAAO;AAC1B,cAAY;AACZ,YAAU;AACV,aAAW,MAAM,EAAE,EAAE,IAAI;AAC3B;AACA,CApBC,cAoBc,CApBC,oBAoBoB,CApBC,0CAoB0C,CAdC,iCAciC,CAXC,8BAW8B,CAAC;AAC/I,WAAS;AACX;;;ACtBA,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,WAAS;AACT,aAAW;AACX,cAAY;AACd;AACA,CAACC;AACC,aAAW;AACX,cAAY;AACZ,SAAO;AACT;AACA,CAACC;AACC,oBAAkB;AACpB;","names":["loadingMessage","conversationListPanel","nsConversations","nsBodyWidth","nsBubbleList","spin","nsAgentHeader","nsChatTitle","nsChatHeaderPopover","chatWelcomeWrap","chatWelcome","chatWelcomePrompts","senderListTitle","senderList","historyList","senderListItem","senderListFooter","nsChatUserName","nsSenderReferenceHeaderTitle","nsSenderReferenceHeaderContent","appCard","fileView","fileEdit","fileEditHeader","fileEditContent","quoteList","mdEdit","nsPreviewHeader","nsPreviewHeaderTitle","nsChatSenderHeader","nsDisclaimerNotice","nsChatLayout"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/common/markdownAlert/styles.module.less","../src/ui/common/styles.module.less","../src/components/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",".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.conversationListPanel {\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.nsBodyWidth {\n margin: 0 auto;\n max-width: 896px;\n min-width: 320px;\n width: calc(100% - 24px) !important;\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.senderListTitle {\n width: 300px;\n}\n.senderList :global .ant-list-items {\n max-height: 350px;\n overflow-y: auto;\n margin-right: -12px;\n padding-right: 12px;\n}\n.senderList.historyList :global .ant-list-items {\n max-height: initial;\n}\n.senderList .senderListItem {\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.senderList .senderListFooter {\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.avatarListContainer {\n height: 300px;\n padding: 30px 48px 30px 24px;\n overflow-y: auto;\n margin-right: -24px;\n}\n.avatarListContainer .avatarList .avatarListItem:hover {\n opacity: 90%;\n}\n.avatarListContainer .avatarList .avatarListItem .avatarListItemIcon.avatarListItemIconActive {\n outline: 2px solid var(--ant-color-primary);\n}\n.avatarListContainer .avatarList .avatarListItem .avatarListItemName {\n font-size: 12px;\n}\n",".nsAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-text {\n display: none;\n}\n.nsAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-circle {\n animation: spin 2s linear infinite;\n}\n.nsAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content {\n gap: 4px;\n}\n.nsAttachments: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.nsAttachments: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",".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 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"],"mappings":";AAAA,CAACA;AACC,SAAO;AACP,iBAAe;AACf,UAAQ,IAAI,MAAM;AA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AC;AACvF,OAAK;AACP;AACA,CATCA,4BASqB,EAAE,CATC,oBASoB,CATC,0CAS0C,CAHC,iCAGiC,CAAC;AACzH,SAAO;AACP,UAAQ;AACR,UAAQ,IAAI,MAAM;AAClB,gBAAc;AACd,iBAAe;AACf,aAAW,KAAK,GAAG,OAAO;AAC1B,cAAY;AACZ,YAAU;AACV,aAAW,MAAM,EAAE,EAAE,IAAI;AAC3B;AACA,CApBCA,4BAoBqB,EAAE,CApBC,oBAoBoB,CApBC,0CAoB0C,CAdC,iCAciC,CAXC,8BAW8B,CAAC;AACxJ,WAAS;AACX;;;ACtBA,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,WAAS;AACT,aAAW;AACX,cAAY;AACd;AACA,CAACC;AACC,aAAW;AACX,cAAY;AACZ,SAAO;AACT;AACA,CAACC;AACC,oBAAkB;AACpB;","names":["appCard","fileView","fileEdit","fileEditHeader","fileEditContent","quoteList","mdEdit","loadingMessage","conversationListPanel","nsConversations","nsBodyWidth","nsBubbleList","spin","nsChatHeader","nsChatTitle","nsChatHeaderPopover","chatWelcomeWrap","chatWelcome","chatWelcomePrompts","senderListTitle","senderList","historyList","senderListItem","senderListFooter","nsChatUserName","nsSenderReferenceHeaderTitle","nsSenderReferenceHeaderContent","avatarListContainer","avatarList","avatarListItem","avatarListItemIcon","avatarListItemIconActive","avatarListItemName","nsAttachments","nsPreviewHeader","nsPreviewHeaderTitle","nsChatSenderHeader","nsDisclaimerNotice","nsChatLayout"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,64 +1,282 @@
|
|
|
1
|
-
import { RenderControl } from '@zero-library/common';
|
|
1
|
+
import { RenderControl, UserInfo } from '@zero-library/common';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { Conversation } from '@ant-design/x';
|
|
4
4
|
import { ThemeConfig } from 'antd';
|
|
5
5
|
|
|
6
|
-
type FileMode = 'local' | 'remote';
|
|
7
6
|
interface InputFile {
|
|
7
|
+
/**
|
|
8
|
+
* Content,文件内容
|
|
9
|
+
*/
|
|
10
|
+
content: string;
|
|
11
|
+
/**
|
|
12
|
+
* 文件模式 remote_url local_file
|
|
13
|
+
*/
|
|
14
|
+
mode: string;
|
|
15
|
+
/**
|
|
16
|
+
* Type,文件类型
|
|
17
|
+
*/
|
|
8
18
|
type: string;
|
|
9
|
-
|
|
19
|
+
/**
|
|
20
|
+
* 文件扩展名
|
|
21
|
+
*/
|
|
22
|
+
extension: string;
|
|
23
|
+
/**
|
|
24
|
+
* 文件名
|
|
25
|
+
*/
|
|
10
26
|
name: string;
|
|
27
|
+
}
|
|
28
|
+
interface MessageQuoteMsg {
|
|
29
|
+
/**
|
|
30
|
+
* Id,消息ID
|
|
31
|
+
*/
|
|
32
|
+
id?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Msgcontent,消息内容
|
|
35
|
+
*/
|
|
36
|
+
msgContent?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Msgfiles,附件文件列表
|
|
39
|
+
*/
|
|
40
|
+
msgFiles?: InputFile;
|
|
41
|
+
}
|
|
42
|
+
interface MessageSender {
|
|
43
|
+
/**
|
|
44
|
+
* Curruser,是否为当前用户
|
|
45
|
+
*/
|
|
46
|
+
currUser?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Id,发送者ID
|
|
49
|
+
*/
|
|
11
50
|
id: string;
|
|
12
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Type,1-用户 2-专家 3-Agent 4-税协
|
|
53
|
+
*/
|
|
54
|
+
type: number;
|
|
13
55
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
56
|
+
interface ConversationMessage {
|
|
57
|
+
/**
|
|
58
|
+
* Conversationid,会话ID
|
|
59
|
+
*/
|
|
17
60
|
conversationId: string;
|
|
18
|
-
|
|
61
|
+
conversationTitle?: string;
|
|
62
|
+
type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END';
|
|
63
|
+
/**
|
|
64
|
+
* Id,消息ID
|
|
65
|
+
*/
|
|
66
|
+
id: string;
|
|
67
|
+
/**
|
|
68
|
+
* Msgcontent,消息内容
|
|
69
|
+
*/
|
|
70
|
+
msgContent: string;
|
|
71
|
+
/**
|
|
72
|
+
* Msgfeedback,消息反馈
|
|
73
|
+
*/
|
|
74
|
+
msgFeedback?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Msgfiles,附件文件列表
|
|
77
|
+
*/
|
|
78
|
+
msgFiles?: InputFile[];
|
|
79
|
+
/**
|
|
80
|
+
* 引消息
|
|
81
|
+
*/
|
|
82
|
+
quoteMsg?: MessageQuoteMsg;
|
|
83
|
+
/**
|
|
84
|
+
* 发送者信息
|
|
85
|
+
*/
|
|
86
|
+
sender?: MessageSender;
|
|
87
|
+
/**
|
|
88
|
+
* Sendtime,发送时间
|
|
89
|
+
*/
|
|
90
|
+
sendTime: number;
|
|
91
|
+
/**
|
|
92
|
+
* Stopflag,是否打断
|
|
93
|
+
*/
|
|
94
|
+
stopFlag?: boolean;
|
|
19
95
|
}
|
|
20
|
-
interface
|
|
21
|
-
|
|
96
|
+
interface ConversationMessageSend {
|
|
97
|
+
/**
|
|
98
|
+
* Conversationid,会话 ID
|
|
99
|
+
*/
|
|
22
100
|
conversationId: string;
|
|
23
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Msgcontent,消息内容
|
|
103
|
+
*/
|
|
104
|
+
msgContent: string;
|
|
105
|
+
/**
|
|
106
|
+
* Msgfiles,附件文件列表
|
|
107
|
+
*/
|
|
108
|
+
msgFiles?: InputFile[];
|
|
109
|
+
/**
|
|
110
|
+
* Params,业务参数,透传到智能体
|
|
111
|
+
*/
|
|
112
|
+
params?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Quotemsgid,引用的消息 ID,大于 0 的整数
|
|
115
|
+
*/
|
|
116
|
+
quoteMsgId?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Receiverid,接收者 ID。当 receiverType ≠ 3(非 agent)时,后端需填充此字段
|
|
119
|
+
*/
|
|
120
|
+
receiverId: string;
|
|
121
|
+
/**
|
|
122
|
+
* Receivertype,接收者身份,必填:1-用户;2-专家;3-agent 4-税协
|
|
123
|
+
*/
|
|
124
|
+
receiverType: number;
|
|
125
|
+
/**
|
|
126
|
+
* Returntype,返回方式:1-http;2-ws(WebSocket)
|
|
127
|
+
*/
|
|
128
|
+
returnType: number;
|
|
129
|
+
/**
|
|
130
|
+
* Senderid,发送者 ID
|
|
131
|
+
*/
|
|
132
|
+
senderId: string;
|
|
133
|
+
/**
|
|
134
|
+
* Sendertype,发送者身份,必填:1-用户;2-专家;3-agent 4-税协
|
|
135
|
+
*/
|
|
136
|
+
senderType: number;
|
|
137
|
+
/**
|
|
138
|
+
* Source,会话来源: 1-罗拉-APP; 2-罗拉-pc端; 3-合作伙伴端 4-税协 5-罗拉-cube 6-api
|
|
139
|
+
*/
|
|
140
|
+
source: number;
|
|
141
|
+
/**
|
|
142
|
+
* Stream,是否启用流式返回响应结果
|
|
143
|
+
*/
|
|
144
|
+
stream: boolean;
|
|
24
145
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
146
|
+
/**
|
|
147
|
+
* FileUploadConfig,文件上传配置
|
|
148
|
+
*/
|
|
149
|
+
interface FileUploadConfig {
|
|
150
|
+
/**
|
|
151
|
+
* Allowedfiletypes,允许的文件类型
|
|
152
|
+
*/
|
|
153
|
+
allowedFileTypes: string[];
|
|
154
|
+
/**
|
|
155
|
+
* Enabled,是否启用文件上传
|
|
156
|
+
*/
|
|
157
|
+
enabled: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Maxfilecount,最大文件数量
|
|
160
|
+
*/
|
|
161
|
+
maxFileCount: number;
|
|
162
|
+
/**
|
|
163
|
+
* Maxfilesize,最大文件大小
|
|
164
|
+
*/
|
|
165
|
+
maxFileSize?: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* QuestionBO,推荐问题或热门问题项
|
|
169
|
+
*/
|
|
170
|
+
interface RecommendQuestion {
|
|
171
|
+
/**
|
|
172
|
+
* Id,问题 ID
|
|
173
|
+
*/
|
|
174
|
+
id: number;
|
|
175
|
+
/**
|
|
176
|
+
* Question,问题内容
|
|
177
|
+
*/
|
|
178
|
+
question: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* LabelBO,热门问题标签
|
|
182
|
+
*/
|
|
183
|
+
interface HotQuestionList {
|
|
184
|
+
/**
|
|
185
|
+
* Id,标签 ID
|
|
186
|
+
*/
|
|
187
|
+
id: number;
|
|
188
|
+
/**
|
|
189
|
+
* Items,标签下的问题列表
|
|
190
|
+
*/
|
|
191
|
+
items: RecommendQuestion[];
|
|
192
|
+
/**
|
|
193
|
+
* Name,标签名称
|
|
194
|
+
*/
|
|
195
|
+
name: string;
|
|
196
|
+
}
|
|
197
|
+
interface AgentConfig {
|
|
198
|
+
/**
|
|
199
|
+
* 文件上传配置
|
|
200
|
+
*/
|
|
201
|
+
fileUpload?: FileUploadConfig[];
|
|
202
|
+
/**
|
|
203
|
+
* Labels,热门问题标签列表
|
|
204
|
+
*/
|
|
205
|
+
labels?: HotQuestionList[];
|
|
206
|
+
/**
|
|
207
|
+
* Recommendquestions,推荐问题列表
|
|
208
|
+
*/
|
|
209
|
+
recommendQuestions?: RecommendQuestion[];
|
|
210
|
+
}
|
|
211
|
+
interface AgentInfo {
|
|
212
|
+
/**
|
|
213
|
+
* Agentname,名称
|
|
214
|
+
*/
|
|
215
|
+
agentName: string;
|
|
216
|
+
/**
|
|
217
|
+
* Agenttype,智能体类型
|
|
218
|
+
*/
|
|
219
|
+
agentType: number;
|
|
220
|
+
/**
|
|
221
|
+
* 智能体的附带信息
|
|
222
|
+
*/
|
|
223
|
+
config: AgentConfig;
|
|
224
|
+
/**
|
|
225
|
+
* Description,描述
|
|
226
|
+
*/
|
|
227
|
+
description?: string;
|
|
228
|
+
/**
|
|
229
|
+
* Id,主键
|
|
230
|
+
*/
|
|
231
|
+
id: string;
|
|
232
|
+
/**
|
|
233
|
+
* Isavailable,是否可用
|
|
234
|
+
*/
|
|
235
|
+
isAvailable?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Logo,logo
|
|
238
|
+
*/
|
|
239
|
+
logo: string;
|
|
240
|
+
feature?: string;
|
|
33
241
|
}
|
|
34
242
|
|
|
243
|
+
type ConversationStrategy = 1 | 2;
|
|
244
|
+
interface ReferencesContent extends MessageQuoteMsg {
|
|
245
|
+
name?: string;
|
|
246
|
+
markdown?: string;
|
|
247
|
+
[key: string]: any;
|
|
248
|
+
}
|
|
35
249
|
interface ReferencesType {
|
|
36
250
|
type: number;
|
|
37
|
-
content:
|
|
38
|
-
name?: string;
|
|
39
|
-
markdown?: string;
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
};
|
|
251
|
+
content: ReferencesContent;
|
|
42
252
|
params?: ObjectType<any>;
|
|
43
253
|
}
|
|
44
254
|
interface ChatHooks {
|
|
45
255
|
onSenderFocus?: () => void;
|
|
46
256
|
onHeaderClose?: () => void;
|
|
47
|
-
onBeforeSend?: (message:
|
|
257
|
+
onBeforeSend?: (message: ConversationMessageSend['msgContent'], files: InputFile[]) => boolean | Promise<boolean> | void;
|
|
48
258
|
onAfterSend?: () => void;
|
|
49
259
|
onBeforeSwitchAgent?: (agentId: string) => boolean | Promise<boolean> | void;
|
|
50
260
|
onAfterSwitchAgent?: (agentId: string) => void;
|
|
51
|
-
onBeforeSwitchConversation?: (conversationId: string
|
|
52
|
-
onAfterSwitchConversation?: (conversationId: string
|
|
261
|
+
onBeforeSwitchConversation?: (conversationId: string) => boolean | Promise<boolean> | void;
|
|
262
|
+
onAfterSwitchConversation?: (conversationId: string) => void;
|
|
263
|
+
onBeforeInitMessages?: (conversationId: string) => boolean | Promise<boolean> | void;
|
|
264
|
+
onAfterInitMessages?: (messages: ConversationMessage[]) => void;
|
|
265
|
+
onBeforeDelConversation?: (conversationId: string) => boolean | Promise<boolean> | void;
|
|
266
|
+
onAfterDelConversation?: (conversationId: string, isCurrentConversation: boolean) => void;
|
|
53
267
|
}
|
|
54
268
|
interface ChatParams {
|
|
55
|
-
|
|
269
|
+
source?: number;
|
|
270
|
+
businessData?: string;
|
|
271
|
+
businessId?: string;
|
|
272
|
+
businessType?: number;
|
|
56
273
|
params?: ObjectType<any>;
|
|
57
274
|
}
|
|
58
275
|
interface ChatLayoutHeader {
|
|
59
276
|
title?: RenderControl<void, void>;
|
|
60
277
|
closeBtn?: boolean;
|
|
61
278
|
newConversationBtn?: RenderControl<void, void>;
|
|
279
|
+
agentCharacter?: boolean;
|
|
62
280
|
conversationListBtn?: boolean;
|
|
63
281
|
}
|
|
64
282
|
interface ChatLayoutConversationList {
|
|
@@ -85,29 +303,25 @@ interface ChatLayout {
|
|
|
85
303
|
|
|
86
304
|
interface Props {
|
|
87
305
|
theme?: ThemeConfig;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
306
|
+
config?: {
|
|
307
|
+
receiverType?: number;
|
|
308
|
+
receiverId?: string;
|
|
91
309
|
conversationId?: string;
|
|
310
|
+
conversationStrategy?: ConversationStrategy;
|
|
92
311
|
};
|
|
93
312
|
params?: ChatParams;
|
|
94
313
|
hooks?: ChatHooks;
|
|
95
314
|
layout?: ChatLayout;
|
|
315
|
+
userInfo?: UserInfo;
|
|
96
316
|
}
|
|
97
317
|
interface ChatHandle {
|
|
98
|
-
sendMessage: (message?: string, files?: InputFile[]) =>
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
agentKey: string;
|
|
102
|
-
isVerify: boolean;
|
|
103
|
-
}, conversationId?: Conversation['key']) => Promise<void>;
|
|
104
|
-
switchConversation: (conversation?: Conversation) => Promise<void>;
|
|
318
|
+
sendMessage: (message?: string, files?: InputFile[]) => void;
|
|
319
|
+
switchAgentConversation: (agentId: AgentInfo['id'], strategy?: ConversationStrategy) => void;
|
|
320
|
+
switchConversation: (id?: Conversation['id']) => void;
|
|
105
321
|
setReferences: (references?: ReferencesType) => void;
|
|
106
322
|
setMessage: (message?: string) => void;
|
|
107
323
|
setFiles: (files?: InputFile[]) => void;
|
|
108
|
-
setParams: (params: Props['params']) => void;
|
|
109
|
-
setLayout: (layout: Props['layout']) => void;
|
|
110
324
|
}
|
|
111
325
|
declare const _default: react.ForwardRefExoticComponent<Props & react.RefAttributes<ChatHandle>>;
|
|
112
326
|
|
|
113
|
-
export { _default as
|
|
327
|
+
export { _default as ChatCopilot, type ChatHandle, type ChatLayout };
|