@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 CHANGED
@@ -7,14 +7,14 @@ var jsxRuntime = require('react/jsx-runtime');
7
7
  var react = require('react');
8
8
  var icons = require('@ant-design/icons');
9
9
  var x = require('@ant-design/x');
10
- var classNames5 = require('classnames');
10
+ var classNames6 = require('classnames');
11
11
  var valtio = require('valtio');
12
12
  var InfiniteScroll = require('react-infinite-scroll-component');
13
13
 
14
14
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
15
15
 
16
16
  var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
17
- var classNames5__default = /*#__PURE__*/_interopDefault(classNames5);
17
+ var classNames6__default = /*#__PURE__*/_interopDefault(classNames6);
18
18
  var InfiniteScroll__default = /*#__PURE__*/_interopDefault(InfiniteScroll);
19
19
 
20
20
  var __defProp = Object.defineProperty;
@@ -478,21 +478,16 @@ var sendChatMessage = (params) => {
478
478
 
479
479
  // src/stores/index.ts
480
480
  var defaultLayout = {
481
+ leftPanel: false,
481
482
  conversationList: true,
482
- conversationListHeader: true,
483
483
  preview: true,
484
484
  messageList: true,
485
485
  senderHeader: false,
486
486
  sender: true,
487
487
  senderPrompts: true,
488
488
  senderFooter: false,
489
- senderExtraBtn: false,
490
- referencesBtn: false,
491
- header: true,
492
- headerTitle: true,
493
- headerConversationListBtn: true,
494
- headerNewConversationBtn: true,
495
- headerCloseBtn: false,
489
+ globalHeader: false,
490
+ chatHeader: true,
496
491
  disclaimerNotice: true
497
492
  };
498
493
  function createChatStore() {
@@ -655,11 +650,12 @@ function createChatStore() {
655
650
  const canProceed = await config.hooks?.onBeforeSwitchConversation?.(chatKey, isNew);
656
651
  if (canProceed === false) return;
657
652
  conversation.active = chat?.key ? chat : { key: chatKey };
653
+ setPreview();
658
654
  if (!conversation.messages[chatKey]) {
659
655
  setInitMessage(chatKey);
660
656
  }
661
657
  config.hooks?.onAfterSwitchConversation?.(chatKey, isNew);
662
- if (!chatKey.endsWith(DEFAULT_NEW_CONV_ID) && conversation.messages[chatKey].message.items.length === 0) {
658
+ if (!isNew && conversation.messages[chatKey].message.items.length === 0) {
663
659
  getMessages(agent.active.id, chatKey);
664
660
  }
665
661
  };
@@ -887,6 +883,7 @@ init_Context();
887
883
  // src/ui/common/styles.module.less
888
884
  var styles_module_default = {
889
885
  loadingMessage: "styles_module_loadingMessage",
886
+ conversationListPanel: "styles_module_conversationListPanel",
890
887
  nsConversations: "styles_module_nsConversations",
891
888
  nsBodyWidth: "styles_module_nsBodyWidth",
892
889
  nsBubbleList: "styles_module_nsBubbleList",
@@ -953,7 +950,8 @@ var ConversationList_default = () => {
953
950
  }
954
951
  ) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u4F1A\u8BDD\u8BB0\u5F55", image: antd.Empty.PRESENTED_IMAGE_SIMPLE }) }) });
955
952
  };
956
- var AgentHeader_default = () => {
953
+ var AgentHeader_default = ({ title = true, closeBtn = false, newConversationBtn = true, conversationListBtn = true }) => {
954
+ console.log("AgentHeader", title, closeBtn, newConversationBtn, conversationListBtn);
957
955
  const chatStore = useChatStore();
958
956
  const agentState = valtio.useSnapshot(chatStore.agent);
959
957
  const configState = valtio.useSnapshot(chatStore.config);
@@ -962,7 +960,7 @@ var AgentHeader_default = () => {
962
960
  /* @__PURE__ */ jsxRuntime.jsx(
963
961
  common.RenderWrapper,
964
962
  {
965
- control: configState.layout.headerTitle,
963
+ control: title,
966
964
  DefaultComponent: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
967
965
  /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { size: 22, src: agentState.active.iconUrl, alt: agentState.active.name }),
968
966
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default.nsChatTitle, children: agentState.active.name })
@@ -975,14 +973,14 @@ var AgentHeader_default = () => {
975
973
  /* @__PURE__ */ jsxRuntime.jsx(
976
974
  common.RenderWrapper,
977
975
  {
978
- control: configState.layout.headerNewConversationBtn,
976
+ control: newConversationBtn,
979
977
  DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "large", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}), onClick: () => chatStore.switchConversation() })
980
978
  }
981
979
  ),
982
980
  /* @__PURE__ */ jsxRuntime.jsx(
983
981
  common.RenderWrapper,
984
982
  {
985
- control: configState.layout.headerConversationListBtn,
983
+ control: conversationListBtn,
986
984
  DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(
987
985
  antd.Popover,
988
986
  {
@@ -999,7 +997,7 @@ var AgentHeader_default = () => {
999
997
  /* @__PURE__ */ jsxRuntime.jsx(
1000
998
  common.RenderWrapper,
1001
999
  {
1002
- control: configState.layout.headerCloseBtn,
1000
+ control: closeBtn,
1003
1001
  DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "large", onClick: configState.hooks?.onHeaderClose, icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseOutlined, {}) })
1004
1002
  }
1005
1003
  )
@@ -1083,7 +1081,7 @@ var MessageAIRender_default = ({ message: message4, placement }) => {
1083
1081
  x.Bubble,
1084
1082
  {
1085
1083
  placement,
1086
- className: classNames5__default.default({ [styles_module_default.loadingMessage]: message4.status === "loading" }),
1084
+ className: classNames6__default.default({ [styles_module_default.loadingMessage]: message4.status === "loading" }),
1087
1085
  content: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1088
1086
  thinkContents.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1089
1087
  antd.Collapse,
@@ -1143,7 +1141,7 @@ var BubbleListItems_default = ({ avatar = true }) => {
1143
1141
  /* @__PURE__ */ jsxRuntime.jsx(
1144
1142
  x.Welcome,
1145
1143
  {
1146
- className: classNames5__default.default(styles_module_default.chatWelcome, "p-t-32"),
1144
+ className: classNames6__default.default(styles_module_default.chatWelcome, "p-t-32"),
1147
1145
  variant: "borderless",
1148
1146
  icon: /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { shape: "square", size: 58, src: agentState.active.iconUrl }),
1149
1147
  title: `\u4F60\u597D\uFF0C\u6211\u662F${agentState.active.name || ""}`,
@@ -1161,7 +1159,7 @@ var BubbleListItems_default = ({ avatar = true }) => {
1161
1159
  label: "\u{1F914} \u63A8\u8350\u95EE\u9898:",
1162
1160
  children: agentState.active.recommendQuestions.map(({ question, id }) => ({
1163
1161
  key: id,
1164
- description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.sendMessage(question), className: classNames5__default.default(styles_module_default.chatWelcomePrompts, "text-ellipsis"), children: question })
1162
+ description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.sendMessage(question), className: classNames6__default.default(styles_module_default.chatWelcomePrompts, "text-ellipsis"), children: question })
1165
1163
  }))
1166
1164
  }
1167
1165
  ]
@@ -1260,7 +1258,7 @@ var BubbleListItems_default = ({ avatar = true }) => {
1260
1258
  {
1261
1259
  ref: listRef,
1262
1260
  items: bubbleListItems,
1263
- className: classNames5__default.default(styles_module_default.nsBubbleList, "height-full", "scroll-fade-in")
1261
+ className: classNames6__default.default(styles_module_default.nsBubbleList, "height-full", "scroll-fade-in")
1264
1262
  },
1265
1263
  conversationState.active.key
1266
1264
  );
@@ -1515,11 +1513,10 @@ var ChatSender_default = react.forwardRef(
1515
1513
 
1516
1514
  // src/ui/common/ChatSender.tsx
1517
1515
  init_Context();
1518
- var ChatSender_default2 = () => {
1516
+ var ChatSender_default2 = ({ placeholder, extraBtn = false, referencesBtn = false }) => {
1519
1517
  const chatStore = useChatStore();
1520
1518
  const agentState = valtio.useSnapshot(chatStore.agent);
1521
1519
  const conversationState = valtio.useSnapshot(chatStore.conversation);
1522
- const configState = valtio.useSnapshot(chatStore.config);
1523
1520
  const chatMessage = react.useMemo(
1524
1521
  () => conversationState.messages[conversationState.active.key] || {},
1525
1522
  [conversationState.messages[conversationState.active.key]]
@@ -1534,7 +1531,7 @@ var ChatSender_default2 = () => {
1534
1531
  return /* @__PURE__ */ jsxRuntime.jsx(
1535
1532
  ChatSender_default,
1536
1533
  {
1537
- placeholder: configState.layout.sender?.props?.placeholder,
1534
+ placeholder,
1538
1535
  content: chatMessage.content,
1539
1536
  fileList: chatMessage.files,
1540
1537
  headerOpen: chatMessage.headerOpen,
@@ -1559,7 +1556,7 @@ var ChatSender_default2 = () => {
1559
1556
  children: "\u6DF1\u5EA6\u601D\u8003"
1560
1557
  }
1561
1558
  ),
1562
- /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.senderExtraBtn })
1559
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: extraBtn })
1563
1560
  ] }),
1564
1561
  extraHeader: /* @__PURE__ */ jsxRuntime.jsx(
1565
1562
  x.Sender.Header,
@@ -1572,12 +1569,12 @@ var ChatSender_default2 = () => {
1572
1569
  onOpenChange: () => chatStore.setReferences(),
1573
1570
  classNames: {
1574
1571
  header: styles_module_default.nsSenderReferenceHeaderTitle,
1575
- content: common.shouldRender(configState.layout.referencesBtn) ? "" : styles_module_default.nsSenderReferenceHeaderContent
1572
+ content: common.shouldRender(referencesBtn) ? "" : styles_module_default.nsSenderReferenceHeaderContent
1576
1573
  },
1577
1574
  children: /* @__PURE__ */ jsxRuntime.jsx(
1578
1575
  common.RenderWrapper,
1579
1576
  {
1580
- control: configState.layout.referencesBtn,
1577
+ control: referencesBtn,
1581
1578
  DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, children: ["\u6DF1\u5EA6\u89E3\u8BFB", "\u6982\u8981\u89E3\u8BFB"].map((con) => /* @__PURE__ */ jsxRuntime.jsxs(antd.Button, { color: "primary", variant: "filled", onClick: () => referenceHandle(con), children: [
1582
1579
  con,
1583
1580
  " \u2192"
@@ -1607,13 +1604,19 @@ var ConversationListHeader_default = () => {
1607
1604
  type: "primary",
1608
1605
  shape: "round",
1609
1606
  onClick: () => chatStore.switchConversation(),
1610
- className: classNames5__default.default("m-t-16"),
1607
+ className: classNames6__default.default("m-t-16"),
1611
1608
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
1612
1609
  children: "\u65B0\u5EFA\u4F1A\u8BDD"
1613
1610
  }
1614
1611
  )
1615
1612
  ] });
1616
1613
  };
1614
+ var ConversationListPanel_default = ({ header }) => {
1615
+ return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames6__default.default("height-full", styles_module_default.conversationListPanel), children: [
1616
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
1617
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}) })
1618
+ ] });
1619
+ };
1617
1620
 
