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