fcr-ui-scene 3.6.2 → 3.6.3

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 (197) hide show
  1. package/lib/creator.d.ts +1 -0
  2. package/lib/creator.js +38 -26
  3. package/lib/electron/app.js +5 -4
  4. package/lib/electron/bootstrap-dev.js +3 -0
  5. package/lib/electron/injections.d.ts +3 -2
  6. package/lib/electron/injections.js +5 -6
  7. package/lib/electron/main.js +15 -11
  8. package/lib/electron/window.js +0 -3
  9. package/lib/fragments/annotation/index.d.ts +1 -0
  10. package/lib/fragments/annotation/index.js +55 -40
  11. package/lib/fragments/annotation/store.d.ts +7 -2
  12. package/lib/fragments/annotation/store.js +170 -90
  13. package/lib/fragments/annotation/view.d.ts +1 -0
  14. package/lib/fragments/annotation/view.js +10 -2
  15. package/lib/modules/action-bar/index.css +4 -0
  16. package/lib/modules/action-bar/store.d.ts +1 -7
  17. package/lib/modules/action-bar/store.js +35 -82
  18. package/lib/modules/annotation/board-cursor.css +76 -0
  19. package/lib/modules/annotation/components/control-bar/index.js +42 -2
  20. package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/index.js +3 -1
  21. package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.d.ts +1 -0
  22. package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.js +11 -5
  23. package/lib/modules/annotation/components/toolbar/components/item/item.d.ts +1 -0
  24. package/lib/modules/annotation/components/toolbar/components/item/item.js +3 -2
  25. package/lib/modules/annotation/index.d.ts +2 -0
  26. package/lib/modules/annotation/index.js +2 -1
  27. package/lib/modules/annotation/store.d.ts +11 -3
  28. package/lib/modules/annotation/store.js +209 -184
  29. package/lib/modules/annotation/style.css +3 -3
  30. package/lib/modules/annotation/view.d.ts +1 -0
  31. package/lib/modules/annotation/view.js +26 -9
  32. package/lib/modules/components/member-window/components/member-actions/components/audio-control.d.ts +0 -1
  33. package/lib/modules/components/member-window/components/member-actions/components/audio-control.js +10 -4
  34. package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.d.ts +2 -2
  35. package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.js +4 -4
  36. package/lib/modules/components/member-window/components/member-actions/components/icon-status.d.ts +0 -2
  37. package/lib/modules/components/member-window/components/member-actions/components/icon-status.js +3 -4
  38. package/lib/modules/components/member-window/components/member-actions/components/more-actions.d.ts +0 -3
  39. package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +6 -32
  40. package/lib/modules/components/member-window/components/member-actions/components/share-status.js +11 -3
  41. package/lib/modules/components/member-window/components/member-actions/components/user-info.d.ts +0 -1
  42. package/lib/modules/components/member-window/components/member-actions/components/user-info.js +7 -10
  43. package/lib/modules/components/member-window/components/member-actions/components/user-tag.d.ts +0 -1
  44. package/lib/modules/components/member-window/components/member-actions/components/user-tag.js +0 -2
  45. package/lib/modules/components/member-window/components/member-actions/index.js +1 -32
  46. package/lib/modules/components/member-window/components/member-actions/store.d.ts +38 -1
  47. package/lib/modules/components/member-window/components/member-actions/store.js +130 -23
  48. package/lib/modules/components/member-window/index.css +37 -0
  49. package/lib/modules/control-bar/index.d.ts +0 -4
  50. package/lib/modules/control-bar/index.js +0 -32
  51. package/lib/modules/control-bar/store.d.ts +4 -6
  52. package/lib/modules/control-bar/store.js +63 -103
  53. package/lib/modules/control-bar/view.js +45 -3
  54. package/lib/modules/dialog/components/control-bar/index.d.ts +0 -2
  55. package/lib/modules/dialog/components/control-bar/index.js +1 -3
  56. package/lib/modules/dialog/hooks/useElectron.js +3 -2
  57. package/lib/modules/dialog/index.d.ts +0 -3
  58. package/lib/modules/dialog/index.js +1 -25
  59. package/lib/modules/dialog/store.d.ts +6 -8
  60. package/lib/modules/dialog/store.js +21 -55
  61. package/lib/modules/layout/components/CommonVideoRenderer.js +5 -2
  62. package/lib/modules/layout/type.d.ts +7 -0
  63. package/lib/modules/participant/store.js +59 -28
  64. package/lib/modules/setting/index.d.ts +2 -0
  65. package/lib/modules/setting/index.js +3 -3
  66. package/lib/modules/setting/store.d.ts +8 -10
  67. package/lib/modules/setting/store.js +22 -20
  68. package/lib/modules/share-screen/store.d.ts +3 -0
  69. package/lib/modules/share-screen/store.js +63 -54
  70. package/lib/modules/state-bar/index.css +8 -6
  71. package/lib/modules/state-bar/index.d.ts +2 -0
  72. package/lib/modules/state-bar/index.js +2 -1
  73. package/lib/modules/state-bar/layout-config.d.ts +1 -0
  74. package/lib/modules/state-bar/layout-config.js +15 -5
  75. package/lib/modules/state-bar/store.d.ts +5 -1
  76. package/lib/modules/state-bar/store.js +8 -1
  77. package/lib/modules/state-bar/view.js +9 -5
  78. package/lib/modules/whiteboard/components/control-bar/store.js +2 -0
  79. package/lib/modules/whiteboard/components/toolbar/store.d.ts +7 -3
  80. package/lib/modules/whiteboard/components/toolbar/store.js +61 -35
  81. package/lib/modules/whiteboard/index.js +3 -2
  82. package/lib/modules/whiteboard/style.css +0 -4
  83. package/lib/modules/whiteboard/view.js +8 -2
  84. package/lib/providers/annotation-provider.d.ts +63 -12
  85. package/lib/providers/annotation-provider.js +51 -41
  86. package/lib/providers/device-provider.d.ts +3 -3
  87. package/lib/providers/device-provider.js +8 -6
  88. package/lib/providers/event-provider.d.ts +3 -3
  89. package/lib/providers/screen-share-provider.js +53 -60
  90. package/lib/providers/sharing-provider.d.ts +5 -1
  91. package/lib/providers/sharing-provider.js +16 -1
  92. package/lib/providers/user-setting-storage-provider.d.ts +20 -0
  93. package/lib/providers/user-setting-storage-provider.js +74 -0
  94. package/lib/scenes/main-scene.js +2 -3
  95. package/lib/scenes/waiting-scene.js +1 -1
  96. package/lib/shared-data-source/config.d.ts +1 -5
  97. package/lib/shared-data-source/config.js +11 -81
  98. package/lib/shared-data-source/screen-share-data.d.ts +4 -0
  99. package/lib/shared-data-source/screen-share-data.js +1 -0
  100. package/lib/shared-data-source/setting.d.ts +13 -13
  101. package/lib/shared-data-source/setting.js +10 -6
  102. package/lib/shared-data-source/video-window.d.ts +2 -1
  103. package/lib/shared-data-source/video-window.js +56 -36
  104. package/lib/translations/enUS.d.ts +8 -0
  105. package/lib/translations/enUS.js +9 -1
  106. package/lib/translations/zhCN.d.ts +8 -0
  107. package/lib/translations/zhCN.js +11 -3
  108. package/lib/type.d.ts +2 -1
  109. package/lib/ui-scene.js +11 -6
  110. package/lib/utilities/constant.d.ts +2 -1
  111. package/lib/utilities/constant.js +1 -0
  112. package/lib/utilities/setting-config-storage.d.ts +5 -6
  113. package/lib/utilities/setting-config-storage.js +33 -39
  114. package/lib/utilities/tools.d.ts +1 -0
  115. package/lib/utilities/tools.js +3 -2
  116. package/package.json +8 -6
  117. package/dist/132.js +0 -2
  118. package/dist/132.js.LICENSE.txt +0 -311
  119. package/dist/317.js +0 -2
  120. package/dist/317.js.LICENSE.txt +0 -20
  121. package/dist/651.js +0 -2
  122. package/dist/651.js.LICENSE.txt +0 -1
  123. package/dist/689343b64b60bfb7ffff.png +0 -0
  124. package/dist/73.js +0 -1
  125. package/dist/885f9369ea05a8ac0e56.png +0 -0
  126. package/dist/90f383876a6e93e7c7ca.png +0 -0
  127. package/dist/9b37584780995fc5df8c.gif +0 -0
  128. package/dist/annotation.e5cbd3a70b6d42361872.css +0 -1274
  129. package/dist/annotation.html +0 -1
  130. package/dist/annotation.js +0 -2
  131. package/dist/annotation.js.LICENSE.txt +0 -252
  132. package/dist/assets/browser/images/default1.jpg +0 -0
  133. package/dist/assets/browser/images/default2.jpg +0 -0
  134. package/dist/assets/browser/images/default3.jpg +0 -0
  135. package/dist/assets/browser/images/default4.jpg +0 -0
  136. package/dist/assets/browser/images/default5.jpg +0 -0
  137. package/dist/assets/browser/images/default6.jpg +0 -0
  138. package/dist/assets/browser/images/default7.jpg +0 -0
  139. package/dist/assets/browser/sound_effects/pretest.mp3 +0 -0
  140. package/dist/assets/browser/sound_effects/recording_started.mp3 +0 -0
  141. package/dist/assets/browser/sound_effects/remote_user_joined.mp3 +0 -0
  142. package/dist/assets/browser/sound_effects/speaker_test.mp3 +0 -0
  143. package/dist/assets/browser/videos/default8.mp4 +0 -0
  144. package/dist/assets/browser/videos/default9.mp4 +0 -0
  145. package/dist/assets/cursors/fcr_whiteboard_input.ico +0 -0
  146. package/dist/assets/cursors/fcr_whiteboard_pen.ico +0 -0
  147. package/dist/assets/cursors/fcr_whiteboard_shape_-straightline.ico +0 -0
  148. package/dist/assets/cursors/fcr_whiteboard_shape_arrow.ico +0 -0
  149. package/dist/assets/cursors/fcr_whiteboard_shape_circle.ico +0 -0
  150. package/dist/assets/cursors/fcr_whiteboard_shape_rectangle.ico +0 -0
  151. package/dist/assets/cursors/fcr_whiteboard_shape_triangle.ico +0 -0
  152. package/dist/assets/electron/images/default1.jpg +0 -0
  153. package/dist/assets/electron/images/default2.jpg +0 -0
  154. package/dist/assets/electron/sound_effects/pretest.mp3 +0 -0
  155. package/dist/assets/electron/videos/default8.mp4 +0 -0
  156. package/dist/assets/fcr_chat_reddot.svg +0 -5
  157. package/dist/assets/fcr_defaultpage.png +0 -0
  158. package/dist/assets/fcr_grid_big.svg +0 -3
  159. package/dist/assets/fcr_leave2.svg +0 -58
  160. package/dist/assets/fcr_listontop_big.svg +0 -3
  161. package/dist/assets/full-screen-error-boundary-img.png +0 -0
  162. package/dist/assets/leave-meeting.png +0 -0
  163. package/dist/assets/loading.gif +0 -0
  164. package/dist/assets/login_confirm.png +0 -0
  165. package/dist/assets/pretest.mp3 +0 -0
  166. package/dist/assets/state-bar-logo.png +0 -0
  167. package/dist/assets/step-gradient.svg +0 -10
  168. package/dist/b74b002687a3a3346bec.png +0 -0
  169. package/dist/b94869094481702f949b.png +0 -0
  170. package/dist/ebeace75fd46b90d890e.png +0 -0
  171. package/dist/electron/app.js +0 -194
  172. package/dist/electron/bootstrap-dev.js +0 -46
  173. package/dist/electron/bootstrap-sdk.js +0 -211
  174. package/dist/electron/default-options.js +0 -25
  175. package/dist/electron/env.js +0 -13
  176. package/dist/electron/index.js +0 -20
  177. package/dist/electron/injections.js +0 -903
  178. package/dist/electron/ipc/ipc.js +0 -141
  179. package/dist/electron/ipc/type.js +0 -19
  180. package/dist/electron/logger.js +0 -65
  181. package/dist/electron/main.js +0 -94
  182. package/dist/electron/plugins/devtool-shortcut.js +0 -33
  183. package/dist/electron/plugins/meeting-state.js +0 -39
  184. package/dist/electron/plugins/screenshot.js +0 -54
  185. package/dist/electron/preload.js +0 -108
  186. package/dist/electron/tools.js +0 -66
  187. package/dist/electron/window.js +0 -123
  188. package/dist/extensions/agora-extension-virtual-background/agora-wasm.wasm +0 -0
  189. package/dist/extensions/ai-denoiser/denoiser-wasm-simd.wasm +0 -0
  190. package/dist/extensions/ai-denoiser/denoiser-wasm.js +0 -1
  191. package/dist/extensions/ai-denoiser/denoiser-wasm.wasm +0 -0
  192. package/dist/fad688b9135b15d6c405.png +0 -0
  193. package/dist/index.html +0 -224
  194. package/dist/main.393a2a91ab7fc05ffce6.css +0 -15403
  195. package/dist/main.js +0 -2
  196. package/dist/main.js.LICENSE.txt +0 -272
  197. package/dist/worker-entry.worker.js.LICENSE.txt +0 -13
