whyuzeim 1.0.0 → 1.0.1
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 +2 -2
- package/cjs/ChatBox/index.js +16 -1
- package/cjs/ContactList/index.js +41 -16
- package/cjs/CustomChatView/image/set.svg.js +5 -0
- package/cjs/CustomChatView/index.d.ts +1 -0
- package/cjs/CustomChatView/index.js +191 -13
- package/cjs/CustomChatView/style/index.scss +7 -0
- package/cjs/GroupDetail/GroupShareView/index.js +1 -1
- package/cjs/IM/style/index.scss +15 -1
- package/cjs/Sidebar/CreateGroup/index.js +55 -29
- package/cjs/Sidebar/CustomConversationItem/OperateBtn/index.js +4 -4
- package/cjs/Sidebar/GroupList/OperateBtn/index.js +11 -7
- package/cjs/Sidebar/GroupList/index.js +2 -3
- package/cjs/Sidebar/MobileCreateGroup/index.js +4 -4
- package/cjs/Sidebar/MobileCreateGroup/style/index.scss +6 -7
- package/cjs/Sidebar/Searchbox/index.js +47 -20
- package/cjs/Sidebar/index.js +7 -3
- package/cjs/TypeItem/OperateBtn/index.js +5 -5
- package/es/AddMember/index.js +2 -2
- package/es/ChatBox/index.js +16 -1
- package/es/ContactList/index.js +42 -17
- package/es/CustomChatView/image/set.svg.js +3 -0
- package/es/CustomChatView/index.d.ts +1 -0
- package/es/CustomChatView/index.js +192 -14
- package/es/CustomChatView/style/index.scss +7 -0
- package/es/GroupDetail/GroupShareView/index.js +1 -1
- package/es/IM/style/index.scss +15 -1
- package/es/Sidebar/CreateGroup/index.js +56 -30
- package/es/Sidebar/CustomConversationItem/OperateBtn/index.js +4 -4
- package/es/Sidebar/GroupList/OperateBtn/index.js +11 -7
- package/es/Sidebar/GroupList/index.js +2 -3
- package/es/Sidebar/MobileCreateGroup/index.js +4 -4
- package/es/Sidebar/MobileCreateGroup/style/index.scss +6 -7
- package/es/Sidebar/Searchbox/index.js +48 -21
- package/es/Sidebar/index.js +7 -3
- package/es/TypeItem/OperateBtn/index.js +5 -5
- package/package.json +15 -4
package/cjs/AddMember/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var index = require('../ContactList/index.js');
|
|
|
14
14
|
var index$1 = require('../TypeItem/index.js');
|
|
15
15
|
var context = require('../IM/context.js');
|
|
16
16
|
var antd = require('antd');
|
|
17
|
-
var
|
|
17
|
+
var useDebounce = require('use-debounce');
|
|
18
18
|
require('./style/index.scss');
|
|
19
19
|
|
|
20
20
|
var AddMember = function AddMember() {
|
|
@@ -48,7 +48,7 @@ var AddMember = function AddMember() {
|
|
|
48
48
|
}
|
|
49
49
|
}, _callee);
|
|
50
50
|
})), [http, memberids, setRightComponent]);
|
|
51
|
-
var handleDebouncdAddMember =
|
|
51
|
+
var handleDebouncdAddMember = useDebounce.useDebouncedCallback(handleAddMember, 100);
|
|
52
52
|
return /*#__PURE__*/React.createElement("div", {
|
|
53
53
|
className: classNames("yuze-addMember w-full h-full")
|
|
54
54
|
}, /*#__PURE__*/React.createElement("div", {
|
package/cjs/ChatBox/index.js
CHANGED
|
@@ -77,7 +77,10 @@ var Chatbox = function Chatbox(props) {
|
|
|
77
77
|
reaction: false,
|
|
78
78
|
select: false,
|
|
79
79
|
thread: false,
|
|
80
|
-
customAction: (_ref = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref !== void 0 ? _ref : undefined
|
|
80
|
+
customAction: (_ref = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref !== void 0 ? _ref : undefined,
|
|
81
|
+
renderUserProfile: function renderUserProfile() {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
81
84
|
});
|
|
82
85
|
};
|
|
83
86
|
var renderShareCardMsg = function renderShareCardMsg(msg) {
|
|
@@ -109,6 +112,9 @@ var Chatbox = function Chatbox(props) {
|
|
|
109
112
|
select: false,
|
|
110
113
|
thread: false,
|
|
111
114
|
customAction: (_ref2 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref2 !== void 0 ? _ref2 : undefined,
|
|
115
|
+
renderUserProfile: function renderUserProfile() {
|
|
116
|
+
return null;
|
|
117
|
+
},
|
|
112
118
|
imageMessage: msg
|
|
113
119
|
});
|
|
114
120
|
} else if (msg.type === 'file') {
|
|
@@ -123,6 +129,9 @@ var Chatbox = function Chatbox(props) {
|
|
|
123
129
|
padding: "10px 12px",
|
|
124
130
|
color: "var(--im-msg-bubble-font-color)"
|
|
125
131
|
},
|
|
132
|
+
renderUserProfile: function renderUserProfile() {
|
|
133
|
+
return null;
|
|
134
|
+
},
|
|
126
135
|
customAction: (_ref3 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref3 !== void 0 ? _ref3 : undefined,
|
|
127
136
|
fileMessage: msg
|
|
128
137
|
});
|
|
@@ -132,6 +141,9 @@ var Chatbox = function Chatbox(props) {
|
|
|
132
141
|
reaction: false,
|
|
133
142
|
select: false,
|
|
134
143
|
thread: false,
|
|
144
|
+
renderUserProfile: function renderUserProfile() {
|
|
145
|
+
return null;
|
|
146
|
+
},
|
|
135
147
|
customAction: (_ref4 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref4 !== void 0 ? _ref4 : undefined,
|
|
136
148
|
videoMessage: msg
|
|
137
149
|
});
|
|
@@ -158,6 +170,9 @@ var Chatbox = function Chatbox(props) {
|
|
|
158
170
|
select: false,
|
|
159
171
|
thread: false,
|
|
160
172
|
direction: isMySelf ? 'rtl' : 'ltr',
|
|
173
|
+
renderUserProfile: function renderUserProfile() {
|
|
174
|
+
return null;
|
|
175
|
+
},
|
|
161
176
|
customAction: (_ref6 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref6 !== void 0 ? _ref6 : undefined,
|
|
162
177
|
children: renderShareCardMsg(msg)
|
|
163
178
|
});
|
package/cjs/ContactList/index.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _toConsumableArray = require('@babel/runtime-corejs3/helpers/esm/toConsumableArray');
|
|
3
4
|
var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/esm/asyncToGenerator');
|
|
4
5
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/esm/slicedToArray');
|
|
5
|
-
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
6
6
|
var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
|
|
7
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
8
|
+
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
7
9
|
var React = require('react');
|
|
10
|
+
var InfiniteScroll = require('react-infinite-scroll-component');
|
|
8
11
|
require('./style/index.scss');
|
|
9
12
|
var context = require('../IM/context.js');
|
|
10
13
|
var agoraChatUikit = require('agora-chat-uikit');
|
|
11
|
-
var
|
|
14
|
+
var useDebounce = require('use-debounce');
|
|
12
15
|
var classNames = require('classnames');
|
|
13
16
|
var index = require('../NoData/index.js');
|
|
14
17
|
|
|
@@ -20,29 +23,39 @@ var ContactList = function ContactList(props) {
|
|
|
20
23
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
24
|
list = _useState2[0],
|
|
22
25
|
setList = _useState2[1];
|
|
26
|
+
var listRef = React.useRef(null);
|
|
27
|
+
var _useState3 = React.useState(0),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
total = _useState4[0],
|
|
30
|
+
setTotal = _useState4[1];
|
|
31
|
+
var pageRef = React.useRef(0);
|
|
23
32
|
var _useContext = React.useContext(context.Context),
|
|
24
33
|
http = _useContext.http;
|
|
25
34
|
var handleGetFrindList = React.useCallback(/*#__PURE__*/function () {
|
|
26
35
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(keyword) {
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
var _context;
|
|
37
|
+
var result, _result$data$data, data, total;
|
|
38
|
+
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
39
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
30
40
|
case 0:
|
|
31
|
-
|
|
41
|
+
pageRef.current = pageRef.current + 1;
|
|
42
|
+
_context2.next = 3;
|
|
32
43
|
return http.post("/capi/account/imsearch/findpage", {
|
|
33
44
|
keyword: keyword,
|
|
34
45
|
type: 2,
|
|
35
46
|
userid: agoraChatUikit.rootStore.initConfig.userId,
|
|
36
47
|
size: 10,
|
|
37
|
-
page:
|
|
48
|
+
page: pageRef.current
|
|
38
49
|
});
|
|
39
|
-
case
|
|
40
|
-
result =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
case 3:
|
|
51
|
+
result = _context2.sent;
|
|
52
|
+
_result$data$data = result.data.data, data = _result$data$data.list, total = _result$data$data.total;
|
|
53
|
+
listRef.current = !listRef.current ? data : _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(listRef.current), _toConsumableArray(data));
|
|
54
|
+
setList(listRef.current);
|
|
55
|
+
setTotal(total);
|
|
56
|
+
case 8:
|
|
44
57
|
case "end":
|
|
45
|
-
return
|
|
58
|
+
return _context2.stop();
|
|
46
59
|
}
|
|
47
60
|
}, _callee);
|
|
48
61
|
}));
|
|
@@ -50,15 +63,27 @@ var ContactList = function ContactList(props) {
|
|
|
50
63
|
return _ref.apply(this, arguments);
|
|
51
64
|
};
|
|
52
65
|
}(), [http]);
|
|
53
|
-
var handleDebounceFriendList =
|
|
66
|
+
var handleDebounceFriendList = useDebounce.useDebouncedCallback(handleGetFrindList, 100);
|
|
54
67
|
React.useEffect(function () {
|
|
68
|
+
pageRef.current = 0;
|
|
69
|
+
listRef.current = [];
|
|
55
70
|
handleDebounceFriendList(keyword);
|
|
56
71
|
}, [handleDebounceFriendList, keyword]);
|
|
57
72
|
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: classNames("yuze-contactList w-full overflow-auto", className)
|
|
73
|
+
className: classNames("yuze-contactList w-full overflow-auto", className),
|
|
74
|
+
id: "contactList"
|
|
75
|
+
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
76
|
+
dataLength: (list === null || list === void 0 ? void 0 : list.length) || 0,
|
|
77
|
+
next: handleGetFrindList,
|
|
78
|
+
inverse: false //
|
|
79
|
+
,
|
|
80
|
+
hasMore: ((list === null || list === void 0 ? void 0 : list.length) || 0) < total,
|
|
81
|
+
scrollableTarget: "contactList",
|
|
82
|
+
loader: /*#__PURE__*/React.createElement(React.Fragment, null),
|
|
83
|
+
className: "h-full"
|
|
59
84
|
}, list === null || list === void 0 ? void 0 : _mapInstanceProperty(list).call(list, function (item) {
|
|
60
85
|
return renderItem(item);
|
|
61
|
-
}), (list === null || list === void 0 ? void 0 : list.length) === 0 && /*#__PURE__*/React.createElement(index, null));
|
|
86
|
+
})), (list === null || list === void 0 ? void 0 : list.length) === 0 && /*#__PURE__*/React.createElement(index, null));
|
|
62
87
|
};
|
|
63
88
|
|
|
64
89
|
module.exports = ContactList;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var img = "data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg id='Config (%26%23233%3b%26%23133%3b%26%23141%3b%26%23231%3b%26%23189%3b%26%23174%3b)'%3e%3cpath id='Vector' d='M8.00016 1.83337L6.00016 3.83337H3.3335V6.50004L1.3335 8.50004L3.3335 10.5V13.1667H6.00016L8.00016 15.1667L10.0002 13.1667H12.6668V10.5L14.6668 8.50004L12.6668 6.50004V3.83337H10.0002L8.00016 1.83337Z' fill='black' fill-opacity='0.9' stroke='black' stroke-opacity='0.9' stroke-width='2' stroke-linejoin='round'/%3e%3cpath id='Vector_2' d='M8 10.5C9.10457 10.5 10 9.60457 10 8.5C10 7.39543 9.10457 6.5 8 6.5C6.89543 6.5 6 7.39543 6 8.5C6 9.60457 6.89543 10.5 8 10.5Z' fill='white' stroke='white' stroke-width='2' stroke-linejoin='round'/%3e%3c/g%3e%3c/svg%3e";
|
|
4
|
+
|
|
5
|
+
module.exports = img;
|
|
@@ -15,14 +15,17 @@ var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
|
|
|
15
15
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
16
16
|
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
17
17
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
18
|
+
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
18
19
|
var React = require('react');
|
|
19
20
|
var agoraChatUikit = require('agora-chat-uikit');
|
|
20
21
|
var context = require('../IM/context.js');
|
|
21
22
|
var antd = require('antd');
|
|
22
23
|
var type = require('../type.js');
|
|
24
|
+
var set = require('./image/set.svg.js');
|
|
25
|
+
require('./style/index.scss');
|
|
23
26
|
|
|
24
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; }
|
|
25
|
-
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 _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; }
|
|
26
29
|
var CustomChatView = function CustomChatView(props) {
|
|
27
30
|
var _props$className;
|
|
28
31
|
var _useContext = React.useContext(context.Context),
|
|
@@ -44,7 +47,8 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
44
47
|
headerImageURL: '',
|
|
45
48
|
conversationName: '',
|
|
46
49
|
memberCount: 0,
|
|
47
|
-
chatType: 'singleChat'
|
|
50
|
+
chatType: 'singleChat',
|
|
51
|
+
conversationId: ''
|
|
48
52
|
}),
|
|
49
53
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
50
54
|
headerInfo = _useState6[0],
|
|
@@ -66,6 +70,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
66
70
|
reaction: false,
|
|
67
71
|
select: false,
|
|
68
72
|
thread: false,
|
|
73
|
+
renderUserProfile: function renderUserProfile() {
|
|
74
|
+
return null;
|
|
75
|
+
},
|
|
69
76
|
customAction: (_ref = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref !== void 0 ? _ref : undefined
|
|
70
77
|
});
|
|
71
78
|
};
|
|
@@ -97,6 +104,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
97
104
|
reaction: false,
|
|
98
105
|
select: false,
|
|
99
106
|
thread: false,
|
|
107
|
+
renderUserProfile: function renderUserProfile() {
|
|
108
|
+
return null;
|
|
109
|
+
},
|
|
100
110
|
customAction: (_ref2 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref2 !== void 0 ? _ref2 : undefined,
|
|
101
111
|
imageMessage: msg
|
|
102
112
|
});
|
|
@@ -112,6 +122,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
112
122
|
reaction: false,
|
|
113
123
|
select: false,
|
|
114
124
|
thread: false,
|
|
125
|
+
renderUserProfile: function renderUserProfile() {
|
|
126
|
+
return null;
|
|
127
|
+
},
|
|
115
128
|
customAction: (_ref3 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref3 !== void 0 ? _ref3 : undefined,
|
|
116
129
|
fileMessage: msg
|
|
117
130
|
});
|
|
@@ -121,6 +134,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
121
134
|
reaction: false,
|
|
122
135
|
select: false,
|
|
123
136
|
thread: false,
|
|
137
|
+
renderUserProfile: function renderUserProfile() {
|
|
138
|
+
return null;
|
|
139
|
+
},
|
|
124
140
|
customAction: (_ref4 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref4 !== void 0 ? _ref4 : undefined,
|
|
125
141
|
videoMessage: msg
|
|
126
142
|
});
|
|
@@ -130,6 +146,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
130
146
|
reaction: false,
|
|
131
147
|
select: false,
|
|
132
148
|
thread: false,
|
|
149
|
+
renderUserProfile: function renderUserProfile() {
|
|
150
|
+
return null;
|
|
151
|
+
},
|
|
133
152
|
customAction: (_ref5 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref5 !== void 0 ? _ref5 : undefined,
|
|
134
153
|
audioMessage: msg
|
|
135
154
|
});
|
|
@@ -147,6 +166,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
147
166
|
select: false,
|
|
148
167
|
thread: false,
|
|
149
168
|
direction: isMySelf ? 'rtl' : 'ltr',
|
|
169
|
+
renderUserProfile: function renderUserProfile() {
|
|
170
|
+
return null;
|
|
171
|
+
},
|
|
150
172
|
customAction: (_ref6 = type.commonMessageProps && (type.commonMessageProps === null || type.commonMessageProps === void 0 ? void 0 : type.commonMessageProps.customAction)) !== null && _ref6 !== void 0 ? _ref6 : undefined,
|
|
151
173
|
children: renderShareCardMsg(msg)
|
|
152
174
|
});
|
|
@@ -159,6 +181,7 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
159
181
|
var cvs = _findInstanceProperty(_context = agoraChatUikit.rootStore.conversationStore.conversationList).call(_context, function (cvs) {
|
|
160
182
|
return cvs.conversationId === props.conversationId;
|
|
161
183
|
});
|
|
184
|
+
console.log("----getHeaderInfo---", cvs);
|
|
162
185
|
if (!cvs || !(cvs !== null && cvs !== void 0 && cvs.conversationId)) {
|
|
163
186
|
return;
|
|
164
187
|
}
|
|
@@ -226,18 +249,18 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
226
249
|
return _getShareGroupInfo.apply(this, arguments);
|
|
227
250
|
}
|
|
228
251
|
function _getShareGroupInfo() {
|
|
229
|
-
_getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
252
|
+
_getShareGroupInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(shareInfo, isJoined) {
|
|
230
253
|
var params, response, data, groupInfo, waitJoinGroupinfo, conversation, _response$data2;
|
|
231
|
-
return _regeneratorRuntime.wrap(function
|
|
232
|
-
while (1) switch (
|
|
254
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
255
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
233
256
|
case 0:
|
|
234
257
|
params = {
|
|
235
258
|
sendbirdid: shareInfo === null || shareInfo === void 0 ? void 0 : shareInfo.objectId
|
|
236
259
|
};
|
|
237
|
-
|
|
260
|
+
_context6.next = 3;
|
|
238
261
|
return http.post("/capi/account/imchannel/getdetails", params);
|
|
239
262
|
case 3:
|
|
240
|
-
response =
|
|
263
|
+
response = _context6.sent;
|
|
241
264
|
data = response.data;
|
|
242
265
|
if (data && data.code === 200 && data.data) {
|
|
243
266
|
groupInfo = data.data;
|
|
@@ -274,9 +297,9 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
274
297
|
}
|
|
275
298
|
case 6:
|
|
276
299
|
case "end":
|
|
277
|
-
return
|
|
300
|
+
return _context6.stop();
|
|
278
301
|
}
|
|
279
|
-
},
|
|
302
|
+
}, _callee5);
|
|
280
303
|
}));
|
|
281
304
|
return _getShareGroupInfo.apply(this, arguments);
|
|
282
305
|
}
|
|
@@ -360,11 +383,154 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
360
383
|
}
|
|
361
384
|
getHeaderInfo();
|
|
362
385
|
}, []);
|
|
386
|
+
var customHeader = function customHeader() {
|
|
387
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
388
|
+
className: "flex h-[64px] items-center bg-[var(--im-main-backgroundColor)] pl-4 pr-4 justify-between"
|
|
389
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
390
|
+
className: "flex items-center gap-2"
|
|
391
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
392
|
+
src: headerInfo.headerImageURL,
|
|
393
|
+
className: "w-12 h-12 ".concat(headerInfo.chatType === 'groupChat' ? 'rounded-md' : 'rounded-full', " bg-blue")
|
|
394
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
395
|
+
className: "flex flex-col overflow-hidden mx-5 flex-1"
|
|
396
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
397
|
+
className: "text-[var(--im-main-fontColor)] text-base font-normal line-clamp-1 mr-[100px]"
|
|
398
|
+
}, headerInfo.conversationName), headerInfo.chatType === 'groupChat' && /*#__PURE__*/React.createElement("p", {
|
|
399
|
+
style: {
|
|
400
|
+
color: 'var(--im-third-fontColor)'
|
|
401
|
+
},
|
|
402
|
+
className: "text-sm"
|
|
403
|
+
}, headerInfo.memberCount, " members"))));
|
|
404
|
+
};
|
|
405
|
+
var _useState7 = React.useState([]),
|
|
406
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
407
|
+
collectList = _useState8[0],
|
|
408
|
+
setCollectList = _useState8[1];
|
|
409
|
+
var _useState9 = React.useState(''),
|
|
410
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
411
|
+
curAgentId = _useState10[0],
|
|
412
|
+
setCurAgentId = _useState10[1];
|
|
413
|
+
// 获取agent列表
|
|
414
|
+
var getCollectList = /*#__PURE__*/function () {
|
|
415
|
+
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
416
|
+
var _yield$http$get, data;
|
|
417
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
418
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
419
|
+
case 0:
|
|
420
|
+
_context3.prev = 0;
|
|
421
|
+
_context3.next = 3;
|
|
422
|
+
return http.get("/api/agentcollect/myCollectAgent");
|
|
423
|
+
case 3:
|
|
424
|
+
_yield$http$get = _context3.sent;
|
|
425
|
+
data = _yield$http$get.data;
|
|
426
|
+
if (data.code == 200) {
|
|
427
|
+
if (data.data) {
|
|
428
|
+
setCollectList(data.data);
|
|
429
|
+
} else {
|
|
430
|
+
setCollectList([]);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
_context3.next = 11;
|
|
434
|
+
break;
|
|
435
|
+
case 8:
|
|
436
|
+
_context3.prev = 8;
|
|
437
|
+
_context3.t0 = _context3["catch"](0);
|
|
438
|
+
console.log(_context3.t0);
|
|
439
|
+
case 11:
|
|
440
|
+
case "end":
|
|
441
|
+
return _context3.stop();
|
|
442
|
+
}
|
|
443
|
+
}, _callee2, null, [[0, 8]]);
|
|
444
|
+
}));
|
|
445
|
+
return function getCollectList() {
|
|
446
|
+
return _ref11.apply(this, arguments);
|
|
447
|
+
};
|
|
448
|
+
}();
|
|
449
|
+
var _useState11 = React.useState([]),
|
|
450
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
451
|
+
agentTipList = _useState12[0],
|
|
452
|
+
setAgentTipList = _useState12[1];
|
|
453
|
+
var getTipsList = /*#__PURE__*/function () {
|
|
454
|
+
var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
455
|
+
var _yield$http$get2, data;
|
|
456
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
457
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
458
|
+
case 0:
|
|
459
|
+
_context4.prev = 0;
|
|
460
|
+
_context4.next = 3;
|
|
461
|
+
return http.get("/api/agentcollect/getAgentImReplyTxt");
|
|
462
|
+
case 3:
|
|
463
|
+
_yield$http$get2 = _context4.sent;
|
|
464
|
+
data = _yield$http$get2.data;
|
|
465
|
+
setAgentTipList(data.data.txtarr);
|
|
466
|
+
_context4.next = 11;
|
|
467
|
+
break;
|
|
468
|
+
case 8:
|
|
469
|
+
_context4.prev = 8;
|
|
470
|
+
_context4.t0 = _context4["catch"](0);
|
|
471
|
+
console.log(_context4.t0);
|
|
472
|
+
case 11:
|
|
473
|
+
case "end":
|
|
474
|
+
return _context4.stop();
|
|
475
|
+
}
|
|
476
|
+
}, _callee3, null, [[0, 8]]);
|
|
477
|
+
}));
|
|
478
|
+
return function getTipsList() {
|
|
479
|
+
return _ref12.apply(this, arguments);
|
|
480
|
+
};
|
|
481
|
+
}();
|
|
482
|
+
React.useEffect(function () {
|
|
483
|
+
setCurAgentId(props.conversationId);
|
|
484
|
+
getCollectList();
|
|
485
|
+
getTipsList();
|
|
486
|
+
}, []);
|
|
487
|
+
var changeAgent = /*#__PURE__*/function () {
|
|
488
|
+
var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(val) {
|
|
489
|
+
var curAgent;
|
|
490
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
491
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
492
|
+
case 0:
|
|
493
|
+
setCurAgentId(val);
|
|
494
|
+
curAgent = _findInstanceProperty(collectList).call(collectList, function (item) {
|
|
495
|
+
return item.imagentid == val;
|
|
496
|
+
});
|
|
497
|
+
setHeaderInfo({
|
|
498
|
+
headerImageURL: curAgent.imageurl,
|
|
499
|
+
conversationId: curAgent.imagentid,
|
|
500
|
+
memberCount: 0,
|
|
501
|
+
conversationName: curAgent.name,
|
|
502
|
+
chatType: 'singleChat'
|
|
503
|
+
});
|
|
504
|
+
case 3:
|
|
505
|
+
case "end":
|
|
506
|
+
return _context5.stop();
|
|
507
|
+
}
|
|
508
|
+
}, _callee4);
|
|
509
|
+
}));
|
|
510
|
+
return function changeAgent(_x4) {
|
|
511
|
+
return _ref13.apply(this, arguments);
|
|
512
|
+
};
|
|
513
|
+
}();
|
|
363
514
|
return /*#__PURE__*/React.createElement("div", {
|
|
364
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")
|
|
365
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
366
|
-
className: "
|
|
367
|
-
},
|
|
516
|
+
}, (collectList === null || collectList === void 0 ? void 0 : collectList.length) && /*#__PURE__*/React.createElement("div", {
|
|
517
|
+
className: "mb-2 mx-5 py-2 rounded-lg bg-[var(--im-main-bg-five)]"
|
|
518
|
+
}, /*#__PURE__*/React.createElement(antd.Select, {
|
|
519
|
+
className: "w-full !h-12 border-none rouded-lg agent-select",
|
|
520
|
+
popupClassName: "agent-select-popup",
|
|
521
|
+
value: curAgentId,
|
|
522
|
+
placeholder: "Select your agent to take actions on token",
|
|
523
|
+
prefix: /*#__PURE__*/React.createElement("img", {
|
|
524
|
+
className: "size-4",
|
|
525
|
+
src: set
|
|
526
|
+
}),
|
|
527
|
+
options: collectList,
|
|
528
|
+
fieldNames: {
|
|
529
|
+
label: 'name',
|
|
530
|
+
value: 'imagentid'
|
|
531
|
+
},
|
|
532
|
+
onChange: changeAgent
|
|
533
|
+
})), customHeader(), /*#__PURE__*/React.createElement(agoraChatUikit.MessageList, {
|
|
368
534
|
className: "w-full flex-1",
|
|
369
535
|
conversation: {
|
|
370
536
|
conversationId: props.conversationId,
|
|
@@ -374,7 +540,19 @@ var CustomChatView = function CustomChatView(props) {
|
|
|
374
540
|
return _renderMessage(msg);
|
|
375
541
|
},
|
|
376
542
|
messageProps: _objectSpread({}, type.commonMessageProps)
|
|
377
|
-
}), /*#__PURE__*/React.createElement(
|
|
543
|
+
}), (agentTipList === null || agentTipList === void 0 ? void 0 : agentTipList.length) && /*#__PURE__*/React.createElement("div", {
|
|
544
|
+
className: "pb-1 pl-5 overflow-x-auto"
|
|
545
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
546
|
+
className: "flex items-center gap-4"
|
|
547
|
+
}, _mapInstanceProperty(agentTipList).call(agentTipList, function (item, index) {
|
|
548
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
549
|
+
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
|
+
key: "tip".concat(index),
|
|
551
|
+
onClick: function onClick() {
|
|
552
|
+
return postMessage(item);
|
|
553
|
+
}
|
|
554
|
+
}, item);
|
|
555
|
+
}))), /*#__PURE__*/React.createElement(agoraChatUikit.MessageInput, _extends({
|
|
378
556
|
enabledTyping: true,
|
|
379
557
|
placeHolder: '',
|
|
380
558
|
conversation: {
|
|
@@ -120,7 +120,7 @@ var GroupShareView = function GroupShareView(props) {
|
|
|
120
120
|
}, "Share")), /*#__PURE__*/React.createElement("p", {
|
|
121
121
|
className: "text-[var(--im-main-fontColor)] text-base font-semibold text-center pt-6 px-4 pb-2.5 border-b border-[var(--im-main-bg-ten)]"
|
|
122
122
|
}, "Groups"), /*#__PURE__*/React.createElement("div", {
|
|
123
|
-
className: "flex flex-col mt-3 mx-4 gap-4 overflow-y-auto flex-1 min-h-0 pb-5"
|
|
123
|
+
className: "flex flex-col mt-3 mx-4 gap-4 overflow-y-auto flex-1 min-h-0 pb-5 no-scrollbar"
|
|
124
124
|
}, _mapInstanceProperty(groupList).call(groupList, function (groupinfo, index) {
|
|
125
125
|
var _groupinfo$name, _groupinfo$members;
|
|
126
126
|
return /*#__PURE__*/React.createElement("div", {
|
package/cjs/IM/style/index.scss
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
.im-light {
|
|
2
2
|
--im-test-color: green;
|
|
3
|
+
--im-main-backgroundColor: #fff;
|
|
3
4
|
|
|
4
|
-
--im-main-fontColor: #000;
|
|
5
|
+
--im-main-fontColor: #000;
|
|
5
6
|
--im-second-fontColor: rgba(0, 0, 0, 0.55);
|
|
6
7
|
--im-third-fontColor: rgba(0, 0, 0, 0.4);
|
|
8
|
+
--im-four-fontColor: rgba(0, 0, 0, 0.22);
|
|
9
|
+
--im-five-fontColor: rgba(0, 0, 0, 0.9);
|
|
7
10
|
--im-six-fontColor: rgba(255, 255, 255, 0.9);
|
|
8
11
|
--im-seven-fontColor: rgba(0, 0, 0, 0.6);
|
|
9
12
|
|
|
@@ -76,6 +79,17 @@
|
|
|
76
79
|
color: var(--im-third-fontColor);
|
|
77
80
|
}
|
|
78
81
|
|
|
82
|
+
@layer utilities {
|
|
83
|
+
.no-scrollbar::-webkit-scrollbar {
|
|
84
|
+
display: none;
|
|
85
|
+
}
|
|
86
|
+
.no-scrollbar {
|
|
87
|
+
-ms-overflow-style: none; /* IE & Edge */
|
|
88
|
+
scrollbar-width: none; /* Firefox */
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
79
93
|
.ellipsis {
|
|
80
94
|
overflow: hidden; //超出的文本隐藏
|
|
81
95
|
text-overflow: ellipsis; //溢出用省略号显示
|