@zero-library/chat-agent 2.1.19 → 2.1.20

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 CHANGED
@@ -2,19 +2,19 @@
2
2
 
3
3
  var common = require('@zero-library/common');
4
4
  var antd = require('antd');
5
- var dayjs = require('dayjs');
6
5
  var jsxRuntime = require('react/jsx-runtime');
7
6
  var react = require('react');
8
7
  var valtio = require('valtio');
9
8
  var icons = require('@ant-design/icons');
10
9
  var x = require('@ant-design/x');
11
10
  var classNames8 = require('classnames');
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 dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
17
16
  var classNames8__default = /*#__PURE__*/_interopDefault(classNames8);
17
+ var dayjs__default = /*#__PURE__*/_interopDefault(dayjs);
18
18
  var InfiniteScroll__default = /*#__PURE__*/_interopDefault(InfiniteScroll);
19
19
 
20
20
  var __defProp = Object.defineProperty;
@@ -26,36 +26,6 @@ var __export = (target, all) => {
26
26
  for (var name in all)
27
27
  __defProp(target, name, { get: all[name], enumerable: true });
28
28
  };
29
- var classifyTime, replaceThinkTags, copy;
30
- var init_utils = __esm({
31
- "src/core/utils.ts"() {
32
- classifyTime = (timestamp) => {
33
- const now = dayjs__default.default();
34
- const target = dayjs__default.default(timestamp);
35
- if (target.isSame(now, "day")) {
36
- return "\u4ECA\u5929";
37
- }
38
- const diffInDays = now.diff(target, "day");
39
- if (diffInDays < 7) {
40
- return "\u6700\u8FD1 7 \u5929";
41
- } else if (diffInDays < 30) {
42
- return "\u6700\u8FD1 30 \u5929";
43
- } else if (diffInDays < 180) {
44
- return "\u6700\u8FD1\u534A\u5E74";
45
- } else {
46
- return "\u66F4\u65E9";
47
- }
48
- };
49
- replaceThinkTags = (str) => {
50
- return str.replace(/<think>/g, ":::alert type=think data={content:'").replace(/<\/think>/g, "'} ::: ");
51
- };
52
- copy = (value) => {
53
- common.copyText(value).then(() => {
54
- antd.message.success("\u590D\u5236\u6210\u529F");
55
- });
56
- };
57
- }
58
- });
59
29
  var ChatProvider, useChatStore;
60
30
  var init_Context = __esm({
61
31
  "src/stores/Context.ts"() {
@@ -214,7 +184,6 @@ __export(FileEdit_exports, {
214
184
  var FileEdit_default;
215
185
  var init_FileEdit = __esm({
216
186
  "src/ui/common/markdownAlert/FileEdit.tsx"() {
217
- init_utils();
218
187
  init_Context();
219
188
  init_styles_module();
220
189
  FileEdit_default = ({ data, loading }) => {
@@ -230,7 +199,7 @@ var init_FileEdit = __esm({
230
199
  ] }),
231
200
  /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { spinning: loading, size: "small", children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
232
201
  /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { color: "default", variant: "text", size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.PlayCircleOutlined, {}), onClick: onPreview, children: "\u9884\u89C8\u7F16\u8F91" }),
233
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { color: "default", variant: "text", size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyOutlined, {}), onClick: () => copy(data.content), children: "\u590D\u5236" })
202
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { color: "default", variant: "text", size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyOutlined, {}), onClick: () => common.copyText(data.content), children: "\u590D\u5236" })
234
203
  ] }) })
235
204
  ] }),
236
205
  /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, align: "center", className: styles_module_default.fileEditContent, children: /* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content: data.content }) })
@@ -313,9 +282,26 @@ var init_Think = __esm({
313
282
  };
314
283
  }
315
284
  });
316
-
317
- // src/stores/index.ts
318
- init_utils();
285
+ var classifyTime = (timestamp) => {
286
+ const now = dayjs__default.default();
287
+ const target = dayjs__default.default(timestamp);
288
+ if (target.isSame(now, "day")) {
289
+ return "\u4ECA\u5929";
290
+ }
291
+ const diffInDays = now.diff(target, "day");
292
+ if (diffInDays < 7) {
293
+ return "\u6700\u8FD1 7 \u5929";
294
+ } else if (diffInDays < 30) {
295
+ return "\u6700\u8FD1 30 \u5929";
296
+ } else if (diffInDays < 180) {
297
+ return "\u6700\u8FD1\u534A\u5E74";
298
+ } else {
299
+ return "\u66F4\u65E9";
300
+ }
301
+ };
302
+ var replaceThinkTags = (str) => {
303
+ return str.replace(/<think>/g, ":::alert type=think data={content:'").replace(/<\/think>/g, "'} :::");
304
+ };
319
305
 
320
306
  // src/services/index.ts
321
307
  var createChatService = (request) => {
@@ -451,6 +437,7 @@ function createChatStore() {
451
437
  },
452
438
  hooks: {},
453
439
  layout: {},
440
+ /** 文件预览状态 */
454
441
  preview: {
455
442
  file: {},
456
443
  isEdit: false
@@ -458,7 +445,9 @@ function createChatStore() {
458
445
  // isShow: 0, // 0 不显示 1 显示 2 用户关闭
459
446
  // isIntact: false // true 完整 false 不完整
460
447
  },
448
+ /** 当前用户信息 */
461
449
  userInfo: {},
450
+ /** 聊天参数配置 */
462
451
  params: {}
463
452
  });