@@ -61,6 +61,7 @@ require("core-js/modules/esnext.json.parse.js");
61
61
  require("core-js/modules/esnext.weak-map.delete-all.js");
62
62
  require("core-js/modules/esnext.weak-map.emplace.js");
63
63
  require("core-js/modules/web.dom-collections.iterator.js");
64
+ require("core-js/modules/web.timers.js");
64
65
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
65
66
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
66
67
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
@@ -81,7 +82,7 @@ var _asyncRetry = require("agora-foundation/lib/utilities/async-retry");
81
82
  var _logger = require("../../utilities/logger");
82
83
  var _platform = require("../../utilities/platform");
83
84
  var _AnnotationStore;
84
- var _initProto, _init_joined, _init_bounds, _handleBoardDomLoadDecs, _closeDecs, _ref;
85
+ var _initProto, _init_joined, _init_bounds, _init_currentTool, _handleBoardDomLoadDecs, _closeDecs, _handleSetToolDecs, _ref;
85
86
  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; }
86
87
  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; }
87
88
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
@@ -96,7 +97,8 @@ function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.descr
96
97
  function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
97
98
  var _A = /*#__PURE__*/new WeakMap();
98
99
  var _B = /*#__PURE__*/new WeakMap();
99
- _ref = (_handleBoardDomLoadDecs = [_mobx.action, _mobx.action.bound], _closeDecs = [_mobx.action, _mobx.action.bound], "logger");
100
+ var _C = /*#__PURE__*/new WeakMap();
101
+ _ref = (_handleBoardDomLoadDecs = [_mobx.action, _mobx.action.bound], _closeDecs = [_mobx.action, _mobx.action.bound], _handleSetToolDecs = [(0, _decorator.debounced)(300), _decorator.bound], "logger");
100
102
  var AnnotationStore = /*#__PURE__*/function () {
101
103
  function AnnotationStore() {
102
104
  (0, _classCallCheck2["default"])(this, AnnotationStore);
@@ -115,10 +117,12 @@ var AnnotationStore = /*#__PURE__*/function () {
115
117
  width: 800,
116
118
  height: 600
117
119
  }));
