@zero-library/chat-agent 2.1.0 → 2.1.2
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/index.cjs.js +46 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +17 -8
- package/dist/index.d.ts +17 -8
- package/dist/index.esm.js +46 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;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,uBA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AS;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"]}
|
|
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 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"],"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,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AAK;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;","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
|
@@ -3,6 +3,8 @@ import * as react from 'react';
|
|
|
3
3
|
import { Conversation } from '@ant-design/x';
|
|
4
4
|
import { ThemeConfig } from 'antd';
|
|
5
5
|
|
|
6
|
+
type ConversationMemberEnum = 'agent' | 'user' | 'other';
|
|
7
|
+
|
|
6
8
|
interface InputFile {
|
|
7
9
|
/**
|
|
8
10
|
* Content,文件内容
|
|
@@ -252,6 +254,8 @@ interface ReferencesType {
|
|
|
252
254
|
params?: ObjectType<any>;
|
|
253
255
|
}
|
|
254
256
|
interface ChatHooks {
|
|
257
|
+
onBeforeInit?: () => void;
|
|
258
|
+
onAfterInit?: () => void;
|
|
255
259
|
onSenderFocus?: () => void;
|
|
256
260
|
onHeaderClose?: () => void;
|
|
257
261
|
onBeforeSend?: (message: ConversationMessageSend['msgContent'], files: InputFile[]) => boolean | Promise<boolean> | void;
|
|
@@ -287,11 +291,15 @@ interface ChatLayoutSender {
|
|
|
287
291
|
extraBtn?: RenderControl<void, void>;
|
|
288
292
|
referencesBtn?: RenderControl<void, void>;
|
|
289
293
|
}
|
|
294
|
+
interface ChatLayoutMessageList {
|
|
295
|
+
avatar?: boolean | Partial<Record<ConversationMemberEnum, boolean>>;
|
|
296
|
+
firstMessage?: RenderControl<void, void>;
|
|
297
|
+
}
|
|
290
298
|
interface ChatLayout {
|
|
291
299
|
leftPanel?: RenderControl<void, void>;
|
|
292
300
|
conversationList?: RenderControl<void, ChatLayoutConversationList>;
|
|
293
301
|
preview?: boolean;
|
|
294
|
-
messageList?:
|
|
302
|
+
messageList?: RenderControl<void, ChatLayoutMessageList>;
|
|
295
303
|
senderHeader?: RenderControl<void, void>;
|
|
296
304
|
sender?: RenderControl<void, ChatLayoutSender>;
|
|
297
305
|
senderPrompts?: boolean;
|
|
@@ -301,14 +309,15 @@ interface ChatLayout {
|
|
|
301
309
|
disclaimerNotice?: RenderControl<void, void>;
|
|
302
310
|
}
|
|
303
311
|
|
|
312
|
+
interface ChatConfig {
|
|
313
|
+
receiverType?: number;
|
|
314
|
+
receiverId?: string;
|
|
315
|
+
conversationId?: string;
|
|
316
|
+
conversationStrategy?: ConversationStrategy;
|
|
317
|
+
}
|
|
304
318
|
interface Props {
|
|
305
319
|
theme?: ThemeConfig;
|
|
306
|
-
config?:
|
|
307
|
-
receiverType?: number;
|
|
308
|
-
receiverId?: string;
|
|
309
|
-
conversationId?: string;
|
|
310
|
-
conversationStrategy?: ConversationStrategy;
|
|
311
|
-
};
|
|
320
|
+
config?: ChatConfig;
|
|
312
321
|
params?: ChatParams;
|
|
313
322
|
hooks?: ChatHooks;
|
|
314
323
|
layout?: ChatLayout;
|
|
@@ -324,4 +333,4 @@ interface ChatHandle {
|
|
|
324
333
|
}
|
|
325
334
|
declare const _default: react.ForwardRefExoticComponent<Props & react.RefAttributes<ChatHandle>>;
|
|
326
335
|
|
|
327
|
-
export { _default as ChatCopilot, type ChatHandle, type ChatLayout };
|
|
336
|
+
export { type ChatConfig, _default as ChatCopilot, type ChatHandle, type ChatLayout };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import * as react from 'react';
|
|
|
3
3
|
import { Conversation } from '@ant-design/x';
|
|
4
4
|
import { ThemeConfig } from 'antd';
|
|
5
5
|
|
|
6
|
+
type ConversationMemberEnum = 'agent' | 'user' | 'other';
|
|
7
|
+
|
|
6
8
|
interface InputFile {
|
|
7
9
|
/**
|
|
8
10
|
* Content,文件内容
|
|
@@ -252,6 +254,8 @@ interface ReferencesType {
|
|
|
252
254
|
params?: ObjectType<any>;
|
|
253
255
|
}
|
|
254
256
|
interface ChatHooks {
|
|
257
|
+
onBeforeInit?: () => void;
|
|
258
|
+
onAfterInit?: () => void;
|
|
255
259
|
onSenderFocus?: () => void;
|
|
256
260
|
onHeaderClose?: () => void;
|
|
257
261
|
onBeforeSend?: (message: ConversationMessageSend['msgContent'], files: InputFile[]) => boolean | Promise<boolean> | void;
|
|
@@ -287,11 +291,15 @@ interface ChatLayoutSender {
|
|
|
287
291
|
extraBtn?: RenderControl<void, void>;
|
|
288
292
|
referencesBtn?: RenderControl<void, void>;
|
|
289
293
|
}
|
|
294
|
+
interface ChatLayoutMessageList {
|
|
295
|
+
avatar?: boolean | Partial<Record<ConversationMemberEnum, boolean>>;
|
|
296
|
+
firstMessage?: RenderControl<void, void>;
|
|
297
|
+
}
|
|
290
298
|
interface ChatLayout {
|
|
291
299
|
leftPanel?: RenderControl<void, void>;
|
|
292
300
|
conversationList?: RenderControl<void, ChatLayoutConversationList>;
|
|
293
301
|
preview?: boolean;
|
|
294
|
-
messageList?:
|
|
302
|
+
messageList?: RenderControl<void, ChatLayoutMessageList>;
|
|
295
303
|
senderHeader?: RenderControl<void, void>;
|
|
296
304
|
sender?: RenderControl<void, ChatLayoutSender>;
|
|
297
305
|
senderPrompts?: boolean;
|
|
@@ -301,14 +309,15 @@ interface ChatLayout {
|
|
|
301
309
|
disclaimerNotice?: RenderControl<void, void>;
|
|
302
310
|
}
|
|
303
311
|
|
|
312
|
+
interface ChatConfig {
|
|
313
|
+
receiverType?: number;
|
|
314
|
+
receiverId?: string;
|
|
315
|
+
conversationId?: string;
|
|
316
|
+
conversationStrategy?: ConversationStrategy;
|
|
317
|
+
}
|
|
304
318
|
interface Props {
|
|
305
319
|
theme?: ThemeConfig;
|
|
306
|
-
config?:
|
|
307
|
-
receiverType?: number;
|
|
308
|
-
receiverId?: string;
|
|
309
|
-
conversationId?: string;
|
|
310
|
-
conversationStrategy?: ConversationStrategy;
|
|
311
|
-
};
|
|
320
|
+
config?: ChatConfig;
|
|
312
321
|
params?: ChatParams;
|
|
313
322
|
hooks?: ChatHooks;
|
|
314
323
|
layout?: ChatLayout;
|
|
@@ -324,4 +333,4 @@ interface ChatHandle {
|
|
|
324
333
|
}
|
|
325
334
|
declare const _default: react.ForwardRefExoticComponent<Props & react.RefAttributes<ChatHandle>>;
|
|
326
335
|
|
|
327
|
-
export { _default as ChatCopilot, type ChatHandle, type ChatLayout };
|
|
336
|
+
export { type ChatConfig, _default as ChatCopilot, type ChatHandle, type ChatLayout };
|
package/dist/index.esm.js
CHANGED
|
@@ -315,7 +315,7 @@ var conversationDelete = (conversationId) => {
|
|
|
315
315
|
return request.delete("/agent/conversation", { conversationId });
|
|
316
316
|
};
|
|
317
317
|
var conversationRecentQuery = (params) => {
|
|
318
|
-
return request.get("/lolr/conversation/recent",
|
|
318
|
+
return request.get("/lolr/conversation/recent", params);
|
|
319
319
|
};
|
|
320
320
|
var conversationMessagesQuery = (params) => {
|
|
321
321
|
return request.get("/lolr/conversation/message", params);
|
|
@@ -354,6 +354,7 @@ var defaultAgentLayout = {
|
|
|
354
354
|
conversationList: true,
|
|
355
355
|
preview: true,
|
|
356
356
|
messageList: true,
|
|
357
|
+
firstMessage: false,
|
|
357
358
|
senderHeader: false,
|
|
358
359
|
sender: true,
|
|
359
360
|
senderPrompts: true,
|
|
@@ -367,12 +368,21 @@ var defaultExpertLayout = {
|
|
|
367
368
|
conversationList: false,
|
|
368
369
|
preview: false,
|
|
369
370
|
messageList: true,
|
|
371
|
+
firstMessage: false,
|
|
370
372
|
senderHeader: false,
|
|
371
373
|
sender: true,
|
|
372
374
|
senderPrompts: false,
|
|
373
375
|
senderFooter: false,
|
|
374
376
|
globalHeader: false,
|
|
375
|
-
chatHeader:
|
|
377
|
+
chatHeader: {
|
|
378
|
+
props: {
|
|
379
|
+
title: true,
|
|
380
|
+
closeBtn: false,
|
|
381
|
+
newConversationBtn: false,
|
|
382
|
+
agentCharacter: false,
|
|
383
|
+
conversationListBtn: false
|
|
384
|
+
}
|
|
385
|
+
},
|
|
376
386
|
disclaimerNotice: false
|
|
377
387
|
};
|
|
378
388
|
function createChatStore() {
|
|
@@ -721,6 +731,7 @@ function createChatStore() {
|
|
|
721
731
|
} finally {
|
|
722
732
|
}
|
|
723
733
|
config.hooks?.onAfterInitMessages?.(conversation.messages[conversationId].message);
|
|
734
|
+
config.hooks?.onAfterInit?.();
|
|
724
735
|
}
|
|
725
736
|
};
|
|
726
737
|
const pickReceiver = () => {
|
|
@@ -1019,7 +1030,7 @@ var MessageAIRender_default = ({ message: message3, placement }) => {
|
|
|
1019
1030
|
}
|
|
1020
1031
|
) });
|
|
1021
1032
|
};
|
|
1022
|
-
var BubbleListItems_default = ({ avatar = { user: false, agent: true, other: true } }) => {
|
|
1033
|
+
var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, agent: true, other: true } }) => {
|
|
1023
1034
|
const chatStore = useChatStore();
|
|
1024
1035
|
const receiverState = useSnapshot(chatStore.receiver);
|
|
1025
1036
|
const conversationState = useSnapshot(chatStore.conversation);
|
|
@@ -1164,8 +1175,22 @@ var BubbleListItems_default = ({ avatar = { user: false, agent: true, other: tru
|
|
|
1164
1175
|
};
|
|
1165
1176
|
});
|
|
1166
1177
|
}, [chatMessage?.message]);
|
|
1178
|
+
const firstMessageRecord = useMemo(() => {
|
|
1179
|
+
const isExist = shouldRender(firstMessage);
|
|
1180
|
+
return isExist ? [
|
|
1181
|
+
{
|
|
1182
|
+
key: "firstMessage",
|
|
1183
|
+
content: /* @__PURE__ */ jsx(RenderWrapper, { control: firstMessage }),
|
|
1184
|
+
placement: "end"
|
|
1185
|
+
// avatar: { style: { visibility: 'hidden' } }
|
|
1186
|
+
}
|
|
1187
|
+
] : [];
|
|
1188
|
+
}, [firstMessage]);
|
|
1167
1189
|
const bubbleListItems = useMemo(() => {
|
|
1168
1190
|
const list = [];
|
|
1191
|
+
if (firstMessageRecord.length > 0) {
|
|
1192
|
+
list.push(...firstMessageRecord);
|
|
1193
|
+
}
|
|
1169
1194
|
if (chatRecords.length > 0) {
|
|
1170
1195
|
list.push(...chatRecords, ...questionList);
|
|
1171
1196
|
}
|
|
@@ -1173,7 +1198,7 @@ var BubbleListItems_default = ({ avatar = { user: false, agent: true, other: tru
|
|
|
1173
1198
|
return list;
|
|
1174
1199
|
}
|
|
1175
1200
|
return [...placeholderNode];
|
|
1176
|
-
}, [chatRecords, questionList, placeholderNode]);
|
|
1201
|
+
}, [chatRecords, questionList, placeholderNode, firstMessageRecord]);
|
|
1177
1202
|
const listRef = useRef(null);
|
|
1178
1203
|
const autoScrollRef = useRef(true);
|
|
1179
1204
|
const handleScroll = (el) => {
|
|
@@ -1796,7 +1821,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
1796
1821
|
return;
|
|
1797
1822
|
}
|
|
1798
1823
|
if (config?.receiverId && config?.receiverType === 3) {
|
|
1799
|
-
chatStore.switchAgentConversation(config.receiverId, config.conversationStrategy);
|
|
1824
|
+
chatStore.switchAgentConversation(String(config.receiverId), config.conversationStrategy);
|
|
1800
1825
|
}
|
|
1801
1826
|
}, [config]);
|
|
1802
1827
|
useEffect(() => {
|
|
@@ -1812,6 +1837,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
1812
1837
|
chatStore.setHooks(hooks);
|
|
1813
1838
|
}, [hooks]);
|
|
1814
1839
|
const receiverState = useSnapshot(chatStore.receiver);
|
|
1840
|
+
useSnapshot(chatStore.conversation);
|
|
1815
1841
|
const configState = useSnapshot(chatStore.config);
|
|
1816
1842
|
useImperativeHandle(
|
|
1817
1843
|
ref,
|
|
@@ -1845,10 +1871,13 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
1845
1871
|
clientHeartbeat: false,
|
|
1846
1872
|
reconnectInterval: 1e4
|
|
1847
1873
|
});
|
|
1874
|
+
useEffect(() => {
|
|
1875
|
+
configState.hooks?.onBeforeInit?.();
|
|
1876
|
+
}, []);
|
|
1848
1877
|
return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: receiverState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames7(styles_module_default4.nsChatLayout, "height-full"), children: [
|
|
1849
1878
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
|
|
1850
1879
|
/* @__PURE__ */ jsxs(Flex, { className: "full-scroll", children: [
|
|
1851
|
-
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.leftPanel
|
|
1880
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.leftPanel }),
|
|
1852
1881
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.conversationList, DefaultComponent: ConversationListPanel_default }),
|
|
1853
1882
|
/* @__PURE__ */ jsxs(Splitter, { className: "flex-1", onResize: setSplitterSizes, children: [
|
|
1854
1883
|
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: hasPreView && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1903,17 +1932,17 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
1903
1932
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
|
|
1904
1933
|
/* @__PURE__ */ jsx(Flex, { vertical: true, className: classNames7("full-scroll"), children: /* @__PURE__ */ jsxs(Flex, { justify: "center", vertical: true, gap: 24, className: classNames7("height-full p-t-8 p-b-8", styles_module_default2.nsBodyWidth), children: [
|
|
1905
1934
|
shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
|
|
1906
|
-
/* @__PURE__ */ jsx(
|
|
1907
|
-
RenderWrapper,
|
|
1908
|
-
{
|
|
1909
|
-
control: configState.layout.senderHeader,
|
|
1910
|
-
DefaultComponent: /* @__PURE__ */ jsxs("div", { className: styles_module_default4.nsChatSenderHeader, children: [
|
|
1911
|
-
"\u6211\u662F ",
|
|
1912
|
-
receiverState.active.name
|
|
1913
|
-
] })
|
|
1914
|
-
}
|
|
1915
|
-
),
|
|
1916
1935
|
/* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 8, children: [
|
|
1936
|
+
/* @__PURE__ */ jsx(
|
|
1937
|
+
RenderWrapper,
|
|
1938
|
+
{
|
|
1939
|
+
control: configState.layout.senderHeader,
|
|
1940
|
+
DefaultComponent: /* @__PURE__ */ jsxs("div", { className: styles_module_default4.nsChatSenderHeader, children: [
|
|
1941
|
+
"\u6211\u662F ",
|
|
1942
|
+
receiverState.active.name
|
|
1943
|
+
] })
|
|
1944
|
+
}
|
|
1945
|
+
),
|
|
1917
1946
|
/* @__PURE__ */ jsx(
|
|
1918
1947
|
RenderWrapper,
|
|
1919
1948
|
{
|
|
@@ -1930,7 +1959,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
1930
1959
|
}
|
|
1931
1960
|
)
|
|
1932
1961
|
] }),
|
|
1933
|
-
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.senderFooter
|
|
1962
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.senderFooter })
|
|
1934
1963
|
] }) })
|
|
1935
1964
|
] }) })
|
|
1936
1965
|
] })
|