1618
1621
  // src/ui/common/SenderPromptsItems.tsx
1619
1622
  init_Context();
@@ -1640,7 +1643,7 @@ var SenderPromptsItems_default = () => {
1640
1643
  title: /* @__PURE__ */ jsxRuntime.jsx(
1641
1644
  "div",
1642
1645
  {
1643
- className: classNames5__default.default(styles_module_default.senderListTitle, "text-ellipsis"),
1646
+ className: classNames6__default.default(styles_module_default.senderListTitle, "text-ellipsis"),
1644
1647
  children: `${agentState.active.name}\u5F00\u59CB\u5173\u6CE8${question.labelName}\u5185\u5BB9\uFF01`
1645
1648
  }
1646
1649
  ),
@@ -1701,111 +1704,102 @@ var layouts_default = react.forwardRef(({ theme, params, hooks, layout, defaultA
1701
1704
  const hasPreView = react.useMemo(() => {
1702
1705
  return common.shouldRender(configState.layout.preview) && (!!configState.preview.file.fileUrl || !!configState.preview.file.content);
1703
1706
  }, [configState.layout.preview, configState.preview.file]);
1704
- return /* @__PURE__ */ jsxRuntime.jsx(x.XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: agentState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames5__default.default(styles_module_default3.nsChatLayout, "height-full"), children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter, { onResize: setSplitterSizes, children: [
1705
- common.shouldRender(configState.layout.conversationList) && /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { size: 360, collapsible: false, resizable: false, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: "height-full", children: [
1706
- /* @__PURE__ */ jsxRuntime.jsx(
1707
- common.RenderWrapper,
1708
- {
1709
- control: configState.layout.conversationListHeader,
1710
- DefaultComponent: ConversationListHeader_default
1711
- }
1712
- ),
1713
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(
1714
- common.RenderWrapper,
1715
- {
1716
- control: configState.layout.conversationList,
1717
- DefaultComponent: ConversationList_default
1718
- }
1719
- ) })
1720
- ] }) }),
1721
- hasPreView && /* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter.Panel, { collapsible: false, resizable: false, children: [
1722
- configState.preview.file.fileUrl && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: "height-full", children: [
1723
- /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", gap: 16, className: styles_module_default3.nsPreviewHeader, children: [
1724
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsPreviewHeaderTitle, children: configState.preview.file.fileName }),
1725
- /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, justify: "center", align: "center", children: [
1726
- /* @__PURE__ */ jsxRuntime.jsx(
1727
- antd.Button,
1707
+ return /* @__PURE__ */ jsxRuntime.jsx(x.XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: agentState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames6__default.default(styles_module_default3.nsChatLayout, "height-full"), children: [
1708
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: AgentHeader_default }),
1709
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { className: "full-scroll", children: [
1710
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.leftPanel, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) }),
1711
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.conversationList, DefaultComponent: ConversationListPanel_default }),
1712
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter, { onResize: setSplitterSizes, children: [
1713
+ hasPreView && /* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter.Panel, { collapsible: false, resizable: false, children: [
1714
+ configState.preview.file.fileUrl && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: "height-full", children: [
1715
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", gap: 16, className: styles_module_default3.nsPreviewHeader, children: [
1716
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsPreviewHeaderTitle, children: configState.preview.file.fileName }),
1717
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, justify: "center", align: "center", children: [
1718
+ /* @__PURE__ */ jsxRuntime.jsx(
1719
+ antd.Button,
1720
+ {
1721
+ color: "primary",
1722
+ variant: "outlined",
1723
+ onClick: () => common.downloadFile(configState.preview.file.fileUrl, configState.preview.file.fileName),
1724
+ children: "\u4E0B\u8F7D"
1725
+ }
1726
+ ),
1727
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => chatStore.setPreview(), children: "\u5173\u95ED" })
1728
+ ] })
1729
+ ] }),
1730
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(
1731
+ common.FilePreview,
1728
1732
  {
1729
- color: "primary",
1730
- variant: "outlined",
1731
- onClick: () => common.downloadFile(configState.preview.file.fileUrl, configState.preview.file.fileName),
1732
- children: "\u4E0B\u8F7D"
1733
- }
1734
- ),
1735
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => chatStore.setPreview(), children: "\u5173\u95ED" })
1736
- ] })
1737
- ] }),
1738
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(
1739
- common.FilePreview,
1740
- {
1741
- ...configState.preview.file,
1742
- pdfParams: {
1743
- isHasThumbnails: false
1744
- }
1745
- }
1746
- ) })
1747
- ] }),
1748
- configState.preview.file.content && /* @__PURE__ */ jsxRuntime.jsx(
1749
- common.MarkdownEditor,
1750
- {
1751
- value: configState.preview.file.content,
1752
- onQuote: (text) => {
1753
- chatStore.setReferences({
1754
- type: 1,
1755
- content: {
1756
- name: text,
1757
- markdown: text
1758
- },
1759
- params: {
1760
- outline: text
1733
+ ...configState.preview.file,
1734
+ pdfParams: {
1735
+ isHasThumbnails: false
1736
+ }
1761
1737
  }
1762
- });
1763
- },
1764
- extraNav: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Tag, { bordered: false, color: "default", className: "cursor-pointer", onClick: () => chatStore.setPreview(), children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseOutlined, {}) }) })
1765
- }
1766
- )
1767
- ] }),
1768
- /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, resizable: false, size: hasPreView ? 400 : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames5__default.default("height-full"), children: [
1769
- /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.header, DefaultComponent: AgentHeader_default }),
1770
- /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: classNames5__default.default("full-scroll"), children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "center", vertical: true, gap: 24, className: classNames5__default.default("height-full p-t-8 p-b-8", styles_module_default.nsBodyWidth), children: [
1771
- common.shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(
1772
- common.RenderWrapper,
1773
- {
1774
- control: configState.layout.messageList,
1775
- DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(BubbleListItems_default, { avatar: { user: false, assistant: true } })
1776
- }
1777
- ) }),
1778
- /* @__PURE__ */ jsxRuntime.jsx(
1779
- common.RenderWrapper,
1780
- {
1781
- control: configState.layout.senderHeader,
1782
- DefaultComponent: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default3.nsChatSenderHeader, children: [
1783
- "\u6211\u662F ",
1784
- agentState.active.name
1785
- ] })
1786
- }
1787
- ),
1788
- /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 8, children: [
1789
- /* @__PURE__ */ jsxRuntime.jsx(
1790
- common.RenderWrapper,
1791
- {
1792
- control: configState.layout.senderPrompts,
1793
- DefaultComponent: SenderPromptsItems_default
1794
- }
1795
- ),
1796
- /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.sender, DefaultComponent: ChatSender_default2 }),
1797
- /* @__PURE__ */ jsxRuntime.jsx(
1798
- common.RenderWrapper,
1738
+ ) })
1739
+ ] }),
1740
+ configState.preview.file.content && /* @__PURE__ */ jsxRuntime.jsx(
1741
+ common.MarkdownEditor,
1799
1742
  {
1800
- control: configState.layout.disclaimerNotice,
1801
- DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsDisclaimerNotice, children: "\u5185\u5BB9\u7531AI\u751F\u6210\uFF0C\u4EC5\u4F9B\u53C2\u8003\uFF0C\u8BF7\u4ED4\u7EC6\u7504\u522B" })
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
1753
+ }
1754
+ });
1755
+ },
1756
+ extraNav: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Tag, { bordered: false, color: "default", className: "cursor-pointer", onClick: () => chatStore.setPreview(), children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseOutlined, {}) }) })
1802
1757
  }