120
+ _classPrivateFieldInitSpec(this, _C, _init_currentTool(this, 'none'));
121
+ (0, _defineProperty2["default"])(this, "timer", null);
118
122
  var annotationRtmAppId = localStorage.getItem('annotation_rtm_app_id') || '';
119
123
  var boardOptions = localStorage.getItem('board_options');
120
124
  var appId = JSON.parse(annotationRtmAppId);
121
- this.logger.info("'annotationRtmAppId =>', ".concat(appId));
125
+ this.logger.info("annotationRtmAppId => ".concat(appId));
122
126
  var _JSON$parse = JSON.parse(boardOptions || '{}'),
123
127
  boardAppId = _JSON$parse.boardAppId,
124
128
  boardId = _JSON$parse.boardId,
@@ -134,7 +138,7 @@ var AnnotationStore = /*#__PURE__*/function () {
134
138
  boardId: boardId,
135
139
  boardToken: boardToken
136
140
  };
137
- this.logger.info("'boardinfo =>', ".concat(JSON.stringify(this._config)));
141
+ this.logger.info("boardinfo => ".concat(JSON.stringify(this._config)));
138
142
  this._init(this._initEngine({
139
143
  userId: userId,
140
144
  roomToken: boardUserToken,
@@ -157,57 +161,66 @@ var AnnotationStore = /*#__PURE__*/function () {
157
161
  set: function set(v) {
158
162
  _classPrivateFieldSet(_B, this, v);
159
163
  }
164
+ }, {
165
+ key: "currentTool",
166
+ get: function get() {
167
+ return _classPrivateFieldGet(_C, this);
168
+ },
169
+ set: function set(v) {
170
+ _classPrivateFieldSet(_C, this, v);
171
+ }
160
172
  }, {
161
173
  key: "open",
162
174
  value: function () {
163
175
  var _open = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
164
- var _this = this;
165
- var whiteboard, _this$_boardDom;
176
+ var visible, whiteboard, _this$_boardDom;
166
177
  return _regenerator["default"].wrap(function _callee$(_context) {
167
178
  while (1) switch (_context.prev = _context.next) {
168
179
  case 0:
169
- this.logger.info("'open method is called, the init bounds is =>', ".concat(JSON.stringify(this.bounds)));
180
+ this.logger.info("[annotation][open]: open method is called, the init bounds is =>, ".concat(JSON.stringify(this.bounds)));
181
+ this.currentTool = 'curve';
170
182
  window.runtime.browserWindow.setAlwaysOnTop(true, 'pop-up-menu');
171
183
  (0, _platform.isWindows)() && window.runtime.browserWindow.blur();
172
184
  this.setIgnore(true);
173
- this.logger.info("'the annotation window visible is =>',\n ".concat(window.runtime.browserWindow.isVisible()));
185
+ visible = window.runtime.browserWindow.isVisible();
186
+ this.logger.info("[annotation][open]: the annotation window visible is =>\n ".concat(visible, ", open process is ").concat(visible ? 'return' : 'continue...'));
174
187
  if (!window.runtime.browserWindow.isVisible()) {
175
- _context.next = 7;
188
+ _context.next = 9;
176
189
  break;
177
190
  }
178
191
  return _context.abrupt("return");
179
- case 7:
192
+ case 9:
180
193
  if (this._engine) {
181
- _context.next = 12;
194
+ _context.next = 14;
182
195
  break;
183
196
  }
184
- this.logger.info('this._engine is null');
197
+ this.logger.info('[annotation][open]: this._engine is null');
185
198
  return _context.abrupt("return");
186
- case 12:
187
- this.logger.info('this._engine is not null, show annotation window');
188
- window.runtime.browserWindow.show();
189
199
  case 14:
190
- this.logger.info("'this._joined', ".concat(this.joined, ", ").concat(this._engine));
200
+ this.logger.info('[annotation][open]: this._engine is initialized, show annotation window');
201
+ window.runtime.browserWindow.show();
202
+ case 16:
203
+ this.logger.info("[annotation][open]: this._joined ".concat(this.joined));
191
204
  if (!this.joined) {
192
- _context.next = 17;
205
+ _context.next = 19;
193
206
  break;
194
207
  }
195
208
  return _context.abrupt("return");
196
- case 17:
209
+ case 19:
197
210
  if (this._boardRoom) {
198
- _context.next = 20;
211
+ _context.next = 22;
199
212
  break;
200
213
  }
201
- _context.next = 20;
214
+ _context.next = 22;
202
215
  return this._initBoardRoom();
203
- case 20:
216
+ case 22:
204
217
  if (this._boardRoom) {
205
- _context.next = 22;
218
+ _context.next = 24;
206
219
  break;
207
220
  }
208
- return _context.abrupt("return", this.logger.error("'this._boardRoom is not initialized', ".concat(this._boardRoom)));
209
- case 22:
210
- _context.next = 24;
221
+ return _context.abrupt("return", this.logger.error("[annotation][open]: this._boardRoom is not initialized, ".concat(this._boardRoom)));
222
+ case 24:
223
+ _context.next = 26;
211
224
  return this._boardRoom.applicationManager.launchApplication(_forgeWhiteboard.WhiteboardApplication, {
212
225
  width: this.bounds.width,
213
226
  height: this.bounds.height,
@@ -217,31 +230,21 @@ var AnnotationStore = /*#__PURE__*/function () {
217
230
  strokeWidth: 2
218
231
  }
219
232
  }, this._FORGE_WHITEBOARD_APP_ID);
220
- case 24:
233
+ case 26:
221
234
  whiteboard = _context.sent;
235
+ this.logger.info("[annotation][open]: whiteboard launch success");
222
236
  if (whiteboard) {
223
237
  this._boardView.classList.add('fcr-whiteboard-window-view');
224
238
  this._boardView.appendChild(whiteboard.view);
225
239
  (_this$_boardDom = this._boardDom) === null || _this$_boardDom === void 0 || _this$_boardDom.appendChild(this._boardView);
226
- this._setBoardInstance(whiteboard);
240
+ this._boardInstance = whiteboard;
241
+ this._initBoardStyle(whiteboard);
227
242
  this.joined = true;
243
+ this.logger.info("[annotation][open]: mount success, the joined is ".concat(this.joined));
228
244
  }
229
- this._boardRoom.applicationManager.on('launch', function (appId, app) {
230
- if (appId === _this._FORGE_WHITEBOARD_APP_ID) {
231
- var _this$_boardView;
232
- _this.logger.info('launch event is triggered');
233
- app.view && ((_this$_boardView = _this._boardView) === null || _this$_boardView === void 0 ? void 0 : _this$_boardView.appendChild(app.view));
234
- _this._setBoardInstance(app);
235
- }
236
- });
237
- this._boardRoom.applicationManager.on('terminal', function (appId, app) {
238
- if (appId === _this._FORGE_WHITEBOARD_APP_ID) {
239
- var _this$_boardView2;
240
- _this.logger.info('terminal event is triggered');
241
- app.view && _this._boardView.hasChildNodes() && ((_this$_boardView2 = _this._boardView) === null || _this$_boardView2 === void 0 ? void 0 : _this$_boardView2.removeChild(app.view));
242
- }
243
- });
244
- case 28:
245
+ this._boardRoom.applicationManager.on('launch', this._launchHandler);
246
+ this._boardRoom.applicationManager.on('terminal', this._terminalHandler);
247
+ case 31:
245
248
  case "end":
246
249
  return _context.stop();
247
250
  }
@@ -259,35 +262,60 @@ var AnnotationStore = /*#__PURE__*/function () {
259
262
  }
260
263
  }, {
261
264
  key: "close",
262
- value: function close() {
263
- var _this$_boardInstance, _this$_boardRoom;
264
- this.joined = false;
265
- this._boardView.removeChild((_this$_boardInstance = this._boardInstance) === null || _this$_boardInstance === void 0 ? void 0 : _this$_boardInstance.view);
266
- (_this$_boardRoom = this._boardRoom) === null || _this$_boardRoom === void 0 || _this$_boardRoom.applicationManager.terminateApplication(this._FORGE_WHITEBOARD_APP_ID);
267
- this._boardInstance = null;
268
- window.runtime.browserWindow.hide();
269
- }
265
+ value: function () {
266
+ var _close = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
267
+ var _this$_boardInstance, _this$_boardInstance2, _this$_boardInstance3, _this$_boardRoom, _this$_boardRoom2, _this$_boardRoom3, _this$_boardRoom4;
268
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
269
+ while (1) switch (_context2.prev = _context2.next) {
270
+ case 0:
271
+ this.joined = false;
272
+ this.currentTool = 'curve';
273
+ (_this$_boardInstance = this._boardInstance) === null || _this$_boardInstance === void 0 || _this$_boardInstance.clearPage();
274
+ ((_this$_boardInstance2 = this._boardInstance) === null || _this$_boardInstance2 === void 0 ? void 0 : _this$_boardInstance2.view) && this._boardView.removeChild((_this$_boardInstance3 = this._boardInstance) === null || _this$_boardInstance3 === void 0 ? void 0 : _this$_boardInstance3.view);
275
+ (_this$_boardRoom = this._boardRoom) === null || _this$_boardRoom === void 0 || _this$_boardRoom.applicationManager.removeListener('launch', this._launchHandler);
276
+ (_this$_boardRoom2 = this._boardRoom) === null || _this$_boardRoom2 === void 0 || _this$_boardRoom2.applicationManager.removeListener('terminal', this._terminalHandler);
277
+ (_this$_boardRoom3 = this._boardRoom) === null || _this$_boardRoom3 === void 0 || _this$_boardRoom3.applicationManager.terminateApplication(this._FORGE_WHITEBOARD_APP_ID);
278
+ _context2.next = 9;
279
+ return (_this$_boardRoom4 = this._boardRoom) === null || _this$_boardRoom4 === void 0 ? void 0 : _this$_boardRoom4.leaveRoom();
280
+ case 9:
281
+ this._boardRoom = null;
282
+ this._boardInstance = null;
283
+ window.runtime.browserWindow.hide();
284
+ this.logger.info('[annotation][open]: close annotation window');
285
+ case 13:
286
+ case "end":
287
+ return _context2.stop();
288
+ }
289
+ }, _callee2, this);
290
+ }));
291
+ function close() {
292
+ return _close.apply(this, arguments);
293
+ }
294
+ return close;
295
+ }()
270
296
  }, {
271
297
  key: "setBounds",
272
298
  value: function setBounds(bounds) {
273
299
  this.bounds = bounds;
274
- this.logger.info("'bounds is changed =>', ".concat(JSON.stringify(bounds)));
300
+ this.logger.info("[annotation][setBounds]: bounds is changed =>, ".concat(JSON.stringify(bounds)));
275
301
  window.runtime.browserWindow.setBounds(bounds);
276
302
  }
277
303
  }, {
278
304
  key: "setIgnore",
279
305
  value: function setIgnore(ignore) {
306
+ this.logger.info("[annotation][setIgnore]: setIgnore method is called, the ignore is => ".concat(ignore));
280
307
  window.runtime.browserWindow.setIgnoreMouseEvents(ignore);
281
308
  }
282
309
  }, {
283
310
  key: "toolChanged",
284
311
  value: function toolChanged(event) {
285
312
  if (!this._boardInstance) return;
313
+ this.logger.info("[annotation][toolChanged]: toolChanged method is called, the event is => ".concat(JSON.stringify(event)));
286
314
  var board = this._boardInstance;
287
315
  var payload = event.payload;
288
316
  switch (event.action) {
289
317
  case _type.ToolbarEvents.SET_TOOL:
290
- board.setCurrentTool((0, _libs.convertTool)(payload));
318
+ this._handleSetTool(payload);
291
319
  break;
292
320
  case _type.ToolbarEvents.SET_STROKE_COLOR:
293
321
  board.strokeColor = payload;
@@ -316,8 +344,8 @@ var AnnotationStore = /*#__PURE__*/function () {
316
344
  }
317
345
  }
318
346
  }, {
319
- key: "_setBoardInstance",
320
- value: function _setBoardInstance(whiteboard) {
347
+ key: "_initBoardStyle",
348
+ value: function _initBoardStyle(whiteboard) {
321
349
  var _this$_boardDom2, _this$_boardDom3;
322
350
  var frameWidth = (_this$_boardDom2 = this._boardDom) === null || _this$_boardDom2 === void 0 ? void 0 : _this$_boardDom2.offsetWidth;
323
351
  var frameHeight = (_this$_boardDom3 = this._boardDom) === null || _this$_boardDom3 === void 0 ? void 0 : _this$_boardDom3.offsetHeight;
@@ -325,7 +353,6 @@ var AnnotationStore = /*#__PURE__*/function () {
325
353
  this._boardView.style.height = "".concat(frameHeight, "px");
326
354
  whiteboard.view.style.height = "".concat(frameHeight, "px");
327
355
  whiteboard.view.style.width = "".concat(frameWidth, "px");
328
- this._boardInstance = whiteboard;
329
356
  whiteboard.setCanvasBackgroundColor('rgba(0, 0, 0, 0)');
330
357
  whiteboard.enableCameraByMouse = false;
331
358
  whiteboard.enableCameraByTouch = false;
@@ -348,30 +375,59 @@ var AnnotationStore = /*#__PURE__*/function () {
348
375
  });
349
376
  });
350
377
  }
378
+ }, {
379
+ key: "_handleSetTool",
380
+ value: function _handleSetTool(payload) {
381
+ var _this = this;
382
+ var board = this._boardInstance;
383
+ this.currentTool = 'none';
384
+ var currentTool = (0, _libs.convertTool)(payload);
385
+ if (board) {
386
+ board.setCurrentTool(currentTool);
387
+ var timber = setTimeout(function () {
388
+ var _this$_boardDom4;
389
+ (_this$_boardDom4 = _this._boardDom) === null || _this$_boardDom4 === void 0 || _this$_boardDom4.getBoundingClientRect();
390
+ _this.currentTool = currentTool;
391
+ clearTimeout(timber);
392
+ }, 600);
393
+ }
394
+ }
351
395
  }, {
352
396
  key: "_init",
353
397
  value: function () {
354
- var _init2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(engine) {
398
+ var _init2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(engine) {
355
399
  var _this2 = this;
356
- return _regenerator["default"].wrap(function _callee2$(_context2) {
357
- while (1) switch (_context2.prev = _context2.next) {
400
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
401
+ while (1) switch (_context3.prev = _context3.next) {
358
402
  case 0:
359
403
  engine.login();
360
404
  engine.addObserver({
361
405
  onConnectionStateUpdated: function onConnectionStateUpdated(state) {
362
406
  if (state === _fcrCore.FcrConnectionState.CONNECTED) {
363
407
  _this2._engine = engine;
408
+ _this2.logger.info("[annotation][initEngine]: engine connection state updated => CONNECTED");
364
409
  }
365
410
  if (state === _fcrCore.FcrConnectionState.DISCONNECTED) {
411
+ _this2.logger.info("[annotation][initEngine]: engine connection state updated => DISCONNECTED, the engine is ".concat(_this2._engine));
412
+ !_this2._engine && engine.login();
413
+ }
414
+ if (state === _fcrCore.FcrConnectionState.CONNECTING) {
415
+ _this2.logger.info("[annotation][initEngine]: engine connection state updated => CONNECTING");
416
+ }
417
+ if (state === _fcrCore.FcrConnectionState.RECONNECTING) {
418
+ _this2.logger.info("[annotation][initEngine]: engine connection state updated => RECONNECTING");
419
+ }
420
+ if (state === _fcrCore.FcrConnectionState.ABORTED) {
421
+ _this2.logger.info("[annotation][initEngine]: engine connection state updated => ABORTED, the engine is ".concat(_this2._engine));
366
422
  !_this2._engine && engine.login();
367
423
  }
368
424
  }
369
425
  });
370
426
  case 2:
371
427
  case "end":
372
- return _context2.stop();
428
+ return _context3.stop();
373
429
  }
374
- }, _callee2);
430
+ }, _callee3);
375
431
  }));
376
432
  function _init(_x) {
377
433
  return _init2.apply(this, arguments);
@@ -381,30 +437,30 @@ var AnnotationStore = /*#__PURE__*/function () {
381
437
  }, {
382
438
  key: "_initBoardRoom",
383
439
  value: function () {
384
- var _initBoardRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
440
+ var _initBoardRoom2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
385
441
  var _this3 = this;
386
442
  var _this$_config, userId, boardToken, region, appIdentifier, boardId, nickName, rtmClient, rtmProvider, wbRoom, retriesMax;
387
- return _regenerator["default"].wrap(function _callee5$(_context5) {
388
- while (1) switch (_context5.prev = _context5.next) {
443
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
444
+ while (1) switch (_context6.prev = _context6.next) {
389
445
  case 0:
390
446
  _this$_config = this._config, userId = _this$_config.userId, boardToken = _this$_config.boardToken, region = _this$_config.region, appIdentifier = _this$_config.appIdentifier, boardId = _this$_config.boardId;
391
447
  nickName = localStorage.getItem('annotation_nickname') || '';
392
- this.logger.info("'board room info =>', ".concat(JSON.stringify(this._config), " - ").concat(nickName));
448
+ this.logger.info("[annotation][initBoardRoom]: start init board room with config => ".concat(JSON.stringify(this._config), " - ").concat(nickName));
393
449
  // @ts-ignore
394
450
  rtmClient = this._engine._rteEngine._rtmClient._client;
395
451
  rtmProvider = new _forgeRtm.RTMProvider_2_2(rtmClient);
396
452
  wbRoom = new _forgeRoom.Room(boardId, rtmProvider);
397
453
  this._boardRoom = wbRoom;
398
454
  wbRoom.applicationManager.registerApplication(_forgeWhiteboard.WhiteboardApplication);
399
- this.logger.info("'start join whiteboard room'");
400
- _context5.prev = 9;
455
+ this.logger.info("[annotation][initBoardRoom]: bordRoom instance is created, start join room");
456
+ _context6.prev = 9;
401
457
  retriesMax = 10;
402
- _context5.next = 13;
403
- return (0, _asyncRetry.retryAttempt)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
404
- return _regenerator["default"].wrap(function _callee3$(_context3) {
405
- while (1) switch (_context3.prev = _context3.next) {
458
+ _context6.next = 13;
459
+ return (0, _asyncRetry.retryAttempt)(/*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
460
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
461
+ while (1) switch (_context4.prev = _context4.next) {
406
462
  case 0:
407
- _context3.next = 2;
463
+ _context4.next = 2;
408
464
  return wbRoom.joinRoom({
409
465
  userId: userId,
410
466
  nickName: nickName,
@@ -416,45 +472,48 @@ var AnnotationStore = /*#__PURE__*/function () {
416
472
  }
417
473
  });
418
474
  case 2:
475
+ _this3.logger.info("[annotation][initBoardRoom]: join room success");
476
+ case 3:
419
477
  case "end":
420
- return _context3.stop();
478
+ return _context4.stop();
421
479
  }
422
- }, _callee3);
480
+ }, _callee4);
423
481
  })), [], {
424
482
  retriesMax: retriesMax
425
483
  }).fail(/*#__PURE__*/function () {
426
- var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(_ref3) {
484
+ var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(_ref3) {
427
485
  var error, timeFn, currentRetry;
428
- return _regenerator["default"].wrap(function _callee4$(_context4) {
429
- while (1) switch (_context4.prev = _context4.next) {
486
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
487
+ while (1) switch (_context5.prev = _context5.next) {
430
488
  case 0:
431
489
  error = _ref3.error, timeFn = _ref3.timeFn, currentRetry = _ref3.currentRetry;
432
- _this3.logger.info("retry to join board room, ".concat(error.message, ", retry ").concat(currentRetry, " times"));
433
- _context4.next = 4;
490
+ _this3.logger.info("[annotation][initBoardRoom]: retry to join board room, ".concat(error.message, ", retry ").concat(currentRetry, " times"));
491
+ _context5.next = 4;
434
492
  return timeFn();
435
493
  case 4:
436
- return _context4.abrupt("return", true);
494
+ return _context5.abrupt("return", true);
437
495
  case 5:
438
496
  case "end":
439
- return _context4.stop();
497
+ return _context5.stop();
440
498
  }
441
- }, _callee4);
499
+ }, _callee5);
442
500
  }));
443
501
  return function (_x2) {
444
502
  return _ref4.apply(this, arguments);
445
503
  };
446
504
  }()).exec();
