fcr-core 3.6.2 → 3.6.4
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-connection/index.js +23 -41
- package/lib/engine/index.js +66 -65
- package/lib/imports.js +1 -3
- package/lib/media-control/desktop.js +7 -15
- package/lib/media-control/mobile.js +11 -18
- package/lib/monitor-control/index.js +3 -10
- package/lib/peer-session/index.js +37 -50
- package/lib/plugins/chatroom.js +184 -203
- package/lib/room-control/ability-control/index.js +7 -14
- package/lib/room-control/ability-control/type.d.ts +2 -1
- package/lib/room-control/ability-control/type.js +1 -0
- package/lib/room-control/group-control/index.js +14 -23
- package/lib/room-control/index.js +57 -84
- package/lib/room-control/interpreter-control/index.js +17 -25
- 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 +10 -20
- package/lib/room-control/privilege-control/helper.js +5 -10
- package/lib/room-control/privilege-control/index.js +17 -29
- package/lib/room-control/privilege-control/type.js +1 -0
- package/lib/room-control/room-connector-control/index.js +14 -25
- package/lib/room-control/room-session/index.js +37 -50
- package/lib/room-control/shared-cache.js +19 -26
- package/lib/room-control/sharing-control/index.js +22 -33
- package/lib/room-control/stream-control/index.js +164 -176
- package/lib/room-control/user-control/index.js +131 -146
- package/lib/room-control/waitingroom-control/index.js +8 -15
- package/lib/room-control/whiteboard-control/board-window.js +52 -60
- package/lib/room-control/whiteboard-control/enums.js +84 -0
- package/lib/room-control/whiteboard-control/index.js +26 -40
- package/lib/room-control/whiteboard-control/mount-manager.js +2 -4
- package/lib/room-control/whiteboard-control/utils.js +14 -17
- package/lib/room-control/whiteboard-control-v2/annotation-control/index.d.ts +1 -1
- package/lib/room-control/whiteboard-control-v2/annotation-control/index.js +20 -27
- package/lib/room-control/whiteboard-control-v2/index.d.ts +1 -1
- package/lib/room-control/whiteboard-control-v2/index.js +51 -55
- package/lib/room-control/whiteboard-control-v2/main-window.d.ts +2 -0
- package/lib/room-control/whiteboard-control-v2/main-window.js +32 -41
- package/lib/room-router/index.js +52 -70
- package/lib/schema.d.ts +15 -15
- package/lib/schema.js +0 -1
- package/lib/service/api.js +113 -117
- package/lib/type.js +4 -2
- package/lib/utilities/collection.js +2 -3
- package/lib/utilities/error.js +4 -6
- package/lib/utilities/logger.js +2 -3
- package/lib/utilities/parameters.js +4 -8
- package/lib/utilities/stream.js +12 -20
- package/lib/utilities/user.js +2 -3
- package/lib/utilities/validate-params.js +1 -2
- package/package.json +4 -4
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.d.ts +0 -38
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.js +0 -261
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
3
|
require("core-js/modules/es.array.push.js");
|
|
5
|
-
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
6
|
-
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
7
4
|
require("core-js/modules/esnext.function.metadata.js");
|
|
8
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
9
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
10
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
11
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
12
6
|
require("core-js/modules/esnext.map.emplace.js");
|
|
13
7
|
require("core-js/modules/esnext.map.every.js");
|
|
@@ -28,12 +22,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
28
22
|
value: true
|
|
29
23
|
});
|
|
30
24
|
exports.FcrBoardMainWindowImpl = void 0;
|
|
31
|
-
require("core-js/modules/
|
|
32
|
-
require("core-js/modules/es.promise.finally.js");
|
|
33
|
-
require("core-js/modules/esnext.async-iterator.map.js");
|
|
25
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
34
26
|
require("core-js/modules/esnext.iterator.map.js");
|
|
35
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
36
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
37
27
|
var _whiteSnapshot = require("@netless/white-snapshot");
|
|
38
28
|
var _windowManager = require("@netless/window-manager");
|
|
39
29
|
require("@netless/window-manager/dist/style.css");
|
|
@@ -44,25 +34,22 @@ var _logger = require("../../utilities/logger");
|
|
|
44
34
|
var _imports = require("../../imports");
|
|
45
35
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
46
36
|
var _schema = require("../../schema");
|
|
47
|
-
|
|
48
|
-
let _initProto, _setContainerSizeRatioDecs, _cleanDecs, _setToolTypeDecs, _setStrokeWidthDecs, _setStrokeColorDecs, _setTextColorDecs, _setTextSizeDecs, _setBackgroundColorDecs, _insertImageDecs, _ref;
|
|
49
|
-
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; }
|
|
50
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
|
+
let _initProto, _setContainerSizeRatioDecs, _cleanDecs, _setToolTypeDecs, _setStrokeWidthDecs, _setStrokeColorDecs, _setTextColorDecs, _setTextSizeDecs, _setBackgroundColorDecs, _insertImageDecs;
|
|
51
38
|
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)]; } }; }
|
|
52
39
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
53
40
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
54
41
|
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; }
|
|
55
42
|
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; }
|
|
56
|
-
_ref = (_setContainerSizeRatioDecs = [_imports.trace, (0, _validateParams.default)(_schema.numberSchema)], _cleanDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.booleanSchema.optional())], _setToolTypeDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrBoardToolTypeSchema)], _setStrokeWidthDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.numberSchema)], _setStrokeColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.colorSchema)], _setTextColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.colorSchema)], _setTextSizeDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.numberSchema)], _setBackgroundColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _insertImageDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.numberSchema, _schema.numberSchema, _schema.numberSchema, _schema.numberSchema)], "logger");
|
|
57
43
|
class FcrBoardMainWindowImpl {
|
|
44
|
+
static #_ = (() => [_initProto] = _applyDecs(this, [[[_imports.bound, _imports.trace], 2, "getSnapshotImage"], [_imports.trace, 2, "addObserver"], [_imports.trace, 2, "removeObserver"], [_imports.trace, 2, "getContentView"], [_setContainerSizeRatioDecs, 2, "setContainerSizeRatio"], [_imports.trace, 2, "getPageInfo"], [[_imports.bound, _imports.trace], 2, "addPage"], [[_imports.bound, _imports.trace], 2, "removePage"], [_imports.trace, 2, "prevPage"], [_imports.trace, 2, "nextPage"], [[_imports.bound, _imports.trace], 2, "undo"], [[_imports.bound, _imports.trace], 2, "redo"], [_cleanDecs, 2, "clean"], [_setToolTypeDecs, 2, "setToolType"], [_setStrokeWidthDecs, 2, "setStrokeWidth"], [_setStrokeColorDecs, 2, "setStrokeColor"], [_setTextColorDecs, 2, "setTextColor"], [_setTextSizeDecs, 2, "setTextSize"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [_insertImageDecs, 2, "insertImage"], [_imports.trace, 2, "destroy"], [_imports.bound, 2, "_updateOperationPrivilege"], [_imports.bound, 2, "_mount"]], []).e)();
|
|
45
|
+
[(_setContainerSizeRatioDecs = [_imports.trace, (0, _validateParams.default)(_schema.numberSchema)], _cleanDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.booleanSchema.optional())], _setToolTypeDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrBoardToolTypeSchema)], _setStrokeWidthDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.numberSchema)], _setStrokeColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.colorSchema)], _setTextColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.colorSchema)], _setTextSizeDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.numberSchema)], _setBackgroundColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _insertImageDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.numberSchema, _schema.numberSchema, _schema.numberSchema, _schema.numberSchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
|
|
46
|
+
prefix: 'FcrBoardMainWindowImpl'
|
|
47
|
+
})))();
|
|
48
|
+
_hasOperationPrivilege = false;
|
|
49
|
+
_memberState = {};
|
|
50
|
+
_observable = (() => new _imports.AgoraObservable())();
|
|
51
|
+
_destroyed = false;
|
|
58
52
|
constructor(room, privilegeControl) {
|
|
59
|
-
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
60
|
-
prefix: 'FcrBoardMainWindowImpl'
|
|
61
|
-
})));
|
|
62
|
-
(0, _defineProperty2.default)(this, "_hasOperationPrivilege", false);
|
|
63
|
-
(0, _defineProperty2.default)(this, "_memberState", {});
|
|
64
|
-
(0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
|
|
65
|
-
(0, _defineProperty2.default)(this, "_destroyed", false);
|
|
66
53
|
this._whiteBoardroom = room;
|
|
67
54
|
this._whiteView = document.createElement('div');
|
|
68
55
|
this._initView();
|
|
@@ -120,44 +107,39 @@ class FcrBoardMainWindowImpl {
|
|
|
120
107
|
return this._whiteView;
|
|
121
108
|
}
|
|
122
109
|
async setContainerSizeRatio(ratio) {
|
|
123
|
-
var _this$_windowManager;
|
|
124
110
|
this._preCheck();
|
|
125
|
-
|
|
111
|
+
this._windowManager?.setContainerSizeRatio(ratio);
|
|
126
112
|
}
|
|
127
113
|
getPageInfo() {
|
|
128
114
|
this._preCheck();
|
|
129
115
|
const windowManager = this._windowManager;
|
|
130
116
|
return {
|
|
131
|
-
showIndex:
|
|
132
|
-
count:
|
|
117
|
+
showIndex: windowManager?.mainViewSceneIndex || 0,
|
|
118
|
+
count: windowManager?.mainViewScenesLength || 0
|
|
133
119
|
};
|
|
134
120
|
}
|
|
135
121
|
async addPage() {
|
|
136
|
-
var _this$_windowManager2;
|
|
137
122
|
this._preCheck();
|
|
138
|
-
if (
|
|
123
|
+
if (this._windowManager?.addPage) {
|
|
139
124
|
await this._windowManager.addPage();
|
|
140
125
|
await this._windowManager.nextPage();
|
|
141
126
|
}
|
|
142
127
|
}
|
|
143
128
|
async removePage() {
|
|
144
|
-
var _this$_windowManager3;
|
|
145
129
|
this._preCheck();
|
|
146
|
-
if (
|
|
130
|
+
if (this._windowManager?.removePage) {
|
|
147
131
|
await this._windowManager.removePage();
|
|
148
132
|
}
|
|
149
133
|
}
|
|
150
134
|
async prevPage() {
|
|
151
|
-
var _this$_windowManager4;
|
|
152
135
|
this._preCheck();
|
|
153
|
-
if (
|
|
136
|
+
if (this._windowManager?.prevPage) {
|
|
154
137
|
await this._windowManager.prevPage();
|
|
155
138
|
}
|
|
156
139
|
}
|
|
157
140
|
async nextPage() {
|
|
158
|
-
var _this$_windowManager5;
|
|
159
141
|
this._preCheck();
|
|
160
|
-
if (
|
|
142
|
+
if (this._windowManager?.nextPage) {
|
|
161
143
|
await this._windowManager.nextPage();
|
|
162
144
|
}
|
|
163
145
|
}
|
|
@@ -189,7 +171,10 @@ class FcrBoardMainWindowImpl {
|
|
|
189
171
|
currentApplianceName: tool,
|
|
190
172
|
shapeType: shape
|
|
191
173
|
};
|
|
192
|
-
this._memberState =
|
|
174
|
+
this._memberState = {
|
|
175
|
+
...this._memberState,
|
|
176
|
+
...change
|
|
177
|
+
};
|
|
193
178
|
if (this._windowManager) {
|
|
194
179
|
this._whiteBoardroom.setMemberState(change);
|
|
195
180
|
}
|
|
@@ -199,7 +184,10 @@ class FcrBoardMainWindowImpl {
|
|
|
199
184
|
const change = {
|
|
200
185
|
strokeWidth
|
|
201
186
|
};
|
|
202
|
-
this._memberState =
|
|
187
|
+
this._memberState = {
|
|
188
|
+
...this._memberState,
|
|
189
|
+
...change
|
|
190
|
+
};
|
|
203
191
|
if (this._windowManager) {
|
|
204
192
|
this._whiteBoardroom.setMemberState(change);
|
|
205
193
|
}
|
|
@@ -209,7 +197,10 @@ class FcrBoardMainWindowImpl {
|
|
|
209
197
|
const change = {
|
|
210
198
|
strokeColor: [color.r, color.g, color.b]
|
|
211
199
|
};
|
|
212
|
-
this._memberState =
|
|
200
|
+
this._memberState = {
|
|
201
|
+
...this._memberState,
|
|
202
|
+
...change
|
|
203
|
+
};
|
|
213
204
|
if (this._windowManager) {
|
|
214
205
|
this._whiteBoardroom.setMemberState(change);
|
|
215
206
|
}
|
|
@@ -219,7 +210,10 @@ class FcrBoardMainWindowImpl {
|
|
|
219
210
|
const change = {
|
|
220
211
|
textColor: [color.r, color.g, color.b]
|
|
221
212
|
};
|
|
222
|
-
this._memberState =
|
|
213
|
+
this._memberState = {
|
|
214
|
+
...this._memberState,
|
|
215
|
+
...change
|
|
216
|
+
};
|
|
223
217
|
if (this._windowManager) {
|
|
224
218
|
this._whiteBoardroom.setMemberState(change);
|
|
225
219
|
}
|
|
@@ -229,16 +223,18 @@ class FcrBoardMainWindowImpl {
|
|
|
229
223
|
const change = {
|
|
230
224
|
textSize: size
|
|
231
225
|
};
|
|
232
|
-
this._memberState =
|
|
226
|
+
this._memberState = {
|
|
227
|
+
...this._memberState,
|
|
228
|
+
...change
|
|
229
|
+
};
|
|
233
230
|
if (this._windowManager) {
|
|
234
231
|
this._whiteBoardroom.setMemberState(change);
|
|
235
232
|
}
|
|
236
233
|
}
|
|
237
234
|
async setBackgroundColor(color) {
|
|
238
|
-
var _this$_whiteView$quer;
|
|
239
235
|
this._preCheck();
|
|
240
236
|
this._backgroundColor = color;
|
|
241
|
-
|
|
237
|
+
this._whiteView.querySelector('.netless-whiteboard')?.style.setProperty('background-color', color);
|
|
242
238
|
}
|
|
243
239
|
async insertImage(resourceUrl, x, y, width, height) {
|
|
244
240
|
const room = this._whiteBoardroom;
|
|
@@ -248,7 +244,6 @@ class FcrBoardMainWindowImpl {
|
|
|
248
244
|
const preWidth = width;
|
|
249
245
|
const preHeight = height;
|
|
250
246
|
if (windowManager) {
|
|
251
|
-
var _this$_whiteView$clie, _this$_whiteView, _this$_whiteView$clie2, _this$_whiteView2;
|
|
252
247
|
let originX = 0;
|
|
253
248
|
let originY = 0;
|
|
254
249
|
if (this._whiteView) {
|
|
@@ -259,12 +254,12 @@ class FcrBoardMainWindowImpl {
|
|
|
259
254
|
x,
|
|
260
255
|
y
|
|
261
256
|
} = windowManager.mainView.convertToPointInWorld({
|
|
262
|
-
x: preX
|
|
263
|
-
y: preY
|
|
257
|
+
x: preX ?? originX,
|
|
258
|
+
y: preY ?? originY
|
|
264
259
|
});
|
|
265
260
|
const containerSize = {
|
|
266
|
-
width:
|
|
267
|
-
height:
|
|
261
|
+
width: this._whiteView?.clientWidth ?? window.innerWidth,
|
|
262
|
+
height: this._whiteView?.clientHeight ?? window.innerHeight
|
|
268
263
|
};
|
|
269
264
|
const uuid = (0, _jsMd.md5)(resourceUrl);
|
|
270
265
|
const {
|
|
@@ -275,8 +270,8 @@ class FcrBoardMainWindowImpl {
|
|
|
275
270
|
uuid: uuid,
|
|
276
271
|
centerX: x,
|
|
277
272
|
centerY: y,
|
|
278
|
-
width: preWidth
|
|
279
|
-
height: preHeight
|
|
273
|
+
width: preWidth ?? width,
|
|
274
|
+
height: preHeight ?? height,
|
|
280
275
|
locked: false
|
|
281
276
|
};
|
|
282
277
|
windowManager.switchMainViewToWriter();
|
|
@@ -319,24 +314,24 @@ class FcrBoardMainWindowImpl {
|
|
|
319
314
|
}
|
|
320
315
|
_addWindowManagerEventListeners() {
|
|
321
316
|
const windowManager = this._windowManager;
|
|
322
|
-
windowManager
|
|
317
|
+
windowManager?.emitter.on('mainViewSceneIndexChange', showIndex => {
|
|
323
318
|
const state = {
|
|
324
319
|
showIndex: showIndex,
|
|
325
|
-
count:
|
|
320
|
+
count: windowManager?.mainViewScenesLength || 0
|
|
326
321
|
};
|
|
327
322
|
this._observable.notifyObservers('onPageInfoUpdated', state);
|
|
328
323
|
});
|
|
329
|
-
windowManager
|
|
324
|
+
windowManager?.emitter.on('mainViewScenesLengthChange', count => {
|
|
330
325
|
const state = {
|
|
331
|
-
showIndex:
|
|
326
|
+
showIndex: windowManager?.mainViewSceneIndex || 0,
|
|
332
327
|
count: count
|
|
333
328
|
};
|
|
334
329
|
this._observable.notifyObservers('onPageInfoUpdated', state);
|
|
335
330
|
});
|
|
336
|
-
windowManager
|
|
331
|
+
windowManager?.emitter.on('canUndoStepsChange', steps => {
|
|
337
332
|
this._observable.notifyObservers('onUndoStateUpdated', steps > 0);
|
|
338
333
|
});
|
|
339
|
-
windowManager
|
|
334
|
+
windowManager?.emitter.on('canRedoStepsChange', steps => {
|
|
340
335
|
this._observable.notifyObservers('onRedoStateUpdated', steps > 0);
|
|
341
336
|
});
|
|
342
337
|
}
|
|
@@ -382,8 +377,7 @@ class FcrBoardMainWindowImpl {
|
|
|
382
377
|
this._updateOperationPrivilege(true);
|
|
383
378
|
this._whiteBoardroom.setMemberState(this._memberState);
|
|
384
379
|
if (this._backgroundColor) {
|
|
385
|
-
|
|
386
|
-
(_this$_whiteView$quer2 = this._whiteView.querySelector('.netless-whiteboard')) === null || _this$_whiteView$quer2 === void 0 || _this$_whiteView$quer2.style.setProperty('background-color', this._backgroundColor);
|
|
380
|
+
this._whiteView.querySelector('.netless-whiteboard')?.style.setProperty('background-color', this._backgroundColor);
|
|
387
381
|
}
|
|
388
382
|
}).catch(e => {
|
|
389
383
|
this.logger.error('[FcrBoardMainWindow] failed to mount', e);
|
|
@@ -402,6 +396,4 @@ class FcrBoardMainWindowImpl {
|
|
|
402
396
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onPageInfoUpdated', 'onPageInfoUpdated', 'onUndoStateUpdated', 'onRedoStateUpdated']));
|
|
403
397
|
}
|
|
404
398
|
}
|
|
405
|
-
exports.FcrBoardMainWindowImpl = FcrBoardMainWindowImpl;
|
|
406
|
-
_FcrBoardMainWindowImpl = FcrBoardMainWindowImpl;
|
|
407
|
-
[_initProto] = _applyDecs(_FcrBoardMainWindowImpl, [[[_imports.bound, _imports.trace], 2, "getSnapshotImage"], [_imports.trace, 2, "addObserver"], [_imports.trace, 2, "removeObserver"], [_imports.trace, 2, "getContentView"], [_setContainerSizeRatioDecs, 2, "setContainerSizeRatio"], [_imports.trace, 2, "getPageInfo"], [[_imports.bound, _imports.trace], 2, "addPage"], [[_imports.bound, _imports.trace], 2, "removePage"], [_imports.trace, 2, "prevPage"], [_imports.trace, 2, "nextPage"], [[_imports.bound, _imports.trace], 2, "undo"], [[_imports.bound, _imports.trace], 2, "redo"], [_cleanDecs, 2, "clean"], [_setToolTypeDecs, 2, "setToolType"], [_setStrokeWidthDecs, 2, "setStrokeWidth"], [_setStrokeColorDecs, 2, "setStrokeColor"], [_setTextColorDecs, 2, "setTextColor"], [_setTextSizeDecs, 2, "setTextSize"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [_insertImageDecs, 2, "insertImage"], [_imports.trace, 2, "destroy"], [_imports.bound, 2, "_updateOperationPrivilege"], [_imports.bound, 2, "_mount"]], []).e;
|
|
399
|
+
exports.FcrBoardMainWindowImpl = FcrBoardMainWindowImpl;
|
|
@@ -24,10 +24,25 @@ let FcrBoardShape = exports.FcrBoardShape = /*#__PURE__*/function (FcrBoardShape
|
|
|
24
24
|
return FcrBoardShape;
|
|
25
25
|
}({});
|
|
26
26
|
let RoomPhase = exports.RoomPhase = /*#__PURE__*/function (RoomPhase) {
|
|
27
|
+
/**
|
|
28
|
+
* 连接中
|
|
29
|
+
*/
|
|
27
30
|
RoomPhase["Connecting"] = "connecting";
|
|
31
|
+
/**
|
|
32
|
+
* 已连接
|
|
33
|
+
*/
|
|
28
34
|
RoomPhase["Connected"] = "connected";
|
|
35
|
+
/**
|
|
36
|
+
* 正在重连
|
|
37
|
+
*/
|
|
29
38
|
RoomPhase["Reconnecting"] = "reconnecting";
|
|
39
|
+
/**
|
|
40
|
+
* 断开连接中
|
|
41
|
+
*/
|
|
30
42
|
RoomPhase["Disconnecting"] = "disconnecting";
|
|
43
|
+
/**
|
|
44
|
+
* 已断开连接
|
|
45
|
+
*/
|
|
31
46
|
RoomPhase["Disconnected"] = "disconnected";
|
|
32
47
|
return RoomPhase;
|
|
33
48
|
}({});
|
|
@@ -38,37 +53,106 @@ let FcrBoardMainWindowFailureReason = exports.FcrBoardMainWindowFailureReason =
|
|
|
38
53
|
return FcrBoardMainWindowFailureReason;
|
|
39
54
|
}({});
|
|
40
55
|
let ViewMode = exports.ViewMode = /*#__PURE__*/function (ViewMode) {
|
|
56
|
+
/**
|
|
57
|
+
* 自由模式。不跟随任何人,也不被任何人跟随,自己可以自由操作视角。
|
|
58
|
+
*/
|
|
41
59
|
ViewMode["Freedom"] = "freedom";
|
|
60
|
+
/**
|
|
61
|
+
* 跟随模式。跟随当前房间的主播视角。
|
|
62
|
+
*/
|
|
42
63
|
ViewMode["Follower"] = "follower";
|
|
64
|
+
/**
|
|
65
|
+
* 主播模式。可以自由操作视角,但房间中处于跟随模式的人会跟随。
|
|
66
|
+
*/
|
|
43
67
|
ViewMode["Broadcaster"] = "broadcaster";
|
|
44
68
|
return ViewMode;
|
|
45
69
|
}({});
|
|
46
70
|
let DeviceType = exports.DeviceType = /*#__PURE__*/function (DeviceType) {
|
|
71
|
+
/**
|
|
72
|
+
* 桌面设备,使用键盘鼠标
|
|
73
|
+
*/
|
|
47
74
|
DeviceType["Desktop"] = "desktop";
|
|
75
|
+
/**
|
|
76
|
+
* 触碰板设备,比如只能手机、平板电脑
|
|
77
|
+
*/
|
|
48
78
|
DeviceType["Touch"] = "touch";
|
|
79
|
+
/**
|
|
80
|
+
* 同时支持键盘、鼠标、触碰板的设备
|
|
81
|
+
*/
|
|
49
82
|
DeviceType["Surface"] = "surface";
|
|
50
83
|
return DeviceType;
|
|
51
84
|
}({});
|
|
52
85
|
let ApplianceNames = exports.ApplianceNames = /*#__PURE__*/function (ApplianceNames) {
|
|
86
|
+
/**
|
|
87
|
+
* 选择工具
|
|
88
|
+
*/
|
|
53
89
|
ApplianceNames["selector"] = "selector";
|
|
90
|
+
/**
|
|
91
|
+
* 互动工具(无默认行为,可供 plugin 自定义)
|
|
92
|
+
*/
|
|
54
93
|
ApplianceNames["clicker"] = "clicker";
|
|
94
|
+
/**
|
|
95
|
+
* 激光笔
|
|
96
|
+
*/
|
|
55
97
|
ApplianceNames["laserPointer"] = "laserPointer";
|
|
98
|
+
/**
|
|
99
|
+
* 铅笔工具
|
|
100
|
+
*/
|
|
56
101
|
ApplianceNames["pencil"] = "pencil";
|
|
102
|
+
/**
|
|
103
|
+
* 矩形工具
|
|
104
|
+
*/
|
|
57
105
|
ApplianceNames["rectangle"] = "rectangle";
|
|
106
|
+
/**
|
|
107
|
+
* 圆形工具
|
|
108
|
+
*/
|
|
58
109
|
ApplianceNames["ellipse"] = "ellipse";
|
|
110
|
+
/**
|
|
111
|
+
* 图形工具
|
|
112
|
+
*/
|
|
59
113
|
ApplianceNames["shape"] = "shape";
|
|
114
|
+
/**
|
|
115
|
+
* 橡皮工具
|
|
116
|
+
*/
|
|
60
117
|
ApplianceNames["eraser"] = "eraser";
|
|
118
|
+
/**
|
|
119
|
+
* 橡皮工具(用来擦除铅笔笔迹的局部)
|
|
120
|
+
*/
|
|
61
121
|
ApplianceNames["pencilEraser"] = "pencilEraser";
|
|
122
|
+
/**
|
|
123
|
+
* 文字工具
|
|
124
|
+
*/
|
|
62
125
|
ApplianceNames["text"] = "text";
|
|
126
|
+
/**
|
|
127
|
+
* 直线工具
|
|
128
|
+
*/
|
|
63
129
|
ApplianceNames["straight"] = "straight";
|
|
130
|
+
/**
|
|
131
|
+
* 箭头工具
|
|
132
|
+
*/
|
|
64
133
|
ApplianceNames["arrow"] = "arrow";
|
|
134
|
+
/**
|
|
135
|
+
* 抓手工具
|
|
136
|
+
*/
|
|
65
137
|
ApplianceNames["hand"] = "hand";
|
|
66
138
|
return ApplianceNames;
|
|
67
139
|
}({});
|
|
68
140
|
let ShapeType = exports.ShapeType = /*#__PURE__*/function (ShapeType) {
|
|
141
|
+
/**
|
|
142
|
+
* 三角形
|
|
143
|
+
*/
|
|
69
144
|
ShapeType["Triangle"] = "triangle";
|
|
145
|
+
/**
|
|
146
|
+
* 菱形
|
|
147
|
+
*/
|
|
70
148
|
ShapeType["Rhombus"] = "rhombus";
|
|
149
|
+
/**
|
|
150
|
+
* 五角星
|
|
151
|
+
*/
|
|
71
152
|
ShapeType["Pentagram"] = "pentagram";
|
|
153
|
+
/**
|
|
154
|
+
* 说话泡泡
|
|
155
|
+
*/
|
|
72
156
|
ShapeType["SpeechBalloon"] = "speechBalloon";
|
|
73
157
|
return ShapeType;
|
|
74
158
|
}({});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
|
5
3
|
require("core-js/modules/es.array.push.js");
|
|
6
4
|
require("core-js/modules/esnext.function.metadata.js");
|
|
7
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
@@ -26,11 +24,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
26
24
|
value: true
|
|
27
25
|
});
|
|
28
26
|
exports.FcrWhiteboardControlImpl = void 0;
|
|
29
|
-
require("core-js/modules/
|
|
30
|
-
require("core-js/modules/esnext.async-iterator.map.js");
|
|
27
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
31
28
|
require("core-js/modules/esnext.iterator.map.js");
|
|
32
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
33
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
34
29
|
var _imports = require("../../imports");
|
|
35
30
|
var _whiteWebSdk = require("white-web-sdk");
|
|
36
31
|
var netlessVideoPlugin = _interopRequireWildcard(require("@netless/video-js-plugin"));
|
|
@@ -46,31 +41,29 @@ var _logger = require("../../utilities/logger");
|
|
|
46
41
|
var _error = require("../../utilities/error");
|
|
47
42
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
48
43
|
var _schema = require("../../schema");
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
52
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
44
|
+
let _initProto, _setBackgroundColorDecs;
|
|
45
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
53
46
|
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)]; } }; }
|
|
54
47
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
55
48
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
56
49
|
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; }
|
|
57
50
|
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; }
|
|
58
|
-
_ref = (_setBackgroundColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger");
|
|
59
51
|
/**
|
|
60
52
|
* @internal
|
|
61
53
|
*/
|
|
62
54
|
class FcrWhiteboardControlImpl {
|
|
55
|
+
static #_ = (() => [_initProto] = _applyDecs(this, [[[_imports.bound, _imports.trace], 2, "active"], [[_imports.bound, _imports.trace], 2, "inactive"], [[_imports.bound, _imports.trace], 2, "open"], [[_imports.bound, _imports.trace], 2, "close"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [[_imports.bound, _imports.trace], 2, "getActivity"], [[_imports.bound, _imports.trace], 2, "getOwnerId"], [[_imports.bound, _imports.trace], 2, "getBackgroundColor"], [[_imports.bound, _imports.trace], 2, "getConnectionState"], [[_imports.bound, _imports.trace], 2, "getMainWindow"], [[_imports.bound, _imports.trace], 2, "addObserver"], [[_imports.bound, _imports.trace], 2, "removeObserver"], [_imports.bound, 2, "getBoardActiveInfo"], [_imports.trace, 2, "leave"], [_imports.bound, 2, "_getToken"], [_imports.bound, 2, "_handleRoomStateUpdated"], [_imports.bound, 2, "_updateConnnectionState"], [_imports.bound, 2, "_handleConnectionStateUpdated"]], []).e)();
|
|
56
|
+
[(_setBackgroundColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
|
|
57
|
+
prefix: 'FcrWhiteboardControlImpl'
|
|
58
|
+
})))();
|
|
59
|
+
_client = (() => ({}))();
|
|
60
|
+
_joined = false;
|
|
61
|
+
_connectState = (() => _2.FcrConnectionState.DISCONNECTED)();
|
|
62
|
+
_observable = (() => new _observable.AgoraObservable())();
|
|
63
|
+
_options = {
|
|
64
|
+
debug: false
|
|
65
|
+
};
|
|
63
66
|
constructor(_scene, _privilegeControl, _api, _sharedCache) {
|
|
64
|
-
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
65
|
-
prefix: 'FcrWhiteboardControlImpl'
|
|
66
|
-
})));
|
|
67
|
-
(0, _defineProperty2.default)(this, "_client", {});
|
|
68
|
-
(0, _defineProperty2.default)(this, "_joined", false);
|
|
69
|
-
(0, _defineProperty2.default)(this, "_connectState", _2.FcrConnectionState.DISCONNECTED);
|
|
70
|
-
(0, _defineProperty2.default)(this, "_observable", new _observable.AgoraObservable());
|
|
71
|
-
(0, _defineProperty2.default)(this, "_options", {
|
|
72
|
-
debug: false
|
|
73
|
-
});
|
|
74
67
|
this._scene = _scene;
|
|
75
68
|
this._privilegeControl = _privilegeControl;
|
|
76
69
|
this._api = _api;
|
|
@@ -78,16 +71,14 @@ class FcrWhiteboardControlImpl {
|
|
|
78
71
|
this._roomCache = _sharedCache.getRoomCache(this._scene.sceneId);
|
|
79
72
|
_scene.addObserver({
|
|
80
73
|
onScenePropertiesUpdated: (_, event) => {
|
|
81
|
-
var _event$cause;
|
|
82
74
|
const operatorUser = (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache);
|
|
83
|
-
if (
|
|
84
|
-
var _ref2, _event$cause$data$wid2;
|
|
75
|
+
if (event.cause?.cmd === 10) {
|
|
85
76
|
const {
|
|
86
77
|
state,
|
|
87
78
|
extra: {
|
|
88
79
|
backgroundColor: bgColor
|
|
89
80
|
}
|
|
90
|
-
} =
|
|
81
|
+
} = _scene.getScenePropertiesByKeyPath('widgets.netlessBoard') ?? {
|
|
91
82
|
state: 0,
|
|
92
83
|
extra: {
|
|
93
84
|
backgroundColor: '#fff'
|
|
@@ -97,10 +88,9 @@ class FcrWhiteboardControlImpl {
|
|
|
97
88
|
this._observable.notifyObservers('onActive', _scene.getScenePropertiesByKeyPath('widgets.netlessBoard').ownerUserUuid, operatorUser);
|
|
98
89
|
}
|
|
99
90
|
if (state === 0) {
|
|
100
|
-
|
|
101
|
-
this._observable.notifyObservers('onInactive', (_event$cause$data$wid = event.cause.data.widgetCause) === null || _event$cause$data$wid === void 0 || (_event$cause$data$wid = _event$cause$data$wid.data) === null || _event$cause$data$wid === void 0 ? void 0 : _event$cause$data$wid.reason, operatorUser);
|
|
91
|
+
this._observable.notifyObservers('onInactive', event.cause.data.widgetCause?.data?.reason, operatorUser);
|
|
102
92
|
}
|
|
103
|
-
if (
|
|
93
|
+
if (event.cause.data.widgetCause?.cmd === 100101) {
|
|
104
94
|
this._observable.notifyObservers('onBackgroundColorUpdated', bgColor, operatorUser);
|
|
105
95
|
}
|
|
106
96
|
}
|
|
@@ -115,11 +105,10 @@ class FcrWhiteboardControlImpl {
|
|
|
115
105
|
return (0, _error.handleRequestError)(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, _enums.FcrSharePermissionState.OFF), _error.FcrErrorModuleCode.ROOM_WHITEBOARD, 'inactive failed');
|
|
116
106
|
}
|
|
117
107
|
async open() {
|
|
118
|
-
var _this$_scene$getUser;
|
|
119
108
|
// 白板权限禁用状态下,主持人和联席主持人仍然可以发起共享,所以,不能根据是否禁用状态直接拒绝
|
|
120
109
|
const roomId = this._scene.sceneId;
|
|
121
110
|
const userId = this._scene.localUser.getLocalUserId();
|
|
122
|
-
const cursorName =
|
|
111
|
+
const cursorName = this._scene.getUser(userId)?.userName;
|
|
123
112
|
const {
|
|
124
113
|
data
|
|
125
114
|
} = await this._getToken(roomId, userId);
|
|
@@ -189,17 +178,17 @@ class FcrWhiteboardControlImpl {
|
|
|
189
178
|
this._updateConnnectionState(_2.FcrConnectionState.CONNECTED);
|
|
190
179
|
}, [], {
|
|
191
180
|
retriesMax
|
|
192
|
-
}).fail(async
|
|
181
|
+
}).fail(async _ref => {
|
|
193
182
|
let {
|
|
194
183
|
error,
|
|
195
184
|
timeFn,
|
|
196
185
|
currentRetry
|
|
197
|
-
} =
|
|
198
|
-
this.logger.info(
|
|
186
|
+
} = _ref;
|
|
187
|
+
this.logger.info(`failed to join board room, error: ${error.message}, current retry: ${currentRetry}`);
|
|
199
188
|
if (this._joined) {
|
|
200
189
|
await timeFn();
|
|
201
190
|
}
|
|
202
|
-
this.logger.info(
|
|
191
|
+
this.logger.info(`continue attemptting? ${this._joined}`);
|
|
203
192
|
return this._joined;
|
|
204
193
|
}).abort(() => {
|
|
205
194
|
this._updateConnnectionState(_2.FcrConnectionState.DISCONNECTED);
|
|
@@ -276,11 +265,10 @@ class FcrWhiteboardControlImpl {
|
|
|
276
265
|
}
|
|
277
266
|
}
|
|
278
267
|
async leave() {
|
|
279
|
-
var _this$_boardView, _this$_room;
|
|
280
268
|
//@ts-ignore
|
|
281
|
-
|
|
269
|
+
this._boardView?.destroy();
|
|
282
270
|
this._boardView = undefined;
|
|
283
|
-
|
|
271
|
+
this._room?.disconnect();
|
|
284
272
|
this._room = undefined;
|
|
285
273
|
}
|
|
286
274
|
_createPlugins() {
|
|
@@ -352,6 +340,4 @@ class FcrWhiteboardControlImpl {
|
|
|
352
340
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onActive', 'onInactive', 'onBackgroundColorUpdated', 'onConnectionStateUpdated']));
|
|
353
341
|
}
|
|
354
342
|
}
|
|
355
|
-
exports.FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|
|
356
|
-
_FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|
|
357
|
-
[_initProto] = _applyDecs(_FcrWhiteboardControlImpl, [[[_imports.bound, _imports.trace], 2, "active"], [[_imports.bound, _imports.trace], 2, "inactive"], [[_imports.bound, _imports.trace], 2, "open"], [[_imports.bound, _imports.trace], 2, "close"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [[_imports.bound, _imports.trace], 2, "getActivity"], [[_imports.bound, _imports.trace], 2, "getOwnerId"], [[_imports.bound, _imports.trace], 2, "getBackgroundColor"], [[_imports.bound, _imports.trace], 2, "getConnectionState"], [[_imports.bound, _imports.trace], 2, "getMainWindow"], [[_imports.bound, _imports.trace], 2, "addObserver"], [[_imports.bound, _imports.trace], 2, "removeObserver"], [_imports.bound, 2, "getBoardActiveInfo"], [_imports.trace, 2, "leave"], [_imports.bound, 2, "_getToken"], [_imports.bound, 2, "_handleRoomStateUpdated"], [_imports.bound, 2, "_updateConnnectionState"], [_imports.bound, 2, "_handleConnectionStateUpdated"]], []).e;
|
|
343
|
+
exports.FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.BoardMountManager = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
class BoardMountManager {
|
|
8
|
+
static isMounting = false;
|
|
10
9
|
static setIsMounting(isMounting) {
|
|
11
10
|
BoardMountManager.isMounting = isMounting;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
|
-
exports.BoardMountManager = BoardMountManager;
|
|
15
|
-
(0, _defineProperty2.default)(BoardMountManager, "isMounting", false);
|
|
13
|
+
exports.BoardMountManager = BoardMountManager;
|