whyuzeim 1.0.1 → 1.0.2
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/CustomChatView/index.d.ts +2 -0
- package/cjs/CustomChatView/index.js +101 -16
- package/cjs/GroupDetail/GroupShareView/index.js +3 -1
- package/cjs/IM/style/index.scss +10 -0
- package/es/CustomChatView/index.d.ts +2 -0
- package/es/CustomChatView/index.js +102 -17
- package/es/GroupDetail/GroupShareView/index.js +3 -1
- package/es/IM/style/index.scss +10 -0
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ var set = require('./image/set.svg.js');
|
|
|
25
25
|
require('./style/index.scss');
|
|
26
26
|
|
|
27
27
|
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; }
|
|
28
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
28
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context10, _context11; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context10 = ownKeys(Object(t), true)).call(_context10, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context11 = ownKeys(Object(t))).call(_context11, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
29
|
var CustomChatView = function CustomChatView(props) {
|
|
30
30
|
var _props$className;
|
|
31
31
|
var _useContext = React.useContext(context.Context),
|
|
@@ -53,6 +53,8 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
53
53
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
54
54
|
headerInfo = _useState6[0],
|
|
55
55
|
setHeaderInfo = _useState6[1];
|
|
56
|
+
var _useSDK = agoraChatUikit.useSDK(),
|
|
57
|
+
MessageSDK = _useSDK.ChatSDK;
|
|
56
58
|
var renderTxtMsg = function renderTxtMsg(msg) {
|
|
57
59
|
var _userInfo$uid, _ref;
|
|
58
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());
|
|
@@ -249,18 +251,18 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
249
251
|
return _getShareGroupInfo.apply(this, arguments);
|
|
250
252
|
}
|
|
251
253
|
function _getShareGroupInfo() {
|
|
252
|
-
_getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
254
|
+
_getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(shareInfo, isJoined) {
|
|
253
255
|
var params, response, data, groupInfo, waitJoinGroupinfo, conversation, _response$data2;
|
|
254
|
-
return _regeneratorRuntime.wrap(function
|
|
255
|
-
while (1) switch (
|
|
256
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
257
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
256
258
|
case 0:
|
|
257
259
|
params = {
|
|
258
260
|
sendbirdid: shareInfo === null || shareInfo === void 0 ? void 0 : shareInfo.objectId
|
|
259
261
|
};
|
|
260
|
-
|
|
262
|
+
_context9.next = 3;
|
|
261
263
|
return http.post("/capi/account/imchannel/getdetails", params);
|
|
262
264
|
case 3:
|
|
263
|
-
response =
|
|
265
|
+
response = _context9.sent;
|
|
264
266
|
data = response.data;
|
|
265
267
|
if (data && data.code === 200 && data.data) {
|
|
266
268
|
groupInfo = data.data;
|
|
@@ -297,9 +299,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
297
299
|
}
|
|
298
300
|
case 6:
|
|
299
301
|
case "end":
|
|
300
|
-
return
|
|
302
|
+
return _context9.stop();
|
|
301
303
|
}
|
|
302
|
-
},
|
|
304
|
+
}, _callee8);
|
|
303
305
|
}));
|
|
304
306
|
return _getShareGroupInfo.apply(this, arguments);
|
|
305
307
|
}
|
|
@@ -385,14 +387,14 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
385
387
|
}, []);
|
|
386
388
|
var customHeader = function customHeader() {
|
|
387
389
|
return /*#__PURE__*/React.createElement("div", {
|
|
388
|
-
className: "flex h-
|
|
390
|
+
className: "flex h-20 items-center bg-[var(--im-main-backgroundColor)] border-b border-[var(--im-border-10)] mx-4 justify-between"
|
|
389
391
|
}, /*#__PURE__*/React.createElement("div", {
|
|
390
|
-
className: "flex items-center gap-
|
|
392
|
+
className: "flex items-center gap-4"
|
|
391
393
|
}, /*#__PURE__*/React.createElement("img", {
|
|
392
394
|
src: headerInfo.headerImageURL,
|
|
393
395
|
className: "w-12 h-12 ".concat(headerInfo.chatType === 'groupChat' ? 'rounded-md' : 'rounded-full', " bg-blue")
|
|
394
396
|
}), /*#__PURE__*/React.createElement("div", {
|
|
395
|
-
className: "flex flex-col overflow-hidden
|
|
397
|
+
className: "flex flex-col overflow-hidden flex-1"
|
|
396
398
|
}, /*#__PURE__*/React.createElement("p", {
|
|
397
399
|
className: "text-[var(--im-main-fontColor)] text-base font-normal line-clamp-1 mr-[100px]"
|
|
398
400
|
}, headerInfo.conversationName), headerInfo.chatType === 'groupChat' && /*#__PURE__*/React.createElement("p", {
|
|
@@ -511,8 +513,88 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
511
513
|
return _ref13.apply(this, arguments);
|
|
512
514
|
};
|
|
513
515
|
}();
|
|
516
|
+
// 给agent 发送消息需要调用该接口
|
|
517
|
+
var sendAgentMsg = /*#__PURE__*/function () {
|
|
518
|
+
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
519
|
+
var userid,
|
|
520
|
+
content,
|
|
521
|
+
options,
|
|
522
|
+
_args5 = arguments;
|
|
523
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
524
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
525
|
+
case 0:
|
|
526
|
+
userid = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : '';
|
|
527
|
+
content = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : '';
|
|
528
|
+
_context6.prev = 2;
|
|
529
|
+
options = {
|
|
530
|
+
userid: userid,
|
|
531
|
+
content: content,
|
|
532
|
+
contractaddress: props.tokenId
|
|
533
|
+
};
|
|
534
|
+
_context6.next = 6;
|
|
535
|
+
return http.post('/api/imchannel/sendagentmessage', options);
|
|
536
|
+
case 6:
|
|
537
|
+
_context6.next = 11;
|
|
538
|
+
break;
|
|
539
|
+
case 8:
|
|
540
|
+
_context6.prev = 8;
|
|
541
|
+
_context6.t0 = _context6["catch"](2);
|
|
542
|
+
console.log(_context6.t0);
|
|
543
|
+
case 11:
|
|
544
|
+
case "end":
|
|
545
|
+
return _context6.stop();
|
|
546
|
+
}
|
|
547
|
+
}, _callee5, null, [[2, 8]]);
|
|
548
|
+
}));
|
|
549
|
+
return function sendAgentMsg() {
|
|
550
|
+
return _ref14.apply(this, arguments);
|
|
551
|
+
};
|
|
552
|
+
}();
|
|
553
|
+
var postMessage = /*#__PURE__*/function () {
|
|
554
|
+
var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(msg) {
|
|
555
|
+
var customMessage;
|
|
556
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
557
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
558
|
+
case 0:
|
|
559
|
+
customMessage = MessageSDK.message.create({
|
|
560
|
+
type: 'txt',
|
|
561
|
+
msg: msg,
|
|
562
|
+
to: curAgentId || '',
|
|
563
|
+
// Need to be the user ID of the current conversation
|
|
564
|
+
chatType: 'singleChat'
|
|
565
|
+
});
|
|
566
|
+
_context7.next = 3;
|
|
567
|
+
return agoraChatUikit.rootStore.messageStore.sendMessage(customMessage);
|
|
568
|
+
case 3:
|
|
569
|
+
sendAgentMsg(curAgentId, msg);
|
|
570
|
+
case 4:
|
|
571
|
+
case "end":
|
|
572
|
+
return _context7.stop();
|
|
573
|
+
}
|
|
574
|
+
}, _callee6);
|
|
575
|
+
}));
|
|
576
|
+
return function postMessage(_x5) {
|
|
577
|
+
return _ref15.apply(this, arguments);
|
|
578
|
+
};
|
|
579
|
+
}();
|
|
580
|
+
var afterSendMsg = /*#__PURE__*/function () {
|
|
581
|
+
var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(msgInfo) {
|
|
582
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
583
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
584
|
+
case 0:
|
|
585
|
+
sendAgentMsg(curAgentId, msgInfo.msg);
|
|
586
|
+
case 1:
|
|
587
|
+
case "end":
|
|
588
|
+
return _context8.stop();
|
|
589
|
+
}
|
|
590
|
+
}, _callee7);
|
|
591
|
+
}));
|
|
592
|
+
return function afterSendMsg(_x6) {
|
|
593
|
+
return _ref16.apply(this, arguments);
|
|
594
|
+
};
|
|
595
|
+
}();
|
|
514
596
|
return /*#__PURE__*/React.createElement("div", {
|
|
515
|
-
className: "bg-[var(--im-main-backgroundColor)] ".concat((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : '', " w-full h-full overflow-hidden flex flex-col")
|
|
597
|
+
className: "bg-[var(--im-main-backgroundColor)] bg-pink ".concat((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : '', " w-full h-full overflow-hidden flex flex-col")
|
|
516
598
|
}, (collectList === null || collectList === void 0 ? void 0 : collectList.length) && /*#__PURE__*/React.createElement("div", {
|
|
517
599
|
className: "mb-2 mx-5 py-2 rounded-lg bg-[var(--im-main-bg-five)]"
|
|
518
600
|
}, /*#__PURE__*/React.createElement(antd.Select, {
|
|
@@ -533,7 +615,7 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
533
615
|
})), customHeader(), /*#__PURE__*/React.createElement(agoraChatUikit.MessageList, {
|
|
534
616
|
className: "w-full flex-1",
|
|
535
617
|
conversation: {
|
|
536
|
-
conversationId:
|
|
618
|
+
conversationId: curAgentId,
|
|
537
619
|
chatType: props.chatType
|
|
538
620
|
},
|
|
539
621
|
renderMessage: function renderMessage(msg) {
|
|
@@ -549,18 +631,21 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
549
631
|
className: "flex-shrink-0 py-1 px-2.5 text-xs text-[var(--im-five-fontColor)] border border-[var(--im-main-bg-ten)] rounded-sm cursor-pointer",
|
|
550
632
|
key: "tip".concat(index),
|
|
551
633
|
onClick: function onClick() {
|
|
552
|
-
|
|
634
|
+
postMessage(item);
|
|
553
635
|
}
|
|
554
636
|
}, item);
|
|
555
637
|
}))), /*#__PURE__*/React.createElement(agoraChatUikit.MessageInput, _extends({
|
|
556
638
|
enabledTyping: true,
|
|
557
639
|
placeHolder: '',
|
|
558
640
|
conversation: {
|
|
559
|
-
conversationId:
|
|
641
|
+
conversationId: curAgentId,
|
|
560
642
|
chatType: props.chatType
|
|
561
643
|
}
|
|
562
644
|
}, type.commonMessageInputConfig, {
|
|
563
|
-
disabled: false
|
|
645
|
+
disabled: false,
|
|
646
|
+
onSendMessage: function onSendMessage(msg) {
|
|
647
|
+
afterSendMsg(msg);
|
|
648
|
+
}
|
|
564
649
|
})));
|
|
565
650
|
};
|
|
566
651
|
|
|
@@ -74,7 +74,9 @@ var GroupShareView = function GroupShareView(props) {
|
|
|
74
74
|
imgUrl: props.shareObjImageurl
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
customMessage = ChatSDK.message.create(
|
|
77
|
+
customMessage = ChatSDK.message.create({
|
|
78
|
+
option: option
|
|
79
|
+
});
|
|
78
80
|
_context2.next = 4;
|
|
79
81
|
return agoraChatUikit.rootStore.messageStore.sendMessage(customMessage);
|
|
80
82
|
case 4:
|
package/cjs/IM/style/index.scss
CHANGED
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
--im-msg-bubble-color-left: rgba(255, 255, 255, 1);
|
|
22
22
|
--im-msg-bubble-color-right: rgba(156, 255, 30.1);
|
|
23
23
|
--im-msg-bubble-font-color: rgba(0, 0, 0, 0.7);
|
|
24
|
+
|
|
25
|
+
--im-border-10: rgba(0, 0, 0, 0.1);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
.cui-textarea-input{
|
|
29
|
+
color: var(--im-five-fontColor);
|
|
30
|
+
background-color: var(--im-main-bg-five);
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
33
|
.im-dark {
|
|
26
34
|
--im-main-backgroundColor: #1e2329;
|
|
@@ -67,6 +75,8 @@
|
|
|
67
75
|
|
|
68
76
|
--im-main-buttonColor: rgba(156, 255, 30, 1);
|
|
69
77
|
--im-main-switchColor: rgba(0, 200, 5, 1);
|
|
78
|
+
|
|
79
|
+
--im-border-10: rgba(255, 255, 255, 0.1);
|
|
70
80
|
}
|
|
71
81
|
|
|
72
82
|
.cui-message-base-right {
|
|
@@ -15,7 +15,7 @@ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
15
15
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
16
16
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
17
17
|
import React, { useContext, useState, useEffect } from 'react';
|
|
18
|
-
import { rootStore, MessageList, MessageInput, ImageMessage, FileMessage, VideoMessage, AudioMessage, BaseMessage, TextMessage } from 'agora-chat-uikit';
|
|
18
|
+
import { useSDK, rootStore, MessageList, MessageInput, ImageMessage, FileMessage, VideoMessage, AudioMessage, BaseMessage, TextMessage } from 'agora-chat-uikit';
|
|
19
19
|
import { Context } from '../IM/context.js';
|
|
20
20
|
import { Modal, Select, message } from 'antd';
|
|
21
21
|
import { commonMessageInputConfig, commonMessageProps } from '../type.js';
|
|
@@ -23,7 +23,7 @@ import img from './image/set.svg.js';
|
|
|
23
23
|
import './style/index.scss';
|
|
24
24
|
|
|
25
25
|
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; }
|
|
26
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
26
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context10, _context11; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context10 = ownKeys(Object(t), true)).call(_context10, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context11 = ownKeys(Object(t))).call(_context11, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
27
|
var CustomChatView = function CustomChatView(props) {
|
|
28
28
|
var _props$className;
|
|
29
29
|
var _useContext = useContext(Context),
|
|
@@ -51,6 +51,8 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
51
51
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
52
52
|
headerInfo = _useState6[0],
|
|
53
53
|
setHeaderInfo = _useState6[1];
|
|
54
|
+
var _useSDK = useSDK(),
|
|
55
|
+
MessageSDK = _useSDK.ChatSDK;
|
|
54
56
|
var renderTxtMsg = function renderTxtMsg(msg) {
|
|
55
57
|
var _userInfo$uid, _ref;
|
|
56
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());
|
|
@@ -247,18 +249,18 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
247
249
|
return _getShareGroupInfo.apply(this, arguments);
|
|
248
250
|
}
|
|
249
251
|
function _getShareGroupInfo() {
|
|
250
|
-
_getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
252
|
+
_getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(shareInfo, isJoined) {
|
|
251
253
|
var params, response, data, groupInfo, waitJoinGroupinfo, conversation, _response$data2;
|
|
252
|
-
return _regeneratorRuntime.wrap(function
|
|
253
|
-
while (1) switch (
|
|
254
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
255
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
254
256
|
case 0:
|
|
255
257
|
params = {
|
|
256
258
|
sendbirdid: shareInfo === null || shareInfo === void 0 ? void 0 : shareInfo.objectId
|
|
257
259
|
};
|
|
258
|
-
|
|
260
|
+
_context9.next = 3;
|
|
259
261
|
return http.post("/capi/account/imchannel/getdetails", params);
|
|
260
262
|
case 3:
|
|
261
|
-
response =
|
|
263
|
+
response = _context9.sent;
|
|
262
264
|
data = response.data;
|
|
263
265
|
if (data && data.code === 200 && data.data) {
|
|
264
266
|
groupInfo = data.data;
|
|
@@ -295,9 +297,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
295
297
|
}
|
|
296
298
|
case 6:
|
|
297
299
|
case "end":
|
|
298
|
-
return
|
|
300
|
+
return _context9.stop();
|
|
299
301
|
}
|
|
300
|
-
},
|
|
302
|
+
}, _callee8);
|
|
301
303
|
}));
|
|
302
304
|
return _getShareGroupInfo.apply(this, arguments);
|
|
303
305
|
}
|
|
@@ -383,14 +385,14 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
383
385
|
}, []);
|
|
384
386
|
var customHeader = function customHeader() {
|
|
385
387
|
return /*#__PURE__*/React.createElement("div", {
|
|
386
|
-
className: "flex h-
|
|
388
|
+
className: "flex h-20 items-center bg-[var(--im-main-backgroundColor)] border-b border-[var(--im-border-10)] mx-4 justify-between"
|
|
387
389
|
}, /*#__PURE__*/React.createElement("div", {
|
|
388
|
-
className: "flex items-center gap-
|
|
390
|
+
className: "flex items-center gap-4"
|
|
389
391
|
}, /*#__PURE__*/React.createElement("img", {
|
|
390
392
|
src: headerInfo.headerImageURL,
|
|
391
393
|
className: "w-12 h-12 ".concat(headerInfo.chatType === 'groupChat' ? 'rounded-md' : 'rounded-full', " bg-blue")
|
|
392
394
|
}), /*#__PURE__*/React.createElement("div", {
|
|
393
|
-
className: "flex flex-col overflow-hidden
|
|
395
|
+
className: "flex flex-col overflow-hidden flex-1"
|
|
394
396
|
}, /*#__PURE__*/React.createElement("p", {
|
|
395
397
|
className: "text-[var(--im-main-fontColor)] text-base font-normal line-clamp-1 mr-[100px]"
|
|
396
398
|
}, headerInfo.conversationName), headerInfo.chatType === 'groupChat' && /*#__PURE__*/React.createElement("p", {
|
|
@@ -509,8 +511,88 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
509
511
|
return _ref13.apply(this, arguments);
|
|
510
512
|
};
|
|
511
513
|
}();
|
|
514
|
+
// 给agent 发送消息需要调用该接口
|
|
515
|
+
var sendAgentMsg = /*#__PURE__*/function () {
|
|
516
|
+
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
517
|
+
var userid,
|
|
518
|
+
content,
|
|
519
|
+
options,
|
|
520
|
+
_args5 = arguments;
|
|
521
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
522
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
523
|
+
case 0:
|
|
524
|
+
userid = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : '';
|
|
525
|
+
content = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : '';
|
|
526
|
+
_context6.prev = 2;
|
|
527
|
+
options = {
|
|
528
|
+
userid: userid,
|
|
529
|
+
content: content,
|
|
530
|
+
contractaddress: props.tokenId
|
|
531
|
+
};
|
|
532
|
+
_context6.next = 6;
|
|
533
|
+
return http.post('/api/imchannel/sendagentmessage', options);
|
|
534
|
+
case 6:
|
|
535
|
+
_context6.next = 11;
|
|
536
|
+
break;
|
|
537
|
+
case 8:
|
|
538
|
+
_context6.prev = 8;
|
|
539
|
+
_context6.t0 = _context6["catch"](2);
|
|
540
|
+
console.log(_context6.t0);
|
|
541
|
+
case 11:
|
|
542
|
+
case "end":
|
|
543
|
+
return _context6.stop();
|
|
544
|
+
}
|
|
545
|
+
}, _callee5, null, [[2, 8]]);
|
|
546
|
+
}));
|
|
547
|
+
return function sendAgentMsg() {
|
|
548
|
+
return _ref14.apply(this, arguments);
|
|
549
|
+
};
|
|
550
|
+
}();
|
|
551
|
+
var postMessage = /*#__PURE__*/function () {
|
|
552
|
+
var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(msg) {
|
|
553
|
+
var customMessage;
|
|
554
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
555
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
556
|
+
case 0:
|
|
557
|
+
customMessage = MessageSDK.message.create({
|
|
558
|
+
type: 'txt',
|
|
559
|
+
msg: msg,
|
|
560
|
+
to: curAgentId || '',
|
|
561
|
+
// Need to be the user ID of the current conversation
|
|
562
|
+
chatType: 'singleChat'
|
|
563
|
+
});
|
|
564
|
+
_context7.next = 3;
|
|
565
|
+
return rootStore.messageStore.sendMessage(customMessage);
|
|
566
|
+
case 3:
|
|
567
|
+
sendAgentMsg(curAgentId, msg);
|
|
568
|
+
case 4:
|
|
569
|
+
case "end":
|
|
570
|
+
return _context7.stop();
|
|
571
|
+
}
|
|
572
|
+
}, _callee6);
|
|
573
|
+
}));
|
|
574
|
+
return function postMessage(_x5) {
|
|
575
|
+
return _ref15.apply(this, arguments);
|
|
576
|
+
};
|
|
577
|
+
}();
|
|
578
|
+
var afterSendMsg = /*#__PURE__*/function () {
|
|
579
|
+
var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(msgInfo) {
|
|
580
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
581
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
582
|
+
case 0:
|
|
583
|
+
sendAgentMsg(curAgentId, msgInfo.msg);
|
|
584
|
+
case 1:
|
|
585
|
+
case "end":
|
|
586
|
+
return _context8.stop();
|
|
587
|
+
}
|
|
588
|
+
}, _callee7);
|
|
589
|
+
}));
|
|
590
|
+
return function afterSendMsg(_x6) {
|
|
591
|
+
return _ref16.apply(this, arguments);
|
|
592
|
+
};
|
|
593
|
+
}();
|
|
512
594
|
return /*#__PURE__*/React.createElement("div", {
|
|
513
|
-
className: "bg-[var(--im-main-backgroundColor)] ".concat((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : '', " w-full h-full overflow-hidden flex flex-col")
|
|
595
|
+
className: "bg-[var(--im-main-backgroundColor)] bg-pink ".concat((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : '', " w-full h-full overflow-hidden flex flex-col")
|
|
514
596
|
}, (collectList === null || collectList === void 0 ? void 0 : collectList.length) && /*#__PURE__*/React.createElement("div", {
|
|
515
597
|
className: "mb-2 mx-5 py-2 rounded-lg bg-[var(--im-main-bg-five)]"
|
|
516
598
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
@@ -531,7 +613,7 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
531
613
|
})), customHeader(), /*#__PURE__*/React.createElement(MessageList, {
|
|
532
614
|
className: "w-full flex-1",
|
|
533
615
|
conversation: {
|
|
534
|
-
conversationId:
|
|
616
|
+
conversationId: curAgentId,
|
|
535
617
|
chatType: props.chatType
|
|
536
618
|
},
|
|
537
619
|
renderMessage: function renderMessage(msg) {
|
|
@@ -547,18 +629,21 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
547
629
|
className: "flex-shrink-0 py-1 px-2.5 text-xs text-[var(--im-five-fontColor)] border border-[var(--im-main-bg-ten)] rounded-sm cursor-pointer",
|
|
548
630
|
key: "tip".concat(index),
|
|
549
631
|
onClick: function onClick() {
|
|
550
|
-
|
|
632
|
+
postMessage(item);
|
|
551
633
|
}
|
|
552
634
|
}, item);
|
|
553
635
|
}))), /*#__PURE__*/React.createElement(MessageInput, _extends({
|
|
554
636
|
enabledTyping: true,
|
|
555
637
|
placeHolder: '',
|
|
556
638
|
conversation: {
|
|
557
|
-
conversationId:
|
|
639
|
+
conversationId: curAgentId,
|
|
558
640
|
chatType: props.chatType
|
|
559
641
|
}
|
|
560
642
|
}, commonMessageInputConfig, {
|
|
561
|
-
disabled: false
|
|
643
|
+
disabled: false,
|
|
644
|
+
onSendMessage: function onSendMessage(msg) {
|
|
645
|
+
afterSendMsg(msg);
|
|
646
|
+
}
|
|
562
647
|
})));
|
|
563
648
|
};
|
|
564
649
|
|
|
@@ -72,7 +72,9 @@ var GroupShareView = function GroupShareView(props) {
|
|
|
72
72
|
imgUrl: props.shareObjImageurl
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
customMessage = ChatSDK.message.create(
|
|
75
|
+
customMessage = ChatSDK.message.create({
|
|
76
|
+
option: option
|
|
77
|
+
});
|
|
76
78
|
_context2.next = 4;
|
|
77
79
|
return rootStore.messageStore.sendMessage(customMessage);
|
|
78
80
|
case 4:
|
package/es/IM/style/index.scss
CHANGED
|
@@ -21,6 +21,14 @@
|
|
|
21
21
|
--im-msg-bubble-color-left: rgba(255, 255, 255, 1);
|
|
22
22
|
--im-msg-bubble-color-right: rgba(156, 255, 30.1);
|
|
23
23
|
--im-msg-bubble-font-color: rgba(0, 0, 0, 0.7);
|
|
24
|
+
|
|
25
|
+
--im-border-10: rgba(0, 0, 0, 0.1);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
.cui-textarea-input{
|
|
29
|
+
color: var(--im-five-fontColor);
|
|
30
|
+
background-color: var(--im-main-bg-five);
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
33
|
.im-dark {
|
|
26
34
|
--im-main-backgroundColor: #1e2329;
|
|
@@ -67,6 +75,8 @@
|
|
|
67
75
|
|
|
68
76
|
--im-main-buttonColor: rgba(156, 255, 30, 1);
|
|
69
77
|
--im-main-switchColor: rgba(0, 200, 5, 1);
|
|
78
|
+
|
|
79
|
+
--im-border-10: rgba(255, 255, 255, 0.1);
|
|
70
80
|
}
|
|
71
81
|
|
|
72
82
|
.cui-message-base-right {
|