447
505
  case 13:
448
- _context5.next = 17;
506
+ _context6.next = 18;
449
507
  break;
450
508
  case 15:
451
- _context5.prev = 15;
452
- _context5.t0 = _context5["catch"](9);
453
- case 17:
509
+ _context6.prev = 15;
510
+ _context6.t0 = _context6["catch"](9);
511
+ this.logger.error("[annotation][initBoardRoom]: join room failed");
512
+ case 18:
454
513
  case "end":
455
- return _context5.stop();
514
+ return _context6.stop();
456
515
  }
457
- }, _callee5, this, [[9, 15]]);
516
+ }, _callee6, this, [[9, 15]]);
458
517
  }));
459
518
  function _initBoardRoom() {
460
519
  return _initBoardRoom2.apply(this, arguments);
@@ -467,6 +526,7 @@ var AnnotationStore = /*#__PURE__*/function () {
467
526
  var userId = config.userId,
468
527
  token = config.roomToken,
469
528
  appId = config.appId;
529
+ this.logger.info("[annotation][initEngine]: init engine with config => ".concat(JSON.stringify(config)));
470
530
  return new _fcrCore.FcrCoreEngine(_objectSpread({
471
531
  appId: appId,
472
532
  token: token,
@@ -474,12 +534,32 @@ var AnnotationStore = /*#__PURE__*/function () {
474
534
  region: _fcrCore.FcrRegion.CN
475
535
  }, _libs.engineRestConfig));
476
536
  }
537
+ }, {
538
+ key: "_launchHandler",
539
+ value: function _launchHandler(appId, app) {
540
+ if (appId === this._FORGE_WHITEBOARD_APP_ID) {
541
+ var _this$_boardView;
542
+ this.logger.info("[annotation][event]: launch event is triggered => ".concat(app.selfUserId));
543
+ app.view && ((_this$_boardView = this._boardView) === null || _this$_boardView === void 0 ? void 0 : _this$_boardView.appendChild(app.view));
544
+ this._initBoardStyle(app);
545
+ }
546
+ }
547
+ }, {
548
+ key: "_terminalHandler",
549
+ value: function _terminalHandler(appId, app) {
550
+ if (appId === this._FORGE_WHITEBOARD_APP_ID) {
551
+ var _this$_boardView2;
552
+ this.logger.info("[annotation][event]: terminal event is triggered => ".concat(app.selfUserId));
553
+ app.view && this._boardView.hasChildNodes() && ((_this$_boardView2 = this._boardView) === null || _this$_boardView2 === void 0 ? void 0 : _this$_boardView2.removeChild(app.view));
554
+ }
555
+ }
477
556
  }]);