464
453
  const setServices = ({ baseUrl = "/api" } = {}) => {
@@ -500,14 +489,16 @@ function createChatStore() {
500
489
  },
501
490
  name: "name",
502
491
  iconUrl: "avatar",
503
- description: "name"
492
+ description: "remark"
504
493
  });
505
494
  };
506
495
  const receiver = valtio.proxy({
496
+ /** 当前激活的接收者信息(智能体或专家) */
507
497
  active: {},
498
+ /** 接收者加载状态 */
508
499
  loading: false,
500
+ /** 接收者透传参数,后期可能扩展不透传参数 */
509
501
  params: {}
510
- // 透传参数,后期可能扩展不透传参数
511
502
  });
512
503
  const setReceiverParams = (params) => {
513
504
  if (common.isObject(params)) {
@@ -566,10 +557,15 @@ function createChatStore() {
566
557
  setReceiverParams();
567
558
  };
568
559
  const character = valtio.proxy({
560
+ /** 性格列表 */
569
561
  list: [],
562
+ /** 当前激活的性格 */
570
563
  active: {},
564
+ /** 性格选择面板是否打开 */
571
565
  open: false,
566
+ /** 加载性格列表的状态 */
572
567
  loading: false,
568
+ /** 切换性格时的加载状态 */
573
569
  switchLoading: false
574
570
  });
575
571
  const getCharacters = async (agentId) => {
@@ -604,16 +600,20 @@ function createChatStore() {
604
600
  }
605
601
  };
606
602
  const conversations = valtio.proxy({
603
+ /** 会话列表数据 */
607
604
  list: {
608
605
  items: [],
606
+ /** 分页查询参数 */
609
607
  params: {
610
608
  pageNum: 1,
611
609
  pageSize: 1e3
612
610
  }
613
611
  },
612
+ /** 当前会话索引,创建会话时更新,促使页面更新会话列表 */
614
613
  updateIndex: 0,
615
- // 当前会话索引, 创建会话时更新,促使页面更新会话列表
614
+ /** 获取会话列表的加载状态 */
616
615
  loading: false,
616
+ /** 删除会话的加载状态 */
617
617
  delLoading: false
618
618
  });
619
619
  const getConversations = async (targetId, targetType) => {
@@ -659,14 +659,18 @@ function createChatStore() {
659
659
  }
660
660
  };
661
661
  const conversation = valtio.proxy({
662
- // 每个会话单独存储
662
+ /** 当前激活的会话信息 */
663
663
  active: {
664
664
  id: "",
665
+ /** 会话成员对象,包含用户、智能体、专家等 */
665
666
  member: {}
666
667
  },
668
+ /** 每个会话的消息存储,以会话ID为键 */
667
669
  messages: {},
670
+ /** 消息反馈状态 */
668
671
  feedback: {
669
672
  // open: false,
673
+ /** 反馈操作加载状态 */
670
674
  loading: false
671
675
  // recordId: '',
672
676
  // target: undefined as number | undefined
@@ -714,14 +718,18 @@ function createChatStore() {
714
718
  };
715
719
  const setInitMessage = async (conversationId) => {
716
720
  conversation.messages[conversationId] = {
721
+ /** 输入框内容 */
717
722
  content: "",
723
+ /** 上传文件列表 */
718
724
  files: [],
719
- // 上传文件内容
725
+ /** 头部展开状态 */
720
726
  headerOpen: false,
727
+ /** 消息发送/接收加载状态 */
721
728
  loading: false,
729
+ /** 消息列表 */
722
730
  message: [],
731
+ /** 推荐问题列表 */
723
732
  questionList: []
724
- // 推荐问题
725
733
  };
726
734
  };
727
735
  const resolveConversationId = async (receiverId, strategy = 2) => {
@@ -826,13 +834,13 @@ function createChatStore() {
826
834
  if (other) return other;
827
835
  return void 0;
828
836
  };
829
- const sendMessage = async (message3, files = [], params) => {
837
+ const sendMessage = async (message2, files = [], params) => {
830
838
  const conversationId = conversation.active.id;
831
839
  if (conversation.messages[conversationId].loading) return;
832
840
  let msgContent = "", msgFiles;
833
841
  const references = conversation.messages[conversationId].references;
834
- if (message3) {
835
- msgContent = message3;
842
+ if (message2) {
843
+ msgContent = message2;
836
844
  msgFiles = files;
837
845
  } else {
838
846
  if (references?.type === 1 && references?.content?.markdown) {
@@ -860,9 +868,9 @@ function createChatStore() {
860
868
  stream: true
861
869
  };
862
870
  const extraParams = common.deepCopy(config.params.params || {});
863
- Object.assign(extraParams, receiver.params, message3 ? {} : references?.params, params);
871
+ Object.assign(extraParams, receiver.params, message2 ? {} : references?.params, params);
864
872
  sendParams.params = JSON.stringify(extraParams);
865
- if (!message3) {
873
+ if (!message2) {
866
874
  setContent("");
867
875
  setFileList([]);
868
876
  setReferences();
@@ -908,15 +916,15 @@ function createChatStore() {
908
916
  const messages = conversation.messages[msg.conversationId].message;
909
917
  const idx = findMsgIndex(msg.conversationId, msg.id);
910
918
  if (idx === -1) return;
911
- const message3 = messages[idx];
919
+ const message2 = messages[idx];
912
920
  conversation.messages[msg.conversationId].loading = true;
913
- if (message3?.type === "STEP_STARTED" || message3?.type === "TEXT_MESSAGE_START") {
921
+ if (message2?.type === "STEP_STARTED" || message2?.type === "TEXT_MESSAGE_START") {
914
922
  messages[idx] = msg;
915
923
  return;
916
924
  }
917
925
  messages[idx] = {
918
- ...message3,
919
- msgContent: message3.msgContent + (msg.msgContent || "")
926
+ ...message2,
927
+ msgContent: message2.msgContent + (msg.msgContent || "")
920
928
  };
921
929
  };
922
930
  const endCallback = (msg) => {
@@ -956,35 +964,65 @@ function createChatStore() {
956
964
  }
957
965
  };
958
966
  return {
967
+ /** 全局配置对象 */
959
968
  config,
969
+ /** 设置服务配置 */
960
970
  setServices,
971
+ /** 设置文件预览 */
961
972
  setPreview,
973
+ /** 设置布局配置 */
962
974
  setLayout,
975
+ /** 设置生命周期钩子 */
963
976
  setHooks,
977
+ /** 设置聊天参数 */
964
978
  setParams,
979
+ /** 设置用户信息 */
965
980
  setUserInfo,
981
+ /** 智能体性格状态 */
966
982
  character,
983
+ /** 获取性格列表 */
967
984
  getCharacters,
985
+ /** 打开性格选择面板 */
968
986
  openCharacterList,
987
+ /** 关闭性格选择面板 */
969
988
  closeCharacterList,
989
+ /** 切换性格 */
970
990
  switchCharacter,
991
+ /** 接收者状态 */
971
992
  receiver,
993
+ /** 设置接收者参数 */
972
994
  setReceiverParams,
995
+ /** 历史会话状态 */
973
996
  conversations,
997
+ /** 获取会话列表 */
974
998
  getConversations,
999
+ /** 删除会话 */
975
1000
  delConversation,
1001
+ /** 当前会话状态 */
976
1002
  conversation,
1003
+ /** 设置说话人类型 */
977
1004
  setSpeakHuman,
1005
+ /** 设置引用消息 */
978
1006
  setReferences,
1007
+ /** 设置消息内容 */
979
1008
  setContent,
1009
+ /** 设置文件列表 */
980
1010
  setFileList,
1011
+ /** 设置头部展开状态 */
981
1012
  setHeaderOpen,
1013
+ /** 消息反馈操作 */
982
1014
  feedback,
1015
+ /** 切换智能体会话 */
983
1016
  switchAgentConversation,
1017
+ /** 创建新会话 */
984
1018
  createConversation,
1019
+ /** 切换会话 */
985
1020
  switchConversation,
1021
+ /** 发送消息 */
986
1022
  sendMessage,
1023
+ /** 取消接收 */
987
1024
  cancelReceive,
1025
+ /** 接收消息 */
988
1026
  acceptMessage
989
1027
  };
990
1028
  }
@@ -992,9 +1030,6 @@ function createChatStore() {
992
1030
  // src/ui/layouts/index.tsx
993
1031
  init_Context();
994
1032
 
995
- // src/components/MessageRender.tsx
996
- init_utils();
997
-
998
1033
  // src/ui/common/markdownAlert/index.ts
999
1034
  var customComponents = {
1000
1035
  appCard: () => Promise.resolve().then(() => (init_AppCard(), AppCard_exports)),
@@ -1013,17 +1048,17 @@ var styles_module_default2 = {
1013
1048
  chatSender: "styles_module_chatSender",
1014
1049
  chatQuoteMsg: "styles_module_chatQuoteMsg"
1015
1050
  };
1016
- var MessageRender_default = ({ message: message3, placement }) => {
1017
- return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, children: !(message3.msgContent || message3.msgFiles.length) ? /* @__PURE__ */ jsxRuntime.jsx(antd.Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1018
- message3.msgContent && /* @__PURE__ */ jsxRuntime.jsx(
1051
+ var MessageRender_default = ({ message: message2, placement }) => {
1052
+ return /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, children: !(message2.msgContent || message2.msgFiles.length) ? /* @__PURE__ */ jsxRuntime.jsx(antd.Typography, { children: /* @__PURE__ */ jsxRuntime.jsx(antd.Spin, { size: "small" }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1053
+ message2.msgContent && /* @__PURE__ */ jsxRuntime.jsx(
1019
1054
  x.Bubble,
1020
1055
  {
1021
1056
  placement,
1022
- className: classNames8__default.default({ [styles_module_default2.loadingMessage]: message3.type }),
1023
- content: /* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content: replaceThinkTags(message3.msgContent), customComponents })
1057
+ className: classNames8__default.default({ [styles_module_default2.loadingMessage]: message2.type }),
1058
+ content: /* @__PURE__ */ jsxRuntime.jsx(common.RenderMarkdown, { content: replaceThinkTags(message2.msgContent), customComponents })
1024
1059
  }
1025
1060
  ),
1026
- message3.msgFiles?.map((file) => /* @__PURE__ */ jsxRuntime.jsx(
1061
+ message2.msgFiles?.map((file) => /* @__PURE__ */ jsxRuntime.jsx(
1027
1062
  x.Bubble,
1028
1063
  {
1029
1064
  className: "m-t-8",
@@ -1043,19 +1078,19 @@ var MessageRender_default = ({ message: message3, placement }) => {
1043
1078
  },
1044
1079
  file.content
1045
1080
  )),
1046
- message3.quoteMsg?.id && /* @__PURE__ */ jsxRuntime.jsx(
1081
+ message2.quoteMsg?.id && /* @__PURE__ */ jsxRuntime.jsx(
1047
1082
  x.Bubble,
1048
1083
  {
1049
1084
  className: classNames8__default.default(styles_module_default2.chatQuoteMsg),
1050
1085
  placement,
1051
1086
  content: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, gap: 8, children: [
1052
- message3.quoteMsg.msgContent && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
1087
+ message2.quoteMsg.msgContent && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
1053
1088
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u3010\u5F15\u7528\u6D88\u606F\u3011\uFF1A" }),
1054
- /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { flex: 1, className: "text-ellipsis", children: message3.quoteMsg.msgContent })
1089
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { flex: 1, className: "text-ellipsis", children: message2.quoteMsg.msgContent })
1055
1090
  ] }),
1056
- message3.quoteMsg?.msgFiles && message3.quoteMsg.msgFiles.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
1091
+ message2.quoteMsg?.msgFiles && message2.quoteMsg.msgFiles.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
1057
1092
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u3010\u5F15\u7528\u6587\u4EF6\u3011\uFF1A" }),
1058
- /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, wrap: true, flex: 1, children: message3.quoteMsg.msgFiles.map((file) => /* @__PURE__ */ jsxRuntime.jsx(
1093
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { gap: 8, wrap: true, flex: 1, children: message2.quoteMsg.msgFiles.map((file) => /* @__PURE__ */ jsxRuntime.jsx(
1059
1094
  x.Attachments.FileCard,
1060
1095
  {
1061
1096
  item: {
@@ -1081,7 +1116,6 @@ var MEMBER_TYPE = {
1081
1116
  };
1082
1117
 
1083
1118
  // src/ui/common/BubbleListItems.tsx
1084
- init_utils();
1085
1119
  init_Context();
1086
1120
 
1087
1121
  // src/ui/common/styles.module.less
@@ -1214,36 +1248,36 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
1214
1248
  [chatMessage?.questionList]
1215
1249
  );
1216
1250
  const chatRecords = react.useMemo(() => {
1217
- return (chatMessage?.message || []).map((message3, index) => {
1218
- const role = conversationRoles[MEMBER_TYPE[message3.sender.type]] || {};
1251
+ return (chatMessage?.message || []).map((message2, index) => {
1252
+ const role = conversationRoles[MEMBER_TYPE[message2.sender.type]] || {};
1219
1253
  return {
1220
- key: message3.id,
1254
+ key: message2.id,
1221
1255
  placement: role.placement,
1222
1256
  variant: "borderless",
1223
1257
  avatar: role.avatar,
1224
- content: /* @__PURE__ */ jsxRuntime.jsx(MessageRender_default, { message: message3, placement: role.placement }),
1258
+ content: /* @__PURE__ */ jsxRuntime.jsx(MessageRender_default, { message: message2, placement: role.placement }),
1225
1259
  footer: role.user === "agent" && /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { children: [
1226
- /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => copy(message3.msgContent), color: "default", variant: "text", size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyOutlined, {}) }),
1260
+ /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { onClick: () => common.copyText(message2.msgContent), color: "default", variant: "text", size: "small", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyOutlined, {}) }),
1227
1261
  /* @__PURE__ */ jsxRuntime.jsx(
1228
1262
  antd.Button,
1229
1263
  {
1230
- color: message3.msgFeedback === 1 ? "primary" : "default",
1231
- disabled: !!message3.type,
1264
+ color: message2.msgFeedback === 1 ? "primary" : "default",
1265
+ disabled: !!message2.type,
1232
1266
  size: "small",
1233
1267
  variant: "text",
1234
1268
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.LikeOutlined, {}),
1235
- onClick: () => chatStore.feedback(conversationState.active.id, message3.id, 1, index)
1269
+ onClick: () => chatStore.feedback(conversationState.active.id, message2.id, 1, index)
1236
1270
  }
1237
1271
  ),
1238
1272
  /* @__PURE__ */ jsxRuntime.jsx(
1239
1273
  antd.Button,
1240
1274
  {
1241
- color: message3.msgFeedback === 2 ? "primary" : "default",
1242
- disabled: !!message3.type,
1275
+ color: message2.msgFeedback === 2 ? "primary" : "default",
1276
+ disabled: !!message2.type,
1243
1277
  size: "small",
1244
1278
  variant: "text",
1245
1279
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.DislikeOutlined, {}),
1246
- onClick: () => chatStore.feedback(conversationState.active.id, message3.id, 2, index)
1280
+ onClick: () => chatStore.feedback(conversationState.active.id, message2.id, 2, index)
1247
1281
  }
1248
1282
  )
1249
1283
  ] })
@@ -1282,7 +1316,7 @@ var BubbleListItems_default = ({ firstMessage = false, avatar = { user: false, a
1282
1316
  const handleScroll = (el) => {
1283
1317
  const target = el.target;
1284
1318
  const distanceToBottom = target.scrollHeight - target.scrollTop - target.clientHeight;
1285
- autoScrollRef.current = distanceToBottom < 100;
1319
+ autoScrollRef.current = distanceToBottom < 150;
1286
1320
  };
1287
1321
  react.useEffect(() => {
1288
1322
  autoScrollRef.current = true;
@@ -1488,7 +1522,7 @@ var ChatHeader_default = ({
1488
1522
  ] }) });
1489
1523
  };
1490
1524
  var Attachments_default = react.forwardRef(({ fileUpload, fileUploadConfig = [], fileList = [], onChange, extraParams }, ref) => {
1491
- const { message: message3 } = antd.App.useApp();
1525
+ const { message: message2 } = antd.App.useApp();
1492
1526
  const fileListRef = react.useRef([]);
1493
1527
  const [attachedFiles, setAttachedFiles, getAttachedFiles] = common.useRefState([]);
1494
1528
  react.useEffect(() => {
@@ -1516,7 +1550,7 @@ var Attachments_default = react.forwardRef(({ fileUpload, fileUploadConfig = [],
1516
1550
  onChange(files);
1517
1551
  }, [attachedFiles]);
1518
1552
  const onErrorTip = common.useDebounce((errorMsg) => {
1519
- message3.error(errorMsg);
1553
+ message2.error(errorMsg);
1520
1554
  }, 300);
1521
1555
  const findConfigByFile = (file) => {
1522
1556
  return fileUploadConfig.find((cfg) => cfg.allowedFileTypes?.includes(common.getFileSuffixName(file.name).toLocaleUpperCase()));