@zero-library/chat-copilot 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -2134,6 +2134,18 @@ var IndexQuote_default = ({ data, loading, message: message2 }) => {
2134
2134
  open && /* @__PURE__ */ jsxRuntime.jsx(DocDrawer_default, { paramsStr: citation?.citationUrl, title: citation?.citationName, open, onClose: () => setOpen(false) })
2135
2135
  ] });
2136
2136
  };
2137
+ var MarkImg_default = ({ data, loading, message: message2, ...rest }) => {
2138
+ const getPreviewFileUrl = (src) => {
2139
+ return common.buildUrlParams({ [TOKEN_KEY]: tokenManager.get() || "" }, src);
2140
+ };
2141
+ const previewSrc = React7.useMemo(() => {
2142
+ if (String(rest.src).startsWith("/luya")) {
2143
+ return getPreviewFileUrl(rest.src);
2144
+ }
2145
+ return rest.src;
2146
+ }, [rest.src]);
2147
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Image, { ...rest, src: previewSrc, placeholder: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, {}) });
2148
+ };
2137
2149
  var MdEdit_default = ({ data, loading }) => {
2138
2150
  const chatStore = useChatStore();
2139
2151
  const [value, setValue] = React7.useState("");
@@ -2301,6 +2313,7 @@ var XMarkdown_default = ({ message: message2, components = {}, content = "", ...
2301
2313
  indexquote: IndexQuote_default,
2302
2314
  mdedit: MdEdit_default,
2303
2315
  fileedit: FileEdit_default,
2316
+ img: MarkImg_default,
2304
2317
  ...components
2305
2318
  }),
2306
2319
  [components]
@@ -3763,38 +3776,43 @@ var FilesNode = React7__default.default.memo(({ item }) => {
3763
3776
  }, [item.files]);
3764
3777
  return /* @__PURE__ */ jsxRuntime.jsx(xV2.FileCard.List, { items: fileItems });
3765
3778
  });
3779
+
3780
+ // src/components/CustomComponents/MessageNode/style.module.less
3781
+ var style_module_default2 = {
3782
+ runStartedNode: "style_module_runStartedNode"};
3766
3783
  var QuoteMsgNode = React7__default.default.memo(({ quoteMsg, role }) => {
3767
3784
  if (!quoteMsg || !quoteMsg.messageContent) return null;
3768
3785
  return /* @__PURE__ */ jsxRuntime.jsx(
3769
3786
  xV2.Bubble,
3770
3787
  {
3788
+ className: style_module_default2.quoteMsgNode,
3771
3789
  placement: role.placement,
3772
3790
  variant: "borderless",
3773
- content: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, gap: 8, children: /* @__PURE__ */ jsxRuntime.jsx(
3774
- antd.Tooltip,
3775
- {
3776
- arrow: false,
3777
- title: /* @__PURE__ */ jsxRuntime.jsx(XMarkdown_default, { content: quoteMsg.messageContent }),
3778
- getPopupContainer: (node) => node,
3779
- children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
3780
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u3010\u5F15\u7528\u6D88\u606F\u3011\uFF1A" }),
3781
- /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { flex: 1, className: "text-ellipsis-2", style: {
3791
+ content: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, gap: 8, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Tooltip, { arrow: false, title: /* @__PURE__ */ jsxRuntime.jsx(XMarkdown_default, { content: quoteMsg.messageContent }), getPopupContainer: (node) => node, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
3792
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u3010\u5F15\u7528\u6D88\u606F\u3011\uFF1A" }),
3793
+ /* @__PURE__ */ jsxRuntime.jsx(
3794
+ antd.Flex,
3795
+ {
3796
+ flex: 1,
3797
+ className: "text-ellipsis-2",
3798
+ style: {
3782
3799
  color: "#666",
3783
3800
  background: "rgba(0,0,0,0.04)",
3784
3801
  padding: "2px 8px",
3785
3802
  borderRadius: "4px",
3786
3803
  fontSize: "12px",
3787
3804
  cursor: "pointer"
3788
- }, children: quoteMsg.messageContent })
3789
- ] })
3790
- }
3791
- ) })
3805
+ },
3806
+ children: quoteMsg.messageContent
3807
+ }
3808
+ )
3809
+ ] }) }) })
3792
3810
  }
3793
3811
  );
3794
3812
  });
3795
3813
  var RunStartedNode = React7__default.default.memo(({ loading }) => {
3796
3814
  if (!loading) return null;
3797
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, align: "center", style: { minHeight: 24 }, children: /* @__PURE__ */ jsxRuntime.jsx(icons.LoadingOutlined, { style: { color: "#1677ff" } }) });
3815
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, align: "center", className: style_module_default2.runStartedNode, children: /* @__PURE__ */ jsxRuntime.jsx(icons.LoadingOutlined, { style: { color: "#1677ff" } }) });
3798
3816
  });
3799
3817
  function QuestionSummary({ content }) {
3800
3818
  const answer = content.replace(/^Question:\s*/, "").trim() || "\u5DF2\u56DE\u7B54";
@@ -4471,7 +4489,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
4471
4489
  width: 960,
4472
4490
  centered: true,
4473
4491
  destroyOnHidden: true,
4474
- title: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { className: style_module_default.titleContainer, children: /* @__PURE__ */ jsxRuntime.jsx(Title2, { level: 5, children: title }) }),
4492
+ title: /* @__PURE__ */ jsxRuntime.jsx("div", { className: style_module_default.titleContainer, children: /* @__PURE__ */ jsxRuntime.jsx(Title2, { level: 5, children: title }) }),
4475
4493
  footer: /* @__PURE__ */ jsxRuntime.jsx("div", { className: style_module_default.footer, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "primary", onClick: handleConfirm, children: "\u786E\u8BA4" }) }),
4476
4494
  children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Layout, { className: style_module_default.layout, children: [
4477
4495
  /* @__PURE__ */ jsxRuntime.jsx(Sider, { width: 220, className: style_module_default.sider, theme: "light", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: style_module_default.siderContent, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 4, vertical: true, children: categories.map((cat) => {
@@ -4865,7 +4883,7 @@ var ChatPreviewPanel = React7.memo(({ file }) => {
4865
4883
  }, [file]);
4866
4884
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4867
4885
  file.fileUrl && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: "height-full", children: [
4868
- /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", className: styles_module_default5.previewHeader, children: [
4886
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default5.previewHeader, children: [
4869
4887
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
4870
4888
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, justify: "center", align: "center", children: [
4871
4889
  /* @__PURE__ */ jsxRuntime.jsx(