whyuzeim 1.0.7 → 1.0.8

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.
@@ -26,7 +26,7 @@ var index$1 = require('../AddMember/index.js');
26
26
  var type = require('../type.js');
27
27
 
28
28
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), true)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
29
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context7 = ownKeys(Object(t), true)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context8 = ownKeys(Object(t))).call(_context8, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
30
30
  var Chatbox = function Chatbox(props) {
31
31
  var _userInfo$uid3;
32
32
  var _useContext = React.useContext(context.Context),
@@ -423,18 +423,18 @@ var Chatbox = function Chatbox(props) {
423
423
  return _getShareGroupInfo.apply(this, arguments);
424
424
  }
425
425
  function _getShareGroupInfo() {
426
- _getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(shareInfo, isJoined) {
426
+ _getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(shareInfo, isJoined) {
427
427
  var params, response, data, groupInfo, waitJoinGroupinfo, conversation, _response$data3;
428
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
429
- while (1) switch (_context4.prev = _context4.next) {
428
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
429
+ while (1) switch (_context6.prev = _context6.next) {
430
430
  case 0:
431
431
  params = {
432
432
  sendbirdid: shareInfo === null || shareInfo === void 0 ? void 0 : shareInfo.objectId
433
433
  };
434
- _context4.next = 3;
434
+ _context6.next = 3;
435
435
  return http.post("/capi/account/imchannel/getdetails", params);
436
436
  case 3:
437
- response = _context4.sent;
437
+ response = _context6.sent;
438
438
  data = response.data;
439
439
  if (data && data.code === 200 && data.data) {
440
440
  groupInfo = data.data;
@@ -471,9 +471,9 @@ var Chatbox = function Chatbox(props) {
471
471
  }
472
472
  case 6:
473
473
  case "end":
474
- return _context4.stop();
474
+ return _context6.stop();
475
475
  }
476
- }, _callee4);
476
+ }, _callee6);
477
477
  }));
478
478
  return _getShareGroupInfo.apply(this, arguments);
479
479
  }
@@ -540,6 +540,60 @@ var Chatbox = function Chatbox(props) {
540
540
  return _ref12.apply(this, arguments);
541
541
  };
542
542
  }();
543
+ // 给agent 发送消息需要调用该接口
544
+ var sendAgentMsg = /*#__PURE__*/function () {
545
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
546
+ var userid,
547
+ content,
548
+ options,
549
+ _args4 = arguments;
550
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
551
+ while (1) switch (_context4.prev = _context4.next) {
552
+ case 0:
553
+ userid = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : '';
554
+ content = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : '';
555
+ _context4.prev = 2;
556
+ options = {
557
+ userid: userid,
558
+ content: content
559
+ };
560
+ _context4.next = 6;
561
+ return http.post('/api/imchannel/sendagentmessage', options);
562
+ case 6:
563
+ _context4.next = 11;
564
+ break;
565
+ case 8:
566
+ _context4.prev = 8;
567
+ _context4.t0 = _context4["catch"](2);
568
+ console.log(_context4.t0);
569
+ case 11:
570
+ case "end":
571
+ return _context4.stop();
572
+ }
573
+ }, _callee4, null, [[2, 8]]);
574
+ }));
575
+ return function sendAgentMsg() {
576
+ return _ref13.apply(this, arguments);
577
+ };
578
+ }();
579
+ var afterSendMsg = /*#__PURE__*/function () {
580
+ var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(msgInfo) {
581
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
582
+ while (1) switch (_context5.prev = _context5.next) {
583
+ case 0:
584
+ if (agoraChatUikit.rootStore.conversationStore.currentCvs.chatType === 'singleChat') {
585
+ sendAgentMsg(agoraChatUikit.rootStore.conversationStore.currentCvs.conversationId, msgInfo.msg);
586
+ }
587
+ case 1:
588
+ case "end":
589
+ return _context5.stop();
590
+ }
591
+ }, _callee5);
592
+ }));
593
+ return function afterSendMsg(_x5) {
594
+ return _ref14.apply(this, arguments);
595
+ };
596
+ }();
543
597
  React.useEffect(function () {
544
598
  getHeaderInfo();
545
599
  }, []);
