@zero-library/chat-copilot 1.0.17 → 1.0.19
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 +14 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +55 -15
- package/dist/index.d.ts +55 -15
- package/dist/index.esm.js +14 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -464,13 +464,6 @@ var defaultLayout = {
|
|
|
464
464
|
chatHeader: true,
|
|
465
465
|
messageList: true,
|
|
466
466
|
senderHeader: false,
|
|
467
|
-
sender: {
|
|
468
|
-
props: {
|
|
469
|
-
modelSelect: true,
|
|
470
|
-
skillsBtn: true,
|
|
471
|
-
reasoningBtn: true
|
|
472
|
-
}
|
|
473
|
-
},
|
|
474
467
|
senderFooter: false,
|
|
475
468
|
disclaimerNotice: true
|
|
476
469
|
};
|
|
@@ -1233,7 +1226,8 @@ function createChatStore() {
|
|
|
1233
1226
|
setHeaderOpen(false);
|
|
1234
1227
|
}
|
|
1235
1228
|
try {
|
|
1236
|
-
await config.
|
|
1229
|
+
const dealedParams = await config.hooks?.onHandleSendParams?.(sendParams);
|
|
1230
|
+
await config.services.request.sendMessageStream(dealedParams || sendParams, agent.agentInfo?.id || "");
|
|
1237
1231
|
config.hooks?.onAfterSend?.();
|
|
1238
1232
|
} finally {
|
|
1239
1233
|
}
|
|
@@ -2167,7 +2161,7 @@ var MdEdit_default = ({ data, loading }) => {
|
|
|
2167
2161
|
!loading && /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "end", className: "m-t-16", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { color: "primary", variant: "outlined", onClick: onOk, children: btnText }) })
|
|
2168
2162
|
] });
|
|
2169
2163
|
};
|
|
2170
|
-
var PreviewLink_default = ({ data, loading,
|
|
2164
|
+
var PreviewLink_default = ({ data, loading, message: message2, ...rest }) => {
|
|
2171
2165
|
const chatStore = useChatStore();
|
|
2172
2166
|
const getLinkFileName = (href) => {
|
|
2173
2167
|
const url = new URL(href, window.location.origin);
|
|
@@ -2183,7 +2177,15 @@ var PreviewLink_default = ({ data, loading, domNode, ...rest }) => {
|
|
|
2183
2177
|
}
|
|
2184
2178
|
};
|
|
2185
2179
|
const getPreviewFileUrl = (href) => {
|
|
2186
|
-
|
|
2180
|
+
const url = new URL(href, window.location.origin);
|
|
2181
|
+
const path = url.searchParams.get("path") || url.pathname;
|
|
2182
|
+
const fileName = getLinkFileName(href);
|
|
2183
|
+
console.log(path, fileName);
|
|
2184
|
+
if (isDocument(fileName)) {
|
|
2185
|
+
return chatStore.config.services.request.getPreviewUrl(message2.agentId, message2.conversationId, path, "preview");
|
|
2186
|
+
} else {
|
|
2187
|
+
return chatStore.config.services.request.getPreviewUrl(message2.agentId, message2.conversationId, path, "download");
|
|
2188
|
+
}
|
|
2187
2189
|
};
|
|
2188
2190
|
const handlePreviewLink = (href) => {
|
|
2189
2191
|
const fileName = getLinkFileName(href);
|
|
@@ -4610,7 +4612,7 @@ var KnowledgeBtn_default = ({}) => {
|
|
|
4610
4612
|
const [modalOpen, setModalOpen] = React6.useState(false);
|
|
4611
4613
|
const knowledgeCount = conversationState.active.spec?.knowledge?.items?.length ?? 0;
|
|
4612
4614
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4613
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4615
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default2.resourceBtn, onClick: () => setModalOpen(true), children: [
|
|
4614
4616
|
/* @__PURE__ */ jsxRuntime.jsx(IconFont_default, { type: "icon-remark" }),
|
|
4615
4617
|
/* @__PURE__ */ jsxRuntime.jsx(Text5, { children: "\u77E5\u8BC6\u5E93" }),
|
|
4616
4618
|
knowledgeCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -4738,7 +4740,7 @@ var ChatSender_default2 = React6.forwardRef(
|
|
|
4738
4740
|
reasonBtn = true,
|
|
4739
4741
|
skillsBtn = false,
|
|
4740
4742
|
knowledgeBtn = false,
|
|
4741
|
-
modelSelect =
|
|
4743
|
+
modelSelect = false
|
|
4742
4744
|
}, ref) => {
|
|
4743
4745
|
const chatStore = useChatStore();
|
|
4744
4746
|
const configState = valtio.useSnapshot(chatStore.config);
|