@zero-library/chat-copilot 3.1.14 → 3.1.15
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 +195 -138
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +316 -232
- package/dist/index.css.map +1 -1
- package/dist/index.esm.js +195 -139
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -19,7 +19,8 @@ var LexicalTypeaheadMenuPlugin = require('@lexical/react/LexicalTypeaheadMenuPlu
|
|
|
19
19
|
var utils = require('@lexical/utils');
|
|
20
20
|
var ReactDOM = require('react-dom');
|
|
21
21
|
var dayjs = require('dayjs');
|
|
22
|
-
var
|
|
22
|
+
var classNames2 = require('classnames');
|
|
23
|
+
var console2 = require('console');
|
|
23
24
|
var InfiniteScroll = require('react-infinite-scroll-component');
|
|
24
25
|
var xCard = require('@ant-design/x-card');
|
|
25
26
|
require('@ant-design/x-markdown/themes/light.css');
|
|
@@ -49,7 +50,8 @@ function _interopNamespace(e) {
|
|
|
49
50
|
var React10__namespace = /*#__PURE__*/_interopNamespace(React10);
|
|
50
51
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
51
52
|
var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
|
|
52
|
-
var
|
|
53
|
+
var classNames2__default = /*#__PURE__*/_interopDefault(classNames2);
|
|
54
|
+
var console2__default = /*#__PURE__*/_interopDefault(console2);
|
|
53
55
|
var InfiniteScroll__default = /*#__PURE__*/_interopDefault(InfiniteScroll);
|
|
54
56
|
var XMarkdown__default = /*#__PURE__*/_interopDefault(XMarkdown);
|
|
55
57
|
var Latex__default = /*#__PURE__*/_interopDefault(Latex);
|
|
@@ -1257,6 +1259,7 @@ function createChatStore() {
|
|
|
1257
1259
|
await config.services.request.deleteConversation(conversationId);
|
|
1258
1260
|
antd.message.success("\u5220\u9664\u6210\u529F");
|
|
1259
1261
|
conversations.list.items = conversations.list.items.filter((item) => item.key !== conversationId);
|
|
1262
|
+
favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
|
|
1260
1263
|
delete conversation.messages[conversationId];
|
|
1261
1264
|
if (conversation.active.id === conversationId) {
|
|
1262
1265
|
createConversation();
|
|
@@ -1302,6 +1305,7 @@ function createChatStore() {
|
|
|
1302
1305
|
id: "id",
|
|
1303
1306
|
label: "title",
|
|
1304
1307
|
spec: "spec",
|
|
1308
|
+
isFavorite: "isFavorite",
|
|
1305
1309
|
group: (c) => {
|
|
1306
1310
|
return classifyTime(c.updatedAt);
|
|
1307
1311
|
}
|
|
@@ -1356,7 +1360,9 @@ function createChatStore() {
|
|
|
1356
1360
|
item.isFavorite = isFavorite;
|
|
1357
1361
|
}
|
|
1358
1362
|
}
|
|
1359
|
-
if (
|
|
1363
|
+
if (isFavorite) {
|
|
1364
|
+
await getConversationFavorite();
|
|
1365
|
+
} else if (favorite.list.items.length) {
|
|
1360
1366
|
favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
|
|
1361
1367
|
}
|
|
1362
1368
|
antd.message.success(isFavorite ? "\u6536\u85CF\u6210\u529F" : "\u5DF2\u53D6\u6D88\u6536\u85CF");
|
|
@@ -2229,109 +2235,34 @@ window._iconfont_svg_string_5021436 = '<svg><symbol id="icon-Ollama" viewBox="0
|
|
|
2229
2235
|
// src/components/IconFont/index.ts
|
|
2230
2236
|
var IconFont = icons.createFromIconfontCN({});
|
|
2231
2237
|
var IconFont_default = IconFont;
|
|
2232
|
-
|
|
2233
|
-
// src/ui/common/FeatureComponents/style.module.less
|
|
2234
|
-
var style_module_default = {
|
|
2235
|
-
popover: "style_module_popover",
|
|
2236
|
-
resourceBtn: "style_module_resourceBtn",
|
|
2237
|
-
divider: "style_module_divider",
|
|
2238
|
-
count: "style_module_count",
|
|
2239
|
-
resourceBtnActive: "style_module_resourceBtnActive",
|
|
2240
|
-
customModal: "style_module_customModal",
|
|
2241
|
-
layout: "style_module_layout",
|
|
2242
|
-
sider: "style_module_sider",
|
|
2243
|
-
categoryName: "style_module_categoryName",
|
|
2244
|
-
siderContent: "style_module_siderContent",
|
|
2245
|
-
categoryItem: "style_module_categoryItem",
|
|
2246
|
-
categoryActive: "style_module_categoryActive",
|
|
2247
|
-
roundCheckbox: "style_module_roundCheckbox",
|
|
2248
|
-
content: "style_module_content",
|
|
2249
|
-
searchInput: "style_module_searchInput",
|
|
2250
|
-
selectedCount: "style_module_selectedCount",
|
|
2251
|
-
tagsArea: "style_module_tagsArea",
|
|
2252
|
-
tagContainer: "style_module_tagContainer",
|
|
2253
|
-
tag: "style_module_tag",
|
|
2254
|
-
expandBtnWrapper: "style_module_expandBtnWrapper",
|
|
2255
|
-
expandBtn: "style_module_expandBtn",
|
|
2256
|
-
tagsExpanded: "style_module_tagsExpanded",
|
|
2257
|
-
listArea: "style_module_listArea",
|
|
2258
|
-
listInner: "style_module_listInner",
|
|
2259
|
-
listItem: "style_module_listItem",
|
|
2260
|
-
listItemSelected: "style_module_listItemSelected",
|
|
2261
|
-
itemIconWrapper: "style_module_itemIconWrapper",
|
|
2262
|
-
itemInfo: "style_module_itemInfo",
|
|
2263
|
-
itemDesc: "style_module_itemDesc",
|
|
2264
|
-
footer: "style_module_footer",
|
|
2265
|
-
titleContainer: "style_module_titleContainer",
|
|
2266
|
-
favoriteCard: "style_module_favoriteCard",
|
|
2267
|
-
favoriteCardActive: "style_module_favoriteCardActive",
|
|
2268
|
-
favoriteCardTitle: "style_module_favoriteCardTitle",
|
|
2269
|
-
favoriteCardActions: "style_module_favoriteCardActions"};
|
|
2270
2238
|
var ConversationFavoritesBtn_default = ({ icon, ...rest }) => {
|
|
2271
2239
|
const chatStore = useChatStore();
|
|
2240
|
+
const conversationsState = valtio.useSnapshot(chatStore.conversations);
|
|
2272
2241
|
const conversationState = valtio.useSnapshot(chatStore.conversation);
|
|
2273
|
-
const
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
const
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
{
|
|
2281
|
-
className: classNames__default.default(style_module_default.favoriteCard, { [style_module_default.favoriteCardActive]: conversationState.active.id === item.id }),
|
|
2282
|
-
onClick: () => chatStore.switchConversation(item.id),
|
|
2283
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, align: "center", children: [
|
|
2284
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { flex: 1, className: classNames__default.default(style_module_default.favoriteCardTitle, "text-ellipsis"), children: item.title }),
|
|
2285
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, align: "center", className: style_module_default.favoriteCardActions, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2286
|
-
antd.Popconfirm,
|
|
2287
|
-
{
|
|
2288
|
-
title: "\u63D0\u793A",
|
|
2289
|
-
okText: "\u786E\u5B9A",
|
|
2290
|
-
cancelText: "\u53D6\u6D88",
|
|
2291
|
-
description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
|
|
2292
|
-
onConfirm: (e) => {
|
|
2293
|
-
e.stopPropagation();
|
|
2294
|
-
chatStore.collectConversation(item.id, false);
|
|
2295
|
-
},
|
|
2296
|
-
onCancel: (e) => e.stopPropagation(),
|
|
2297
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2298
|
-
antd.Button,
|
|
2299
|
-
{
|
|
2300
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
2301
|
-
title: "\u5220\u9664",
|
|
2302
|
-
type: "text",
|
|
2303
|
-
onClick: (e) => {
|
|
2304
|
-
e.stopPropagation();
|
|
2305
|
-
}
|
|
2306
|
-
}
|
|
2307
|
-
)
|
|
2308
|
-
}
|
|
2309
|
-
) })
|
|
2310
|
-
] })
|
|
2311
|
-
},
|
|
2312
|
-
item.id
|
|
2313
|
-
)) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u6536\u85CF", image: antd.Empty.PRESENTED_IMAGE_SIMPLE }) });
|
|
2314
|
-
}, [favoriteState.list.items, conversationState.active.id]);
|
|
2315
|
-
const handlePopoverVisibleChange = (visible) => {
|
|
2316
|
-
if (!visible) return;
|
|
2317
|
-
getFavoriteList();
|
|
2242
|
+
const activeConversation = React10.useMemo(() => {
|
|
2243
|
+
return conversationsState.list.items.find((item) => item.id === conversationState.active.id);
|
|
2244
|
+
}, [conversationsState.list.items, conversationState.active.id]);
|
|
2245
|
+
const isFavorite = Boolean(activeConversation?.isFavorite);
|
|
2246
|
+
const handleToggleFavorite = () => {
|
|
2247
|
+
if (!conversationState.active.id) return;
|
|
2248
|
+
chatStore.collectConversation(conversationState.active.id, !isFavorite);
|
|
2318
2249
|
};
|
|
2319
2250
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2320
|
-
antd.
|
|
2251
|
+
antd.Button,
|
|
2321
2252
|
{
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2253
|
+
title: isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF",
|
|
2254
|
+
type: "text",
|
|
2255
|
+
size: "small",
|
|
2256
|
+
disabled: !conversationState.active.id,
|
|
2257
|
+
icon: icon?.() || (isFavorite ? /* @__PURE__ */ jsxRuntime.jsx(icons.StarFilled, { className: "primary-text" }) : /* @__PURE__ */ jsxRuntime.jsx(icons.StarOutlined, {})),
|
|
2258
|
+
onClick: handleToggleFavorite,
|
|
2259
|
+
...rest
|
|
2329
2260
|
}
|
|
2330
2261
|
);
|
|
2331
2262
|
};
|
|
2332
2263
|
var CreateBtn_default = ({ icon, ...rest }) => {
|
|
2333
2264
|
const chatStore = useChatStore();
|
|
2334
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u65B0\u5EFA\u4F1A\u8BDD", size: "
|
|
2265
|
+
return /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u65B0\u5EFA\u4F1A\u8BDD", size: "small", type: "text", icon: icon?.() || /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}), onClick: () => chatStore.createConversation(), ...rest });
|
|
2335
2266
|
};
|
|
2336
2267
|
|
|
2337
2268
|
// src/ui/common/styles.module.less
|
|
@@ -2344,6 +2275,10 @@ var styles_module_default2 = {
|
|
|
2344
2275
|
conversationListPanel: "styles_module_conversationListPanel",
|
|
2345
2276
|
createConversationButton: "styles_module_createConversationButton",
|
|
2346
2277
|
conversations: "styles_module_conversations",
|
|
2278
|
+
conversationTabs: "styles_module_conversationTabs",
|
|
2279
|
+
conversationTabPane: "styles_module_conversationTabPane",
|
|
2280
|
+
conversationEmpty: "styles_module_conversationEmpty",
|
|
2281
|
+
conversationScrollArea: "styles_module_conversationScrollArea",
|
|
2347
2282
|
chatWelcomeWrap: "styles_module_chatWelcomeWrap",
|
|
2348
2283
|
chatWelcome: "styles_module_chatWelcome",
|
|
2349
2284
|
promptItem: "styles_module_promptItem",
|
|
@@ -2362,12 +2297,30 @@ var styles_module_default2 = {
|
|
|
2362
2297
|
};
|
|
2363
2298
|
var ConversationList_default = () => {
|
|
2364
2299
|
const chatStore = useChatStore();
|
|
2300
|
+
const agentState = valtio.useSnapshot(chatStore.agent);
|
|
2365
2301
|
const conversationsState = valtio.useSnapshot(chatStore.conversations);
|
|
2366
2302
|
const conversationState = valtio.useSnapshot(chatStore.conversation);
|
|
2303
|
+
const favoriteState = valtio.useSnapshot(chatStore.favorite);
|
|
2304
|
+
const [activeTabKey, setActiveTabKey] = React10.useState("history");
|
|
2305
|
+
React10.useEffect(() => {
|
|
2306
|
+
if (!agentState.agentInfo.id) return;
|
|
2307
|
+
chatStore.getConversationFavorite();
|
|
2308
|
+
}, [agentState.agentInfo.id, chatStore]);
|
|
2367
2309
|
const conversationList = React10.useMemo(() => {
|
|
2368
2310
|
return conversationsState.list.items.filter((item) => item.label);
|
|
2369
2311
|
}, [conversationsState.list.items]);
|
|
2370
|
-
const
|
|
2312
|
+
const favoriteConversationList = React10.useMemo(() => {
|
|
2313
|
+
return favoriteState.list.items.filter((item) => item.title).map((item) => ({
|
|
2314
|
+
...item,
|
|
2315
|
+
key: item.id,
|
|
2316
|
+
id: item.id,
|
|
2317
|
+
label: item.title,
|
|
2318
|
+
spec: item.spec,
|
|
2319
|
+
isFavorite: true,
|
|
2320
|
+
group: classifyTime(item.updatedAt)
|
|
2321
|
+
}));
|
|
2322
|
+
}, [favoriteState.list.items]);
|
|
2323
|
+
const historyMenuConfig = (conversation) => ({
|
|
2371
2324
|
items: [
|
|
2372
2325
|
{
|
|
2373
2326
|
label: `${conversation.isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF"}`,
|
|
@@ -2390,31 +2343,135 @@ var ConversationList_default = () => {
|
|
|
2390
2343
|
}
|
|
2391
2344
|
}
|
|
2392
2345
|
});
|
|
2393
|
-
|
|
2394
|
-
|
|
2346
|
+
const favoriteMenuConfig = (conversation) => ({
|
|
2347
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2348
|
+
antd.Popconfirm,
|
|
2349
|
+
{
|
|
2350
|
+
title: "\u63D0\u793A",
|
|
2351
|
+
okText: "\u786E\u5B9A",
|
|
2352
|
+
cancelText: "\u53D6\u6D88",
|
|
2353
|
+
description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
|
|
2354
|
+
onConfirm: (e) => {
|
|
2355
|
+
e.stopPropagation();
|
|
2356
|
+
chatStore.collectConversation(conversation.id, false);
|
|
2357
|
+
},
|
|
2358
|
+
onCancel: (e) => e.stopPropagation(),
|
|
2359
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2360
|
+
antd.Button,
|
|
2361
|
+
{
|
|
2362
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
2363
|
+
title: "\u5220\u9664",
|
|
2364
|
+
type: "text",
|
|
2365
|
+
onClick: (e) => {
|
|
2366
|
+
e.stopPropagation();
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
)
|
|
2370
|
+
}
|
|
2371
|
+
),
|
|
2372
|
+
items: []
|
|
2373
|
+
});
|
|
2374
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default2.conversationTabs, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2375
|
+
antd.Tabs,
|
|
2395
2376
|
{
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2377
|
+
activeKey: activeTabKey,
|
|
2378
|
+
centered: true,
|
|
2379
|
+
onChange: setActiveTabKey,
|
|
2380
|
+
items: [
|
|
2381
|
+
{
|
|
2382
|
+
key: "history",
|
|
2383
|
+
label: "\u5386\u53F2\u4F1A\u8BDD",
|
|
2384
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default2.conversationTabPane, children: conversationList.length ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default2.conversationScrollArea, id: "historyConversationScrollableDiv", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2385
|
+
InfiniteScroll__default.default,
|
|
2386
|
+
{
|
|
2387
|
+
dataLength: conversationList.length,
|
|
2388
|
+
hasMore: false,
|
|
2389
|
+
next: () => {
|
|
2390
|
+
console2__default.default.log("next");
|
|
2391
|
+
},
|
|
2392
|
+
loader: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { indicator: /* @__PURE__ */ jsxRuntime.jsx(icons.RedoOutlined, { spin: true }), size: "small" }) }),
|
|
2393
|
+
style: { overflow: "hidden" },
|
|
2394
|
+
scrollableTarget: "historyConversationScrollableDiv",
|
|
2395
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2396
|
+
xV2.Conversations,
|
|
2397
|
+
{
|
|
2398
|
+
className: styles_module_default2.conversations,
|
|
2399
|
+
items: conversationList,
|
|
2400
|
+
activeKey: conversationState.active.id,
|
|
2401
|
+
onActiveChange: async (id) => chatStore.switchConversation(id),
|
|
2402
|
+
groupable: true,
|
|
2403
|
+
menu: historyMenuConfig
|
|
2404
|
+
}
|
|
2405
|
+
)
|
|
2406
|
+
}
|
|
2407
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default2.conversationEmpty, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u4F1A\u8BDD\u8BB0\u5F55", image: antd.Empty.PRESENTED_IMAGE_SIMPLE }) }) })
|
|
2408
|
+
},
|
|
2406
2409
|
{
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2410
|
+
key: "favorite",
|
|
2411
|
+
label: "\u6536\u85CF\u4F1A\u8BDD",
|
|
2412
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default2.conversationTabPane, children: favoriteConversationList.length ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default2.conversationScrollArea, id: "favoriteConversationScrollableDiv", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2413
|
+
InfiniteScroll__default.default,
|
|
2414
|
+
{
|
|
2415
|
+
dataLength: favoriteConversationList.length,
|
|
2416
|
+
hasMore: false,
|
|
2417
|
+
next: () => {
|
|
2418
|
+
console2__default.default.log("next");
|
|
2419
|
+
},
|
|
2420
|
+
loader: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { indicator: /* @__PURE__ */ jsxRuntime.jsx(icons.RedoOutlined, { spin: true }), size: "small" }) }),
|
|
2421
|
+
style: { overflow: "hidden" },
|
|
2422
|
+
scrollableTarget: "favoriteConversationScrollableDiv",
|
|
2423
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2424
|
+
xV2.Conversations,
|
|
2425
|
+
{
|
|
2426
|
+
className: styles_module_default2.conversations,
|
|
2427
|
+
items: favoriteConversationList,
|
|
2428
|
+
activeKey: conversationState.active.id,
|
|
2429
|
+
onActiveChange: async (id) => chatStore.switchConversation(id),
|
|
2430
|
+
groupable: true,
|
|
2431
|
+
menu: favoriteMenuConfig
|
|
2432
|
+
}
|
|
2433
|
+
)
|
|
2434
|
+
}
|
|
2435
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default2.conversationEmpty, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u6536\u85CF\u4F1A\u8BDD", image: antd.Empty.PRESENTED_IMAGE_SIMPLE }) }) })
|
|
2413
2436
|
}
|
|
2414
|
-
|
|
2437
|
+
]
|
|
2415
2438
|
}
|
|
2416
|
-
)
|
|
2439
|
+
) });
|
|
2417
2440
|
};
|
|
2441
|
+
|
|
2442
|
+
// src/ui/common/FeatureComponents/style.module.less
|
|
2443
|
+
var style_module_default = {
|
|
2444
|
+
popover: "style_module_popover",
|
|
2445
|
+
resourceBtn: "style_module_resourceBtn",
|
|
2446
|
+
divider: "style_module_divider",
|
|
2447
|
+
count: "style_module_count",
|
|
2448
|
+
resourceBtnActive: "style_module_resourceBtnActive",
|
|
2449
|
+
customModal: "style_module_customModal",
|
|
2450
|
+
layout: "style_module_layout",
|
|
2451
|
+
sider: "style_module_sider",
|
|
2452
|
+
categoryName: "style_module_categoryName",
|
|
2453
|
+
siderContent: "style_module_siderContent",
|
|
2454
|
+
categoryItem: "style_module_categoryItem",
|
|
2455
|
+
categoryActive: "style_module_categoryActive",
|
|
2456
|
+
roundCheckbox: "style_module_roundCheckbox",
|
|
2457
|
+
content: "style_module_content",
|
|
2458
|
+
searchInput: "style_module_searchInput",
|
|
2459
|
+
selectedCount: "style_module_selectedCount",
|
|
2460
|
+
tagsArea: "style_module_tagsArea",
|
|
2461
|
+
tagContainer: "style_module_tagContainer",
|
|
2462
|
+
tag: "style_module_tag",
|
|
2463
|
+
expandBtnWrapper: "style_module_expandBtnWrapper",
|
|
2464
|
+
expandBtn: "style_module_expandBtn",
|
|
2465
|
+
tagsExpanded: "style_module_tagsExpanded",
|
|
2466
|
+
listArea: "style_module_listArea",
|
|
2467
|
+
listInner: "style_module_listInner",
|
|
2468
|
+
listItem: "style_module_listItem",
|
|
2469
|
+
listItemSelected: "style_module_listItemSelected",
|
|
2470
|
+
itemIconWrapper: "style_module_itemIconWrapper",
|
|
2471
|
+
itemInfo: "style_module_itemInfo",
|
|
2472
|
+
itemDesc: "style_module_itemDesc",
|
|
2473
|
+
footer: "style_module_footer",
|
|
2474
|
+
titleContainer: "style_module_titleContainer"};
|
|
2418
2475
|
var HistoryBtn_default = ({ icon, ...rest }) => {
|
|
2419
2476
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2420
2477
|
antd.Popover,
|
|
@@ -2424,7 +2481,7 @@ var HistoryBtn_default = ({ icon, ...rest }) => {
|
|
|
2424
2481
|
classNames: { container: style_module_default.popover },
|
|
2425
2482
|
content: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}),
|
|
2426
2483
|
trigger: ["click"],
|
|
2427
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u5386\u53F2\u4F1A\u8BDD", size: "
|
|
2484
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { title: "\u5386\u53F2\u4F1A\u8BDD", size: "small", type: "text", icon: icon?.() || /* @__PURE__ */ jsxRuntime.jsx(icons.CommentOutlined, {}), ...rest })
|
|
2428
2485
|
}
|
|
2429
2486
|
);
|
|
2430
2487
|
};
|
|
@@ -2439,7 +2496,7 @@ var ChatHeader_default = ({
|
|
|
2439
2496
|
const chatStore = useChatStore();
|
|
2440
2497
|
const agentState = valtio.useSnapshot(chatStore.agent);
|
|
2441
2498
|
const configState = valtio.useSnapshot(chatStore.config);
|
|
2442
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2499
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default(styles_module_default2.chatHeader, "zero-chat-header"), children: [
|
|
2443
2500
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default2.chatHeaderContent, children: [
|
|
2444
2501
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2445
2502
|
common.RenderWrapper,
|
|
@@ -2485,8 +2542,8 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
|
|
|
2485
2542
|
{
|
|
2486
2543
|
control: title,
|
|
2487
2544
|
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 4, flex: 1, style: { minWidth: 0 }, children: [
|
|
2488
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text, { strong: true, className:
|
|
2489
|
-
/* @__PURE__ */ jsxRuntime.jsx(Text, { type: "secondary", ellipsis: true, className:
|
|
2545
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { strong: true, className: classNames2__default.default("fz-16"), children: agentState.agentInfo.name }),
|
|
2546
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { type: "secondary", ellipsis: true, className: classNames2__default.default("fz-12"), children: agentState.agentInfo.description })
|
|
2490
2547
|
] }) })
|
|
2491
2548
|
}
|
|
2492
2549
|
)
|
|
@@ -2501,7 +2558,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
|
|
|
2501
2558
|
block: true,
|
|
2502
2559
|
type: "primary",
|
|
2503
2560
|
onClick: () => chatStore.createConversation(),
|
|
2504
|
-
className:
|
|
2561
|
+
className: classNames2__default.default(styles_module_default2.createConversationButton),
|
|
2505
2562
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
2506
2563
|
children: "\u65B0\u5EFA\u4F1A\u8BDD"
|
|
2507
2564
|
}
|
|
@@ -2511,7 +2568,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
|
|
|
2511
2568
|
] });
|
|
2512
2569
|
};
|
|
2513
2570
|
var ConversationListPanel = ({ header }) => {
|
|
2514
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
2571
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames2__default.default("height-full", "zero-chat-conversations", styles_module_default2.conversationListPanel), children: [
|
|
2515
2572
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
|
|
2516
2573
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(ConversationList_default, {}) })
|
|
2517
2574
|
] });
|
|
@@ -2980,7 +3037,7 @@ var CHART_COMPONENTS = Object.fromEntries(
|
|
|
2980
3037
|
);
|
|
2981
3038
|
var Charts_default = ({ data, loading }) => {
|
|
2982
3039
|
const { type, config } = data;
|
|
2983
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
3040
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
|
|
2984
3041
|
// Antd 骨架屏
|
|
2985
3042
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Skeleton.Node, { active: true, className: styles_module_default3.chartSkeleton, children: /* @__PURE__ */ jsxRuntime.jsx(icons.DotChartOutlined, { className: styles_module_default3.chartSkeletonIcon }) })
|
|
2986
3043
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3275,7 +3332,7 @@ var XMarkdown_default = React10.memo(({ message: message3, components = {}, cont
|
|
|
3275
3332
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3276
3333
|
XMarkdown__default.default,
|
|
3277
3334
|
{
|
|
3278
|
-
className:
|
|
3335
|
+
className: classNames2__default.default("x-markdown-light", styles_module_default4.xMarkdownStyle),
|
|
3279
3336
|
config,
|
|
3280
3337
|
...rest,
|
|
3281
3338
|
content: processedContent,
|
|
@@ -3620,7 +3677,7 @@ var Switch = ({ id, label, value, bind_path_token, onChange, onDataChange }) =>
|
|
|
3620
3677
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 13, color: "#555" }, children: label })
|
|
3621
3678
|
] });
|
|
3622
3679
|
};
|
|
3623
|
-
var
|
|
3680
|
+
var Button11 = ({ label, variant = "default", onClick, action, onAction }) => {
|
|
3624
3681
|
const handleClick = () => {
|
|
3625
3682
|
if (onClick) {
|
|
3626
3683
|
onClick();
|
|
@@ -3650,7 +3707,7 @@ var A2uiComponents = {
|
|
|
3650
3707
|
TextField,
|
|
3651
3708
|
Select,
|
|
3652
3709
|
Switch,
|
|
3653
|
-
Button:
|
|
3710
|
+
Button: Button11,
|
|
3654
3711
|
Divider,
|
|
3655
3712
|
Tag: Tag3,
|
|
3656
3713
|
Progress,
|
|
@@ -5340,7 +5397,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
|
|
|
5340
5397
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5341
5398
|
xV2.Welcome,
|
|
5342
5399
|
{
|
|
5343
|
-
className:
|
|
5400
|
+
className: classNames2__default.default(styles_module_default2.chatWelcome, "p-t-32"),
|
|
5344
5401
|
variant: "borderless",
|
|
5345
5402
|
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5346
5403
|
common.RenderWrapper,
|
|
@@ -5366,7 +5423,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
|
|
|
5366
5423
|
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5367
5424
|
xV2.Prompts,
|
|
5368
5425
|
{
|
|
5369
|
-
className:
|
|
5426
|
+
className: classNames2__default.default("m-t-16", styles_module_default2.promptItem),
|
|
5370
5427
|
wrap: true,
|
|
5371
5428
|
onItemClick: (info) => chatStore.sendMessage(info.data.description),
|
|
5372
5429
|
items: recommendQuestions
|
|
@@ -5575,7 +5632,7 @@ var BubbleListItems_default = ({
|
|
|
5575
5632
|
autoScroll: false,
|
|
5576
5633
|
ref: listRef,
|
|
5577
5634
|
items: bubbleListItems,
|
|
5578
|
-
className:
|
|
5635
|
+
className: classNames2__default.default(styles_module_default2.bubbleList, "height-full", "scroll-fade-in"),
|
|
5579
5636
|
onScroll: handleScroll
|
|
5580
5637
|
},
|
|
5581
5638
|
conversationState.active.id
|
|
@@ -5726,7 +5783,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
|
|
|
5726
5783
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5727
5784
|
antd.Flex,
|
|
5728
5785
|
{
|
|
5729
|
-
className:
|
|
5786
|
+
className: classNames2__default.default(style_module_default.categoryItem, { [style_module_default.categoryActive]: isChecked }),
|
|
5730
5787
|
onClick: () => handleCategoryChange(cat.id, !isChecked),
|
|
5731
5788
|
children: [
|
|
5732
5789
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5761,7 +5818,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
|
|
|
5761
5818
|
"\u5DF2\u9009 ",
|
|
5762
5819
|
selectedIds.length
|
|
5763
5820
|
] }) }),
|
|
5764
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
5821
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames2__default.default(style_module_default.tagsArea, { [style_module_default.tagsExpanded]: tagsExpanded }), children: [
|
|
5765
5822
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, className: style_module_default.tagContainer, wrap: true, ref: tagsContainerRef, children: [
|
|
5766
5823
|
selectedIds.map((id) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5767
5824
|
antd.Tag,
|
|
@@ -5791,7 +5848,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
|
|
|
5791
5848
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5792
5849
|
"div",
|
|
5793
5850
|
{
|
|
5794
|
-
className:
|
|
5851
|
+
className: classNames2__default.default(style_module_default.listItem, { [style_module_default.listItemSelected]: isSelected }),
|
|
5795
5852
|
onClick: () => toggleItemSelection(item.id),
|
|
5796
5853
|
children: [
|
|
5797
5854
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: style_module_default.itemIconWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(IconFont_default, { type: iconType }) }),
|
|
@@ -5921,7 +5978,7 @@ var ReasonBtn_default = ({}) => {
|
|
|
5921
5978
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5922
5979
|
"div",
|
|
5923
5980
|
{
|
|
5924
|
-
className:
|
|
5981
|
+
className: classNames2__default.default(style_module_default.resourceBtn, { [style_module_default.resourceBtnActive]: agentState.model.reasoning }),
|
|
5925
5982
|
onClick: () => chatStore.setAgentModel({ ...agentState.model, reasoning: !agentState.model.reasoning }),
|
|
5926
5983
|
children: [
|
|
5927
5984
|
/* @__PURE__ */ jsxRuntime.jsx(IconFont_default, { type: "icon-reason" }),
|
|
@@ -6394,9 +6451,9 @@ var ChatMainPanel = React10.memo(
|
|
|
6394
6451
|
);
|
|
6395
6452
|
const configState = valtio.useSnapshot(chatStore.config);
|
|
6396
6453
|
const agentState = valtio.useSnapshot(chatStore.agent);
|
|
6397
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
6454
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames2__default.default("height-full"), children: [
|
|
6398
6455
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
|
|
6399
|
-
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", vertical: true, gap: 24, className:
|
|
6456
|
+
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { align: "center", vertical: true, gap: 24, className: classNames2__default.default("height-full", styles_module_default5.bodyWidth), children: [
|
|
6400
6457
|
common.shouldRender(agentState.agentInfo.userInput && agentState.agentInfo.userInput.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.userInput, DefaultComponent: UserInputPanel_default }),
|
|
6401
6458
|
common.shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
|
|
6402
6459
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.senderHeader, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(ChatSenderHeader_default, {}) }),
|
|
@@ -6431,7 +6488,7 @@ var ChatPreviewPanel = React10.memo(({ file }) => {
|
|
|
6431
6488
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6432
6489
|
file.fileUrl && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: "height-full", children: [
|
|
6433
6490
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default5.previewHeader, children: [
|
|
6434
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
6491
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames2__default.default(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
|
|
6435
6492
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, justify: "center", align: "center", children: [
|
|
6436
6493
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6437
6494
|
antd.Button,
|
|
@@ -6567,12 +6624,12 @@ var layouts_default = React10.forwardRef(({ theme: theme5, params, hooks, layout
|
|
|
6567
6624
|
React10.useEffect(() => {
|
|
6568
6625
|
hooks?.onBeforeInit?.();
|
|
6569
6626
|
}, []);
|
|
6570
|
-
return /* @__PURE__ */ jsxRuntime.jsx(xV2.XProvider, { theme: { cssVar: {}, ...theme5 }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: configState.loading, classNames: { root: "full-spin" }, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className:
|
|
6627
|
+
return /* @__PURE__ */ jsxRuntime.jsx(xV2.XProvider, { theme: { cssVar: {}, ...theme5 }, children: /* @__PURE__ */ jsxRuntime.jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: configState.loading, classNames: { root: "full-spin" }, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames2__default.default(index_module_default3.chatLayout, "zero-chat-layout", "height-full"), children: [
|
|
6571
6628
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
|
|
6572
6629
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { ref: containerRef, className: "full-scroll", children: [
|
|
6573
6630
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.leftPanel }),
|
|
6574
6631
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.conversationList, DefaultComponent: ConversationListPanel_default }),
|
|
6575
|
-
/* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter, { className:
|
|
6632
|
+
/* @__PURE__ */ jsxRuntime.jsxs(antd.Splitter, { className: classNames2__default.default("flex-1", index_module_default3.animatedSplitter, { [index_module_default3.hideSplitterBar]: !hasPreView }), children: [
|
|
6576
6633
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsxRuntime.jsx(ChatMainPanel_default, { ref: senderRef }) }),
|
|
6577
6634
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: /* @__PURE__ */ jsxRuntime.jsx(ChatPreviewPanel_default, { file: configState.preview.file }) })
|
|
6578
6635
|
] })
|