478
557
  }();
479
558
  _AnnotationStore = AnnotationStore;
480
- var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AnnotationStore, [[_mobx.observable, 1, "joined"], [_mobx.observable, 1, "bounds"], [_decorator.bound, 2, "open"], [_handleBoardDomLoadDecs, 18, "handleBoardDomLoad"], [_closeDecs, 18, "close"], [_decorator.bound, 2, "setIgnore"], [_decorator.bound, 2, "toolChanged"], [_decorator.bound, 2, "_setBoardInstance"], [_decorator.bound, 2, "_init"], [_decorator.bound, 2, "_initBoardRoom"]], []).e, 3);
559
+ var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AnnotationStore, [[_mobx.observable, 1, "joined"], [_mobx.observable, 1, "bounds"], [_mobx.observable, 1, "currentTool"], [_decorator.bound, 2, "open"], [_handleBoardDomLoadDecs, 18, "handleBoardDomLoad"], [_closeDecs, 18, "close"], [_decorator.bound, 2, "setIgnore"], [_decorator.bound, 2, "toolChanged"], [_decorator.bound, 2, "_initBoardStyle"], [_handleSetToolDecs, 2, "_handleSetTool"], [_decorator.bound, 2, "_init"], [_decorator.bound, 2, "_initBoardRoom"], [_decorator.bound, 2, "_launchHandler"], [_decorator.bound, 2, "_terminalHandler"]], []).e, 4);
481
560
  _init_joined = _applyDecs$e[0];
