fcr-ui-scene 3.2.0 → 3.3.0

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.
Files changed (219) hide show
  1. package/installer/icons/favicon.ico +0 -0
  2. package/installer/icons/favicon.png +0 -0
  3. package/installer/mac/entitlements.mac.plist +16 -0
  4. package/lib/common/device-store.d.ts +1 -1
  5. package/lib/common/device-store.js +11 -3
  6. package/lib/common/event-store.d.ts +17 -1
  7. package/lib/common/event-store.js +38 -5
  8. package/lib/common/security-store.d.ts +14 -4
  9. package/lib/common/security-store.js +149 -30
  10. package/lib/electron/bootstrap-dev.d.ts +1 -0
  11. package/lib/electron/bootstrap-dev.js +51 -0
  12. package/lib/electron/bootstrap-sdk.d.ts +1 -0
  13. package/lib/electron/bootstrap-sdk.js +56 -0
  14. package/lib/electron/bootstrap.d.ts +1 -0
  15. package/lib/electron/bootstrap.js +56 -0
  16. package/lib/electron/default-options.js +1 -1
  17. package/lib/electron/dev.d.ts +1 -0
  18. package/lib/electron/dev.js +51 -0
  19. package/lib/electron/injections.d.ts +1 -1
  20. package/lib/electron/injections.js +3 -6
  21. package/lib/electron/main.js +4 -16
  22. package/lib/electron/plugins/meeting-state.d.ts +2 -0
  23. package/lib/electron/plugins/meeting-state.js +39 -0
  24. package/lib/electron/preload.js +1 -1
  25. package/lib/fragments/control-bar/control-bar-store.d.ts +34 -1
  26. package/lib/fragments/control-bar/control-bar-store.js +371 -79
  27. package/lib/fragments/control-bar/device/index.js +5 -3
  28. package/lib/fragments/control-bar/index.css +15 -10
  29. package/lib/fragments/control-bar/index.js +18 -0
  30. package/lib/fragments/control-bar/meeting-details/meeting-detail.css +109 -0
  31. package/lib/fragments/control-bar/meeting-details/meeting-details-portal.d.ts +3 -0
  32. package/lib/fragments/control-bar/meeting-details/meeting-details-portal.js +60 -0
  33. package/lib/fragments/control-bar/meeting-details/meeting-details.d.ts +2 -0
  34. package/lib/fragments/control-bar/meeting-details/meeting-details.js +179 -0
  35. package/lib/fragments/control-bar/more-actions/index.css +53 -0
  36. package/lib/fragments/control-bar/more-actions/index.js +72 -37
  37. package/lib/fragments/control-bar/security-content/index.css +10 -0
  38. package/lib/fragments/control-bar/security-content/index.js +40 -18
  39. package/lib/fragments/control-bar/view.js +8 -2
  40. package/lib/login-confirm-dialog.d.ts +12 -0
  41. package/lib/login-confirm-dialog.js +80 -0
  42. package/lib/modules/action-bar/action-bar-collapes-items.js +5 -5
  43. package/lib/modules/action-bar/chat/index.js +5 -5
  44. package/lib/modules/action-bar/device/index.css +7 -2
  45. package/lib/modules/action-bar/device/index.js +4 -4
  46. package/lib/modules/action-bar/index.css +59 -12
  47. package/lib/modules/action-bar/index.d.ts +3 -2
  48. package/lib/modules/action-bar/index.dev.js +1 -1
  49. package/lib/modules/action-bar/index.js +21 -0
  50. package/lib/modules/action-bar/leave/assign-host.d.ts +3 -0
  51. package/lib/modules/action-bar/leave/assign-host.js +2 -4
  52. package/lib/modules/action-bar/leave/index.js +29 -6
  53. package/lib/modules/action-bar/leave/leave-meeting.d.ts +11 -0
  54. package/lib/modules/action-bar/leave/leave-meeting.js +25 -16
  55. package/lib/modules/action-bar/more/poppover-content.js +4 -4
  56. package/lib/modules/action-bar/participants/index.css +12 -0
  57. package/lib/modules/action-bar/participants/index.js +21 -14
  58. package/lib/modules/action-bar/screen-share/index.js +5 -1
  59. package/lib/modules/action-bar/screen-share/submenu.js +16 -22
  60. package/lib/modules/action-bar/security/drop-menu.js +90 -13
  61. package/lib/modules/action-bar/store.d.ts +38 -6
  62. package/lib/modules/action-bar/store.js +487 -95
  63. package/lib/modules/action-bar/view.js +65 -42
  64. package/lib/modules/chat/chat-bar/index.js +39 -27
  65. package/lib/modules/chat/chat-select/index.css +14 -4
  66. package/lib/modules/chat/chat.d.ts +1 -2
  67. package/lib/modules/chat/chat.js +184 -105
  68. package/lib/modules/chat/index.css +49 -0
  69. package/lib/modules/chat/index.d.ts +2 -2
  70. package/lib/modules/chat/index.dev.js +1 -1
  71. package/lib/modules/chat/index.js +13 -8
  72. package/lib/modules/chat/message-list.js +59 -48
  73. package/lib/modules/chat/store.d.ts +48 -2
  74. package/lib/modules/chat/store.js +258 -45
  75. package/lib/modules/connection-gateway/index.d.ts +2 -1
  76. package/lib/modules/connection-gateway/store.d.ts +6 -3
  77. package/lib/modules/connection-gateway/store.js +5 -1
  78. package/lib/modules/device-pretest/audio-preview/speaker-control.js +1 -1
  79. package/lib/modules/device-pretest/index.css +0 -4
  80. package/lib/modules/device-pretest/settings/beauty.js +17 -6
  81. package/lib/modules/device-pretest/store.js +7 -11
  82. package/lib/modules/dialog/components/chat/electron.js +2 -1
  83. package/lib/modules/dialog/components/confirm/electron.js +5 -3
  84. package/lib/modules/dialog/components/connection-gateway/electron.js +3 -1
  85. package/lib/modules/dialog/components/connection-gateway/index.css +0 -2
  86. package/lib/modules/dialog/components/device-setting/electron.js +3 -1
  87. package/lib/modules/dialog/components/device-setting/index.css +0 -1
  88. package/lib/modules/dialog/components/operation-waiting-room/electron.d.ts +5 -0
  89. package/lib/modules/dialog/components/operation-waiting-room/electron.js +89 -0
  90. package/lib/modules/dialog/components/operation-waiting-room/index.css +44 -0
  91. package/lib/modules/dialog/components/operation-waiting-room/index.d.ts +5 -0
  92. package/lib/modules/dialog/components/operation-waiting-room/index.js +156 -0
  93. package/lib/modules/dialog/components/participant/electron.js +2 -1
  94. package/lib/modules/dialog/components/remove-admit-waiting-room/electron.d.ts +5 -0
  95. package/lib/modules/dialog/components/remove-admit-waiting-room/electron.js +89 -0
  96. package/lib/modules/dialog/components/remove-admit-waiting-room/index.css +50 -0
  97. package/lib/modules/dialog/components/remove-admit-waiting-room/index.d.ts +5 -0
  98. package/lib/modules/dialog/components/remove-admit-waiting-room/index.js +90 -0
  99. package/lib/modules/dialog/components/whiteboard/index.js +2 -1
  100. package/lib/modules/dialog/dialogs.js +17 -13
  101. package/lib/modules/dialog/index.css +2 -0
  102. package/lib/modules/dialog/store.d.ts +4 -0
  103. package/lib/modules/dialog/store.js +16 -2
  104. package/lib/modules/event-notification/context.d.ts +2 -0
  105. package/lib/modules/event-notification/context.js +9 -0
  106. package/lib/modules/event-notification/index.css +58 -0
  107. package/lib/modules/event-notification/index.d.ts +13 -0
  108. package/lib/modules/event-notification/index.js +48 -0
  109. package/lib/modules/event-notification/store.d.ts +17 -0
  110. package/lib/modules/event-notification/store.js +133 -0
  111. package/lib/modules/event-notification/view.d.ts +5 -0
  112. package/lib/modules/event-notification/view.js +114 -0
  113. package/lib/modules/invite/index.css +4 -4
  114. package/lib/modules/invite/pstn-invite.js +1 -0
  115. package/lib/modules/layout/components/Gallery.js +7 -1
  116. package/lib/modules/layout/components/Layout.js +82 -57
  117. package/lib/modules/layout/components/index.css +33 -6
  118. package/lib/modules/layout/index.css +30 -0
  119. package/lib/modules/layout/member-window/index.js +9 -3
  120. package/lib/modules/layout/store.d.ts +19 -2
  121. package/lib/modules/layout/store.js +177 -70
  122. package/lib/modules/layout/video-window-datasource.d.ts +1 -1
  123. package/lib/modules/layout/video-window-datasource.js +1 -1
  124. package/lib/modules/live-streaming/index.dev.js +1 -1
  125. package/lib/modules/participant/attendee/index.d.ts +12 -3
  126. package/lib/modules/participant/attendee/index.js +132 -30
  127. package/lib/modules/participant/index.css +20 -0
  128. package/lib/modules/participant/index.d.ts +5 -2
  129. package/lib/modules/participant/index.dev.js +1 -1
  130. package/lib/modules/participant/index.js +27 -0
  131. package/lib/modules/participant/room-control-drop-menu/index.css +37 -0
  132. package/lib/modules/participant/store.d.ts +30 -5
  133. package/lib/modules/participant/store.js +347 -74
  134. package/lib/modules/participant/view.js +133 -34
  135. package/lib/modules/setting/index.css +1 -5
  136. package/lib/modules/setting/index.dev.js +1 -1
  137. package/lib/modules/setting/store.d.ts +2 -2
  138. package/lib/modules/setting/store.js +3 -8
  139. package/lib/modules/setting/translate-settings/translate-settings.js +1 -1
  140. package/lib/modules/setting/video-settings/index.css +9 -6
  141. package/lib/modules/share-screen/index.d.ts +2 -0
  142. package/lib/modules/share-screen/index.dev.js +3 -2
  143. package/lib/modules/share-screen/selection/index.css +2 -0
  144. package/lib/modules/share-screen/store.d.ts +6 -3
  145. package/lib/modules/share-screen/store.js +170 -129
  146. package/lib/modules/state-bar/index.css +2 -2
  147. package/lib/modules/state-bar/index.d.ts +2 -2
  148. package/lib/modules/state-bar/index.dev.js +1 -1
  149. package/lib/modules/state-bar/meeting-detail.css +6 -4
  150. package/lib/modules/state-bar/meeting-details.js +29 -3
  151. package/lib/modules/state-bar/meeting-network-state.css +14 -3
  152. package/lib/modules/state-bar/meeting-network-state.js +10 -4
  153. package/lib/modules/state-bar/recording.js +3 -5
  154. package/lib/modules/state-bar/store.d.ts +4 -2
  155. package/lib/modules/state-bar/store.js +18 -3
  156. package/lib/modules/state-bar/view.js +1 -6
  157. package/lib/modules/video-window/index.css +1 -0
  158. package/lib/modules/video-window/store.d.ts +2 -2
  159. package/lib/modules/video-window/store.js +14 -11
  160. package/lib/modules/waiting-room-layout/context.d.ts +2 -0
  161. package/lib/modules/waiting-room-layout/context.js +9 -0
  162. package/lib/modules/waiting-room-layout/index.css +71 -0
  163. package/lib/modules/waiting-room-layout/index.d.ts +8 -0
  164. package/lib/modules/waiting-room-layout/index.js +47 -0
  165. package/lib/modules/waiting-room-layout/store.d.ts +30 -0
  166. package/lib/modules/waiting-room-layout/store.js +189 -0
  167. package/lib/modules/waiting-room-layout/type.d.ts +0 -0
  168. package/lib/modules/waiting-room-layout/type.js +1 -0
  169. package/lib/modules/waiting-room-layout/view.d.ts +3 -0
  170. package/lib/modules/waiting-room-layout/view.js +67 -0
  171. package/lib/modules/whiteboard/app.js +0 -6
  172. package/lib/modules/whiteboard/components/control-bar/index.css +3 -0
  173. package/lib/modules/whiteboard/components/multi-window/index.js +6 -1
  174. package/lib/modules/whiteboard/components/progress/electron.js +2 -1
  175. package/lib/modules/whiteboard/components/switch-theme/index.css +4 -0
  176. package/lib/modules/whiteboard/components/switch-theme/index.d.ts +2 -1
  177. package/lib/modules/whiteboard/components/switch-theme/index.js +20 -15
  178. package/lib/modules/whiteboard/components/switch-theme/item.d.ts +1 -0
  179. package/lib/modules/whiteboard/components/switch-theme/item.js +9 -2
  180. package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +14 -10
  181. package/lib/modules/whiteboard/components/toolbar/store.d.ts +1 -0
  182. package/lib/modules/whiteboard/components/toolbar/store.js +3 -0
  183. package/lib/modules/whiteboard/context.d.ts +4 -0
  184. package/lib/modules/whiteboard/context.js +4 -2
  185. package/lib/modules/whiteboard/index.js +22 -6
  186. package/lib/plugins/browser-runtime-plugin.js +1 -1
  187. package/lib/plugins/module-dev-plugin.js +8 -6
  188. package/lib/runtime.d.ts +1 -1
  189. package/lib/translations/enUS.d.ts +449 -6
  190. package/lib/translations/enUS.js +485 -32
  191. package/lib/translations/zhCN.d.ts +447 -6
  192. package/lib/translations/zhCN.js +468 -17
  193. package/lib/type.d.ts +6 -2
  194. package/lib/ui-manager.d.ts +7 -3
  195. package/lib/ui-manager.js +576 -139
  196. package/lib/ui-scene.d.ts +1 -0
  197. package/lib/ui-scene.js +26 -21
  198. package/lib/utilities/constant.d.ts +43 -4
  199. package/lib/utilities/constant.js +41 -1
  200. package/lib/utilities/parameters.js +2 -2
  201. package/lib/utilities/renderer.d.ts +1 -0
  202. package/lib/utilities/renderer.js +6 -2
  203. package/package.json +14 -14
  204. package/public/assets/fcr_defaultpage.png +0 -0
  205. package/public/assets/login_confirm.png +0 -0
  206. package/public/index.html +29 -11
  207. package/dist/132.js +0 -2
  208. package/dist/132.js.LICENSE.txt +0 -311
  209. package/dist/651.js +0 -2
  210. package/dist/651.js.LICENSE.txt +0 -1
  211. package/dist/73.js +0 -1
  212. package/dist/index.html +0 -13
  213. package/dist/main.da7c203ab32d15742cfe.css +0 -11760
  214. package/dist/main.js +0 -2
  215. package/dist/main.js.LICENSE.txt +0 -254
  216. package/dist/worker-entry.worker.js.LICENSE.txt +0 -13
  217. package/lib/modules/device-pretest/settings/index.css +0 -15
  218. package/lib/modules/participant/attendee/participants-more-action.d.ts +0 -18
  219. package/lib/modules/participant/attendee/participants-more-action.js +0 -278