1803
1758
  )
1804
1759
  ] }),
1805
- /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.senderFooter, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) })
1806
- ] }) })
1807
- ] }) })
1808
- ] }) }) }) }) });
1760
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, resizable: true, size: hasPreView ? 400 : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames6__default.default("height-full"), children: [
1761
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: AgentHeader_default }),
1762
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: classNames6__default.default("full-scroll"), children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "center", vertical: true, gap: 24, className: classNames6__default.default("height-full p-t-8 p-b-8", styles_module_default.nsBodyWidth), children: [
1763
+ common.shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(
1764
+ common.RenderWrapper,
1765
+ {
1766
+ control: configState.layout.messageList,
1767
+ DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(BubbleListItems_default, { avatar: { user: false, assistant: true } })
1768
+ }
1769
+ ) }),
1770
+ /* @__PURE__ */ jsxRuntime.jsx(
1771
+ common.RenderWrapper,
1772
+ {
1773
+ control: configState.layout.senderHeader,
1774
+ DefaultComponent: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default3.nsChatSenderHeader, children: [
1775
+ "\u6211\u662F ",
1776
+ agentState.active.name
1777
+ ] })
1778
+ }
1779
+ ),
1780
+ /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 8, children: [
1781
+ /* @__PURE__ */ jsxRuntime.jsx(
1782
+ common.RenderWrapper,
1783
+ {
1784
+ control: configState.layout.senderPrompts,
1785
+ DefaultComponent: SenderPromptsItems_default
1786
+ }
1787
+ ),
1788
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.sender, DefaultComponent: ChatSender_default2 }),
1789
+ /* @__PURE__ */ jsxRuntime.jsx(
1790
+ common.RenderWrapper,
1791
+ {
1792
+ control: configState.layout.disclaimerNotice,
1793
+ DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsDisclaimerNotice, children: "\u5185\u5BB9\u7531AI\u751F\u6210\uFF0C\u4EC5\u4F9B\u53C2\u8003\uFF0C\u8BF7\u4ED4\u7EC6\u7504\u522B" })
1794
+ }
1795
+ )
1796
+ ] }),
1797
+ /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.senderFooter, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) })
1798
+ ] }) })
1799
+ ] }) })
1800
+ ] })
1801
+ ] })
1802
+ ] }) }) }) });
1809
1803
  });
1810
1804
 
1811
1805
  exports.AgentChat = layouts_default;