whyuzeim 1.1.2 → 1.1.4
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/AddMember/index.js +3 -5
- package/cjs/ChatBox/JoinGroupDialog/index.js +2 -4
- package/cjs/ChatBox/index.js +4 -5
- package/cjs/ContactList/index.js +2 -4
- package/cjs/CustomChatView/index.js +3 -4
- package/cjs/GroupDetail/GroupDetailEditView/index.js +3 -5
- package/cjs/GroupDetail/GroupShareView/index.js +2 -4
- package/cjs/GroupDetail/index.js +4 -6
- package/cjs/HighlyCustomChat/index.d.ts +1 -0
- package/cjs/HighlyCustomChat/index.js +3 -1
- package/cjs/IM/context.d.ts +0 -5
- package/cjs/IM/context.js +1 -7
- package/cjs/IM/hooks/useGetAgoraToken.d.ts +1 -2
- package/cjs/IM/hooks/useGetAgoraToken.js +3 -5
- package/cjs/IM/index.d.ts +1 -2
- package/cjs/IM/index.js +3 -5
- package/cjs/Sidebar/CreateGroup/index.js +4 -6
- package/cjs/Sidebar/CustomConversationItem/OperateBtn/index.js +2 -4
- package/cjs/Sidebar/GroupList/OperateBtn/index.js +3 -5
- package/cjs/Sidebar/GroupList/index.js +2 -4
- package/cjs/Sidebar/MobileCreateGroup/index.js +4 -6
- package/cjs/Sidebar/Searchbox/index.js +2 -4
- package/cjs/TypeItem/OperateBtn/index.js +5 -7
- package/cjs/UserProfile/index.js +3 -5
- package/cjs/index.d.ts +7 -8
- package/cjs/index.js +0 -4
- package/cjs/type.d.ts +1 -3
- package/cjs/type.js +10 -22
- package/es/AddMember/index.js +3 -5
- package/es/ChatBox/JoinGroupDialog/index.js +2 -4
- package/es/ChatBox/index.js +5 -6
- package/es/ContactList/index.js +2 -4
- package/es/CustomChatView/index.js +4 -5
- package/es/GroupDetail/GroupDetailEditView/index.js +3 -5
- package/es/GroupDetail/GroupShareView/index.js +2 -4
- package/es/GroupDetail/index.js +4 -6
- package/es/HighlyCustomChat/index.d.ts +1 -0
- package/es/HighlyCustomChat/index.js +3 -1
- package/es/IM/context.d.ts +0 -5
- package/es/IM/context.js +2 -8
- package/es/IM/hooks/useGetAgoraToken.d.ts +1 -2
- package/es/IM/hooks/useGetAgoraToken.js +3 -5
- package/es/IM/index.d.ts +1 -2
- package/es/IM/index.js +3 -5
- package/es/Sidebar/CreateGroup/index.js +4 -6
- package/es/Sidebar/CustomConversationItem/OperateBtn/index.js +2 -4
- package/es/Sidebar/GroupList/OperateBtn/index.js +3 -5
- package/es/Sidebar/GroupList/index.js +2 -4
- package/es/Sidebar/MobileCreateGroup/index.js +4 -6
- package/es/Sidebar/Searchbox/index.js +2 -4
- package/es/TypeItem/OperateBtn/index.js +5 -7
- package/es/UserProfile/index.js +3 -5
- package/es/index.d.ts +7 -8
- package/es/index.js +1 -1
- package/es/type.d.ts +1 -3
- package/es/type.js +11 -22
- package/package.json +1 -1
package/cjs/AddMember/index.js
CHANGED
|
@@ -17,7 +17,6 @@ var context = require('../IM/context.js');
|
|
|
17
17
|
var antd = require('antd');
|
|
18
18
|
var useDebounce = require('use-debounce');
|
|
19
19
|
require('./style/index.scss');
|
|
20
|
-
var type = require('../type.js');
|
|
21
20
|
|
|
22
21
|
var AddMember = function AddMember() {
|
|
23
22
|
var _useContext = React.useContext(context.Context),
|
|
@@ -35,8 +34,7 @@ var AddMember = function AddMember() {
|
|
|
35
34
|
memberids = _useState6[0],
|
|
36
35
|
setMemberids = _useState6[1];
|
|
37
36
|
var _useContext2 = React.useContext(context.Context),
|
|
38
|
-
http = _useContext2.http
|
|
39
|
-
scense = _useContext2.scense;
|
|
37
|
+
http = _useContext2.http;
|
|
40
38
|
var _useState7 = React.useState([]),
|
|
41
39
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
42
40
|
memberList = _useState8[0],
|
|
@@ -55,7 +53,7 @@ var AddMember = function AddMember() {
|
|
|
55
53
|
return _context.abrupt("return");
|
|
56
54
|
case 4:
|
|
57
55
|
_context.next = 6;
|
|
58
|
-
return http.post(
|
|
56
|
+
return http.post("/capi/account/imchannel/getchanneluserv2", {
|
|
59
57
|
page: 1,
|
|
60
58
|
size: 2000,
|
|
61
59
|
sendbirdid: groupid
|
|
@@ -84,7 +82,7 @@ var AddMember = function AddMember() {
|
|
|
84
82
|
case 0:
|
|
85
83
|
setLoading(true);
|
|
86
84
|
try {
|
|
87
|
-
http.post(
|
|
85
|
+
http.post("/capi/account/imchannel/inviteruser", {
|
|
88
86
|
sendbirdid: agoraChatUikit.rootStore.conversationStore.currentCvs.conversationId,
|
|
89
87
|
memberids: memberids
|
|
90
88
|
});
|
|
@@ -7,13 +7,11 @@ var antd = require('antd');
|
|
|
7
7
|
var context = require('../../IM/context.js');
|
|
8
8
|
var agoraChatUikit = require('agora-chat-uikit');
|
|
9
9
|
require('./style/index.scss');
|
|
10
|
-
var type = require('../../type.js');
|
|
11
10
|
|
|
12
11
|
var JoinGroupDialog = function JoinGroupDialog(props) {
|
|
13
12
|
var _props$shareGroupInfo6;
|
|
14
13
|
var _useContext = React.useContext(context.Context),
|
|
15
|
-
http = _useContext.http
|
|
16
|
-
scense = _useContext.scense;
|
|
14
|
+
http = _useContext.http;
|
|
17
15
|
var joinGroup = /*#__PURE__*/function () {
|
|
18
16
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
19
17
|
var _props$shareGroupInfo;
|
|
@@ -26,7 +24,7 @@ var JoinGroupDialog = function JoinGroupDialog(props) {
|
|
|
26
24
|
inviteruid: props.userId
|
|
27
25
|
};
|
|
28
26
|
_context.next = 3;
|
|
29
|
-
return http.post(
|
|
27
|
+
return http.post('/capi/account/imchannel/apply/join', params);
|
|
30
28
|
case 3:
|
|
31
29
|
_yield$http$post = _context.sent;
|
|
32
30
|
data = _yield$http$post.data;
|
package/cjs/ChatBox/index.js
CHANGED
|
@@ -34,8 +34,7 @@ var Chatbox = function Chatbox(props) {
|
|
|
34
34
|
setRightComponent = _useContext.setRightComponent,
|
|
35
35
|
userInfo = _useContext.userInfo,
|
|
36
36
|
mobile = _useContext.mobile,
|
|
37
|
-
setMidComponent = _useContext.setMidComponent
|
|
38
|
-
scense = _useContext.scense;
|
|
37
|
+
setMidComponent = _useContext.setMidComponent;
|
|
39
38
|
var onBack = props.onBack;
|
|
40
39
|
var _useState = React.useState(false),
|
|
41
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -233,7 +232,7 @@ var Chatbox = function Chatbox(props) {
|
|
|
233
232
|
sendbirdid: groupid
|
|
234
233
|
};
|
|
235
234
|
_context2.next = 4;
|
|
236
|
-
return http.post(
|
|
235
|
+
return http.post("/capi/account/imchannel/exitchannel", params);
|
|
237
236
|
case 4:
|
|
238
237
|
response = _context2.sent;
|
|
239
238
|
_response$data = response.data, code = _response$data.code, msg = _response$data.msg;
|
|
@@ -432,7 +431,7 @@ var Chatbox = function Chatbox(props) {
|
|
|
432
431
|
sendbirdid: shareInfo === null || shareInfo === void 0 ? void 0 : shareInfo.objectId
|
|
433
432
|
};
|
|
434
433
|
_context6.next = 3;
|
|
435
|
-
return http.post(
|
|
434
|
+
return http.post("/capi/account/imchannel/getdetails", params);
|
|
436
435
|
case 3:
|
|
437
436
|
response = _context6.sent;
|
|
438
437
|
data = response.data;
|
|
@@ -497,7 +496,7 @@ var Chatbox = function Chatbox(props) {
|
|
|
497
496
|
};
|
|
498
497
|
_context3.prev = 4;
|
|
499
498
|
_context3.next = 7;
|
|
500
|
-
return http.get(
|
|
499
|
+
return http.get("/capi/account/imchannel/checkuserisexist", {
|
|
501
500
|
params: params
|
|
502
501
|
});
|
|
503
502
|
case 7:
|
package/cjs/ContactList/index.js
CHANGED
|
@@ -15,7 +15,6 @@ var useDebounce = require('use-debounce');
|
|
|
15
15
|
var classNames = require('classnames');
|
|
16
16
|
var index = require('../NoData/index.js');
|
|
17
17
|
var _ = require('lodash');
|
|
18
|
-
var type = require('../type.js');
|
|
19
18
|
|
|
20
19
|
var ContactList = function ContactList(props) {
|
|
21
20
|
var _$uniqBy;
|
|
@@ -35,8 +34,7 @@ var ContactList = function ContactList(props) {
|
|
|
35
34
|
setTotal = _useState4[1];
|
|
36
35
|
var pageRef = React.useRef(0);
|
|
37
36
|
var _useContext = React.useContext(context.Context),
|
|
38
|
-
http = _useContext.http
|
|
39
|
-
scense = _useContext.scense;
|
|
37
|
+
http = _useContext.http;
|
|
40
38
|
var apiRef = React.useRef(true);
|
|
41
39
|
var handleGetFrindList = React.useCallback(/*#__PURE__*/function () {
|
|
42
40
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(keyword) {
|
|
@@ -48,7 +46,7 @@ var ContactList = function ContactList(props) {
|
|
|
48
46
|
apiRef.current = false;
|
|
49
47
|
pageRef.current = pageRef.current + 1;
|
|
50
48
|
_context2.next = 5;
|
|
51
|
-
return http.post(
|
|
49
|
+
return http.post("/capi/account/imsearch/findpage", {
|
|
52
50
|
keyword: keyword,
|
|
53
51
|
type: 2,
|
|
54
52
|
userid: agoraChatUikit.rootStore.initConfig.userId,
|
|
@@ -29,8 +29,7 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
29
29
|
var _props$className;
|
|
30
30
|
var _useContext = React.useContext(context.Context),
|
|
31
31
|
http = _useContext.http,
|
|
32
|
-
userInfo = _useContext.userInfo
|
|
33
|
-
scense = _useContext.scense;
|
|
32
|
+
userInfo = _useContext.userInfo;
|
|
34
33
|
var _useState = React.useState(false),
|
|
35
34
|
_useState2 = _slicedToArray(_useState, 2);
|
|
36
35
|
_useState2[0];
|
|
@@ -339,7 +338,7 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
339
338
|
sendbirdid: shareInfo === null || shareInfo === void 0 ? void 0 : shareInfo.objectId
|
|
340
339
|
};
|
|
341
340
|
_context9.next = 3;
|
|
342
|
-
return http.post(
|
|
341
|
+
return http.post("/capi/account/imchannel/getdetails", params);
|
|
343
342
|
case 3:
|
|
344
343
|
response = _context9.sent;
|
|
345
344
|
data = response.data;
|
|
@@ -404,7 +403,7 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
404
403
|
};
|
|
405
404
|
_context2.prev = 4;
|
|
406
405
|
_context2.next = 7;
|
|
407
|
-
return http.get(
|
|
406
|
+
return http.get("/capi/account/imchannel/checkuserisexist", {
|
|
408
407
|
params: params
|
|
409
408
|
});
|
|
410
409
|
case 7:
|
|
@@ -18,7 +18,6 @@ var context = require('../../IM/context.js');
|
|
|
18
18
|
var antd = require('antd');
|
|
19
19
|
require('../../IM/style/index.scss');
|
|
20
20
|
var agoraChatUikit = require('agora-chat-uikit');
|
|
21
|
-
var type = require('../../type.js');
|
|
22
21
|
|
|
23
22
|
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; }
|
|
24
23
|
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; }
|
|
@@ -35,8 +34,7 @@ var GroupDetailEditView = function GroupDetailEditView(props) {
|
|
|
35
34
|
groupForm = _useState2[0],
|
|
36
35
|
setGroupForm = _useState2[1];
|
|
37
36
|
var _useContext = React.useContext(context.Context),
|
|
38
|
-
http = _useContext.http
|
|
39
|
-
scense = _useContext.scense;
|
|
37
|
+
http = _useContext.http;
|
|
40
38
|
var nameInputRef = React.useRef(null);
|
|
41
39
|
var descriptionInputRef = React.useRef(null);
|
|
42
40
|
// 设置默认值
|
|
@@ -64,7 +62,7 @@ var GroupDetailEditView = function GroupDetailEditView(props) {
|
|
|
64
62
|
formData.append('file', file);
|
|
65
63
|
_context.prev = 3;
|
|
66
64
|
_context.next = 6;
|
|
67
|
-
return http.post(
|
|
65
|
+
return http.post("/capi/account/open/videos/upload", formData);
|
|
68
66
|
case 6:
|
|
69
67
|
_yield$http$post = _context.sent;
|
|
70
68
|
data = _yield$http$post.data;
|
|
@@ -156,7 +154,7 @@ var GroupDetailEditView = function GroupDetailEditView(props) {
|
|
|
156
154
|
};
|
|
157
155
|
_context3.prev = 6;
|
|
158
156
|
_context3.next = 9;
|
|
159
|
-
return http.post(
|
|
157
|
+
return http.post("/capi/account/imchannel/update", options);
|
|
160
158
|
case 9:
|
|
161
159
|
response = _context3.sent;
|
|
162
160
|
_response$data = response.data, code = _response$data.code, msg = _response$data.msg;
|
|
@@ -8,13 +8,11 @@ var React = require('react');
|
|
|
8
8
|
var context = require('../../IM/context.js');
|
|
9
9
|
require('../../IM/style/index.scss');
|
|
10
10
|
var agoraChatUikit = require('agora-chat-uikit');
|
|
11
|
-
var type = require('../../type.js');
|
|
12
11
|
|
|
13
12
|
var GroupShareView = function GroupShareView(props) {
|
|
14
13
|
var _useContext = React.useContext(context.Context),
|
|
15
14
|
http = _useContext.http,
|
|
16
|
-
userInfo = _useContext.userInfo
|
|
17
|
-
scense = _useContext.scense;
|
|
15
|
+
userInfo = _useContext.userInfo;
|
|
18
16
|
var _useState = React.useState([]),
|
|
19
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
18
|
groupList = _useState2[0],
|
|
@@ -32,7 +30,7 @@ var GroupShareView = function GroupShareView(props) {
|
|
|
32
30
|
};
|
|
33
31
|
_context.prev = 1;
|
|
34
32
|
_context.next = 4;
|
|
35
|
-
return http.post(
|
|
33
|
+
return http.post("/capi/account/imchannel/getchannels", param);
|
|
36
34
|
case 4:
|
|
37
35
|
_yield$http$post = _context.sent;
|
|
38
36
|
data = _yield$http$post.data;
|
package/cjs/GroupDetail/index.js
CHANGED
|
@@ -17,7 +17,6 @@ var context = require('../IM/context.js');
|
|
|
17
17
|
require('./style/index.scss');
|
|
18
18
|
var index = require('./GroupDetailEditView/index.js');
|
|
19
19
|
var index$1 = require('./GroupShareView/index.js');
|
|
20
|
-
var type = require('../type.js');
|
|
21
20
|
|
|
22
21
|
var GroupDetail = function GroupDetail(props) {
|
|
23
22
|
var _groupInfo$sendbirdid;
|
|
@@ -25,8 +24,7 @@ var GroupDetail = function GroupDetail(props) {
|
|
|
25
24
|
http = _useContext.http,
|
|
26
25
|
mobile = _useContext.mobile,
|
|
27
26
|
setRightComponent = _useContext.setRightComponent,
|
|
28
|
-
renderMidComponent = _useContext.renderMidComponent
|
|
29
|
-
scense = _useContext.scense;
|
|
27
|
+
renderMidComponent = _useContext.renderMidComponent;
|
|
30
28
|
var _useState = React.useState(false),
|
|
31
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
30
|
isEdit = _useState2[0],
|
|
@@ -57,7 +55,7 @@ var GroupDetail = function GroupDetail(props) {
|
|
|
57
55
|
_context.prev = 0;
|
|
58
56
|
groupid = agoraChatUikit.rootStore.conversationStore.currentCvs.conversationId;
|
|
59
57
|
_context.next = 4;
|
|
60
|
-
return http.post(
|
|
58
|
+
return http.post("/capi/account/imchannel/getdetails", {
|
|
61
59
|
sendbirdid: groupid
|
|
62
60
|
});
|
|
63
61
|
case 4:
|
|
@@ -86,7 +84,7 @@ var GroupDetail = function GroupDetail(props) {
|
|
|
86
84
|
_context2.prev = 0;
|
|
87
85
|
groupid = agoraChatUikit.rootStore.conversationStore.currentCvs.conversationId;
|
|
88
86
|
_context2.next = 4;
|
|
89
|
-
return http.post(
|
|
87
|
+
return http.post("/capi/account/imchannel/getchanneluserv2", {
|
|
90
88
|
page: 1,
|
|
91
89
|
size: 2000,
|
|
92
90
|
sendbirdid: groupid
|
|
@@ -116,7 +114,7 @@ var GroupDetail = function GroupDetail(props) {
|
|
|
116
114
|
_context3.prev = 0;
|
|
117
115
|
groupid = agoraChatUikit.rootStore.conversationStore.currentCvs.conversationId;
|
|
118
116
|
_context3.next = 4;
|
|
119
|
-
return http.post(
|
|
117
|
+
return http.post("/capi/account/imchannel/setautomatictranslate", {
|
|
120
118
|
sendbirdid: groupid,
|
|
121
119
|
type: 0,
|
|
122
120
|
isautomatictranslate: checked ? 1 : 0
|
|
@@ -11,6 +11,7 @@ export interface IHighlyCustomChat {
|
|
|
11
11
|
renderInputView?: (cvs: Conversation, sendMessage: (text: string) => void) => React.ReactNode;
|
|
12
12
|
renderQuestionList?: (cvs: Conversation, sendMessage: (text: string) => void) => React.ReactNode;
|
|
13
13
|
sendMessageSuccessCallback?: (msg: ChatSDK.MessageBody) => void;
|
|
14
|
+
onStartRenderMessage?: () => void;
|
|
14
15
|
}
|
|
15
16
|
declare const HighlyCustomChat: React.FC<IHighlyCustomChat>;
|
|
16
17
|
export default HighlyCustomChat;
|
|
@@ -28,7 +28,8 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
28
28
|
// 设置默认值
|
|
29
29
|
var _props$showHeader = props.showHeader,
|
|
30
30
|
showHeader = _props$showHeader === void 0 ? true : _props$showHeader,
|
|
31
|
-
renderQuestionList = props.renderQuestionList
|
|
31
|
+
renderQuestionList = props.renderQuestionList,
|
|
32
|
+
onStartRenderMessage = props.onStartRenderMessage;
|
|
32
33
|
var _useSDK = agoraChatUikit.useSDK(),
|
|
33
34
|
MessageSDK = _useSDK.ChatSDK;
|
|
34
35
|
var _useContext = React.useContext(context.Context);
|
|
@@ -119,6 +120,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
119
120
|
}, formatMessageTime(msg.time)));
|
|
120
121
|
};
|
|
121
122
|
var _renderMessage = function renderMessage(msg) {
|
|
123
|
+
onStartRenderMessage && onStartRenderMessage();
|
|
122
124
|
if (msg.type === "txt") {
|
|
123
125
|
return renderTxtMsg(msg);
|
|
124
126
|
} else if (msg.type === "img") {
|
package/cjs/IM/context.d.ts
CHANGED
|
@@ -6,10 +6,6 @@ export interface IUserInfo {
|
|
|
6
6
|
username?: string;
|
|
7
7
|
avatar?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare enum Scense {
|
|
10
|
-
moompump = 0,
|
|
11
|
-
pdao = 1
|
|
12
|
-
}
|
|
13
9
|
export type ConfigConsumerProps = {
|
|
14
10
|
rightComponent?: React.ReactElement;
|
|
15
11
|
setRightComponent?: (element: React.ReactElement | undefined) => void;
|
|
@@ -20,7 +16,6 @@ export type ConfigConsumerProps = {
|
|
|
20
16
|
userInfo: IUserInfo;
|
|
21
17
|
sidebarExpand?: boolean;
|
|
22
18
|
setSidebarExpand?: (value: boolean) => void;
|
|
23
|
-
scense: Scense;
|
|
24
19
|
mobile?: boolean;
|
|
25
20
|
onChatIconClick?: () => void;
|
|
26
21
|
additionalConversations?: Conversation[];
|
package/cjs/IM/context.js
CHANGED
|
@@ -3,17 +3,11 @@
|
|
|
3
3
|
var axios = require('axios');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
|
|
6
|
-
exports.Scense = void 0;
|
|
7
|
-
(function (Scense) {
|
|
8
|
-
Scense[Scense["moompump"] = 0] = "moompump";
|
|
9
|
-
Scense[Scense["pdao"] = 1] = "pdao";
|
|
10
|
-
})(exports.Scense || (exports.Scense = {}));
|
|
11
6
|
var Context = /*#__PURE__*/React.createContext({
|
|
12
7
|
http: axios.create({}),
|
|
13
8
|
userInfo: {
|
|
14
9
|
uid: ""
|
|
15
|
-
}
|
|
16
|
-
scense: exports.Scense.moompump
|
|
10
|
+
}
|
|
17
11
|
});
|
|
18
12
|
|
|
19
13
|
exports.Context = Context;
|
|
@@ -6,10 +6,8 @@ var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var jsrsasign = require('jsrsasign');
|
|
8
8
|
var encryption = require('../encryption.js');
|
|
9
|
-
var context = require('../context.js');
|
|
10
|
-
var type = require('../../type.js');
|
|
11
9
|
|
|
12
|
-
var useGetAgoraToken = function useGetAgoraToken(http, uid
|
|
10
|
+
var useGetAgoraToken = function useGetAgoraToken(http, uid) {
|
|
13
11
|
var _useState = React.useState(""),
|
|
14
12
|
_useState2 = _slicedToArray(_useState, 2),
|
|
15
13
|
agoraToken = _useState2[0],
|
|
@@ -26,7 +24,7 @@ var useGetAgoraToken = function useGetAgoraToken(http, uid, scense) {
|
|
|
26
24
|
return _context.abrupt("return");
|
|
27
25
|
case 2:
|
|
28
26
|
_context.next = 4;
|
|
29
|
-
return http.get(
|
|
27
|
+
return http.get("/capi/account/imuser/getkeypair", {
|
|
30
28
|
params: {
|
|
31
29
|
type: 2
|
|
32
30
|
}
|
|
@@ -38,7 +36,7 @@ var useGetAgoraToken = function useGetAgoraToken(http, uid, scense) {
|
|
|
38
36
|
pub = jsrsasign.KEYUTIL.getKey(publicPemKey);
|
|
39
37
|
enc = jsrsasign.KJUR.crypto.Cipher.encrypt(encryption.aesKey, pub, "RSAOAEP");
|
|
40
38
|
_context.next = 11;
|
|
41
|
-
return http.get(
|
|
39
|
+
return http.get("/capi/account/imuser/getutoken", {
|
|
42
40
|
params: {
|
|
43
41
|
type: 2,
|
|
44
42
|
token: jsrsasign.hextob64(enc)
|
package/cjs/IM/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AxiosInstance } from "axios";
|
|
3
3
|
import { Conversation } from "agora-chat-uikit";
|
|
4
|
-
import { IUserInfo
|
|
4
|
+
import { IUserInfo } from "./context";
|
|
5
5
|
import "agora-chat-uikit/style.css";
|
|
6
6
|
import "./style/index.scss";
|
|
7
7
|
export type IIMProps = {
|
|
@@ -16,7 +16,6 @@ export type IIMProps = {
|
|
|
16
16
|
style?: React.CSSProperties;
|
|
17
17
|
mobile?: boolean;
|
|
18
18
|
onChatIconClick?: () => void;
|
|
19
|
-
scense: Scense;
|
|
20
19
|
additionalConversations?: Conversation[];
|
|
21
20
|
onAdditionalConversationClick?: (conversation: Conversation) => Promise<boolean>;
|
|
22
21
|
onRenderConversationItem?: (cvs: Conversation, defaultConversationItemClick: (conversation: Conversation) => void) => React.ReactElement | undefined;
|
package/cjs/IM/index.js
CHANGED
|
@@ -30,10 +30,9 @@ var IM = function IM(props) {
|
|
|
30
30
|
onChatIconClick = props.onChatIconClick,
|
|
31
31
|
additionalConversations = props.additionalConversations,
|
|
32
32
|
onAdditionalConversationClick = props.onAdditionalConversationClick,
|
|
33
|
-
onRenderConversationItem = props.onRenderConversationItem
|
|
34
|
-
scense = props.scense;
|
|
33
|
+
onRenderConversationItem = props.onRenderConversationItem;
|
|
35
34
|
console.log("the useinfo is", userInfo);
|
|
36
|
-
var agoraToken = useGetAgoraToken.useGetAgoraToken(http, userInfo.uid
|
|
35
|
+
var agoraToken = useGetAgoraToken.useGetAgoraToken(http, userInfo.uid);
|
|
37
36
|
var _useState = React.useState(),
|
|
38
37
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
38
|
rightComponent = _useState2[0],
|
|
@@ -88,8 +87,7 @@ var IM = function IM(props) {
|
|
|
88
87
|
onChatIconClick: onChatIconClick,
|
|
89
88
|
additionalConversations: additionalConversations,
|
|
90
89
|
onAdditionalConversationClick: onAdditionalConversationClick,
|
|
91
|
-
onRenderConversationItem: onRenderConversationItem
|
|
92
|
-
scense: scense
|
|
90
|
+
onRenderConversationItem: onRenderConversationItem
|
|
93
91
|
}
|
|
94
92
|
}, /*#__PURE__*/React.createElement(agoraChatUikit.UIKitProvider, {
|
|
95
93
|
initConfig: {
|
|
@@ -20,7 +20,6 @@ require('./style/index.scss');
|
|
|
20
20
|
var InfiniteScroll = require('react-infinite-scroll-component');
|
|
21
21
|
var index$1 = require('../../NoData/index.js');
|
|
22
22
|
var _ = require('lodash');
|
|
23
|
-
var type = require('../../type.js');
|
|
24
23
|
|
|
25
24
|
var CreateGroup = function CreateGroup(props) {
|
|
26
25
|
var _$uniqBy;
|
|
@@ -29,8 +28,7 @@ var CreateGroup = function CreateGroup(props) {
|
|
|
29
28
|
open = _props$open === void 0 ? false : _props$open;
|
|
30
29
|
var _useContext = React.useContext(context.Context),
|
|
31
30
|
http = _useContext.http,
|
|
32
|
-
userInfo = _useContext.userInfo
|
|
33
|
-
scense = _useContext.scense;
|
|
31
|
+
userInfo = _useContext.userInfo;
|
|
34
32
|
var _useState = React.useState([]),
|
|
35
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
34
|
list = _useState2[0],
|
|
@@ -60,7 +58,7 @@ var CreateGroup = function CreateGroup(props) {
|
|
|
60
58
|
apiRef.current = false;
|
|
61
59
|
_context2.prev = 2;
|
|
62
60
|
_context2.next = 5;
|
|
63
|
-
return http.post(
|
|
61
|
+
return http.post("/capi/account/imsearch/findpage", {
|
|
64
62
|
keyword: keyword,
|
|
65
63
|
type: 2,
|
|
66
64
|
userid: userInfo === null || userInfo === void 0 ? void 0 : userInfo.uid,
|
|
@@ -101,7 +99,7 @@ var CreateGroup = function CreateGroup(props) {
|
|
|
101
99
|
setLoading(true);
|
|
102
100
|
_context3.prev = 1;
|
|
103
101
|
_context3.next = 4;
|
|
104
|
-
return http.get(
|
|
102
|
+
return http.get("/capi/account/imchannel/imchannelconfig");
|
|
105
103
|
case 4:
|
|
106
104
|
result1 = _context3.sent;
|
|
107
105
|
name = _mapInstanceProperty(member).call(member, function (item) {
|
|
@@ -116,7 +114,7 @@ var CreateGroup = function CreateGroup(props) {
|
|
|
116
114
|
})
|
|
117
115
|
};
|
|
118
116
|
_context3.next = 9;
|
|
119
|
-
return http.post(
|
|
117
|
+
return http.post("/capi/account/imchannel/save", data);
|
|
120
118
|
case 9:
|
|
121
119
|
result2 = _context3.sent;
|
|
122
120
|
setLoading(false);
|
|
@@ -13,15 +13,13 @@ var muted = require('./image/muted.svg.js');
|
|
|
13
13
|
var logout = require('./image/logout.svg.js');
|
|
14
14
|
var _delete = require('./image/delete.svg.js');
|
|
15
15
|
require('./style/index.scss');
|
|
16
|
-
var type = require('../../../type.js');
|
|
17
16
|
|
|
18
17
|
var OperateBtn = function OperateBtn(props) {
|
|
19
18
|
var conversationId = props.conversationId,
|
|
20
19
|
chatType = props.chatType,
|
|
21
20
|
silent = props.silent;
|
|
22
21
|
var _useContext = React.useContext(context.Context),
|
|
23
|
-
http = _useContext.http
|
|
24
|
-
scense = _useContext.scense;
|
|
22
|
+
http = _useContext.http;
|
|
25
23
|
var _useConversationConte = agoraChatUikit.useConversationContext(),
|
|
26
24
|
deleteConversation = _useConversationConte.deleteConversation;
|
|
27
25
|
var _useState = React.useState(false),
|
|
@@ -134,7 +132,7 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
134
132
|
while (1) switch (_context4.prev = _context4.next) {
|
|
135
133
|
case 0:
|
|
136
134
|
_context4.next = 2;
|
|
137
|
-
return http.post(
|
|
135
|
+
return http.post("/capi/account/imchannel/exitchannel", {
|
|
138
136
|
sendbirdid: conversationId
|
|
139
137
|
});
|
|
140
138
|
case 2:
|
|
@@ -14,7 +14,6 @@ var muted = require('./image/muted.svg.js');
|
|
|
14
14
|
var logout = require('./image/logout.svg.js');
|
|
15
15
|
var _delete = require('./image/delete.svg.js');
|
|
16
16
|
require('./style/index.scss');
|
|
17
|
-
var type = require('../../../type.js');
|
|
18
17
|
|
|
19
18
|
var OperateBtn = function OperateBtn(props) {
|
|
20
19
|
var conversationId = props.conversationId,
|
|
@@ -22,8 +21,7 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
22
21
|
silent = props.silent,
|
|
23
22
|
onDelete = props.onDelete;
|
|
24
23
|
var _useContext = React.useContext(context.Context),
|
|
25
|
-
http = _useContext.http
|
|
26
|
-
scense = _useContext.scense;
|
|
24
|
+
http = _useContext.http;
|
|
27
25
|
var _useState = React.useState(false),
|
|
28
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
27
|
tooltipOpen = _useState2[0],
|
|
@@ -157,7 +155,7 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
157
155
|
while (1) switch (_context5.prev = _context5.next) {
|
|
158
156
|
case 0:
|
|
159
157
|
_context5.next = 2;
|
|
160
|
-
return http.post(
|
|
158
|
+
return http.post("/capi/account/imchannel/exitchannel", {
|
|
161
159
|
sendbirdid: conversationId
|
|
162
160
|
});
|
|
163
161
|
case 2:
|
|
@@ -181,7 +179,7 @@ var OperateBtn = function OperateBtn(props) {
|
|
|
181
179
|
case 0:
|
|
182
180
|
event.stopPropagation();
|
|
183
181
|
_context6.next = 3;
|
|
184
|
-
return http.post(
|
|
182
|
+
return http.post("/capi/account/imchannel/delete", {
|
|
185
183
|
sendbirdid: conversationId
|
|
186
184
|
});
|
|
187
185
|
case 3:
|
|
@@ -15,7 +15,6 @@ var index = require('../../TypeItem/index.js');
|
|
|
15
15
|
var index$1 = require('./OperateBtn/index.js');
|
|
16
16
|
var index$2 = require('../../NoData/index.js');
|
|
17
17
|
var useDebounce = require('use-debounce');
|
|
18
|
-
var type = require('../../type.js');
|
|
19
18
|
|
|
20
19
|
var List = function List(props) {
|
|
21
20
|
var _props$activekey = props.activekey,
|
|
@@ -23,8 +22,7 @@ var List = function List(props) {
|
|
|
23
22
|
keyword = props.keyword;
|
|
24
23
|
var _useContext = React.useContext(context.Context),
|
|
25
24
|
http = _useContext.http,
|
|
26
|
-
renderMidComponent = _useContext.renderMidComponent
|
|
27
|
-
scense = _useContext.scense;
|
|
25
|
+
renderMidComponent = _useContext.renderMidComponent;
|
|
28
26
|
var _useState = React.useState(null),
|
|
29
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
30
28
|
list = _useState2[0],
|
|
@@ -37,7 +35,7 @@ var List = function List(props) {
|
|
|
37
35
|
while (1) switch (_context.prev = _context.next) {
|
|
38
36
|
case 0:
|
|
39
37
|
_context.next = 2;
|
|
40
|
-
return http.post(
|
|
38
|
+
return http.post("/capi/account/imchannel/getchannels", {
|
|
41
39
|
name: keyword,
|
|
42
40
|
type: activekey
|
|
43
41
|
});
|
|
@@ -18,15 +18,13 @@ var ic_close = require('../image/ic_close.svg.js');
|
|
|
18
18
|
require('./style/index.scss');
|
|
19
19
|
var classNames = require('classnames');
|
|
20
20
|
var InfiniteScroll = require('react-infinite-scroll-component');
|
|
21
|
-
var type = require('../../type.js');
|
|
22
21
|
|
|
23
22
|
var MobileCreateGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
24
23
|
var onClose = props.onClose,
|
|
25
24
|
style = props.style;
|
|
26
25
|
var _useContext = React.useContext(context.Context),
|
|
27
26
|
http = _useContext.http,
|
|
28
|
-
userInfo = _useContext.userInfo
|
|
29
|
-
scense = _useContext.scense;
|
|
27
|
+
userInfo = _useContext.userInfo;
|
|
30
28
|
var _useState = React.useState([]),
|
|
31
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
30
|
list = _useState2[0],
|
|
@@ -52,7 +50,7 @@ var MobileCreateGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
52
50
|
apiRef.current = false;
|
|
53
51
|
_context2.prev = 2;
|
|
54
52
|
_context2.next = 5;
|
|
55
|
-
return http.post(
|
|
53
|
+
return http.post("/capi/account/imsearch/findpage", {
|
|
56
54
|
keyword: keyword,
|
|
57
55
|
type: 2,
|
|
58
56
|
userid: userInfo.uid,
|
|
@@ -92,7 +90,7 @@ var MobileCreateGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
92
90
|
case 0:
|
|
93
91
|
_context3.prev = 0;
|
|
94
92
|
_context3.next = 3;
|
|
95
|
-
return http.get(
|
|
93
|
+
return http.get("/capi/account/imchannel/imchannelconfig");
|
|
96
94
|
case 3:
|
|
97
95
|
result1 = _context3.sent;
|
|
98
96
|
name = _mapInstanceProperty(member).call(member, function (item) {
|
|
@@ -107,7 +105,7 @@ var MobileCreateGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
107
105
|
})
|
|
108
106
|
};
|
|
109
107
|
_context3.next = 8;
|
|
110
|
-
return http.post(
|
|
108
|
+
return http.post("/capi/account/imchannel/save", data);
|
|
111
109
|
case 8:
|
|
112
110
|
result2 = _context3.sent;
|
|
113
111
|
if ((_result2$data = result2.data) !== null && _result2$data !== void 0 && (_result2$data = _result2$data.data) !== null && _result2$data !== void 0 && _result2$data.sendbirdid) {
|
|
@@ -17,14 +17,12 @@ var ic_messages = require('./image/ic_messages.svg.js');
|
|
|
17
17
|
require('./style/index.scss');
|
|
18
18
|
var index$2 = require('../../NoData/index.js');
|
|
19
19
|
var InfiniteScroll = require('react-infinite-scroll-component');
|
|
20
|
-
var type = require('../../type.js');
|
|
21
20
|
|
|
22
21
|
var Searchbox = function Searchbox(props) {
|
|
23
22
|
var style = props.style;
|
|
24
23
|
var _useContext = React.useContext(context.Context),
|
|
25
24
|
http = _useContext.http,
|
|
26
|
-
renderMidComponent = _useContext.renderMidComponent
|
|
27
|
-
scense = _useContext.scense;
|
|
25
|
+
renderMidComponent = _useContext.renderMidComponent;
|
|
28
26
|
var _useState = React.useState(0),
|
|
29
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
30
28
|
current = _useState2[0],
|
|
@@ -59,7 +57,7 @@ var Searchbox = function Searchbox(props) {
|
|
|
59
57
|
apiRef.current = false;
|
|
60
58
|
pageGroupsRef.current = pageGroupsRef.current + 1;
|
|
61
59
|
_context2.next = 5;
|
|
62
|
-
return http.post(
|
|
60
|
+
return http.post("/capi/account/imsearch/findpage", {
|
|
63
61
|
keyword: keyword,
|
|
64
62
|
type: 1,
|
|
65
63
|
userid: agoraChatUikit.rootStore.initConfig.userId,
|