@zero-library/chat-agent 2.0.5 → 2.0.6

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
@@ -35,7 +35,7 @@
35
35
  min-width: 320px;
36
36
  width: calc(100% - 24px) !important;
37
37
  }
38
- .styles_module_nsBubbleList.ant-bubble-list .ant-bubble .ant-bubble-content-filled {
38
+ .styles_module_nsBubbleList.ant-bubble-list .ant-bubble.ant-bubble-start .ant-bubble-content-filled {
39
39
  background-color: transparent;
40
40
  }
41
41
  .styles_module_nsBubbleList.ant-bubble-list .ant-bubble.ant-bubble-end .ant-bubble-content-filled {
@@ -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-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,WAAW,CAAC;AAChD,oBAAkB;AACpB;AACA,CAHCA,0BAGmB,CAHC,gBAGgB,CAHC,UAGU,CAAC,eAAe,CAHd;AAIhD,oBAAkB,IAAI;AACxB;AACA,CANCA,0BAMm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;AACA,CANC,cAMc,CANC,oBAMoB,CANC,0CAM0C,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.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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ACX,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"]}
package/dist/index.d.mts CHANGED
@@ -48,8 +48,8 @@ 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) => boolean | Promise<boolean> | void;
52
- onAfterSwitchConversation?: (conversationId: string) => void;
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;
package/dist/index.d.ts CHANGED
@@ -48,8 +48,8 @@ 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) => boolean | Promise<boolean> | void;
52
- onAfterSwitchConversation?: (conversationId: string) => void;
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;
package/dist/index.esm.js CHANGED
@@ -196,16 +196,7 @@ var init_IndexQuote = __esm({
196
196
  }
197
197
  };
198
198
  const Content = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Flex, { align: "center", gap: 8, children: /* @__PURE__ */ jsx("a", { onClick, children: data.fileName }) }) });
199
- const rootRef = useRef(null);
200
- useEffect(() => {
201
- const el = rootRef.current;
202
- if (!el) return;
203
- const previous = el.previousElementSibling;
204
- if (!previous) return;
205
- console.log("previous", previous, el);
206
- previous.appendChild(el);
207
- }, []);
208
- return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: "inline-block m-l-8", children: [
199
+ return /* @__PURE__ */ jsxs("div", { className: "inline-block m-l-8", children: [
209
200
  /* @__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 }) }) }),
210
201
  open && /* @__PURE__ */ jsx(DocDrawer_default, { fileUrl: data.fileUrl, title: data.fileName, open, onClose: () => setOpen(false) })
211
202
  ] });
@@ -227,16 +218,15 @@ var init_MdEdit = __esm({
227
218
  const chatStore = useChatStore();
228
219
  const [value, setValue] = useState("");
229
220
  const onOk = () => {
230
- console.log("value", value);
231
221
  chatStore.sendMessage("\u5F00\u59CB\u5199\u4F5C", [], { outline: value });
232
222
  };
233
223
  useEffect(() => {
234
224
  setValue(data.content);
235
225
  }, [data.content]);
236
- return /* @__PURE__ */ jsx(Spin, { spinning: loading, size: "small", children: /* @__PURE__ */ jsxs("div", { className: styles_module_default2.mdEdit, children: [
226
+ return /* @__PURE__ */ jsxs("div", { className: styles_module_default2.mdEdit, children: [
237
227
  /* @__PURE__ */ jsx(MarkdownEditor, { disabled: loading, value, onChange: setValue, showToolbar: false }),
238
228
  !loading && /* @__PURE__ */ jsx(Flex, { justify: "end", className: "m-t-16", children: /* @__PURE__ */ jsx(Button, { color: "primary", variant: "outlined", onClick: onOk, children: "\u786E\u8BA4\u63D0\u7EB2\u601D\u8DEF\uFF0C\u5F00\u59CB\u5199\u4F5C" }) })
239
- ] }) });
229
+ ] });
240
230
  };
241
231
  }
242
232
  });
@@ -297,7 +287,7 @@ var init_QuoteList = __esm({
297
287
  }
298
288
  };
299
289
  return /* @__PURE__ */ jsxs(Fragment, { children: [
300
- /* @__PURE__ */ jsx(Spin, { spinning: loading, size: "small", children: /* @__PURE__ */ jsx(
290
+ /* @__PURE__ */ jsx(
301
291
  Collapse,
302
292
  {
303
293
  className: styles_module_default2.quoteList,
@@ -308,11 +298,11 @@ var init_QuoteList = __esm({
308
298
  {
309
299
  key: "1",
310
300
  label: "\u53C2\u8003\u8D44\u6599",
311
- children: /* @__PURE__ */ jsx(Flex, { vertical: true, gap: 4, children: data.list.map((item) => /* @__PURE__ */ jsx("p", { onClick: () => onClick(item), className: "cursor-pointer", children: item.title }, item.fileUrl)) })
301
+ 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)) })
312
302
  }
313
303
  ]
314
304
  }
315
- ) }),
305
+ ),
316
306
  open && /* @__PURE__ */ jsx(DocDrawer_default, { fileUrl: selectItem.fileUrl, title: selectItem.title, open, onClose: () => setOpen(false) })
317
307
  ] });
318
308
  };
@@ -653,13 +643,14 @@ function createChatStore() {
653
643
  const switchConversation = async (chat) => {
654
644
  const chatKey = chat?.key || `${agent.active.id}-${DEFAULT_NEW_CONV_ID}`;
655
645
  if (conversation.active.key === chatKey) return;
656
- const canProceed = await config.hooks?.onBeforeSwitchConversation?.(chatKey);
646
+ const isNew = !chat?.key;
647
+ const canProceed = await config.hooks?.onBeforeSwitchConversation?.(chatKey, isNew);
657
648
  if (canProceed === false) return;
658
649
  conversation.active = chat?.key ? chat : { key: chatKey };
659
650
  if (!conversation.messages[chatKey]) {
660
651
  setInitMessage(chatKey);
661
652
  }
662
- config.hooks?.onAfterSwitchConversation?.(chatKey);
653
+ config.hooks?.onAfterSwitchConversation?.(chatKey, isNew);
663
654
  if (!chatKey.endsWith(DEFAULT_NEW_CONV_ID) && conversation.messages[chatKey].message.items.length === 0) {
664
655
  getMessages(agent.active.id, chatKey);
665
656
  }
@@ -1752,7 +1743,7 @@ var layouts_default = forwardRef(({ theme, params, hooks, layout, defaultAgent }
1752
1743
  value: configState.preview.file.content,
1753
1744
  onQuote: (text) => {
1754
1745
  chatStore.setReferences({
1755
- type: 2,
1746
+ type: 1,
1756
1747
  content: {
1757
1748
  name: text,
1758
1749
  markdown: text