@@ -15,3 +15,52 @@
15
15
  .fcr-message-label .fcr-avatar {
16
16
  cursor: pointer;
17
17
  }
18
+
19
+ .chat-tabs-container {
20
+ width: 100%;
21
+ display: flex;
22
+ justify-content: center;
23
+ }
24
+
25
+ .fcr-no-data-chat {
26
+ width: 100%;
27
+ height: 100%;
28
+ display: flex;
29
+ flex-direction: column;
30
+ justify-content: center;
31
+ align-items: center;
32
+ }
33
+
34
+ .fcr-no-data-chat span {
35
+ font-weight: 400;
36
+ font-size: 13px;
37
+ line-height: 14px;
38
+ font-family: PingFang HK;
39
+ color: var(--fcr_ui_scene_icontext2);
40
+ }
41
+
42
+ .fcr-no-data-chat img {
43
+ width: 50%;
44
+ object-fit: contain;
45
+ margin-bottom: 20px;
46
+ }
47
+
48
+ .chat-container-icon {
49
+ position: relative;
50
+ }
51
+
52
+ .chat-container-red {
53
+ width: 8px;
54
+ height: 8px;
55
+ border-radius: 50%;
56
+ background: var(--fcr_ui_scene_ramp_red6);
57
+ position: absolute;
58
+ right: -5px;
59
+ top: -5px;
60
+ }
61
+
62
+ .chat-tabs-container .fcr-action-bar-chat-unread-count {
63
+ top: -16px;
64
+ right: -16px;
65
+ left: auto;
66
+ }
@@ -4,7 +4,7 @@ import { FcrUIEventStore } from '../../common/event-store';
4
4
  import { FcrSecurityStore } from '../../common/security-store';
