@zero-library/chat-agent 2.3.8 → 2.3.10
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 +103 -96
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +13 -17
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.esm.js +105 -98
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -2213,7 +2213,7 @@ var QuickAskEditModal_default = ({ open, onCancel, loading, onConfirm, initialVa
|
|
|
2213
2213
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2214
2214
|
antd.Modal,
|
|
2215
2215
|
{
|
|
2216
|
-
title: initialValues?.id ? "\u7F16\u8F91\
|
|
2216
|
+
title: initialValues?.id ? "\u7F16\u8F91\u80FD\u529B\u6A21\u677F" : "\u65B0\u589E\u80FD\u529B\u6A21\u677F",
|
|
2217
2217
|
open,
|
|
2218
2218
|
onCancel,
|
|
2219
2219
|
onOk: handleOk,
|
|
@@ -2271,10 +2271,9 @@ var styles_module_default4 = {
|
|
|
2271
2271
|
quickAskPanel: "styles_module_quickAskPanel",
|
|
2272
2272
|
tagContainer: "styles_module_tagContainer",
|
|
2273
2273
|
quickAskItem: "styles_module_quickAskItem",
|
|
2274
|
-
|
|
2274
|
+
quickAskItemIcon: "styles_module_quickAskItemIcon",
|
|
2275
2275
|
quickAskItemTitle: "styles_module_quickAskItemTitle",
|
|
2276
|
-
|
|
2277
|
-
quickAskItemBody: "styles_module_quickAskItemBody"
|
|
2276
|
+
quickAskItemActions: "styles_module_quickAskItemActions"
|
|
2278
2277
|
};
|
|
2279
2278
|
var ALL = "all";
|
|
2280
2279
|
var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
@@ -2366,14 +2365,25 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2366
2365
|
} catch (err) {
|
|
2367
2366
|
}
|
|
2368
2367
|
};
|
|
2368
|
+
const onSelectItem = async (item) => {
|
|
2369
|
+
const canProceed = await configState.hooks?.onBeforeSelectCapacity?.(item);
|
|
2370
|
+
onClose();
|
|
2371
|
+
if (canProceed === false) {
|
|
2372
|
+
return;
|
|
2373
|
+
}
|
|
2374
|
+
chatStore.setContent(item.content);
|
|
2375
|
+
chatStore.setContentParams({
|
|
2376
|
+
use_template: 1
|
|
2377
|
+
});
|
|
2378
|
+
};
|
|
2369
2379
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2370
2380
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2371
2381
|
antd.Drawer,
|
|
2372
2382
|
{
|
|
2373
2383
|
className: classNames11__default.default("no-padding-drawer"),
|
|
2374
|
-
width:
|
|
2384
|
+
width: 540,
|
|
2375
2385
|
open,
|
|
2376
|
-
title: "\
|
|
2386
|
+
title: "\u80FD\u529B\u9009\u62E9",
|
|
2377
2387
|
closable: { placement: "end" },
|
|
2378
2388
|
onClose,
|
|
2379
2389
|
placement: "right",
|
|
@@ -2392,7 +2402,7 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2392
2402
|
setEditingItem(null);
|
|
2393
2403
|
setEditModalOpen(true);
|
|
2394
2404
|
},
|
|
2395
|
-
children: "\u65B0\u589E\
|
|
2405
|
+
children: "\u65B0\u589E\u80FD\u529B\u6A21\u677F"
|
|
2396
2406
|
}
|
|
2397
2407
|
),
|
|
2398
2408
|
searchExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2427,94 +2437,91 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2427
2437
|
}
|
|
2428
2438
|
)
|
|
2429
2439
|
] }),
|
|
2430
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, wrapperClassName: "full-spin", tip: "\u52A0\u8F7D\u4E2D...", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, gap: 8, className: "height-full scroll-fade-in p-16 p-t-
|
|
2431
|
-
|
|
2432
|
-
{
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
)
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
},
|
|
2516
|
-
item.id
|
|
2517
|
-
)) }) }) })
|
|
2440
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, wrapperClassName: "full-spin", tip: "\u52A0\u8F7D\u4E2D...", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, gap: 8, className: "height-full scroll-fade-in p-16 p-t-0", children: items.length ? items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, align: "start", className: styles_module_default4.quickAskItem, onClick: () => onSelectItem(item), children: [
|
|
2441
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.FileTextOutlined, { className: styles_module_default4.quickAskItemIcon }),
|
|
2442
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames11__default.default("flex-1 text-ellipsis-2", styles_module_default4.quickAskItemTitle), children: item.title }),
|
|
2443
|
+
/* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { size: 0, className: styles_module_default4.quickAskItemActions, children: [
|
|
2444
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2445
|
+
antd.Button,
|
|
2446
|
+
{
|
|
2447
|
+
variant: "text",
|
|
2448
|
+
color: "primary",
|
|
2449
|
+
size: "small",
|
|
2450
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PushpinOutlined, { rotate: item.isTop ? -45 : 0 }),
|
|
2451
|
+
title: item.isTop ? "\u53D6\u6D88\u7F6E\u9876" : "\u7F6E\u9876",
|
|
2452
|
+
onClick: (e) => {
|
|
2453
|
+
e.stopPropagation();
|
|
2454
|
+
handleTop(item);
|
|
2455
|
+
}
|
|
2456
|
+
},
|
|
2457
|
+
"top"
|
|
2458
|
+
),
|
|
2459
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2460
|
+
antd.Button,
|
|
2461
|
+
{
|
|
2462
|
+
variant: "text",
|
|
2463
|
+
color: "primary",
|
|
2464
|
+
size: "small",
|
|
2465
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyOutlined, {}),
|
|
2466
|
+
title: "\u590D\u5236",
|
|
2467
|
+
onClick: (e) => {
|
|
2468
|
+
e.stopPropagation();
|
|
2469
|
+
setEditingItem({
|
|
2470
|
+
title: item.title,
|
|
2471
|
+
labelName: item.labelName,
|
|
2472
|
+
content: item.content
|
|
2473
|
+
});
|
|
2474
|
+
setEditModalOpen(true);
|
|
2475
|
+
}
|
|
2476
|
+
},
|
|
2477
|
+
"copy"
|
|
2478
|
+
),
|
|
2479
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2480
|
+
antd.Button,
|
|
2481
|
+
{
|
|
2482
|
+
variant: "text",
|
|
2483
|
+
color: "primary",
|
|
2484
|
+
size: "small",
|
|
2485
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EditOutlined, {}),
|
|
2486
|
+
title: "\u7F16\u8F91",
|
|
2487
|
+
onClick: (e) => {
|
|
2488
|
+
e.stopPropagation();
|
|
2489
|
+
setEditingItem(item);
|
|
2490
|
+
setEditModalOpen(true);
|
|
2491
|
+
}
|
|
2492
|
+
},
|
|
2493
|
+
"edit"
|
|
2494
|
+
),
|
|
2495
|
+
item.canDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2496
|
+
antd.Popconfirm,
|
|
2497
|
+
{
|
|
2498
|
+
title: "\u63D0\u793A",
|
|
2499
|
+
okText: "\u786E\u5B9A",
|
|
2500
|
+
cancelText: "\u53D6\u6D88",
|
|
2501
|
+
description: "\u786E\u8BA4\u5220\u9664\u95EE\u9898\u5417?",
|
|
2502
|
+
onConfirm: (e) => {
|
|
2503
|
+
e.stopPropagation();
|
|
2504
|
+
handleDelete(item.id);
|
|
2505
|
+
},
|
|
2506
|
+
onCancel: (e) => {
|
|
2507
|
+
e.stopPropagation();
|
|
2508
|
+
},
|
|
2509
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2510
|
+
antd.Button,
|
|
2511
|
+
{
|
|
2512
|
+
variant: "text",
|
|
2513
|
+
color: "primary",
|
|
2514
|
+
size: "small",
|
|
2515
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DeleteOutlined, {}),
|
|
2516
|
+
title: "\u5220\u9664",
|
|
2517
|
+
onClick: (e) => e.stopPropagation()
|
|
2518
|
+
}
|
|
2519
|
+
)
|
|
2520
|
+
},
|
|
2521
|
+
"delete"
|
|
2522
|
+
)
|
|
2523
|
+
] })
|
|
2524
|
+
] }, item.id)) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { description: "\u6682\u65E0\u6570\u636E", className: "m-t-24" }) }) }) })
|
|
2518
2525
|
] })
|
|
2519
2526
|
}
|
|
2520
2527
|
),
|
|
@@ -2567,7 +2574,7 @@ var FeaturesRenderer_default = () => {
|
|
|
2567
2574
|
}
|
|
2568
2575
|
),
|
|
2569
2576
|
receiverState.active.feature?.quickAsk && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2570
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "filled", onClick: () => setQuickAskOpen(true), children: "\
|
|
2577
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "filled", onClick: () => setQuickAskOpen(true), children: "\u80FD\u529B\u9009\u62E9" }),
|
|
2571
2578
|
quickAskOpen && /* @__PURE__ */ jsxRuntime.jsx(QuickAskPanelDrawer_default, { open: quickAskOpen, onClose: () => setQuickAskOpen(false) })
|
|
2572
2579
|
] })
|
|
2573
2580
|
] });
|