@zero-library/chat-agent 2.3.11 → 2.3.12
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 +46 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +28 -4
- package/dist/index.d.ts +28 -4
- package/dist/index.esm.js +46 -14
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -187,7 +187,7 @@ var init_MdEdit = __esm({
|
|
|
187
187
|
setValue(data.content);
|
|
188
188
|
}, [data.content]);
|
|
189
189
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default.mdEdit, children: [
|
|
190
|
-
/* @__PURE__ */ jsxRuntime.jsx(common.MarkdownEditor, { disabled: loading, value, onChange: setValue,
|
|
190
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.MarkdownEditor, { disabled: loading, value, onChange: setValue, fixedToolbar: false, floatToolbar: false }),
|
|
191
191
|
!loading && /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { justify: "end", className: "m-t-16", children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { color: "primary", variant: "outlined", onClick: onOk, children: btnText }) })
|
|
192
192
|
] });
|
|
193
193
|
};
|
|
@@ -427,11 +427,11 @@ var createChatService = (request) => {
|
|
|
427
427
|
const labelItemDelete = (id) => {
|
|
428
428
|
return request.delete("/lolr/label/item", { id });
|
|
429
429
|
};
|
|
430
|
-
const labelsQuery = (
|
|
431
|
-
return request.get("/lolr/label",
|
|
430
|
+
const labelsQuery = (params) => {
|
|
431
|
+
return request.get("/lolr/label", params);
|
|
432
432
|
};
|
|
433
|
-
const labelItemsQuery = (
|
|
434
|
-
return request.get("/lolr/label/item",
|
|
433
|
+
const labelItemsQuery = (params) => {
|
|
434
|
+
return request.get("/lolr/label/item", params);
|
|
435
435
|
};
|
|
436
436
|
const labelItemTop = (params) => {
|
|
437
437
|
return request.put("/lolr/label/item/top", params);
|
|
@@ -2125,6 +2125,13 @@ var ChatSender_default = react.forwardRef(
|
|
|
2125
2125
|
onSend();
|
|
2126
2126
|
}
|
|
2127
2127
|
};
|
|
2128
|
+
const isFocusedRef = react.useRef(false);
|
|
2129
|
+
react.useEffect(() => {
|
|
2130
|
+
if (!content) return;
|
|
2131
|
+
if (!isFocusedRef.current) {
|
|
2132
|
+
senderRef.current?.focus({ cursor: "end" });
|
|
2133
|
+
}
|
|
2134
|
+
}, [content]);
|
|
2128
2135
|
react.useImperativeHandle(
|
|
2129
2136
|
ref,
|
|
2130
2137
|
() => ({
|
|
@@ -2143,7 +2150,13 @@ var ChatSender_default = react.forwardRef(
|
|
|
2143
2150
|
header: senderHeader,
|
|
2144
2151
|
onSubmit,
|
|
2145
2152
|
onChange: setInputValue,
|
|
2146
|
-
onFocus
|
|
2153
|
+
onFocus: () => {
|
|
2154
|
+
isFocusedRef.current = true;
|
|
2155
|
+
onFocus?.();
|
|
2156
|
+
},
|
|
2157
|
+
onBlur: () => {
|
|
2158
|
+
isFocusedRef.current = false;
|
|
2159
|
+
},
|
|
2147
2160
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2148
2161
|
onCancel,
|
|
2149
2162
|
footer: ({ components }) => {
|
|
@@ -2289,7 +2302,12 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2289
2302
|
const [editingItem, setEditingItem] = react.useState();
|
|
2290
2303
|
const fetchCategories = async () => {
|
|
2291
2304
|
try {
|
|
2292
|
-
const res = await configState.services.request?.labelsQuery?.(
|
|
2305
|
+
const res = await configState.services.request?.labelsQuery?.({
|
|
2306
|
+
agentId: receiverState.active?.id,
|
|
2307
|
+
businessData: configState.params.businessData,
|
|
2308
|
+
pageNo: 1,
|
|
2309
|
+
pageSize: 1e3
|
|
2310
|
+
});
|
|
2293
2311
|
if (res?.data) {
|
|
2294
2312
|
setCategories(res.data?.items);
|
|
2295
2313
|
if (!activeTab && res.data?.items?.length) {
|
|
@@ -2311,7 +2329,8 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2311
2329
|
if (!getActiveTab()) return;
|
|
2312
2330
|
try {
|
|
2313
2331
|
setLoading(true);
|
|
2314
|
-
const res = await configState.services.request?.labelItemsQuery?.(
|
|
2332
|
+
const res = await configState.services.request?.labelItemsQuery?.({
|
|
2333
|
+
agentId: receiverState.active?.id,
|
|
2315
2334
|
labelId: getActiveTab(),
|
|
2316
2335
|
keyword: getSearchText()
|
|
2317
2336
|
});
|
|
@@ -2368,9 +2387,10 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2368
2387
|
if (canProceed === false) {
|
|
2369
2388
|
return;
|
|
2370
2389
|
}
|
|
2371
|
-
chatStore.setContent(item.
|
|
2390
|
+
chatStore.setContent(`#${item.title}# `);
|
|
2372
2391
|
chatStore.setContentParams({
|
|
2373
|
-
|
|
2392
|
+
capacityId: item.id,
|
|
2393
|
+
capacityTitle: item.title
|
|
2374
2394
|
});
|
|
2375
2395
|
};
|
|
2376
2396
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -2388,11 +2408,10 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2388
2408
|
children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: styles_module_default4.quickAskPanel, children: [
|
|
2389
2409
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 12, className: "p-16", vertical: true, children: [
|
|
2390
2410
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, children: [
|
|
2391
|
-
!searchExpanded
|
|
2411
|
+
!searchExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2392
2412
|
antd.Button,
|
|
2393
2413
|
{
|
|
2394
2414
|
type: "dashed",
|
|
2395
|
-
block: true,
|
|
2396
2415
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
2397
2416
|
className: "flex-1",
|
|
2398
2417
|
onClick: () => {
|
|
@@ -2401,6 +2420,20 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2401
2420
|
},
|
|
2402
2421
|
children: "\u65B0\u589E\u80FD\u529B\u6A21\u677F"
|
|
2403
2422
|
}
|
|
2423
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2424
|
+
antd.Button,
|
|
2425
|
+
{
|
|
2426
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlusOutlined, {}),
|
|
2427
|
+
onClick: () => {
|
|
2428
|
+
if (getSearchText()) {
|
|
2429
|
+
setSearchText("");
|
|
2430
|
+
fetchItems();
|
|
2431
|
+
}
|
|
2432
|
+
setSearchExpanded(false);
|
|
2433
|
+
setEditingItem(null);
|
|
2434
|
+
setEditModalOpen(true);
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2404
2437
|
),
|
|
2405
2438
|
searchExpanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2406
2439
|
antd.Input,
|
|
@@ -2414,8 +2447,7 @@ var QuickAskPanelDrawer_default = ({ open, onClose }) => {
|
|
|
2414
2447
|
fetchItems();
|
|
2415
2448
|
},
|
|
2416
2449
|
className: "flex-1",
|
|
2417
|
-
allowClear: true
|
|
2418
|
-
onBlur: () => setSearchExpanded(false)
|
|
2450
|
+
allowClear: true
|
|
2419
2451
|
}
|
|
2420
2452
|
) : /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.SearchOutlined, {}), onClick: () => setSearchExpanded(true) })
|
|
2421
2453
|
] }),
|