5
5
  import { CHAT_WRAPPER_CLASS } from 'agora-ui-foundation/lib/components/chat-wrapper';
6
6
  import { FcrChatRoomFile, FcrChatRoomMessageType } from 'agora-edu-core/lib/room-control/chatroom-control/type';
7
- import { FcrBaseRoomControl } from 'agora-edu-core';
7
+ import { FcrMainRoomControl, FcrWaitingRoomControl } from 'agora-edu-core/lib/room-control/type';
8
8
  export { CHAT_WRAPPER_CLASS };
9
9
  export declare class ChatUIModule extends UIModule {
10
10
  private _store;
@@ -12,7 +12,7 @@ export declare class ChatUIModule extends UIModule {
12
12
  private _uiEventStore;
13
13
  private _uid;
14
14
  constructor({ roomControl, uiEventStore, securityStore, }: {
15
- roomControl: FcrBaseRoomControl;
15
+ roomControl: FcrMainRoomControl | FcrWaitingRoomControl;
16
16
  uiEventStore: FcrUIEventStore;
17
17
  securityStore: FcrSecurityStore;
18
18
  });
@@ -23,7 +23,7 @@ window.__DEV_ENGINE_IS_READY__.then(/*#__PURE__*/(0, _asyncToGenerator2["default
23
23
  engine = window.__DEV_ENGINE__;
24
24
  roomId = window.__DEV_ROOM_ID__; // TODO: dev 环境需要 login
25
25
  // await engine.login();
26
- roomControl = engine.createRoomControl(roomId);
26
+ roomControl = engine.createMainRoomControl(roomId);
27
27
  uiEventStore = new _eventStore.FcrUIEventStore();
28
28
  securityStore = new _securityStore.FcrSecurityStore(roomControl.getPrivilegeControl(), roomControl.getUserControl(), roomControl.getStreamControl(), roomControl.getRoomSessionControl(), uiEventStore); // TODO: dev 环境需要 join
29
29
  // await roomControl.join({
@@ -62,13 +62,13 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
62
62
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
63
63
  var _base = require("../../base");
64
64
  require("./index.css");
65
- var _store = _interopRequireDefault(require("./store"));
66
65
  var _chat = require("./chat");
67
66
  var _decorator = require("agora-foundation/lib/decorator");
68
67
  var _contex = require("./contex");
69
68
  var _messageTextarea = require("agora-ui-foundation/lib/components/message-textarea");
70
69
  var _chatWrapper = require("agora-ui-foundation/lib/components/chat-wrapper");
71
70
  var _type = require("agora-edu-core/lib/room-control/chatroom-control/type");
71
+ var _store = _interopRequireDefault(require("./store"));
72
72
  var _jsxRuntime = require("react/jsx-runtime");
73
73
  var _ChatUIModule;
74
74
  var _initProto;
@@ -95,7 +95,8 @@ var ChatUIModule = exports.ChatUIModule = /*#__PURE__*/function (_UIModule) {
95
95
  chatRoomControl: _this._chatRoomControl,
96
96
  userControl: roomControl.getUserControl(),
97
97
  uiEventStore: uiEventStore,
98
- securityStore: securityStore
98
+ securityStore: securityStore,
99
+ roomControl: roomControl
99
100
  });
100
101
  _this.sendMessage = _this.sendMessage.bind(_this);
101
102
  _this.updateReadMsgIndex = _this.updateReadMsgIndex.bind(_this);
@@ -123,8 +124,9 @@ var ChatUIModule = exports.ChatUIModule = /*#__PURE__*/function (_UIModule) {
123
124
  _this2.sendMessage(imgData, _type.FcrChatRoomMessageType.Image);
124
125
  });
125
126
  },
126
- userId: this._uid,
127
- isHost: this._store.isHost,
127
+ userId: this._uid
128
+ // isHost={this._store.isHost}
129
+ ,
128
130
  singling: singling
129
131
  })
