@zero-library/chat-agent 2.2.1 → 2.2.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.css CHANGED
@@ -67,17 +67,33 @@
67
67
  }
68
68
 
69
69
  /* src/components/styles.module.less */
70
+ @keyframes styles_module_loading-line {
71
+ from {
72
+ background-position: 200% 0;
73
+ }
74
+ to {
75
+ background-position: 0 0;
76
+ }
77
+ }
70
78
  .styles_module_loadingMessage {
71
- background-image:
79
+ position: relative;
80
+ padding-bottom: 6px;
81
+ }
82
+ .styles_module_loadingMessage::after {
83
+ content: "";
84
+ position: absolute;
85
+ left: 0;
86
+ bottom: 0;
87
+ height: 2px;
88
+ width: 100%;
89
+ background:
72
90
  linear-gradient(
73
91
  90deg,
74
- #ff6b23 0%,
75
- #af3cb8 31%,
76
- #53b6ff 89%);
77
- background-size: 100% 2px;
78
- background-repeat: no-repeat;
79
- background-position: bottom;
80
- padding-bottom: 2px;
92
+ #ff6b23,
93
+ #af3cb8,
94
+ #53b6ff);
95
+ background-size: 200% 100%;
96
+ animation: styles_module_loading-line 1.2s linear infinite;
81
97
  }
82
98
  @keyframes styles_module_spin {
83
99
  to {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ui/common/markdownAlert/styles.module.less","../src/components/styles.module.less","../src/ui/common/styles.module.less","../src/ui/layouts/styles.module.less"],"sourcesContent":[".appCard {\n width: 180px;\n border-radius: 10px;\n border: 1px solid #d7d7d7;\n background-color: #fafafa;\n font-size: 16px;\n cursor: pointer;\n margin: 8px;\n padding: 12px 8px;\n}\n.appCard > div {\n max-width: 100%;\n}\n.appCard > img {\n height: 30px;\n}\n.fileView {\n width: 200px;\n padding: 4px 8px;\n cursor: pointer;\n background-color: #f5f3f3;\n border-radius: 6px;\n}\n.fileEdit {\n margin: 12px 0;\n border-radius: 6px;\n border: 1px solid #f2f2f2;\n}\n.fileEdit .fileEditHeader {\n padding: 2px 8px;\n background-color: #f2f2f2;\n}\n.fileEdit .fileEditContent {\n padding: 8px;\n background-color: #fafafa;\n}\n.quoteList {\n min-width: 300px;\n}\n.quoteList:global.ant-collapse .ant-collapse-item .ant-collapse-header {\n padding: 12px 0;\n color: #8f91a8;\n}\n.quoteList:global.ant-collapse .ant-collapse-item .ant-collapse-content {\n color: #8f91a8;\n background-color: #f2f2f2;\n}\n.mdEdit {\n margin: 10px 0;\n background-color: rgba(242, 242, 242, 0.2);\n border: 1px solid #f2f2f2;\n padding: 10px;\n border-radius: 4px;\n}\n.think:global.ant-collapse {\n margin-bottom: 16px;\n}\n.think:global.ant-collapse .ant-collapse-header {\n color: #8f91a8;\n}\n.think:global.ant-collapse .ant-collapse-content {\n color: #8f91a8;\n}\n.think:global.ant-collapse .ant-collapse-content .ant-collapse-content-box {\n padding: 0 10px 0 24px;\n}\n",".loadingMessage {\n background-image: linear-gradient(90deg, #ff6b23 0%, #af3cb8 31%, #53b6ff 89%);\n background-size: 100% 2px;\n background-repeat: no-repeat;\n background-position: bottom;\n padding-bottom: 2px;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-text {\n display: none;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-circle {\n animation: spin 2s linear infinite;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content {\n gap: 4px;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc {\n width: 15px;\n height: 15px;\n border: 2px solid transparent;\n border-color: #1890ff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n box-sizing: border-box;\n position: relative;\n clip-path: inset(0 0 30% 0);\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc .ant-attachment-list-card-ellipsis-prefix {\n display: none;\n}\n.chatSender:global.ant-sender:focus-within {\n box-shadow: none;\n}\n.chatQuoteMsg {\n margin-top: 4px;\n}\n.chatQuoteMsg:global.ant-bubble > .ant-bubble-content {\n min-height: auto;\n background-color: var(--ant-color-fill-tertiary) !important;\n color: var(--ant-color-text-tertiary);\n}\n",".nsConversationListPanel {\n width: 360px;\n}\n.nsConversations {\n padding: 0 24px;\n}\n.nsConversations :global .ant-conversations-group-title {\n padding: 0;\n}\n.nsConversations :global .ant-conversations-group-title .ant-typography {\n color: #878aab;\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item {\n padding-left: 16px;\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item .ant-conversations-label {\n color: rgba(0, 0, 0, 0.88);\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item.ant-conversations-item-active .ant-conversations-label {\n color: var(--ant-color-primary);\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble.ant-bubble-start .ant-bubble-content-filled {\n background-color: transparent;\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble.ant-bubble-end .ant-bubble-content-filled {\n background-color: var(--ant-color-primary-bg);\n}\n.nsChatHeader {\n padding: 8px 16px;\n border-bottom: 1px solid #eee;\n}\n.nsChatHeader .nsChatTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsChatHeader .nsChatHeaderPopover {\n max-height: 500px;\n width: 300px;\n display: flex;\n flex-direction: column;\n}\n.nsChatHeader .nsChatHeaderPopover :global .ant-popover-inner-content {\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.chatWelcomeWrap :global .ant-prompts .ant-prompts-list {\n overflow: auto;\n}\n.chatWelcomeWrap .chatWelcome :global .ant-welcome-icon > img {\n border-radius: 10px;\n max-width: initial;\n}\n.chatWelcomeWrap .chatWelcomePrompts {\n width: 300px;\n}\n.nsSenderListTitle {\n width: 300px;\n}\n.nsSenderList :global .ant-list-items {\n max-height: 350px;\n overflow-y: auto;\n margin-right: -12px;\n padding-right: 12px;\n}\n.nsSenderList.historyList :global .ant-list-items {\n max-height: initial;\n}\n.nsSenderList .nsSenderListItem {\n background-color: #f6f6f6;\n color: #6b6b6b !important;\n border-radius: 5px;\n width: 300px;\n padding: 6px 12px !important;\n margin-top: 12px;\n font-size: 14px;\n cursor: pointer;\n}\n.nsSenderList .nsSenderListFooter {\n font-size: 12px;\n}\n.nsChatUserName {\n font-size: 16px;\n font-weight: bold;\n}\n.nsSenderReferenceHeaderTitle:global > .ant-sender-header-title {\n overflow: hidden;\n}\n.nsSenderReferenceHeaderContent {\n padding: 0 !important;\n}\n.nsAvatarListContainer {\n height: 300px;\n padding: 30px 48px 30px 24px;\n overflow-y: auto;\n margin-right: -24px;\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem:hover {\n opacity: 90%;\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem .nsAvatarListItemIcon.nsAvatarListItemIconActive {\n outline: 2px solid var(--ant-color-primary);\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem .nsAvatarListItemName {\n font-size: 12px;\n}\n",".nsPreviewHeader {\n padding: 16px 24px;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\n}\n.nsPreviewHeader .nsPreviewHeaderTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsChatSenderHeader {\n margin-bottom: 16px;\n padding: 24px;\n font-size: 24px;\n text-align: center;\n}\n.nsDisclaimerNotice {\n font-size: 12px;\n text-align: center;\n color: #bfbfbf;\n}\n.nsChatLayout {\n background-color: #fff;\n}\n.nsChatLayout .nsChatBody {\n padding: 8px 0;\n}\n.nsBodyWidth {\n margin: 0 auto;\n max-width: 896px;\n min-width: 320px;\n width: calc(100% - 24px);\n}\n"],"mappings":";AAAA,CAACA;AACC,SAAO;AACP,iBAAe;AACf,UAAQ,IAAI,MAAM;AAClB,oBAAkB;AAClB,aAAW;AACX,UAAQ;AACR,UAAQ;AACR,WAAS,KAAK;AAChB;AACA,CAVCA,sBAU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;AAC3E,WAAS,IAAI,MAAM,IAAI;AACzB;AACA,CAZCJ,oCAYsB,CANCC,2BAMa,CANCC,+BAMiB,CAACG;AACtD,aAAW;AACb;;;ACzGA,CAACC;AACC,WAAS,KAAK;AACd,cAAY,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACtC;AACA,CAJCA,8BAIgB,CAACC;AAChB,aAAW;AACX,eAAa;AACf;AACA,CAACC;AACC,iBAAe;AACf,WAAS;AACT,aAAW;AACX,cAAY;AACd;AACA,CAACC;AACC,aAAW;AACX,cAAY;AACZ,SAAO;AACT;AACA,CAACC;AACC,oBAAkB;AACpB;AACA,CAHCA,2BAGa,CAACC;AACb,WAAS,IAAI;AACf;AACA,CAACC;AACC,UAAQ,EAAE;AACV,aAAW;AACX,aAAW;AACX,SAAO,KAAK,KAAK,EAAE;AACrB;","names":["appCard","fileView","fileEdit","fileEditHeader","fileEditContent","quoteList","mdEdit","think","loadingMessage","spin","chatAttachments","chatSender","chatQuoteMsg","nsConversationListPanel","nsConversations","nsBubbleList","nsChatHeader","nsChatTitle","nsChatHeaderPopover","chatWelcomeWrap","chatWelcome","chatWelcomePrompts","nsSenderListTitle","nsSenderList","historyList","nsSenderListItem","nsSenderListFooter","nsChatUserName","nsSenderReferenceHeaderTitle","nsSenderReferenceHeaderContent","nsAvatarListContainer","nsAvatarList","nsAvatarListItem","nsAvatarListItemIcon","nsAvatarListItemIconActive","nsAvatarListItemName","nsPreviewHeader","nsPreviewHeaderTitle","nsChatSenderHeader","nsDisclaimerNotice","nsChatLayout","nsChatBody","nsBodyWidth"]}
1
+ {"version":3,"sources":["../src/ui/common/markdownAlert/styles.module.less","../src/components/styles.module.less","../src/ui/common/styles.module.less","../src/ui/layouts/styles.module.less"],"sourcesContent":[".appCard {\n width: 180px;\n border-radius: 10px;\n border: 1px solid #d7d7d7;\n background-color: #fafafa;\n font-size: 16px;\n cursor: pointer;\n margin: 8px;\n padding: 12px 8px;\n}\n.appCard > div {\n max-width: 100%;\n}\n.appCard > img {\n height: 30px;\n}\n.fileView {\n width: 200px;\n padding: 4px 8px;\n cursor: pointer;\n background-color: #f5f3f3;\n border-radius: 6px;\n}\n.fileEdit {\n margin: 12px 0;\n border-radius: 6px;\n border: 1px solid #f2f2f2;\n}\n.fileEdit .fileEditHeader {\n padding: 2px 8px;\n background-color: #f2f2f2;\n}\n.fileEdit .fileEditContent {\n padding: 8px;\n background-color: #fafafa;\n}\n.quoteList {\n min-width: 300px;\n}\n.quoteList:global.ant-collapse .ant-collapse-item .ant-collapse-header {\n padding: 12px 0;\n color: #8f91a8;\n}\n.quoteList:global.ant-collapse .ant-collapse-item .ant-collapse-content {\n color: #8f91a8;\n background-color: #f2f2f2;\n}\n.mdEdit {\n margin: 10px 0;\n background-color: rgba(242, 242, 242, 0.2);\n border: 1px solid #f2f2f2;\n padding: 10px;\n border-radius: 4px;\n}\n.think:global.ant-collapse {\n margin-bottom: 16px;\n}\n.think:global.ant-collapse .ant-collapse-header {\n color: #8f91a8;\n}\n.think:global.ant-collapse .ant-collapse-content {\n color: #8f91a8;\n}\n.think:global.ant-collapse .ant-collapse-content .ant-collapse-content-box {\n padding: 0 10px 0 24px;\n}\n","@keyframes loading-line {\n from {\n background-position: 200% 0;\n }\n to {\n background-position: 0 0;\n }\n}\n.loadingMessage {\n position: relative;\n padding-bottom: 6px;\n}\n.loadingMessage::after {\n content: '';\n position: absolute;\n left: 0;\n bottom: 0;\n height: 2px;\n width: 100%;\n background: linear-gradient(90deg, #ff6b23, #af3cb8, #53b6ff);\n background-size: 200% 100%;\n animation: loading-line 1.2s linear infinite;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-text {\n display: none;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-progress .ant-progress-circle {\n animation: spin 2s linear infinite;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content {\n gap: 4px;\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc {\n width: 15px;\n height: 15px;\n border: 2px solid transparent;\n border-color: #1890ff;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n box-sizing: border-box;\n position: relative;\n clip-path: inset(0 0 30% 0);\n}\n.chatAttachments:global > .ant-attachment-list .ant-attachment-list-card-status-uploading .ant-attachment-list-card-content .ant-attachment-list-card-desc .ant-attachment-list-card-ellipsis-prefix {\n display: none;\n}\n.chatSender:global.ant-sender:focus-within {\n box-shadow: none;\n}\n.chatQuoteMsg {\n margin-top: 4px;\n}\n.chatQuoteMsg:global.ant-bubble > .ant-bubble-content {\n min-height: auto;\n background-color: var(--ant-color-fill-tertiary) !important;\n color: var(--ant-color-text-tertiary);\n}\n",".nsConversationListPanel {\n width: 360px;\n}\n.nsConversations {\n padding: 0 24px;\n}\n.nsConversations :global .ant-conversations-group-title {\n padding: 0;\n}\n.nsConversations :global .ant-conversations-group-title .ant-typography {\n color: #878aab;\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item {\n padding-left: 16px;\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item .ant-conversations-label {\n color: rgba(0, 0, 0, 0.88);\n}\n.nsConversations :global .ant-conversations-list .ant-conversations-item.ant-conversations-item-active .ant-conversations-label {\n color: var(--ant-color-primary);\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble.ant-bubble-start .ant-bubble-content-filled {\n background-color: transparent;\n}\n.nsBubbleList:global.ant-bubble-list .ant-bubble.ant-bubble-end .ant-bubble-content-filled {\n background-color: var(--ant-color-primary-bg);\n}\n.nsChatHeader {\n padding: 8px 16px;\n border-bottom: 1px solid #eee;\n}\n.nsChatHeader .nsChatTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsChatHeader .nsChatHeaderPopover {\n max-height: 500px;\n width: 300px;\n display: flex;\n flex-direction: column;\n}\n.nsChatHeader .nsChatHeaderPopover :global .ant-popover-inner-content {\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n.chatWelcomeWrap :global .ant-prompts .ant-prompts-list {\n overflow: auto;\n}\n.chatWelcomeWrap .chatWelcome :global .ant-welcome-icon > img {\n border-radius: 10px;\n max-width: initial;\n}\n.chatWelcomeWrap .chatWelcomePrompts {\n width: 300px;\n}\n.nsSenderListTitle {\n width: 300px;\n}\n.nsSenderList :global .ant-list-items {\n max-height: 350px;\n overflow-y: auto;\n margin-right: -12px;\n padding-right: 12px;\n}\n.nsSenderList.historyList :global .ant-list-items {\n max-height: initial;\n}\n.nsSenderList .nsSenderListItem {\n background-color: #f6f6f6;\n color: #6b6b6b !important;\n border-radius: 5px;\n width: 300px;\n padding: 6px 12px !important;\n margin-top: 12px;\n font-size: 14px;\n cursor: pointer;\n}\n.nsSenderList .nsSenderListFooter {\n font-size: 12px;\n}\n.nsChatUserName {\n font-size: 16px;\n font-weight: bold;\n}\n.nsSenderReferenceHeaderTitle:global > .ant-sender-header-title {\n overflow: hidden;\n}\n.nsSenderReferenceHeaderContent {\n padding: 0 !important;\n}\n.nsAvatarListContainer {\n height: 300px;\n padding: 30px 48px 30px 24px;\n overflow-y: auto;\n margin-right: -24px;\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem:hover {\n opacity: 90%;\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem .nsAvatarListItemIcon.nsAvatarListItemIconActive {\n outline: 2px solid var(--ant-color-primary);\n}\n.nsAvatarListContainer .nsAvatarList .nsAvatarListItem .nsAvatarListItemName {\n font-size: 12px;\n}\n",".nsPreviewHeader {\n padding: 16px 24px;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\n}\n.nsPreviewHeader .nsPreviewHeaderTitle {\n font-size: 16px;\n font-weight: bold;\n}\n.nsChatSenderHeader {\n margin-bottom: 16px;\n padding: 24px;\n font-size: 24px;\n text-align: center;\n}\n.nsDisclaimerNotice {\n font-size: 12px;\n text-align: center;\n color: #bfbfbf;\n}\n.nsChatLayout {\n background-color: #fff;\n}\n.nsChatLayout .nsChatBody {\n padding: 8px 0;\n}\n.nsBodyWidth {\n margin: 0 auto;\n max-width: 896px;\n min-width: 320px;\n width: calc(100% - 24px);\n}\n"],"mappings":";AAAA,CAACA;AACC,SAAO;AACP,iBAAe;AACf,UAAQ,IAAI,MAAM;AAClB,oBAAkB;AAClB,aAAW;AACX,UAAQ;AACR,UAAQ;AACR,WAAS,KAAK;AAChB;AACA,CAVCA,sBAUQ,EAAE;AACT,aAAW;AACb;AACA,CAbCA,sBAaQ,EAAE;AACT,UAAQ;AACV;AACA,CAACC;AACC,SAAO;AACP,WAAS,IAAI;AACb,UAAQ;AACR,oBAAkB;AAClB,iBAAe;AACjB;AACA,CAACC;AACC,UAAQ,KAAK;AACb,iBAAe;AACf,UAAQ,IAAI,MAAM;AACpB;AACA,CALCA,uBAKS,CAACC;AACT,WAAS,IAAI;AACb,oBAAkB;AACpB;AACA,CATCD,uBASS,CAACE;AACT,WAAS;AACT,oBAAkB;AACpB;AACA,CAACC;AACC,aAAW;AACb;AACA,CAHCA,uBAGgB,CAAC,aAAa,CAAC,kBAAkB,CAAC;AACjD,WAAS,KAAK;AACd,SAAO;AACT;AACA,CAPCA,uBAOgB,CAJC,aAIa,CAJC,kBAIkB,CAAC;AACjD,SAAO;AACP,oBAAkB;AACpB;AACA,CAACC;AACC,UAAQ,KAAK;AACb,oBAAkB,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;AACtC,UAAQ,IAAI,MAAM;AAClB,WAAS;AACT,iBAAe;AACjB;AACA,CAACC,mBAAY,CAfK;AAgBhB,iBAAe;AACjB;AACA,CAHCA,mBAGY,CAlBK,aAkBS,CAlBwB;AAmBjD,SAAO;AACT;AACA,CANCA,mBAMY,CArBK,aAqBS,CAjBwB;AAkBjD,SAAO;AACT;AACA,CATCA,mBASY,CAxBK,aAw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oB,CANX;AAOrB,cAAY;AACd;AACA,CATCD,2BASa,CAACE;AACb,oBAAkB;AAClB,SAAO;AACP,iBAAe;AACf,SAAO;AACP,WAAS,IAAI;AACb,cAAY;AACZ,aAAW;AACX,UAAQ;AACV;AACA,CAnBCF,2BAmBa,CAACG;AACb,aAAW;AACb;AACA,CAACC;AACC,aAAW;AACX,eAAa;AACf;AACA,CAACC,2CAAoC,EAAE,CAAC;AACtC,YAAU;AACZ;AACA,CAACC;AACC,WAAS;AACX;AACA,CAACC;AACC,UAAQ;AACR,WAAS,KAAK,KAAK,KAAK;AACxB,cAAY;AACZ,gBAAc;AAChB;AACA,CANCA,oCAMsB,CAACC,2BAAa,CAACC,8BAAgB;AACpD,WAAS;AACX;AACA,CATCF,oCASsB,CAHCC,2BAGa,CAHCC,+BAGiB,CAACC,kCAAoB,CAACC;AAC3E,WAAS,IAAI,MAAM,IAAI;AACzB;AACA,CAZCJ,oCAYsB,CANCC,2BAMa,CANCC,+BAMiB,CAACG;AACtD,aAAW;AACb;;;ACzGA,CAACC;AACC,WAAS,KAAK;AACd,cAAY,EAAE,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACtC;AACA,CAJCA,8BAIgB,CAACC;AAChB,aAAW;AACX,eAAa;AACf;AACA,CAACC;AACC,iBAAe;AACf,WAAS;AACT,aAAW;AACX,cAAY;AACd;AACA,CAACC;AACC,aAAW;AACX,cAAY;AACZ,SAAO;AACT;AACA,CAACC;AACC,oBAAkB;AACpB;AACA,CAHCA,2BAGa,CAACC;AACb,WAAS,IAAI;AACf;AACA,CAACC;AACC,UAAQ,EAAE;AACV,aAAW;AACX,aAAW;AACX,SAAO,KAAK,KAAK,EAAE;AACrB;","names":["appCard","fileView","fileEdit","fileEditHeader","fileEditContent","quoteList","mdEdit","think","loading-line","loadingMessage","spin","chatAttachments","chatSender","chatQuoteMsg","nsConversationListPanel","nsConversations","nsBubbleList","nsChatHeader","nsChatTitle","nsChatHeaderPopover","chatWelcomeWrap","chatWelcome","chatWelcomePrompts","nsSenderListTitle","nsSenderList","historyList","nsSenderListItem","nsSenderListFooter","nsChatUserName","nsSenderReferenceHeaderTitle","nsSenderReferenceHeaderContent","nsAvatarListContainer","nsAvatarList","nsAvatarListItem","nsAvatarListItemIcon","nsAvatarListItemIconActive","nsAvatarListItemName","nsPreviewHeader","nsPreviewHeaderTitle","nsChatSenderHeader","nsDisclaimerNotice","nsChatLayout","nsChatBody","nsBodyWidth"]}
package/dist/index.d.mts CHANGED
@@ -232,7 +232,7 @@ interface ConversationMessage {
232
232
  /** 会话标题(WebSocket返回时可能包含) */
233
233
  conversationTitle?: string;
234
234
  /** 消息类型:WebSocket流式消息类型 */
235
- type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END' | 'RUN_ERROR';
235
+ type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END' | 'RUN_ERROR' | 'TEXT_MESSAGE_CITATION';
236
236
  /** 消息ID */
237
237
  id: string;
238
238
  /** 消息内容 */
@@ -243,12 +243,18 @@ interface ConversationMessage {
243
243
  msgFiles?: InputFile[];
244
244
  /** 引用的消息信息 */
245
245
  quoteMsg?: MessageQuoteMsg;
246
+ /** 透传参数 json字符串 */
247
+ params?: string;
248
+ /** 大模型引用到的数据列表 json字符串*/
249
+ citations?: string;
246
250
  /** 发送者信息 */
247
251
  sender?: MessageSender;
248
252
  /** 发送时间戳 */
249
253
  sendTime: number;
250
254
  /** 是否被打断标志 */
251
255
  stopFlag?: boolean;
256
+ /** 临时Content数据 用于存储step和error信息 */
257
+ tempContent?: string;
252
258
  }
253
259
  /**
254
260
  * 消息反馈更新接口
@@ -856,6 +862,33 @@ interface ChatHooks {
856
862
  * }
857
863
  */
858
864
  onRedirectLogin?: () => void;
865
+ /**
866
+ * 应用权限验证回调函数
867
+ * 在访问特定应用前调用,用于验证用户是否有权限使用指定的应用功能
868
+ *
869
+ * @param appKey - 应用标识, 特殊场景下会存在与聊天内部,比如AppCard卡片
870
+ * @returns boolean | Promise<boolean> | void - 返回验证结果或无返回
871
+ *
872
+ * @example
873
+ * // 简单的权限验证
874
+ * onAppRightVerify: (appKey) => {
875
+ * const userRights = getUserRights()
876
+ * return userRights.includes(appKey)
877
+ * }
878
+ *
879
+ * @example
880
+ * // 异步权限验证
881
+ * onAppRightVerify: async (appKey) => {
882
+ * try {
883
+ * const result = await checkUserRights(appKey)
884
+ * return result.hasRight
885
+ * } catch (error) {
886
+ * console.error('权限验证失败:', error)
887
+ * return false
888
+ * }
889
+ * }
890
+ */
891
+ onAppRightVerify?: (appKey: string) => boolean | Promise<boolean> | void;
859
892
  }
860
893
  /**
861
894
  * 聊天参数接口
package/dist/index.d.ts CHANGED
@@ -232,7 +232,7 @@ interface ConversationMessage {
232
232
  /** 会话标题(WebSocket返回时可能包含) */
233
233
  conversationTitle?: string;
234
234
  /** 消息类型:WebSocket流式消息类型 */
235
- type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END' | 'RUN_ERROR';
235
+ type?: 'TEXT_MESSAGE_START' | 'STEP_STARTED' | 'TEXT_MESSAGE_CONTENT' | 'TEXT_MESSAGE_END' | 'RUN_ERROR' | 'TEXT_MESSAGE_CITATION';
236
236
  /** 消息ID */
237
237
  id: string;
238
238
  /** 消息内容 */
@@ -243,12 +243,18 @@ interface ConversationMessage {
243
243
  msgFiles?: InputFile[];
244
244
  /** 引用的消息信息 */
245
245
  quoteMsg?: MessageQuoteMsg;
246
+ /** 透传参数 json字符串 */
247
+ params?: string;
248
+ /** 大模型引用到的数据列表 json字符串*/
249
+ citations?: string;
246
250
  /** 发送者信息 */
247
251
  sender?: MessageSender;
248
252
  /** 发送时间戳 */
249
253
  sendTime: number;
250
254
  /** 是否被打断标志 */
251
255
  stopFlag?: boolean;
256
+ /** 临时Content数据 用于存储step和error信息 */
257
+ tempContent?: string;
252
258
  }
253
259
  /**
254
260
  * 消息反馈更新接口
@@ -856,6 +862,33 @@ interface ChatHooks {
856
862
  * }
857
863
  */
858
864
  onRedirectLogin?: () => void;
865
+ /**
866
+ * 应用权限验证回调函数
867
+ * 在访问特定应用前调用,用于验证用户是否有权限使用指定的应用功能
868
+ *
869
+ * @param appKey - 应用标识, 特殊场景下会存在与聊天内部,比如AppCard卡片
870
+ * @returns boolean | Promise<boolean> | void - 返回验证结果或无返回
871
+ *
872
+ * @example
873
+ * // 简单的权限验证
874
+ * onAppRightVerify: (appKey) => {
875
+ * const userRights = getUserRights()
876
+ * return userRights.includes(appKey)
877
+ * }
878
+ *
879
+ * @example
880
+ * // 异步权限验证
881
+ * onAppRightVerify: async (appKey) => {
882
+ * try {
883
+ * const result = await checkUserRights(appKey)
884
+ * return result.hasRight
885
+ * } catch (error) {
886
+ * console.error('权限验证失败:', error)
887
+ * return false
888
+ * }
889
+ * }
890
+ */
891
+ onAppRightVerify?: (appKey: string) => boolean | Promise<boolean> | void;
859
892
  }
860
893
  /**
861
894
  * 聊天参数接口
package/dist/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import { App, Badge, Button, Flex, Typography, Spin, Splitter, Tag, Popover, Lis
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { forwardRef, useRef, useEffect, useImperativeHandle, useMemo, useState } from 'react';
5
5
  import { useSnapshot, proxy } from 'valtio';
6
- import { CloudUploadOutlined, PaperClipOutlined, EnterOutlined, UserSwitchOutlined, CloseOutlined, PlusOutlined, CommentOutlined, OpenAIOutlined, CopyOutlined, LikeOutlined, DislikeOutlined, DeleteOutlined, RedoOutlined, PlayCircleOutlined, CaretRightOutlined } from '@ant-design/icons';
6
+ import { CloudUploadOutlined, PaperClipOutlined, EnterOutlined, UserSwitchOutlined, CloseOutlined, PlusOutlined, CommentOutlined, OpenAIOutlined, CopyOutlined, LikeOutlined, DislikeOutlined, DeleteOutlined, RedoOutlined, PlayCircleOutlined } from '@ant-design/icons';
7
7
  import { Attachments, Sender, Suggestion, XProvider, Prompts, Bubble, Conversations, Welcome } from '@ant-design/x';
8
8
  import classNames9 from 'classnames';
9
9
  import dayjs from 'dayjs';
@@ -54,8 +54,14 @@ var init_AppCard = __esm({
54
54
  init_styles_module();
55
55
  AppCard_default = ({ data, loading }) => {
56
56
  const chatStore = useChatStore();
57
- const onClick = () => {
58
- chatStore.switchAgentConversation(data.appKey);
57
+ const onClick = async () => {
58
+ if (data.appKey) {
59
+ const canProceed = await chatStore.config.hooks?.onAppRightVerify?.(data.appKey);
60
+ if (canProceed === false) {
61
+ return;
62
+ }
63
+ }
64
+ chatStore.switchAgentConversation(data.agentId);
59
65
  };
60
66
  return /* @__PURE__ */ jsx(Spin, { spinning: loading, size: "small", children: /* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 4, align: "center", className: styles_module_default.appCard, onClick, children: [
61
67
  /* @__PURE__ */ jsx("img", { src: data.iconUrl }),
@@ -91,7 +97,7 @@ var DocDrawer_default;
91
97
  var init_DocDrawer = __esm({
92
98
  "src/ui/common/markdownAlert/components/DocDrawer.tsx"() {
93
99
  init_Context();
94
- DocDrawer_default = ({ title, open, onClose, fileUrl }) => {
100
+ DocDrawer_default = ({ title, open, onClose, paramsStr }) => {
95
101
  const chatStore = useChatStore();
96
102
  const configState = useSnapshot(chatStore.config);
97
103
  const [content, setContent] = useState("");
@@ -99,7 +105,7 @@ var init_DocDrawer = __esm({
99
105
  const getContent = async () => {
100
106
  try {
101
107
  setLoading(true);
102
- const res = await configState.services.request.docQuery(fileUrl);
108
+ const res = await configState.services.request.docQuery(paramsStr);
103
109
  setContent(res.data?.content);
104
110
  } finally {
105
111
  setLoading(false);
@@ -107,7 +113,7 @@ var init_DocDrawer = __esm({
107
113
  };
108
114
  useEffect(() => {
109
115
  getContent();
110
- }, [fileUrl]);
116
+ }, [paramsStr]);
111
117
  return /* @__PURE__ */ jsx(Drawer, { title, push: false, width: "100%", open, onClose, children: /* @__PURE__ */ jsx(Spin, { spinning: loading, children: content ? /* @__PURE__ */ jsx(RenderMarkdown, { content }) : /* @__PURE__ */ jsx(Empty, { className: "m-t-32" }) }) });
112
118
  };
113
119
  }
@@ -122,20 +128,28 @@ var IndexQuote_default;
122
128
  var init_IndexQuote = __esm({
123
129
  "src/ui/common/markdownAlert/IndexQuote.tsx"() {
124
130
  init_DocDrawer();
125
- IndexQuote_default = ({ data, loading }) => {
131
+ IndexQuote_default = ({ data, loading, message: message2 }) => {
126
132
  const [open, setOpen] = useState(false);
133
+ const citation = useMemo(() => {
134
+ let citations = [];
135
+ try {
136
+ citations = JSON.parse(message2.citations);
137
+ } catch (e) {
138
+ }
139
+ return citations.find((item) => String(item.citationId) === String(data.citationId));
140
+ }, [data.citationId, message2.citations]);
127
141
  const onClick = () => {
128
- if (!data.fileUrl) return;
129
- if (isExternal(data.fileUrl)) {
130
- window.open(data.fileUrl, "_blank");
142
+ if (!citation.citationUrl) return;
143
+ if (isExternal(citation.citationUrl)) {
144
+ window.open(citation.citationUrl, "_blank");
131
145
  } else {
132
146
  setOpen(true);
133
147
  }
134
148
  };
135
- const Content = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Flex, { align: "center", gap: 8, children: /* @__PURE__ */ jsx("a", { onClick, children: data.fileName }) }) });
149
+ const Content = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Flex, { align: "center", gap: 8, children: /* @__PURE__ */ jsx("a", { onClick, children: citation.citationName }) }) });
136
150
  return /* @__PURE__ */ jsxs("div", { className: "inline-block m-l-8", children: [
137
- /* @__PURE__ */ jsx(Spin, { spinning: loading, size: "small", children: /* @__PURE__ */ jsx(Popover, { content: Content, children: /* @__PURE__ */ jsx(Tag, { bordered: false, color: "processing", className: "cursor-pointer", children: data.index }) }) }),
138
- open && /* @__PURE__ */ jsx(DocDrawer_default, { fileUrl: data.fileUrl, title: data.fileName, open, onClose: () => setOpen(false) })
151
+ /* @__PURE__ */ jsx(Spin, { spinning: loading, size: "small", children: /* @__PURE__ */ jsx(Popover, { content: Content, children: /* @__PURE__ */ jsx(Tag, { bordered: false, color: "processing", className: "cursor-pointer", children: data.citationName }) }) }),
152
+ open && /* @__PURE__ */ jsx(DocDrawer_default, { paramsStr: citation.citationUrl, title: citation.citationName, open, onClose: () => setOpen(false) })
139
153
  ] });
140
154
  };
141
155
  }
@@ -200,51 +214,6 @@ var init_FileEdit = __esm({
200
214
  }
201
215
  });
202
216
 
203
- // src/ui/common/markdownAlert/QuoteList.tsx
204
- var QuoteList_exports = {};
205
- __export(QuoteList_exports, {
206
- default: () => QuoteList_default
207
- });
208
- var QuoteList_default;
209
- var init_QuoteList = __esm({
210
- "src/ui/common/markdownAlert/QuoteList.tsx"() {
211
- init_DocDrawer();
212
- init_styles_module();
213
- QuoteList_default = ({ data, loading }) => {
214
- const [open, setOpen] = useState(false);
215
- const [selectItem, setSelectItem] = useState({});
216
- const onClick = (item) => {
217
- if (!item.fileUrl) return;
218
- if (isExternal(item.fileUrl)) {
219
- window.open(item.fileUrl, "_blank");
220
- } else {
221
- setSelectItem(item);
222
- setOpen(true);
223
- }
224
- };
225
- return /* @__PURE__ */ jsxs(Fragment, { children: [
226
- /* @__PURE__ */ jsx(
227
- Collapse,
228
- {
229
- className: styles_module_default.quoteList,
230
- bordered: false,
231
- ghost: true,
232
- expandIcon: ({ isActive }) => /* @__PURE__ */ jsx(CaretRightOutlined, { rotate: isActive ? 90 : 0 }),
233
- items: [
234
- {
235
- key: "1",
236
- label: "\u53C2\u8003\u8D44\u6599",
237
- children: /* @__PURE__ */ jsx(Flex, { vertical: true, gap: 4, children: data.list.map((item) => /* @__PURE__ */ jsx("p", { onClick: () => !loading && onClick(item), className: "cursor-pointer", children: item.title }, item.fileUrl)) })
238
- }
239
- ]
240
- }
241
- ),
242
- open && /* @__PURE__ */ jsx(DocDrawer_default, { fileUrl: selectItem.fileUrl, title: selectItem.title, open, onClose: () => setOpen(false) })
243
- ] });
244
- };
245
- }
246
- });
247
-
248
217
  // src/ui/common/markdownAlert/Think.tsx
249
218
  var Think_exports = {};
250
219
  __export(Think_exports, {
@@ -800,8 +769,7 @@ function createChatStore() {
800
769
  }
801
770
  };
802
771
  const switchAgentConversation = async (id, strategy) => {
803
- const agentId = String(id);
804
- await switchAgent(agentId);
772
+ await switchAgent(String(id));
805
773
  const conversationId = await resolveConversationId(receiver.active.id, strategy);
806
774
  if (conversationId) {
807
775
  await switchConversation(conversationId);
@@ -912,60 +880,84 @@ function createChatStore() {
912
880
  const cancelReceive = async () => {
913
881
  console.log("\u53D6\u6D88\u63A5\u6536");
914
882
  await config.services.request.conversationStop(conversation.active.id);
883
+ conversation.messages[conversation.active.id].loading = false;
915
884
  };
916
885
  const updateConversationTitle = (conversationId, title) => {
917
- const idx = conversations.list.items.findIndex((item) => item.id === conversationId);
918
- if (idx === -1) return;
919
- conversations.list.items[idx].title = title;
886
+ if (title && conversations.list.items.length) {
887
+ const idx = conversations.list.items.findIndex((item) => item.id === conversationId);
888
+ if (idx === -1) return;
889
+ conversations.list.items[idx].label = title;
890
+ }
920
891
  };
921
- const findMsgIndex = (conversationId, msgId) => {
922
- const messages = conversation.messages[conversationId]?.message || [];
923
- return messages.findLastIndex((item) => item.id === msgId);
892
+ const findMsgIndex = (msgId, messages) => {
893
+ return (messages || []).findLastIndex((item) => item.id === msgId);
924
894
  };
925
895
  const startCallback = (msg) => {
926
- if (msg.conversationTitle && conversations.list.items.length) {
927
- updateConversationTitle(msg.conversationId, msg.conversationTitle);
928
- }
929
896
  removeQuestionList(msg.conversationId);
930
- const messages = conversation.messages[msg.conversationId].message;
931
- messages.push(msg.sender.type === 3 ? { ...msg, msgContent: "\u6B63\u5728\u52AA\u529B\u601D\u8003\u4E2D" } : msg);
897
+ const messages = conversation.messages[msg.conversationId]?.message;
898
+ if (!messages) return;
899
+ messages.push(msg.sender.type === 3 ? { ...msg, tempContent: "\u6B63\u5728\u52AA\u529B\u601D\u8003\u4E2D" } : msg);
932
900
  conversation.messages[msg.conversationId].loading = true;
933
901
  };
934
902
  const stepCallback = (msg) => {
935
- const messages = conversation.messages[msg.conversationId].message;
936
- const idx = findMsgIndex(msg.conversationId, msg.id);
903
+ const messages = conversation.messages[msg.conversationId]?.message;
904
+ const idx = findMsgIndex(msg.id, messages);
937
905
  if (idx === -1) return;
938
- messages[idx] = msg;
939
906
  conversation.messages[msg.conversationId].loading = true;
907
+ messages[idx] = {
908
+ ...messages[idx],
909
+ params: messages[idx]?.params || msg.params,
910
+ type: msg.type,
911
+ tempContent: msg.msgContent
912
+ };
940
913
  };
941
914
  const contentCallback = (msg) => {
942
- const messages = conversation.messages[msg.conversationId].message;
943
- const idx = findMsgIndex(msg.conversationId, msg.id);
915
+ const messages = conversation.messages[msg.conversationId]?.message;
916
+ const idx = findMsgIndex(msg.id, messages);
944
917
  if (idx === -1) return;
945
- const message2 = messages[idx];
946
918
  conversation.messages[msg.conversationId].loading = true;
947
- if (message2?.type === "STEP_STARTED" || message2?.type === "TEXT_MESSAGE_START") {
948
- messages[idx] = msg;
949
- return;
950
- }
951
919
  messages[idx] = {
952
- ...message2,
953
- msgContent: message2.msgContent + (msg.msgContent || "")
920
+ ...messages[idx],
921
+ params: messages[idx]?.params || msg.params,
922
+ type: msg.type,
923
+ tempContent: "",
924
+ msgContent: messages[idx].msgContent + (msg.msgContent || "")
954
925
  };
955
926
  };
956
927
  const endCallback = (msg) => {
957
- const messages = conversation.messages[msg.conversationId].message;
958
- const idx = findMsgIndex(msg.conversationId, msg.id);
928
+ const messages = conversation.messages[msg.conversationId]?.message;
929
+ const idx = findMsgIndex(msg.id, messages);
959
930
  if (idx === -1) return;
960
- messages[idx] = { ...messages[idx], type: void 0 };
931
+ messages[idx] = {
932
+ ...messages[idx],
933
+ tempContent: "",
934
+ type: void 0
935
+ };
961
936
  conversation.messages[msg.conversationId].loading = false;
962
937
  getQuestionList(msg.conversationId, msg.id);
963
938
  };
939
+ const citationCallback = (msg) => {
940
+ const messages = conversation.messages[msg.conversationId]?.message;
941
+ const idx = findMsgIndex(msg.id, messages);
942
+ if (idx === -1) return;
943
+ messages[idx] = {
944
+ ...messages[idx],
945
+ citations: msg.msgContent
946
+ };
947
+ };
964
948
  const errCallback = (msg) => {
965
949
  const messages = conversation.messages[msg.conversationId].message;
966
- const idx = findMsgIndex(msg.conversationId, msg.id);
950
+ const idx = findMsgIndex(msg.id, messages);
967
951
  if (idx === -1) return;
968
- messages[idx] = { ...msg, type: void 0 };
952
+ messages[idx] = {
953
+ ...messages[idx],
954
+ params: messages[idx]?.params || msg.params,
955
+ tempContent: msg.msgContent,
956
+ type: void 0,
957
+ // 报错后清空消息内容
958
+ msgContent: "",
959
+ citations: ""
960
+ };
969
961
  conversation.messages[msg.conversationId].loading = false;
970
962
  };
971
963
  const acceptMessage = async (newMessage) => {
@@ -975,6 +967,7 @@ function createChatStore() {
975
967
  if (canProceed === false) {
976
968
  throw new Error("\u64CD\u4F5C\u88AB\u963B\u6B62");
977
969
  }
970
+ updateConversationTitle(conversationId, newMessage.data.conversationTitle);
978
971
  switch (newMessage.data.type) {
979
972
  case "TEXT_MESSAGE_START":
980
973
  startCallback(newMessage.data);
@@ -988,6 +981,9 @@ function createChatStore() {
988
981
  case "TEXT_MESSAGE_END":
989
982
  endCallback(newMessage.data);
990
983
  break;
984
+ case "TEXT_MESSAGE_CITATION":
985
+ citationCallback(newMessage.data);
986
+ break;
991
987
  case "RUN_ERROR":
992
988
  errCallback(newMessage.data);
993
989
  break;
@@ -1068,7 +1064,7 @@ var customComponents = {
1068
1064
  indexQuote: () => Promise.resolve().then(() => (init_IndexQuote(), IndexQuote_exports)),
1069
1065
  mdEdit: () => Promise.resolve().then(() => (init_MdEdit(), MdEdit_exports)),
1070
1066
  fileEdit: () => Promise.resolve().then(() => (init_FileEdit(), FileEdit_exports)),
1071
- quoteList: () => Promise.resolve().then(() => (init_QuoteList(), QuoteList_exports)),
1067
+ // quoteList: () => import('./QuoteList'),
1072
1068
  think: () => Promise.resolve().then(() => (init_Think(), Think_exports))
1073
1069
  };
1074
1070
 
@@ -1080,13 +1076,25 @@ var styles_module_default2 = {
1080
1076
  chatQuoteMsg: "styles_module_chatQuoteMsg"
1081
1077
  };
1082
1078
  var MessageRender_default = ({ message: message2, placement }) => {
1083
- return /* @__PURE__ */ jsx(Flex, { vertical: true, children: !(message2.msgContent || message2.msgFiles.length) ? /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(Spin, { size: "small" }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1084
- message2.msgContent && /* @__PURE__ */ jsx(
1079
+ const content = useMemo(
1080
+ () => `${message2.msgContent || ""}${message2.msgContent && message2.tempContent ? "\n\n" : ""}${message2.tempContent || ""}`,
1081
+ [message2.msgContent, message2.tempContent]
1082
+ );
1083
+ const paramsTextInfo = useMemo(() => {
1084
+ let textInfo = "";
1085
+ try {
1086
+ textInfo = JSON.parse(message2.params || "{}").textInfo || "";
1087
+ } catch (e) {
1088
+ }
1089
+ return textInfo;
1090
+ }, [message2.params]);
1091
+ return /* @__PURE__ */ jsx(Flex, { vertical: true, children: !(message2.msgContent || message2.tempContent || message2.msgFiles.length) ? /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(Spin, { size: "small" }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1092
+ content && /* @__PURE__ */ jsx(
1085
1093
  Bubble,
1086
1094
  {
1087
1095
  placement,
1088
1096
  className: classNames9({ [styles_module_default2.loadingMessage]: message2.type }),
1089
- content: /* @__PURE__ */ jsx(RenderMarkdown, { content: replaceThinkTags(message2.msgContent), customComponents })
1097
+ content: /* @__PURE__ */ jsx(RenderMarkdown, { content: replaceThinkTags(content), customComponents, message: message2 })
1090
1098
  }
1091
1099
  ),
1092
1100
  message2.msgFiles?.map((file) => /* @__PURE__ */ jsx(
@@ -1109,7 +1117,7 @@ var MessageRender_default = ({ message: message2, placement }) => {
1109
1117
  },
1110
1118
  file.content
1111
1119
  )),
1112
- message2.quoteMsg?.id && /* @__PURE__ */ jsx(
1120
+ message2.quoteMsg?.id ? /* @__PURE__ */ jsx(
1113
1121
  Bubble,
1114
1122
  {
1115
1123
  className: classNames9(styles_module_default2.chatQuoteMsg),
@@ -1117,7 +1125,7 @@ var MessageRender_default = ({ message: message2, placement }) => {
1117
1125
  content: /* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 8, children: [
1118
1126
  message2.quoteMsg.msgContent && /* @__PURE__ */ jsxs(Flex, { children: [
1119
1127
  /* @__PURE__ */ jsx("span", { children: "\u3010\u5F15\u7528\u6D88\u606F\u3011\uFF1A" }),
1120
- /* @__PURE__ */ jsx(Flex, { flex: 1, className: "text-ellipsis", children: message2.quoteMsg.msgContent })
1128
+ /* @__PURE__ */ jsx(Flex, { flex: 1, className: "text-ellipsis", children: /* @__PURE__ */ jsx(RenderMarkdown, { content: message2.quoteMsg.msgContent }) })
1121
1129
  ] }),
1122
1130
  message2.quoteMsg?.msgFiles && message2.quoteMsg.msgFiles.length > 0 && /* @__PURE__ */ jsxs(Flex, { children: [
1123
1131
  /* @__PURE__ */ jsx("span", { children: "\u3010\u5F15\u7528\u6587\u4EF6\u3011\uFF1A" }),
@@ -1135,6 +1143,16 @@ var MessageRender_default = ({ message: message2, placement }) => {
1135
1143
  ] })
1136
1144
  ] })
1137
1145
  }
1146
+ ) : paramsTextInfo && /* @__PURE__ */ jsx(
1147
+ Bubble,
1148
+ {
1149
+ className: classNames9(styles_module_default2.chatQuoteMsg),
1150
+ placement,
1151
+ content: /* @__PURE__ */ jsx(Flex, { vertical: true, gap: 8, children: /* @__PURE__ */ jsxs(Flex, { children: [
1152
+ /* @__PURE__ */ jsx("span", { children: "\u3010\u5F15\u7528\u6D88\u606F\u3011\uFF1A" }),
1153
+ /* @__PURE__ */ jsx(Flex, { flex: 1, className: "text-ellipsis", children: /* @__PURE__ */ jsx(RenderMarkdown, { content: paramsTextInfo }) })
1154
+ ] }) })
1155
+ }
1138
1156
  )
1139
1157
  ] }) });
1140
1158
  };