fcr-core 3.7.8 → 3.7.9-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chat-connection/index.js +26 -41
- package/lib/engine/index.js +74 -67
- package/lib/imports.js +0 -1
- package/lib/media-control/desktop.js +13 -18
- package/lib/media-control/mobile.js +13 -18
- package/lib/monitor-control/index.js +5 -10
- package/lib/peer-session/index.js +39 -48
- package/lib/plugins/chatroom.js +202 -218
- package/lib/room-control/ability-control/index.js +9 -14
- package/lib/room-control/group-control/index.js +16 -21
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +36 -53
- package/lib/room-control/interpreter-control/index.js +34 -47
- 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 +17 -25
- package/lib/room-control/privilege-control/helper.js +5 -8
- package/lib/room-control/privilege-control/index.js +19 -26
- package/lib/room-control/room-connector-control/index.js +19 -28
- package/lib/room-control/room-control-factory.js +1 -2
- package/lib/room-control/room-session/index.js +39 -48
- package/lib/room-control/shared-cache.js +29 -36
- package/lib/room-control/sharing-control/index.js +32 -40
- package/lib/room-control/stream-control/index.js +173 -181
- package/lib/room-control/user-control/index.js +136 -143
- package/lib/room-control/waitingroom-control/index.js +9 -14
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +24 -32
- package/lib/room-control/whiteboard-control-v2/annotation-control/index.js +16 -27
- package/lib/room-control/whiteboard-control-v2/annotation-control/privilege-control.js +53 -63
- package/lib/room-control/whiteboard-control-v2/index.js +28 -40
- package/lib/room-control/whiteboard-control-v2/main-window.js +23 -28
- package/lib/room-control/whiteboard-control-v2/utils.js +6 -7
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +27 -38
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.js +3 -5
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/privilege-control.js +42 -54
- package/lib/room-router/index.js +42 -52
- package/lib/service/api.js +207 -231
- package/lib/utilities/collection.js +2 -3
- package/lib/utilities/error-helpers.js +27 -34
- package/lib/utilities/error.js +8 -9
- package/lib/utilities/join-helper.js +25 -32
- package/lib/utilities/logger.js +3 -6
- package/lib/utilities/parameters.js +4 -8
- package/lib/utilities/retry-helpers.js +0 -1
- package/lib/utilities/shared-storage.js +0 -1
- package/lib/utilities/storage.js +0 -1
- package/lib/utilities/stream.js +11 -16
- package/lib/utilities/user.js +3 -4
- package/lib/utilities/validate-params.js +1 -2
- package/package.json +4 -4
|
@@ -1,12 +1,7 @@
|
|
|
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
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
9
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
10
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
11
6
|
require("core-js/modules/esnext.map.emplace.js");
|
|
12
7
|
require("core-js/modules/esnext.map.every.js");
|
|
@@ -22,63 +17,57 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
22
17
|
require("core-js/modules/esnext.map.some.js");
|
|
23
18
|
require("core-js/modules/esnext.map.update.js");
|
|
24
19
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
25
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
26
20
|
Object.defineProperty(exports, "__esModule", {
|
|
27
21
|
value: true
|
|
28
22
|
});
|
|
29
23
|
exports.FcrAnnotationControlFactoryImpl = void 0;
|
|
30
|
-
require("core-js/modules/es.json.stringify.js");
|
|
31
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
32
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
33
24
|
var _control = require("./control");
|
|
34
25
|
var _decorator = require("agora-foundation/lib/decorator");
|
|
35
26
|
var _logger = require("../../../utilities/logger");
|
|
36
27
|
var _privilegeControl2 = require("./privilege-control");
|
|
37
28
|
var _utils = require("../utils");
|
|
38
|
-
var _FcrAnnotationControlFactoryImpl;
|
|
39
29
|
let _initProto;
|
|
40
|
-
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; }
|
|
41
|
-
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; }
|
|
42
30
|
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)]; } }; }
|
|
43
31
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
44
32
|
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); }
|
|
45
33
|
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; }
|
|
46
34
|
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; }
|
|
47
35
|
class FcrAnnotationControlFactoryImpl {
|
|
36
|
+
static {
|
|
37
|
+
[_initProto] = _applyDecs(this, [[_decorator.bound, 2, "_getBoardConfigInfoWithScene"]], []).e;
|
|
38
|
+
}
|
|
39
|
+
logger = (_initProto(this), (0, _logger.createLogger)({
|
|
40
|
+
prefix: 'FcrAnnotationControlFactory'
|
|
41
|
+
}));
|
|
48
42
|
constructor(_rtmClient, _scene, _streamControl, _userControl, _privilegeControl, _api) {
|
|
49
|
-
(0, _defineProperty2.default)(this, "logger", (_initProto(this), (0, _logger.createLogger)({
|
|
50
|
-
prefix: 'FcrAnnotationControlFactory'
|
|
51
|
-
})));
|
|
52
43
|
this._rtmClient = _rtmClient;
|
|
53
44
|
this._scene = _scene;
|
|
54
45
|
this._streamControl = _streamControl;
|
|
55
46
|
this._userControl = _userControl;
|
|
56
47
|
this._privilegeControl = _privilegeControl;
|
|
57
48
|
this._api = _api;
|
|
58
|
-
this.logger.info(
|
|
49
|
+
this.logger.info(`[annotation]: constructor initialized`);
|
|
59
50
|
}
|
|
60
51
|
createForSubProcess(config) {
|
|
61
|
-
this.logger.info(
|
|
52
|
+
this.logger.info(`[annotation]: create for sub process with config: ${JSON.stringify(config)}`);
|
|
62
53
|
return new _control.FcrAnnotationControlImpl(this._rtmClient, config);
|
|
63
54
|
}
|
|
64
55
|
createForMainProcess() {
|
|
65
|
-
this.logger.info(
|
|
56
|
+
this.logger.info(`[annotation]: start create for main process`);
|
|
66
57
|
const config = this._getBoardConfigInfoWithScene();
|
|
67
|
-
this.logger.info(
|
|
58
|
+
this.logger.info(`[annotation]: create for main process with config: ${JSON.stringify(config)}`);
|
|
68
59
|
const control = new _privilegeControl2.FcrPrivilegedAnnotationControlImpl(this._rtmClient, config, this._scene, this._streamControl, this._userControl, this._privilegeControl, this._api);
|
|
69
60
|
return control;
|
|
70
61
|
}
|
|
71
62
|
_getBoardConfigInfoWithScene() {
|
|
72
|
-
var _this$_userControl;
|
|
73
63
|
const roomProperties = this._scene.getSceneProperties();
|
|
74
|
-
const localUser =
|
|
64
|
+
const localUser = this._userControl?.getLocalUser();
|
|
75
65
|
const annotationConfig = (0, _utils.getAnnotationConfigFromRoomProperties)(roomProperties, this.logger);
|
|
76
|
-
return
|
|
66
|
+
return {
|
|
77
67
|
userId: localUser.userId,
|
|
78
|
-
nickName: localUser.userName
|
|
79
|
-
|
|
68
|
+
nickName: localUser.userName,
|
|
69
|
+
...annotationConfig
|
|
70
|
+
};
|
|
80
71
|
}
|
|
81
72
|
}
|
|
82
|
-
exports.FcrAnnotationControlFactoryImpl = FcrAnnotationControlFactoryImpl;
|
|
83
|
-
_FcrAnnotationControlFactoryImpl = FcrAnnotationControlFactoryImpl;
|
|
84
|
-
[_initProto] = _applyDecs(_FcrAnnotationControlFactoryImpl, [[_decorator.bound, 2, "_getBoardConfigInfoWithScene"]], []).e;
|
|
73
|
+
exports.FcrAnnotationControlFactoryImpl = FcrAnnotationControlFactoryImpl;
|
|
@@ -1,6 +1,5 @@
|
|
|
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
4
|
require("core-js/modules/esnext.function.metadata.js");
|
|
6
5
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
@@ -18,18 +17,13 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
18
17
|
require("core-js/modules/esnext.map.some.js");
|
|
19
18
|
require("core-js/modules/esnext.map.update.js");
|
|
20
19
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
21
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
22
20
|
Object.defineProperty(exports, "__esModule", {
|
|
23
21
|
value: true
|
|
24
22
|
});
|
|
25
23
|
exports.FcrPrivilegedAnnotationControlImpl = void 0;
|
|
26
|
-
require("core-js/modules/es.error.cause.js");
|
|
27
|
-
require("core-js/modules/es.json.stringify.js");
|
|
28
24
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
29
25
|
require("core-js/modules/esnext.iterator.find.js");
|
|
30
26
|
require("core-js/modules/esnext.iterator.some.js");
|
|
31
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
32
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
33
27
|
var _type = require("../../../type");
|
|
34
28
|
var _control = require("./control");
|
|
35
29
|
var _forgeWhiteboard = require("@netless/forge-whiteboard");
|
|
@@ -38,7 +32,6 @@ var _imports = require("../../../imports");
|
|
|
38
32
|
var _error = require("../../../utilities/error");
|
|
39
33
|
var _logger = require("../../../utilities/logger");
|
|
40
34
|
var _utils = require("../utils");
|
|
41
|
-
var _FcrPrivilegedAnnotationControlImpl;
|
|
42
35
|
let _initProto;
|
|
43
36
|
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)]; } }; }
|
|
44
37
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -46,52 +39,55 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
46
39
|
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; }
|
|
47
40
|
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; }
|
|
48
41
|
class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlImpl {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
42
|
+
static {
|
|
43
|
+
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "open"], [_imports.trace, 2, "close"], [_imports.trace, 2, "syncScreenShareOwnerAnnotationOpenDone"], [[_imports.bound, _imports.trace], 2, "_handleApplicationLaunch"], [[_imports.bound, _imports.trace], 2, "_handleApplicationTerminal"]], [], 0, void 0, _control.FcrAnnotationControlImpl).e;
|
|
44
|
+
}
|
|
45
|
+
logger = (_initProto(this), (0, _logger.createLogger)({
|
|
46
|
+
prefix: 'FcrPrivilegedAnnotationControlImpl'
|
|
47
|
+
}));
|
|
48
|
+
_isOpen = false;
|
|
49
|
+
_waitPromise = null;
|
|
50
|
+
_waitPromiseResolve = null;
|
|
51
|
+
_waitPromiseReject = null;
|
|
52
|
+
_privilegeObserver = {
|
|
53
|
+
onLocalUserPermissionInfoAdded: (roomId, event) => {
|
|
54
|
+
if (this._hasBoardWritePermission(event)) {
|
|
55
|
+
this.logger.info(`add board write permission`);
|
|
56
|
+
const whiteboard = this.annotation;
|
|
57
|
+
if (whiteboard) {
|
|
58
|
+
whiteboard.permissions.addPermission(_forgeWhiteboard.WhiteboardPermissionFlag.all);
|
|
59
|
+
} else {
|
|
60
|
+
this.logger.warn('whiteboard is not initialized yet, should add permission when application launched');
|
|
68
61
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
onLocalUserPermissionInfoDeleted: (roomId, event) => {
|
|
65
|
+
if (this._hasBoardWritePermission(event)) {
|
|
66
|
+
this.logger.info(`remove board write permission`);
|
|
67
|
+
const whiteboard = this.annotation;
|
|
68
|
+
if (whiteboard) {
|
|
69
|
+
whiteboard.permissions.removePermission(_forgeWhiteboard.WhiteboardPermissionFlag.all);
|
|
70
|
+
} else {
|
|
71
|
+
this.logger.warn('whiteboard is not initialized yet, should remove permission when application launched');
|
|
79
72
|
}
|
|
80
73
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
_sceneObserver = {
|
|
77
|
+
onScenePropertiesUpdated: async (sceneId, event) => {
|
|
78
|
+
const hasKey = Object.keys(event.changedProperties).some(changeKey => {
|
|
79
|
+
return changeKey === 'widgets.annotation.extra.boardAppId';
|
|
80
|
+
});
|
|
81
|
+
if (hasKey) {
|
|
82
|
+
this.logger.info('widgets.annotation.extra.boardAppId updated, re-initializing annotation info');
|
|
83
|
+
if (this._isOpen && (await this._checkForConnect())) {
|
|
84
|
+
this._connect();
|
|
92
85
|
}
|
|
93
86
|
}
|
|
94
|
-
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
constructor(rtmClient, config, _scene, _streamControl, _userControl, _privilegeControl, _api) {
|
|
90
|
+
super(rtmClient, config);
|
|
95
91
|
this._scene = _scene;
|
|
96
92
|
this._streamControl = _streamControl;
|
|
97
93
|
this._userControl = _userControl;
|
|
@@ -100,7 +96,7 @@ class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlIm
|
|
|
100
96
|
this._config = config;
|
|
101
97
|
this._privilegeControl.addObserver(this._privilegeObserver);
|
|
102
98
|
this._scene.addObserver(this._sceneObserver);
|
|
103
|
-
this.logger.info(
|
|
99
|
+
this.logger.info(`initialized, config: ${JSON.stringify(config)}`);
|
|
104
100
|
}
|
|
105
101
|
addObserver(observer) {
|
|
106
102
|
this.observable.addObserver(observer);
|
|
@@ -110,7 +106,7 @@ class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlIm
|
|
|
110
106
|
}
|
|
111
107
|
async open() {
|
|
112
108
|
this._isOpen = true;
|
|
113
|
-
this.logger.info(
|
|
109
|
+
this.logger.info(`open privileged annotation control with config: ${(0, _imports.jsonstring)(this._config)}`);
|
|
114
110
|
const isReadyToConnect = await this._checkForConnect();
|
|
115
111
|
if (isReadyToConnect) {
|
|
116
112
|
return this._connect();
|
|
@@ -138,7 +134,7 @@ class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlIm
|
|
|
138
134
|
} catch (e) {
|
|
139
135
|
const error = e;
|
|
140
136
|
const errorMessage = error.message;
|
|
141
|
-
throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.ROOM_WHITEBOARD, _error.FcrErrorCode.LOCAL_HTTP_REQUEST_FAILED,
|
|
137
|
+
throw (0, _error.generateFcrCoreClientError)(_error.FcrErrorModuleCode.ROOM_WHITEBOARD, _error.FcrErrorCode.LOCAL_HTTP_REQUEST_FAILED, `sync screen share owner annotation open done failed: ${errorMessage}`, error);
|
|
142
138
|
}
|
|
143
139
|
}
|
|
144
140
|
updateConnnectionState(state) {
|
|
@@ -166,13 +162,12 @@ class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlIm
|
|
|
166
162
|
const stream = this._streamControl.getStreamList().find(stream => stream.videoSourceType === _type.FcrVideoSourceType.SCREEN);
|
|
167
163
|
const localUserId = this._userControl.getLocalUser().userId;
|
|
168
164
|
if (stream) {
|
|
169
|
-
var _this$_userControl$ge;
|
|
170
165
|
const ownerId = stream.owner.userId;
|
|
171
166
|
const isNotMeSharing = ownerId !== localUserId;
|
|
172
|
-
const platform =
|
|
167
|
+
const platform = this._userControl.getUser(ownerId)?.platform;
|
|
173
168
|
const isPcPlatform = platform && [_type.FcrPlatform.WEB_DESKTOP, _type.FcrPlatform.WINDOWS, _type.FcrPlatform.MACOS].includes(platform);
|
|
174
169
|
const isAndroidPlatform = platform && platform === _type.FcrPlatform.ANDROID;
|
|
175
|
-
this.logger.debug(
|
|
170
|
+
this.logger.debug(`isPcPlatform: ${isPcPlatform}, isAndroidPlatform: ${isAndroidPlatform}, isNotMeSharing: ${isNotMeSharing}, ownerId: ${ownerId}, localUserId: ${localUserId}, platform: ${platform}`);
|
|
176
171
|
if (isPcPlatform) {
|
|
177
172
|
mainWindow.setAutoCancelDraw(false);
|
|
178
173
|
}
|
|
@@ -211,10 +206,7 @@ class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlIm
|
|
|
211
206
|
return promise;
|
|
212
207
|
}
|
|
213
208
|
_hasBoardWritePermission(event) {
|
|
214
|
-
const hasPermissionNow = event.permissionInfo.some(perm =>
|
|
215
|
-
var _perm$info;
|
|
216
|
-
return ((_perm$info = perm.info) === null || _perm$info === void 0 ? void 0 : _perm$info.action) === _type.FcrPermissionAction.BoardWrite;
|
|
217
|
-
});
|
|
209
|
+
const hasPermissionNow = event.permissionInfo.some(perm => perm.info?.action === _type.FcrPermissionAction.BoardWrite);
|
|
218
210
|
return hasPermissionNow;
|
|
219
211
|
}
|
|
220
212
|
async _checkForConnect() {
|
|
@@ -222,7 +214,7 @@ class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlIm
|
|
|
222
214
|
const userId = this._scene.localUser.getLocalUserId();
|
|
223
215
|
const boardOptions = (await this._getToken(roomId, userId)).data;
|
|
224
216
|
if (boardOptions && boardOptions.boardAppId) {
|
|
225
|
-
this.logger.info(
|
|
217
|
+
this.logger.info(`board options found, ready to connect: ${(0, _imports.jsonstring)(boardOptions)}`);
|
|
226
218
|
if (this.annotationConfig) {
|
|
227
219
|
this.annotationConfig.extra = this.annotationConfig.extra || {};
|
|
228
220
|
this.annotationConfig.extra.boardAppId = boardOptions.boardAppId;
|
|
@@ -233,7 +225,7 @@ class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlIm
|
|
|
233
225
|
const annotationConfig = (0, _utils.getAnnotationConfigFromRoomProperties)(roomProperties, this.logger);
|
|
234
226
|
this.annotationConfig.size.width = annotationConfig.size.width;
|
|
235
227
|
this.annotationConfig.size.height = annotationConfig.size.height;
|
|
236
|
-
this.logger.info(
|
|
228
|
+
this.logger.info(`update annotation config, config: ${(0, _imports.jsonstring)(this.annotationConfig)}`);
|
|
237
229
|
}
|
|
238
230
|
return true;
|
|
239
231
|
}
|
|
@@ -257,6 +249,4 @@ class FcrPrivilegedAnnotationControlImpl extends _control.FcrAnnotationControlIm
|
|
|
257
249
|
this.annotation = app;
|
|
258
250
|
}
|
|
259
251
|
}
|
|
260
|
-
exports.FcrPrivilegedAnnotationControlImpl = FcrPrivilegedAnnotationControlImpl;
|
|
261
|
-
_FcrPrivilegedAnnotationControlImpl = FcrPrivilegedAnnotationControlImpl;
|
|
262
|
-
[_initProto] = _applyDecs(_FcrPrivilegedAnnotationControlImpl, [[_imports.trace, 2, "open"], [_imports.trace, 2, "close"], [_imports.trace, 2, "syncScreenShareOwnerAnnotationOpenDone"], [[_imports.bound, _imports.trace], 2, "_handleApplicationLaunch"], [[_imports.bound, _imports.trace], 2, "_handleApplicationTerminal"]], [], 0, void 0, _control.FcrAnnotationControlImpl).e;
|
|
252
|
+
exports.FcrPrivilegedAnnotationControlImpl = FcrPrivilegedAnnotationControlImpl;
|
|
@@ -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");
|
|
@@ -24,9 +22,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
24
22
|
value: true
|
|
25
23
|
});
|
|
26
24
|
exports.FcrWhiteboardControlImpl = void 0;
|
|
27
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
28
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
29
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
30
25
|
var _enums = require("../whiteboard-control/enums");
|
|
31
26
|
var _forgeRoom = require("@netless/forge-room");
|
|
32
27
|
var _forgeWhiteboard = require("@netless/forge-whiteboard");
|
|
@@ -43,23 +38,24 @@ var _validateParams = _interopRequireDefault(require("../../utilities/validate-p
|
|
|
43
38
|
var _schema = require("../../schema");
|
|
44
39
|
var _type2 = require("./whiteboard-control/type");
|
|
45
40
|
var _packageInfo = require("../../utilities/package-info");
|
|
46
|
-
|
|
47
|
-
let _initProto, _setBackgroundColorDecs, _ref;
|
|
41
|
+
let _initProto, _setBackgroundColorDecs;
|
|
48
42
|
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)]; } }; }
|
|
49
43
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
50
44
|
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); }
|
|
51
45
|
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; }
|
|
52
46
|
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; }
|
|
53
|
-
_ref = (_setBackgroundColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger");
|
|
54
47
|
class FcrWhiteboardControlImpl {
|
|
48
|
+
static {
|
|
49
|
+
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "open"], [_imports.trace, 2, "close"], [_imports.trace, 2, "active"], [_imports.trace, 2, "inactive"], [[_imports.bound, _imports.trace], 2, "getConnectionState"], [[_imports.bound, _imports.trace], 2, "getMainWindow"], [_imports.bound, 2, "getBoardActiveInfo"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [[_imports.bound, _imports.trace], 2, "getBackgroundColor"], [[_imports.bound, _imports.trace], 2, "getActivity"], [[_imports.bound, _imports.trace], 2, "getOwnerId"], [_imports.bound, 2, "_notifyObservers"], [_imports.bound, 2, "_updateConnnectionState"], [_imports.bound, 2, "_getToken"]], []).e;
|
|
50
|
+
}
|
|
51
|
+
[(_setBackgroundColorDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
52
|
+
prefix: 'FcrWhiteboardControlImpl'
|
|
53
|
+
}));
|
|
54
|
+
_observable = new _observable.AgoraObservable();
|
|
55
|
+
_connectState = _type.FcrConnectionState.DISCONNECTED;
|
|
56
|
+
_needRetry = true;
|
|
57
|
+
_FORGE_WHITEBOARD_APP_ID = 'MainWhiteboard';
|
|
55
58
|
constructor(_scene, _api, _engine, _sharedCache) {
|
|
56
|
-
(0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
57
|
-
prefix: 'FcrWhiteboardControlImpl'
|
|
58
|
-
})));
|
|
59
|
-
(0, _defineProperty2.default)(this, "_observable", new _observable.AgoraObservable());
|
|
60
|
-
(0, _defineProperty2.default)(this, "_connectState", _type.FcrConnectionState.DISCONNECTED);
|
|
61
|
-
(0, _defineProperty2.default)(this, "_needRetry", true);
|
|
62
|
-
(0, _defineProperty2.default)(this, "_FORGE_WHITEBOARD_APP_ID", 'MainWhiteboard');
|
|
63
59
|
this._scene = _scene;
|
|
64
60
|
this._api = _api;
|
|
65
61
|
this._engine = _engine;
|
|
@@ -67,16 +63,15 @@ class FcrWhiteboardControlImpl {
|
|
|
67
63
|
this._roomCache = _sharedCache.getRoomCache(this._scene.sceneId);
|
|
68
64
|
this._addLogObserver();
|
|
69
65
|
_scene.addObserver(this._notifyObservers());
|
|
70
|
-
this.logger.info(
|
|
66
|
+
this.logger.info(`Whitebaord Version: forge-whiteboard@${(0, _packageInfo.getDependenciesInfo)('@netless/forge-whiteboard')}, forge-room@${(0, _packageInfo.getDependenciesInfo)('@netless/forge-room')}, forge-rtm@${(0, _packageInfo.getDependenciesInfo)('@netless/forge-rtm')}`);
|
|
71
67
|
}
|
|
72
68
|
async open() {
|
|
73
|
-
var _this$_scene$getUser;
|
|
74
69
|
// 此宽高为设计稿中的白板尺寸,如无特殊需求,不建议修改
|
|
75
70
|
const width = 1920;
|
|
76
71
|
const height = 1220;
|
|
77
72
|
const roomId = this._scene.sceneId;
|
|
78
73
|
const userId = this._scene.localUser.getLocalUserId();
|
|
79
|
-
const nickName =
|
|
74
|
+
const nickName = this._scene.getUser(userId)?.userName;
|
|
80
75
|
const {
|
|
81
76
|
data
|
|
82
77
|
} = await this._getToken(roomId, userId);
|
|
@@ -153,15 +148,14 @@ class FcrWhiteboardControlImpl {
|
|
|
153
148
|
this._updateConnnectionState(_type.FcrConnectionState.CONNECTED);
|
|
154
149
|
}, [], {
|
|
155
150
|
retriesMax
|
|
156
|
-
}).fail(async
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
this.logger.info("[whiteboard]: failed to join board room, error: ".concat(error.message, ", current retry: ").concat(currentRetry));
|
|
151
|
+
}).fail(async ({
|
|
152
|
+
error,
|
|
153
|
+
timeFn,
|
|
154
|
+
currentRetry
|
|
155
|
+
}) => {
|
|
156
|
+
this.logger.info(`[whiteboard]: failed to join board room, error: ${error.message}, current retry: ${currentRetry}`);
|
|
163
157
|
this._needRetry && (await timeFn());
|
|
164
|
-
this.logger.info(
|
|
158
|
+
this.logger.info(`[whiteboard]: continue attemptting? need retry: ${this._needRetry}`);
|
|
165
159
|
return this._needRetry;
|
|
166
160
|
}).abort(() => {
|
|
167
161
|
this.logger.info('[whiteboard]: join board room aborted, state: DISCONNECTED');
|
|
@@ -174,10 +168,9 @@ class FcrWhiteboardControlImpl {
|
|
|
174
168
|
return this._boardView;
|
|
175
169
|
}
|
|
176
170
|
async close() {
|
|
177
|
-
var _this$_boardRoom, _this$_boardRoom2;
|
|
178
171
|
this._needRetry = false;
|
|
179
|
-
|
|
180
|
-
await
|
|
172
|
+
this._boardRoom?.applicationManager.terminateApplication(this._FORGE_WHITEBOARD_APP_ID);
|
|
173
|
+
await this._boardRoom?.leaveRoom();
|
|
181
174
|
this._boardRoom = undefined;
|
|
182
175
|
this._boardView = undefined;
|
|
183
176
|
}
|
|
@@ -211,12 +204,11 @@ class FcrWhiteboardControlImpl {
|
|
|
211
204
|
}
|
|
212
205
|
}
|
|
213
206
|
async setBackgroundColor(backgroundColor) {
|
|
214
|
-
var _this$_boardView;
|
|
215
207
|
await this._api.setBackgroundColor({
|
|
216
208
|
roomId: this._scene.sceneId,
|
|
217
209
|
backgroundColor
|
|
218
210
|
});
|
|
219
|
-
|
|
211
|
+
this._boardView?.setBackgroundColor(backgroundColor);
|
|
220
212
|
}
|
|
221
213
|
getBackgroundColor() {
|
|
222
214
|
return this._scene.getScenePropertiesByKeyPath('widgets.netlessBoard.extra.backgroundColor');
|
|
@@ -236,24 +228,22 @@ class FcrWhiteboardControlImpl {
|
|
|
236
228
|
_notifyObservers() {
|
|
237
229
|
return {
|
|
238
230
|
onScenePropertiesUpdated: (_, event) => {
|
|
239
|
-
var _event$cause;
|
|
240
231
|
const operatorUser = (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache);
|
|
241
232
|
const getByKeyPath = value => this._scene.getScenePropertiesByKeyPath(value);
|
|
242
|
-
if (
|
|
243
|
-
var _ref3, _ref4, _event$cause$data;
|
|
233
|
+
if (event.cause?.cmd === 10) {
|
|
244
234
|
const {
|
|
245
235
|
state,
|
|
246
236
|
ownerUserUuid
|
|
247
|
-
} =
|
|
237
|
+
} = getByKeyPath('widgets.netlessBoard') ?? {
|
|
248
238
|
state: 0
|
|
249
239
|
};
|
|
250
240
|
const {
|
|
251
241
|
backgroundColor: bgColor
|
|
252
|
-
} =
|
|
242
|
+
} = getByKeyPath('widgets.netlessBoard.extra') ?? {
|
|
253
243
|
backgroundColor: '#ffffff'
|
|
254
244
|
};
|
|
255
245
|
const widgetCauseReason = getByKeyPath('event.cause.data.widgetCause.data.reason');
|
|
256
|
-
const widgetCauseCmd =
|
|
246
|
+
const widgetCauseCmd = event.cause.data?.widgetCause?.cmd;
|
|
257
247
|
if (state === 1) {
|
|
258
248
|
this._observable.notifyObservers('onActive', ownerUserUuid, operatorUser);
|
|
259
249
|
}
|
|
@@ -281,6 +271,4 @@ class FcrWhiteboardControlImpl {
|
|
|
281
271
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onActive', 'onInactive', 'onBackgroundColorUpdated', 'onConnectionStateUpdated']));
|
|
282
272
|
}
|
|
283
273
|
}
|
|
284
|
-
exports.FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|
|
285
|
-
_FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|
|
286
|
-
[_initProto] = _applyDecs(_FcrWhiteboardControlImpl, [[_imports.trace, 2, "open"], [_imports.trace, 2, "close"], [_imports.trace, 2, "active"], [_imports.trace, 2, "inactive"], [[_imports.bound, _imports.trace], 2, "getConnectionState"], [[_imports.bound, _imports.trace], 2, "getMainWindow"], [_imports.bound, 2, "getBoardActiveInfo"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [[_imports.bound, _imports.trace], 2, "getBackgroundColor"], [[_imports.bound, _imports.trace], 2, "getActivity"], [[_imports.bound, _imports.trace], 2, "getOwnerId"], [_imports.bound, 2, "_notifyObservers"], [_imports.bound, 2, "_updateConnnectionState"], [_imports.bound, 2, "_getToken"]], []).e;
|
|
274
|
+
exports.FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|