fcr-core 3.10.2 → 3.10.5
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/engine/index.js +102 -108
- package/lib/imports.js +1 -0
- package/lib/media-control/desktop.js +22 -13
- package/lib/media-control/mobile.js +27 -19
- package/lib/media-control/type.d.ts +3 -3
- package/lib/monitor-control/index.js +17 -7
- package/lib/peer-session/index.js +120 -121
- package/lib/plugins/chat/chatroom.js +119 -96
- package/lib/plugins/chat/connector.js +69 -48
- package/lib/remote-control/index.js +194 -216
- package/lib/room-control/ability-control/index.js +20 -10
- package/lib/room-control/application-control/index.js +82 -75
- package/lib/room-control/group-control/index.js +31 -30
- package/lib/room-control/helpers/board-init-info-helper.js +16 -10
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +70 -51
- package/lib/room-control/infinity-room-control/index.js +27 -19
- package/lib/room-control/interpreter-control/index.js +77 -65
- package/lib/room-control/interpreter-control/room.js +6 -4
- package/lib/room-control/join-before-host-waitingroom-control/index.js +6 -4
- package/lib/room-control/mainroom-control/index.js +37 -25
- package/lib/room-control/privilege-control/helper.js +28 -13
- package/lib/room-control/privilege-control/index.js +36 -28
- package/lib/room-control/room-connector-control/index.js +52 -49
- package/lib/room-control/room-connector-control/type.d.ts +1 -1
- package/lib/room-control/room-control-factory.js +10 -12
- package/lib/room-control/room-session/index.js +77 -74
- package/lib/room-control/shared-cache.js +63 -56
- package/lib/room-control/sharing-control/index.js +65 -57
- package/lib/room-control/stream-control/index.js +197 -193
- package/lib/room-control/stt-control/de-compress-gzip.js +10 -0
- package/lib/room-control/stt-control/index.js +93 -86
- package/lib/room-control/user-control/index.js +162 -155
- package/lib/room-control/waitingroom-control/index.js +18 -9
- package/lib/room-control/whiteboard-control/utils.js +4 -2
- package/lib/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
- package/lib/room-control/whiteboard-control-v1/board-window.js +120 -103
- package/lib/room-control/whiteboard-control-v1/factory.js +7 -4
- package/lib/room-control/whiteboard-control-v1/index.js +80 -67
- package/lib/room-control/whiteboard-control-v1/mount-manager.js +4 -2
- package/lib/room-control/whiteboard-control-v1/utils.js +17 -14
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +14 -10
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +17 -8
- package/lib/room-control/whiteboard-control-v2/base/index.js +61 -53
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +39 -30
- package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +27 -11
- package/lib/room-control/widget-control/index.js +43 -33
- package/lib/room-router/index.js +66 -58
- package/lib/schema.d.ts +15 -15
- package/lib/service/api.js +446 -548
- package/lib/struct.js +5 -2
- package/lib/utilities/abortable-retry.js +3 -0
- package/lib/utilities/collection.js +15 -11
- package/lib/utilities/error-helpers.js +34 -27
- package/lib/utilities/error.js +4 -3
- package/lib/utilities/join-helper.js +37 -31
- package/lib/utilities/logger.js +8 -5
- package/lib/utilities/parameters.js +21 -10
- package/lib/utilities/retry-helpers.js +1 -0
- package/lib/utilities/stream.js +16 -11
- package/lib/utilities/user.js +4 -3
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.js +10 -5
- package/lib-es/engine/index.js +102 -108
- package/lib-es/media-control/desktop.js +22 -13
- package/lib-es/media-control/mobile.js +27 -19
- package/lib-es/monitor-control/index.js +16 -7
- package/lib-es/peer-session/index.js +120 -121
- package/lib-es/plugins/chat/chatroom.js +118 -95
- package/lib-es/plugins/chat/connector.js +67 -47
- package/lib-es/remote-control/index.js +194 -216
- package/lib-es/room-control/ability-control/index.js +19 -10
- package/lib-es/room-control/application-control/index.js +81 -75
- package/lib-es/room-control/group-control/index.js +31 -30
- package/lib-es/room-control/helpers/board-init-info-helper.js +15 -10
- package/lib-es/room-control/helpers/validation-helper.js +1 -1
- package/lib-es/room-control/index.js +69 -51
- package/lib-es/room-control/infinity-room-control/index.js +26 -19
- package/lib-es/room-control/interpreter-control/index.js +77 -65
- package/lib-es/room-control/interpreter-control/room.js +5 -4
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +5 -4
- package/lib-es/room-control/mainroom-control/index.js +37 -25
- package/lib-es/room-control/privilege-control/helper.js +27 -13
- package/lib-es/room-control/privilege-control/index.js +36 -28
- package/lib-es/room-control/room-connector-control/index.js +52 -49
- package/lib-es/room-control/room-control-factory.js +10 -12
- package/lib-es/room-control/room-session/index.js +77 -74
- package/lib-es/room-control/shared-cache.js +62 -56
- package/lib-es/room-control/sharing-control/index.js +64 -57
- package/lib-es/room-control/stream-control/index.js +197 -193
- package/lib-es/room-control/stt-control/de-compress-gzip.js +10 -0
- package/lib-es/room-control/stt-control/index.js +93 -86
- package/lib-es/room-control/user-control/index.js +162 -155
- package/lib-es/room-control/waitingroom-control/index.js +18 -9
- package/lib-es/room-control/whiteboard-control/utils.js +4 -2
- package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +120 -103
- package/lib-es/room-control/whiteboard-control-v1/factory.js +6 -4
- package/lib-es/room-control/whiteboard-control-v1/index.js +80 -67
- package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +3 -2
- package/lib-es/room-control/whiteboard-control-v1/utils.js +17 -14
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +13 -10
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +16 -8
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +60 -53
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +39 -30
- package/lib-es/room-control/whiteboard-control-v2/utils.js +10 -10
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +26 -11
- package/lib-es/room-control/widget-control/index.js +42 -33
- package/lib-es/room-router/index.js +66 -58
- package/lib-es/service/api.js +445 -548
- package/lib-es/struct.js +4 -2
- package/lib-es/utilities/abortable-retry.js +3 -0
- package/lib-es/utilities/collection.js +14 -11
- package/lib-es/utilities/error-helpers.js +33 -26
- package/lib-es/utilities/error.js +4 -3
- package/lib-es/utilities/join-helper.js +36 -29
- package/lib-es/utilities/logger.js +7 -5
- package/lib-es/utilities/parameters.js +21 -10
- package/lib-es/utilities/retry-helpers.js +1 -0
- package/lib-es/utilities/stream.js +15 -11
- package/lib-es/utilities/user.js +4 -3
- package/lib-es/utilities/validate-params.js +1 -1
- package/lib-es/utilities/video-encoder-config.js +10 -5
- package/package.json +4 -4
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import "core-js/modules/es.symbol.description.js";
|
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
|
1
3
|
import "core-js/modules/es.array.push.js";
|
|
2
4
|
import "core-js/modules/esnext.function.metadata.js";
|
|
5
|
+
import "core-js/modules/esnext.iterator.filter.js";
|
|
6
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
|
3
7
|
import "core-js/modules/esnext.map.delete-all.js";
|
|
4
8
|
import "core-js/modules/esnext.map.emplace.js";
|
|
5
9
|
import "core-js/modules/esnext.map.every.js";
|
|
@@ -15,9 +19,19 @@ import "core-js/modules/esnext.map.reduce.js";
|
|
|
15
19
|
import "core-js/modules/esnext.map.some.js";
|
|
16
20
|
import "core-js/modules/esnext.map.update.js";
|
|
17
21
|
import "core-js/modules/esnext.symbol.metadata.js";
|
|
18
|
-
|
|
22
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
23
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
24
|
+
var _FcrBoardMainWindowImpl;
|
|
25
|
+
let _initProto, _cleanDecs, _setToolTypeDecs, _setStrokeWidthDecs, _setStrokeColorDecs, _setTextColorDecs, _setTextSizeDecs, _setFillColorDecs, _setEraserSizeDecs, _setBackgroundColorDecs, _insertImageDecs, _insertMediaDecs, _mountDecs, _ref;
|
|
26
|
+
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; }
|
|
27
|
+
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) { _defineProperty(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; }
|
|
28
|
+
import "core-js/modules/es.promise.finally.js";
|
|
19
29
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
20
30
|
import "core-js/modules/esnext.iterator.map.js";
|
|
31
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
32
|
+
import "core-js/modules/web.url.js";
|
|
33
|
+
import "core-js/modules/web.url.to-json.js";
|
|
34
|
+
import "core-js/modules/web.url-search-params.js";
|
|
21
35
|
import "core-js/modules/web.url-search-params.delete.js";
|
|
22
36
|
import "core-js/modules/web.url-search-params.has.js";
|
|
23
37
|
import "core-js/modules/web.url-search-params.size.js";
|
|
@@ -45,17 +59,15 @@ import subWorkerString from '@netless/appliance-plugin/dist/subWorker.js?raw';
|
|
|
45
59
|
import { FcrReturnCode } from '../../type';
|
|
46
60
|
import { isPlainObject } from 'lodash';
|
|
47
61
|
import { jsonstring } from 'agora-rte-sdk/lib/imports';
|
|
62
|
+
_ref = (_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");
|
|
48
63
|
export class FcrBoardMainWindowImpl {
|
|
49
|
-
static {
|
|
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;
|
|
51
|
-
}
|
|
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({
|
|
53
|
-
prefix: 'FcrBoardMainWindowImpl'
|
|
54
|
-
}));
|
|
55
|
-
_memberState = {};
|
|
56
|
-
_observable = new AgoraObservable();
|
|
57
|
-
_destroyed = false;
|
|
58
64
|
constructor(room) {
|
|
65
|
+
_defineProperty(this, _ref, (_initProto(this), createLogger({
|
|
66
|
+
prefix: 'FcrBoardMainWindowImpl'
|
|
67
|
+
})));
|
|
68
|
+
_defineProperty(this, "_memberState", {});
|
|
69
|
+
_defineProperty(this, "_observable", new AgoraObservable());
|
|
70
|
+
_defineProperty(this, "_destroyed", false);
|
|
59
71
|
this._whiteBoardroom = room;
|
|
60
72
|
this._whiteView = document.createElement('div');
|
|
61
73
|
this._initView();
|
|
@@ -111,80 +123,90 @@ export class FcrBoardMainWindowImpl {
|
|
|
111
123
|
return this._whiteView;
|
|
112
124
|
}
|
|
113
125
|
setScale(value) {
|
|
126
|
+
var _this$_windowManager;
|
|
114
127
|
const scale = Math.max(Math.min(value, 3), -3);
|
|
115
|
-
this._windowManager
|
|
128
|
+
(_this$_windowManager = this._windowManager) === null || _this$_windowManager === void 0 || _this$_windowManager.moveCamera({
|
|
116
129
|
scale
|
|
117
130
|
});
|
|
118
131
|
}
|
|
119
132
|
async openSubWindowWithTaskId(title, taskId, urlPrefix) {
|
|
120
|
-
|
|
133
|
+
var _this$_windowManager2;
|
|
134
|
+
const appId = await ((_this$_windowManager2 = this._windowManager) === null || _this$_windowManager2 === void 0 ? void 0 : _this$_windowManager2.addApp({
|
|
121
135
|
kind: 'Slide',
|
|
122
136
|
options: {
|
|
123
|
-
scenePath:
|
|
137
|
+
scenePath: "/ppt".concat(taskId),
|
|
124
138
|
title
|
|
125
139
|
},
|
|
126
140
|
attributes: {
|
|
127
141
|
taskId,
|
|
128
142
|
url: urlPrefix
|
|
129
143
|
}
|
|
130
|
-
});
|
|
144
|
+
}));
|
|
131
145
|
if (appId) {
|
|
132
|
-
|
|
146
|
+
var _this$_windowManager3;
|
|
147
|
+
const app = (_this$_windowManager3 = this._windowManager) === null || _this$_windowManager3 === void 0 || (_this$_windowManager3 = _this$_windowManager3.apps) === null || _this$_windowManager3 === void 0 ? void 0 : _this$_windowManager3[appId];
|
|
133
148
|
return app ? new FcrBoardSubWindowImpl(appId) : undefined;
|
|
134
149
|
}
|
|
135
150
|
}
|
|
136
151
|
async openSubWindowWithPageList(title, pageList) {
|
|
137
|
-
|
|
138
|
-
const
|
|
152
|
+
var _this$_windowManager4;
|
|
153
|
+
const scenePath = "/".concat(Date.now());
|
|
154
|
+
const appId = await ((_this$_windowManager4 = this._windowManager) === null || _this$_windowManager4 === void 0 ? void 0 : _this$_windowManager4.addApp({
|
|
139
155
|
kind: BuiltinApps.DocsViewer,
|
|
140
156
|
options: {
|
|
141
157
|
scenePath,
|
|
142
158
|
title,
|
|
143
159
|
scenes: this._convertToScenes(pageList)
|
|
144
160
|
}
|
|
145
|
-
});
|
|
161
|
+
}));
|
|
146
162
|
if (appId) {
|
|
147
|
-
|
|
163
|
+
var _this$_windowManager5;
|
|
164
|
+
const app = (_this$_windowManager5 = this._windowManager) === null || _this$_windowManager5 === void 0 || (_this$_windowManager5 = _this$_windowManager5.apps) === null || _this$_windowManager5 === void 0 ? void 0 : _this$_windowManager5[appId];
|
|
148
165
|
return app ? new FcrBoardSubWindowImpl(appId) : undefined;
|
|
149
166
|
}
|
|
150
167
|
}
|
|
151
168
|
async setContainerSizeRatio(ratio) {
|
|
169
|
+
var _this$_windowManager6;
|
|
152
170
|
this._preCheck();
|
|
153
|
-
this._windowManager
|
|
171
|
+
(_this$_windowManager6 = this._windowManager) === null || _this$_windowManager6 === void 0 || _this$_windowManager6.setContainerSizeRatio(ratio);
|
|
154
172
|
}
|
|
155
173
|
getPageInfo() {
|
|
156
174
|
this._preCheck();
|
|
157
175
|
const windowManager = this._windowManager;
|
|
158
176
|
return {
|
|
159
|
-
showIndex: windowManager
|
|
160
|
-
count: windowManager
|
|
177
|
+
showIndex: (windowManager === null || windowManager === void 0 ? void 0 : windowManager.mainViewSceneIndex) || 0,
|
|
178
|
+
count: (windowManager === null || windowManager === void 0 ? void 0 : windowManager.mainViewScenesLength) || 0
|
|
161
179
|
};
|
|
162
180
|
}
|
|
163
181
|
async addPage() {
|
|
182
|
+
var _this$_windowManager7;
|
|
164
183
|
this._preCheck();
|
|
165
|
-
if (this._windowManager
|
|
184
|
+
if ((_this$_windowManager7 = this._windowManager) !== null && _this$_windowManager7 !== void 0 && _this$_windowManager7.addPage) {
|
|
166
185
|
await this._windowManager.addPage();
|
|
167
186
|
await this._windowManager.nextPage();
|
|
168
187
|
}
|
|
169
188
|
return FcrReturnCode.SUCCESS;
|
|
170
189
|
}
|
|
171
190
|
async removePage() {
|
|
191
|
+
var _this$_windowManager8;
|
|
172
192
|
this._preCheck();
|
|
173
|
-
if (this._windowManager
|
|
193
|
+
if ((_this$_windowManager8 = this._windowManager) !== null && _this$_windowManager8 !== void 0 && _this$_windowManager8.removePage) {
|
|
174
194
|
await this._windowManager.removePage();
|
|
175
195
|
}
|
|
176
196
|
return FcrReturnCode.SUCCESS;
|
|
177
197
|
}
|
|
178
198
|
async prevPage() {
|
|
199
|
+
var _this$_windowManager9;
|
|
179
200
|
this._preCheck();
|
|
180
|
-
if (this._windowManager
|
|
201
|
+
if ((_this$_windowManager9 = this._windowManager) !== null && _this$_windowManager9 !== void 0 && _this$_windowManager9.prevPage) {
|
|
181
202
|
await this._windowManager.prevPage();
|
|
182
203
|
}
|
|
183
204
|
return FcrReturnCode.SUCCESS;
|
|
184
205
|
}
|
|
185
206
|
async nextPage() {
|
|
207
|
+
var _this$_windowManager0;
|
|
186
208
|
this._preCheck();
|
|
187
|
-
if (this._windowManager
|
|
209
|
+
if ((_this$_windowManager0 = this._windowManager) !== null && _this$_windowManager0 !== void 0 && _this$_windowManager0.nextPage) {
|
|
188
210
|
await this._windowManager.nextPage();
|
|
189
211
|
}
|
|
190
212
|
return FcrReturnCode.SUCCESS;
|
|
@@ -213,19 +235,20 @@ export class FcrBoardMainWindowImpl {
|
|
|
213
235
|
this._preCheck({
|
|
214
236
|
wm: false
|
|
215
237
|
});
|
|
216
|
-
const
|
|
238
|
+
const _convertToNetlessBoar = convertToNetlessBoardTool(type),
|
|
239
|
+
_convertToNetlessBoar2 = _slicedToArray(_convertToNetlessBoar, 2),
|
|
240
|
+
tool = _convertToNetlessBoar2[0],
|
|
241
|
+
shape = _convertToNetlessBoar2[1];
|
|
217
242
|
const strokeType = convertToNetlessStorkeType(type);
|
|
218
243
|
const change = {
|
|
219
244
|
currentApplianceName: tool,
|
|
220
245
|
shapeType: shape,
|
|
221
246
|
strokeType
|
|
222
247
|
};
|
|
223
|
-
this._memberState = {
|
|
224
|
-
...this._memberState,
|
|
225
|
-
...change
|
|
226
|
-
};
|
|
248
|
+
this._memberState = _objectSpread(_objectSpread({}, this._memberState), change);
|
|
227
249
|
if (this._windowManager) {
|
|
228
|
-
|
|
250
|
+
var _this$_appliancePlugi;
|
|
251
|
+
(_this$_appliancePlugi = this._appliancePluginInstance) === null || _this$_appliancePlugi === void 0 || _this$_appliancePlugi.setMemberState(change);
|
|
229
252
|
}
|
|
230
253
|
return FcrReturnCode.SUCCESS;
|
|
231
254
|
}
|
|
@@ -234,40 +257,33 @@ export class FcrBoardMainWindowImpl {
|
|
|
234
257
|
const change = {
|
|
235
258
|
strokeWidth
|
|
236
259
|
};
|
|
237
|
-
this._memberState = {
|
|
238
|
-
...this._memberState,
|
|
239
|
-
...change
|
|
240
|
-
};
|
|
260
|
+
this._memberState = _objectSpread(_objectSpread({}, this._memberState), change);
|
|
241
261
|
if (this._windowManager) {
|
|
242
262
|
this._whiteBoardroom.setMemberState(change);
|
|
243
263
|
}
|
|
244
264
|
return FcrReturnCode.SUCCESS;
|
|
245
265
|
}
|
|
246
266
|
async setStrokeColor(color) {
|
|
267
|
+
var _color$a;
|
|
247
268
|
this._preCheck();
|
|
248
269
|
const change = {
|
|
249
270
|
strokeColor: [color.r, color.g, color.b],
|
|
250
|
-
strokeOpacity: color.a
|
|
251
|
-
};
|
|
252
|
-
this._memberState = {
|
|
253
|
-
...this._memberState,
|
|
254
|
-
...change
|
|
271
|
+
strokeOpacity: (_color$a = color.a) !== null && _color$a !== void 0 ? _color$a : 1
|
|
255
272
|
};
|
|
273
|
+
this._memberState = _objectSpread(_objectSpread({}, this._memberState), change);
|
|
256
274
|
if (this._windowManager) {
|
|
257
275
|
this._whiteBoardroom.setMemberState(change);
|
|
258
276
|
}
|
|
259
277
|
return FcrReturnCode.SUCCESS;
|
|
260
278
|
}
|
|
261
279
|
async setTextColor(color) {
|
|
280
|
+
var _color$a2;
|
|
262
281
|
this._preCheck();
|
|
263
282
|
const change = {
|
|
264
283
|
textColor: [color.r, color.g, color.b],
|
|
265
|
-
textOpacity: color.a
|
|
266
|
-
};
|
|
267
|
-
this._memberState = {
|
|
268
|
-
...this._memberState,
|
|
269
|
-
...change
|
|
284
|
+
textOpacity: (_color$a2 = color.a) !== null && _color$a2 !== void 0 ? _color$a2 : 1
|
|
270
285
|
};
|
|
286
|
+
this._memberState = _objectSpread(_objectSpread({}, this._memberState), change);
|
|
271
287
|
if (this._windowManager) {
|
|
272
288
|
this._whiteBoardroom.setMemberState(change);
|
|
273
289
|
}
|
|
@@ -278,25 +294,20 @@ export class FcrBoardMainWindowImpl {
|
|
|
278
294
|
const change = {
|
|
279
295
|
textSize: size
|
|
280
296
|
};
|
|
281
|
-
this._memberState = {
|
|
282
|
-
...this._memberState,
|
|
283
|
-
...change
|
|
284
|
-
};
|
|
297
|
+
this._memberState = _objectSpread(_objectSpread({}, this._memberState), change);
|
|
285
298
|
if (this._windowManager) {
|
|
286
299
|
this._whiteBoardroom.setMemberState(change);
|
|
287
300
|
}
|
|
288
301
|
return FcrReturnCode.SUCCESS;
|
|
289
302
|
}
|
|
290
303
|
async setFillColor(fillColor) {
|
|
304
|
+
var _fillColor$a;
|
|
291
305
|
this._preCheck();
|
|
292
306
|
const change = {
|
|
293
307
|
fillColor: [fillColor.r, fillColor.g, fillColor.b],
|
|
294
|
-
fillOpacity: fillColor.a
|
|
295
|
-
};
|
|
296
|
-
this._memberState = {
|
|
297
|
-
...this._memberState,
|
|
298
|
-
...change
|
|
308
|
+
fillOpacity: (_fillColor$a = fillColor.a) !== null && _fillColor$a !== void 0 ? _fillColor$a : 1
|
|
299
309
|
};
|
|
310
|
+
this._memberState = _objectSpread(_objectSpread({}, this._memberState), change);
|
|
300
311
|
if (this._windowManager) {
|
|
301
312
|
this._whiteBoardroom.setMemberState(change);
|
|
302
313
|
}
|
|
@@ -307,19 +318,17 @@ export class FcrBoardMainWindowImpl {
|
|
|
307
318
|
const change = {
|
|
308
319
|
pencilEraserSize: size
|
|
309
320
|
};
|
|
310
|
-
this._memberState = {
|
|
311
|
-
...this._memberState,
|
|
312
|
-
...change
|
|
313
|
-
};
|
|
321
|
+
this._memberState = _objectSpread(_objectSpread({}, this._memberState), change);
|
|
314
322
|
if (this._windowManager) {
|
|
315
323
|
this._whiteBoardroom.setMemberState(change);
|
|
316
324
|
}
|
|
317
325
|
return FcrReturnCode.SUCCESS;
|
|
318
326
|
}
|
|
319
327
|
async setBackgroundColor(color) {
|
|
328
|
+
var _this$_whiteView$quer;
|
|
320
329
|
this._preCheck();
|
|
321
330
|
this._backgroundColor = color;
|
|
322
|
-
this._whiteView.querySelector('.netless-whiteboard')
|
|
331
|
+
(_this$_whiteView$quer = this._whiteView.querySelector('.netless-whiteboard')) === null || _this$_whiteView$quer === void 0 || _this$_whiteView$quer.style.setProperty('background-color', color);
|
|
323
332
|
return FcrReturnCode.SUCCESS;
|
|
324
333
|
}
|
|
325
334
|
async insertImage(resourceUrl, x, y, width, height) {
|
|
@@ -330,34 +339,33 @@ export class FcrBoardMainWindowImpl {
|
|
|
330
339
|
const preWidth = width;
|
|
331
340
|
const preHeight = height;
|
|
332
341
|
if (windowManager) {
|
|
342
|
+
var _this$_whiteView$clie, _this$_whiteView, _this$_whiteView$clie2, _this$_whiteView2;
|
|
333
343
|
let originX = 0;
|
|
334
344
|
let originY = 0;
|
|
335
345
|
if (this._whiteView) {
|
|
336
346
|
originX = this._whiteView.clientWidth / 2;
|
|
337
347
|
originY = this._whiteView.clientHeight / 2;
|
|
338
348
|
}
|
|
339
|
-
const {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
x
|
|
344
|
-
y
|
|
345
|
-
});
|
|
349
|
+
const _windowManager$mainVi = windowManager.mainView.convertToPointInWorld({
|
|
350
|
+
x: preX !== null && preX !== void 0 ? preX : originX,
|
|
351
|
+
y: preY !== null && preY !== void 0 ? preY : originY
|
|
352
|
+
}),
|
|
353
|
+
x = _windowManager$mainVi.x,
|
|
354
|
+
y = _windowManager$mainVi.y;
|
|
346
355
|
const containerSize = {
|
|
347
|
-
width: this._whiteView
|
|
348
|
-
height: this._whiteView
|
|
356
|
+
width: (_this$_whiteView$clie = (_this$_whiteView = this._whiteView) === null || _this$_whiteView === void 0 ? void 0 : _this$_whiteView.clientWidth) !== null && _this$_whiteView$clie !== void 0 ? _this$_whiteView$clie : window.innerWidth,
|
|
357
|
+
height: (_this$_whiteView$clie2 = (_this$_whiteView2 = this._whiteView) === null || _this$_whiteView2 === void 0 ? void 0 : _this$_whiteView2.clientHeight) !== null && _this$_whiteView$clie2 !== void 0 ? _this$_whiteView$clie2 : window.innerHeight
|
|
349
358
|
};
|
|
350
359
|
const uuid = md5(resourceUrl);
|
|
351
|
-
const
|
|
352
|
-
width,
|
|
353
|
-
height
|
|
354
|
-
} = await fetchImageInfoByUrl(resourceUrl, containerSize);
|
|
360
|
+
const _await$fetchImageInfo = await fetchImageInfoByUrl(resourceUrl, containerSize),
|
|
361
|
+
width = _await$fetchImageInfo.width,
|
|
362
|
+
height = _await$fetchImageInfo.height;
|
|
355
363
|
const imageInfo = {
|
|
356
364
|
uuid: uuid,
|
|
357
365
|
centerX: x,
|
|
358
366
|
centerY: y,
|
|
359
|
-
width: preWidth
|
|
360
|
-
height: preHeight
|
|
367
|
+
width: preWidth !== null && preWidth !== void 0 ? preWidth : width,
|
|
368
|
+
height: preHeight !== null && preHeight !== void 0 ? preHeight : height,
|
|
361
369
|
locked: false
|
|
362
370
|
};
|
|
363
371
|
windowManager.switchMainViewToWriter();
|
|
@@ -405,11 +413,12 @@ export class FcrBoardMainWindowImpl {
|
|
|
405
413
|
}
|
|
406
414
|
}));
|
|
407
415
|
}
|
|
408
|
-
_preCheck(
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
416
|
+
_preCheck() {
|
|
417
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
418
|
+
const _options$privilege = options.privilege,
|
|
419
|
+
privilege = _options$privilege === void 0 ? true : _options$privilege,
|
|
420
|
+
_options$wm = options.wm,
|
|
421
|
+
wm = _options$wm === void 0 ? true : _options$wm;
|
|
413
422
|
if (privilege && !this._whiteBoardroom.isWritable) {
|
|
414
423
|
this.logger.warn('Try to operate on board window without operation privilege');
|
|
415
424
|
}
|
|
@@ -419,32 +428,35 @@ export class FcrBoardMainWindowImpl {
|
|
|
419
428
|
}
|
|
420
429
|
_addWindowManagerEventListeners() {
|
|
421
430
|
const windowManager = this._windowManager;
|
|
422
|
-
windowManager
|
|
431
|
+
windowManager === null || windowManager === void 0 || windowManager.emitter.on('mainViewSceneIndexChange', showIndex => {
|
|
423
432
|
const state = {
|
|
424
433
|
showIndex: showIndex,
|
|
425
|
-
count: windowManager
|
|
434
|
+
count: (windowManager === null || windowManager === void 0 ? void 0 : windowManager.mainViewScenesLength) || 0
|
|
426
435
|
};
|
|
427
436
|
this._observable.notifyObservers('onPageInfoUpdated', state);
|
|
428
437
|
});
|
|
429
|
-
windowManager
|
|
438
|
+
windowManager === null || windowManager === void 0 || windowManager.emitter.on('mainViewScenesLengthChange', count => {
|
|
430
439
|
const state = {
|
|
431
|
-
showIndex: windowManager
|
|
440
|
+
showIndex: (windowManager === null || windowManager === void 0 ? void 0 : windowManager.mainViewSceneIndex) || 0,
|
|
432
441
|
count: count
|
|
433
442
|
};
|
|
434
443
|
this._observable.notifyObservers('onPageInfoUpdated', state);
|
|
435
444
|
});
|
|
436
|
-
windowManager
|
|
445
|
+
windowManager === null || windowManager === void 0 || windowManager.emitter.on('canUndoStepsChange', steps => {
|
|
437
446
|
this._observable.notifyObservers('onUndoStateUpdated', steps > 0);
|
|
438
447
|
});
|
|
439
|
-
windowManager
|
|
448
|
+
windowManager === null || windowManager === void 0 || windowManager.emitter.on('canRedoStepsChange', steps => {
|
|
440
449
|
this._observable.notifyObservers('onRedoStateUpdated', steps > 0);
|
|
441
450
|
});
|
|
442
451
|
}
|
|
443
452
|
|
|
444
453
|
// don't remove, used by FcrWhiteboardControl
|
|
445
|
-
async _mount(
|
|
454
|
+
async _mount() {
|
|
455
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
456
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
446
457
|
this._whiteboardPrivateParameters = params;
|
|
447
458
|
if (this._whiteBoardroom) {
|
|
459
|
+
var _this$_whiteboardPriv, _this$_whiteboardPriv2, _this$_whiteboardPriv3, _this$_whiteboardPriv4, _this$_whiteboardPriv5, _this$_whiteboardPriv6, _this$_whiteboardPriv7, _this$_whiteboardPriv8;
|
|
448
460
|
this._destroyed = false;
|
|
449
461
|
if (BoardMountManager.isMounting) {
|
|
450
462
|
this.logger.info('[FcrBoardMainWindow] wait for previous board window mounted, white room id:', this._whiteBoardroom.uuid);
|
|
@@ -457,15 +469,15 @@ export class FcrBoardMainWindowImpl {
|
|
|
457
469
|
}
|
|
458
470
|
BoardMountManager.setIsMounting(true);
|
|
459
471
|
this.logger.info('start mount board window, white room id:', this._whiteBoardroom.uuid);
|
|
460
|
-
const extras = this._whiteboardPrivateParameters
|
|
461
|
-
const cursor = this._whiteboardPrivateParameters
|
|
462
|
-
const extendClass = this._whiteboardPrivateParameters
|
|
463
|
-
const containerElement = this._whiteboardPrivateParameters
|
|
464
|
-
let windowManagerParams = this._whiteboardPrivateParameters
|
|
465
|
-
this.logger.info(
|
|
466
|
-
this.logger.info(
|
|
467
|
-
this.logger.info(
|
|
468
|
-
this.logger.info(
|
|
472
|
+
const extras = (_this$_whiteboardPriv = (_this$_whiteboardPriv2 = this._whiteboardPrivateParameters) === null || _this$_whiteboardPriv2 === void 0 ? void 0 : _this$_whiteboardPriv2.extras) !== null && _this$_whiteboardPriv !== void 0 ? _this$_whiteboardPriv : {};
|
|
473
|
+
const cursor = (_this$_whiteboardPriv3 = (_this$_whiteboardPriv4 = this._whiteboardPrivateParameters) === null || _this$_whiteboardPriv4 === void 0 ? void 0 : _this$_whiteboardPriv4.cursor) !== null && _this$_whiteboardPriv3 !== void 0 ? _this$_whiteboardPriv3 : true;
|
|
474
|
+
const extendClass = (_this$_whiteboardPriv5 = this._whiteboardPrivateParameters) === null || _this$_whiteboardPriv5 === void 0 ? void 0 : _this$_whiteboardPriv5.extendClass;
|
|
475
|
+
const containerElement = (_this$_whiteboardPriv6 = this._whiteboardPrivateParameters) === null || _this$_whiteboardPriv6 === void 0 ? void 0 : _this$_whiteboardPriv6.containerElement;
|
|
476
|
+
let windowManagerParams = (_this$_whiteboardPriv7 = (_this$_whiteboardPriv8 = this._whiteboardPrivateParameters) === null || _this$_whiteboardPriv8 === void 0 ? void 0 : _this$_whiteboardPriv8.windowManagerParams) !== null && _this$_whiteboardPriv7 !== void 0 ? _this$_whiteboardPriv7 : {};
|
|
477
|
+
this.logger.info("set whiteboard extendClass: ".concat(extendClass));
|
|
478
|
+
this.logger.info("set whiteboard cursor: ".concat(cursor));
|
|
479
|
+
this.logger.info("set whiteboard extras: ".concat(jsonstring(extras)));
|
|
480
|
+
this.logger.info("set whiteboard windowManagerParams: ".concat(jsonstring(windowManagerParams)));
|
|
469
481
|
if (!isPlainObject(windowManagerParams)) {
|
|
470
482
|
this.logger.warn('windowManagerParams is not a plain object');
|
|
471
483
|
windowManagerParams = {};
|
|
@@ -475,7 +487,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
475
487
|
if (containerElement) {
|
|
476
488
|
containerElement.appendChild(this._whiteView);
|
|
477
489
|
}
|
|
478
|
-
await WindowManager.mount({
|
|
490
|
+
await WindowManager.mount(_objectSpread({
|
|
479
491
|
debug: true,
|
|
480
492
|
room: this._whiteBoardroom,
|
|
481
493
|
container: this._whiteView,
|
|
@@ -483,9 +495,8 @@ export class FcrBoardMainWindowImpl {
|
|
|
483
495
|
chessboard: false,
|
|
484
496
|
collectorContainer: options.collectorContainer,
|
|
485
497
|
containerSizeRatio: options.containerSizeRatio,
|
|
486
|
-
supportAppliancePlugin: true
|
|
487
|
-
|
|
488
|
-
}, extendClass).then(async wm => {
|
|
498
|
+
supportAppliancePlugin: true
|
|
499
|
+
}, windowManagerParams), extendClass).then(async wm => {
|
|
489
500
|
if (this._destroyed) {
|
|
490
501
|
wm.destroy();
|
|
491
502
|
return;
|
|
@@ -496,7 +507,8 @@ export class FcrBoardMainWindowImpl {
|
|
|
496
507
|
this._windowManager.mainView.disableCameraTransform = true;
|
|
497
508
|
this._addWindowManagerEventListeners();
|
|
498
509
|
if (this._backgroundColor) {
|
|
499
|
-
|
|
510
|
+
var _this$_whiteView$quer2;
|
|
511
|
+
(_this$_whiteView$quer2 = this._whiteView.querySelector('.netless-whiteboard')) === null || _this$_whiteView$quer2 === void 0 || _this$_whiteView$quer2.style.setProperty('background-color', this._backgroundColor);
|
|
500
512
|
}
|
|
501
513
|
const fullWorkerBlob = new Blob([fullWorkerString], {
|
|
502
514
|
type: 'text/javascript'
|
|
@@ -535,7 +547,7 @@ export class FcrBoardMainWindowImpl {
|
|
|
535
547
|
}
|
|
536
548
|
});
|
|
537
549
|
const hasPermission = this._whiteBoardroom.isWritable;
|
|
538
|
-
this.logger.info(
|
|
550
|
+
this.logger.info("after mount, isWritable: ".concat(hasPermission));
|
|
539
551
|
if (hasPermission) {
|
|
540
552
|
this._whiteBoardroom.setMemberState(this._memberState);
|
|
541
553
|
appliancePluginInstance.setMemberState({
|
|
@@ -570,4 +582,9 @@ export class FcrBoardMainWindowImpl {
|
|
|
570
582
|
_addLogObserver() {
|
|
571
583
|
this.addObserver(generateLogObserver(this.logger, [['onWritable', ['isWritable']], ['onPageInfoUpdated', ['info']], ['onUndoStateUpdated', ['enable']], ['onRedoStateUpdated', ['enable']]]));
|
|
572
584
|
}
|
|
573
|
-
}
|
|
585
|
+
}
|
|
586
|
+
_FcrBoardMainWindowImpl = FcrBoardMainWindowImpl;
|
|
587
|
+
var _applyDecs$e = _applyDecs(_FcrBoardMainWindowImpl, [[[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;
|
|
588
|
+
var _applyDecs$e2 = _slicedToArray(_applyDecs$e, 1);
|
|
589
|
+
_initProto = _applyDecs$e2[0];
|
|
590
|
+
_applyDecs$e;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import { FcrWhiteboardControlImpl } from '.';
|
|
2
3
|
import { createLogger } from '../../utilities/logger';
|
|
3
4
|
export class FcrWhiteboardControlFactoryImpl {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
constructor() {
|
|
6
|
+
_defineProperty(this, "logger", createLogger({
|
|
7
|
+
prefix: 'FcrWhiteboardControlFactory'
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
8
10
|
createForMainProcess(hasOperationPrivilege, scene, api, sharedCache) {
|
|
9
11
|
this.logger.info('create for main process, use old whiteboard control');
|
|
10
12
|
return new FcrWhiteboardControlImpl(scene, api, sharedCache, hasOperationPrivilege);
|