482
561
  _init_bounds = _applyDecs$e[1];
483
- _initProto = _applyDecs$e[2];
562
+ _init_currentTool = _applyDecs$e[2];
563
+ _initProto = _applyDecs$e[3];
484
564
  var _default = exports["default"] = AnnotationStore;
485
565
  var AnnotationStoreContext = exports.AnnotationStoreContext = /*#__PURE__*/(0, _react.createContext)(null);
@@ -1,2 +1,3 @@
1
+ import '../../modules/annotation/board-cursor.css';
1
2
  declare const View: () => import("react/jsx-runtime").JSX.Element;
2
3
  export default View;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.define-property.js");
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
@@ -8,16 +9,23 @@ exports["default"] = void 0;
8
9
  var _mobxReact = require("mobx-react");
9
10
  var _react = require("react");
10
11
  var _store = require("./store");
12
+ require("../../modules/annotation/board-cursor.css");
13
+ var _classnames = _interopRequireDefault(require("classnames"));
11
14
  var _jsxRuntime = require("react/jsx-runtime");
12
15
  var View = (0, _mobxReact.observer)(function () {
13
- var store = (0, _react.useContext)(_store.AnnotationStoreContext);
16
+ var _useContext = (0, _react.useContext)(_store.AnnotationStoreContext),
17
+ handleBoardDomLoad = _useContext.handleBoardDomLoad,
18
+ currentTool = _useContext.currentTool;
19
+ var cursorClassname = "board-widget-cursor-".concat(currentTool);
20
+ var boardWidgetAppCls = (0, _classnames["default"])('board-widget-app', cursorClassname.toLowerCase());
14
21
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
22
+ className: boardWidgetAppCls,
15
23
  style: {
16
24
  width: '100vw',
17
25
  height: '100vh',
18
26
  overflow: 'hidden'
19
27
  },
20
- ref: store.handleBoardDomLoad
28
+ ref: handleBoardDomLoad
21
29
  });
