@zero-library/chat-agent 2.3.4 → 2.3.5
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 +186 -35
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +29 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +48 -3
- package/dist/index.d.ts +48 -3
- package/dist/index.esm.js +186 -35
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -3,8 +3,8 @@ 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, CloseOutlined, FileSearchOutlined, UserSwitchOutlined, PlusOutlined, CommentOutlined, OpenAIOutlined, CopyOutlined, LikeOutlined, DislikeOutlined, SearchOutlined, PushpinOutlined, EditOutlined, DeleteOutlined, RedoOutlined, SignatureOutlined, PlayCircleOutlined, DotChartOutlined } from '@ant-design/icons';
|
|
7
|
-
import
|
|
6
|
+
import { CloudUploadOutlined, PaperClipOutlined, EnterOutlined, CloseOutlined, FileSearchOutlined, UserSwitchOutlined, PlusOutlined, CommentOutlined, OpenAIOutlined, CopyOutlined, LikeOutlined, DislikeOutlined, SearchOutlined, PushpinOutlined, EditOutlined, DeleteOutlined, StarFilled, StarOutlined, RedoOutlined, SignatureOutlined, PlayCircleOutlined, DotChartOutlined } from '@ant-design/icons';
|
|
7
|
+
import classNames12 from 'classnames';
|
|
8
8
|
import { Attachments, Sender, Suggestion, XProvider, Prompts, Bubble, Conversations, Welcome } from '@ant-design/x';
|
|
9
9
|
import dayjs from 'dayjs';
|
|
10
10
|
import InfiniteScroll from 'react-infinite-scroll-component';
|
|
@@ -303,7 +303,7 @@ var init_Charts = __esm({
|
|
|
303
303
|
);
|
|
304
304
|
Charts_default = ({ data, loading }) => {
|
|
305
305
|
const { type, config } = data;
|
|
306
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
306
|
+
return /* @__PURE__ */ jsx("div", { className: classNames12(styles_module_default.chart, "scroll-fade-in"), children: loading ? (
|
|
307
307
|
// Antd 骨架屏
|
|
308
308
|
/* @__PURE__ */ jsx(Skeleton.Node, { active: true, className: styles_module_default.chartSkeleton, children: /* @__PURE__ */ jsx(DotChartOutlined, { className: styles_module_default.chartSkeletonIcon }) })
|
|
309
309
|
) : /* @__PURE__ */ jsx(
|
|
@@ -365,6 +365,12 @@ var createChatService = (request) => {
|
|
|
365
365
|
const conversationDelete = (conversationId) => {
|
|
366
366
|
return request.delete("/lolr/conversation", { conversationId });
|
|
367
367
|
};
|
|
368
|
+
const conversationFavoritesQuery = (params) => {
|
|
369
|
+
return request.get("/lolr/conversation/favorite", params);
|
|
370
|
+
};
|
|
371
|
+
const conversationFavorite = (conversationId, isFavorite) => {
|
|
372
|
+
return request.put("/lolr/conversation/favorite/status", { conversationId, status: Number(isFavorite) });
|
|
373
|
+
};
|
|
368
374
|
const conversationRecentUpdate = (params) => {
|
|
369
375
|
return request.put("/lolr/conversation/recent", params);
|
|
370
376
|
};
|
|
@@ -432,6 +438,8 @@ var createChatService = (request) => {
|
|
|
432
438
|
conversationsQuery,
|
|
433
439
|
conversationCreate,
|
|
434
440
|
conversationDelete,
|
|
441
|
+
conversationFavoritesQuery,
|
|
442
|
+
conversationFavorite,
|
|
435
443
|
conversationRecentUpdate,
|
|
436
444
|
conversationRecentQuery,
|
|
437
445
|
conversationMessagesQuery,
|
|
@@ -737,7 +745,8 @@ function createChatStore() {
|
|
|
737
745
|
group: (c) => {
|
|
738
746
|
return classifyTime(c.updateTime);
|
|
739
747
|
},
|
|
740
|
-
timestamp: "updateTime"
|
|
748
|
+
timestamp: "updateTime",
|
|
749
|
+
isFavorite: "isFavorite"
|
|
741
750
|
});
|
|
742
751
|
conversations.list.items = items;
|
|
743
752
|
} finally {
|
|
@@ -761,6 +770,48 @@ function createChatStore() {
|
|
|
761
770
|
conversations.delLoading = false;
|
|
762
771
|
}
|
|
763
772
|
};
|
|
773
|
+
const favorite = proxy({
|
|
774
|
+
/** 收藏列表数据 */
|
|
775
|
+
list: {
|
|
776
|
+
items: [],
|
|
777
|
+
/** 分页查询参数 */
|
|
778
|
+
params: {
|
|
779
|
+
pageNo: 1,
|
|
780
|
+
pageSize: 1e3
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
/** 收藏列表的加载状态 */
|
|
784
|
+
loading: false
|
|
785
|
+
});
|
|
786
|
+
const getConversationFavorite = async () => {
|
|
787
|
+
try {
|
|
788
|
+
favorite.loading = true;
|
|
789
|
+
const { data } = await config.services.request.conversationFavoritesQuery({
|
|
790
|
+
targetId: receiver.active.id,
|
|
791
|
+
targetType: receiver.active.type,
|
|
792
|
+
...favorite.list.params
|
|
793
|
+
});
|
|
794
|
+
favorite.list.items = data?.items || [];
|
|
795
|
+
} finally {
|
|
796
|
+
favorite.loading = false;
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
const collectConversation = async (conversationId, isFavorite) => {
|
|
800
|
+
try {
|
|
801
|
+
await config.services.request.conversationFavorite(conversationId, isFavorite);
|
|
802
|
+
if (conversations.list.items.length) {
|
|
803
|
+
const item = conversations.list.items.find((item2) => item2.id === conversationId);
|
|
804
|
+
if (item) {
|
|
805
|
+
item.isFavorite = isFavorite;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
if (!isFavorite && favorite.list.items.length) {
|
|
809
|
+
favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
|
|
810
|
+
}
|
|
811
|
+
message.success(isFavorite ? "\u6536\u85CF\u6210\u529F" : "\u5DF2\u53D6\u6D88\u6536\u85CF");
|
|
812
|
+
} finally {
|
|
813
|
+
}
|
|
814
|
+
};
|
|
764
815
|
const conversation = proxy({
|
|
765
816
|
/** 当前激活的会话信息 */
|
|
766
817
|
active: {
|
|
@@ -1155,6 +1206,12 @@ function createChatStore() {
|
|
|
1155
1206
|
getConversations,
|
|
1156
1207
|
/** 删除会话 */
|
|
1157
1208
|
delConversation,
|
|
1209
|
+
/** 收藏相关状态 */
|
|
1210
|
+
favorite,
|
|
1211
|
+
/** 取消/收藏 */
|
|
1212
|
+
collectConversation,
|
|
1213
|
+
/** 获取收藏的会话列表 */
|
|
1214
|
+
getConversationFavorite,
|
|
1158
1215
|
/** 当前会话状态 */
|
|
1159
1216
|
conversation,
|
|
1160
1217
|
/** 设置说话人类型 */
|
|
@@ -1251,7 +1308,7 @@ var MessageRender_default = ({ message: message2, placement, onFilePreview, cust
|
|
|
1251
1308
|
Bubble,
|
|
1252
1309
|
{
|
|
1253
1310
|
placement,
|
|
1254
|
-
className:
|
|
1311
|
+
className: classNames12({ [styles_module_default2.loadingMessage]: message2.type }),
|
|
1255
1312
|
content: /* @__PURE__ */ jsx(RenderMarkdown, { content: replaceMarkdownTags(msgContent), customComponents: mergedCustomComponents, message: message2 })
|
|
1256
1313
|
}
|
|
1257
1314
|
),
|
|
@@ -1322,10 +1379,15 @@ init_Context();
|
|
|
1322
1379
|
var styles_module_default3 = {
|
|
1323
1380
|
nsConversationListPanel: "styles_module_nsConversationListPanel",
|
|
1324
1381
|
nsConversations: "styles_module_nsConversations",
|
|
1382
|
+
favoriteCard: "styles_module_favoriteCard",
|
|
1383
|
+
favoriteCardActive: "styles_module_favoriteCardActive",
|
|
1384
|
+
favoriteCardTitle: "styles_module_favoriteCardTitle",
|
|
1385
|
+
favoriteCardActions: "styles_module_favoriteCardActions",
|
|
1386
|
+
favoriteCardDate: "styles_module_favoriteCardDate",
|
|
1325
1387
|
nsBubbleList: "styles_module_nsBubbleList",
|
|
1326
1388
|
nsChatHeader: "styles_module_nsChatHeader",
|
|
1327
1389
|
nsChatTitle: "styles_module_nsChatTitle",
|
|
1328
|
-
|
|
1390
|
+
nsPopover: "styles_module_nsPopover",
|
|
1329
1391
|
chatWelcomeWrap: "styles_module_chatWelcomeWrap",
|
|
1330
1392
|
chatWelcome: "styles_module_chatWelcome",
|
|
1331
1393
|
chatWelcomePrompts: "styles_module_chatWelcomePrompts",
|
|
@@ -1353,7 +1415,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
|
|
|
1353
1415
|
/* @__PURE__ */ jsx(
|
|
1354
1416
|
Welcome,
|
|
1355
1417
|
{
|
|
1356
|
-
className:
|
|
1418
|
+
className: classNames12(styles_module_default3.chatWelcome, "p-t-32"),
|
|
1357
1419
|
variant: "borderless",
|
|
1358
1420
|
icon: /* @__PURE__ */ jsx(RenderWrapper, { control: icon, DefaultComponent: /* @__PURE__ */ jsx(Avatar, { shape: "square", size: 58, src: receiverState.active.logo }) }),
|
|
1359
1421
|
title: /* @__PURE__ */ jsx(RenderWrapper, { control: title, DefaultComponent: `\u4F60\u597D\uFF0C\u6211\u662F${receiverState.active.name || ""}` }),
|
|
@@ -1382,7 +1444,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
|
|
|
1382
1444
|
label: "\u{1F914} \u63A8\u8350\u95EE\u9898:",
|
|
1383
1445
|
children: receiverState?.recommendQuestions.map((question) => ({
|
|
1384
1446
|
key: question,
|
|
1385
|
-
description: /* @__PURE__ */ jsx("span", { className:
|
|
1447
|
+
description: /* @__PURE__ */ jsx("span", { className: classNames12(styles_module_default3.chatWelcomePrompts, "text-ellipsis"), children: question })
|
|
1386
1448
|
}))
|
|
1387
1449
|
}
|
|
1388
1450
|
]
|
|
@@ -1620,7 +1682,7 @@ var BubbleListItems_default = ({
|
|
|
1620
1682
|
autoScroll: false,
|
|
1621
1683
|
ref: listRef,
|
|
1622
1684
|
items: bubbleListItems,
|
|
1623
|
-
className:
|
|
1685
|
+
className: classNames12(styles_module_default3.nsBubbleList, "height-full", "scroll-fade-in", "zero-chat-bubbles"),
|
|
1624
1686
|
onScroll: handleScroll
|
|
1625
1687
|
},
|
|
1626
1688
|
conversationState.active.id
|
|
@@ -1655,7 +1717,7 @@ var CharacterList_default = () => {
|
|
|
1655
1717
|
/* @__PURE__ */ jsx(
|
|
1656
1718
|
Avatar,
|
|
1657
1719
|
{
|
|
1658
|
-
className:
|
|
1720
|
+
className: classNames12(styles_module_default3.nsAvatarListItemIcon, "cursor-pointer", {
|
|
1659
1721
|
[styles_module_default3.nsAvatarListItemIconActive]: activeCharacter.id === item.id
|
|
1660
1722
|
}),
|
|
1661
1723
|
size: 50,
|
|
@@ -1682,6 +1744,73 @@ var AgentCharacter_default = () => {
|
|
|
1682
1744
|
] });
|
|
1683
1745
|
};
|
|
1684
1746
|
|
|
1747
|
+
// src/ui/common/ConversationFavoritesList.tsx
|
|
1748
|
+
init_Context();
|
|
1749
|
+
var ConversationFavoritesList_default = () => {
|
|
1750
|
+
const chatStore = useChatStore();
|
|
1751
|
+
const conversationState = useSnapshot(chatStore.conversation);
|
|
1752
|
+
const favoriteState = useSnapshot(chatStore.favorite);
|
|
1753
|
+
const getFavoriteList = useDebounce(() => {
|
|
1754
|
+
chatStore.getConversationFavorite();
|
|
1755
|
+
}, 300);
|
|
1756
|
+
const renderFavoriteList = useMemo(() => {
|
|
1757
|
+
return /* @__PURE__ */ jsx("div", { className: classNames12("height-full", "scroll-fade-in"), children: favoriteState.list.items.length ? favoriteState.list.items.map((item) => /* @__PURE__ */ jsxs(
|
|
1758
|
+
"div",
|
|
1759
|
+
{
|
|
1760
|
+
className: classNames12(styles_module_default3.favoriteCard, { [styles_module_default3.favoriteCardActive]: conversationState.active.id === item.id }),
|
|
1761
|
+
onClick: () => chatStore.switchConversation(item.id),
|
|
1762
|
+
children: [
|
|
1763
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 8, align: "center", children: [
|
|
1764
|
+
/* @__PURE__ */ jsx(Flex, { flex: 1, className: classNames12(styles_module_default3.favoriteCardTitle, "text-ellipsis"), children: item.title }),
|
|
1765
|
+
/* @__PURE__ */ jsx(Flex, { gap: 8, align: "center", className: styles_module_default3.favoriteCardActions, children: /* @__PURE__ */ jsx(
|
|
1766
|
+
Popconfirm,
|
|
1767
|
+
{
|
|
1768
|
+
title: "\u63D0\u793A",
|
|
1769
|
+
okText: "\u786E\u5B9A",
|
|
1770
|
+
cancelText: "\u53D6\u6D88",
|
|
1771
|
+
description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
|
|
1772
|
+
onConfirm: (e) => {
|
|
1773
|
+
e.stopPropagation();
|
|
1774
|
+
chatStore.collectConversation(item.id, false);
|
|
1775
|
+
},
|
|
1776
|
+
children: /* @__PURE__ */ jsx(
|
|
1777
|
+
Button,
|
|
1778
|
+
{
|
|
1779
|
+
icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
|
|
1780
|
+
title: "\u5220\u9664",
|
|
1781
|
+
type: "text",
|
|
1782
|
+
onClick: (e) => {
|
|
1783
|
+
e.stopPropagation();
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
}
|
|
1788
|
+
) })
|
|
1789
|
+
] }),
|
|
1790
|
+
/* @__PURE__ */ jsx("div", { className: styles_module_default3.favoriteCardDate, children: item.favoriteTime })
|
|
1791
|
+
]
|
|
1792
|
+
},
|
|
1793
|
+
item.id
|
|
1794
|
+
)) : /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u6536\u85CF", image: Empty.PRESENTED_IMAGE_SIMPLE }) });
|
|
1795
|
+
}, [favoriteState.list.items, conversationState.active.id]);
|
|
1796
|
+
const handlePopoverVisibleChange = (visible) => {
|
|
1797
|
+
if (!visible) return;
|
|
1798
|
+
getFavoriteList();
|
|
1799
|
+
};
|
|
1800
|
+
return /* @__PURE__ */ jsx(
|
|
1801
|
+
Popover,
|
|
1802
|
+
{
|
|
1803
|
+
classNames: { body: styles_module_default3.nsPopover },
|
|
1804
|
+
getPopupContainer: (e) => e,
|
|
1805
|
+
placement: "bottom",
|
|
1806
|
+
content: renderFavoriteList,
|
|
1807
|
+
trigger: ["click"],
|
|
1808
|
+
onOpenChange: handlePopoverVisibleChange,
|
|
1809
|
+
children: /* @__PURE__ */ jsx(Button, { title: "\u6536\u85CF\u5939", type: "text", size: "large", icon: /* @__PURE__ */ jsx(StarOutlined, {}) })
|
|
1810
|
+
}
|
|
1811
|
+
);
|
|
1812
|
+
};
|
|
1813
|
+
|
|
1685
1814
|
// src/ui/common/ConversationList.tsx
|
|
1686
1815
|
init_Context();
|
|
1687
1816
|
var ConversationList_default = () => {
|
|
@@ -1690,7 +1819,7 @@ var ConversationList_default = () => {
|
|
|
1690
1819
|
const conversationsState = useSnapshot(chatStore.conversations);
|
|
1691
1820
|
const conversationState = useSnapshot(chatStore.conversation);
|
|
1692
1821
|
const getConversations = useDebounce(() => {
|
|
1693
|
-
chatStore.getConversations(receiverState.active.id,
|
|
1822
|
+
chatStore.getConversations(receiverState.active.id, receiverState.active.type);
|
|
1694
1823
|
}, 300);
|
|
1695
1824
|
useEffect(() => {
|
|
1696
1825
|
if (receiverState.active.id) {
|
|
@@ -1721,6 +1850,11 @@ var ConversationList_default = () => {
|
|
|
1721
1850
|
groupable: true,
|
|
1722
1851
|
menu: (conversation) => ({
|
|
1723
1852
|
items: [
|
|
1853
|
+
{
|
|
1854
|
+
label: `${conversation.isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF"}`,
|
|
1855
|
+
key: "collect",
|
|
1856
|
+
icon: conversation?.isFavorite ? /* @__PURE__ */ jsx(StarFilled, { className: "primary-text" }) : /* @__PURE__ */ jsx(StarOutlined, {})
|
|
1857
|
+
},
|
|
1724
1858
|
{
|
|
1725
1859
|
label: "\u5220\u9664\u4F1A\u8BDD",
|
|
1726
1860
|
key: "delete",
|
|
@@ -1732,6 +1866,8 @@ var ConversationList_default = () => {
|
|
|
1732
1866
|
menuInfo.domEvent.stopPropagation();
|
|
1733
1867
|
if (menuInfo.key === "delete") {
|
|
1734
1868
|
chatStore.delConversation(conversation.id);
|
|
1869
|
+
} else if (menuInfo.key === "collect") {
|
|
1870
|
+
chatStore.collectConversation(conversation.id, !conversation.isFavorite);
|
|
1735
1871
|
}
|
|
1736
1872
|
}
|
|
1737
1873
|
})
|
|
@@ -1746,12 +1882,13 @@ var ChatHeader_default = ({
|
|
|
1746
1882
|
closeBtn = false,
|
|
1747
1883
|
newConversationBtn = true,
|
|
1748
1884
|
agentCharacter = true,
|
|
1749
|
-
conversationListBtn = true
|
|
1885
|
+
conversationListBtn = true,
|
|
1886
|
+
conversationListFavoriteBtn = true
|
|
1750
1887
|
}) => {
|
|
1751
1888
|
const chatStore = useChatStore();
|
|
1752
1889
|
const receiverState = useSnapshot(chatStore.receiver);
|
|
1753
1890
|
const configState = useSnapshot(chatStore.config);
|
|
1754
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Flex, { justify: "space-between", align: "center", className:
|
|
1891
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Flex, { justify: "space-between", align: "center", className: classNames12(styles_module_default3.nsChatHeader, "zero-chat-header"), children: [
|
|
1755
1892
|
/* @__PURE__ */ jsxs(Flex, { gap: 4, align: "center", children: [
|
|
1756
1893
|
/* @__PURE__ */ jsx(RenderWrapper, { control: avatar, DefaultComponent: /* @__PURE__ */ jsx(Avatar, { size: 22, src: receiverState.active.logo, alt: receiverState.active.name }) }),
|
|
1757
1894
|
/* @__PURE__ */ jsx(RenderWrapper, { control: title, DefaultComponent: /* @__PURE__ */ jsx("div", { className: styles_module_default3.nsChatTitle, children: receiverState.active.name }) }),
|
|
@@ -1775,7 +1912,7 @@ var ChatHeader_default = ({
|
|
|
1775
1912
|
{
|
|
1776
1913
|
getPopupContainer: (e) => e,
|
|
1777
1914
|
placement: "bottom",
|
|
1778
|
-
classNames: { body: styles_module_default3.
|
|
1915
|
+
classNames: { body: styles_module_default3.nsPopover },
|
|
1779
1916
|
content: /* @__PURE__ */ jsx(ConversationList_default, {}),
|
|
1780
1917
|
trigger: ["click"],
|
|
1781
1918
|
children: /* @__PURE__ */ jsx(Button, { title: "\u5386\u53F2\u4F1A\u8BDD", type: "text", size: "large", icon: /* @__PURE__ */ jsx(CommentOutlined, {}) })
|
|
@@ -1783,6 +1920,7 @@ var ChatHeader_default = ({
|
|
|
1783
1920
|
)
|
|
1784
1921
|
}
|
|
1785
1922
|
),
|
|
1923
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: conversationListFavoriteBtn, DefaultComponent: /* @__PURE__ */ jsx(ConversationFavoritesList_default, {}) }),
|
|
1786
1924
|
/* @__PURE__ */ jsx(
|
|
1787
1925
|
RenderWrapper,
|
|
1788
1926
|
{
|
|
@@ -2245,7 +2383,7 @@ var QuickAskPanel_default = () => {
|
|
|
2245
2383
|
}
|
|
2246
2384
|
) : /* @__PURE__ */ jsx(Button, { icon: /* @__PURE__ */ jsx(SearchOutlined, {}), onClick: () => setSearchExpanded(true) })
|
|
2247
2385
|
] }),
|
|
2248
|
-
/* @__PURE__ */ jsxs(Flex, { align: "center", className:
|
|
2386
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", className: classNames12("scroll-fade-in", "m-b-16", styles_module_default4.tagContainer), children: [
|
|
2249
2387
|
/* @__PURE__ */ jsx(
|
|
2250
2388
|
Tag,
|
|
2251
2389
|
{
|
|
@@ -2286,7 +2424,7 @@ var QuickAskPanel_default = () => {
|
|
|
2286
2424
|
},
|
|
2287
2425
|
children: [
|
|
2288
2426
|
/* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "space-between", align: "center", className: styles_module_default4.quickAskItemHeader, children: [
|
|
2289
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
2427
|
+
/* @__PURE__ */ jsx("div", { className: classNames12("flex-1 text-ellipsis", styles_module_default4.quickAskItemTitle), children: item.title }),
|
|
2290
2428
|
/* @__PURE__ */ jsxs(Space, { size: 4, className: styles_module_default4.quickAskItemHeaderActions, children: [
|
|
2291
2429
|
/* @__PURE__ */ jsx(
|
|
2292
2430
|
Button,
|
|
@@ -2353,7 +2491,7 @@ var QuickAskPanel_default = () => {
|
|
|
2353
2491
|
)
|
|
2354
2492
|
] })
|
|
2355
2493
|
] }),
|
|
2356
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
2494
|
+
/* @__PURE__ */ jsx("div", { className: classNames12(styles_module_default4.quickAskItemBody), children: /* @__PURE__ */ jsx("div", { className: "text-ellipsis-3", children: item.content }) })
|
|
2357
2495
|
]
|
|
2358
2496
|
},
|
|
2359
2497
|
item.id
|
|
@@ -2450,7 +2588,7 @@ var SenderPromptsItems_default = () => {
|
|
|
2450
2588
|
title: /* @__PURE__ */ jsx(
|
|
2451
2589
|
"div",
|
|
2452
2590
|
{
|
|
2453
|
-
className:
|
|
2591
|
+
className: classNames12(styles_module_default3.nsSenderListTitle, "text-ellipsis"),
|
|
2454
2592
|
children: `${receiverState.active.name}\u5F00\u59CB\u5173\u6CE8${question.name}\u5185\u5BB9\uFF01`
|
|
2455
2593
|
}
|
|
2456
2594
|
),
|
|
@@ -2544,30 +2682,43 @@ var ChatSender_default2 = forwardRef(
|
|
|
2544
2682
|
|
|
2545
2683
|
// src/ui/common/ConversationListHeader.tsx
|
|
2546
2684
|
init_Context();
|
|
2547
|
-
var ConversationListHeader_default = () => {
|
|
2685
|
+
var ConversationListHeader_default = ({ title = true, avatar = true, newConversationBtn = true, conversationListFavoriteBtn = true }) => {
|
|
2548
2686
|
const chatStore = useChatStore();
|
|
2549
2687
|
const receiverState = useSnapshot(chatStore.receiver);
|
|
2550
2688
|
return /* @__PURE__ */ jsxs("div", { className: "p-24", children: [
|
|
2551
2689
|
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: 8, children: [
|
|
2552
|
-
/* @__PURE__ */ jsx(Avatar, { size: 36, src: receiverState.active.logo }),
|
|
2553
|
-
/* @__PURE__ */ jsx(
|
|
2690
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: avatar, DefaultComponent: /* @__PURE__ */ jsx(Avatar, { size: 36, src: receiverState.active.logo }) }),
|
|
2691
|
+
/* @__PURE__ */ jsx(
|
|
2692
|
+
RenderWrapper,
|
|
2693
|
+
{
|
|
2694
|
+
control: title,
|
|
2695
|
+
DefaultComponent: /* @__PURE__ */ jsx("span", { className: classNames12(styles_module_default3.nsChatUserName, "flex-1 text-ellipsis"), children: receiverState.active.name })
|
|
2696
|
+
}
|
|
2697
|
+
),
|
|
2698
|
+
/* @__PURE__ */ jsx(RenderWrapper, { control: conversationListFavoriteBtn, DefaultComponent: /* @__PURE__ */ jsx(ConversationFavoritesList_default, {}) })
|
|
2554
2699
|
] }),
|
|
2555
2700
|
/* @__PURE__ */ jsx(
|
|
2556
|
-
|
|
2701
|
+
RenderWrapper,
|
|
2557
2702
|
{
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2703
|
+
control: newConversationBtn,
|
|
2704
|
+
DefaultComponent: /* @__PURE__ */ jsx(
|
|
2705
|
+
Button,
|
|
2706
|
+
{
|
|
2707
|
+
block: true,
|
|
2708
|
+
type: "primary",
|
|
2709
|
+
shape: "round",
|
|
2710
|
+
onClick: () => chatStore.createConversation(),
|
|
2711
|
+
className: classNames12("m-t-16"),
|
|
2712
|
+
icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
|
|
2713
|
+
children: "\u65B0\u5EFA\u4F1A\u8BDD"
|
|
2714
|
+
}
|
|
2715
|
+
)
|
|
2565
2716
|
}
|
|
2566
2717
|
)
|
|
2567
2718
|
] });
|
|
2568
2719
|
};
|
|
2569
2720
|
var ConversationListPanel_default = ({ header }) => {
|
|
2570
|
-
return /* @__PURE__ */ jsxs(Flex, { vertical: true, className:
|
|
2721
|
+
return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames12("height-full", "zero-chat-conversations", styles_module_default3.nsConversationListPanel), children: [
|
|
2571
2722
|
/* @__PURE__ */ jsx(RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
|
|
2572
2723
|
/* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(ConversationList_default, {}) })
|
|
2573
2724
|
] });
|
|
@@ -2661,7 +2812,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
2661
2812
|
useEffect(() => {
|
|
2662
2813
|
configState.hooks?.onBeforeInit?.();
|
|
2663
2814
|
}, []);
|
|
2664
|
-
return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: receiverState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className:
|
|
2815
|
+
return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: receiverState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames12(styles_module_default5.nsChatLayout, "zero-chat-layout", "height-full"), children: [
|
|
2665
2816
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
|
|
2666
2817
|
/* @__PURE__ */ jsxs(Flex, { className: "full-scroll", children: [
|
|
2667
2818
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.leftPanel }),
|
|
@@ -2670,7 +2821,7 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
2670
2821
|
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: hasPreView && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2671
2822
|
configState.preview.file.fileUrl && /* @__PURE__ */ jsxs(Flex, { vertical: true, className: "height-full", children: [
|
|
2672
2823
|
/* @__PURE__ */ jsxs(Flex, { justify: "space-between", align: "center", gap: 16, className: styles_module_default5.nsPreviewHeader, children: [
|
|
2673
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
2824
|
+
/* @__PURE__ */ jsx("div", { className: classNames12(styles_module_default5.nsPreviewHeaderTitle, "text-ellipsis"), title: configState.preview.file.fileName, children: configState.preview.file.fileName }),
|
|
2674
2825
|
/* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "center", align: "center", children: [
|
|
2675
2826
|
/* @__PURE__ */ jsx(
|
|
2676
2827
|
Button,
|
|
@@ -2714,15 +2865,15 @@ var layouts_default = forwardRef(({ theme, params, userInfo, hooks, layout, conf
|
|
|
2714
2865
|
}
|
|
2715
2866
|
)
|
|
2716
2867
|
] }) }),
|
|
2717
|
-
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className:
|
|
2868
|
+
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames12("height-full"), children: [
|
|
2718
2869
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
|
|
2719
|
-
/* @__PURE__ */ jsx(Flex, { vertical: true, className:
|
|
2870
|
+
/* @__PURE__ */ jsx(Flex, { vertical: true, className: classNames12("full-scroll"), children: /* @__PURE__ */ jsxs(
|
|
2720
2871
|
Flex,
|
|
2721
2872
|
{
|
|
2722
2873
|
justify: "center",
|
|
2723
2874
|
vertical: true,
|
|
2724
2875
|
gap: 24,
|
|
2725
|
-
className:
|
|
2876
|
+
className: classNames12("height-full", styles_module_default5.nsChatBody, "zero-chat-body", styles_module_default5.nsBodyWidth),
|
|
2726
2877
|
children: [
|
|
2727
2878
|
shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
|
|
2728
2879
|
/* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 8, children: [
|