whyuzeim 1.0.6 → 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.
- package/cjs/ChatBox/index.js +67 -9
- package/cjs/CustomChatView/index.js +27 -31
- package/cjs/GroupDetail/index.js +1 -0
- package/cjs/IM/style/index.scss +5 -0
- package/cjs/Sidebar/CreateGroup/index.js +13 -11
- package/cjs/TypeItem/OperateBtn/index.d.ts +1 -0
- package/cjs/TypeItem/OperateBtn/index.js +3 -2
- package/cjs/TypeItem/index.d.ts +1 -0
- package/cjs/TypeItem/index.js +4 -2
- package/es/ChatBox/index.js +68 -10
- package/es/CustomChatView/index.js +27 -31
- package/es/GroupDetail/index.js +1 -0
- package/es/IM/style/index.scss +5 -0
- package/es/Sidebar/CreateGroup/index.js +13 -11
- package/es/TypeItem/OperateBtn/index.d.ts +1 -0
- package/es/TypeItem/OperateBtn/index.js +3 -2
- package/es/TypeItem/index.d.ts +1 -0
- package/es/TypeItem/index.js +4 -2
- package/package.json +1 -1
package/cjs/ChatBox/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
429
|
-
while (1) switch (
|
|
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
|
-
|
|
434
|
+
_context6.next = 3;
|
|
435
435
|
return http.post("/capi/account/imchannel/getdetails", params);
|
|
436
436
|
case 3:
|
|
437
|
-
response =
|
|
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
|
|
474
|
+
return _context6.stop();
|
|
475
475
|
}
|
|
476
|
-
},
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
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,
|
|
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 = (
|
|
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,
|
|
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 = (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
510
|
+
return _ref7.apply(this, arguments);
|
|
515
511
|
};
|
|
516
512
|
}();
|
|
517
513
|
// 给agent 发送消息需要调用该接口
|
|
518
514
|
var sendAgentMsg = /*#__PURE__*/function () {
|
|
519
|
-
var
|
|
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
|
|
547
|
+
return _ref8.apply(this, arguments);
|
|
552
548
|
};
|
|
553
549
|
}();
|
|
554
550
|
var postMessage = /*#__PURE__*/function () {
|
|
555
|
-
var
|
|
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
|
|
574
|
+
return _ref9.apply(this, arguments);
|
|
579
575
|
};
|
|
580
576
|
}();
|
|
581
577
|
var afterSendMsg = /*#__PURE__*/function () {
|
|
582
|
-
var
|
|
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
|
|
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", {
|
package/cjs/GroupDetail/index.js
CHANGED
|
@@ -213,6 +213,7 @@ var GroupDetail = function GroupDetail(props) {
|
|
|
213
213
|
avatar: item.headimgurl,
|
|
214
214
|
key: item.userid,
|
|
215
215
|
roletype: item.roletype,
|
|
216
|
+
groupRoleType: groupInfo === null || groupInfo === void 0 ? void 0 : groupInfo.roletype,
|
|
216
217
|
rightNode: /*#__PURE__*/React.createElement("img", {
|
|
217
218
|
src: ic_messages,
|
|
218
219
|
onClick: function onClick() {
|
package/cjs/IM/style/index.scss
CHANGED
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
.ant-select-dropdown {
|
|
39
39
|
background-color: var(--im-main-backgroundColor);
|
|
40
40
|
}
|
|
41
|
+
height: 100vh;
|
|
42
|
+
overflow: auto;
|
|
41
43
|
}
|
|
42
44
|
.im-dark {
|
|
43
45
|
--im-main-backgroundColor: #1e2329;
|
|
@@ -90,6 +92,9 @@
|
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
--im-border-10: rgba(255, 255, 255, 0.1);
|
|
95
|
+
|
|
96
|
+
height: 100vh;
|
|
97
|
+
overflow: auto;
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
.cui-message-base-right {
|
|
@@ -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:
|
|
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 =
|
|
113
|
+
_context3.next = 9;
|
|
112
114
|
return http.post("/capi/account/imchannel/save", data);
|
|
113
|
-
case
|
|
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 =
|
|
122
|
+
_context3.next = 18;
|
|
121
123
|
break;
|
|
122
|
-
case
|
|
123
|
-
_context3.prev =
|
|
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
|
|
129
|
+
case 18:
|
|
128
130
|
case "end":
|
|
129
131
|
return _context3.stop();
|
|
130
132
|
}
|
|
131
|
-
}, _callee2, null, [[1,
|
|
133
|
+
}, _callee2, null, [[1, 14]]);
|
|
132
134
|
}));
|
|
133
135
|
return function handleCreateGroup() {
|
|
134
136
|
return _ref2.apply(this, arguments);
|
|
@@ -21,7 +21,8 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
21
21
|
onDelete = props.onDelete,
|
|
22
22
|
onBlock = props.onBlock,
|
|
23
23
|
isprohibition = props.isprohibition,
|
|
24
|
-
onBan = props.onBan
|
|
24
|
+
onBan = props.onBan,
|
|
25
|
+
groupRoleType = props.groupRoleType;
|
|
25
26
|
var _useContext = React.useContext(context.Context),
|
|
26
27
|
http = _useContext.http;
|
|
27
28
|
var _Modal$useModal = antd.Modal.useModal(),
|
|
@@ -140,7 +141,7 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
140
141
|
placement: "bottomLeft",
|
|
141
142
|
title: /*#__PURE__*/React.createElement("div", {
|
|
142
143
|
className: "flex flex-col"
|
|
143
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
144
|
+
}, groupRoleType === 2 && /*#__PURE__*/React.createElement("div", {
|
|
144
145
|
className: "yuze-conversationList-header-right-tooltip-item flex flex-row items-center gap-3 cursor-pointer",
|
|
145
146
|
onClick: handleDebounceUpdateAdmin
|
|
146
147
|
}, /*#__PURE__*/React.createElement("img", {
|
package/cjs/TypeItem/index.d.ts
CHANGED
package/cjs/TypeItem/index.js
CHANGED
|
@@ -25,7 +25,8 @@ var TypeItem = function TypeItem(props) {
|
|
|
25
25
|
showMore = _props$showMore === void 0 ? false : _props$showMore,
|
|
26
26
|
onDelete = props.onDelete,
|
|
27
27
|
isprohibition = props.isprohibition,
|
|
28
|
-
onBlock = props.onBlock
|
|
28
|
+
onBlock = props.onBlock,
|
|
29
|
+
groupRoleType = props.groupRoleType;
|
|
29
30
|
var _useState = React.useState(roletype),
|
|
30
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31
32
|
iroletype = _useState2[0],
|
|
@@ -65,7 +66,8 @@ var TypeItem = function TypeItem(props) {
|
|
|
65
66
|
})
|
|
66
67
|
}, /*#__PURE__*/React.createElement("span", null, iroletype === 2 ? "Owner" : "Admin"))), /*#__PURE__*/React.createElement("div", {
|
|
67
68
|
className: "yuze-TypeItem-right shrink-0 flex items-center justify-center"
|
|
68
|
-
}, rightNode, roletype !== 2 && userId && sendbirdid && showMore && /*#__PURE__*/React.createElement(index, {
|
|
69
|
+
}, rightNode, roletype !== 2 && groupRoleType !== 0 && userId && sendbirdid && showMore && /*#__PURE__*/React.createElement(index, {
|
|
70
|
+
groupRoleType: groupRoleType,
|
|
69
71
|
userId: userId,
|
|
70
72
|
roletype: iroletype,
|
|
71
73
|
sendbirdid: sendbirdid,
|
package/es/ChatBox/index.js
CHANGED
|
@@ -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 {
|
|
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
|
|
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
|
|
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
|
|
427
|
-
while (1) switch (
|
|
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
|
-
|
|
432
|
+
_context6.next = 3;
|
|
433
433
|
return http.post("/capi/account/imchannel/getdetails", params);
|
|
434
434
|
case 3:
|
|
435
|
-
response =
|
|
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
|
|
472
|
+
return _context6.stop();
|
|
473
473
|
}
|
|
474
|
-
},
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
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,
|
|
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 = (
|
|
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,
|
|
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 = (
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
508
|
+
return _ref7.apply(this, arguments);
|
|
513
509
|
};
|
|
514
510
|
}();
|
|
515
511
|
// 给agent 发送消息需要调用该接口
|
|
516
512
|
var sendAgentMsg = /*#__PURE__*/function () {
|
|
517
|
-
var
|
|
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
|
|
545
|
+
return _ref8.apply(this, arguments);
|
|
550
546
|
};
|
|
551
547
|
}();
|
|
552
548
|
var postMessage = /*#__PURE__*/function () {
|
|
553
|
-
var
|
|
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
|
|
572
|
+
return _ref9.apply(this, arguments);
|
|
577
573
|
};
|
|
578
574
|
}();
|
|
579
575
|
var afterSendMsg = /*#__PURE__*/function () {
|
|
580
|
-
var
|
|
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
|
|
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", {
|
package/es/GroupDetail/index.js
CHANGED
|
@@ -211,6 +211,7 @@ var GroupDetail = function GroupDetail(props) {
|
|
|
211
211
|
avatar: item.headimgurl,
|
|
212
212
|
key: item.userid,
|
|
213
213
|
roletype: item.roletype,
|
|
214
|
+
groupRoleType: groupInfo === null || groupInfo === void 0 ? void 0 : groupInfo.roletype,
|
|
214
215
|
rightNode: /*#__PURE__*/React.createElement("img", {
|
|
215
216
|
src: img$3,
|
|
216
217
|
onClick: function onClick() {
|
package/es/IM/style/index.scss
CHANGED
|
@@ -38,6 +38,8 @@
|
|
|
38
38
|
.ant-select-dropdown {
|
|
39
39
|
background-color: var(--im-main-backgroundColor);
|
|
40
40
|
}
|
|
41
|
+
height: 100vh;
|
|
42
|
+
overflow: auto;
|
|
41
43
|
}
|
|
42
44
|
.im-dark {
|
|
43
45
|
--im-main-backgroundColor: #1e2329;
|
|
@@ -90,6 +92,9 @@
|
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
--im-border-10: rgba(255, 255, 255, 0.1);
|
|
95
|
+
|
|
96
|
+
height: 100vh;
|
|
97
|
+
overflow: auto;
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
.cui-message-base-right {
|
|
@@ -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:
|
|
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 =
|
|
111
|
+
_context3.next = 9;
|
|
110
112
|
return http.post("/capi/account/imchannel/save", data);
|
|
111
|
-
case
|
|
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 =
|
|
120
|
+
_context3.next = 18;
|
|
119
121
|
break;
|
|
120
|
-
case
|
|
121
|
-
_context3.prev =
|
|
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
|
|
127
|
+
case 18:
|
|
126
128
|
case "end":
|
|
127
129
|
return _context3.stop();
|
|
128
130
|
}
|
|
129
|
-
}, _callee2, null, [[1,
|
|
131
|
+
}, _callee2, null, [[1, 14]]);
|
|
130
132
|
}));
|
|
131
133
|
return function handleCreateGroup() {
|
|
132
134
|
return _ref2.apply(this, arguments);
|
|
@@ -19,7 +19,8 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
19
19
|
onDelete = props.onDelete,
|
|
20
20
|
onBlock = props.onBlock,
|
|
21
21
|
isprohibition = props.isprohibition,
|
|
22
|
-
onBan = props.onBan
|
|
22
|
+
onBan = props.onBan,
|
|
23
|
+
groupRoleType = props.groupRoleType;
|
|
23
24
|
var _useContext = useContext(Context),
|
|
24
25
|
http = _useContext.http;
|
|
25
26
|
var _Modal$useModal = Modal.useModal(),
|
|
@@ -138,7 +139,7 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
138
139
|
placement: "bottomLeft",
|
|
139
140
|
title: /*#__PURE__*/React.createElement("div", {
|
|
140
141
|
className: "flex flex-col"
|
|
141
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
}, groupRoleType === 2 && /*#__PURE__*/React.createElement("div", {
|
|
142
143
|
className: "yuze-conversationList-header-right-tooltip-item flex flex-row items-center gap-3 cursor-pointer",
|
|
143
144
|
onClick: handleDebounceUpdateAdmin
|
|
144
145
|
}, /*#__PURE__*/React.createElement("img", {
|
package/es/TypeItem/index.d.ts
CHANGED
package/es/TypeItem/index.js
CHANGED
|
@@ -23,7 +23,8 @@ var TypeItem = function TypeItem(props) {
|
|
|
23
23
|
showMore = _props$showMore === void 0 ? false : _props$showMore,
|
|
24
24
|
onDelete = props.onDelete,
|
|
25
25
|
isprohibition = props.isprohibition,
|
|
26
|
-
onBlock = props.onBlock
|
|
26
|
+
onBlock = props.onBlock,
|
|
27
|
+
groupRoleType = props.groupRoleType;
|
|
27
28
|
var _useState = useState(roletype),
|
|
28
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
30
|
iroletype = _useState2[0],
|
|
@@ -63,7 +64,8 @@ var TypeItem = function TypeItem(props) {
|
|
|
63
64
|
})
|
|
64
65
|
}, /*#__PURE__*/React.createElement("span", null, iroletype === 2 ? "Owner" : "Admin"))), /*#__PURE__*/React.createElement("div", {
|
|
65
66
|
className: "yuze-TypeItem-right shrink-0 flex items-center justify-center"
|
|
66
|
-
}, rightNode, roletype !== 2 && userId && sendbirdid && showMore && /*#__PURE__*/React.createElement(OperateBtn, {
|
|
67
|
+
}, rightNode, roletype !== 2 && groupRoleType !== 0 && userId && sendbirdid && showMore && /*#__PURE__*/React.createElement(OperateBtn, {
|
|
68
|
+
groupRoleType: groupRoleType,
|
|
67
69
|
userId: userId,
|
|
68
70
|
roletype: iroletype,
|
|
69
71
|
sendbirdid: sendbirdid,
|