22
30
  });
23
31
  var _default = exports["default"] = View;
@@ -151,6 +151,10 @@ html {
151
151
  font-size: 12px;
152
152
  line-height: 12px;
153
153
  padding: 0 8px;
154
+ max-width: 100px;
155
+ white-space: nowrap;
156
+ overflow: hidden;
157
+ text-overflow: ellipsis;
154
158
  }
155
159
 
156
160
  .fcr-action-bar-item-text span {
@@ -48,8 +48,6 @@ export default class ActionBarStore {
48
48
  private _disposers;
49
49
  private _waitingRoomControl?;
50
50
  private _userControl;
51
- private _streamControl;
52
- private _screenVideoTrack;
53
51
  private _sharedLayoutDataSource;
54
52
  private _sharedChatDataSource;
55
53
  private _interpreterProvider?;
@@ -64,11 +62,9 @@ export default class ActionBarStore {
64
62
  private _roomObserver;
65
63
  private _mainRoomObserver;
66
64
  private _uiEventObserver;
67
- private _screenObserver;
68
65
  private _openedDialogIdMap;
69
66
  private _newMessageTooltipTimer;
70
67
  private _hideBarArrowTimer;
71
- private _streamObserver;
72
68
  private _interpreterProviderObserver;
73
69
  accessor newMessageTooltipVisible: boolean;
74
70
  accessor totalWaitingRoomUser: number;
@@ -78,7 +74,6 @@ export default class ActionBarStore {
78
74
  accessor connectionSettingVisible: boolean;
79
75
  accessor folded: boolean;
80
76
  accessor boardOwnerUser: FcrUserInfo | null;
81
- accessor hasScreenShare: boolean;
82
77
  accessor showArrow: boolean;
83
78
  accessor phoneMicEnabled: boolean;
84
79
  accessor chatTabIndex: FcrUIRoomType;
@@ -149,6 +144,7 @@ export default class ActionBarStore {
149
144
  get hasEnableStartSharePermission(): boolean;
150
145
  get hasAllowWriteBoardPermission(): boolean;
151
146
  get hasCloseWriteBoardPermission(): boolean;
147
+ get hasScreenShare(): boolean;
152
148
  get hasAllowScreenShareAndBoardPermission(): boolean;
153
149
  get hasAllowChatPermission(): boolean;
154
150
  get hasStartCloudRecordingPermission(): boolean;
@@ -232,14 +228,12 @@ export default class ActionBarStore {
232
228
  private _handleRemoteUsersLeft;
233
229
  private _handleLiveStreamingStateUpdated;
234
230
  private _handleChatVisible;
235
- private _handlerTraceScreenCaptureStateUpdate;
236
231
  setAllowWaterMark(): void;
237
232
  setWaterMarkLineType(lineType: FcrLineType): void;
238
233
  setAlllowChangeName(enable: boolean): void;
239
234
  private _onEvent;
240
235
  private _operateWaitingRoom;
241
236
  private _handleCloudRecordingStateUpdated;
242
- private _handleStreamsAddedOrUpdated;
243
237
  setOutputLanguage(language: FcrLanguage): Promise<void>;
244
238
  subscribeLanguage(language: FcrUILanguage): Promise<void>;
245
239
  subscribeExtraOriginLanguage(enable: boolean): Promise<void>;