fcr-core 3.8.2 → 3.9.0-alpha
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/chat-connector/type.d.ts +40 -0
- package/lib/{chat-connection → chat-connector}/type.js +1 -1
- package/lib/engine/index.d.ts +10 -11
- package/lib/engine/index.js +63 -72
- package/lib/engine/type.d.ts +96 -0
- package/lib/engine/type.js +5 -0
- package/lib/imports.d.ts +7 -4
- package/lib/imports.js +30 -4
- package/lib/index.d.ts +3 -2
- package/lib/index.js +21 -2
- package/lib/media-control/desktop.js +12 -12
- package/lib/media-control/mobile.js +4 -0
- package/lib/media-control/type.d.ts +32 -33
- package/lib/monitor-control/index.js +3 -3
- package/lib/peer-session/index.js +14 -14
- package/lib/peer-session/type.d.ts +1 -1
- package/lib/plugins/chat/chatroom.js +417 -0
- package/lib/{chat-connection → plugins/chat}/config.d.ts +1 -0
- package/lib/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib/plugins/chat/connector.d.ts +38 -0
- package/lib/{chat-connection/index.js → plugins/chat/connector.js} +181 -61
- package/lib/room-control/ability-control/index.js +5 -4
- package/lib/room-control/ability-control/type.d.ts +5 -1
- package/lib/room-control/ability-control/type.js +4 -0
- package/lib/room-control/chatroom-control/type.d.ts +44 -35
- package/lib/room-control/group-control/index.js +9 -9
- package/lib/room-control/index.js +37 -22
- package/lib/room-control/interpreter-control/index.js +7 -4
- package/lib/room-control/interpreter-control/room.js +3 -3
- package/lib/room-control/interpreter-control/types.d.ts +2 -2
- package/lib/room-control/join-before-host-waitingroom-control/index.js +3 -3
- package/lib/room-control/mainroom-control/index.js +15 -13
- package/lib/room-control/privilege-control/index.js +39 -24
- package/lib/room-control/privilege-control/type.d.ts +15 -15
- package/lib/room-control/room-connector-control/index.js +7 -5
- package/lib/room-control/room-connector-control/type.d.ts +1 -1
- package/lib/room-control/room-control-factory.d.ts +3 -3
- package/lib/room-control/room-control-factory.js +7 -7
- package/lib/room-control/room-session/index.js +17 -15
- package/lib/room-control/room-session/type.d.ts +3 -3
- package/lib/room-control/sharing-control/index.js +13 -7
- package/lib/room-control/stream-control/index.js +18 -16
- package/lib/room-control/stream-control/type.d.ts +5 -5
- package/lib/room-control/stt-control/index.js +38 -31
- package/lib/room-control/type.d.ts +19 -19
- package/lib/room-control/user-control/index.js +20 -22
- package/lib/room-control/user-control/type.d.ts +1 -1
- package/lib/room-control/waitingroom-control/index.js +11 -11
- package/lib/room-control/whiteboard-control-v1/board-window.d.ts +21 -20
- package/lib/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib/room-control/whiteboard-control-v1/index.js +26 -18
- package/lib/room-control/whiteboard-control-v1/type.d.ts +26 -25
- package/lib/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +15 -6
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +4 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +6 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +7 -1
- package/lib/room-control/whiteboard-control-v2/base/index.d.ts +9 -8
- package/lib/room-control/whiteboard-control-v2/base/index.js +84 -42
- package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +16 -15
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib/room-control/whiteboard-control-v2/type.d.ts +17 -17
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +12 -6
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +64 -18
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +2 -2
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +1 -1
- package/lib/room-router/index.js +10 -7
- package/lib/room-router/type.d.ts +1 -1
- package/lib/schema.d.ts +24 -46
- package/lib/schema.js +1 -2
- package/lib/service/api.d.ts +5 -3
- package/lib/service/api.js +17 -12
- package/lib/type.d.ts +64 -45
- package/lib/type.js +76 -11
- package/lib/utilities/abortable-retry.d.ts +38 -0
- package/lib/utilities/abortable-retry.js +61 -0
- package/lib/utilities/dual-video-stream-config.d.ts +6 -0
- package/lib/utilities/dual-video-stream-config.js +25 -0
- package/lib/utilities/error-helpers.d.ts +10 -9
- package/lib/utilities/error-helpers.js +12 -11
- package/lib/utilities/error.d.ts +4 -40
- package/lib/utilities/error.js +20 -77
- package/lib/utilities/join-helper.js +2 -2
- package/lib/utilities/logger.d.ts +2 -2
- package/lib/utilities/logger.js +6 -25
- package/lib/utilities/package-info.d.ts +1 -2
- package/lib/utilities/package-info.js +4 -8
- package/lib/utilities/parameters.js +88 -15
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.d.ts +9 -0
- package/lib/utilities/video-encoder-config.js +109 -0
- package/lib-es/{chat-connection → chat-connector}/type.js +1 -1
- package/lib-es/engine/index.js +46 -56
- package/lib-es/engine/type.js +1 -0
- package/lib-es/imports.js +5 -3
- package/lib-es/index.js +2 -1
- package/lib-es/media-control/desktop.js +12 -12
- package/lib-es/media-control/mobile.js +4 -0
- package/lib-es/monitor-control/index.js +3 -3
- package/lib-es/peer-session/index.js +16 -15
- package/lib-es/plugins/chat/chatroom.js +409 -0
- package/lib-es/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib-es/{chat-connection/index.js → plugins/chat/connector.js} +178 -58
- package/lib-es/room-control/ability-control/index.js +5 -4
- package/lib-es/room-control/ability-control/type.js +4 -0
- package/lib-es/room-control/group-control/index.js +11 -10
- package/lib-es/room-control/index.js +40 -26
- package/lib-es/room-control/interpreter-control/index.js +10 -5
- package/lib-es/room-control/interpreter-control/room.js +3 -3
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -3
- package/lib-es/room-control/mainroom-control/index.js +16 -17
- package/lib-es/room-control/privilege-control/index.js +43 -29
- package/lib-es/room-control/room-connector-control/index.js +9 -6
- package/lib-es/room-control/room-control-factory.js +6 -6
- package/lib-es/room-control/room-session/index.js +21 -22
- package/lib-es/room-control/sharing-control/index.js +13 -7
- package/lib-es/room-control/stream-control/index.js +21 -18
- package/lib-es/room-control/stt-control/index.js +23 -15
- package/lib-es/room-control/user-control/index.js +23 -23
- package/lib-es/room-control/waitingroom-control/index.js +10 -9
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib-es/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib-es/room-control/whiteboard-control-v1/index.js +26 -17
- package/lib-es/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +7 -6
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +86 -42
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +60 -13
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib-es/room-router/index.js +10 -6
- package/lib-es/schema.js +1 -2
- package/lib-es/service/api.js +17 -12
- package/lib-es/type.js +70 -18
- package/lib-es/utilities/abortable-retry.js +54 -0
- package/lib-es/utilities/dual-video-stream-config.js +19 -0
- package/lib-es/utilities/error-helpers.js +13 -12
- package/lib-es/utilities/error.js +9 -75
- package/lib-es/utilities/join-helper.js +4 -3
- package/lib-es/utilities/logger.js +7 -23
- package/lib-es/utilities/package-info.js +4 -6
- package/lib-es/utilities/parameters.js +88 -15
- package/lib-es/utilities/validate-params.js +3 -2
- package/lib-es/utilities/video-encoder-config.js +103 -0
- package/package.json +7 -7
- package/lib/chat-connection/index.d.ts +0 -24
- package/lib/chat-connection/type.d.ts +0 -17
- package/lib/plugins/chatroom.js +0 -454
- package/lib/room-control/chatroom-control/config.d.ts +0 -51
- package/lib/room-control/chatroom-control/config.js +0 -105
- package/lib/utilities/storage.d.ts +0 -8
- package/lib/utilities/storage.js +0 -33
- package/lib-es/plugins/chatroom.js +0 -446
- package/lib-es/room-control/chatroom-control/config.js +0 -100
- package/lib-es/utilities/storage.js +0 -27
- /package/lib/plugins/{chatroom.d.ts → chat/chatroom.d.ts} +0 -0
|
@@ -15,7 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
15
15
|
import "core-js/modules/esnext.map.some.js";
|
|
16
16
|
import "core-js/modules/esnext.map.update.js";
|
|
17
17
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
18
|
-
let _initProto;
|
|
18
|
+
let _initProto, _cleanDecs, _setToolTypeDecs, _setStrokeWidthDecs, _setStrokeColorDecs, _setTextColorDecs, _setTextSizeDecs, _setFillColorDecs, _setEraserSizeDecs, _setBackgroundColorDecs, _insertImageDecs, _insertMediaDecs, _mountDecs;
|
|
19
19
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
20
20
|
import "core-js/modules/esnext.iterator.map.js";
|
|
21
21
|
import "core-js/modules/web.url-search-params.delete.js";
|
|
@@ -42,13 +42,14 @@ import { FcrBoardSubWindowImpl } from './board-subwindow';
|
|
|
42
42
|
import fullWorkerString from '@netless/appliance-plugin/dist/fullWorker.js?raw';
|
|
43
43
|
//@ts-ignore
|
|
44
44
|
import subWorkerString from '@netless/appliance-plugin/dist/subWorker.js?raw';
|
|
45
|
+
import { FcrReturnCode } from '../../type';
|
|
45
46
|
import { isPlainObject } from 'lodash';
|
|
46
47
|
import { jsonstring } from 'agora-rte-sdk/lib/imports';
|
|
47
48
|
export class FcrBoardMainWindowImpl {
|
|
48
49
|
static {
|
|
49
|
-
[_initProto] = _applyDecs(this, [[[bound, trace], 2, "getSnapshotImage"], [trace, 2, "addObserver"], [trace, 2, "removeObserver"], [trace, 2, "getContentView"], [bound, 2, "setScale"], [bound, 2, "openSubWindowWithTaskId"], [bound, 2, "openSubWindowWithPageList"], [trace, 2, "getPageInfo"], [[bound, trace], 2, "addPage"], [[bound, trace], 2, "removePage"], [trace, 2, "prevPage"], [trace, 2, "nextPage"], [[bound, trace], 2, "undo"], [[bound, trace], 2, "redo"], [
|
|
50
|
+
[_initProto] = _applyDecs(this, [[[bound, trace], 2, "getSnapshotImage"], [trace, 2, "addObserver"], [trace, 2, "removeObserver"], [trace, 2, "getContentView"], [bound, 2, "setScale"], [bound, 2, "openSubWindowWithTaskId"], [bound, 2, "openSubWindowWithPageList"], [trace, 2, "getPageInfo"], [[bound, trace], 2, "addPage"], [[bound, trace], 2, "removePage"], [trace, 2, "prevPage"], [trace, 2, "nextPage"], [[bound, trace], 2, "undo"], [[bound, trace], 2, "redo"], [_cleanDecs, 2, "clean"], [_setToolTypeDecs, 2, "setToolType"], [_setStrokeWidthDecs, 2, "setStrokeWidth"], [_setStrokeColorDecs, 2, "setStrokeColor"], [_setTextColorDecs, 2, "setTextColor"], [_setTextSizeDecs, 2, "setTextSize"], [_setFillColorDecs, 2, "setFillColor"], [_setEraserSizeDecs, 2, "setEraserSize"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [_insertImageDecs, 2, "insertImage"], [_insertMediaDecs, 2, "insertMedia"], [trace, 2, "destroy"], [trace, 2, "getWritable"], [_mountDecs, 2, "_mount"], [trace, 2, "_setRoom"]], []).e;
|
|
50
51
|
}
|
|
51
|
-
logger = (_initProto(this), createLogger({
|
|
52
|
+
[(_cleanDecs = [bound, trace(['retainPpt'])], _setToolTypeDecs = [bound, trace(['type'])], _setStrokeWidthDecs = [bound, trace(['strokeWidth'])], _setStrokeColorDecs = [bound, trace(['color'])], _setTextColorDecs = [bound, trace(['color'])], _setTextSizeDecs = [bound, trace(['size'])], _setFillColorDecs = [bound, trace(['fillColor'])], _setEraserSizeDecs = [bound, trace(['size'])], _setBackgroundColorDecs = [bound, trace(['color'])], _insertImageDecs = [bound, trace(['resourceUrl', 'x', 'y', 'width', 'height'])], _insertMediaDecs = [bound, trace(['resourceUrl', 'title'])], _mountDecs = trace(['options', 'params']), "logger")] = (_initProto(this), createLogger({
|
|
52
53
|
prefix: 'FcrBoardMainWindowImpl'
|
|
53
54
|
}));
|
|
54
55
|
_memberState = {};
|
|
@@ -92,7 +93,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
92
93
|
return result;
|
|
93
94
|
}
|
|
94
95
|
} catch (e) {
|
|
95
|
-
this.logger.error('
|
|
96
|
+
this.logger.error('failed to take snapshot', e);
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
}
|
|
@@ -100,9 +101,11 @@ export class FcrBoardMainWindowImpl {
|
|
|
100
101
|
}
|
|
101
102
|
addObserver(observer) {
|
|
102
103
|
this._observable.addObserver(observer);
|
|
104
|
+
return FcrReturnCode.SUCCESS;
|
|
103
105
|
}
|
|
104
106
|
removeObserver(observer) {
|
|
105
107
|
this._observable.removeObserver(observer);
|
|
108
|
+
return FcrReturnCode.SUCCESS;
|
|
106
109
|
}
|
|
107
110
|
getContentView() {
|
|
108
111
|
return this._whiteView;
|
|
@@ -163,36 +166,40 @@ export class FcrBoardMainWindowImpl {
|
|
|
163
166
|
await this._windowManager.addPage();
|
|
164
167
|
await this._windowManager.nextPage();
|
|
165
168
|
}
|
|
169
|
+
return FcrReturnCode.SUCCESS;
|
|
166
170
|
}
|
|
167
171
|
async removePage() {
|
|
168
172
|
this._preCheck();
|
|
169
173
|
if (this._windowManager?.removePage) {
|
|
170
174
|
await this._windowManager.removePage();
|
|
171
175
|
}
|
|
176
|
+
return FcrReturnCode.SUCCESS;
|
|
172
177
|
}
|
|
173
178
|
async prevPage() {
|
|
174
179
|
this._preCheck();
|
|
175
180
|
if (this._windowManager?.prevPage) {
|
|
176
181
|
await this._windowManager.prevPage();
|
|
177
182
|
}
|
|
183
|
+
return FcrReturnCode.SUCCESS;
|
|
178
184
|
}
|
|
179
185
|
async nextPage() {
|
|
180
186
|
this._preCheck();
|
|
181
187
|
if (this._windowManager?.nextPage) {
|
|
182
188
|
await this._windowManager.nextPage();
|
|
183
189
|
}
|
|
190
|
+
return FcrReturnCode.SUCCESS;
|
|
184
191
|
}
|
|
185
192
|
async undo() {
|
|
186
193
|
this._preCheck({
|
|
187
194
|
wm: false
|
|
188
195
|
});
|
|
189
|
-
this._whiteBoardroom.undo();
|
|
196
|
+
return this._whiteBoardroom.undo();
|
|
190
197
|
}
|
|
191
198
|
async redo() {
|
|
192
199
|
this._preCheck({
|
|
193
200
|
wm: false
|
|
194
201
|
});
|
|
195
|
-
this._whiteBoardroom.redo();
|
|
202
|
+
return this._whiteBoardroom.redo();
|
|
196
203
|
}
|
|
197
204
|
async clean(retainPpt) {
|
|
198
205
|
this._preCheck({
|
|
@@ -200,6 +207,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
200
207
|
});
|
|
201
208
|
// this._whiteBoardroom?.cleanScene?.(true); // new version methods
|
|
202
209
|
this._whiteBoardroom.cleanCurrentScene(retainPpt);
|
|
210
|
+
return FcrReturnCode.SUCCESS;
|
|
203
211
|
}
|
|
204
212
|
async setToolType(type) {
|
|
205
213
|
this._preCheck({
|
|
@@ -219,6 +227,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
219
227
|
if (this._windowManager) {
|
|
220
228
|
this._appliancePluginInstance?.setMemberState(change);
|
|
221
229
|
}
|
|
230
|
+
return FcrReturnCode.SUCCESS;
|
|
222
231
|
}
|
|
223
232
|
async setStrokeWidth(strokeWidth) {
|
|
224
233
|
this._preCheck();
|
|
@@ -232,6 +241,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
232
241
|
if (this._windowManager) {
|
|
233
242
|
this._whiteBoardroom.setMemberState(change);
|
|
234
243
|
}
|
|
244
|
+
return FcrReturnCode.SUCCESS;
|
|
235
245
|
}
|
|
236
246
|
async setStrokeColor(color) {
|
|
237
247
|
this._preCheck();
|
|
@@ -246,6 +256,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
246
256
|
if (this._windowManager) {
|
|
247
257
|
this._whiteBoardroom.setMemberState(change);
|
|
248
258
|
}
|
|
259
|
+
return FcrReturnCode.SUCCESS;
|
|
249
260
|
}
|
|
250
261
|
async setTextColor(color) {
|
|
251
262
|
this._preCheck();
|
|
@@ -260,6 +271,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
260
271
|
if (this._windowManager) {
|
|
261
272
|
this._whiteBoardroom.setMemberState(change);
|
|
262
273
|
}
|
|
274
|
+
return FcrReturnCode.SUCCESS;
|
|
263
275
|
}
|
|
264
276
|
async setTextSize(size) {
|
|
265
277
|
this._preCheck();
|
|
@@ -273,6 +285,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
273
285
|
if (this._windowManager) {
|
|
274
286
|
this._whiteBoardroom.setMemberState(change);
|
|
275
287
|
}
|
|
288
|
+
return FcrReturnCode.SUCCESS;
|
|
276
289
|
}
|
|
277
290
|
async setFillColor(fillColor) {
|
|
278
291
|
this._preCheck();
|
|
@@ -287,6 +300,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
287
300
|
if (this._windowManager) {
|
|
288
301
|
this._whiteBoardroom.setMemberState(change);
|
|
289
302
|
}
|
|
303
|
+
return FcrReturnCode.SUCCESS;
|
|
290
304
|
}
|
|
291
305
|
async setEraserSize(size) {
|
|
292
306
|
this._preCheck();
|
|
@@ -300,11 +314,13 @@ export class FcrBoardMainWindowImpl {
|
|
|
300
314
|
if (this._windowManager) {
|
|
301
315
|
this._whiteBoardroom.setMemberState(change);
|
|
302
316
|
}
|
|
317
|
+
return FcrReturnCode.SUCCESS;
|
|
303
318
|
}
|
|
304
319
|
async setBackgroundColor(color) {
|
|
305
320
|
this._preCheck();
|
|
306
321
|
this._backgroundColor = color;
|
|
307
322
|
this._whiteView.querySelector('.netless-whiteboard')?.style.setProperty('background-color', color);
|
|
323
|
+
return FcrReturnCode.SUCCESS;
|
|
308
324
|
}
|
|
309
325
|
async insertImage(resourceUrl, x, y, width, height) {
|
|
310
326
|
const room = this._whiteBoardroom;
|
|
@@ -348,6 +364,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
348
364
|
room.insertImage(imageInfo);
|
|
349
365
|
room.completeImageUpload(uuid, resourceUrl);
|
|
350
366
|
}
|
|
367
|
+
return FcrReturnCode.SUCCESS;
|
|
351
368
|
}
|
|
352
369
|
async insertMedia(resourceUrl, title) {
|
|
353
370
|
const windowManager = this._windowManager;
|
|
@@ -364,6 +381,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
364
381
|
}
|
|
365
382
|
});
|
|
366
383
|
}
|
|
384
|
+
return FcrReturnCode.SUCCESS;
|
|
367
385
|
}
|
|
368
386
|
destroy() {
|
|
369
387
|
if (this._windowManager) {
|
|
@@ -371,6 +389,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
371
389
|
this._windowManager = undefined;
|
|
372
390
|
}
|
|
373
391
|
this._destroyed = true;
|
|
392
|
+
return FcrReturnCode.SUCCESS;
|
|
374
393
|
}
|
|
375
394
|
getWritable() {
|
|
376
395
|
return this._whiteBoardroom.isWritable;
|
|
@@ -524,7 +543,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
524
543
|
});
|
|
525
544
|
}
|
|
526
545
|
}).catch(e => {
|
|
527
|
-
this.logger.error('
|
|
546
|
+
this.logger.error('failed to mount', e);
|
|
528
547
|
}).finally(() => {
|
|
529
548
|
this.logger.info('[FcrBoardMainWindow] finish mount board window, white room id:', this._whiteBoardroom.uuid);
|
|
530
549
|
BoardMountManager.setIsMounting(false);
|
|
@@ -549,6 +568,6 @@ export class FcrBoardMainWindowImpl {
|
|
|
549
568
|
room.setMemberState(this._memberState);
|
|
550
569
|
}
|
|
551
570
|
_addLogObserver() {
|
|
552
|
-
this.addObserver(generateLogObserver(this.logger, ['onWritable', 'onPageInfoUpdated', 'onUndoStateUpdated', 'onRedoStateUpdated']));
|
|
571
|
+
this.addObserver(generateLogObserver(this.logger, [['onWritable', ['isWritable']], ['onPageInfoUpdated', ['info']], ['onUndoStateUpdated', ['enable']], ['onRedoStateUpdated', ['enable']]]));
|
|
553
572
|
}
|
|
554
573
|
}
|
|
@@ -6,7 +6,7 @@ export class FcrWhiteboardControlFactoryImpl {
|
|
|
6
6
|
});
|
|
7
7
|
constructor() {}
|
|
8
8
|
createForMainProcess(hasOperationPrivilege, scene, api, sharedCache) {
|
|
9
|
-
this.logger.info('
|
|
9
|
+
this.logger.info('create for main process, use old whiteboard control');
|
|
10
10
|
return new FcrWhiteboardControlImpl(scene, api, sharedCache, hasOperationPrivilege);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -15,7 +15,7 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
15
15
|
import "core-js/modules/esnext.map.some.js";
|
|
16
16
|
import "core-js/modules/esnext.map.update.js";
|
|
17
17
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
18
|
-
let _initProto;
|
|
18
|
+
let _initProto, _openDecs, _setBackgroundColorDecs, _setOperationPrivilegeDecs, _setBoardWritableDecs;
|
|
19
19
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
20
20
|
import "core-js/modules/esnext.iterator.map.js";
|
|
21
21
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
@@ -24,31 +24,33 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
24
24
|
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
25
25
|
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; }
|
|
26
26
|
import SlideApp from '@netless/app-slide';
|
|
27
|
-
import {
|
|
27
|
+
import { ApplianceMultiPlugin } from '@netless/appliance-plugin';
|
|
28
28
|
import * as netlessVideoPlugin from '@netless/video-js-plugin';
|
|
29
29
|
import { WindowManager } from '@netless/window-manager';
|
|
30
|
-
import { ApplianceMultiPlugin } from '@netless/appliance-plugin';
|
|
31
|
-
import { convertToFcrBoardToolShape, hexColorToWhiteboardColor, textColors } from './utils';
|
|
32
|
-
import { AgoraObservable } from 'agora-foundation/lib/utilities/observable';
|
|
33
|
-
import { FcrBoardMainWindowImpl } from './board-window';
|
|
34
|
-
import { FcrBoardPropertiesState } from '../whiteboard-control/type';
|
|
35
30
|
import { bound } from 'agora-foundation/lib/decorator';
|
|
36
|
-
import {
|
|
31
|
+
import { ErrorModuleCode } from '../../imports';
|
|
32
|
+
import { AgoraObservable } from 'agora-foundation/lib/utilities/observable';
|
|
33
|
+
import { sleep } from 'agora-rte-sdk/lib/imports';
|
|
34
|
+
import { DeviceType, LoggerReportMode, RoomPhase, ViewMode, WhiteWebSdk, createPlugins } from 'white-web-sdk';
|
|
37
35
|
import { FcrConnectionState } from '../..';
|
|
38
|
-
import { createLogger, generateLogObserver } from '../../utilities/logger';
|
|
39
36
|
import { trace } from '../../imports';
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
37
|
+
import { FcrReturnCode } from '../../type';
|
|
38
|
+
import { handleRequestError } from '../../utilities/error';
|
|
39
|
+
import { createLogger, generateLogObserver } from '../../utilities/logger';
|
|
40
|
+
import { convertRteUserToFcrUser } from '../../utilities/user';
|
|
42
41
|
import { FcrSharePermissionState } from '../sharing-control/type';
|
|
42
|
+
import { FcrBoardPropertiesState } from '../whiteboard-control/type';
|
|
43
|
+
import { FcrBoardMainWindowImpl } from './board-window';
|
|
44
|
+
import { convertToFcrBoardToolShape, hexColorToWhiteboardColor, textColors } from './utils';
|
|
43
45
|
|
|
44
46
|
/**
|
|
45
47
|
* @internal
|
|
46
48
|
*/
|
|
47
49
|
export class FcrWhiteboardControlImpl {
|
|
48
50
|
static {
|
|
49
|
-
[_initProto] = _applyDecs(this, [[[bound, trace], 2, "active"], [[bound, trace], 2, "inactive"], [
|
|
51
|
+
[_initProto] = _applyDecs(this, [[[bound, trace], 2, "active"], [[bound, trace], 2, "inactive"], [_openDecs, 2, "open"], [[bound, trace], 2, "close"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [[bound, trace], 2, "getActivity"], [[bound, trace], 2, "getOwnerId"], [[bound, trace], 2, "getBackgroundColor"], [[bound, trace], 2, "getConnectionState"], [[bound, trace], 2, "getMainWindow"], [[bound, trace], 2, "addObserver"], [[bound, trace], 2, "removeObserver"], [[bound, trace], 2, "getBoardActiveInfo"], [[bound, trace], 2, "hasOperationPrivilege"], [_setOperationPrivilegeDecs, 2, "setOperationPrivilege"], [_setBoardWritableDecs, 2, "_setBoardWritable"], [bound, 2, "_getToken"], [bound, 2, "_handleRoomStateUpdated"], [bound, 2, "_updateConnnectionState"], [bound, 2, "_handleConnectionStateUpdated"], [trace, 2, "_connect"], [trace, 2, "_clean"]], []).e;
|
|
50
52
|
}
|
|
51
|
-
logger = (_initProto(this), createLogger({
|
|
53
|
+
[(_openDecs = [bound, trace(['params'])], _setBackgroundColorDecs = [bound, trace(['backgroundColor'])], _setOperationPrivilegeDecs = [bound, trace(['hasPrivilege'])], _setBoardWritableDecs = trace(['granted']), "logger")] = (_initProto(this), createLogger({
|
|
52
54
|
prefix: 'FcrWhiteboardControlImpl'
|
|
53
55
|
}));
|
|
54
56
|
_client = {};
|
|
@@ -99,10 +101,10 @@ export class FcrWhiteboardControlImpl {
|
|
|
99
101
|
});
|
|
100
102
|
}
|
|
101
103
|
async active() {
|
|
102
|
-
return handleRequestError(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, FcrSharePermissionState.ON),
|
|
104
|
+
return handleRequestError(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, FcrSharePermissionState.ON), ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'active failed');
|
|
103
105
|
}
|
|
104
106
|
async inactive() {
|
|
105
|
-
return handleRequestError(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, FcrSharePermissionState.OFF),
|
|
107
|
+
return handleRequestError(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, FcrSharePermissionState.OFF), ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'inactive failed');
|
|
106
108
|
}
|
|
107
109
|
async open(params = {}) {
|
|
108
110
|
this._whiteboardPrivateParameters = params;
|
|
@@ -118,12 +120,14 @@ export class FcrWhiteboardControlImpl {
|
|
|
118
120
|
async close() {
|
|
119
121
|
this._joined = false;
|
|
120
122
|
await this._clean();
|
|
123
|
+
return FcrReturnCode.SUCCESS;
|
|
121
124
|
}
|
|
122
125
|
async setBackgroundColor(backgroundColor) {
|
|
123
126
|
await this._api.setBackgroundColor({
|
|
124
127
|
roomId: this._scene.sceneId,
|
|
125
128
|
backgroundColor
|
|
126
129
|
});
|
|
130
|
+
return FcrReturnCode.SUCCESS;
|
|
127
131
|
}
|
|
128
132
|
getActivity() {
|
|
129
133
|
return this._scene.getScenePropertiesByKeyPath('widgets.netlessBoard').state === 1;
|
|
@@ -142,9 +146,11 @@ export class FcrWhiteboardControlImpl {
|
|
|
142
146
|
}
|
|
143
147
|
addObserver(observer) {
|
|
144
148
|
this._observable.addObserver(observer);
|
|
149
|
+
return FcrReturnCode.SUCCESS;
|
|
145
150
|
}
|
|
146
151
|
removeObserver(observer) {
|
|
147
152
|
this._observable.removeObserver(observer);
|
|
153
|
+
return FcrReturnCode.SUCCESS;
|
|
148
154
|
}
|
|
149
155
|
getBoardActiveInfo() {
|
|
150
156
|
const {
|
|
@@ -174,6 +180,7 @@ export class FcrWhiteboardControlImpl {
|
|
|
174
180
|
this._hasOperationPrivilege = hasPrivilege;
|
|
175
181
|
this._setBoardWritable(hasPrivilege);
|
|
176
182
|
}
|
|
183
|
+
return FcrReturnCode.SUCCESS;
|
|
177
184
|
}
|
|
178
185
|
async _setBoardWritable(granted) {
|
|
179
186
|
if (this._room) {
|
|
@@ -202,6 +209,7 @@ export class FcrWhiteboardControlImpl {
|
|
|
202
209
|
}
|
|
203
210
|
}
|
|
204
211
|
}
|
|
212
|
+
return FcrReturnCode.SUCCESS;
|
|
205
213
|
}
|
|
206
214
|
_createPlugins() {
|
|
207
215
|
const plugins = createPlugins({
|
|
@@ -217,7 +225,7 @@ export class FcrWhiteboardControlImpl {
|
|
|
217
225
|
return await handleRequestError(() => this._api.getWhiteboardToken({
|
|
218
226
|
roomId,
|
|
219
227
|
userId
|
|
220
|
-
}),
|
|
228
|
+
}), ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'get whiteboard token failed');
|
|
221
229
|
}
|
|
222
230
|
_handleRoomStateUpdated(state) {
|
|
223
231
|
const {
|
|
@@ -411,8 +419,9 @@ export class FcrWhiteboardControlImpl {
|
|
|
411
419
|
}
|
|
412
420
|
this._room = undefined;
|
|
413
421
|
}
|
|
422
|
+
return FcrReturnCode.SUCCESS;
|
|
414
423
|
}
|
|
415
424
|
_addLogObserver() {
|
|
416
|
-
this.addObserver(generateLogObserver(this.logger, ['onActive', 'onInactive', 'onBackgroundColorUpdated', 'onConnectionStateUpdated']));
|
|
425
|
+
this.addObserver(generateLogObserver(this.logger, [['onActive', ['ownerId', 'operatorUser']], ['onInactive', ['reason', 'operatorUser']], ['onBackgroundColorUpdated', ['color', 'operatorUser']], ['onConnectionStateUpdated', ['state']]]));
|
|
417
426
|
}
|
|
418
427
|
}
|
|
@@ -3,5 +3,6 @@ export let FcrBoardEraserSize = /*#__PURE__*/function (FcrBoardEraserSize) {
|
|
|
3
3
|
FcrBoardEraserSize[FcrBoardEraserSize["SMALL"] = 1] = "SMALL";
|
|
4
4
|
FcrBoardEraserSize[FcrBoardEraserSize["MEDIUM"] = 2] = "MEDIUM";
|
|
5
5
|
FcrBoardEraserSize[FcrBoardEraserSize["LARGE"] = 3] = "LARGE";
|
|
6
|
+
FcrBoardEraserSize[FcrBoardEraserSize["GIANT"] = 4] = "GIANT";
|
|
6
7
|
return FcrBoardEraserSize;
|
|
7
8
|
}({});
|
|
@@ -1,23 +1,45 @@
|
|
|
1
|
+
import { FcrErrorCode, FcrErrorModuleCode, generateFcrCoreClientError } from '../../../utilities/error';
|
|
1
2
|
import { createLogger } from '../../../utilities/logger';
|
|
2
3
|
import { FcrBaseWhiteboardControlImpl } from '../base';
|
|
3
4
|
import { ANNOTATION_APP_ID } from '../constant';
|
|
5
|
+
import { FcrBoardPropertiesState } from '../../whiteboard-control/type';
|
|
4
6
|
export class FcrAnnotationControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
5
7
|
logger = createLogger({
|
|
6
8
|
prefix: 'FcrAnnotationControlImpl'
|
|
7
9
|
});
|
|
8
|
-
constructor(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher) {
|
|
10
|
+
constructor(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher, _sceneConfig, _api) {
|
|
9
11
|
super(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher);
|
|
10
12
|
this.rtmClient = rtmClient;
|
|
11
13
|
this.config = config;
|
|
14
|
+
this._sceneConfig = _sceneConfig;
|
|
15
|
+
this._api = _api;
|
|
12
16
|
this.logger.info(`initialized, hasOperationPrivilege: ${hasOperationPrivilege}`);
|
|
13
17
|
}
|
|
18
|
+
async syncScreenShareOwnerAnnotationOpenDone() {
|
|
19
|
+
try {
|
|
20
|
+
await this._api.syncScreenShareOwnerAnnotationOpenDone(this._sceneConfig.sceneId);
|
|
21
|
+
return 0;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
const error = e;
|
|
24
|
+
const errorMessage = error.message;
|
|
25
|
+
throw generateFcrCoreClientError(FcrErrorModuleCode.FCR_ROOM_WHITEBOARD, FcrErrorCode.LOCAL_HTTP_REQUEST_FAILED, `sync screen share owner annotation open done failed: ${errorMessage}`, error);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async open() {
|
|
29
|
+
const state = this._sceneConfig.getAnnotationState();
|
|
30
|
+
if (state === FcrBoardPropertiesState.INACTIVE) {
|
|
31
|
+
return await super.internalOpen(true);
|
|
32
|
+
} else {
|
|
33
|
+
return await super.internalOpen(false);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
14
36
|
getApplicationId() {
|
|
15
37
|
return ANNOTATION_APP_ID;
|
|
16
38
|
}
|
|
17
39
|
getWhiteboardOption() {
|
|
18
40
|
return {
|
|
19
|
-
width:
|
|
20
|
-
height:
|
|
41
|
+
width: this.config.size.width,
|
|
42
|
+
height: this.config.size.height,
|
|
21
43
|
defaultToolbarStyle: {
|
|
22
44
|
tool: 'laser'
|
|
23
45
|
},
|
|
@@ -26,13 +48,25 @@ export class FcrAnnotationControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
|
26
48
|
}
|
|
27
49
|
}
|
|
28
50
|
export class FcrStandaloneAnnotationControlImpl extends FcrBaseWhiteboardControlImpl {
|
|
51
|
+
logger = createLogger({
|
|
52
|
+
prefix: 'FcrStandaloneAnnotationControlImpl'
|
|
53
|
+
});
|
|
54
|
+
constructor(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher) {
|
|
55
|
+
super(rtmClient, config, hasOperationPrivilege, forgeInitConfigFetcher);
|
|
56
|
+
this.rtmClient = rtmClient;
|
|
57
|
+
this.config = config;
|
|
58
|
+
this.logger.info(`initialized, hasOperationPrivilege: ${hasOperationPrivilege}`);
|
|
59
|
+
}
|
|
60
|
+
async open() {
|
|
61
|
+
return await super.internalOpen(true);
|
|
62
|
+
}
|
|
29
63
|
getApplicationId() {
|
|
30
64
|
return ANNOTATION_APP_ID;
|
|
31
65
|
}
|
|
32
66
|
getWhiteboardOption() {
|
|
33
67
|
return {
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
68
|
+
width: this.config.size.width,
|
|
69
|
+
height: this.config.size.height,
|
|
36
70
|
defaultToolbarStyle: {
|
|
37
71
|
tool: 'laser'
|
|
38
72
|
},
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import "core-js/modules/es.json.stringify.js";
|
|
2
2
|
import { FcrAnnotationControlImpl, FcrStandaloneAnnotationControlImpl } from './control';
|
|
3
3
|
import { createLogger } from '../../../utilities/logger';
|
|
4
|
-
import {
|
|
4
|
+
import { generateFcrCoreClientError, handleRequestError } from '../../../utilities/error';
|
|
5
5
|
import { getAnnotationBoardOptions } from '../../../utilities/shared-storage';
|
|
6
|
+
import { DetailErrorCode, ErrorModuleCode } from '../../../imports';
|
|
6
7
|
export class FcrAnnotationControlFactoryImpl {
|
|
7
8
|
logger = createLogger({
|
|
8
9
|
prefix: 'FcrAnnotationControlFactory'
|
|
9
10
|
});
|
|
10
11
|
createForSubProcess(rtmClient, hasOperationPrivilege, config) {
|
|
11
|
-
this.logger.info(`
|
|
12
|
+
this.logger.info(`create for sub process with config: ${JSON.stringify(config)}`);
|
|
12
13
|
return new FcrStandaloneAnnotationControlImpl(rtmClient, config, hasOperationPrivilege, () => {
|
|
13
14
|
const forgeInitConfig = getAnnotationBoardOptions();
|
|
14
15
|
if (!forgeInitConfig) {
|
|
15
|
-
throw generateFcrCoreClientError(
|
|
16
|
+
throw generateFcrCoreClientError(ErrorModuleCode.FCR_ROOM_WHITEBOARD, DetailErrorCode.UNDEFINED_ERROR, `whiteboard init config is not exist`, new Error(`whiteboard init config is not exist`));
|
|
16
17
|
}
|
|
17
18
|
return Promise.resolve(forgeInitConfig);
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
createForMainProcess(rtmClient, hasOperationPrivilege, config, api) {
|
|
21
|
-
const control = new FcrAnnotationControlImpl(rtmClient, config, hasOperationPrivilege, this._createForgeInitConfigFetcher(api, config.roomId, config.userId));
|
|
21
|
+
createForMainProcess(rtmClient, hasOperationPrivilege, config, annotationSceneConfig, api) {
|
|
22
|
+
const control = new FcrAnnotationControlImpl(rtmClient, config, hasOperationPrivilege, this._createForgeInitConfigFetcher(api, config.roomId, config.userId), annotationSceneConfig, api);
|
|
22
23
|
return control;
|
|
23
24
|
}
|
|
24
25
|
_createForgeInitConfigFetcher(api, roomId, userId) {
|
|
@@ -26,7 +27,7 @@ export class FcrAnnotationControlFactoryImpl {
|
|
|
26
27
|
return await handleRequestError(() => api.getAnnotationToken({
|
|
27
28
|
roomId,
|
|
28
29
|
userId
|
|
29
|
-
}),
|
|
30
|
+
}), ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'get annotation token failed');
|
|
30
31
|
};
|
|
31
32
|
return async () => {
|
|
32
33
|
const response = await getObjectInitConfig(roomId, userId);
|