fcr-ui-scene 3.4.2 → 3.4.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/lib/common/device-store.d.ts +23 -14
- package/lib/common/device-store.js +361 -252
- package/lib/common/device-stream-store.d.ts +8 -14
- package/lib/common/device-stream-store.js +254 -116
- package/lib/common/event-store.d.ts +35 -10
- package/lib/common/event-store.js +64 -13
- package/lib/common/security-store.d.ts +47 -39
- package/lib/common/security-store.js +335 -379
- package/lib/electron/app.js +1 -0
- package/lib/modules/action-bar/action-bar-collapes-items.d.ts +4 -1
- package/lib/modules/action-bar/action-bar-collapes-items.js +38 -21
- package/lib/modules/action-bar/components/apps/useWidgetList.d.ts +7 -0
- package/lib/modules/action-bar/components/apps/useWidgetList.js +43 -0
- package/lib/modules/action-bar/components/leave/assign-host.d.ts +8 -1
- package/lib/modules/action-bar/components/leave/assign-host.js +1 -1
- package/lib/modules/action-bar/components/leave/leave-meeting.d.ts +16 -1
- package/lib/modules/action-bar/smaller.js +5 -5
- package/lib/modules/chat/chat-bar/index.css +6 -0
- package/lib/modules/chat/chat-bar/index.d.ts +3 -3
- package/lib/modules/chat/chat-bar/index.js +51 -39
- package/lib/modules/chat/chat-select/index.css +27 -7
- package/lib/modules/chat/chat-select/index.d.ts +1 -1
- package/lib/modules/chat/chat-select/index.js +18 -4
- package/lib/modules/chat/chat.d.ts +1 -2
- package/lib/modules/chat/chat.js +196 -128
- package/lib/modules/chat/components/chat-select/select-input/index.d.ts +7 -0
- package/lib/modules/chat/components/chat-select/select-input/index.js +35 -0
- package/lib/modules/chat/components/chat-select/select-item/index.d.ts +12 -0
- package/lib/modules/chat/components/chat-select/select-item/index.js +153 -0
- package/lib/modules/chat/components/chat-tabs/index.d.ts +2 -0
- package/lib/modules/chat/components/chat-tabs/index.js +61 -0
- package/lib/modules/chat/components/message-list/chat-empty/index.d.ts +2 -0
- package/lib/modules/chat/components/message-list/chat-empty/index.js +26 -0
- package/lib/modules/chat/components/message-list/history-unread-message-button/index.d.ts +7 -0
- package/lib/modules/chat/components/message-list/history-unread-message-button/index.js +55 -0
- package/lib/modules/chat/components/message-list/message-item/index.d.ts +15 -0
- package/lib/modules/chat/components/message-list/message-item/index.js +279 -0
- package/lib/modules/chat/components/message-list/scroll-bottom-button/index.d.ts +9 -0
- package/lib/modules/chat/components/message-list/scroll-bottom-button/index.js +67 -0
- package/lib/modules/chat/message-list.js +68 -51
- package/lib/modules/components/dialog-container/component/body.js +1 -2
- package/lib/modules/components/dialog-container/index.d.ts +2 -2
- package/lib/modules/components/member-window/components/member-actions/components/audio-control.d.ts +6 -0
- package/lib/modules/components/member-window/components/member-actions/components/audio-control.js +36 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.d.ts +40 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.js +170 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.d.ts +11 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.js +105 -0
- package/lib/modules/components/member-window/components/member-actions/components/layout/index.d.ts +9 -0
- package/lib/modules/components/member-window/components/member-actions/components/layout/index.js +42 -0
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.d.ts +11 -0
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +159 -0
- package/lib/modules/components/member-window/components/member-actions/components/share-status.d.ts +2 -0
- package/lib/modules/components/member-window/components/member-actions/components/share-status.js +32 -0
- package/lib/modules/components/member-window/components/member-actions/components/user-info.d.ts +16 -0
- package/lib/modules/components/member-window/components/member-actions/components/user-info.js +130 -0
- package/lib/modules/components/member-window/components/member-actions/components/user-tag.d.ts +12 -0
- package/lib/modules/components/member-window/components/member-actions/components/user-tag.js +57 -0
- package/lib/modules/components/member-window/components/member-actions/index.d.ts +3 -0
- package/lib/modules/components/member-window/components/member-actions/index.js +122 -0
- package/lib/modules/components/member-window/components/member-actions/libs/index.d.ts +2 -0
- package/lib/modules/components/member-window/components/member-actions/libs/index.js +24 -0
- package/lib/modules/components/member-window/components/member-actions/provider.d.ts +21 -0
- package/lib/modules/components/member-window/components/member-actions/provider.js +77 -0
- package/lib/modules/components/member-window/components/member-actions/store.d.ts +48 -0
- package/lib/modules/components/member-window/components/member-actions/store.js +306 -0
- package/lib/modules/components/member-window/components/member-board.d.ts +2 -0
- package/lib/modules/components/member-window/components/member-board.js +63 -0
- package/lib/modules/components/member-window/components/mic-volume.d.ts +2 -0
- package/lib/modules/components/member-window/components/mic-volume.js +23 -0
- package/lib/modules/components/member-window/components/video-player/components/local-video-player.d.ts +4 -0
- package/lib/modules/components/member-window/components/video-player/components/local-video-player.js +40 -0
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player.d.ts +8 -0
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player.js +62 -0
- package/lib/modules/components/member-window/components/video-player/index.d.ts +9 -0
- package/lib/modules/components/member-window/components/video-player/index.js +38 -0
- package/lib/modules/components/member-window/types.d.ts +78 -0
- package/lib/modules/components/member-window/types.js +6 -0
- package/lib/modules/connection-gateway/components/tabs/index.js +2 -1
- package/lib/modules/control-bar/components/meeting-details/index.js +7 -15
- package/lib/modules/control-bar/components/more-actions/index.js +5 -15
- package/lib/modules/dialog/components/system-preference/assets/bg1.png +0 -0
- package/lib/modules/dialog/components/system-preference/assets/bg2.png +0 -0
- package/lib/modules/dialog/components/system-preference/assets/fcr_png_host.png +0 -0
- package/lib/modules/dialog/components/widget/electron.d.ts +5 -0
- package/lib/modules/dialog/components/widget/electron.js +41 -0
- package/lib/modules/dialog/components/widget/index.d.ts +6 -0
- package/lib/modules/dialog/components/widget/index.js +41 -0
- package/lib/modules/dialog/type.d.ts +84 -0
- package/lib/modules/dialog/type.js +6 -0
- package/lib/modules/invite/components/pstn-invite.js +4 -13
- package/lib/modules/invite/pstn-invite.js +7 -9
- package/lib/modules/invite/store.d.ts +2 -0
- package/lib/modules/invite/store.js +6 -0
- package/lib/modules/invite/voip-invite.js +5 -6
- package/lib/modules/layout/member-window/index.css +116 -18
- package/lib/modules/layout/member-window/index.d.ts +10 -3
- package/lib/modules/layout/member-window/index.js +227 -115
- package/lib/modules/participant/attendee/index.css +0 -51
- package/lib/modules/participant/attendee/index.d.ts +8 -5
- package/lib/modules/participant/attendee/index.js +61 -15
- package/lib/modules/participant/components/attendee/components/interpreter-tag/index.d.ts +3 -0
- package/lib/modules/participant/components/attendee/components/interpreter-tag/index.js +48 -0
- package/lib/modules/participant/components/confirm-input/index.d.ts +6 -0
- package/lib/modules/participant/components/confirm-input/index.js +49 -0
- package/lib/modules/participant/components/drop-menu/util.d.ts +5 -0
- package/lib/modules/participant/components/drop-menu/util.js +28 -0
- package/lib/modules/participant/components/participants/components/footer/components/buttons.d.ts +6 -0
- package/lib/modules/participant/components/participants/components/footer/components/buttons.js +52 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/index.css +60 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/index.d.ts +2 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/index.js +166 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/util.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/footer/components/drop-menu/util.js +28 -0
- package/lib/modules/participant/components/participants/components/footer/components/footer/index.css +13 -0
- package/lib/modules/participant/components/participants/components/footer/components/footer/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/footer/components/footer/index.js +242 -0
- package/lib/modules/participant/components/participants/components/footer/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/footer/index.js +47 -0
- package/lib/modules/participant/components/participants/components/merge/index.d.ts +11 -0
- package/lib/modules/participant/components/participants/components/merge/index.js +49 -0
- package/lib/modules/participant/components/participants/components/participants/components/attendee/index.css +191 -0
- package/lib/modules/participant/components/participants/components/participants/components/attendee/index.d.ts +4 -0
- package/lib/modules/participant/components/participants/components/participants/components/attendee/index.js +204 -0
- package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.css +49 -0
- package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.js +219 -0
- package/lib/modules/participant/components/participants/components/participants/components/user-row/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/participants/components/user-row/index.js +70 -0
- package/lib/modules/participant/components/participants/components/participants/index.css +104 -0
- package/lib/modules/participant/components/participants/components/participants/index.d.ts +3 -0
- package/lib/modules/participant/components/participants/components/participants/index.js +110 -0
- package/lib/modules/participant/components/participants/components/render-tab/index.d.ts +2 -0
- package/lib/modules/participant/components/participants/components/render-tab/index.js +49 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/interpreter-tag/index.d.ts +3 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/interpreter-tag/index.js +48 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/microphone-indicator/index.d.ts +6 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/microphone-indicator/index.js +28 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/user-avatar/index.d.ts +7 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/components/user-avatar/index.js +39 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.css +69 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/render-user/components/attendee/index.js +135 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/audio-button/index.d.ts +7 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/audio-button/index.js +31 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-actions-popover/index.d.ts +12 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-actions-popover/index.js +82 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-to-mainroom-button/index.d.ts +4 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-to-mainroom-button/index.js +26 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/index.d.ts +2 -0
- package/lib/modules/participant/components/participants/components/render-user/components/user-action/index.js +75 -0
- package/lib/modules/participant/components/participants/components/render-user/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/components/render-user/index.js +21 -0
- package/lib/modules/participant/components/participants/render-tab/index.d.ts +2 -0
- package/lib/modules/participant/components/participants/render-tab/index.js +49 -0
- package/lib/modules/participant/components/participants/render-user/index.d.ts +5 -0
- package/lib/modules/participant/components/participants/render-user/index.js +21 -0
- package/lib/modules/participant/components/participants/types.d.ts +96 -0
- package/lib/modules/participant/components/participants/types.js +37 -0
- package/lib/modules/participant/components/user-action/audio-button/index.d.ts +7 -0
- package/lib/modules/participant/components/user-action/audio-button/index.js +31 -0
- package/lib/modules/participant/components/user-action/move-actions-popover/index.d.ts +12 -0
- package/lib/modules/participant/components/user-action/move-actions-popover/index.js +82 -0
- package/lib/modules/participant/components/user-action/move-to-mainroom-button/index.d.ts +4 -0
- package/lib/modules/participant/components/user-action/move-to-mainroom-button/index.js +26 -0
- package/lib/modules/share-screen/selection/index.css +4 -0
- package/lib/modules/share-screen/selection/index.js +126 -129
- package/lib/modules/share-screen/share-state-bar/index.js +1 -1
- package/lib/modules/state-bar/meeting-details.js +29 -34
- package/lib/modules/video-window/components/deviceState/index.d.ts +7 -0
- package/lib/modules/video-window/components/deviceState/index.js +75 -0
- package/lib/modules/video-window/components/members/index.css +51 -0
- package/lib/modules/video-window/components/members/index.d.ts +2 -0
- package/lib/modules/video-window/components/members/index.js +130 -0
- package/lib/modules/video-window/components/speaking/index.css +86 -0
- package/lib/modules/video-window/components/speaking/index.d.ts +3 -0
- package/lib/modules/video-window/components/speaking/index.js +48 -0
- package/lib/modules/video-window/components/topControl/index.css +35 -0
- package/lib/modules/video-window/components/topControl/index.d.ts +3 -0
- package/lib/modules/video-window/components/topControl/index.js +79 -0
- package/lib/modules/widget/index.css +17 -0
- package/lib/modules/widget/index.d.ts +10 -0
- package/lib/modules/widget/index.js +114 -0
- package/lib/modules/widget/sdk.d.ts +30 -0
- package/lib/modules/widget/sdk.js +221 -0
- package/lib/modules/widget/store.d.ts +14 -0
- package/lib/modules/widget/store.js +28 -0
- package/lib/modules/widget/type.d.ts +155 -0
- package/lib/modules/widget/type.js +6 -0
- package/lib/modules/widget/view.d.ts +2 -0
- package/lib/modules/widget/view.js +47 -0
- package/lib/modules/widget/web-widget.d.ts +29 -0
- package/lib/modules/widget/web-widget.js +234 -0
- package/lib/providers/ability-provider.d.ts +24 -0
- package/lib/providers/ability-provider.js +36 -0
- package/lib/providers/widget-provider.d.ts +44 -0
- package/lib/providers/widget-provider.js +167 -0
- package/lib/schema.d.ts +114 -0
- package/lib/schema.js +77 -0
- package/lib/shared-data-source/member-data.d.ts +126 -0
- package/lib/shared-data-source/member-data.js +465 -0
- package/lib/translations/enUS.d.ts +5 -0
- package/lib/translations/enUS.js +9 -3
- package/lib/translations/zhCN.d.ts +5 -0
- package/lib/translations/zhCN.js +13 -7
- package/lib/utilities/extract.d.ts +1 -1
- package/lib/utilities/logger.d.ts +8 -0
- package/lib/utilities/logger.js +42 -0
- package/lib/utilities/meeting-detail.d.ts +2 -0
- package/lib/utilities/meeting-detail.js +56 -0
- package/lib/utilities/validate-params.d.ts +2 -0
- package/lib/utilities/validate-params.js +16 -0
- package/lib/widget-sdk.d.ts +2 -0
- package/lib/widget-sdk.js +13 -0
- package/package.json +5 -5
package/lib/modules/chat/chat.js
CHANGED
|
@@ -14,7 +14,6 @@ require("core-js/modules/es.array.for-each.js");
|
|
|
14
14
|
require("core-js/modules/es.array.from.js");
|
|
15
15
|
require("core-js/modules/es.array.iterator.js");
|
|
16
16
|
require("core-js/modules/es.array.map.js");
|
|
17
|
-
require("core-js/modules/es.array.push.js");
|
|
18
17
|
require("core-js/modules/es.array.sort.js");
|
|
19
18
|
require("core-js/modules/es.array.unshift.js");
|
|
20
19
|
require("core-js/modules/es.map.js");
|
|
@@ -51,7 +50,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
51
50
|
var _mobxReact = require("mobx-react");
|
|
52
51
|
var _store = require("./store");
|
|
53
52
|
var _messageList = require("./message-list");
|
|
54
|
-
var _contex = require("./contex");
|
|
55
53
|
var _chatWrapper = require("agora-ui-foundation/lib/components/chat-wrapper");
|
|
56
54
|
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
57
55
|
var _react = require("react");
|
|
@@ -60,42 +58,56 @@ var _type = require("../../type");
|
|
|
60
58
|
var _util = require("./util");
|
|
61
59
|
var _copyText = require("../../utilities/copyText");
|
|
62
60
|
var _chatManager = require("agora-ui-foundation/lib/components/chat-manager");
|
|
63
|
-
var _type2 = require("
|
|
64
|
-
var
|
|
61
|
+
var _type2 = require("fcr-core/lib/room-control/chatroom-control/type");
|
|
62
|
+
var _fcrCore = require("fcr-core");
|
|
63
|
+
var _tabs = require("agora-ui-foundation/lib/components/tabs");
|
|
64
|
+
var _constant = require("../../utilities/constant");
|
|
65
|
+
var _fcr_chat_reddot = _interopRequireDefault(require("../../../public/assets/fcr_chat_reddot.svg"));
|
|
65
66
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
66
67
|
var Chat = exports.Chat = (0, _mobxReact.observer)(function (_ref) {
|
|
68
|
+
var _chatRoomStores$RoomT, _chatRoomStores$RoomT2, _chatRoomStores$RoomT3, _chatRoomStores$RoomT4, _chatRoomStores$RoomT5, _chatRoomStores$RoomT6;
|
|
67
69
|
var updateReadIndex = _ref.updateReadIndex,
|
|
68
70
|
sendMsg = _ref.sendMsg,
|
|
69
71
|
localUserId = _ref.userId,
|
|
70
|
-
isHost = _ref.isHost,
|
|
71
72
|
singling = _ref.singling,
|
|
72
73
|
handleClickUploadImage = _ref.handleClickUploadImage;
|
|
73
74
|
var t = (0, _i18n.useI18n)();
|
|
75
|
+
var _useContext = (0, _react.useContext)(_store.StoreContext),
|
|
76
|
+
chatRoomStores = _useContext.chatRoomStores,
|
|
77
|
+
hasWaitingRoomPermission = _useContext.hasWaitingRoomPermission,
|
|
78
|
+
activeTabIndex = _useContext.activeTabIndex,
|
|
79
|
+
handlerActiveTab = _useContext.handlerActiveTab;
|
|
74
80
|
var defaultProps = {
|
|
75
81
|
errorMsg: t('fmt_chat_tips_exceedlimit'),
|
|
76
82
|
forbiddenTxt: t('fmt_chat_button_muteall'),
|
|
77
83
|
styles: {
|
|
78
|
-
display: 'flex'
|
|
84
|
+
display: 'flex',
|
|
85
|
+
height: chatRoomStores[_constant.RoomType.WAITING_ROOM] && chatRoomStores[_constant.RoomType.WAITING_ROOM].userCount > 0 ? 'calc(100% - 28px)' : '100%'
|
|
79
86
|
}
|
|
80
87
|
};
|
|
81
88
|
var styles = defaultProps.styles,
|
|
82
89
|
forbiddenTxt = defaultProps.forbiddenTxt,
|
|
83
90
|
errorMsg = defaultProps.errorMsg;
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
var _ref2 = chatRoomStores[activeTabIndex],
|
|
92
|
+
setTargetUser = _ref2.setTargetUser,
|
|
93
|
+
privateTargetUser = _ref2.privateTargetUser,
|
|
94
|
+
remoteUsers = _ref2.remoteUsers,
|
|
95
|
+
targetUserIsOnline = _ref2.targetUserIsOnline,
|
|
96
|
+
localIsManager = _ref2.localIsManager,
|
|
97
|
+
chatLevel = _ref2.chatLevel,
|
|
98
|
+
messageList = _ref2.messageList,
|
|
99
|
+
textMsg = _ref2.textMsg,
|
|
100
|
+
updateChatTextMsg = _ref2.updateChatTextMsg,
|
|
101
|
+
privateTargetList = _ref2.privateTargetList,
|
|
102
|
+
resetTargetUser = _ref2.resetTargetUser,
|
|
103
|
+
handleToast = _ref2.handleToast,
|
|
104
|
+
chatRoomState = _ref2.chatRoomState,
|
|
105
|
+
isHost = _ref2.isHost,
|
|
106
|
+
hasChatPermission = _ref2.hasChatPermission,
|
|
107
|
+
hasChatSendPrivatePermission = _ref2.hasChatSendPrivatePermission,
|
|
108
|
+
filterChatMember = _ref2.filterChatMember,
|
|
109
|
+
hasSendMessagePermission = _ref2.hasSendMessagePermission,
|
|
110
|
+
hasSendAllPermission = _ref2.hasSendAllPermission;
|
|
99
111
|
var handleTargetChange = function handleTargetChange(user) {
|
|
100
112
|
setTargetUser(user);
|
|
101
113
|
};
|
|
@@ -111,32 +123,21 @@ var Chat = exports.Chat = (0, _mobxReact.observer)(function (_ref) {
|
|
|
111
123
|
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
112
124
|
selectCnt = _useState6[0],
|
|
113
125
|
setSelectCnt = _useState6[1];
|
|
114
|
-
var
|
|
115
|
-
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
116
|
-
targetList = _useState8[0],
|
|
117
|
-
setTargetList = _useState8[1];
|
|
118
|
-
(0, _react.useEffect)(function () {
|
|
126
|
+
var targetList = (0, _react.useMemo)(function () {
|
|
119
127
|
var _users$;
|
|
120
|
-
var users = (0, _toConsumableArray2["default"])(
|
|
128
|
+
var users = (0, _toConsumableArray2["default"])(remoteUsers);
|
|
121
129
|
if (((_users$ = users[0]) === null || _users$ === void 0 ? void 0 : _users$.userId) === _store.USER_ALL) {
|
|
122
|
-
if (
|
|
130
|
+
if (!hasSendAllPermission) {
|
|
123
131
|
users.shift();
|
|
124
132
|
}
|
|
125
|
-
} else if (
|
|
133
|
+
} else if (hasSendAllPermission) {
|
|
126
134
|
users.unshift({
|
|
127
135
|
userId: _store.USER_ALL,
|
|
128
136
|
userName: t('fmt_chat_option_all'),
|
|
129
137
|
userRole: _type.FcrUserRole.ROBOT,
|
|
130
|
-
connectorType:
|
|
138
|
+
connectorType: _fcrCore.FcrRoomConnectorType.NONE
|
|
131
139
|
});
|
|
132
140
|
}
|
|
133
|
-
remoteUsers.forEach(function (user) {
|
|
134
|
-
if (!users.find(function (u) {
|
|
135
|
-
return u.userId === user.userId;
|
|
136
|
-
})) {
|
|
137
|
-
users.push(user);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
141
|
users = users.filter(function (user) {
|
|
141
142
|
return remoteUsers.find(function (u) {
|
|
142
143
|
return u.userId === user.userId;
|
|
@@ -148,10 +149,11 @@ var Chat = exports.Chat = (0, _mobxReact.observer)(function (_ref) {
|
|
|
148
149
|
return u.userId === user.userId;
|
|
149
150
|
})) !== null && _remoteUsers$find !== void 0 ? _remoteUsers$find : user;
|
|
150
151
|
});
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
users = filterChatMember(users);
|
|
153
|
+
return users;
|
|
154
|
+
}, [chatLevel, remoteUsers, activeTabIndex, hasChatPermission, hasChatSendPrivatePermission]);
|
|
153
155
|
var handleMultiCopyMsg = /*#__PURE__*/function () {
|
|
154
|
-
var
|
|
156
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
155
157
|
var msgHandled, msgIndex;
|
|
156
158
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
157
159
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -186,7 +188,7 @@ var Chat = exports.Chat = (0, _mobxReact.observer)(function (_ref) {
|
|
|
186
188
|
}, _callee);
|
|
187
189
|
}));
|
|
188
190
|
return function handleMultiCopyMsg() {
|
|
189
|
-
return
|
|
191
|
+
return _ref3.apply(this, arguments);
|
|
190
192
|
};
|
|
191
193
|
}();
|
|
192
194
|
(0, _react.useEffect)(function () {
|
|
@@ -209,107 +211,173 @@ var Chat = exports.Chat = (0, _mobxReact.observer)(function (_ref) {
|
|
|
209
211
|
}
|
|
210
212
|
});
|
|
211
213
|
};
|
|
212
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
})
|
|
241
|
-
|
|
214
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
215
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
216
|
+
className: "chat-tabs-container",
|
|
217
|
+
children: chatRoomStores[_constant.RoomType.WAITING_ROOM] && chatRoomStores[_constant.RoomType.MAIN_ROOM] && chatRoomStores[_constant.RoomType.WAITING_ROOM].userCount > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_tabs.FcrTabs, {
|
|
218
|
+
items: [{
|
|
219
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
220
|
+
className: "chat-container-icon",
|
|
221
|
+
children: [((_chatRoomStores$RoomT = chatRoomStores[_constant.RoomType.MAIN_ROOM]) === null || _chatRoomStores$RoomT === void 0 ? void 0 : _chatRoomStores$RoomT.unReadMsgCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
222
|
+
className: "fcr-action-bar-chat-unread-count",
|
|
223
|
+
children: ((_chatRoomStores$RoomT2 = chatRoomStores[_constant.RoomType.MAIN_ROOM]) === null || _chatRoomStores$RoomT2 === void 0 ? void 0 : _chatRoomStores$RoomT2.unReadMsgCount) > 99 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
224
|
+
src: _fcr_chat_reddot["default"]
|
|
225
|
+
}) : (_chatRoomStores$RoomT3 = chatRoomStores[_constant.RoomType.MAIN_ROOM]) === null || _chatRoomStores$RoomT3 === void 0 ? void 0 : _chatRoomStores$RoomT3.unReadMsgCount
|
|
226
|
+
}), t('fmt_waitingroom_sidebar_chat_label_meeting', {
|
|
227
|
+
reason1: chatRoomStores[_constant.RoomType.MAIN_ROOM].userCount
|
|
228
|
+
})]
|
|
229
|
+
}),
|
|
230
|
+
key: _constant.RoomType.MAIN_ROOM
|
|
231
|
+
}, {
|
|
232
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
233
|
+
className: "chat-container-icon",
|
|
234
|
+
children: [((_chatRoomStores$RoomT4 = chatRoomStores[_constant.RoomType.WAITING_ROOM]) === null || _chatRoomStores$RoomT4 === void 0 ? void 0 : _chatRoomStores$RoomT4.unReadMsgCount) > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
235
|
+
className: "fcr-action-bar-chat-unread-count",
|
|
236
|
+
children: ((_chatRoomStores$RoomT5 = chatRoomStores[_constant.RoomType.WAITING_ROOM]) === null || _chatRoomStores$RoomT5 === void 0 ? void 0 : _chatRoomStores$RoomT5.unReadMsgCount) > 99 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
237
|
+
src: _fcr_chat_reddot["default"]
|
|
238
|
+
}) : (_chatRoomStores$RoomT6 = chatRoomStores[_constant.RoomType.WAITING_ROOM]) === null || _chatRoomStores$RoomT6 === void 0 ? void 0 : _chatRoomStores$RoomT6.unReadMsgCount
|
|
239
|
+
}), t('fmt_waitingroom_sidebar_label_waiting', {
|
|
240
|
+
reason1: chatRoomStores[_constant.RoomType.WAITING_ROOM].userCount
|
|
241
|
+
})]
|
|
242
|
+
}),
|
|
243
|
+
key: _constant.RoomType.WAITING_ROOM
|
|
244
|
+
}],
|
|
245
|
+
activeKey: activeTabIndex,
|
|
246
|
+
onChange: function onChange(key) {
|
|
247
|
+
handlerActiveTab(key);
|
|
242
248
|
}
|
|
243
|
-
|
|
249
|
+
}) : null
|
|
250
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_chatWrapper.ChatWrapper, {
|
|
251
|
+
styles: styles,
|
|
252
|
+
errorMsg: errorMsg,
|
|
253
|
+
forbiddenTxt: forbiddenTxt,
|
|
254
|
+
singling: singling,
|
|
255
|
+
forbidden: !localIsManager && !hasChatPermission && !hasChatSendPrivatePermission,
|
|
256
|
+
isHost: isHost,
|
|
257
|
+
handMsg: function handMsg(msg) {
|
|
258
|
+
if (chatRoomState !== _type2.FcrChatRoomConnectionState.Connected) {
|
|
244
259
|
handleToast({
|
|
245
|
-
id: 'send-msg-
|
|
260
|
+
id: 'send-msg-offline',
|
|
246
261
|
toastProps: {
|
|
247
|
-
type: '
|
|
248
|
-
content: t('
|
|
262
|
+
type: 'error',
|
|
263
|
+
content: t('fmt_chat_tips_Networkconnect'),
|
|
249
264
|
size: 'small'
|
|
250
265
|
}
|
|
251
266
|
});
|
|
252
|
-
resetTargetUser();
|
|
253
267
|
return;
|
|
254
268
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
269
|
+
if (!localIsManager) {
|
|
270
|
+
if (privateTargetUser.userId === _store.USER_NONE) {
|
|
271
|
+
handleToast({
|
|
272
|
+
id: 'send-msg-to-none',
|
|
273
|
+
toastProps: {
|
|
274
|
+
type: 'normal',
|
|
275
|
+
content: t('fmt_chat_tips_selectchat'),
|
|
276
|
+
size: 'small'
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// if (
|
|
283
|
+
// chatLevel === 'no_one' ||
|
|
284
|
+
// (chatLevel !== 'everyone' &&
|
|
285
|
+
// privateTargetUser.userId !== USER_ALL &&
|
|
286
|
+
// !isManager(privateTargetUser.userRole))
|
|
287
|
+
// ) {
|
|
288
|
+
// handleToast({
|
|
289
|
+
// id: 'send-msg-to-none',
|
|
290
|
+
// toastProps: {
|
|
291
|
+
// type: 'normal',
|
|
292
|
+
// content: t('fmt_chat_tips_permissionchange'),
|
|
293
|
+
// size: 'small',
|
|
294
|
+
// },
|
|
295
|
+
// });
|
|
296
|
+
// resetTargetUser();
|
|
297
|
+
// return;
|
|
298
|
+
// }
|
|
299
|
+
|
|
300
|
+
if (privateTargetUser.userId === _store.USER_ALL && !hasSendMessagePermission()) {
|
|
301
|
+
handleToast({
|
|
302
|
+
id: 'send-msg-to-none',
|
|
303
|
+
toastProps: {
|
|
304
|
+
type: 'normal',
|
|
305
|
+
content: t('fmt_chat_tips_permissionchange'),
|
|
306
|
+
size: 'small'
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
return;
|
|
310
|
+
} else if (privateTargetUser.userId !== _store.USER_ALL && !hasChatSendPrivatePermission) {
|
|
311
|
+
handleToast({
|
|
312
|
+
id: 'send-msg-to-none',
|
|
313
|
+
toastProps: {
|
|
314
|
+
type: 'normal',
|
|
315
|
+
content: t('fmt_chat_tips_permissionchange'),
|
|
316
|
+
size: 'small'
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
resetTargetUser();
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
290
322
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
323
|
+
sendMsg(msg);
|
|
324
|
+
},
|
|
325
|
+
handleClickUploadImage: handleClickUploadImage,
|
|
326
|
+
msgBarElement: /*#__PURE__*/(0, _jsxRuntime.jsx)(_chatBar.MessageBar, {
|
|
327
|
+
selectedUser: privateTargetUser,
|
|
328
|
+
users: targetList,
|
|
329
|
+
onTargetChange: handleTargetChange,
|
|
330
|
+
title: chatSelectNoTitle ? undefined : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
331
|
+
className: "assign-host-title",
|
|
332
|
+
children: chatLevel === 'public' ? t('fmt_chat_option_onlypublic') : t('fmt_chat_option_onlyprivate')
|
|
333
|
+
})
|
|
334
|
+
}),
|
|
335
|
+
targetUserIsOnline: targetUserIsOnline,
|
|
336
|
+
privateTarget: privateTargetUser.userId,
|
|
337
|
+
selectTargetNickname: privateTargetUser.userName,
|
|
299
338
|
multiSelectActive: multiSelectActive,
|
|
300
|
-
copyMap: copyMap,
|
|
301
|
-
setCopyMap: setCopyMap,
|
|
302
339
|
selectCnt: selectCnt,
|
|
303
|
-
|
|
304
|
-
|
|
340
|
+
onSelectCancel: function onSelectCancel() {
|
|
341
|
+
resetMultiSelectStates();
|
|
342
|
+
},
|
|
343
|
+
onSelectConfirm: /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
344
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
345
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
346
|
+
case 0:
|
|
347
|
+
_context2.next = 2;
|
|
348
|
+
return handleMultiCopyMsg();
|
|
349
|
+
case 2:
|
|
350
|
+
resetMultiSelectStates();
|
|
351
|
+
copyTips();
|
|
352
|
+
case 4:
|
|
353
|
+
case "end":
|
|
354
|
+
return _context2.stop();
|
|
355
|
+
}
|
|
356
|
+
}, _callee2);
|
|
357
|
+
})),
|
|
358
|
+
defaultMsg: textMsg,
|
|
359
|
+
updateChatTextMsg: updateChatTextMsg,
|
|
360
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_messageList.MessageList, {
|
|
361
|
+
updateReadMsgIndex: updateReadIndex,
|
|
362
|
+
userId: localUserId,
|
|
363
|
+
setMultiSelectActive: setMultiSelectActive,
|
|
364
|
+
multiSelectActive: multiSelectActive,
|
|
365
|
+
copyMap: copyMap,
|
|
366
|
+
setCopyMap: setCopyMap,
|
|
367
|
+
selectCnt: selectCnt,
|
|
368
|
+
copyTips: copyTips
|
|
369
|
+
})
|
|
370
|
+
})]
|
|
305
371
|
});
|
|
306
372
|
});
|
|
307
373
|
var ChatAction = exports.ChatAction = (0, _mobxReact.observer)(function () {
|
|
308
|
-
var _useContext2 = (0, _react.useContext)(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
374
|
+
var _useContext2 = (0, _react.useContext)(_store.StoreContext),
|
|
375
|
+
chatRoomStores = _useContext2.chatRoomStores;
|
|
376
|
+
var _ref5 = chatRoomStores[_constant.RoomType.MAIN_ROOM],
|
|
377
|
+
isHostOrCoHost = _ref5.isHostOrCoHost,
|
|
378
|
+
setAllowChat = _ref5.setAllowChat,
|
|
379
|
+
setAllowChatWithPayload = _ref5.setAllowChatWithPayload,
|
|
380
|
+
chatLevel = _ref5.chatLevel;
|
|
313
381
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_chatManager.ChatManager, {
|
|
314
382
|
isManager: isHostOrCoHost,
|
|
315
383
|
setAllowChat: setAllowChat,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ISelectInput = {
|
|
3
|
+
handleFilterChange: (search: string) => void;
|
|
4
|
+
searchTxt: string;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: React.MemoExoticComponent<(props: ISelectInput) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
var _type = require("agora-ui-foundation/lib/components/icon/type");
|
|
10
|
+
var _input = require("agora-ui-foundation/lib/components/input");
|
|
11
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
var _default = exports["default"] = /*#__PURE__*/_react["default"].memo(function (props) {
|
|
15
|
+
var handleFilterChange = props.handleFilterChange,
|
|
16
|
+
filterKey = props.searchTxt;
|
|
17
|
+
var t = (0, _i18n.useI18n)();
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
|
+
className: "assign-host-search",
|
|
20
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_input.FcrInput, {
|
|
21
|
+
iconPrefix: {
|
|
22
|
+
colors: {
|
|
23
|
+
iconPrimary: 'var(--fcr_ui_scene_icontext1)'
|
|
24
|
+
},
|
|
25
|
+
type: _type.FcrIconType.FCR_V2_SEARCH
|
|
26
|
+
},
|
|
27
|
+
onChange: function onChange(value) {
|
|
28
|
+
handleFilterChange(value);
|
|
29
|
+
},
|
|
30
|
+
placeholder: t('fmt_attendies_button_serach'),
|
|
31
|
+
shape: "rounded",
|
|
32
|
+
value: filterKey
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FcrUserInfo } from 'fcr-core/lib/type';
|
|
2
|
+
type ISelectItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
style: React.CSSProperties | undefined;
|
|
5
|
+
onSelect: (user: FcrUserInfo) => void;
|
|
6
|
+
type: 'assign-host' | 'private-chat';
|
|
7
|
+
isSelf: boolean;
|
|
8
|
+
currentUser: FcrUserInfo;
|
|
9
|
+
filterKey: string;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (props: ISelectItem) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.array.filter.js");
|
|
5
|
+
require("core-js/modules/es.array.for-each.js");
|
|
6
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
7
|
+
require("core-js/modules/es.object.define-property.js");
|
|
8
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
9
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
10
|
+
require("core-js/modules/es.object.keys.js");
|
|
11
|
+
require("core-js/modules/es.object.to-string.js");
|
|
12
|
+
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
13
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
14
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
15
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
16
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
17
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
18
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
exports["default"] = void 0;
|
|
23
|
+
require("core-js/modules/es.array.index-of.js");
|
|
24
|
+
require("core-js/modules/es.array.map.js");
|
|
25
|
+
require("core-js/modules/es.array.push.js");
|
|
26
|
+
require("core-js/modules/es.array.slice.js");
|
|
27
|
+
require("core-js/modules/esnext.async-iterator.map.js");
|
|
28
|
+
require("core-js/modules/esnext.iterator.map.js");
|
|
29
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
30
|
+
var _type = require("fcr-core/lib/type");
|
|
31
|
+
var _mobxReact = require("mobx-react");
|
|
32
|
+
var _helper = require("agora-ui-foundation/lib/components/avatar/helper");
|
|
33
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
34
|
+
var _types = require("../../../types");
|
|
35
|
+
var _textBubble = require("agora-ui-foundation/lib/components/text-bubble");
|
|
36
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
37
|
+
var _type2 = require("agora-ui-foundation/lib/components/icon/type");
|
|
38
|
+
var _avatar = require("agora-ui-foundation/lib/components/avatar");
|
|
39
|
+
var _icon = require("agora-ui-foundation/lib/components/icon");
|
|
40
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
41
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
42
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
43
|
+
var _default = exports["default"] = (0, _mobxReact.observer)(function (props) {
|
|
44
|
+
var key = props.key,
|
|
45
|
+
style = props.style,
|
|
46
|
+
onSelect = props.onSelect,
|
|
47
|
+
type = props.type,
|
|
48
|
+
isSelf = props.isSelf,
|
|
49
|
+
currentUser = props.currentUser,
|
|
50
|
+
filterKey = props.filterKey;
|
|
51
|
+
var t = (0, _i18n.useI18n)();
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
53
|
+
className: isSelf ? 'candidate-container-selected' : 'candidate-container',
|
|
54
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
55
|
+
pointerEvents: 'all'
|
|
56
|
+
}),
|
|
57
|
+
onClick: function onClick(_) {
|
|
58
|
+
onSelect(currentUser);
|
|
59
|
+
},
|
|
60
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
61
|
+
style: {
|
|
62
|
+
background: (0, _helper.getNameColor)(currentUser.userName)
|
|
63
|
+
},
|
|
64
|
+
className: (0, _classnames["default"])('candidate-avatar', {
|
|
65
|
+
'candidate-avatar-all': currentUser.userId === _types.USER_ALL
|
|
66
|
+
}),
|
|
67
|
+
children: type === 'private-chat' && currentUser.userName === _types.USER_ALL ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FcrIcon, {
|
|
68
|
+
size: 16,
|
|
69
|
+
type: _type2.FcrIconType.FCR_USERS,
|
|
70
|
+
colors: {
|
|
71
|
+
iconPrimary: 'var(--fcr_ui_scene_white10)'
|
|
72
|
+
}
|
|
73
|
+
}) :
|
|
74
|
+
/*#__PURE__*/
|
|
75
|
+
// currentUser.userName.charAt(0).toLocaleUpperCase()
|
|
76
|
+
(0, _jsxRuntime.jsx)(_avatar.FcrAvatar, {
|
|
77
|
+
isShowFirstLetter: true,
|
|
78
|
+
size: 32,
|
|
79
|
+
nickName: currentUser.userName,
|
|
80
|
+
textSize: 14
|
|
81
|
+
})
|
|
82
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
83
|
+
className: "candidate",
|
|
84
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
85
|
+
className: "candidate-info",
|
|
86
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
87
|
+
className: (0, _classnames["default"])('candidate-name', {
|
|
88
|
+
'candidate-name-active': isSelf
|
|
89
|
+
}),
|
|
90
|
+
style: {
|
|
91
|
+
color: (0, _helper.getNameColor)(currentUser.userName)
|
|
92
|
+
},
|
|
93
|
+
children: highlightMatches(currentUser.userName, filterKey).map(function (value, i) {
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
95
|
+
className: value !== null && value !== void 0 && value.isHighlight ? 'candidate-highlight' : '',
|
|
96
|
+
children: value.data
|
|
97
|
+
}, "".concat(i));
|
|
98
|
+
})
|
|
99
|
+
}), currentUser.userId !== _types.USER_ALL && (currentUser.userRole === _type.FcrUserRole.COHOST || currentUser.userRole === _type.FcrUserRole.HOST) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_textBubble.TextBubble, {
|
|
100
|
+
txt: t(currentUser.userRole === _type.FcrUserRole.HOST ? 'fmt_role_host' : 'fmt_role_cohost'),
|
|
101
|
+
styles: {
|
|
102
|
+
width: 'fit-content'
|
|
103
|
+
},
|
|
104
|
+
type: "gray",
|
|
105
|
+
lineHeight: "small",
|
|
106
|
+
classnames: currentUser.userRole === _type.FcrUserRole.HOST ? 'host' : 'cohost'
|
|
107
|
+
})]
|
|
108
|
+
}), isSelf ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
109
|
+
className: "candidate-select",
|
|
110
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FcrIcon, {
|
|
111
|
+
type: _type2.FcrIconType.FCR_CHOOSEIT,
|
|
112
|
+
size: 24,
|
|
113
|
+
colors: {
|
|
114
|
+
iconPrimary: 'var(--fcr_web_ui_scene_mainicon2)'
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
}) : null]
|
|
118
|
+
})]
|
|
119
|
+
}, key);
|
|
120
|
+
});
|
|
121
|
+
function highlightMatches(str, matchStr) {
|
|
122
|
+
var result = [];
|
|
123
|
+
var matchLen = matchStr.length;
|
|
124
|
+
var start = 0;
|
|
125
|
+
if (matchStr.length === 0) {
|
|
126
|
+
return [{
|
|
127
|
+
data: str,
|
|
128
|
+
isHighlight: false
|
|
129
|
+
}];
|
|
130
|
+
}
|
|
131
|
+
while (start < str.length) {
|
|
132
|
+
var matchStart = str.indexOf(matchStr, start);
|
|
133
|
+
if (matchStart === -1) {
|
|
134
|
+
result.push({
|
|
135
|
+
data: str.slice(start),
|
|
136
|
+
isHighlight: false
|
|
137
|
+
});
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
if (start !== matchStart) {
|
|
141
|
+
result.push({
|
|
142
|
+
data: str.slice(start, matchStart),
|
|
143
|
+
isHighlight: false
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
result.push({
|
|
147
|
+
data: matchStr,
|
|
148
|
+
isHighlight: true
|
|
149
|
+
});
|
|
150
|
+
start = matchStart + matchLen;
|
|
151
|
+
}
|
|
152
|
+
return result;
|
|
153
|
+
}
|