@@ -555,7 +609,11 @@ var Chatbox = function Chatbox(props) {
555
609
  className: "yuze_chat_container w-full h-full overflow-hidden flex flex-col"
556
610
  }, agoraChatUikit.rootStore.conversationStore.currentCvs.conversationId && customHeader(), /*#__PURE__*/React.createElement(agoraChatUikit.Chat, {
557
611
  className: "flex-1",
558
- messageInputProps: _objectSpread({}, type.commonMessageInputConfig),
612
+ messageInputProps: _objectSpread(_objectSpread({}, type.commonMessageInputConfig), {}, {
613
+ onSendMessage: function onSendMessage(msg) {
614
+ return afterSendMsg(msg);
615
+ }
616
+ }),
559
617
  renderHeader: function renderHeader() {
560
618
  return undefined;
561
619
  },
@@ -56,7 +56,7 @@ var CustomChatView = function CustomChatView(props) {
56
56
  var _useSDK = agoraChatUikit.useSDK(),
57
57
  MessageSDK = _useSDK.ChatSDK;
58
58
  var renderTxtMsg = function renderTxtMsg(msg) {
59
- var _userInfo$uid, _ref;
59
+ var _userInfo$uid;
60
60
  var isMySelf = (msg === null || msg === void 0 ? void 0 : msg.bySelf) === true || (msg === null || msg === void 0 ? void 0 : msg.from.toLowerCase()) === ((_userInfo$uid = userInfo.uid) === null || _userInfo$uid === void 0 ? void 0 : _userInfo$uid.toLowerCase());
61
61
  return /*#__PURE__*/React.createElement(agoraChatUikit.TextMessage, {
62
62
  bubbleStyle: {
@@ -76,7 +76,7 @@ var CustomChatView = function CustomChatView(props) {
76
76
  renderUserProfile: function renderUserProfile() {
77
77
  return null;
78
78
  },
79
- customAction: (_ref = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref !== void 0 ? _ref : undefined
79
+ customAction: undefined
80
80
  });
81
81
  };
82
82
  var renderShareCardMsg = function renderShareCardMsg(msg) {
@@ -102,7 +102,6 @@ var CustomChatView = function CustomChatView(props) {
102
102
  if (msg.type === "txt") {
103
103
  return renderTxtMsg(msg);
104
104
  } else if (msg.type === 'img') {
105
- var _ref2;
106
105
  return /*#__PURE__*/React.createElement(agoraChatUikit.ImageMessage, {
107
106
  reaction: false,
108
107
  select: false,
@@ -110,11 +109,10 @@ var CustomChatView = function CustomChatView(props) {
110
109
  renderUserProfile: function renderUserProfile() {
111
110
  return null;
112
111
  },
113
- customAction: (_ref2 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref2 !== void 0 ? _ref2 : undefined,
112
+ customAction: undefined,
114
113
  imageMessage: msg
115
114
  });
116
115
  } else if (msg.type === 'file') {
117
- var _ref3;
118
116
  return /*#__PURE__*/React.createElement(agoraChatUikit.FileMessage, {
119
117
  bubbleStyle: {
120
118
  background: msg.bySelf ? "var(--im-msg-bubble-color-right)" : "var(--im-msg-bubble-color-left)",
@@ -128,11 +126,10 @@ var CustomChatView = function CustomChatView(props) {
128
126
  renderUserProfile: function renderUserProfile() {
129
127
  return null;
130
128
  },
131
- customAction: (_ref3 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref3 !== void 0 ? _ref3 : undefined,
129
+ customAction: undefined,
132
130
  fileMessage: msg
133
131
  });
134
132
  } else if (msg.type === 'video') {
135
- var _ref4;
136
133
  return /*#__PURE__*/React.createElement(agoraChatUikit.VideoMessage, {
137
134
  reaction: false,
138
135
  select: false,
@@ -140,11 +137,10 @@ var CustomChatView = function CustomChatView(props) {
140
137
  renderUserProfile: function renderUserProfile() {
141
138
  return null;
142
139
  },
143
- customAction: (_ref4 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref4 !== void 0 ? _ref4 : undefined,
140
+ customAction: undefined,
144
141
  videoMessage: msg
145
142
  });
146
143
  } else if (msg.type === 'audio') {
147
- var _ref5;
148
144
  return /*#__PURE__*/React.createElement(agoraChatUikit.AudioMessage, {
149
145
  reaction: false,
150
146
  select: false,
@@ -152,11 +148,11 @@ var CustomChatView = function CustomChatView(props) {
152
148
  renderUserProfile: function renderUserProfile() {
153
149
  return null;
154
150
  },
155
- customAction: (_ref5 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref5 !== void 0 ? _ref5 : undefined,
151
+ customAction: undefined,
156
152
  audioMessage: msg
157
153
  });
158
154
  } else if (msg.type === 'custom' && ((msg === null || msg === void 0 ? void 0 : msg.customEvent) === 'im_group_share' || (msg === null || msg === void 0 ? void 0 : msg.customEvent) === 'personcenter_share')) {
159
- var _userInfo$uid2, _ref6;
155
+ var _userInfo$uid2;
160
156
  var isMySelf = (msg === null || msg === void 0 ? void 0 : msg.bySelf) === true || (msg === null || msg === void 0 ? void 0 : msg.from.toLowerCase()) === (userInfo === null || userInfo === void 0 || (_userInfo$uid2 = userInfo.uid) === null || _userInfo$uid2 === void 0 ? void 0 : _userInfo$uid2.toLowerCase());
161
157
  return /*#__PURE__*/React.createElement(agoraChatUikit.BaseMessage, {
162
158
  bubbleStyle: {
@@ -172,7 +168,7 @@ var CustomChatView = function CustomChatView(props) {
172
168
  renderUserProfile: function renderUserProfile() {
173
169
  return null;
174
170
  },
175
- customAction: (_ref6 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref6 !== void 0 ? _ref6 : undefined,
171
+ customAction: undefined,
176
172
  children: renderShareCardMsg(msg)
177
173
  });
178
174
  } else {
@@ -200,11 +196,11 @@ var CustomChatView = function CustomChatView(props) {
200
196
  var _group$info;
201
197
  // @ts-ignore
202
198
  if (cvs.conversationId == (group === null || group === void 0 ? void 0 : group.groupid) && group !== null && group !== void 0 && (_group$info = group.info) !== null && _group$info !== void 0 && _group$info.custom) {
203
- var _group$info2, _customObj$headimgurl, _group$info$affiliati, _group$info3, _ref7, _ref8, _group$name, _group$info4;
199
+ var _group$info2, _customObj$headimgurl, _group$info$affiliati, _group$info3, _ref, _ref2, _group$name, _group$info4;
204
200
  var customObj = JSON.parse(group === null || group === void 0 || (_group$info2 = group.info) === null || _group$info2 === void 0 ? void 0 : _group$info2.custom);
205
201
  var imageurl = (_customObj$headimgurl = customObj === null || customObj === void 0 ? void 0 : customObj.headimgurl) !== null && _customObj$headimgurl !== void 0 ? _customObj$headimgurl : '';
206
202
  var member = (_group$info$affiliati = group === null || group === void 0 || (_group$info3 = group.info) === null || _group$info3 === void 0 ? void 0 : _group$info3.affiliations_count) !== null && _group$info$affiliati !== void 0 ? _group$info$affiliati : 0;
207
- var name = (_ref7 = (_ref8 = (_group$name = group === null || group === void 0 ? void 0 : group.name) !== null && _group$name !== void 0 ? _group$name : group === null || group === void 0 || (_group$info4 = group.info) === null || _group$info4 === void 0 ? void 0 : _group$info4.name) !== null && _ref8 !== void 0 ? _ref8 : cvs.name) !== null && _ref7 !== void 0 ? _ref7 : '';
203
+ var name = (_ref = (_ref2 = (_group$name = group === null || group === void 0 ? void 0 : group.name) !== null && _group$name !== void 0 ? _group$name : group === null || group === void 0 || (_group$info4 = group.info) === null || _group$info4 === void 0 ? void 0 : _group$info4.name) !== null && _ref2 !== void 0 ? _ref2 : cvs.name) !== null && _ref !== void 0 ? _ref : '';
208
204
  setHeaderInfo(function (prevState) {
209
205
  return _objectSpread(_objectSpread({}, prevState), {}, {
210
206
  headerImageURL: imageurl,
@@ -235,9 +231,9 @@ var CustomChatView = function CustomChatView(props) {
235
231
  }
236
232
  });
237
233
  } else {
238
- var _appUsersInfo$avataru, _ref9, _appUsersInfo$name;
234
+ var _appUsersInfo$avataru, _ref3, _appUsersInfo$name;
239
235
  var imageurl = (_appUsersInfo$avataru = appUsersInfo === null || appUsersInfo === void 0 ? void 0 : appUsersInfo.avatarurl) !== null && _appUsersInfo$avataru !== void 0 ? _appUsersInfo$avataru : '';
240
- var name = (_ref9 = (_appUsersInfo$name = appUsersInfo === null || appUsersInfo === void 0 ? void 0 : appUsersInfo.name) !== null && _appUsersInfo$name !== void 0 ? _appUsersInfo$name : cvs.name) !== null && _ref9 !== void 0 ? _ref9 : '';
236
+ var name = (_ref3 = (_appUsersInfo$name = appUsersInfo === null || appUsersInfo === void 0 ? void 0 : appUsersInfo.name) !== null && _appUsersInfo$name !== void 0 ? _appUsersInfo$name : cvs.name) !== null && _ref3 !== void 0 ? _ref3 : '';
241
237
  setHeaderInfo(function (prevState) {
242
238
  return _objectSpread(_objectSpread({}, prevState), {}, {
243
239
  headerImageURL: imageurl,
@@ -307,7 +303,7 @@ var CustomChatView = function CustomChatView(props) {
307
303
  return _getShareGroupInfo.apply(this, arguments);
308
304
  }
309
305
  var clickCustomGroupCardMsg = /*#__PURE__*/function () {
310
- var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(msg) {
306
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(msg) {
311
307
  var params, _response$data, response, _msg$customExts3, _msg$customExts4, _msg$customExts5, _msg$customExts6, conversation;
312
308
  return _regeneratorRuntime.wrap(function _callee$(_context2) {
313
309
  while (1) switch (_context2.prev = _context2.next) {
@@ -366,7 +362,7 @@ var CustomChatView = function CustomChatView(props) {
366
362
  }, _callee, null, [[4, 11]]);
367
363
  }));
368
364
  return function clickCustomGroupCardMsg(_x3) {
369
- return _ref10.apply(this, arguments);
365
+ return _ref4.apply(this, arguments);
370
366
  };
371
367
  }();
372
368
  React.useEffect(function () {
@@ -415,7 +411,7 @@ var CustomChatView = function CustomChatView(props) {
415
411
  setCurAgentId = _useState10[1];
416
412
  // 获取agent列表
417
413
  var getCollectList = /*#__PURE__*/function () {
418
- var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
414
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
419
415
  var _yield$http$get, data;
420
416
  return _regeneratorRuntime.wrap(function _callee2$(_context3) {
421
417
  while (1) switch (_context3.prev = _context3.next) {
@@ -446,7 +442,7 @@ var CustomChatView = function CustomChatView(props) {
446
442
  }, _callee2, null, [[0, 8]]);
447
443
  }));
448
444
  return function getCollectList() {
449
- return _ref11.apply(this, arguments);
445
+ return _ref5.apply(this, arguments);
450
446
  };
451
447
  }();
452
448
  var _useState11 = React.useState([]),
@@ -454,7 +450,7 @@ var CustomChatView = function CustomChatView(props) {
454
450
  agentTipList = _useState12[0],
455
451
  setAgentTipList = _useState12[1];
456
452
  var getTipsList = /*#__PURE__*/function () {
457
- var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
453
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
458
454
  var _yield$http$get2, data;
459
455
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
460
456
  while (1) switch (_context4.prev = _context4.next) {
@@ -479,7 +475,7 @@ var CustomChatView = function CustomChatView(props) {
479
475
  }, _callee3, null, [[0, 8]]);
480
476
  }));
481
477
  return function getTipsList() {
482
- return _ref12.apply(this, arguments);
478
+ return _ref6.apply(this, arguments);
483
479
  };
484
480
  }();
485
481
  React.useEffect(function () {
@@ -488,7 +484,7 @@ var CustomChatView = function CustomChatView(props) {
488
484
  getTipsList();
489
485
  }, []);
490
486
  var changeAgent = /*#__PURE__*/function () {
491
- var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(val) {
487
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(val) {
492
488
  var curAgent;
493
489
  return _regeneratorRuntime.wrap(function _callee4$(_context5) {
494
490
  while (1) switch (_context5.prev = _context5.next) {
@@ -511,12 +507,12 @@ var CustomChatView = function CustomChatView(props) {
511
507
  }, _callee4);
512
508
  }));
513
509
  return function changeAgent(_x4) {
514
- return _ref13.apply(this, arguments);
510
+ return _ref7.apply(this, arguments);
515
511
  };
516
512
  }();
517
513
  // 给agent 发送消息需要调用该接口
518
514
  var sendAgentMsg = /*#__PURE__*/function () {
519
- var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
515
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
520
516
  var userid,
521
517
  content,
522
518
  options,
@@ -548,11 +544,11 @@ var CustomChatView = function CustomChatView(props) {
548
544
  }, _callee5, null, [[2, 8]]);
549
545
  }));
550
546
  return function sendAgentMsg() {
551
- return _ref14.apply(this, arguments);
547
+ return _ref8.apply(this, arguments);
552
548
  };
553
549
  }();
554
550
  var postMessage = /*#__PURE__*/function () {
555
- var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(msg) {
551
+ var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(msg) {
556
552
  var customMessage;
557
553
  return _regeneratorRuntime.wrap(function _callee6$(_context7) {
558
554
  while (1) switch (_context7.prev = _context7.next) {
@@ -575,11 +571,11 @@ var CustomChatView = function CustomChatView(props) {
575
571
  }, _callee6);
576
572
  }));
577
573
  return function postMessage(_x5) {
578
- return _ref15.apply(this, arguments);
574
+ return _ref9.apply(this, arguments);
579
575
  };
580
576
  }();
581
577
  var afterSendMsg = /*#__PURE__*/function () {
582
- var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(msgInfo) {
578
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(msgInfo) {
583
579
  return _regeneratorRuntime.wrap(function _callee7$(_context8) {
584
580
  while (1) switch (_context8.prev = _context8.next) {
585
581
  case 0:
@@ -591,7 +587,7 @@ var CustomChatView = function CustomChatView(props) {
591
587
  }, _callee7);
592
588
  }));
593
589
  return function afterSendMsg(_x6) {
594
- return _ref16.apply(this, arguments);
590
+ return _ref10.apply(this, arguments);
595
591
  };
596
592
  }();
597
593
  return /*#__PURE__*/React.createElement("div", {
@@ -600,7 +596,7 @@ var CustomChatView = function CustomChatView(props) {
600
596
  className: "mb-2 mx-4 py-2 rounded-lg bg-[var(--im-main-bg-five)]"
601
597
  }, /*#__PURE__*/React.createElement(antd.Select, {
602
598
  className: "w-full !h-12 border-none rouded-lg agent-select",
603
- popupClassName: "agent-select-popup",
599
+ popupClassName: "agent-select-popup bg-[var(--im-main-backgroundColor)] text-[var(--im-main-fontColor)]",
604
600
  value: curAgentId,
605
601
  placeholder: "Select your agent to take actions on token",
606
602
  prefix: /*#__PURE__*/React.createElement("img", {
@@ -6,6 +6,7 @@ var _slicedToArray = require('@babel/runtime-corejs3/helpers/esm/slicedToArray')
6
6
  var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
7
7
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
8
8
  var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
9
+ var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
9
10
  var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
10
11
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
11
12
  var React = require('react');
@@ -88,7 +89,7 @@ var CreateGroup = function CreateGroup(props) {
88
89
  var handleDebounceGetFrindList = useDebounce.useDebouncedCallback(handleGetFrindList, 150);
89
90
  var handleCreateGroup = /*#__PURE__*/function () {
90
91
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
91
- var _result2$data, result1, data, result2;
92
+ var _result2$data, result1, name, data, result2;
92
93
  return _regeneratorRuntime.wrap(function _callee2$(_context3) {
93
94
  while (1) switch (_context3.prev = _context3.next) {
94
95
  case 0:
@@ -98,37 +99,38 @@ var CreateGroup = function CreateGroup(props) {
98
99
  return http.get("/capi/account/imchannel/imchannelconfig");
99
100
  case 4:
100
101
  result1 = _context3.sent;
102
+ name = _mapInstanceProperty(member).call(member, function (item) {
103
+ return item.name;
104
+ }).join(",");
101
105
  data = {
102
- name: _mapInstanceProperty(member).call(member, function (item) {
103
- return item.name;
104
- }).join(","),
106
+ name: _sliceInstanceProperty(name).call(name, -32, name.length),
105
107
  customtype: "chat_group",
106
108
  headimgurl: result1.data.data.headimgurl,
107
109
  memberids: _mapInstanceProperty(member).call(member, function (item) {
108
110
  return item.userid;
109
111
  })
110
112
  };
111
- _context3.next = 8;
113
+ _context3.next = 9;
112
114
  return http.post("/capi/account/imchannel/save", data);
113
- case 8:
115
+ case 9:
114
116
  result2 = _context3.sent;
115
117
  setLoading(false);
116
118
  if ((_result2$data = result2.data) !== null && _result2$data !== void 0 && (_result2$data = _result2$data.data) !== null && _result2$data !== void 0 && _result2$data.sendbirdid) {
117
119
  setMember([]);
118
120
  onClose && onClose();
119
121
  }
120
- _context3.next = 17;
122
+ _context3.next = 18;
121
123
  break;
122
- case 13:
123
- _context3.prev = 13;
124
+ case 14:
125
+ _context3.prev = 14;
124
126
  _context3.t0 = _context3["catch"](1);
125
127
  console.log(_context3.t0);
126
128
  setLoading(false);
127
- case 17:
129
+ case 18:
128
130
  case "end":
129
131
  return _context3.stop();
130
132
  }
131
- }, _callee2, null, [[1, 13]]);
133
+ }, _callee2, null, [[1, 14]]);
132
134
  }));
133
135
  return function handleCreateGroup() {
134
136
  return _ref2.apply(this, arguments);
@@ -35,7 +35,6 @@ var TypeItem = function TypeItem(props) {
35
35
  _useState4 = _slicedToArray(_useState3, 2),
36
36
  iisprohibition = _useState4[0],
37
37
  setIisprohibition = _useState4[1];
38
- console.log(groupRoleType, 'erwrewrw');
39
38
  return /*#__PURE__*/React.createElement("div", {
40
39
  className: "yuze-typeItem w-full flex flex-row justify-between items-center px-2 cursor-pointer",
41
40
  onClick: onClick
@@ -21,10 +21,10 @@ import { Context } from '../IM/context.js';
21
21
  import { Modal, Button, message } from 'antd';
22
22
  import JoinGroupDialog from './JoinGroupDialog/index.js';
23
23
  import AddMember from '../AddMember/index.js';
24
- import { commonMessageProps, commonMessageInputConfig } from '../type.js';
24
+ import { commonMessageInputConfig, commonMessageProps } from '../type.js';
25
25
 
26
26
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
27
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context5 = ownKeys(Object(t), true)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context6 = ownKeys(Object(t))).call(_context6, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
27
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context7 = ownKeys(Object(t), true)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context8 = ownKeys(Object(t))).call(_context8, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
28
28
  var Chatbox = function Chatbox(props) {
29
29
  var _userInfo$uid3;
30
30
  var _useContext = useContext(Context),
@@ -421,18 +421,18 @@ var Chatbox = function Chatbox(props) {
421
421
  return _getShareGroupInfo.apply(this, arguments);
422
422
  }
423
423
  function _getShareGroupInfo() {
424
- _getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(shareInfo, isJoined) {
424
+ _getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(shareInfo, isJoined) {
425
425
  var params, response, data, groupInfo, waitJoinGroupinfo, conversation, _response$data3;
426
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
427
- while (1) switch (_context4.prev = _context4.next) {
426
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
427
+ while (1) switch (_context6.prev = _context6.next) {
428
428
  case 0:
429
429
  params = {
430
430
  sendbirdid: shareInfo === null || shareInfo === void 0 ? void 0 : shareInfo.objectId
431
431
  };
432
- _context4.next = 3;
432
+ _context6.next = 3;
433
433
  return http.post("/capi/account/imchannel/getdetails", params);
434
434
  case 3:
435
- response = _context4.sent;
435
+ response = _context6.sent;
436
436
  data = response.data;
437
437
  if (data && data.code === 200 && data.data) {
438
438
  groupInfo = data.data;
@@ -469,9 +469,9 @@ var Chatbox = function Chatbox(props) {
469
469
  }
470
470
  case 6:
471
471
  case "end":
472
- return _context4.stop();
472
+ return _context6.stop();
473
473
  }
474
- }, _callee4);
474
+ }, _callee6);
475
475
  }));
476
476
  return _getShareGroupInfo.apply(this, arguments);
477
477
  }
@@ -538,6 +538,60 @@ var Chatbox = function Chatbox(props) {
538
538
  return _ref12.apply(this, arguments);
539
539
  };
540
540
  }();
541
+ // 给agent 发送消息需要调用该接口
542
+ var sendAgentMsg = /*#__PURE__*/function () {
543
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
544
+ var userid,
545
+ content,
546
+ options,
547
+ _args4 = arguments;
548
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
549
+ while (1) switch (_context4.prev = _context4.next) {
550
+ case 0:
551
+ userid = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : '';
552
+ content = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : '';
553
+ _context4.prev = 2;
554
+ options = {
555
+ userid: userid,
556
+ content: content
557
+ };
558
+ _context4.next = 6;
559
+ return http.post('/api/imchannel/sendagentmessage', options);
560
+ case 6:
561
+ _context4.next = 11;
562
+ break;
563
+ case 8:
564
+ _context4.prev = 8;
565
+ _context4.t0 = _context4["catch"](2);
566
+ console.log(_context4.t0);
567
+ case 11:
568
+ case "end":
569
+ return _context4.stop();
570
+ }
571
+ }, _callee4, null, [[2, 8]]);
572
+ }));
573
+ return function sendAgentMsg() {
574
+ return _ref13.apply(this, arguments);
575
+ };
576
+ }();
577
+ var afterSendMsg = /*#__PURE__*/function () {
578
+ var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(msgInfo) {
579
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
580
+ while (1) switch (_context5.prev = _context5.next) {
581
+ case 0:
582
+ if (rootStore.conversationStore.currentCvs.chatType === 'singleChat') {
583
+ sendAgentMsg(rootStore.conversationStore.currentCvs.conversationId, msgInfo.msg);
584
+ }
585
+ case 1:
586
+ case "end":
587
+ return _context5.stop();
588
+ }
589
+ }, _callee5);
590
+ }));
591
+ return function afterSendMsg(_x5) {
592
+ return _ref14.apply(this, arguments);
593
+ };
594
+ }();
541
595
  useEffect(function () {
542
596
  getHeaderInfo();
543
597
  }, []);
@@ -553,7 +607,11 @@ var Chatbox = function Chatbox(props) {
553
607
  className: "yuze_chat_container w-full h-full overflow-hidden flex flex-col"
554
608
  }, rootStore.conversationStore.currentCvs.conversationId && customHeader(), /*#__PURE__*/React.createElement(Chat, {
555
609
  className: "flex-1",
556
- messageInputProps: _objectSpread({}, commonMessageInputConfig),
610
+ messageInputProps: _objectSpread(_objectSpread({}, commonMessageInputConfig), {}, {
611
+ onSendMessage: function onSendMessage(msg) {
612
+ return afterSendMsg(msg);
613
+ }
614
+ }),
557
615
  renderHeader: function renderHeader() {
558
616
  return undefined;
559
617
  },
@@ -54,7 +54,7 @@ var CustomChatView = function CustomChatView(props) {
54
54
  var _useSDK = useSDK(),
55
55
  MessageSDK = _useSDK.ChatSDK;
56
56
  var renderTxtMsg = function renderTxtMsg(msg) {
57
- var _userInfo$uid, _ref;
57
+ var _userInfo$uid;
58
58
  var isMySelf = (msg === null || msg === void 0 ? void 0 : msg.bySelf) === true || (msg === null || msg === void 0 ? void 0 : msg.from.toLowerCase()) === ((_userInfo$uid = userInfo.uid) === null || _userInfo$uid === void 0 ? void 0 : _userInfo$uid.toLowerCase());
59
59
  return /*#__PURE__*/React.createElement(TextMessage, {
60
60
  bubbleStyle: {
@@ -74,7 +74,7 @@ var CustomChatView = function CustomChatView(props) {
74
74
  renderUserProfile: function renderUserProfile() {
75
75
  return null;
76
76
  },
77
- customAction: (_ref = commonMessageProps && (commonMessageProps === null || commonMessageProps === void 0 ? void 0 : commonMessageProps.customAction)) !== null && _ref !== void 0 ? _ref : undefined
77
+ customAction: undefined
78
78
  });
79
79
  };
80
80
  var renderShareCardMsg = function renderShareCardMsg(msg) {
@@ -100,7 +100,6 @@ var CustomChatView = function CustomChatView(props) {
100
100
  if (msg.type === "txt") {
101
101
  return renderTxtMsg(msg);
102
102
  } else if (msg.type === 'img') {
103
- var _ref2;
104
103
  return /*#__PURE__*/React.createElement(ImageMessage, {
105
104
  reaction: false,
106
105
  select: false,
@@ -108,11 +107,10 @@ var CustomChatView = function CustomChatView(props) {
108
107
  renderUserProfile: function renderUserProfile() {
109
108
  return null;
110
109
  },
111
- customAction: (_ref2 = commonMessageProps && (commonMessageProps === null || commonMessageProps === void 0 ? void 0 : commonMessageProps.customAction)) !== null && _ref2 !== void 0 ? _ref2 : undefined,
110
+ customAction: undefined,
112
111
  imageMessage: msg
113
112
  });
114
113
  } else if (msg.type === 'file') {
115
- var _ref3;
116
114
  return /*#__PURE__*/React.createElement(FileMessage, {
117
115
  bubbleStyle: {
118
116
  background: msg.bySelf ? "var(--im-msg-bubble-color-right)" : "var(--im-msg-bubble-color-left)",
@@ -126,11 +124,10 @@ var CustomChatView = function CustomChatView(props) {
126
124
  renderUserProfile: function renderUserProfile() {
127
125
  return null;
128
126
  },
129
- customAction: (_ref3 = commonMessageProps && (commonMessageProps === null || commonMessageProps === void 0 ? void 0 : commonMessageProps.customAction)) !== null && _ref3 !== void 0 ? _ref3 : undefined,
127
+ customAction: undefined,
130
128
  fileMessage: msg
131
129
  });
132
130
  } else if (msg.type === 'video') {
133
- var _ref4;
134
131
  return /*#__PURE__*/React.createElement(VideoMessage, {
135
132
  reaction: false,
136
133
  select: false,
@@ -138,11 +135,10 @@ var CustomChatView = function CustomChatView(props) {
138
135
  renderUserProfile: function renderUserProfile() {
139
136
  return null;
140
137
  },
141
- customAction: (_ref4 = commonMessageProps && (commonMessageProps === null || commonMessageProps === void 0 ? void 0 : commonMessageProps.customAction)) !== null && _ref4 !== void 0 ? _ref4 : undefined,
138
+ customAction: undefined,
142
139
  videoMessage: msg
143
140
  });
144
141
  } else if (msg.type === 'audio') {
145
- var _ref5;
146
142
  return /*#__PURE__*/React.createElement(AudioMessage, {
147
143
  reaction: false,
148
144
  select: false,
@@ -150,11 +146,11 @@ var CustomChatView = function CustomChatView(props) {
150
146
  renderUserProfile: function renderUserProfile() {
151
147
  return null;
152
148
  },
153
- customAction: (_ref5 = commonMessageProps && (commonMessageProps === null || commonMessageProps === void 0 ? void 0 : commonMessageProps.customAction)) !== null && _ref5 !== void 0 ? _ref5 : undefined,
149
+ customAction: undefined,
154
150
  audioMessage: msg
155
151
  });
156
152
  } else if (msg.type === 'custom' && ((msg === null || msg === void 0 ? void 0 : msg.customEvent) === 'im_group_share' || (msg === null || msg === void 0 ? void 0 : msg.customEvent) === 'personcenter_share')) {
157
- var _userInfo$uid2, _ref6;
153
+ var _userInfo$uid2;
158
154
  var isMySelf = (msg === null || msg === void 0 ? void 0 : msg.bySelf) === true || (msg === null || msg === void 0 ? void 0 : msg.from.toLowerCase()) === (userInfo === null || userInfo === void 0 || (_userInfo$uid2 = userInfo.uid) === null || _userInfo$uid2 === void 0 ? void 0 : _userInfo$uid2.toLowerCase());
159
155
  return /*#__PURE__*/React.createElement(BaseMessage, {
160
156
  bubbleStyle: {
@@ -170,7 +166,7 @@ var CustomChatView = function CustomChatView(props) {
170
166
  renderUserProfile: function renderUserProfile() {
171
167
  return null;
172
168
  },
173
- customAction: (_ref6 = commonMessageProps && (commonMessageProps === null || commonMessageProps === void 0 ? void 0 : commonMessageProps.customAction)) !== null && _ref6 !== void 0 ? _ref6 : undefined,
169
+ customAction: undefined,
174
170
  children: renderShareCardMsg(msg)
175
171
  });
176
172
  } else {
@@ -198,11 +194,11 @@ var CustomChatView = function CustomChatView(props) {
198
194
  var _group$info;
199
195
  // @ts-ignore
200
196
  if (cvs.conversationId == (group === null || group === void 0 ? void 0 : group.groupid) && group !== null && group !== void 0 && (_group$info = group.info) !== null && _group$info !== void 0 && _group$info.custom) {
201
- var _group$info2, _customObj$headimgurl, _group$info$affiliati, _group$info3, _ref7, _ref8, _group$name, _group$info4;
197
+ var _group$info2, _customObj$headimgurl, _group$info$affiliati, _group$info3, _ref, _ref2, _group$name, _group$info4;
202
198
  var customObj = JSON.parse(group === null || group === void 0 || (_group$info2 = group.info) === null || _group$info2 === void 0 ? void 0 : _group$info2.custom);
203
199
  var imageurl = (_customObj$headimgurl = customObj === null || customObj === void 0 ? void 0 : customObj.headimgurl) !== null && _customObj$headimgurl !== void 0 ? _customObj$headimgurl : '';
204
200
  var member = (_group$info$affiliati = group === null || group === void 0 || (_group$info3 = group.info) === null || _group$info3 === void 0 ? void 0 : _group$info3.affiliations_count) !== null && _group$info$affiliati !== void 0 ? _group$info$affiliati : 0;
205
- var name = (_ref7 = (_ref8 = (_group$name = group === null || group === void 0 ? void 0 : group.name) !== null && _group$name !== void 0 ? _group$name : group === null || group === void 0 || (_group$info4 = group.info) === null || _group$info4 === void 0 ? void 0 : _group$info4.name) !== null && _ref8 !== void 0 ? _ref8 : cvs.name) !== null && _ref7 !== void 0 ? _ref7 : '';
201
+ var name = (_ref = (_ref2 = (_group$name = group === null || group === void 0 ? void 0 : group.name) !== null && _group$name !== void 0 ? _group$name : group === null || group === void 0 || (_group$info4 = group.info) === null || _group$info4 === void 0 ? void 0 : _group$info4.name) !== null && _ref2 !== void 0 ? _ref2 : cvs.name) !== null && _ref !== void 0 ? _ref : '';
206
202
  setHeaderInfo(function (prevState) {
207
203
  return _objectSpread(_objectSpread({}, prevState), {}, {
208
204
  headerImageURL: imageurl,
@@ -233,9 +229,9 @@ var CustomChatView = function CustomChatView(props) {
233
229
  }
234
230
  });
235
231
  } else {
236
- var _appUsersInfo$avataru, _ref9, _appUsersInfo$name;
232
+ var _appUsersInfo$avataru, _ref3, _appUsersInfo$name;
237
233
  var imageurl = (_appUsersInfo$avataru = appUsersInfo === null || appUsersInfo === void 0 ? void 0 : appUsersInfo.avatarurl) !== null && _appUsersInfo$avataru !== void 0 ? _appUsersInfo$avataru : '';
238
- var name = (_ref9 = (_appUsersInfo$name = appUsersInfo === null || appUsersInfo === void 0 ? void 0 : appUsersInfo.name) !== null && _appUsersInfo$name !== void 0 ? _appUsersInfo$name : cvs.name) !== null && _ref9 !== void 0 ? _ref9 : '';
234
+ var name = (_ref3 = (_appUsersInfo$name = appUsersInfo === null || appUsersInfo === void 0 ? void 0 : appUsersInfo.name) !== null && _appUsersInfo$name !== void 0 ? _appUsersInfo$name : cvs.name) !== null && _ref3 !== void 0 ? _ref3 : '';
239
235
  setHeaderInfo(function (prevState) {
240
236
  return _objectSpread(_objectSpread({}, prevState), {}, {
241
237
  headerImageURL: imageurl,
@@ -305,7 +301,7 @@ var CustomChatView = function CustomChatView(props) {
305
301
  return _getShareGroupInfo.apply(this, arguments);
306
302
  }
307
303
  var clickCustomGroupCardMsg = /*#__PURE__*/function () {
308
- var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(msg) {
304
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(msg) {
309
305
  var params, _response$data, response, _msg$customExts3, _msg$customExts4, _msg$customExts5, _msg$customExts6, conversation;
310
306
  return _regeneratorRuntime.wrap(function _callee$(_context2) {
311
307
  while (1) switch (_context2.prev = _context2.next) {
@@ -364,7 +360,7 @@ var CustomChatView = function CustomChatView(props) {
364
360
  }, _callee, null, [[4, 11]]);
365
361
  }));
366
362
  return function clickCustomGroupCardMsg(_x3) {
367
- return _ref10.apply(this, arguments);
363
+ return _ref4.apply(this, arguments);
368
364
  };
369
365
  }();
370
366
  useEffect(function () {
@@ -413,7 +409,7 @@ var CustomChatView = function CustomChatView(props) {
413
409
  setCurAgentId = _useState10[1];
414
410
  // 获取agent列表
415
411
  var getCollectList = /*#__PURE__*/function () {
416
- var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
412
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
417
413
  var _yield$http$get, data;
418
414
  return _regeneratorRuntime.wrap(function _callee2$(_context3) {
419
415
  while (1) switch (_context3.prev = _context3.next) {
@@ -444,7 +440,7 @@ var CustomChatView = function CustomChatView(props) {
444
440
  }, _callee2, null, [[0, 8]]);
445
441
  }));
446
442
  return function getCollectList() {
447
- return _ref11.apply(this, arguments);
443
+ return _ref5.apply(this, arguments);
448
444
  };
449
445
  }();
450
446
  var _useState11 = useState([]),
@@ -452,7 +448,7 @@ var CustomChatView = function CustomChatView(props) {
452
448
  agentTipList = _useState12[0],
453
449
  setAgentTipList = _useState12[1];
454
450
  var getTipsList = /*#__PURE__*/function () {
455
- var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
451
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
456
452
  var _yield$http$get2, data;
457
453
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
458
454
  while (1) switch (_context4.prev = _context4.next) {
@@ -477,7 +473,7 @@ var CustomChatView = function CustomChatView(props) {
477
473
  }, _callee3, null, [[0, 8]]);
478
474
  }));
479
475
  return function getTipsList() {
480
- return _ref12.apply(this, arguments);
476
+ return _ref6.apply(this, arguments);
481
477
  };
482
478
  }();
483
479
  useEffect(function () {
@@ -486,7 +482,7 @@ var CustomChatView = function CustomChatView(props) {
486
482
  getTipsList();
487
483
  }, []);
488
484
  var changeAgent = /*#__PURE__*/function () {
489
- var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(val) {
485
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(val) {
490
486
  var curAgent;
491
487
  return _regeneratorRuntime.wrap(function _callee4$(_context5) {
492
488
  while (1) switch (_context5.prev = _context5.next) {
@@ -509,12 +505,12 @@ var CustomChatView = function CustomChatView(props) {
509
505
  }, _callee4);
510
506
  }));
511
507
  return function changeAgent(_x4) {
512
- return _ref13.apply(this, arguments);
508
+ return _ref7.apply(this, arguments);
513
509
  };
514
510
  }();
515
511
  // 给agent 发送消息需要调用该接口
516
512
  var sendAgentMsg = /*#__PURE__*/function () {
517
- var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
513
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
518
514
  var userid,
519
515
  content,
520
516
  options,
@@ -546,11 +542,11 @@ var CustomChatView = function CustomChatView(props) {
546
542
  }, _callee5, null, [[2, 8]]);
547
543
  }));
548
544
  return function sendAgentMsg() {
549
- return _ref14.apply(this, arguments);
545
+ return _ref8.apply(this, arguments);
550
546
  };
551
547
  }();
552
548
  var postMessage = /*#__PURE__*/function () {
553
- var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(msg) {
549
+ var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(msg) {
554
550
  var customMessage;
555
551
  return _regeneratorRuntime.wrap(function _callee6$(_context7) {
556
552
  while (1) switch (_context7.prev = _context7.next) {
@@ -573,11 +569,11 @@ var CustomChatView = function CustomChatView(props) {
573
569
  }, _callee6);
574
570
  }));
575
571
  return function postMessage(_x5) {
576
- return _ref15.apply(this, arguments);
572
+ return _ref9.apply(this, arguments);
577
573
  };
578
574
  }();
579
575
  var afterSendMsg = /*#__PURE__*/function () {
580
- var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(msgInfo) {
576
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(msgInfo) {
581
577
  return _regeneratorRuntime.wrap(function _callee7$(_context8) {
582
578
  while (1) switch (_context8.prev = _context8.next) {
583
579
  case 0:
@@ -589,7 +585,7 @@ var CustomChatView = function CustomChatView(props) {
589
585
  }, _callee7);
590
586
  }));
591
587
  return function afterSendMsg(_x6) {
592
- return _ref16.apply(this, arguments);
588
+ return _ref10.apply(this, arguments);
593
589
  };
594
590
  }();
595
591
  return /*#__PURE__*/React.createElement("div", {
@@ -598,7 +594,7 @@ var CustomChatView = function CustomChatView(props) {
598
594
  className: "mb-2 mx-4 py-2 rounded-lg bg-[var(--im-main-bg-five)]"
599
595
  }, /*#__PURE__*/React.createElement(Select, {
600
596
  className: "w-full !h-12 border-none rouded-lg agent-select",
601
- popupClassName: "agent-select-popup",
597
+ popupClassName: "agent-select-popup bg-[var(--im-main-backgroundColor)] text-[var(--im-main-fontColor)]",
602
598
  value: curAgentId,
603
599
  placeholder: "Select your agent to take actions on token",
604
600
  prefix: /*#__PURE__*/React.createElement("img", {
@@ -4,6 +4,7 @@ import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
4
4
  import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
5
5
  import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
6
6
  import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
7
+ import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
7
8
  import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
8
9
  import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
9
10
  import React, { useContext, useState, useRef, useEffect } from 'react';
@@ -86,7 +87,7 @@ var CreateGroup = function CreateGroup(props) {
86
87
  var handleDebounceGetFrindList = useDebouncedCallback(handleGetFrindList, 150);
87
88
  var handleCreateGroup = /*#__PURE__*/function () {
88
89
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
89
- var _result2$data, result1, data, result2;
90
+ var _result2$data, result1, name, data, result2;
90
91
  return _regeneratorRuntime.wrap(function _callee2$(_context3) {
91
92
  while (1) switch (_context3.prev = _context3.next) {
92
93
  case 0:
@@ -96,37 +97,38 @@ var CreateGroup = function CreateGroup(props) {
96
97
  return http.get("/capi/account/imchannel/imchannelconfig");
97
98
  case 4:
98
99
  result1 = _context3.sent;
100
+ name = _mapInstanceProperty(member).call(member, function (item) {
101
+ return item.name;
102
+ }).join(",");
99
103
  data = {
100
- name: _mapInstanceProperty(member).call(member, function (item) {
101
- return item.name;
102
- }).join(","),
104
+ name: _sliceInstanceProperty(name).call(name, -32, name.length),
103
105
  customtype: "chat_group",
104
106
  headimgurl: result1.data.data.headimgurl,
105
107
  memberids: _mapInstanceProperty(member).call(member, function (item) {
106
108
  return item.userid;
107
109
  })
108
110
  };
109
- _context3.next = 8;
111
+ _context3.next = 9;
110
112
  return http.post("/capi/account/imchannel/save", data);
111
- case 8:
113
+ case 9:
112
114
  result2 = _context3.sent;
113
115
  setLoading(false);
114
116
  if ((_result2$data = result2.data) !== null && _result2$data !== void 0 && (_result2$data = _result2$data.data) !== null && _result2$data !== void 0 && _result2$data.sendbirdid) {
115
117
  setMember([]);
116
118
  onClose && onClose();
117
119
  }
118
- _context3.next = 17;
120
+ _context3.next = 18;
119
121
  break;
120
- case 13:
121
- _context3.prev = 13;
122
+ case 14:
123
+ _context3.prev = 14;
122
124
  _context3.t0 = _context3["catch"](1);
123
125
  console.log(_context3.t0);
124
126
  setLoading(false);
125
- case 17:
127
+ case 18:
126
128
  case "end":
127
129
  return _context3.stop();
128
130
  }
129
- }, _callee2, null, [[1, 13]]);
131
+ }, _callee2, null, [[1, 14]]);
130
132
  }));
131
133
  return function handleCreateGroup() {
132
134
  return _ref2.apply(this, arguments);
@@ -33,7 +33,6 @@ var TypeItem = function TypeItem(props) {
33
33
  _useState4 = _slicedToArray(_useState3, 2),
34
34
  iisprohibition = _useState4[0],
35
35
  setIisprohibition = _useState4[1];
36
- console.log(groupRoleType, 'erwrewrw');
37
36
  return /*#__PURE__*/React.createElement("div", {
38
37
  className: "yuze-typeItem w-full flex flex-row justify-between items-center px-2 cursor-pointer",
39
38
  onClick: onClick
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whyuzeim",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "im componenets",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",