130
132
  });
@@ -141,19 +143,20 @@ var ChatUIModule = exports.ChatUIModule = /*#__PURE__*/function (_UIModule) {
141
143
  key: "sendMessage",
142
144
  value: function () {
143
145
  var _sendMessage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(msg, type) {
146
+ var _this$_store$chatRoom, _this$_store$chatRoom2;
144
147
  return _regenerator["default"].wrap(function _callee$(_context) {
145
148
  while (1) switch (_context.prev = _context.next) {
146
149
  case 0:
147
150
  _context.prev = 0;
148
151
  _context.next = 3;
149
- return this._store.sendMessage(msg, type);
152
+ return (_this$_store$chatRoom = this._store.chatRoomStores[this._store.activeTabIndex]) === null || _this$_store$chatRoom === void 0 ? void 0 : _this$_store$chatRoom.sendMessage(msg, type);
150
153
  case 3:
151
154
  _context.next = 8;
152
155
  break;
153
156
  case 5:
154
157
  _context.prev = 5;
155
158
  _context.t0 = _context["catch"](0);
156
- this._store.handleToast({
159
+ (_this$_store$chatRoom2 = this._store.chatRoomStores[this._store.activeTabIndex]) === null || _this$_store$chatRoom2 === void 0 || _this$_store$chatRoom2.handleToast({
157
160
  id: 'send-msg',
158
161
  toastProps: {
159
162
  content: _context.t0.reason,
@@ -176,10 +179,11 @@ var ChatUIModule = exports.ChatUIModule = /*#__PURE__*/function (_UIModule) {
176
179
  key: "updateReadMsgIndex",
177
180
  value: function () {
178
181
  var _updateReadMsgIndex = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(data) {
182
+ var _this$_store$chatRoom3;
179
183
  return _regenerator["default"].wrap(function _callee2$(_context2) {
180
184
  while (1) switch (_context2.prev = _context2.next) {
181
185
  case 0:
182
- this._store.updateReadMsgIndex(data);
186
+ (_this$_store$chatRoom3 = this._store.chatRoomStores[this._store.activeTabIndex]) === null || _this$_store$chatRoom3 === void 0 || _this$_store$chatRoom3.updateReadMsgIndex(data);
183
187
  case 1:
184
188
  case "end":
185
189
  return _context2.stop();
@@ -194,7 +198,8 @@ var ChatUIModule = exports.ChatUIModule = /*#__PURE__*/function (_UIModule) {
194
198
  }, {
195
199
  key: "onUnload",
196
200
  value: function onUnload() {
197
- this._store.release();
201
+ var _this$_store$chatRoom4;
202
+ (_this$_store$chatRoom4 = this._store.chatRoomStores[this._store.activeTabIndex]) === null || _this$_store$chatRoom4 === void 0 || _this$_store$chatRoom4.release();
198
203
  }
199
204
  }]);
200
205
  }(_base.UIModule);
@@ -70,6 +70,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
70
70
  var _copyText = require("../../utilities/copyText");
71
71
  var _platform = require("../../utilities/platform");
72
72
  var _env = require("agora-foundation/lib/utilities/env");
73
+ var _fcr_defaultpage = _interopRequireDefault(require("../../../public/assets/fcr_defaultpage.png"));
73
74
  var _jsxRuntime = require("react/jsx-runtime");
74
75
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
75
76
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
@@ -95,39 +96,42 @@ var MessageList = exports.MessageList = (0, _mobxReact.observer)(function (_ref)
95
96
  copyTips = _ref.copyTips;
96
97
  var t = (0, _i18n.useI18n)();
97
98
  var _useContext = (0, _react.useContext)(_contex.StoreContext),
98
- storeMsgs = _useContext.messageList,
99
- readMsgIndex = _useContext.readMsgIndex,
100
- needCbBottomCount = _useContext.needCbBottomCount,
101
- list = _useContext.list,
102
- mostRecentHeight = _useContext.mostRecentHeight,
103
- mostRecentWidth = _useContext.mostRecentWidth,
104
- cache = _useContext.cache,
105
- scrollHeight = _useContext.scrollHeight,
106
- scrollTop = _useContext.scrollTop,
107
- clientHeight = _useContext.clientHeight,
108
- firstMsgId = _useContext.firstMsgId,
109
- readIdx = _useContext.readIdx,
110
- viewIdx = _useContext.viewIdx,
111
- historyUnReadCount = _useContext.historyUnreadCount,
112
- hasHistoryMsg = _useContext.hasHistoryMsg,
113
- newMsgsUnReadCnt = _useContext.newMsgsUnReadCnt,
114
- isHost = _useContext.isHost,
115
- isCohost = _useContext.isCohost,
116
- initReadInfo = _useContext.initReadInfo,
117
- updateScrollInfo = _useContext.updateScrollInfo,
118
- updateHasHistoryMsg = _useContext.updateHasHistoryMsg,
119
- updateHistoryCnt = _useContext.updateHistoryUnreadCnt,
120
- updateViewIdx = _useContext.updateViewIdx,
121
- updateReadIdx = _useContext.updateReadIdx,
122
- updateFirstMsgId = _useContext.updateFirstMsgId,
123
- updateHistoryUnReadCount = _useContext.updateHistoryUnReadCount,
124
- updateList = _useContext.updateList,
125
- updateMostRecentHeight = _useContext.updateMostRecentHeight,
126
- updateMostRecentWidth = _useContext.updateMostRecentWidth,
127
- forceNotifyMsgs = _useContext.forceNotifyMsgs,
128
- permitPrivateChat = _useContext.permitPrivateChat,
129
- lastScrollTop = _useContext.lastScrollTop,
130
- setLastScrollTop = _useContext.setLastScrollTop;
99
+ chatRoomStores = _useContext.chatRoomStores,
100
+ activeTabIndex = _useContext.activeTabIndex;
101
+ var _ref2 = chatRoomStores[activeTabIndex],
102
+ storeMsgs = _ref2.messageList,
103
+ readMsgIndex = _ref2.readMsgIndex,
104
+ needCbBottomCount = _ref2.needCbBottomCount,
105
+ list = _ref2.list,
106
+ mostRecentHeight = _ref2.mostRecentHeight,
107
+ mostRecentWidth = _ref2.mostRecentWidth,
108
+ cache = _ref2.cache,
109
+ scrollHeight = _ref2.scrollHeight,
110
+ scrollTop = _ref2.scrollTop,
111
+ clientHeight = _ref2.clientHeight,
112
+ firstMsgId = _ref2.firstMsgId,
113
+ readIdx = _ref2.readIdx,
114
+ viewIdx = _ref2.viewIdx,
115
+ historyUnReadCount = _ref2.historyUnreadCount,
116
+ hasHistoryMsg = _ref2.hasHistoryMsg,
117
+ newMsgsUnReadCnt = _ref2.newMsgsUnReadCnt,
118
+ isHost = _ref2.isHost,
119
+ isCohost = _ref2.isCohost,
120
+ initReadInfo = _ref2.initReadInfo,
121
+ updateScrollInfo = _ref2.updateScrollInfo,
122
+ updateHasHistoryMsg = _ref2.updateHasHistoryMsg,
123
+ updateHistoryCnt = _ref2.updateHistoryUnreadCnt,
124
+ updateViewIdx = _ref2.updateViewIdx,
125
+ updateReadIdx = _ref2.updateReadIdx,
126
+ updateFirstMsgId = _ref2.updateFirstMsgId,
127
+ updateHistoryUnReadCount = _ref2.updateHistoryUnReadCount,
128
+ updateList = _ref2.updateList,
129
+ updateMostRecentHeight = _ref2.updateMostRecentHeight,
130
+ updateMostRecentWidth = _ref2.updateMostRecentWidth,
131
+ forceNotifyMsgs = _ref2.forceNotifyMsgs,
132
+ permitPrivateChat = _ref2.permitPrivateChat,
133
+ lastScrollTop = _ref2.lastScrollTop,
134
+ setLastScrollTop = _ref2.setLastScrollTop;
131
135
  var _useState = (0, _react.useState)(storeMsgs !== null && storeMsgs !== void 0 ? storeMsgs : []),
132
136
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
133
137
  messageList = _useState2[0],
@@ -207,7 +211,7 @@ var MessageList = exports.MessageList = (0, _mobxReact.observer)(function (_ref)
207
211
  scrollToIdx(viewIdx);
208
212
  }, [newMsgsUnReadCnt]);
209
213
  var handleCopyMsg = /*#__PURE__*/function () {
210
- var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(msg, time, publisherNickName, targetNickname) {
214
+ var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(msg, time, publisherNickName, targetNickname) {
211
215
  var msgHandled;
212
216
  return _regenerator["default"].wrap(function _callee$(_context) {
213
217
  while (1) switch (_context.prev = _context.next) {
@@ -224,7 +228,7 @@ var MessageList = exports.MessageList = (0, _mobxReact.observer)(function (_ref)
224
228
  }, _callee);
225
229
  }));
226
230
  return function handleCopyMsg(_x, _x2, _x3, _x4) {
227
- return _ref2.apply(this, arguments);
231
+ return _ref3.apply(this, arguments);
228
232
  };
229
233
  }();
230
234
  var handleSelectMsg = function handleSelectMsg(idx, checked) {
@@ -245,12 +249,12 @@ var MessageList = exports.MessageList = (0, _mobxReact.observer)(function (_ref)
245
249
  // list?.scrollToPosition(_scrollTop);
246
250
  };
247
251
  var rowRenderer = function rowRenderer(messageList) {
248
- return function (_ref3) {
252
+ return function (_ref4) {
249
253
  var _arr, _arr2, _arr3, _arr4, _datum$img;
250
- var index = _ref3.index,
251
- key = _ref3.key,
252
- parent = _ref3.parent,
253
- style = _ref3.style;
254
+ var index = _ref4.index,
255
+ key = _ref4.key,
256
+ parent = _ref4.parent,
257
+ style = _ref4.style;
254
258
  var datum = messageList[index % messageList.length];
255
259
  var publisherRole = datum.role,
256
260
  time = datum.time,
@@ -379,7 +383,7 @@ var MessageList = exports.MessageList = (0, _mobxReact.observer)(function (_ref)
379
383
  width: 'auto'
380
384
  },
381
385
  onCopy: (/*#__PURE__*/function () {
382
- var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(type) {
386
+ var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(type) {
383
387
  var currentScrollTop;
384
388
  return _regenerator["default"].wrap(function _callee2$(_context2) {
385
389
  while (1) switch (_context2.prev = _context2.next) {
@@ -410,7 +414,7 @@ var MessageList = exports.MessageList = (0, _mobxReact.observer)(function (_ref)
410
414
  }, _callee2);
411
415
  }));
412
416
  return function (_x5) {
413
- return _ref4.apply(this, arguments);
417
+ return _ref5.apply(this, arguments);
414
418
  };
415
419
  }()),
416
420
  onPrivate: function onPrivate() {
@@ -576,13 +580,20 @@ var MessageList = exports.MessageList = (0, _mobxReact.observer)(function (_ref)
576
580
  styles: {
577
581
  zIndex: 999
578
582
  }
579
- }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactVirtualized.AutoSizer, {
583
+ }) : null, messageList.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
584
+ className: "fcr-no-data-chat",
585
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
586
+ src: _fcr_defaultpage["default"]
587
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
588
+ children: t('fmt_chat_tips_nodata')
589
+ })]
590
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactVirtualized.AutoSizer, {
580
591
  style: {
581
592
  alignSelf: 'stretch'
582
593
  },
583
- children: function children(_ref5) {
584
- var height = _ref5.height,
585
- width = _ref5.width;
594
+ children: function children(_ref6) {
595
+ var height = _ref6.height,
596
+ width = _ref6.width;
586
597
  if (height !== mostRecentHeight || width !== mostRecentWidth) {
587
598
  cache.clearAll();
588
599
  if (list) {
@@ -592,8 +603,8 @@ var MessageList = exports.MessageList = (0, _mobxReact.observer)(function (_ref)
592
603
  updateMostRecentHeight(height);
593
604
  updateMostRecentWidth(width);
594
605
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactVirtualized.List, {
595
- ref: function ref(_ref6) {
596
- updateList(_ref6);
606
+ ref: function ref(_ref7) {
607
+ updateList(_ref7);
597
608
  },
598
609
  style: {
599
610
  padding: 'inherit',
@@ -4,9 +4,13 @@ import { FcrUserRole, FcrUserInfo } from 'agora-edu-core/lib/type';
4
4
  import { FcrUIEventStore } from '../../common/event-store';
5
5
  import { FcrSecurityStore } from '../../common/security-store';
6
6
  import { CellMeasurerCache, List } from 'react-virtualized';
7
+ import { RoomType } from '../../utilities/constant';
7
8
  import { AllowChatLevelType } from 'agora-ui-foundation/lib/components/chat-manager';
8
9
  import { ToastConfig } from 'agora-ui-foundation/lib/components/toast';
9
- import { FcrChatRoomConnectionState, FcrChatRoomControl, FcrChatRoomFile, FcrChatRoomMessageType } from 'agora-edu-core/lib/room-control/chatroom-control/type';
10
+ import { FcrChatRoomConnectionState, FcrChatRoomControl, FcrChatRoomFile, FcrChatRoomMessageType, FcrChatRoomReceiveImageMessage, FcrChatRoomReceiveTextMessage } from 'agora-edu-core/lib/room-control/chatroom-control/type';
11
+ import { FcrMainRoomControl, FcrWaitingRoomControl } from 'agora-edu-core/lib/room-control/type';
12
+ import { AgoraObservable } from 'agora-foundation/lib/utilities/observable';
13
+ type FcrChatRoomReceiveMessage = FcrChatRoomReceiveTextMessage | FcrChatRoomReceiveImageMessage;
10
14
  export interface MsgListType {
11
15
  id: string;
12
16
  nickName: string;
@@ -25,7 +29,35 @@ export declare const USER_ALL = "All";
25
29
  export declare const USER_NONE = "NONE";
26
30
  export declare const allToUser: FcrUserInfo;
27
31
  export declare const noUser: FcrUserInfo;
32
+ type FcrChatStoreObserver = {
33
+ onReceiveMessage: (msgs: FcrChatRoomReceiveMessage[], type: RoomType) => void;
34
+ };
35
+ type ChatRoomStoreMap = {
36
+ [K in RoomType]?: ChatRoomStore;
37
+ };
38
+ type RoomTypeKeys = keyof typeof RoomType;
28
39
  export default class ChatStore {
40
+ private _observable;
41
+ private _securityStore;
42
+ private _uiEventStore;
43
+ private _chatVisible;
44
+ private _eventObserver;
45
+ private _chatStoreObserver;
46
+ accessor chatRoomStores: ChatRoomStoreMap;
47
+ accessor activeTabIndex: RoomTypeKeys;
48
+ constructor({ chatRoomControl, userControl, uiEventStore, securityStore, roomControl, }: {
49
+ chatRoomControl: FcrChatRoomControl;
50
+ userControl: FcrUserControl;
51
+ uiEventStore: FcrUIEventStore;
52
+ securityStore: FcrSecurityStore;
53
+ roomControl: FcrWaitingRoomControl | FcrMainRoomControl;
54
+ });
55
+ hasWaitingRoomPermission(): boolean;
56
+ private _handleReceiveMessage;
57
+ handlerActiveTab(key: RoomType): void;
58
+ private _handleEvent;
59
+ }
60
+ export declare class ChatRoomStore {
29
61
  needCbBottomCount: number;
30
62
  list: List | undefined;
31
63
  mostRecentHeight: number;
@@ -45,9 +77,11 @@ export default class ChatStore {
45
77
  private _userControl;
46
78
  private _chatRoomControl;
47
79
  private _securityStore;
80
+ private _chatStoreObservable;
48
81
  private _maxMsgCount;
49
82
  private _originalMessages;
50
83
  private _disposers;
84
+ private _type;
51
85
  private accessor _userInfo;
52
86
  accessor messageList: MsgListType[];
53
87
  accessor readMsgIndex: {
@@ -65,20 +99,28 @@ export default class ChatStore {
65
99
  accessor textMsg: string;
66
100
  accessor privateTargetList: FcrUserInfo[];
67
101
  accessor chatRoomState: FcrChatRoomConnectionState;
102
+ accessor hasNewMsg: boolean;
103
+ accessor userCount: number;
104
+ accessor unReadMsgCount: number;
68
105
  private _chatRoomObserver;
69
106
  private _userObserver;
70
- constructor({ chatRoomControl, userControl, uiEventStore, securityStore, }: {
107
+ constructor({ chatRoomControl, userControl, uiEventStore, securityStore, type, chatStoreObservable, }: {
71
108
  chatRoomControl: FcrChatRoomControl;
72
109
  userControl: FcrUserControl;
73
110
  uiEventStore: FcrUIEventStore;
74
111
  securityStore: FcrSecurityStore;
112
+ type: RoomType;
113
+ chatStoreObservable: AgoraObservable<FcrChatStoreObserver>;
75
114
  });
76
115
  release(): void;
77
116
  setLastScrollTop(value: number | undefined): void;
78
117
  setMessageList(messages: MsgListType[]): void;
79
118
  sendMessage(msg: string | FcrChatRoomFile, type: FcrChatRoomMessageType): Promise<void>;
80
119
  private messageReceived;
120
+ setUnReadMsgCount(count: number): void;
121
+ setHasNewMsg(value: boolean): void;
81
122
  private _handleTextMessageReceived;
123
+ getUserCount(): number;
82
124
  private _onRemoteUserUpdate;
83
125
  private _onUserPropertiesUpdated;
84
126
  private _onUserInfoUpdated;
@@ -94,6 +136,7 @@ export default class ChatStore {
94
136
  get disallowedPublicChatAndDisallowedPrivateChatToParticipant(): boolean | undefined;
95
137
  get disallowedAllChat(): boolean | undefined;
96
138
  get hasChatPermission(): boolean;
139
+ get hasChatSendPrivatePermission(): boolean;
97
140
  get isHost(): boolean;
98
141
  get isCohost(): boolean;
99
142
  get localIsManager(): boolean;
@@ -121,6 +164,8 @@ export default class ChatStore {
121
164
  updateChatLevel(chatLevel: AllowChatLevelType): void;
122
165
  get privilegeOperator(): FcrUserInfo | undefined;
123
166
  updateChatTextMsg(txt: string): void;
167
+ filterChatMember(list: FcrUserInfo[]): FcrUserInfo[];
168
+ hasSendMessagePermission(): boolean;
124
169
  permitPrivateChat(userId: string): void;
125
170
  handleToast(params: ToastConfig): void;
126
171
  get isHostOrCoHost(): boolean;
@@ -130,3 +175,4 @@ export default class ChatStore {
130
175
  }
131
176
  export declare function isManager(role: FcrUserRole): role is FcrUserRole.HOST | FcrUserRole.COHOST;
132
177
  export declare function sortUsers(users: FcrUserInfo[]): FcrUserInfo[];
178
+ export {};