@zero-library/chat-agent 2.0.6 → 2.0.7
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 +121 -127
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +21 -14
- package/dist/index.d.ts +21 -14
- package/dist/index.esm.js +123 -129
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/index.css
CHANGED
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.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,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,mBA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CAM0C,CAAC;AAC9E,OAAK;AACP;AACA,CATC,cASc,CATC,oBASoB,CATC,0CAS0C,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","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/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,CA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;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"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -48,31 +48,38 @@ interface ChatHooks {
|
|
|
48
48
|
onAfterSend?: () => void;
|
|
49
49
|
onBeforeSwitchAgent?: (agentId: string) => boolean | Promise<boolean> | void;
|
|
50
50
|
onAfterSwitchAgent?: (agentId: string) => void;
|
|
51
|
-
onBeforeSwitchConversation?: (conversationId: string, isNew
|
|
52
|
-
onAfterSwitchConversation?: (conversationId: string, isNew
|
|
51
|
+
onBeforeSwitchConversation?: (conversationId: string, isNew: boolean) => boolean | Promise<boolean> | void;
|
|
52
|
+
onAfterSwitchConversation?: (conversationId: string, isNew: boolean) => void;
|
|
53
53
|
}
|
|
54
54
|
interface ChatParams {
|
|
55
55
|
bizId?: string;
|
|
56
56
|
params?: ObjectType<any>;
|
|
57
57
|
}
|
|
58
|
+
interface ChatLayoutHeader {
|
|
59
|
+
title: RenderControl<void, void>;
|
|
60
|
+
closeBtn: boolean;
|
|
61
|
+
newConversationBtn: RenderControl<void, void>;
|
|
62
|
+
conversationListBtn: boolean;
|
|
63
|
+
}
|
|
64
|
+
interface ChatLayoutConversationList {
|
|
65
|
+
header: RenderControl<void, void>;
|
|
66
|
+
}
|
|
67
|
+
interface ChatLayoutSender {
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
extraBtn: RenderControl<void, void>;
|
|
70
|
+
referencesBtn: RenderControl<void, void>;
|
|
71
|
+
}
|
|
58
72
|
interface ChatLayout {
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
leftPanel?: RenderControl<void, void>;
|
|
74
|
+
conversationList?: RenderControl<void, ChatLayoutConversationList>;
|
|
61
75
|
preview?: boolean;
|
|
62
76
|
messageList?: boolean;
|
|
63
77
|
senderHeader?: RenderControl<void, void>;
|
|
64
|
-
sender?: RenderControl<void,
|
|
65
|
-
placeholder?: string;
|
|
66
|
-
}>;
|
|
78
|
+
sender?: RenderControl<void, ChatLayoutSender>;
|
|
67
79
|
senderPrompts?: boolean;
|
|
68
80
|
senderFooter?: RenderControl<void, void>;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
header?: RenderControl<void, void>;
|
|
72
|
-
headerTitle?: RenderControl<void, void>;
|
|
73
|
-
headerConversationListBtn?: boolean;
|
|
74
|
-
headerNewConversationBtn?: RenderControl<void, void>;
|
|
75
|
-
headerCloseBtn?: boolean;
|
|
81
|
+
globalHeader?: RenderControl<void, ChatLayoutHeader>;
|
|
82
|
+
chatHeader?: RenderControl<void, ChatLayoutHeader>;
|
|
76
83
|
disclaimerNotice?: RenderControl<void, void>;
|
|
77
84
|
}
|
|
78
85
|
|
package/dist/index.d.ts
CHANGED
|
@@ -48,31 +48,38 @@ interface ChatHooks {
|
|
|
48
48
|
onAfterSend?: () => void;
|
|
49
49
|
onBeforeSwitchAgent?: (agentId: string) => boolean | Promise<boolean> | void;
|
|
50
50
|
onAfterSwitchAgent?: (agentId: string) => void;
|
|
51
|
-
onBeforeSwitchConversation?: (conversationId: string, isNew
|
|
52
|
-
onAfterSwitchConversation?: (conversationId: string, isNew
|
|
51
|
+
onBeforeSwitchConversation?: (conversationId: string, isNew: boolean) => boolean | Promise<boolean> | void;
|
|
52
|
+
onAfterSwitchConversation?: (conversationId: string, isNew: boolean) => void;
|
|
53
53
|
}
|
|
54
54
|
interface ChatParams {
|
|
55
55
|
bizId?: string;
|
|
56
56
|
params?: ObjectType<any>;
|
|
57
57
|
}
|
|
58
|
+
interface ChatLayoutHeader {
|
|
59
|
+
title: RenderControl<void, void>;
|
|
60
|
+
closeBtn: boolean;
|
|
61
|
+
newConversationBtn: RenderControl<void, void>;
|
|
62
|
+
conversationListBtn: boolean;
|
|
63
|
+
}
|
|
64
|
+
interface ChatLayoutConversationList {
|
|
65
|
+
header: RenderControl<void, void>;
|
|
66
|
+
}
|
|
67
|
+
interface ChatLayoutSender {
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
extraBtn: RenderControl<void, void>;
|
|
70
|
+
referencesBtn: RenderControl<void, void>;
|
|
71
|
+
}
|
|
58
72
|
interface ChatLayout {
|
|
59
|
-
|
|
60
|
-
|
|
73
|
+
leftPanel?: RenderControl<void, void>;
|
|
74
|
+
conversationList?: RenderControl<void, ChatLayoutConversationList>;
|
|
61
75
|
preview?: boolean;
|
|
62
76
|
messageList?: boolean;
|
|
63
77
|
senderHeader?: RenderControl<void, void>;
|
|
64
|
-
sender?: RenderControl<void,
|
|
65
|
-
placeholder?: string;
|
|
66
|
-
}>;
|
|
78
|
+
sender?: RenderControl<void, ChatLayoutSender>;
|
|
67
79
|
senderPrompts?: boolean;
|
|
68
80
|
senderFooter?: RenderControl<void, void>;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
header?: RenderControl<void, void>;
|
|
72
|
-
headerTitle?: RenderControl<void, void>;
|
|
73
|
-
headerConversationListBtn?: boolean;
|
|
74
|
-
headerNewConversationBtn?: RenderControl<void, void>;
|
|
75
|
-
headerCloseBtn?: boolean;
|
|
81
|
+
globalHeader?: RenderControl<void, ChatLayoutHeader>;
|
|
82
|
+
chatHeader?: RenderControl<void, ChatLayoutHeader>;
|
|
76
83
|
disclaimerNotice?: RenderControl<void, void>;
|
|
77
84
|
}
|
|
78
85
|
|
package/dist/index.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useRefState, useDebounce, isNumber, useSyncInput, shouldRender, RenderWrapper, downloadFile, FilePreview, MarkdownEditor, createValtioContext, isObject, isNullOrUnDef, isBoolean, UserAvatar, request as request$1, getCurrentUser, deepMerge, RenderMarkdown, OK, getToken, TOKEN_KEY, copyText, FileIcon, isExternal } from '@zero-library/common';
|
|
2
|
-
import { message, Badge, Button, Flex, Spin, Splitter, Tag, Avatar,
|
|
2
|
+
import { message, Badge, Button, Flex, Spin, Splitter, Tag, Avatar, Space, Popover, List, Typography, Empty, Collapse, Drawer } from 'antd';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { forwardRef, useRef, useEffect, useImperativeHandle, useMemo, useState } from 'react';
|
|
6
|
-
import { CloudUploadOutlined, PaperClipOutlined, CloseOutlined, PlusOutlined,
|
|
7
|
-
import { Attachments, Sender, Suggestion, XProvider,
|
|
8
|
-
import
|
|
6
|
+
import { CloudUploadOutlined, PaperClipOutlined, CloseOutlined, PlusOutlined, CommentOutlined, OpenAIOutlined, CopyOutlined, LikeOutlined, DislikeOutlined, EnterOutlined, DeleteOutlined, RedoOutlined, CloseCircleOutlined, PlayCircleOutlined, CaretRightOutlined } from '@ant-design/icons';
|
|
7
|
+
import { Attachments, Sender, Suggestion, XProvider, Welcome, Prompts, Bubble, Conversations } from '@ant-design/x';
|
|
8
|
+
import classNames6 from 'classnames';
|
|
9
9
|
import { useSnapshot, proxy } from 'valtio';
|
|
10
10
|
import InfiniteScroll from 'react-infinite-scroll-component';
|
|
11
11
|
|
|
@@ -470,21 +470,16 @@ var sendChatMessage = (params) => {
|
|
|
470
470
|
|
|
471
471
|
// src/stores/index.ts
|
|
472
472
|
var defaultLayout = {
|
|
473
|
+
leftPanel: false,
|
|
473
474
|
conversationList: true,
|
|
474
|
-
conversationListHeader: true,
|
|
475
475
|
preview: true,
|
|
476
476
|
messageList: true,
|
|
477
477
|
senderHeader: false,
|
|
478
478
|
sender: true,
|
|
479
479
|
senderPrompts: true,
|
|
480
480
|
senderFooter: false,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
header: true,
|
|
484
|
-
headerTitle: true,
|
|
485
|
-
headerConversationListBtn: true,
|
|
486
|
-
headerNewConversationBtn: true,
|
|
487
|
-
headerCloseBtn: false,
|
|
481
|
+
globalHeader: false,
|
|
482
|
+
chatHeader: true,
|
|
488
483
|
disclaimerNotice: true
|
|
489
484
|
};
|
|
490
485
|
function createChatStore() {
|
|
@@ -647,11 +642,12 @@ function createChatStore() {
|
|
|
647
642
|
const canProceed = await config.hooks?.onBeforeSwitchConversation?.(chatKey, isNew);
|
|
648
643
|
if (canProceed === false) return;
|
|
649
644
|
conversation.active = chat?.key ? chat : { key: chatKey };
|
|
645
|
+
setPreview();
|
|
650
646
|
if (!conversation.messages[chatKey]) {
|
|
651
647
|
setInitMessage(chatKey);
|
|
652
648
|
}
|
|
653
649
|
config.hooks?.onAfterSwitchConversation?.(chatKey, isNew);
|
|
654
|
-
if (!
|
|
650
|
+
if (!isNew && conversation.messages[chatKey].message.items.length === 0) {
|
|
655
651
|
getMessages(agent.active.id, chatKey);
|
|
656
652
|
}
|
|
657
653
|
};
|
|
@@ -879,6 +875,7 @@ init_Context();
|
|
|
879
875
|
// src/ui/common/styles.module.less
|
|
880
876
|
var styles_module_default = {
|
|
881
877
|
loadingMessage: "styles_module_loadingMessage",
|
|
878
|
+
conversationListPanel: "styles_module_conversationListPanel",
|
|
882
879
|
nsConversations: "styles_module_nsConversations",
|
|
883
880
|
nsBodyWidth: "styles_module_nsBodyWidth",
|
|
884
881
|
nsBubbleList: "styles_module_nsBubbleList",
|
|
@@ -945,7 +942,8 @@ var ConversationList_default = () => {
|
|
|
945
942
|
}
|
|
946
943
|
) : /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u4F1A\u8BDD\u8BB0\u5F55", image: Empty.PRESENTED_IMAGE_SIMPLE }) }) });
|
|
947
944
|
};
|
|
948
|
-
var AgentHeader_default = () => {
|
|
945
|
+
var AgentHeader_default = ({ title = true, closeBtn = false, newConversationBtn = true, conversationListBtn = true }) => {
|
|
946
|
+
console.log("AgentHeader", title, closeBtn, newConversationBtn, conversationListBtn);
|
|
949
947
|
const chatStore = useChatStore();
|
|
950
948
|
const agentState = useSnapshot(chatStore.agent);
|
|
951
949
|
const configState = useSnapshot(chatStore.config);
|
|
@@ -954,7 +952,7 @@ var AgentHeader_default = () => {
|
|
|
954
952
|
/* @__PURE__ */ jsx(
|
|
955
953
|
RenderWrapper,
|
|
956
954
|
{
|
|
957
|
-
control:
|
|
955
|
+
control: title,
|
|
958
956
|
DefaultComponent: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
959
957
|
/* @__PURE__ */ jsx(Avatar, { size: 22, src: agentState.active.iconUrl, alt: agentState.active.name }),
|
|
960
958
|
/* @__PURE__ */ jsx("div", { className: styles_module_default.nsChatTitle, children: agentState.active.name })
|
|
@@ -967,14 +965,14 @@ var AgentHeader_default = () => {
|
|
|
967
965
|
/* @__PURE__ */ jsx(
|
|
968
966
|
RenderWrapper,
|
|
969
967
|
{
|
|
970
|
-
control:
|
|
968
|
+
control: newConversationBtn,
|
|
971
969
|
DefaultComponent: /* @__PURE__ */ jsx(Button, { type: "text", size: "large", icon: /* @__PURE__ */ jsx(PlusOutlined, {}), onClick: () => chatStore.switchConversation() })
|
|
972
970
|
}
|
|
973
971
|
),
|
|
974
972
|
/* @__PURE__ */ jsx(
|
|
975
973
|
RenderWrapper,
|
|
976
974
|
{
|
|
977
|
-
control:
|
|
975
|
+
control: conversationListBtn,
|
|
978
976
|
DefaultComponent: /* @__PURE__ */ jsx(
|
|
979
977
|
Popover,
|
|
980
978
|
{
|
|
@@ -991,7 +989,7 @@ var AgentHeader_default = () => {
|
|
|
991
989
|
/* @__PURE__ */ jsx(
|
|
992
990
|
RenderWrapper,
|
|
993
991
|
{
|
|
994
|
-
control:
|
|
992
|
+
control: closeBtn,
|
|
995
993
|
DefaultComponent: /* @__PURE__ */ jsx(Button, { type: "text", size: "large", onClick: configState.hooks?.onHeaderClose, icon: /* @__PURE__ */ jsx(CloseOutlined, {}) })
|
|
996
994
|
}
|
|
997
995
|
)
|
|
@@ -1075,7 +1073,7 @@ var MessageAIRender_default = ({ message: message4, placement }) => {
|
|
|
1075
1073
|
Bubble,
|
|
1076
1074
|
{
|
|
1077
1075
|
placement,
|
|
1078
|
-
className:
|
|
1076
|
+
className: classNames6({ [styles_module_default.loadingMessage]: message4.status === "loading" }),
|
|
1079
1077
|
content: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1080
1078
|
thinkContents.length > 0 && /* @__PURE__ */ jsx(
|
|
1081
1079
|
Collapse,
|
|
@@ -1135,7 +1133,7 @@ var BubbleListItems_default = ({ avatar = true }) => {
|
|
|
1135
1133
|
/* @__PURE__ */ jsx(
|
|
1136
1134
|
Welcome,
|
|
1137
1135
|
{
|
|
1138
|
-
className:
|
|
1136
|
+
className: classNames6(styles_module_default.chatWelcome, "p-t-32"),
|
|
1139
1137
|
variant: "borderless",
|
|
1140
1138
|
icon: /* @__PURE__ */ jsx(Avatar, { shape: "square", size: 58, src: agentState.active.iconUrl }),
|
|
1141
1139
|
title: `\u4F60\u597D\uFF0C\u6211\u662F${agentState.active.name || ""}`,
|
|
@@ -1153,7 +1151,7 @@ var BubbleListItems_default = ({ avatar = true }) => {
|
|
|
1153
1151
|
label: "\u{1F914} \u63A8\u8350\u95EE\u9898:",
|
|
1154
1152
|
children: agentState.active.recommendQuestions.map(({ question, id }) => ({
|
|
1155
1153
|
key: id,
|
|
1156
|
-
description: /* @__PURE__ */ jsx("span", { onClick: () => chatStore.sendMessage(question), className:
|
|
1154
|
+
description: /* @__PURE__ */ jsx("span", { onClick: () => chatStore.sendMessage(question), className: classNames6(styles_module_default.chatWelcomePrompts, "text-ellipsis"), children: question })
|
|
1157
1155
|
}))
|
|
1158
1156
|
}
|
|
1159
1157
|
]
|
|
@@ -1252,7 +1250,7 @@ var BubbleListItems_default = ({ avatar = true }) => {
|
|
|
1252
1250
|
{
|
|
1253
1251
|
ref: listRef,
|
|
1254
1252
|
items: bubbleListItems,
|
|
1255
|
-
className:
|
|
1253
|
+
className: classNames6(styles_module_default.nsBubbleList, "height-full", "scroll-fade-in")
|
|
1256
1254
|
},
|
|
1257
1255
|
conversationState.active.key
|
|
1258
1256
|
);
|
|
@@ -1507,11 +1505,10 @@ var ChatSender_default = forwardRef(
|
|
|
1507
1505
|
|
|
1508
1506
|
// src/ui/common/ChatSender.tsx
|
|
1509
1507
|
init_Context();
|
|
1510
|
-
var ChatSender_default2 = () => {
|
|
1508
|
+
var ChatSender_default2 = ({ placeholder, extraBtn = false, referencesBtn = false }) => {
|
|
1511
1509
|
const chatStore = useChatStore();
|
|
1512
1510
|
const agentState = useSnapshot(chatStore.agent);
|
|
1513
1511
|
const conversationState = useSnapshot(chatStore.conversation);
|
|
1514
|
-
const configState = useSnapshot(chatStore.config);
|
|
1515
1512
|
const chatMessage = useMemo(
|
|
1516
1513
|
() => conversationState.messages[conversationState.active.key] || {},
|
|
1517
1514
|
[conversationState.messages[conversationState.active.key]]
|
|
@@ -1526,7 +1523,7 @@ var ChatSender_default2 = () => {
|
|
|
1526
1523
|
return /* @__PURE__ */ jsx(
|
|
1527
1524
|
ChatSender_default,
|
|
1528
1525
|
{
|
|
1529
|
-
placeholder
|
|
1526
|
+
placeholder,
|
|
1530
1527
|
content: chatMessage.content,
|
|
1531
1528
|
fileList: chatMessage.files,
|
|
1532
1529
|
headerOpen: chatMessage.headerOpen,
|
|
@@ -1551,7 +1548,7 @@ var ChatSender_default2 = () => {
|
|
|
1551
1548
|
children: "\u6DF1\u5EA6\u601D\u8003"
|
|
1552
1549
|
}
|
|
1553
1550
|
),
|
|
1554
|
-
/* @__PURE__ */ jsx(RenderWrapper, { control:
|
|
1551
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: extraBtn })
|
|
1555
1552
|
] }),
|
|
1556
1553
|
extraHeader: /* @__PURE__ */ jsx(
|
|
1557
1554
|
Sender.Header,
|
|
@@ -1564,12 +1561,12 @@ var ChatSender_default2 = () => {
|
|
|
1564
1561
|
onOpenChange: () => chatStore.setReferences(),
|
|
1565
1562
|
classNames: {
|
|
1566
1563
|
header: styles_module_default.nsSenderReferenceHeaderTitle,
|
|
1567
|
-
content: shouldRender(
|
|
1564
|
+
content: shouldRender(referencesBtn) ? "" : styles_module_default.nsSenderReferenceHeaderContent
|
|
1568
1565
|
},
|
|
1569
1566
|
children: /* @__PURE__ */ jsx(
|
|
1570
1567
|
RenderWrapper,
|
|
1571
1568
|
{
|
|
1572
|
-
control:
|
|
1569
|
+
control: referencesBtn,
|
|
1573
1570
|
DefaultComponent: /* @__PURE__ */ jsx(Flex, { gap: 8, children: ["\u6DF1\u5EA6\u89E3\u8BFB", "\u6982\u8981\u89E3\u8BFB"].map((con) => /* @__PURE__ */ jsxs(Button, { color: "primary", variant: "filled", onClick: () => referenceHandle(con), children: [
|
|
1574
1571
|
con,
|
|
1575
1572
|
" \u2192"
|
|
@@ -1599,13 +1596,19 @@ var ConversationListHeader_default = () => {
|
|
|
1599
1596
|
type: "primary",
|
|
1600
1597
|
shape: "round",
|
|
1601
1598
|
onClick: () => chatStore.switchConversation(),
|
|
1602
|
-
className:
|
|
1599
|
+
className: classNames6("m-t-16"),
|
|
1603
1600
|
icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
|
|
1604
1601
|
children: "\u65B0\u5EFA\u4F1A\u8BDD"
|
|
1605
1602
|
}
|
|
1606
1603
|
)
|
|
1607
1604
|
] });
|
|
1608
1605
|
};
|
|
1606
|
+
var ConversationListPanel_default = ({ header }) => {
|
|
1607
|
+
return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames6("height-full", styles_module_default.conversationListPanel), children: [
|
|
1608
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
|
|
1609
|
+
/* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(ConversationList_default, {}) })
|
|
1610
|
+
] });
|
|
1611
|
+
};
|
|
1609
1612
|
|
|
1610
1613
|
// src/ui/common/SenderPromptsItems.tsx
|
|
1611
1614
|
init_Context();
|
|
@@ -1632,7 +1635,7 @@ var SenderPromptsItems_default = () => {
|
|
|
1632
1635
|
title: /* @__PURE__ */ jsx(
|
|
1633
1636
|
"div",
|
|
1634
1637
|
{
|
|
1635
|
-
className:
|
|
1638
|
+
className: classNames6(styles_module_default.senderListTitle, "text-ellipsis"),
|
|
1636
1639
|
children: `${agentState.active.name}\u5F00\u59CB\u5173\u6CE8${question.labelName}\u5185\u5BB9\uFF01`
|
|
1637
1640
|
}
|
|
1638
1641
|
),
|
|
@@ -1693,111 +1696,102 @@ var layouts_default = forwardRef(({ theme, params, hooks, layout, defaultAgent }
|
|
|
1693
1696
|
const hasPreView = useMemo(() => {
|
|
1694
1697
|
return shouldRender(configState.layout.preview) && (!!configState.preview.file.fileUrl || !!configState.preview.file.content);
|
|
1695
1698
|
}, [configState.layout.preview, configState.preview.file]);
|
|
1696
|
-
return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: agentState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1699
|
+
return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: agentState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames6(styles_module_default3.nsChatLayout, "height-full"), children: [
|
|
1700
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: AgentHeader_default }),
|
|
1701
|
+
/* @__PURE__ */ jsxs(Flex, { className: "full-scroll", children: [
|
|
1702
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.leftPanel, DefaultComponent: /* @__PURE__ */ jsx(Fragment, {}) }),
|
|
1703
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.conversationList, DefaultComponent: ConversationListPanel_default }),
|
|
1704
|
+
/* @__PURE__ */ jsxs(Splitter, { onResize: setSplitterSizes, children: [
|
|
1705
|
+
hasPreView && /* @__PURE__ */ jsxs(Splitter.Panel, { collapsible: false, resizable: false, children: [
|
|
1706
|
+
configState.preview.file.fileUrl && /* @__PURE__ */ jsxs(Flex, { vertical: true, className: "height-full", children: [
|
|
1707
|
+
/* @__PURE__ */ jsxs(Flex, { justify: "space-between", align: "center", gap: 16, className: styles_module_default3.nsPreviewHeader, children: [
|
|
1708
|
+
/* @__PURE__ */ jsx("div", { className: styles_module_default3.nsPreviewHeaderTitle, children: configState.preview.file.fileName }),
|
|
1709
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "center", align: "center", children: [
|
|
1710
|
+
/* @__PURE__ */ jsx(
|
|
1711
|
+
Button,
|
|
1712
|
+
{
|
|
1713
|
+
color: "primary",
|
|
1714
|
+
variant: "outlined",
|
|
1715
|
+
onClick: () => downloadFile(configState.preview.file.fileUrl, configState.preview.file.fileName),
|
|
1716
|
+
children: "\u4E0B\u8F7D"
|
|
1717
|
+
}
|
|
1718
|
+
),
|
|
1719
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => chatStore.setPreview(), children: "\u5173\u95ED" })
|
|
1720
|
+
] })
|
|
1721
|
+
] }),
|
|
1722
|
+
/* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(
|
|
1723
|
+
FilePreview,
|
|
1720
1724
|
{
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
}
|
|
1726
|
-
),
|
|
1727
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => chatStore.setPreview(), children: "\u5173\u95ED" })
|
|
1728
|
-
] })
|
|
1729
|
-
] }),
|
|
1730
|
-
/* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(
|
|
1731
|
-
FilePreview,
|
|
1732
|
-
{
|
|
1733
|
-
...configState.preview.file,
|
|
1734
|
-
pdfParams: {
|
|
1735
|
-
isHasThumbnails: false
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
) })
|
|
1739
|
-
] }),
|
|
1740
|
-
configState.preview.file.content && /* @__PURE__ */ jsx(
|
|
1741
|
-
MarkdownEditor,
|
|
1742
|
-
{
|
|
1743
|
-
value: configState.preview.file.content,
|
|
1744
|
-
onQuote: (text) => {
|
|
1745
|
-
chatStore.setReferences({
|
|
1746
|
-
type: 1,
|
|
1747
|
-
content: {
|
|
1748
|
-
name: text,
|
|
1749
|
-
markdown: text
|
|
1750
|
-
},
|
|
1751
|
-
params: {
|
|
1752
|
-
outline: text
|
|
1725
|
+
...configState.preview.file,
|
|
1726
|
+
pdfParams: {
|
|
1727
|
+
isHasThumbnails: false
|
|
1728
|
+
}
|
|
1753
1729
|
}
|
|
1754
|
-
})
|
|
1755
|
-
},
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
)
|
|
1759
|
-
] }),
|
|
1760
|
-
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, resizable: false, size: hasPreView ? 400 : void 0, children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames5("height-full"), children: [
|
|
1761
|
-
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.header, DefaultComponent: AgentHeader_default }),
|
|
1762
|
-
/* @__PURE__ */ jsx(Flex, { vertical: true, className: classNames5("full-scroll"), children: /* @__PURE__ */ jsxs(Flex, { justify: "center", vertical: true, gap: 24, className: classNames5("height-full p-t-8 p-b-8", styles_module_default.nsBodyWidth), children: [
|
|
1763
|
-
shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(
|
|
1764
|
-
RenderWrapper,
|
|
1765
|
-
{
|
|
1766
|
-
control: configState.layout.messageList,
|
|
1767
|
-
DefaultComponent: /* @__PURE__ */ jsx(BubbleListItems_default, { avatar: { user: false, assistant: true } })
|
|
1768
|
-
}
|
|
1769
|
-
) }),
|
|
1770
|
-
/* @__PURE__ */ jsx(
|
|
1771
|
-
RenderWrapper,
|
|
1772
|
-
{
|
|
1773
|
-
control: configState.layout.senderHeader,
|
|
1774
|
-
DefaultComponent: /* @__PURE__ */ jsxs("div", { className: styles_module_default3.nsChatSenderHeader, children: [
|
|
1775
|
-
"\u6211\u662F ",
|
|
1776
|
-
agentState.active.name
|
|
1777
|
-
] })
|
|
1778
|
-
}
|
|
1779
|
-
),
|
|
1780
|
-
/* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 8, children: [
|
|
1781
|
-
/* @__PURE__ */ jsx(
|
|
1782
|
-
RenderWrapper,
|
|
1783
|
-
{
|
|
1784
|
-
control: configState.layout.senderPrompts,
|
|
1785
|
-
DefaultComponent: SenderPromptsItems_default
|
|
1786
|
-
}
|
|
1787
|
-
),
|
|
1788
|
-
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.sender, DefaultComponent: ChatSender_default2 }),
|
|
1789
|
-
/* @__PURE__ */ jsx(
|
|
1790
|
-
RenderWrapper,
|
|
1730
|
+
) })
|
|
1731
|
+
] }),
|
|
1732
|
+
configState.preview.file.content && /* @__PURE__ */ jsx(
|
|
1733
|
+
MarkdownEditor,
|
|
1791
1734
|
{
|
|
1792
|
-
|
|
1793
|
-
|
|
1735
|
+
value: configState.preview.file.content,
|
|
1736
|
+
onQuote: (text) => {
|
|
1737
|
+
chatStore.setReferences({
|
|
1738
|
+
type: 1,
|
|
1739
|
+
content: {
|
|
1740
|
+
name: text,
|
|
1741
|
+
markdown: text
|
|
1742
|
+
},
|
|
1743
|
+
params: {
|
|
1744
|
+
outline: text
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
},
|
|
1748
|
+
extraNav: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Tag, { bordered: false, color: "default", className: "cursor-pointer", onClick: () => chatStore.setPreview(), children: /* @__PURE__ */ jsx(CloseOutlined, {}) }) })
|
|
1794
1749
|
}
|
|
1795
1750
|
)
|
|
1796
1751
|
] }),
|
|
1797
|
-
/* @__PURE__ */ jsx(
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1752
|
+
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, resizable: true, size: hasPreView ? 400 : void 0, children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames6("height-full"), children: [
|
|
1753
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: AgentHeader_default }),
|
|
1754
|
+
/* @__PURE__ */ jsx(Flex, { vertical: true, className: classNames6("full-scroll"), children: /* @__PURE__ */ jsxs(Flex, { justify: "center", vertical: true, gap: 24, className: classNames6("height-full p-t-8 p-b-8", styles_module_default.nsBodyWidth), children: [
|
|
1755
|
+
shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(
|
|
1756
|
+
RenderWrapper,
|
|
1757
|
+
{
|
|
1758
|
+
control: configState.layout.messageList,
|
|
1759
|
+
DefaultComponent: /* @__PURE__ */ jsx(BubbleListItems_default, { avatar: { user: false, assistant: true } })
|
|
1760
|
+
}
|
|
1761
|
+
) }),
|
|
1762
|
+
/* @__PURE__ */ jsx(
|
|
1763
|
+
RenderWrapper,
|
|
1764
|
+
{
|
|
1765
|
+
control: configState.layout.senderHeader,
|
|
1766
|
+
DefaultComponent: /* @__PURE__ */ jsxs("div", { className: styles_module_default3.nsChatSenderHeader, children: [
|
|
1767
|
+
"\u6211\u662F ",
|
|
1768
|
+
agentState.active.name
|
|
1769
|
+
] })
|
|
1770
|
+
}
|
|
1771
|
+
),
|
|
1772
|
+
/* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 8, children: [
|
|
1773
|
+
/* @__PURE__ */ jsx(
|
|
1774
|
+
RenderWrapper,
|
|
1775
|
+
{
|
|
1776
|
+
control: configState.layout.senderPrompts,
|
|
1777
|
+
DefaultComponent: SenderPromptsItems_default
|
|
1778
|
+
}
|
|
1779
|
+
),
|
|
1780
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.sender, DefaultComponent: ChatSender_default2 }),
|
|
1781
|
+
/* @__PURE__ */ jsx(
|
|
1782
|
+
RenderWrapper,
|
|
1783
|
+
{
|
|
1784
|
+
control: configState.layout.disclaimerNotice,
|
|
1785
|
+
DefaultComponent: /* @__PURE__ */ jsx("div", { className: styles_module_default3.nsDisclaimerNotice, children: "\u5185\u5BB9\u7531AI\u751F\u6210\uFF0C\u4EC5\u4F9B\u53C2\u8003\uFF0C\u8BF7\u4ED4\u7EC6\u7504\u522B" })
|
|
1786
|
+
}
|
|
1787
|
+
)
|
|
1788
|
+
] }),
|
|
1789
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.senderFooter, DefaultComponent: /* @__PURE__ */ jsx(Fragment, {}) })
|
|
1790
|
+
] }) })
|
|
1791
|
+
] }) })
|
|
1792
|
+
] })
|
|
1793
|
+
] })
|
|
1794
|
+
] }) }) }) });
|
|
1801
1795
|
});
|
|
1802
1796
|
|
|
1803
1797
|
export { layouts_default as AgentChat };
|