@zero-library/chat-agent 2.3.4 → 2.3.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.cjs.js +220 -115
- 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 -5
- package/dist/index.d.ts +48 -5
- package/dist/index.esm.js +222 -117
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -373,6 +373,12 @@ var createChatService = (request) => {
|
|
|
373
373
|
const conversationDelete = (conversationId) => {
|
|
374
374
|
return request.delete("/lolr/conversation", { conversationId });
|
|
375
375
|
};
|
|
376
|
+
const conversationFavoritesQuery = (params) => {
|
|
377
|
+
return request.get("/lolr/conversation/favorite", params);
|
|
378
|
+
};
|
|
379
|
+
const conversationFavorite = (conversationId, isFavorite) => {
|
|
380
|
+
return request.put("/lolr/conversation/favorite/status", { conversationId, status: Number(isFavorite) });
|
|
381
|
+
};
|
|
376
382
|
const conversationRecentUpdate = (params) => {
|
|
377
383
|
return request.put("/lolr/conversation/recent", params);
|
|
378
384
|
};
|
|
@@ -440,6 +446,8 @@ var createChatService = (request) => {
|
|
|
440
446
|
conversationsQuery,
|
|
441
447
|
conversationCreate,
|
|
442
448
|
conversationDelete,
|
|
449
|
+
conversationFavoritesQuery,
|
|
450
|
+
conversationFavorite,
|
|
443
451
|
conversationRecentUpdate,
|
|
444
452
|
conversationRecentQuery,
|
|
445
453
|
conversationMessagesQuery,
|
|
@@ -745,7 +753,8 @@ function createChatStore() {
|
|
|
745
753
|
group: (c) => {
|
|
746
754
|
return classifyTime(c.updateTime);
|
|
747
755
|
},
|
|
748
|
-
timestamp: "updateTime"
|
|
756
|
+
timestamp: "updateTime",
|
|
757
|
+
isFavorite: "isFavorite"
|
|
749
758
|
});
|
|
750
759
|
conversations.list.items = items;
|
|
751
760
|
} finally {
|
|
@@ -769,6 +778,48 @@ function createChatStore() {
|
|
|
769
778
|
conversations.delLoading = false;
|
|
770
779
|
}
|
|
771
780
|
};
|
|
781
|
+
const favorite = valtio.proxy({
|
|
782
|
+
/** 收藏列表数据 */
|
|
783
|
+
list: {
|
|
784
|
+
items: [],
|
|
785
|
+
/** 分页查询参数 */
|
|
786
|
+
params: {
|
|
787
|
+
pageNo: 1,
|
|
788
|
+
pageSize: 1e3
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
/** 收藏列表的加载状态 */
|
|
792
|
+
loading: false
|
|
793
|
+
});
|
|
794
|
+
const getConversationFavorite = async () => {
|
|
795
|
+
try {
|
|
796
|
+
favorite.loading = true;
|
|
797
|
+
const { data } = await config.services.request.conversationFavoritesQuery({
|
|
798
|
+
targetId: receiver.active.id,
|
|
799
|
+
targetType: receiver.active.type,
|
|
800
|
+
...favorite.list.params
|
|
801
|
+
});
|
|
802
|
+
favorite.list.items = data?.items || [];
|
|
803
|
+
} finally {
|
|
804
|
+
favorite.loading = false;
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
const collectConversation = async (conversationId, isFavorite) => {
|
|
808
|
+
try {
|
|
809
|
+
await config.services.request.conversationFavorite(conversationId, isFavorite);
|
|
810
|
+
if (conversations.list.items.length) {
|
|
811
|
+
const item = conversations.list.items.find((item2) => item2.id === conversationId);
|
|
812
|
+
if (item) {
|
|
813
|
+
item.isFavorite = isFavorite;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
if (!isFavorite && favorite.list.items.length) {
|
|
817
|
+
favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
|
|
818
|
+
}
|
|
819
|
+
antd.message.success(isFavorite ? "\u6536\u85CF\u6210\u529F" : "\u5DF2\u53D6\u6D88\u6536\u85CF");
|
|
820
|
+
} finally {
|
|
821
|
+
}
|
|
822
|
+
};
|
|
772
823
|
const conversation = valtio.proxy({
|
|
773
824
|
/** 当前激活的会话信息 */
|
|
774
825
|
active: {
|
|
@@ -1163,6 +1214,12 @@ function createChatStore() {
|
|
|
1163
1214
|
getConversations,
|
|
1164
1215
|
/** 删除会话 */
|
|
1165
1216
|
delConversation,
|
|
1217
|
+
/** 收藏相关状态 */
|
|
1218
|
+
favorite,
|
|
1219
|
+
/** 取消/收藏 */
|
|
1220
|
+
collectConversation,
|
|
1221
|
+
/** 获取收藏的会话列表 */
|
|
1222
|
+
getConversationFavorite,
|
|
1166
1223
|
/** 当前会话状态 */
|
|
1167
1224
|
conversation,
|
|
1168
1225
|
/** 设置说话人类型 */
|
|
@@ -1330,17 +1387,18 @@ init_Context();
|
|
|
1330
1387
|
var styles_module_default3 = {
|
|
1331
1388
|
nsConversationListPanel: "styles_module_nsConversationListPanel",
|
|
1332
1389
|
nsConversations: "styles_module_nsConversations",
|
|
1390
|
+
favoriteCard: "styles_module_favoriteCard",
|
|
1391
|
+
favoriteCardActive: "styles_module_favoriteCardActive",
|
|
1392
|
+
favoriteCardTitle: "styles_module_favoriteCardTitle",
|
|
1393
|
+
favoriteCardActions: "styles_module_favoriteCardActions",
|
|
1394
|
+
favoriteCardDate: "styles_module_favoriteCardDate",
|
|
1333
1395
|
nsBubbleList: "styles_module_nsBubbleList",
|
|
1334
1396
|
nsChatHeader: "styles_module_nsChatHeader",
|
|
1335
1397
|
nsChatTitle: "styles_module_nsChatTitle",
|
|
1336
|
-
|
|
1398
|
+
nsPopover: "styles_module_nsPopover",
|
|
1337
1399
|
chatWelcomeWrap: "styles_module_chatWelcomeWrap",
|
|
1338
1400
|
chatWelcome: "styles_module_chatWelcome",
|
|
1339
1401
|
chatWelcomePrompts: "styles_module_chatWelcomePrompts",
|
|
1340
|
-
nsSenderListTitle: "styles_module_nsSenderListTitle",
|
|
1341
|
-
nsSenderList: "styles_module_nsSenderList",
|
|
1342
|
-
nsSenderListItem: "styles_module_nsSenderListItem",
|
|
1343
|
-
nsSenderListFooter: "styles_module_nsSenderListFooter",
|
|
1344
1402
|
nsChatUserName: "styles_module_nsChatUserName",
|
|
1345
1403
|
nsSenderReferenceHeaderTitle: "styles_module_nsSenderReferenceHeaderTitle",
|
|
1346
1404
|
nsSenderReferenceHeaderContent: "styles_module_nsSenderReferenceHeaderContent",
|
|
@@ -1690,6 +1748,73 @@ var AgentCharacter_default = () => {
|
|
|
1690
1748
|
] });
|
|
1691
1749
|
};
|
|
1692
1750
|
|
|
1751
|
+
// src/ui/common/ConversationFavoritesList.tsx
|
|
1752
|
+
init_Context();
|
|
1753
|
+
var ConversationFavoritesList_default = () => {
|
|
1754
|
+
const chatStore = useChatStore();
|
|
1755
|
+
const conversationState = valtio.useSnapshot(chatStore.conversation);
|
|
1756
|
+
const favoriteState = valtio.useSnapshot(chatStore.favorite);
|
|
1757
|
+
const getFavoriteList = common.useDebounce(() => {
|
|
1758
|
+
chatStore.getConversationFavorite();
|
|
1759
|
+
}, 300);
|
|
1760
|
+
const renderFavoriteList = react.useMemo(() => {
|
|
1761
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames11__default.default("height-full", "scroll-fade-in"), children: favoriteState.list.items.length ? favoriteState.list.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1762
|
+
"div",
|
|
1763
|
+
{
|
|
1764
|
+
className: classNames11__default.default(styles_module_default3.favoriteCard, { [styles_module_default3.favoriteCardActive]: conversationState.active.id === item.id }),
|
|
1765
|
+
onClick: () => chatStore.switchConversation(item.id),
|
|
1766
|
+
children: [
|
|
1767
|
+
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, align: "center", children: [
|
|
1768
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { flex: 1, className: classNames11__default.default(styles_module_default3.favoriteCardTitle, "text-ellipsis"), children: item.title }),
|
|
1769
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, align: "center", className: styles_module_default3.favoriteCardActions, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1770
|
+
antd.Popconfirm,
|
|
1771
|
+
{
|
|
1772
|
+
title: "\u63D0\u793A",
|
|
1773
|
+
okText: "\u786E\u5B9A",
|
|
1774
|
+
cancelText: "\u53D6\u6D88",
|
|
1775
|
+
description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
|
|
1776
|
+
onConfirm: (e) => {
|
|
1777
|
+
e.stopPropagation();
|
|
1778
|
+
chatStore.collectConversation(item.id, false);
|
|
1779
|
+
},
|
|
1780
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1781
|
+
antd.Button,
|
|
1782
|
+
{
|
|
1783
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
1784
|
+
title: "\u5220\u9664",
|
|
1785
|
+
type: "text",
|
|
1786
|
+
onClick: (e) => {
|
|
1787
|
+
e.stopPropagation();
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
)
|
|
1791
|
+
}
|
|
1792
|
+
) })
|
|
1793
|
+
] }),
|
|
1794
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.favoriteCardDate, children: item.favoriteTime })
|
|
1795
|
+
]
|
|
1796
|
+
},
|
|
1797
|
+
item.id
|
|
1798
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u6536\u85CF", image: antd.Empty.PRESENTED_IMAGE_SIMPLE }) });
|
|
1799
|
+
}, [favoriteState.list.items, conversationState.active.id]);
|
|
1800
|
+
const handlePopoverVisibleChange = (visible) => {
|
|
1801
|
+
if (!visible) return;
|
|
1802
|
+
getFavoriteList();
|
|
1803
|
+
};
|
|
1804
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1805
|
+
antd.Popover,
|
|
1806
|
+
{
|
|
1807
|
+
classNames: { body: styles_module_default3.nsPopover },
|
|
1808
|
+
getPopupContainer: (e) => e,
|
|
1809
|
+
placement: "bottom",
|
|
1810
|
+
content: renderFavoriteList,
|
|
1811
|
+
trigger: ["click"],
|
|
1812
|
+
onOpenChange: handlePopoverVisibleChange,
|
|
1813
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u6536\u85CF\u5939", type: "text", size: "large", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.StarOutlined, {}) })
|
|
1814
|
+
}
|
|
1815
|
+
);
|
|
1816
|
+
};
|
|
1817
|
+
|
|
1693
1818
|
// src/ui/common/ConversationList.tsx
|
|
1694
1819
|
init_Context();
|
|
1695
1820
|
var ConversationList_default = () => {
|
|
@@ -1698,7 +1823,7 @@ var ConversationList_default = () => {
|
|
|
1698
1823
|
const conversationsState = valtio.useSnapshot(chatStore.conversations);
|
|
1699
1824
|
const conversationState = valtio.useSnapshot(chatStore.conversation);
|
|
1700
1825
|
const getConversations = common.useDebounce(() => {
|
|
1701
|
-
chatStore.getConversations(receiverState.active.id,
|
|
1826
|
+
chatStore.getConversations(receiverState.active.id, receiverState.active.type);
|
|
1702
1827
|
}, 300);
|
|
1703
1828
|
react.useEffect(() => {
|
|
1704
1829
|
if (receiverState.active.id) {
|
|
@@ -1729,6 +1854,11 @@ var ConversationList_default = () => {
|
|
|
1729
1854
|
groupable: true,
|
|
1730
1855
|
menu: (conversation) => ({
|
|
1731
1856
|
items: [
|
|
1857
|
+
{
|
|
1858
|
+
label: `${conversation.isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF"}`,
|
|
1859
|
+
key: "collect",
|
|
1860
|
+
icon: conversation?.isFavorite ? /* @__PURE__ */ jsxRuntime.jsx(icons.StarFilled, { className: "primary-text" }) : /* @__PURE__ */ jsxRuntime.jsx(icons.StarOutlined, {})
|
|
1861
|
+
},
|
|
1732
1862
|
{
|
|
1733
1863
|
label: "\u5220\u9664\u4F1A\u8BDD",
|
|
1734
1864
|
key: "delete",
|
|
@@ -1740,6 +1870,8 @@ var ConversationList_default = () => {
|
|
|
1740
1870
|
menuInfo.domEvent.stopPropagation();
|
|
1741
1871
|
if (menuInfo.key === "delete") {
|
|
1742
1872
|
chatStore.delConversation(conversation.id);
|
|
1873
|
+
} else if (menuInfo.key === "collect") {
|
|
1874
|
+
chatStore.collectConversation(conversation.id, !conversation.isFavorite);
|
|
1743
1875
|
}
|
|
1744
1876
|
}
|
|
1745
1877
|
})
|
|
@@ -1754,7 +1886,8 @@ var ChatHeader_default = ({
|
|
|
1754
1886
|
closeBtn = false,
|
|
1755
1887
|
newConversationBtn = true,
|
|
1756
1888
|
agentCharacter = true,
|
|
1757
|
-
conversationListBtn = true
|
|
1889
|
+
conversationListBtn = true,
|
|
1890
|
+
conversationListFavoriteBtn = true
|
|
1758
1891
|
}) => {
|
|
1759
1892
|
const chatStore = useChatStore();
|
|
1760
1893
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
@@ -1783,7 +1916,7 @@ var ChatHeader_default = ({
|
|
|
1783
1916
|
{
|
|
1784
1917
|
getPopupContainer: (e) => e,
|
|
1785
1918
|
placement: "bottom",
|
|
1786
|
-
classNames: { body: styles_module_default3.
|
|
1919
|
+
classNames: { body: styles_module_default3.nsPopover },
|
|
1787
1920
|
content: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}),
|
|
1788
1921
|
trigger: ["click"],
|
|
1789
1922
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u5386\u53F2\u4F1A\u8BDD", type: "text", size: "large", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CommentOutlined, {}) })
|
|
@@ -1791,6 +1924,7 @@ var ChatHeader_default = ({
|
|
|
1791
1924
|
)
|
|
1792
1925
|
}
|
|
1793
1926
|
),
|
|
1927
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: conversationListFavoriteBtn, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(ConversationFavoritesList_default, {}) }),
|
|
1794
1928
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1795
1929
|
common.RenderWrapper,
|
|
1796
1930
|
{
|
|
@@ -2432,47 +2566,8 @@ var FeaturesRenderer_default = () => {
|
|
|
2432
2566
|
)
|
|
2433
2567
|
] });
|
|
2434
2568
|
};
|
|
2435
|
-
|
|
2436
|
-
// src/ui/common/SenderPromptsItems.tsx
|
|
2437
|
-
init_Context();
|
|
2438
|
-
var SenderPromptsItems_default = () => {
|
|
2439
|
-
const chatStore = useChatStore();
|
|
2440
|
-
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
2441
|
-
const component = react.useMemo(
|
|
2442
|
-
() => receiverState.active.config?.labels?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, wrap: true, children: [
|
|
2443
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { disabled: true, color: "default", variant: "text", children: "\u968F\u4FBF\u804A\u804A" }),
|
|
2444
|
-
receiverState.active.config.labels.slice(0, 6).map((question) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2445
|
-
antd.Popover,
|
|
2446
|
-
{
|
|
2447
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2448
|
-
antd.List,
|
|
2449
|
-
{
|
|
2450
|
-
itemLayout: "horizontal",
|
|
2451
|
-
split: false,
|
|
2452
|
-
className: styles_module_default3.nsSenderList,
|
|
2453
|
-
dataSource: question.items,
|
|
2454
|
-
renderItem: (item) => /* @__PURE__ */ jsxRuntime.jsx(antd.List.Item, { onClick: () => chatStore.sendMessage(item.question), className: styles_module_default3.nsSenderListItem, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-ellipsis", children: item.question }) }),
|
|
2455
|
-
footer: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "end", className: styles_module_default3.nsSenderListFooter, children: "(\u60A8\u53EF\u70B9\u51FB\u4EE5\u4E0A\u95EE\u9898\u5F00\u542FAI\u4F53\u9A8C)" })
|
|
2456
|
-
}
|
|
2457
|
-
),
|
|
2458
|
-
title: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2459
|
-
"div",
|
|
2460
|
-
{
|
|
2461
|
-
className: classNames11__default.default(styles_module_default3.nsSenderListTitle, "text-ellipsis"),
|
|
2462
|
-
children: `${receiverState.active.name}\u5F00\u59CB\u5173\u6CE8${question.name}\u5185\u5BB9\uFF01`
|
|
2463
|
-
}
|
|
2464
|
-
),
|
|
2465
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { color: "default", variant: "filled", children: question.name })
|
|
2466
|
-
},
|
|
2467
|
-
question.id
|
|
2468
|
-
))
|
|
2469
|
-
] }),
|
|
2470
|
-
[receiverState.active.config?.labels]
|
|
2471
|
-
);
|
|
2472
|
-
return component;
|
|
2473
|
-
};
|
|
2474
2569
|
var ChatSender_default2 = react.forwardRef(
|
|
2475
|
-
({ placeholder, extraBtn = false, referencesBtn = false, sendBtnProps, footerBelow = false
|
|
2570
|
+
({ placeholder, extraBtn = false, referencesBtn = false, sendBtnProps, footerBelow = false }, ref) => {
|
|
2476
2571
|
const chatStore = useChatStore();
|
|
2477
2572
|
const configState = valtio.useSnapshot(chatStore.config);
|
|
2478
2573
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
@@ -2492,84 +2587,94 @@ var ChatSender_default2 = react.forwardRef(
|
|
|
2492
2587
|
chatStore.setContent(con);
|
|
2493
2588
|
chatStore.sendMessage();
|
|
2494
2589
|
};
|
|
2495
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
{
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
}
|
|
2548
|
-
)
|
|
2549
|
-
] });
|
|
2590
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, gap: 8, className: "zero-chat-sender", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2591
|
+
ChatSender_default,
|
|
2592
|
+
{
|
|
2593
|
+
ref,
|
|
2594
|
+
placeholder,
|
|
2595
|
+
content: chatMessage.content,
|
|
2596
|
+
fileList: chatMessage.files,
|
|
2597
|
+
headerOpen: chatMessage.headerOpen,
|
|
2598
|
+
loading: chatMessage.loading,
|
|
2599
|
+
onContentChange: chatStore.setContent,
|
|
2600
|
+
onFileListChange: chatStore.setFileList,
|
|
2601
|
+
onHeaderOpenChange: chatStore.setHeaderOpen,
|
|
2602
|
+
onSend: () => chatStore.sendMessage(),
|
|
2603
|
+
onCancel: chatStore.cancelReceive,
|
|
2604
|
+
onFocus: chatStore.config.hooks?.onSenderFocus,
|
|
2605
|
+
fileUpload: {
|
|
2606
|
+
request: configState.services.request?.fileUpload,
|
|
2607
|
+
config: receiverState.active.config?.fileUpload
|
|
2608
|
+
},
|
|
2609
|
+
sendBtnProps: common.isFunction(sendBtnProps) ? sendBtnProps() : {},
|
|
2610
|
+
extraFooterBelow: /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: footerBelow }),
|
|
2611
|
+
extraFooter: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2612
|
+
/* @__PURE__ */ jsxRuntime.jsx(FeaturesRenderer_default, {}),
|
|
2613
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: extraBtn })
|
|
2614
|
+
] }),
|
|
2615
|
+
extraHeader: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2616
|
+
x.Sender.Header,
|
|
2617
|
+
{
|
|
2618
|
+
title: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, children: [
|
|
2619
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.EnterOutlined, {}),
|
|
2620
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Typography.Text, { type: "secondary", ellipsis: true, children: referenceContent })
|
|
2621
|
+
] }),
|
|
2622
|
+
open: !!referenceContent,
|
|
2623
|
+
onOpenChange: () => chatStore.setReferences(),
|
|
2624
|
+
classNames: {
|
|
2625
|
+
header: styles_module_default3.nsSenderReferenceHeaderTitle,
|
|
2626
|
+
content: common.shouldRender(referencesBtn) ? "" : styles_module_default3.nsSenderReferenceHeaderContent
|
|
2627
|
+
},
|
|
2628
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2629
|
+
common.RenderWrapper,
|
|
2630
|
+
{
|
|
2631
|
+
control: referencesBtn,
|
|
2632
|
+
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: [
|
|
2633
|
+
con,
|
|
2634
|
+
" \u2192"
|
|
2635
|
+
] }, con)) })
|
|
2636
|
+
}
|
|
2637
|
+
)
|
|
2638
|
+
}
|
|
2639
|
+
)
|
|
2640
|
+
}
|
|
2641
|
+
) });
|
|
2550
2642
|
}
|
|
2551
2643
|
);
|
|
2552
2644
|
|
|
2553
2645
|
// src/ui/common/ConversationListHeader.tsx
|
|
2554
2646
|
init_Context();
|
|
2555
|
-
var ConversationListHeader_default = () => {
|
|
2647
|
+
var ConversationListHeader_default = ({ title = true, avatar = true, newConversationBtn = true, conversationListFavoriteBtn = true }) => {
|
|
2556
2648
|
const chatStore = useChatStore();
|
|
2557
2649
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
2558
2650
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-24", children: [
|
|
2559
2651
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", gap: 8, children: [
|
|
2560
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { size: 36, src: receiverState.active.logo }),
|
|
2561
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2652
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: avatar, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { size: 36, src: receiverState.active.logo }) }),
|
|
2653
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2654
|
+
common.RenderWrapper,
|
|
2655
|
+
{
|
|
2656
|
+
control: title,
|
|
2657
|
+
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx("span", { className: classNames11__default.default(styles_module_default3.nsChatUserName, "flex-1 text-ellipsis"), children: receiverState.active.name })
|
|
2658
|
+
}
|
|
2659
|
+
),
|
|
2660
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: conversationListFavoriteBtn, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(ConversationFavoritesList_default, {}) })
|
|
2562
2661
|
] }),
|
|
2563
2662
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2564
|
-
|
|
2663
|
+
common.RenderWrapper,
|
|
2565
2664
|
{
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2665
|
+
control: newConversationBtn,
|
|
2666
|
+
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2667
|
+
antd.Button,
|
|
2668
|
+
{
|
|
2669
|
+
block: true,
|
|
2670
|
+
type: "primary",
|
|
2671
|
+
shape: "round",
|
|
2672
|
+
onClick: () => chatStore.createConversation(),
|
|
2673
|
+
className: classNames11__default.default("m-t-16"),
|
|
2674
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
2675
|
+
children: "\u65B0\u5EFA\u4F1A\u8BDD"
|
|
2676
|
+
}
|
|
2677
|
+
)
|
|
2573
2678
|
}
|
|
2574
2679
|
)
|
|
2575
2680
|
] });
|