@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.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CloudUploadOutlined, PaperClipOutlined, createFromIconfontCN, EnterOutlined, DownloadOutlined, CloseOutlined, PlayCircleOutlined, CopyOutlined, DotChartOutlined, LoadingOutlined, RightOutlined, LikeOutlined, DislikeOutlined, ToolOutlined, SearchOutlined, UpOutlined, DownOutlined, PlusOutlined, CommentOutlined,
|
|
1
|
+
import { CloudUploadOutlined, PaperClipOutlined, createFromIconfontCN, EnterOutlined, DownloadOutlined, CloseOutlined, PlayCircleOutlined, CopyOutlined, DotChartOutlined, LoadingOutlined, RightOutlined, LikeOutlined, DislikeOutlined, ToolOutlined, SearchOutlined, UpOutlined, DownOutlined, PlusOutlined, CommentOutlined, StarFilled, StarOutlined, RedoOutlined, DeleteOutlined, ClockCircleOutlined, CheckCircleOutlined, FileImageOutlined, FilePdfOutlined, FileWordOutlined, FileExcelOutlined, FilePptOutlined, FileZipOutlined, FileTextOutlined, FileUnknownOutlined } from '@ant-design/icons';
|
|
2
2
|
import { Attachments, Sender, FileCard, Bubble, Think, XProvider, Mermaid, CodeHighlighter, Welcome, Prompts, Conversations } from '@ant-design/x-v2';
|
|
3
3
|
import { useRefState, useDebounce, createTokenManager, useSyncInput, isEmptyObj, markdownToText, RenderWrapper, shouldRender, isFunction, downloadFile, LuyaFilePreview, MarkdownEditor, useDeepEffect, isObject, useWebSocket, isNullOrUnDef, isNumber, getFileSuffixName, emit, FileIcon, copyText, LazyComponent, isBoolean, UserAvatar, htmlToMarkdown, buildUrlParams, isExternal, deepCopy, transforms, deepMerge, createRequest, HttpStatus, isArray, isString, isDef, isNull, transform, getWebSocketUrl, safeParseJson } from '@zero-library/common';
|
|
4
|
-
import { App, Badge, Button, Flex, Typography, Tooltip, Layout, Tag, Spin, Splitter, Image as Image$1, Popover, Skeleton, Alert, theme, Collapse, Divider as Divider$1, Select as Select$1, Avatar, Space, Form, Drawer, Empty, Modal, Checkbox, Input,
|
|
4
|
+
import { App, Badge, Button, Flex, Typography, Tooltip, Layout, Tag, Spin, Splitter, Image as Image$1, Popover, Skeleton, Alert, theme, Collapse, Divider as Divider$1, Select as Select$1, Avatar, Space, Form, Drawer, Empty, Modal, Checkbox, Input, InputNumber, Switch as Switch$1, message, Tabs, Upload, Popconfirm, List, Card, Table, Progress as Progress$1 } from 'antd';
|
|
5
5
|
import * as React10 from 'react';
|
|
6
6
|
import React10__default, { createContext, forwardRef, useRef, useEffect, useImperativeHandle, useMemo, memo, useState, useContext, useCallback, useLayoutEffect } from 'react';
|
|
7
7
|
import { useSnapshot, proxy } from 'valtio';
|
|
@@ -18,7 +18,8 @@ import { LexicalTypeaheadMenuPlugin, MenuOption } from '@lexical/react/LexicalTy
|
|
|
18
18
|
import { mergeRegister } from '@lexical/utils';
|
|
19
19
|
import * as ReactDOM from 'react-dom';
|
|
20
20
|
import dayjs from 'dayjs';
|
|
21
|
-
import
|
|
21
|
+
import classNames2 from 'classnames';
|
|
22
|
+
import console2 from 'console';
|
|
22
23
|
import InfiniteScroll from 'react-infinite-scroll-component';
|
|
23
24
|
import { XCard as XCard$1 } from '@ant-design/x-card';
|
|
24
25
|
import '@ant-design/x-markdown/themes/light.css';
|
|
@@ -1228,6 +1229,7 @@ function createChatStore() {
|
|
|
1228
1229
|
await config.services.request.deleteConversation(conversationId);
|
|
1229
1230
|
message.success("\u5220\u9664\u6210\u529F");
|
|
1230
1231
|
conversations.list.items = conversations.list.items.filter((item) => item.key !== conversationId);
|
|
1232
|
+
favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
|
|
1231
1233
|
delete conversation.messages[conversationId];
|
|
1232
1234
|
if (conversation.active.id === conversationId) {
|
|
1233
1235
|
createConversation();
|
|
@@ -1273,6 +1275,7 @@ function createChatStore() {
|
|
|
1273
1275
|
id: "id",
|
|
1274
1276
|
label: "title",
|
|
1275
1277
|
spec: "spec",
|
|
1278
|
+
isFavorite: "isFavorite",
|
|
1276
1279
|
group: (c) => {
|
|
1277
1280
|
return classifyTime(c.updatedAt);
|
|
1278
1281
|
}
|
|
@@ -1327,7 +1330,9 @@ function createChatStore() {
|
|
|
1327
1330
|
item.isFavorite = isFavorite;
|
|
1328
1331
|
}
|
|
1329
1332
|
}
|
|
1330
|
-
if (
|
|
1333
|
+
if (isFavorite) {
|
|
1334
|
+
await getConversationFavorite();
|
|
1335
|
+
} else if (favorite.list.items.length) {
|
|
1331
1336
|
favorite.list.items = favorite.list.items.filter((item) => item.id !== conversationId);
|
|
1332
1337
|
}
|
|
1333
1338
|
message.success(isFavorite ? "\u6536\u85CF\u6210\u529F" : "\u5DF2\u53D6\u6D88\u6536\u85CF");
|
|
@@ -2200,109 +2205,34 @@ window._iconfont_svg_string_5021436 = '<svg><symbol id="icon-Ollama" viewBox="0
|
|
|
2200
2205
|
// src/components/IconFont/index.ts
|
|
2201
2206
|
var IconFont = createFromIconfontCN({});
|
|
2202
2207
|
var IconFont_default = IconFont;
|
|
2203
|
-
|
|
2204
|
-
// src/ui/common/FeatureComponents/style.module.less
|
|
2205
|
-
var style_module_default = {
|
|
2206
|
-
popover: "style_module_popover",
|
|
2207
|
-
resourceBtn: "style_module_resourceBtn",
|
|
2208
|
-
divider: "style_module_divider",
|
|
2209
|
-
count: "style_module_count",
|
|
2210
|
-
resourceBtnActive: "style_module_resourceBtnActive",
|
|
2211
|
-
customModal: "style_module_customModal",
|
|
2212
|
-
layout: "style_module_layout",
|
|
2213
|
-
sider: "style_module_sider",
|
|
2214
|
-
categoryName: "style_module_categoryName",
|
|
2215
|
-
siderContent: "style_module_siderContent",
|
|
2216
|
-
categoryItem: "style_module_categoryItem",
|
|
2217
|
-
categoryActive: "style_module_categoryActive",
|
|
2218
|
-
roundCheckbox: "style_module_roundCheckbox",
|
|
2219
|
-
content: "style_module_content",
|
|
2220
|
-
searchInput: "style_module_searchInput",
|
|
2221
|
-
selectedCount: "style_module_selectedCount",
|
|
2222
|
-
tagsArea: "style_module_tagsArea",
|
|
2223
|
-
tagContainer: "style_module_tagContainer",
|
|
2224
|
-
tag: "style_module_tag",
|
|
2225
|
-
expandBtnWrapper: "style_module_expandBtnWrapper",
|
|
2226
|
-
expandBtn: "style_module_expandBtn",
|
|
2227
|
-
tagsExpanded: "style_module_tagsExpanded",
|
|
2228
|
-
listArea: "style_module_listArea",
|
|
2229
|
-
listInner: "style_module_listInner",
|
|
2230
|
-
listItem: "style_module_listItem",
|
|
2231
|
-
listItemSelected: "style_module_listItemSelected",
|
|
2232
|
-
itemIconWrapper: "style_module_itemIconWrapper",
|
|
2233
|
-
itemInfo: "style_module_itemInfo",
|
|
2234
|
-
itemDesc: "style_module_itemDesc",
|
|
2235
|
-
footer: "style_module_footer",
|
|
2236
|
-
titleContainer: "style_module_titleContainer",
|
|
2237
|
-
favoriteCard: "style_module_favoriteCard",
|
|
2238
|
-
favoriteCardActive: "style_module_favoriteCardActive",
|
|
2239
|
-
favoriteCardTitle: "style_module_favoriteCardTitle",
|
|
2240
|
-
favoriteCardActions: "style_module_favoriteCardActions"};
|
|
2241
2208
|
var ConversationFavoritesBtn_default = ({ icon, ...rest }) => {
|
|
2242
2209
|
const chatStore = useChatStore();
|
|
2210
|
+
const conversationsState = useSnapshot(chatStore.conversations);
|
|
2243
2211
|
const conversationState = useSnapshot(chatStore.conversation);
|
|
2244
|
-
const
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
const
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
{
|
|
2252
|
-
className: classNames(style_module_default.favoriteCard, { [style_module_default.favoriteCardActive]: conversationState.active.id === item.id }),
|
|
2253
|
-
onClick: () => chatStore.switchConversation(item.id),
|
|
2254
|
-
children: /* @__PURE__ */ jsxs(Flex, { gap: 8, align: "center", children: [
|
|
2255
|
-
/* @__PURE__ */ jsx(Flex, { flex: 1, className: classNames(style_module_default.favoriteCardTitle, "text-ellipsis"), children: item.title }),
|
|
2256
|
-
/* @__PURE__ */ jsx(Flex, { gap: 8, align: "center", className: style_module_default.favoriteCardActions, children: /* @__PURE__ */ jsx(
|
|
2257
|
-
Popconfirm,
|
|
2258
|
-
{
|
|
2259
|
-
title: "\u63D0\u793A",
|
|
2260
|
-
okText: "\u786E\u5B9A",
|
|
2261
|
-
cancelText: "\u53D6\u6D88",
|
|
2262
|
-
description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
|
|
2263
|
-
onConfirm: (e) => {
|
|
2264
|
-
e.stopPropagation();
|
|
2265
|
-
chatStore.collectConversation(item.id, false);
|
|
2266
|
-
},
|
|
2267
|
-
onCancel: (e) => e.stopPropagation(),
|
|
2268
|
-
children: /* @__PURE__ */ jsx(
|
|
2269
|
-
Button,
|
|
2270
|
-
{
|
|
2271
|
-
icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
|
|
2272
|
-
title: "\u5220\u9664",
|
|
2273
|
-
type: "text",
|
|
2274
|
-
onClick: (e) => {
|
|
2275
|
-
e.stopPropagation();
|
|
2276
|
-
}
|
|
2277
|
-
}
|
|
2278
|
-
)
|
|
2279
|
-
}
|
|
2280
|
-
) })
|
|
2281
|
-
] })
|
|
2282
|
-
},
|
|
2283
|
-
item.id
|
|
2284
|
-
)) : /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u6536\u85CF", image: Empty.PRESENTED_IMAGE_SIMPLE }) });
|
|
2285
|
-
}, [favoriteState.list.items, conversationState.active.id]);
|
|
2286
|
-
const handlePopoverVisibleChange = (visible) => {
|
|
2287
|
-
if (!visible) return;
|
|
2288
|
-
getFavoriteList();
|
|
2212
|
+
const activeConversation = useMemo(() => {
|
|
2213
|
+
return conversationsState.list.items.find((item) => item.id === conversationState.active.id);
|
|
2214
|
+
}, [conversationsState.list.items, conversationState.active.id]);
|
|
2215
|
+
const isFavorite = Boolean(activeConversation?.isFavorite);
|
|
2216
|
+
const handleToggleFavorite = () => {
|
|
2217
|
+
if (!conversationState.active.id) return;
|
|
2218
|
+
chatStore.collectConversation(conversationState.active.id, !isFavorite);
|
|
2289
2219
|
};
|
|
2290
2220
|
return /* @__PURE__ */ jsx(
|
|
2291
|
-
|
|
2221
|
+
Button,
|
|
2292
2222
|
{
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2223
|
+
title: isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF",
|
|
2224
|
+
type: "text",
|
|
2225
|
+
size: "small",
|
|
2226
|
+
disabled: !conversationState.active.id,
|
|
2227
|
+
icon: icon?.() || (isFavorite ? /* @__PURE__ */ jsx(StarFilled, { className: "primary-text" }) : /* @__PURE__ */ jsx(StarOutlined, {})),
|
|
2228
|
+
onClick: handleToggleFavorite,
|
|
2229
|
+
...rest
|
|
2300
2230
|
}
|
|
2301
2231
|
);
|
|
2302
2232
|
};
|
|
2303
2233
|
var CreateBtn_default = ({ icon, ...rest }) => {
|
|
2304
2234
|
const chatStore = useChatStore();
|
|
2305
|
-
return /* @__PURE__ */ jsx(Button, { title: "\u65B0\u5EFA\u4F1A\u8BDD", size: "
|
|
2235
|
+
return /* @__PURE__ */ jsx(Button, { title: "\u65B0\u5EFA\u4F1A\u8BDD", size: "small", type: "text", icon: icon?.() || /* @__PURE__ */ jsx(PlusOutlined, {}), onClick: () => chatStore.createConversation(), ...rest });
|
|
2306
2236
|
};
|
|
2307
2237
|
|
|
2308
2238
|
// src/ui/common/styles.module.less
|
|
@@ -2315,6 +2245,10 @@ var styles_module_default2 = {
|
|
|
2315
2245
|
conversationListPanel: "styles_module_conversationListPanel",
|
|
2316
2246
|
createConversationButton: "styles_module_createConversationButton",
|
|
2317
2247
|
conversations: "styles_module_conversations",
|
|
2248
|
+
conversationTabs: "styles_module_conversationTabs",
|
|
2249
|
+
conversationTabPane: "styles_module_conversationTabPane",
|
|
2250
|
+
conversationEmpty: "styles_module_conversationEmpty",
|
|
2251
|
+
conversationScrollArea: "styles_module_conversationScrollArea",
|
|
2318
2252
|
chatWelcomeWrap: "styles_module_chatWelcomeWrap",
|
|
2319
2253
|
chatWelcome: "styles_module_chatWelcome",
|
|
2320
2254
|
promptItem: "styles_module_promptItem",
|
|
@@ -2333,12 +2267,30 @@ var styles_module_default2 = {
|
|
|
2333
2267
|
};
|
|
2334
2268
|
var ConversationList_default = () => {
|
|
2335
2269
|
const chatStore = useChatStore();
|
|
2270
|
+
const agentState = useSnapshot(chatStore.agent);
|
|
2336
2271
|
const conversationsState = useSnapshot(chatStore.conversations);
|
|
2337
2272
|
const conversationState = useSnapshot(chatStore.conversation);
|
|
2273
|
+
const favoriteState = useSnapshot(chatStore.favorite);
|
|
2274
|
+
const [activeTabKey, setActiveTabKey] = useState("history");
|
|
2275
|
+
useEffect(() => {
|
|
2276
|
+
if (!agentState.agentInfo.id) return;
|
|
2277
|
+
chatStore.getConversationFavorite();
|
|
2278
|
+
}, [agentState.agentInfo.id, chatStore]);
|
|
2338
2279
|
const conversationList = useMemo(() => {
|
|
2339
2280
|
return conversationsState.list.items.filter((item) => item.label);
|
|
2340
2281
|
}, [conversationsState.list.items]);
|
|
2341
|
-
const
|
|
2282
|
+
const favoriteConversationList = useMemo(() => {
|
|
2283
|
+
return favoriteState.list.items.filter((item) => item.title).map((item) => ({
|
|
2284
|
+
...item,
|
|
2285
|
+
key: item.id,
|
|
2286
|
+
id: item.id,
|
|
2287
|
+
label: item.title,
|
|
2288
|
+
spec: item.spec,
|
|
2289
|
+
isFavorite: true,
|
|
2290
|
+
group: classifyTime(item.updatedAt)
|
|
2291
|
+
}));
|
|
2292
|
+
}, [favoriteState.list.items]);
|
|
2293
|
+
const historyMenuConfig = (conversation) => ({
|
|
2342
2294
|
items: [
|
|
2343
2295
|
{
|
|
2344
2296
|
label: `${conversation.isFavorite ? "\u53D6\u6D88\u6536\u85CF" : "\u6536\u85CF"}`,
|
|
@@ -2361,31 +2313,135 @@ var ConversationList_default = () => {
|
|
|
2361
2313
|
}
|
|
2362
2314
|
}
|
|
2363
2315
|
});
|
|
2364
|
-
|
|
2365
|
-
|
|
2316
|
+
const favoriteMenuConfig = (conversation) => ({
|
|
2317
|
+
trigger: /* @__PURE__ */ jsx(
|
|
2318
|
+
Popconfirm,
|
|
2319
|
+
{
|
|
2320
|
+
title: "\u63D0\u793A",
|
|
2321
|
+
okText: "\u786E\u5B9A",
|
|
2322
|
+
cancelText: "\u53D6\u6D88",
|
|
2323
|
+
description: "\u786E\u8BA4\u53D6\u6D88\u6536\u85CF\u8BE5\u4F1A\u8BDD\u5417\uFF1F",
|
|
2324
|
+
onConfirm: (e) => {
|
|
2325
|
+
e.stopPropagation();
|
|
2326
|
+
chatStore.collectConversation(conversation.id, false);
|
|
2327
|
+
},
|
|
2328
|
+
onCancel: (e) => e.stopPropagation(),
|
|
2329
|
+
children: /* @__PURE__ */ jsx(
|
|
2330
|
+
Button,
|
|
2331
|
+
{
|
|
2332
|
+
icon: /* @__PURE__ */ jsx(DeleteOutlined, {}),
|
|
2333
|
+
title: "\u5220\u9664",
|
|
2334
|
+
type: "text",
|
|
2335
|
+
onClick: (e) => {
|
|
2336
|
+
e.stopPropagation();
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
)
|
|
2340
|
+
}
|
|
2341
|
+
),
|
|
2342
|
+
items: []
|
|
2343
|
+
});
|
|
2344
|
+
return /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationTabs, children: /* @__PURE__ */ jsx(
|
|
2345
|
+
Tabs,
|
|
2366
2346
|
{
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2347
|
+
activeKey: activeTabKey,
|
|
2348
|
+
centered: true,
|
|
2349
|
+
onChange: setActiveTabKey,
|
|
2350
|
+
items: [
|
|
2351
|
+
{
|
|
2352
|
+
key: "history",
|
|
2353
|
+
label: "\u5386\u53F2\u4F1A\u8BDD",
|
|
2354
|
+
children: /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationTabPane, children: conversationList.length ? /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationScrollArea, id: "historyConversationScrollableDiv", children: /* @__PURE__ */ jsx(
|
|
2355
|
+
InfiniteScroll,
|
|
2356
|
+
{
|
|
2357
|
+
dataLength: conversationList.length,
|
|
2358
|
+
hasMore: false,
|
|
2359
|
+
next: () => {
|
|
2360
|
+
console2.log("next");
|
|
2361
|
+
},
|
|
2362
|
+
loader: /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(Spin, { indicator: /* @__PURE__ */ jsx(RedoOutlined, { spin: true }), size: "small" }) }),
|
|
2363
|
+
style: { overflow: "hidden" },
|
|
2364
|
+
scrollableTarget: "historyConversationScrollableDiv",
|
|
2365
|
+
children: /* @__PURE__ */ jsx(
|
|
2366
|
+
Conversations,
|
|
2367
|
+
{
|
|
2368
|
+
className: styles_module_default2.conversations,
|
|
2369
|
+
items: conversationList,
|
|
2370
|
+
activeKey: conversationState.active.id,
|
|
2371
|
+
onActiveChange: async (id) => chatStore.switchConversation(id),
|
|
2372
|
+
groupable: true,
|
|
2373
|
+
menu: historyMenuConfig
|
|
2374
|
+
}
|
|
2375
|
+
)
|
|
2376
|
+
}
|
|
2377
|
+
) }) : /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationEmpty, children: /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u4F1A\u8BDD\u8BB0\u5F55", image: Empty.PRESENTED_IMAGE_SIMPLE }) }) })
|
|
2378
|
+
},
|
|
2377
2379
|
{
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2380
|
+
key: "favorite",
|
|
2381
|
+
label: "\u6536\u85CF\u4F1A\u8BDD",
|
|
2382
|
+
children: /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationTabPane, children: favoriteConversationList.length ? /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationScrollArea, id: "favoriteConversationScrollableDiv", children: /* @__PURE__ */ jsx(
|
|
2383
|
+
InfiniteScroll,
|
|
2384
|
+
{
|
|
2385
|
+
dataLength: favoriteConversationList.length,
|
|
2386
|
+
hasMore: false,
|
|
2387
|
+
next: () => {
|
|
2388
|
+
console2.log("next");
|
|
2389
|
+
},
|
|
2390
|
+
loader: /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx(Spin, { indicator: /* @__PURE__ */ jsx(RedoOutlined, { spin: true }), size: "small" }) }),
|
|
2391
|
+
style: { overflow: "hidden" },
|
|
2392
|
+
scrollableTarget: "favoriteConversationScrollableDiv",
|
|
2393
|
+
children: /* @__PURE__ */ jsx(
|
|
2394
|
+
Conversations,
|
|
2395
|
+
{
|
|
2396
|
+
className: styles_module_default2.conversations,
|
|
2397
|
+
items: favoriteConversationList,
|
|
2398
|
+
activeKey: conversationState.active.id,
|
|
2399
|
+
onActiveChange: async (id) => chatStore.switchConversation(id),
|
|
2400
|
+
groupable: true,
|
|
2401
|
+
menu: favoriteMenuConfig
|
|
2402
|
+
}
|
|
2403
|
+
)
|
|
2404
|
+
}
|
|
2405
|
+
) }) : /* @__PURE__ */ jsx("div", { className: styles_module_default2.conversationEmpty, children: /* @__PURE__ */ jsx(Empty, { description: "\u6682\u65E0\u6536\u85CF\u4F1A\u8BDD", image: Empty.PRESENTED_IMAGE_SIMPLE }) }) })
|
|
2384
2406
|
}
|
|
2385
|
-
|
|
2407
|
+
]
|
|
2386
2408
|
}
|
|
2387
|
-
)
|
|
2409
|
+
) });
|
|
2388
2410
|
};
|
|
2411
|
+
|
|
2412
|
+
// src/ui/common/FeatureComponents/style.module.less
|
|
2413
|
+
var style_module_default = {
|
|
2414
|
+
popover: "style_module_popover",
|
|
2415
|
+
resourceBtn: "style_module_resourceBtn",
|
|
2416
|
+
divider: "style_module_divider",
|
|
2417
|
+
count: "style_module_count",
|
|
2418
|
+
resourceBtnActive: "style_module_resourceBtnActive",
|
|
2419
|
+
customModal: "style_module_customModal",
|
|
2420
|
+
layout: "style_module_layout",
|
|
2421
|
+
sider: "style_module_sider",
|
|
2422
|
+
categoryName: "style_module_categoryName",
|
|
2423
|
+
siderContent: "style_module_siderContent",
|
|
2424
|
+
categoryItem: "style_module_categoryItem",
|
|
2425
|
+
categoryActive: "style_module_categoryActive",
|
|
2426
|
+
roundCheckbox: "style_module_roundCheckbox",
|
|
2427
|
+
content: "style_module_content",
|
|
2428
|
+
searchInput: "style_module_searchInput",
|
|
2429
|
+
selectedCount: "style_module_selectedCount",
|
|
2430
|
+
tagsArea: "style_module_tagsArea",
|
|
2431
|
+
tagContainer: "style_module_tagContainer",
|
|
2432
|
+
tag: "style_module_tag",
|
|
2433
|
+
expandBtnWrapper: "style_module_expandBtnWrapper",
|
|
2434
|
+
expandBtn: "style_module_expandBtn",
|
|
2435
|
+
tagsExpanded: "style_module_tagsExpanded",
|
|
2436
|
+
listArea: "style_module_listArea",
|
|
2437
|
+
listInner: "style_module_listInner",
|
|
2438
|
+
listItem: "style_module_listItem",
|
|
2439
|
+
listItemSelected: "style_module_listItemSelected",
|
|
2440
|
+
itemIconWrapper: "style_module_itemIconWrapper",
|
|
2441
|
+
itemInfo: "style_module_itemInfo",
|
|
2442
|
+
itemDesc: "style_module_itemDesc",
|
|
2443
|
+
footer: "style_module_footer",
|
|
2444
|
+
titleContainer: "style_module_titleContainer"};
|
|
2389
2445
|
var HistoryBtn_default = ({ icon, ...rest }) => {
|
|
2390
2446
|
return /* @__PURE__ */ jsx(
|
|
2391
2447
|
Popover,
|
|
@@ -2395,7 +2451,7 @@ var HistoryBtn_default = ({ icon, ...rest }) => {
|
|
|
2395
2451
|
classNames: { container: style_module_default.popover },
|
|
2396
2452
|
content: /* @__PURE__ */ jsx(ConversationList_default, {}),
|
|
2397
2453
|
trigger: ["click"],
|
|
2398
|
-
children: /* @__PURE__ */ jsx(Button, { title: "\u5386\u53F2\u4F1A\u8BDD", size: "
|
|
2454
|
+
children: /* @__PURE__ */ jsx(Button, { title: "\u5386\u53F2\u4F1A\u8BDD", size: "small", type: "text", icon: icon?.() || /* @__PURE__ */ jsx(CommentOutlined, {}), ...rest })
|
|
2399
2455
|
}
|
|
2400
2456
|
);
|
|
2401
2457
|
};
|
|
@@ -2410,7 +2466,7 @@ var ChatHeader_default = ({
|
|
|
2410
2466
|
const chatStore = useChatStore();
|
|
2411
2467
|
const agentState = useSnapshot(chatStore.agent);
|
|
2412
2468
|
const configState = useSnapshot(chatStore.config);
|
|
2413
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className:
|
|
2469
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: classNames2(styles_module_default2.chatHeader, "zero-chat-header"), children: [
|
|
2414
2470
|
/* @__PURE__ */ jsxs("div", { className: styles_module_default2.chatHeaderContent, children: [
|
|
2415
2471
|
/* @__PURE__ */ jsx(
|
|
2416
2472
|
RenderWrapper,
|
|
@@ -2456,8 +2512,8 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
|
|
|
2456
2512
|
{
|
|
2457
2513
|
control: title,
|
|
2458
2514
|
DefaultComponent: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Flex, { vertical: true, gap: 4, flex: 1, style: { minWidth: 0 }, children: [
|
|
2459
|
-
/* @__PURE__ */ jsx(Text, { strong: true, className:
|
|
2460
|
-
/* @__PURE__ */ jsx(Text, { type: "secondary", ellipsis: true, className:
|
|
2515
|
+
/* @__PURE__ */ jsx(Text, { strong: true, className: classNames2("fz-16"), children: agentState.agentInfo.name }),
|
|
2516
|
+
/* @__PURE__ */ jsx(Text, { type: "secondary", ellipsis: true, className: classNames2("fz-12"), children: agentState.agentInfo.description })
|
|
2461
2517
|
] }) })
|
|
2462
2518
|
}
|
|
2463
2519
|
)
|
|
@@ -2472,7 +2528,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
|
|
|
2472
2528
|
block: true,
|
|
2473
2529
|
type: "primary",
|
|
2474
2530
|
onClick: () => chatStore.createConversation(),
|
|
2475
|
-
className:
|
|
2531
|
+
className: classNames2(styles_module_default2.createConversationButton),
|
|
2476
2532
|
icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
|
|
2477
2533
|
children: "\u65B0\u5EFA\u4F1A\u8BDD"
|
|
2478
2534
|
}
|
|
@@ -2482,7 +2538,7 @@ var ConversationListHeader_default = ({ title = true, avatar = true, newConversa
|
|
|
2482
2538
|
] });
|
|
2483
2539
|
};
|
|
2484
2540
|
var ConversationListPanel = ({ header }) => {
|
|
2485
|
-
return /* @__PURE__ */ jsxs(Flex, { vertical: true, className:
|
|
2541
|
+
return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames2("height-full", "zero-chat-conversations", styles_module_default2.conversationListPanel), children: [
|
|
2486
2542
|
/* @__PURE__ */ jsx(RenderWrapper, { control: header, DefaultComponent: ConversationListHeader_default }),
|
|
2487
2543
|
/* @__PURE__ */ jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsx(ConversationList_default, {}) })
|
|
2488
2544
|
] });
|
|
@@ -2951,7 +3007,7 @@ var CHART_COMPONENTS = Object.fromEntries(
|
|
|
2951
3007
|
);
|
|
2952
3008
|
var Charts_default = ({ data, loading }) => {
|
|
2953
3009
|
const { type, config } = data;
|
|
2954
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
3010
|
+
return /* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default3.chart, "scroll-fade-in"), children: loading ? (
|
|
2955
3011
|
// Antd 骨架屏
|
|
2956
3012
|
/* @__PURE__ */ jsx(Skeleton.Node, { active: true, className: styles_module_default3.chartSkeleton, children: /* @__PURE__ */ jsx(DotChartOutlined, { className: styles_module_default3.chartSkeletonIcon }) })
|
|
2957
3013
|
) : /* @__PURE__ */ jsx(
|
|
@@ -3246,7 +3302,7 @@ var XMarkdown_default = memo(({ message: message3, components = {}, content = ""
|
|
|
3246
3302
|
return /* @__PURE__ */ jsx(
|
|
3247
3303
|
XMarkdown,
|
|
3248
3304
|
{
|
|
3249
|
-
className:
|
|
3305
|
+
className: classNames2("x-markdown-light", styles_module_default4.xMarkdownStyle),
|
|
3250
3306
|
config,
|
|
3251
3307
|
...rest,
|
|
3252
3308
|
content: processedContent,
|
|
@@ -3591,7 +3647,7 @@ var Switch = ({ id, label, value, bind_path_token, onChange, onDataChange }) =>
|
|
|
3591
3647
|
/* @__PURE__ */ jsx("span", { style: { fontSize: 13, color: "#555" }, children: label })
|
|
3592
3648
|
] });
|
|
3593
3649
|
};
|
|
3594
|
-
var
|
|
3650
|
+
var Button11 = ({ label, variant = "default", onClick, action, onAction }) => {
|
|
3595
3651
|
const handleClick = () => {
|
|
3596
3652
|
if (onClick) {
|
|
3597
3653
|
onClick();
|
|
@@ -3621,7 +3677,7 @@ var A2uiComponents = {
|
|
|
3621
3677
|
TextField,
|
|
3622
3678
|
Select,
|
|
3623
3679
|
Switch,
|
|
3624
|
-
Button:
|
|
3680
|
+
Button: Button11,
|
|
3625
3681
|
Divider,
|
|
3626
3682
|
Tag: Tag3,
|
|
3627
3683
|
Progress,
|
|
@@ -5311,7 +5367,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
|
|
|
5311
5367
|
/* @__PURE__ */ jsx(
|
|
5312
5368
|
Welcome,
|
|
5313
5369
|
{
|
|
5314
|
-
className:
|
|
5370
|
+
className: classNames2(styles_module_default2.chatWelcome, "p-t-32"),
|
|
5315
5371
|
variant: "borderless",
|
|
5316
5372
|
icon: /* @__PURE__ */ jsx(
|
|
5317
5373
|
RenderWrapper,
|
|
@@ -5337,7 +5393,7 @@ var WelcomeItem_default = ({ icon = true, title = true, description = true, prom
|
|
|
5337
5393
|
DefaultComponent: /* @__PURE__ */ jsx(
|
|
5338
5394
|
Prompts,
|
|
5339
5395
|
{
|
|
5340
|
-
className:
|
|
5396
|
+
className: classNames2("m-t-16", styles_module_default2.promptItem),
|
|
5341
5397
|
wrap: true,
|
|
5342
5398
|
onItemClick: (info) => chatStore.sendMessage(info.data.description),
|
|
5343
5399
|
items: recommendQuestions
|
|
@@ -5546,7 +5602,7 @@ var BubbleListItems_default = ({
|
|
|
5546
5602
|
autoScroll: false,
|
|
5547
5603
|
ref: listRef,
|
|
5548
5604
|
items: bubbleListItems,
|
|
5549
|
-
className:
|
|
5605
|
+
className: classNames2(styles_module_default2.bubbleList, "height-full", "scroll-fade-in"),
|
|
5550
5606
|
onScroll: handleScroll
|
|
5551
5607
|
},
|
|
5552
5608
|
conversationState.active.id
|
|
@@ -5697,7 +5753,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
|
|
|
5697
5753
|
return /* @__PURE__ */ jsxs(
|
|
5698
5754
|
Flex,
|
|
5699
5755
|
{
|
|
5700
|
-
className:
|
|
5756
|
+
className: classNames2(style_module_default.categoryItem, { [style_module_default.categoryActive]: isChecked }),
|
|
5701
5757
|
onClick: () => handleCategoryChange(cat.id, !isChecked),
|
|
5702
5758
|
children: [
|
|
5703
5759
|
/* @__PURE__ */ jsx(
|
|
@@ -5732,7 +5788,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
|
|
|
5732
5788
|
"\u5DF2\u9009 ",
|
|
5733
5789
|
selectedIds.length
|
|
5734
5790
|
] }) }),
|
|
5735
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
5791
|
+
/* @__PURE__ */ jsxs("div", { className: classNames2(style_module_default.tagsArea, { [style_module_default.tagsExpanded]: tagsExpanded }), children: [
|
|
5736
5792
|
/* @__PURE__ */ jsxs(Flex, { gap: 8, className: style_module_default.tagContainer, wrap: true, ref: tagsContainerRef, children: [
|
|
5737
5793
|
selectedIds.map((id) => /* @__PURE__ */ jsx(
|
|
5738
5794
|
Tag,
|
|
@@ -5762,7 +5818,7 @@ var ResourceSelectorModal_default = ({ open, type, onCancel }) => {
|
|
|
5762
5818
|
return /* @__PURE__ */ jsxs(
|
|
5763
5819
|
"div",
|
|
5764
5820
|
{
|
|
5765
|
-
className:
|
|
5821
|
+
className: classNames2(style_module_default.listItem, { [style_module_default.listItemSelected]: isSelected }),
|
|
5766
5822
|
onClick: () => toggleItemSelection(item.id),
|
|
5767
5823
|
children: [
|
|
5768
5824
|
/* @__PURE__ */ jsx("div", { className: style_module_default.itemIconWrapper, children: /* @__PURE__ */ jsx(IconFont_default, { type: iconType }) }),
|
|
@@ -5892,7 +5948,7 @@ var ReasonBtn_default = ({}) => {
|
|
|
5892
5948
|
return /* @__PURE__ */ jsxs(
|
|
5893
5949
|
"div",
|
|
5894
5950
|
{
|
|
5895
|
-
className:
|
|
5951
|
+
className: classNames2(style_module_default.resourceBtn, { [style_module_default.resourceBtnActive]: agentState.model.reasoning }),
|
|
5896
5952
|
onClick: () => chatStore.setAgentModel({ ...agentState.model, reasoning: !agentState.model.reasoning }),
|
|
5897
5953
|
children: [
|
|
5898
5954
|
/* @__PURE__ */ jsx(IconFont_default, { type: "icon-reason" }),
|
|
@@ -6365,9 +6421,9 @@ var ChatMainPanel = memo(
|
|
|
6365
6421
|
);
|
|
6366
6422
|
const configState = useSnapshot(chatStore.config);
|
|
6367
6423
|
const agentState = useSnapshot(chatStore.agent);
|
|
6368
|
-
return /* @__PURE__ */ jsxs(Flex, { vertical: true, className:
|
|
6424
|
+
return /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames2("height-full"), children: [
|
|
6369
6425
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.chatHeader, DefaultComponent: ChatHeader_default }),
|
|
6370
|
-
/* @__PURE__ */ jsxs(Flex, { align: "center", vertical: true, gap: 24, className:
|
|
6426
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", vertical: true, gap: 24, className: classNames2("height-full", styles_module_default5.bodyWidth), children: [
|
|
6371
6427
|
shouldRender(agentState.agentInfo.userInput && agentState.agentInfo.userInput.length > 0) && /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.userInput, DefaultComponent: UserInputPanel_default }),
|
|
6372
6428
|
shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsx("div", { className: "full-scroll", style: { width: "100%" }, children: /* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.messageList, DefaultComponent: BubbleListItems_default }) }),
|
|
6373
6429
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.senderHeader, DefaultComponent: /* @__PURE__ */ jsx(ChatSenderHeader_default, {}) }),
|
|
@@ -6402,7 +6458,7 @@ var ChatPreviewPanel = memo(({ file }) => {
|
|
|
6402
6458
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6403
6459
|
file.fileUrl && /* @__PURE__ */ jsxs(Flex, { vertical: true, className: "height-full", children: [
|
|
6404
6460
|
/* @__PURE__ */ jsxs("div", { className: styles_module_default5.previewHeader, children: [
|
|
6405
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
6461
|
+
/* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default5.previewHeaderTitle, "text-ellipsis"), title: file.fileName, children: file.fileName }),
|
|
6406
6462
|
/* @__PURE__ */ jsxs(Flex, { gap: 8, justify: "center", align: "center", children: [
|
|
6407
6463
|
/* @__PURE__ */ jsx(
|
|
6408
6464
|
Button,
|
|
@@ -6538,12 +6594,12 @@ var layouts_default = forwardRef(({ theme: theme5, params, hooks, layout, config
|
|
|
6538
6594
|
useEffect(() => {
|
|
6539
6595
|
hooks?.onBeforeInit?.();
|
|
6540
6596
|
}, []);
|
|
6541
|
-
return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: {}, ...theme5 }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: configState.loading, classNames: { root: "full-spin" }, children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className:
|
|
6597
|
+
return /* @__PURE__ */ jsx(XProvider, { theme: { cssVar: {}, ...theme5 }, children: /* @__PURE__ */ jsx(ChatProvider, { store: chatStore, children: /* @__PURE__ */ jsx(Spin, { spinning: configState.loading, classNames: { root: "full-spin" }, children: /* @__PURE__ */ jsxs(Flex, { vertical: true, className: classNames2(index_module_default3.chatLayout, "zero-chat-layout", "height-full"), children: [
|
|
6542
6598
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.globalHeader, DefaultComponent: ChatHeader_default }),
|
|
6543
6599
|
/* @__PURE__ */ jsxs(Flex, { ref: containerRef, className: "full-scroll", children: [
|
|
6544
6600
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.leftPanel }),
|
|
6545
6601
|
/* @__PURE__ */ jsx(RenderWrapper, { control: configState.layout.conversationList, DefaultComponent: ConversationListPanel_default }),
|
|
6546
|
-
/* @__PURE__ */ jsxs(Splitter, { className:
|
|
6602
|
+
/* @__PURE__ */ jsxs(Splitter, { className: classNames2("flex-1", index_module_default3.animatedSplitter, { [index_module_default3.hideSplitterBar]: !hasPreView }), children: [
|
|
6547
6603
|
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, max: 800, min: 400, size: sizes[1], children: /* @__PURE__ */ jsx(ChatMainPanel_default, { ref: senderRef }) }),
|
|
6548
6604
|
/* @__PURE__ */ jsx(Splitter.Panel, { collapsible: false, min: 600, size: sizes[0], children: /* @__PURE__ */ jsx(ChatPreviewPanel_default, { file: configState.preview.file }) })
|
|
6549
6605
|
] })
|