@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.cjs.js
CHANGED
|
@@ -6,14 +6,14 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var valtio = require('valtio');
|
|
8
8
|
var icons = require('@ant-design/icons');
|
|
9
|
-
var
|
|
9
|
+
var classNames12 = require('classnames');
|
|
10
10
|
var x = require('@ant-design/x');
|
|
11
11
|
var dayjs = require('dayjs');
|
|
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
|
-
var
|
|
16
|
+
var classNames12__default = /*#__PURE__*/_interopDefault(classNames12);
|
|
17
17
|
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
18
18
|
var InfiniteScroll__default = /*#__PURE__*/_interopDefault(InfiniteScroll);
|
|
19
19
|
|
|
@@ -311,7 +311,7 @@ var init_Charts = __esm({
|
|
|
311
311
|
);
|
|
312
312
|
Charts_default = ({ data, loading }) => {
|
|
313
313
|
const { type, config } = data;
|
|
314
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
314
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames12__default.default(styles_module_default.chart, "scroll-fade-in"), children: loading ? (
|
|
315
315
|
// Antd 骨架屏
|
|
316
316
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Node, { active: true, className: styles_module_default.chartSkeleton, children: /* @__PURE__ */ jsxRuntime.jsx(icons.DotChartOutlined, { className: styles_module_default.chartSkeletonIcon }) })
|
|
317
317
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -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
|
/** 设置说话人类型 */
|
|
@@ -1259,7 +1316,7 @@ var MessageRender_default = ({ message: message2, placement, onFilePreview, cust
|
|
|
1259
1316
|
x.Bubble,
|
|
1260
1317
|
{
|
|
1261
1318
|
placement,
|
|
1262
|
-
className:
|
|
1319
|
+
className: classNames12__default.default({ [styles_module_default2.loadingMessage]: message2.type }),
|
|
1263
1320
|
content: /* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content: replaceMarkdownTags(msgContent), customComponents: mergedCustomComponents, message: message2 })
|
|
1264
1321
|
}
|
|
1265
1322
|
),
|
|
@@ -1330,10 +1387,15 @@ 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",
|
|
@@ -1361,7 +1423,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
|
|
|
1361
1423
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1362
1424
|
x.Welcome,
|
|
1363
1425
|
{
|
|
1364
|
-
className:
|
|
1426
|
+
className: classNames12__default.default(styles_module_default3.chatWelcome, "p-t-32"),
|
|
1365
1427
|
variant: "borderless",
|
|
1366
1428
|
icon: /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: icon, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { shape: "square", size: 58, src: receiverState.active.logo }) }),
|
|
1367
1429
|
title: /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: title, DefaultComponent: `\u4F60\u597D\uFF0C\u6211\u662F${receiverState.active.name || ""}` }),
|
|
@@ -1390,7 +1452,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
|
|
|
1390
1452
|
label: "\u{1F914} \u63A8\u8350\u95EE\u9898:",
|
|
1391
1453
|
children: receiverState?.recommendQuestions.map((question) => ({
|
|
1392
1454
|
key: question,
|
|
1393
|
-
description: /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1455
|
+
description: /* @__PURE__ */ jsxRuntime.jsx("span", { className: classNames12__default.default(styles_module_default3.chatWelcomePrompts, "text-ellipsis"), children: question })
|
|
1394
1456
|
}))
|
|
1395
1457
|
}
|
|
1396
1458
|
]
|
|
@@ -1628,7 +1690,7 @@ var BubbleListItems_default = ({
|
|
|
1628
1690
|
autoScroll: false,
|
|
1629
1691
|
ref: listRef,
|
|
1630
1692
|
items: bubbleListItems,
|
|
1631
|
-
className:
|
|
1693
|
+
className: classNames12__default.default(styles_module_default3.nsBubbleList, "height-full", "scroll-fade-in", "zero-chat-bubbles"),
|
|
1632
1694
|
onScroll: handleScroll
|
|
1633
1695
|
},
|
|
1634
1696
|
conversationState.active.id
|
|
@@ -1663,7 +1725,7 @@ var CharacterList_default = () => {
|
|
|
1663
1725
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1664
1726
|
antd.Avatar,
|
|
1665
1727
|
{
|
|
1666
|
-
className:
|
|
1728
|
+
className: classNames12__default.default(styles_module_default3.nsAvatarListItemIcon, "cursor-pointer", {
|
|
1667
1729
|
[styles_module_default3.nsAvatarListItemIconActive]: activeCharacter.id === item.id
|
|
1668
1730
|
}),
|
|
1669
1731
|
size: 50,
|
|
@@ -1690,6 +1752,73 @@ var AgentCharacter_default = () => {
|
|
|
1690
1752
|
] });
|
|
1691
1753
|
};
|
|
1692
1754
|
|
|
1755
|
+
// src/ui/common/ConversationFavoritesList.tsx
|
|
1756
|
+
init_Context();
|
|
1757
|
+
var ConversationFavoritesList_default = () => {
|
|
1758
|
+
const chatStore = useChatStore();
|
|
1759
|
+
const conversationState = valtio.useSnapshot(chatStore.conversation);
|
|
1760
|
+
const favoriteState = valtio.useSnapshot(chatStore.favorite);
|
|
1761
|
+
const getFavoriteList = common.useDebounce(() => {
|
|
1762
|
+
chatStore.getConversationFavorite();
|
|
1763
|
+
}, 300);
|
|
1764
|
+
const renderFavoriteList = react.useMemo(() => {
|
|
1765
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames12__default.default("height-full", "scroll-fade-in"), children: favoriteState.list.items.length ? favoriteState.list.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1766
|
+
"div",
|
|
1767
|
+
{
|
|
1768
|
+
className: classNames12__default.default(styles_module_default3.favoriteCard, { [styles_module_default3.favoriteCardActive]: conversationState.active.id === item.id }),
|
|
1769
|
+
onClick: () => chatStore.switchConversation(item.id),
|
|
1770
|
+
children: [
|
|
1771
|
+
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, align: "center", children: [
|
|
1772
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { flex: 1, className: classNames12__default.default(styles_module_default3.favoriteCardTitle, "text-ellipsis"), children: item.title }),
|
|
1773
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, align: "center", className: styles_module_default3.favoriteCardActions, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1774
|
+
antd.Popconfirm,
|
|
1775
|
+
{
|
|
1776
|
+
title: "\u63D0\u793A",
|
|
1777
|
+
okText: "\u786E\u5B9A",
|
|
1778
|
+
cancelText: "\u53D6\u6D88",
|
|
1779
|
+
description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
|
|
1780
|
+
onConfirm: (e) => {
|
|
1781
|
+
e.stopPropagation();
|
|
1782
|
+
chatStore.collectConversation(item.id, false);
|
|
1783
|
+
},
|
|
1784
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1785
|
+
antd.Button,
|
|
1786
|
+
{
|
|
1787
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
1788
|
+
title: "\u5220\u9664",
|
|
1789
|
+
type: "text",
|
|
1790
|
+
onClick: (e) => {
|
|
1791
|
+
e.stopPropagation();
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
)
|
|
1795
|
+
}
|
|
1796
|
+
) })
|
|
1797
|
+
] }),
|
|
1798
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.favoriteCardDate, children: item.favoriteTime })
|
|
1799
|
+
]
|
|
1800
|
+
},
|
|
1801
|
+
item.id
|
|
1802
|
+
)) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u6536\u85CF", image: antd.Empty.PRESENTED_IMAGE_SIMPLE }) });
|
|
1803
|
+
}, [favoriteState.list.items, conversationState.active.id]);
|
|
1804
|
+
const handlePopoverVisibleChange = (visible) => {
|
|
1805
|
+
if (!visible) return;
|
|
1806
|
+
getFavoriteList();
|
|
1807
|
+
};
|
|
1808
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1809
|
+
antd.Popover,
|
|
1810
|
+
{
|
|
1811
|
+
classNames: { body: styles_module_default3.nsPopover },
|
|
1812
|
+
getPopupContainer: (e) => e,
|
|
1813
|
+
placement: "bottom",
|
|
1814
|
+
content: renderFavoriteList,
|
|
1815
|
+
trigger: ["click"],
|
|
1816
|
+
onOpenChange: handlePopoverVisibleChange,
|
|
1817
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u6536\u85CF\u5939", type: "text", size: "large", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.StarOutlined, {}) })
|
|
1818
|
+
}
|
|
1819
|
+
);
|
|
1820
|
+
};
|
|
1821
|
+
|
|
1693
1822
|
// src/ui/common/ConversationList.tsx
|
|
1694
1823
|
init_Context();
|
|
1695
1824
|
var ConversationList_default = () => {
|
|
@@ -1698,7 +1827,7 @@ var ConversationList_default = () => {
|
|
|
1698
1827
|
const conversationsState = valtio.useSnapshot(chatStore.conversations);
|
|
1699
1828
|
const conversationState = valtio.useSnapshot(chatStore.conversation);
|
|
1700
1829
|
const getConversations = common.useDebounce(() => {
|
|
1701
|
-
chatStore.getConversations(receiverState.active.id,
|
|
1830
|
+
chatStore.getConversations(receiverState.active.id, receiverState.active.type);
|
|
1702
1831
|
}, 300);
|
|
1703
1832
|
react.useEffect(() => {
|
|
1704
1833
|
if (receiverState.active.id) {
|
|
@@ -1729,6 +1858,11 @@ var ConversationList_default = () => {
|
|
|
1729
1858
|
groupable: true,
|
|
1730
1859
|
menu: (conversation) => ({
|
|
1731
1860
|
items: [
|
|
1861
|
+
{
|
|
1862
|
+
label: `${conversation.isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF"}`,
|
|
1863
|
+
key: "collect",
|
|
1864
|
+
icon: conversation?.isFavorite ? /* @__PURE__ */ jsxRuntime.jsx(icons.StarFilled, { className: "primary-text" }) : /* @__PURE__ */ jsxRuntime.jsx(icons.StarOutlined, {})
|
|
1865
|
+
},
|
|
1732
1866
|
{
|
|
1733
1867
|
label: "\u5220\u9664\u4F1A\u8BDD",
|
|
1734
1868
|
key: "delete",
|
|
@@ -1740,6 +1874,8 @@ var ConversationList_default = () => {
|
|
|
1740
1874
|
menuInfo.domEvent.stopPropagation();
|
|
1741
1875
|
if (menuInfo.key === "delete") {
|
|
1742
1876
|
chatStore.delConversation(conversation.id);
|
|
1877
|
+
} else if (menuInfo.key === "collect") {
|
|
1878
|
+
chatStore.collectConversation(conversation.id, !conversation.isFavorite);
|
|
1743
1879
|
}
|
|
1744
1880
|
}
|
|
1745
1881
|
})
|
|
@@ -1754,12 +1890,13 @@ var ChatHeader_default = ({
|
|
|
1754
1890
|
closeBtn = false,
|
|
1755
1891
|
newConversationBtn = true,
|
|
1756
1892
|
agentCharacter = true,
|
|
1757
|
-
conversationListBtn = true
|
|
1893
|
+
conversationListBtn = true,
|
|
1894
|
+
conversationListFavoriteBtn = true
|
|
1758
1895
|
}) => {
|
|
1759
1896
|
const chatStore = useChatStore();
|
|
1760
1897
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
1761
1898
|
const configState = valtio.useSnapshot(chatStore.config);
|
|
1762
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", className:
|
|
1899
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", className: classNames12__default.default(styles_module_default3.nsChatHeader, "zero-chat-header"), children: [
|
|
1763
1900
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, align: "center", children: [
|
|
1764
1901
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: avatar, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { size: 22, src: receiverState.active.logo, alt: receiverState.active.name }) }),
|
|
1765
1902
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: title, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsChatTitle, children: receiverState.active.name }) }),
|
|
@@ -1783,7 +1920,7 @@ var ChatHeader_default = ({
|
|
|
1783
1920
|
{
|
|
1784
1921
|
getPopupContainer: (e) => e,
|
|
1785
1922
|
placement: "bottom",
|
|
1786
|
-
classNames: { body: styles_module_default3.
|
|
1923
|
+
classNames: { body: styles_module_default3.nsPopover },
|
|
1787
1924
|
content: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}),
|
|
1788
1925
|
trigger: ["click"],
|
|
1789
1926
|
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u5386\u53F2\u4F1A\u8BDD", type: "text", size: "large", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CommentOutlined, {}) })
|
|
@@ -1791,6 +1928,7 @@ var ChatHeader_default = ({
|
|
|
1791
1928
|
)
|
|
1792
1929
|
}
|
|
1793
1930
|
),
|
|
1931
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: conversationListFavoriteBtn, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(ConversationFavoritesList_default, {}) }),
|
|
1794
1932
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1795
1933
|
common.RenderWrapper,
|
|
1796
1934
|
{
|
|
@@ -2253,7 +2391,7 @@ var QuickAskPanel_default = () => {
|
|
|
2253
2391
|
}
|
|
2254
2392
|
) : /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SearchOutlined, {}), onClick: () => setSearchExpanded(true) })
|
|
2255
2393
|
] }),
|
|
2256
|
-
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", className:
|
|
2394
|
+
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", className: classNames12__default.default("scroll-fade-in", "m-b-16", styles_module_default4.tagContainer), children: [
|
|
2257
2395
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2258
2396
|
antd.Tag,
|
|
2259
2397
|
{
|
|
@@ -2294,7 +2432,7 @@ var QuickAskPanel_default = () => {
|
|
|
2294
2432
|
},
|
|
2295
2433
|
children: [
|
|
2296
2434
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, justify: "space-between", align: "center", className: styles_module_default4.quickAskItemHeader, children: [
|
|
2297
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2435
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames12__default.default("flex-1 text-ellipsis", styles_module_default4.quickAskItemTitle), children: item.title }),
|
|
2298
2436
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { size: 4, className: styles_module_default4.quickAskItemHeaderActions, children: [
|
|
2299
2437
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2300
2438
|
antd.Button,
|
|
@@ -2361,7 +2499,7 @@ var QuickAskPanel_default = () => {
|
|
|
2361
2499
|
)
|
|
2362
2500
|
] })
|
|
2363
2501
|
] }),
|
|
2364
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2502
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames12__default.default(styles_module_default4.quickAskItemBody), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-ellipsis-3", children: item.content }) })
|
|
2365
2503
|
]
|
|
2366
2504
|
},
|
|
2367
2505
|
item.id
|
|
@@ -2458,7 +2596,7 @@ var SenderPromptsItems_default = () => {
|
|
|
2458
2596
|
title: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2459
2597
|
"div",
|
|
2460
2598
|
{
|
|
2461
|
-
className:
|
|
2599
|
+
className: classNames12__default.default(styles_module_default3.nsSenderListTitle, "text-ellipsis"),
|
|
2462
2600
|
children: `${receiverState.active.name}\u5F00\u59CB\u5173\u6CE8${question.name}\u5185\u5BB9\uFF01`
|
|
2463
2601
|
}
|
|
2464
2602
|
),
|
|
@@ -2552,30 +2690,43 @@ var ChatSender_default2 = react.forwardRef(
|
|
|
2552
2690
|
|
|
2553
2691
|
// src/ui/common/ConversationListHeader.tsx
|
|
2554
2692
|
init_Context();
|
|
2555
|
-
var ConversationListHeader_default = () => {
|
|
2693
|
+
var ConversationListHeader_default = ({ title = true, avatar = true, newConversationBtn = true, conversationListFavoriteBtn = true }) => {
|
|
2556
2694
|
const chatStore = useChatStore();
|
|
2557
2695
|
const receiverState = valtio.useSnapshot(chatStore.receiver);
|
|
2558
2696
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-24", children: [
|
|
2559
2697
|
/* @__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(
|
|
2698
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: avatar, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(antd.Avatar, { size: 36, src: receiverState.active.logo }) }),
|
|
2699
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2700
|
+
common.RenderWrapper,
|
|
2701
|
+
{
|
|
2702
|
+
control: title,
|
|
2703
|
+
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx("span", { className: classNames12__default.default(styles_module_default3.nsChatUserName, "flex-1 text-ellipsis"), children: receiverState.active.name })
|
|
2704
|
+
}
|
|
2705
|
+
),
|
|
2706
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: conversationListFavoriteBtn, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(ConversationFavoritesList_default, {}) })
|
|
2562
2707
|
] }),
|
|
2563
2708
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2564
|
-
|
|
2709
|
+
common.RenderWrapper,
|
|
2565
2710
|
{
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2711
|
+
control: newConversationBtn,
|
|
2712
|
+
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2713
|
+
antd.Button,
|
|
2714
|
+
{
|
|
2715
|
+
block: true,
|
|
2716
|
+
type: "primary",
|
|
2717
|
+
shape: "round",
|
|
2718
|
+
onClick: () => chatStore.createConversation(),
|
|
2719
|
+
className: classNames12__default.default("m-t-16"),
|
|
2720
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
2721
|
+
children: "\u65B0\u5EFA\u4F1A\u8BDD"
|
|
2722
|
+
}
|
|
2723
|
+
)
|
|
2573
2724
|
}
|
|
2574
2725
|
)
|
|
2575
2726
|
] });
|
|
2576
2727
|
};
|
|
2577
2728
|
var ConversationListPanel_default = ({ header }) => {
|
|
2578
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
2729
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames12__default.default("height-full", "zero-chat-conversations", styles_module_default3.nsConversationListPanel), children: [
|
|
2579
2730
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
|
|
2580
2731
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}) })
|
|
2581
2732
|
] });
|
|
@@ -2669,7 +2820,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
2669
2820
|
react.useEffect(() => {
|
|
2670
2821
|
configState.hooks?.onBeforeInit?.();
|
|
2671
2822
|
}, []);
|
|
2672
|
-
return /* @__PURE__ */ jsxRuntime.jsx(x.XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: receiverState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
2823
|
+
return /* @__PURE__ */ jsxRuntime.jsx(x.XProvider, { theme: { cssVar: true, ...theme }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: receiverState.loading, wrapperClassName: "full-spin", children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames12__default.default(styles_module_default5.nsChatLayout, "zero-chat-layout", "height-full"), children: [
|
|
2673
2824
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
|
|
2674
2825
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { className: "full-scroll", children: [
|
|
2675
2826
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.leftPanel }),
|
|
@@ -2678,7 +2829,7 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
2678
2829
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: hasPreView && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2679
2830
|
configState.preview.file.fileUrl && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: "height-full", children: [
|
|
2680
2831
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", gap: 16, className: styles_module_default5.nsPreviewHeader, children: [
|
|
2681
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2832
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames12__default.default(styles_module_default5.nsPreviewHeaderTitle, "text-ellipsis"), title: configState.preview.file.fileName, children: configState.preview.file.fileName }),
|
|
2682
2833
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, justify: "center", align: "center", children: [
|
|
2683
2834
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2684
2835
|
antd.Button,
|
|
@@ -2722,15 +2873,15 @@ var layouts_default = react.forwardRef(({ theme, params, userInfo, hooks, layout
|
|
|
2722
2873
|
}
|
|
2723
2874
|
)
|
|
2724
2875
|
] }) }),
|
|
2725
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
2876
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames12__default.default("height-full"), children: [
|
|
2726
2877
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
|
|
2727
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className:
|
|
2878
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: classNames12__default.default("full-scroll"), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2728
2879
|
antd.Flex,
|
|
2729
2880
|
{
|
|
2730
2881
|
justify: "center",
|
|
2731
2882
|
vertical: true,
|
|
2732
2883
|
gap: 24,
|
|
2733
|
-
className:
|
|
2884
|
+
className: classNames12__default.default("height-full", styles_module_default5.nsChatBody, "zero-chat-body", styles_module_default5.nsBodyWidth),
|
|
2734
2885
|
children: [
|
|
2735
2886
|
common.shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
|
|
2736
2887
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 8, children: [
|