fcr-core 3.8.2 → 3.9.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chat-connector/type.d.ts +40 -0
- package/lib/{chat-connection → chat-connector}/type.js +1 -1
- package/lib/engine/index.d.ts +10 -11
- package/lib/engine/index.js +63 -72
- package/lib/engine/type.d.ts +96 -0
- package/lib/engine/type.js +5 -0
- package/lib/imports.d.ts +7 -4
- package/lib/imports.js +30 -4
- package/lib/index.d.ts +3 -2
- package/lib/index.js +21 -2
- package/lib/media-control/desktop.js +12 -12
- package/lib/media-control/mobile.js +4 -0
- package/lib/media-control/type.d.ts +32 -33
- package/lib/monitor-control/index.js +3 -3
- package/lib/peer-session/index.js +14 -14
- package/lib/peer-session/type.d.ts +1 -1
- package/lib/plugins/chat/chatroom.js +417 -0
- package/lib/{chat-connection → plugins/chat}/config.d.ts +1 -0
- package/lib/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib/plugins/chat/connector.d.ts +38 -0
- package/lib/{chat-connection/index.js → plugins/chat/connector.js} +181 -61
- package/lib/room-control/ability-control/index.js +5 -4
- package/lib/room-control/ability-control/type.d.ts +5 -1
- package/lib/room-control/ability-control/type.js +4 -0
- package/lib/room-control/chatroom-control/type.d.ts +44 -35
- package/lib/room-control/group-control/index.js +9 -9
- package/lib/room-control/index.js +37 -22
- package/lib/room-control/interpreter-control/index.js +7 -4
- package/lib/room-control/interpreter-control/room.js +3 -3
- package/lib/room-control/interpreter-control/types.d.ts +2 -2
- package/lib/room-control/join-before-host-waitingroom-control/index.js +3 -3
- package/lib/room-control/mainroom-control/index.js +15 -13
- package/lib/room-control/privilege-control/index.js +39 -24
- package/lib/room-control/privilege-control/type.d.ts +15 -15
- package/lib/room-control/room-connector-control/index.js +7 -5
- package/lib/room-control/room-connector-control/type.d.ts +1 -1
- package/lib/room-control/room-control-factory.d.ts +3 -3
- package/lib/room-control/room-control-factory.js +7 -7
- package/lib/room-control/room-session/index.js +17 -15
- package/lib/room-control/room-session/type.d.ts +3 -3
- package/lib/room-control/sharing-control/index.js +13 -7
- package/lib/room-control/stream-control/index.js +18 -16
- package/lib/room-control/stream-control/type.d.ts +5 -5
- package/lib/room-control/stt-control/index.js +38 -31
- package/lib/room-control/type.d.ts +19 -19
- package/lib/room-control/user-control/index.js +20 -22
- package/lib/room-control/user-control/type.d.ts +1 -1
- package/lib/room-control/waitingroom-control/index.js +11 -11
- package/lib/room-control/whiteboard-control-v1/board-window.d.ts +21 -20
- package/lib/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib/room-control/whiteboard-control-v1/index.js +26 -18
- package/lib/room-control/whiteboard-control-v1/type.d.ts +26 -25
- package/lib/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +15 -6
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +4 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +6 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +7 -1
- package/lib/room-control/whiteboard-control-v2/base/index.d.ts +9 -8
- package/lib/room-control/whiteboard-control-v2/base/index.js +84 -42
- package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +16 -15
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib/room-control/whiteboard-control-v2/type.d.ts +17 -17
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +12 -6
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +64 -18
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +2 -2
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +1 -1
- package/lib/room-router/index.js +10 -7
- package/lib/room-router/type.d.ts +1 -1
- package/lib/schema.d.ts +24 -46
- package/lib/schema.js +1 -2
- package/lib/service/api.d.ts +5 -3
- package/lib/service/api.js +17 -12
- package/lib/type.d.ts +64 -45
- package/lib/type.js +76 -11
- package/lib/utilities/abortable-retry.d.ts +38 -0
- package/lib/utilities/abortable-retry.js +61 -0
- package/lib/utilities/dual-video-stream-config.d.ts +6 -0
- package/lib/utilities/dual-video-stream-config.js +25 -0
- package/lib/utilities/error-helpers.d.ts +10 -9
- package/lib/utilities/error-helpers.js +12 -11
- package/lib/utilities/error.d.ts +4 -40
- package/lib/utilities/error.js +20 -77
- package/lib/utilities/join-helper.js +2 -2
- package/lib/utilities/logger.d.ts +2 -2
- package/lib/utilities/logger.js +6 -25
- package/lib/utilities/package-info.d.ts +1 -2
- package/lib/utilities/package-info.js +4 -8
- package/lib/utilities/parameters.js +88 -15
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.d.ts +9 -0
- package/lib/utilities/video-encoder-config.js +109 -0
- package/lib-es/{chat-connection → chat-connector}/type.js +1 -1
- package/lib-es/engine/index.js +46 -56
- package/lib-es/engine/type.js +1 -0
- package/lib-es/imports.js +5 -3
- package/lib-es/index.js +2 -1
- package/lib-es/media-control/desktop.js +12 -12
- package/lib-es/media-control/mobile.js +4 -0
- package/lib-es/monitor-control/index.js +3 -3
- package/lib-es/peer-session/index.js +16 -15
- package/lib-es/plugins/chat/chatroom.js +409 -0
- package/lib-es/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib-es/{chat-connection/index.js → plugins/chat/connector.js} +178 -58
- package/lib-es/room-control/ability-control/index.js +5 -4
- package/lib-es/room-control/ability-control/type.js +4 -0
- package/lib-es/room-control/group-control/index.js +11 -10
- package/lib-es/room-control/index.js +40 -26
- package/lib-es/room-control/interpreter-control/index.js +10 -5
- package/lib-es/room-control/interpreter-control/room.js +3 -3
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -3
- package/lib-es/room-control/mainroom-control/index.js +16 -17
- package/lib-es/room-control/privilege-control/index.js +43 -29
- package/lib-es/room-control/room-connector-control/index.js +9 -6
- package/lib-es/room-control/room-control-factory.js +6 -6
- package/lib-es/room-control/room-session/index.js +21 -22
- package/lib-es/room-control/sharing-control/index.js +13 -7
- package/lib-es/room-control/stream-control/index.js +21 -18
- package/lib-es/room-control/stt-control/index.js +23 -15
- package/lib-es/room-control/user-control/index.js +23 -23
- package/lib-es/room-control/waitingroom-control/index.js +10 -9
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib-es/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib-es/room-control/whiteboard-control-v1/index.js +26 -17
- package/lib-es/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +7 -6
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +86 -42
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +60 -13
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib-es/room-router/index.js +10 -6
- package/lib-es/schema.js +1 -2
- package/lib-es/service/api.js +17 -12
- package/lib-es/type.js +70 -18
- package/lib-es/utilities/abortable-retry.js +54 -0
- package/lib-es/utilities/dual-video-stream-config.js +19 -0
- package/lib-es/utilities/error-helpers.js +13 -12
- package/lib-es/utilities/error.js +9 -75
- package/lib-es/utilities/join-helper.js +4 -3
- package/lib-es/utilities/logger.js +7 -23
- package/lib-es/utilities/package-info.js +4 -6
- package/lib-es/utilities/parameters.js +88 -15
- package/lib-es/utilities/validate-params.js +3 -2
- package/lib-es/utilities/video-encoder-config.js +103 -0
- package/package.json +7 -7
- package/lib/chat-connection/index.d.ts +0 -24
- package/lib/chat-connection/type.d.ts +0 -17
- package/lib/plugins/chatroom.js +0 -454
- package/lib/room-control/chatroom-control/config.d.ts +0 -51
- package/lib/room-control/chatroom-control/config.js +0 -105
- package/lib/utilities/storage.d.ts +0 -8
- package/lib/utilities/storage.js +0 -33
- package/lib-es/plugins/chatroom.js +0 -446
- package/lib-es/room-control/chatroom-control/config.js +0 -100
- package/lib-es/utilities/storage.js +0 -27
- /package/lib/plugins/{chatroom.d.ts → chat/chatroom.d.ts} +0 -0
|
@@ -3,6 +3,7 @@ import '@netless/appliance-plugin/dist/style.css';
|
|
|
3
3
|
import '@netless/window-manager/dist/style.css';
|
|
4
4
|
import { FcrBoardToolType } from './enum';
|
|
5
5
|
import { FcrBoardSubWindowImpl } from './board-subwindow';
|
|
6
|
+
import { FcrReturnCode } from '../../type';
|
|
6
7
|
import { FcrBoardEraserSize, FcrBoardMainWindow_V1, FcrBoardPage, FcrBoardWindowObserver } from './type';
|
|
7
8
|
import { FcrColor } from '../whiteboard-control/type';
|
|
8
9
|
export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow_V1 {
|
|
@@ -18,8 +19,8 @@ export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow_V1 {
|
|
|
18
19
|
private _destroyed;
|
|
19
20
|
constructor(room: Room);
|
|
20
21
|
getSnapshotImage(): Promise<ImageData>;
|
|
21
|
-
addObserver(observer: FcrBoardWindowObserver):
|
|
22
|
-
removeObserver(observer: FcrBoardWindowObserver):
|
|
22
|
+
addObserver(observer: FcrBoardWindowObserver): FcrReturnCode;
|
|
23
|
+
removeObserver(observer: FcrBoardWindowObserver): FcrReturnCode;
|
|
23
24
|
getContentView(): HTMLElement;
|
|
24
25
|
setScale(value: number): void;
|
|
25
26
|
openSubWindowWithTaskId(title: string, taskId: string, urlPrefix?: string): Promise<FcrBoardSubWindowImpl | undefined>;
|
|
@@ -29,24 +30,24 @@ export declare class FcrBoardMainWindowImpl implements FcrBoardMainWindow_V1 {
|
|
|
29
30
|
showIndex: number;
|
|
30
31
|
count: number;
|
|
31
32
|
};
|
|
32
|
-
addPage(): Promise<
|
|
33
|
-
removePage(): Promise<
|
|
34
|
-
prevPage(): Promise<
|
|
35
|
-
nextPage(): Promise<
|
|
36
|
-
undo(): Promise<
|
|
37
|
-
redo(): Promise<
|
|
38
|
-
clean(retainPpt?: boolean): Promise<
|
|
39
|
-
setToolType(type: FcrBoardToolType): Promise<
|
|
40
|
-
setStrokeWidth(strokeWidth: number): Promise<
|
|
41
|
-
setStrokeColor(color: FcrColor): Promise<
|
|
42
|
-
setTextColor(color: FcrColor): Promise<
|
|
43
|
-
setTextSize(size: number): Promise<
|
|
44
|
-
setFillColor(fillColor: FcrColor): Promise<
|
|
45
|
-
setEraserSize(size: FcrBoardEraserSize): Promise<
|
|
46
|
-
setBackgroundColor(color: string): Promise<
|
|
47
|
-
insertImage(resourceUrl: string, x: number, y: number, width: number, height: number): Promise<
|
|
48
|
-
insertMedia(resourceUrl: string, title?: string): Promise<
|
|
49
|
-
destroy():
|
|
33
|
+
addPage(): Promise<FcrReturnCode>;
|
|
34
|
+
removePage(): Promise<FcrReturnCode>;
|
|
35
|
+
prevPage(): Promise<FcrReturnCode>;
|
|
36
|
+
nextPage(): Promise<FcrReturnCode>;
|
|
37
|
+
undo(): Promise<number>;
|
|
38
|
+
redo(): Promise<number>;
|
|
39
|
+
clean(retainPpt?: boolean): Promise<FcrReturnCode>;
|
|
40
|
+
setToolType(type: FcrBoardToolType): Promise<FcrReturnCode>;
|
|
41
|
+
setStrokeWidth(strokeWidth: number): Promise<FcrReturnCode>;
|
|
42
|
+
setStrokeColor(color: FcrColor): Promise<FcrReturnCode>;
|
|
43
|
+
setTextColor(color: FcrColor): Promise<FcrReturnCode>;
|
|
44
|
+
setTextSize(size: number): Promise<FcrReturnCode>;
|
|
45
|
+
setFillColor(fillColor: FcrColor): Promise<FcrReturnCode>;
|
|
46
|
+
setEraserSize(size: FcrBoardEraserSize): Promise<FcrReturnCode>;
|
|
47
|
+
setBackgroundColor(color: string): Promise<FcrReturnCode>;
|
|
48
|
+
insertImage(resourceUrl: string, x: number, y: number, width: number, height: number): Promise<FcrReturnCode>;
|
|
49
|
+
insertMedia(resourceUrl: string, title?: string): Promise<FcrReturnCode>;
|
|
50
|
+
destroy(): FcrReturnCode;
|
|
50
51
|
getWritable(): boolean;
|
|
51
52
|
private _convertToScenes;
|
|
52
53
|
private _preCheck;
|
|
@@ -40,9 +40,10 @@ var _imports = require("../../imports");
|
|
|
40
40
|
var _boardSubwindow = require("./board-subwindow");
|
|
41
41
|
var _fullWorker = _interopRequireDefault(require("@netless/appliance-plugin/dist/fullWorker.js?raw"));
|
|
42
42
|
var _subWorker = _interopRequireDefault(require("@netless/appliance-plugin/dist/subWorker.js?raw"));
|
|
43
|
+
var _type = require("../../type");
|
|
43
44
|
var _lodash = require("lodash");
|
|
44
45
|
var _imports2 = require("agora-rte-sdk/lib/imports");
|
|
45
|
-
let _initProto; //@ts-ignore
|
|
46
|
+
let _initProto, _cleanDecs, _setToolTypeDecs, _setStrokeWidthDecs, _setStrokeColorDecs, _setTextColorDecs, _setTextSizeDecs, _setFillColorDecs, _setEraserSizeDecs, _setBackgroundColorDecs, _insertImageDecs, _insertMediaDecs, _mountDecs; //@ts-ignore
|
|
46
47
|
//@ts-ignore
|
|
47
48
|
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)]; } }; }
|
|
48
49
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -51,9 +52,9 @@ function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.descrip
|
|
|
51
52
|
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; }
|
|
52
53
|
class FcrBoardMainWindowImpl {
|
|
53
54
|
static {
|
|
54
|
-
[_initProto] = _applyDecs(this, [[[_imports.bound, _imports.trace], 2, "getSnapshotImage"], [_imports.trace, 2, "addObserver"], [_imports.trace, 2, "removeObserver"], [_imports.trace, 2, "getContentView"], [_imports.bound, 2, "setScale"], [_imports.bound, 2, "openSubWindowWithTaskId"], [_imports.bound, 2, "openSubWindowWithPageList"], [_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"], [
|
|
55
|
+
[_initProto] = _applyDecs(this, [[[_imports.bound, _imports.trace], 2, "getSnapshotImage"], [_imports.trace, 2, "addObserver"], [_imports.trace, 2, "removeObserver"], [_imports.trace, 2, "getContentView"], [_imports.bound, 2, "setScale"], [_imports.bound, 2, "openSubWindowWithTaskId"], [_imports.bound, 2, "openSubWindowWithPageList"], [_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"], [_setFillColorDecs, 2, "setFillColor"], [_setEraserSizeDecs, 2, "setEraserSize"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [_insertImageDecs, 2, "insertImage"], [_insertMediaDecs, 2, "insertMedia"], [_imports.trace, 2, "destroy"], [_imports.trace, 2, "getWritable"], [_mountDecs, 2, "_mount"], [_imports.trace, 2, "_setRoom"]], []).e;
|
|
55
56
|
}
|
|
56
|
-
logger = (_initProto(this), (0, _logger.createLogger)({
|
|
57
|
+
[(_cleanDecs = [_imports.bound, (0, _imports.trace)(['retainPpt'])], _setToolTypeDecs = [_imports.bound, (0, _imports.trace)(['type'])], _setStrokeWidthDecs = [_imports.bound, (0, _imports.trace)(['strokeWidth'])], _setStrokeColorDecs = [_imports.bound, (0, _imports.trace)(['color'])], _setTextColorDecs = [_imports.bound, (0, _imports.trace)(['color'])], _setTextSizeDecs = [_imports.bound, (0, _imports.trace)(['size'])], _setFillColorDecs = [_imports.bound, (0, _imports.trace)(['fillColor'])], _setEraserSizeDecs = [_imports.bound, (0, _imports.trace)(['size'])], _setBackgroundColorDecs = [_imports.bound, (0, _imports.trace)(['color'])], _insertImageDecs = [_imports.bound, (0, _imports.trace)(['resourceUrl', 'x', 'y', 'width', 'height'])], _insertMediaDecs = [_imports.bound, (0, _imports.trace)(['resourceUrl', 'title'])], _mountDecs = (0, _imports.trace)(['options', 'params']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
57
58
|
prefix: 'FcrBoardMainWindowImpl'
|
|
58
59
|
}));
|
|
59
60
|
_memberState = {};
|
|
@@ -97,7 +98,7 @@ class FcrBoardMainWindowImpl {
|
|
|
97
98
|
return result;
|
|
98
99
|
}
|
|
99
100
|
} catch (e) {
|
|
100
|
-
this.logger.error('
|
|
101
|
+
this.logger.error('failed to take snapshot', e);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
}
|
|
@@ -105,9 +106,11 @@ class FcrBoardMainWindowImpl {
|
|
|
105
106
|
}
|
|
106
107
|
addObserver(observer) {
|
|
107
108
|
this._observable.addObserver(observer);
|
|
109
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
108
110
|
}
|
|
109
111
|
removeObserver(observer) {
|
|
110
112
|
this._observable.removeObserver(observer);
|
|
113
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
111
114
|
}
|
|
112
115
|
getContentView() {
|
|
113
116
|
return this._whiteView;
|
|
@@ -168,36 +171,40 @@ class FcrBoardMainWindowImpl {
|
|
|
168
171
|
await this._windowManager.addPage();
|
|
169
172
|
await this._windowManager.nextPage();
|
|
170
173
|
}
|
|
174
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
171
175
|
}
|
|
172
176
|
async removePage() {
|
|
173
177
|
this._preCheck();
|
|
174
178
|
if (this._windowManager?.removePage) {
|
|
175
179
|
await this._windowManager.removePage();
|
|
176
180
|
}
|
|
181
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
177
182
|
}
|
|
178
183
|
async prevPage() {
|
|
179
184
|
this._preCheck();
|
|
180
185
|
if (this._windowManager?.prevPage) {
|
|
181
186
|
await this._windowManager.prevPage();
|
|
182
187
|
}
|
|
188
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
183
189
|
}
|
|
184
190
|
async nextPage() {
|
|
185
191
|
this._preCheck();
|
|
186
192
|
if (this._windowManager?.nextPage) {
|
|
187
193
|
await this._windowManager.nextPage();
|
|
188
194
|
}
|
|
195
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
189
196
|
}
|
|
190
197
|
async undo() {
|
|
191
198
|
this._preCheck({
|
|
192
199
|
wm: false
|
|
193
200
|
});
|
|
194
|
-
this._whiteBoardroom.undo();
|
|
201
|
+
return this._whiteBoardroom.undo();
|
|
195
202
|
}
|
|
196
203
|
async redo() {
|
|
197
204
|
this._preCheck({
|
|
198
205
|
wm: false
|
|
199
206
|
});
|
|
200
|
-
this._whiteBoardroom.redo();
|
|
207
|
+
return this._whiteBoardroom.redo();
|
|
201
208
|
}
|
|
202
209
|
async clean(retainPpt) {
|
|
203
210
|
this._preCheck({
|
|
@@ -205,6 +212,7 @@ class FcrBoardMainWindowImpl {
|
|
|
205
212
|
});
|
|
206
213
|
// this._whiteBoardroom?.cleanScene?.(true); // new version methods
|
|
207
214
|
this._whiteBoardroom.cleanCurrentScene(retainPpt);
|
|
215
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
208
216
|
}
|
|
209
217
|
async setToolType(type) {
|
|
210
218
|
this._preCheck({
|
|
@@ -224,6 +232,7 @@ class FcrBoardMainWindowImpl {
|
|
|
224
232
|
if (this._windowManager) {
|
|
225
233
|
this._appliancePluginInstance?.setMemberState(change);
|
|
226
234
|
}
|
|
235
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
227
236
|
}
|
|
228
237
|
async setStrokeWidth(strokeWidth) {
|
|
229
238
|
this._preCheck();
|
|
@@ -237,6 +246,7 @@ class FcrBoardMainWindowImpl {
|
|
|
237
246
|
if (this._windowManager) {
|
|
238
247
|
this._whiteBoardroom.setMemberState(change);
|
|
239
248
|
}
|
|
249
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
240
250
|
}
|
|
241
251
|
async setStrokeColor(color) {
|
|
242
252
|
this._preCheck();
|
|
@@ -251,6 +261,7 @@ class FcrBoardMainWindowImpl {
|
|
|
251
261
|
if (this._windowManager) {
|
|
252
262
|
this._whiteBoardroom.setMemberState(change);
|
|
253
263
|
}
|
|
264
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
254
265
|
}
|
|
255
266
|
async setTextColor(color) {
|
|
256
267
|
this._preCheck();
|
|
@@ -265,6 +276,7 @@ class FcrBoardMainWindowImpl {
|
|
|
265
276
|
if (this._windowManager) {
|
|
266
277
|
this._whiteBoardroom.setMemberState(change);
|
|
267
278
|
}
|
|
279
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
268
280
|
}
|
|
269
281
|
async setTextSize(size) {
|
|
270
282
|
this._preCheck();
|
|
@@ -278,6 +290,7 @@ class FcrBoardMainWindowImpl {
|
|
|
278
290
|
if (this._windowManager) {
|
|
279
291
|
this._whiteBoardroom.setMemberState(change);
|
|
280
292
|
}
|
|
293
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
281
294
|
}
|
|
282
295
|
async setFillColor(fillColor) {
|
|
283
296
|
this._preCheck();
|
|
@@ -292,6 +305,7 @@ class FcrBoardMainWindowImpl {
|
|
|
292
305
|
if (this._windowManager) {
|
|
293
306
|
this._whiteBoardroom.setMemberState(change);
|
|
294
307
|
}
|
|
308
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
295
309
|
}
|
|
296
310
|
async setEraserSize(size) {
|
|
297
311
|
this._preCheck();
|
|
@@ -305,11 +319,13 @@ class FcrBoardMainWindowImpl {
|
|
|
305
319
|
if (this._windowManager) {
|
|
306
320
|
this._whiteBoardroom.setMemberState(change);
|
|
307
321
|
}
|
|
322
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
308
323
|
}
|
|
309
324
|
async setBackgroundColor(color) {
|
|
310
325
|
this._preCheck();
|
|
311
326
|
this._backgroundColor = color;
|
|
312
327
|
this._whiteView.querySelector('.netless-whiteboard')?.style.setProperty('background-color', color);
|
|
328
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
313
329
|
}
|
|
314
330
|
async insertImage(resourceUrl, x, y, width, height) {
|
|
315
331
|
const room = this._whiteBoardroom;
|
|
@@ -353,6 +369,7 @@ class FcrBoardMainWindowImpl {
|
|
|
353
369
|
room.insertImage(imageInfo);
|
|
354
370
|
room.completeImageUpload(uuid, resourceUrl);
|
|
355
371
|
}
|
|
372
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
356
373
|
}
|
|
357
374
|
async insertMedia(resourceUrl, title) {
|
|
358
375
|
const windowManager = this._windowManager;
|
|
@@ -369,6 +386,7 @@ class FcrBoardMainWindowImpl {
|
|
|
369
386
|
}
|
|
370
387
|
});
|
|
371
388
|
}
|
|
389
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
372
390
|
}
|
|
373
391
|
destroy() {
|
|
374
392
|
if (this._windowManager) {
|
|
@@ -376,6 +394,7 @@ class FcrBoardMainWindowImpl {
|
|
|
376
394
|
this._windowManager = undefined;
|
|
377
395
|
}
|
|
378
396
|
this._destroyed = true;
|
|
397
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
379
398
|
}
|
|
380
399
|
getWritable() {
|
|
381
400
|
return this._whiteBoardroom.isWritable;
|
|
@@ -529,7 +548,7 @@ class FcrBoardMainWindowImpl {
|
|
|
529
548
|
});
|
|
530
549
|
}
|
|
531
550
|
}).catch(e => {
|
|
532
|
-
this.logger.error('
|
|
551
|
+
this.logger.error('failed to mount', e);
|
|
533
552
|
}).finally(() => {
|
|
534
553
|
this.logger.info('[FcrBoardMainWindow] finish mount board window, white room id:', this._whiteBoardroom.uuid);
|
|
535
554
|
_mountManager.BoardMountManager.setIsMounting(false);
|
|
@@ -554,7 +573,7 @@ class FcrBoardMainWindowImpl {
|
|
|
554
573
|
room.setMemberState(this._memberState);
|
|
555
574
|
}
|
|
556
575
|
_addLogObserver() {
|
|
557
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onWritable', 'onPageInfoUpdated', 'onUndoStateUpdated', 'onRedoStateUpdated']));
|
|
576
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onWritable', ['isWritable']], ['onPageInfoUpdated', ['info']], ['onUndoStateUpdated', ['enable']], ['onRedoStateUpdated', ['enable']]]));
|
|
558
577
|
}
|
|
559
578
|
}
|
|
560
579
|
exports.FcrBoardMainWindowImpl = FcrBoardMainWindowImpl;
|
|
@@ -12,7 +12,7 @@ class FcrWhiteboardControlFactoryImpl {
|
|
|
12
12
|
});
|
|
13
13
|
constructor() {}
|
|
14
14
|
createForMainProcess(hasOperationPrivilege, scene, api, sharedCache) {
|
|
15
|
-
this.logger.info('
|
|
15
|
+
this.logger.info('create for main process, use old whiteboard control');
|
|
16
16
|
return new _.FcrWhiteboardControlImpl(scene, api, sharedCache, hasOperationPrivilege);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -27,23 +27,24 @@ exports.FcrWhiteboardControlImpl = void 0;
|
|
|
27
27
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
28
28
|
require("core-js/modules/esnext.iterator.map.js");
|
|
29
29
|
var _appSlide = _interopRequireDefault(require("@netless/app-slide"));
|
|
30
|
-
var
|
|
30
|
+
var _appliancePlugin = require("@netless/appliance-plugin");
|
|
31
31
|
var netlessVideoPlugin = _interopRequireWildcard(require("@netless/video-js-plugin"));
|
|
32
32
|
var _windowManager = require("@netless/window-manager");
|
|
33
|
-
var _appliancePlugin = require("@netless/appliance-plugin");
|
|
34
|
-
var _utils = require("./utils");
|
|
35
|
-
var _observable = require("agora-foundation/lib/utilities/observable");
|
|
36
|
-
var _boardWindow = require("./board-window");
|
|
37
|
-
var _type = require("../whiteboard-control/type");
|
|
38
33
|
var _decorator = require("agora-foundation/lib/decorator");
|
|
39
|
-
var _user = require("../../utilities/user");
|
|
40
|
-
var _2 = require("../..");
|
|
41
|
-
var _logger = require("../../utilities/logger");
|
|
42
34
|
var _imports = require("../../imports");
|
|
43
|
-
var
|
|
35
|
+
var _observable = require("agora-foundation/lib/utilities/observable");
|
|
44
36
|
var _imports2 = require("agora-rte-sdk/lib/imports");
|
|
37
|
+
var _whiteWebSdk = require("white-web-sdk");
|
|
38
|
+
var _2 = require("../..");
|
|
39
|
+
var _type = require("../../type");
|
|
40
|
+
var _error = require("../../utilities/error");
|
|
41
|
+
var _logger = require("../../utilities/logger");
|
|
42
|
+
var _user = require("../../utilities/user");
|
|
45
43
|
var _type2 = require("../sharing-control/type");
|
|
46
|
-
|
|
44
|
+
var _type3 = require("../whiteboard-control/type");
|
|
45
|
+
var _boardWindow = require("./board-window");
|
|
46
|
+
var _utils = require("./utils");
|
|
47
|
+
let _initProto, _openDecs, _setBackgroundColorDecs, _setOperationPrivilegeDecs, _setBoardWritableDecs;
|
|
47
48
|
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); }
|
|
48
49
|
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
50
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
@@ -55,9 +56,9 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
55
56
|
*/
|
|
56
57
|
class FcrWhiteboardControlImpl {
|
|
57
58
|
static {
|
|
58
|
-
[_initProto] = _applyDecs(this, [[[_decorator.bound, _imports.trace], 2, "active"], [[_decorator.bound, _imports.trace], 2, "inactive"], [
|
|
59
|
+
[_initProto] = _applyDecs(this, [[[_decorator.bound, _imports.trace], 2, "active"], [[_decorator.bound, _imports.trace], 2, "inactive"], [_openDecs, 2, "open"], [[_decorator.bound, _imports.trace], 2, "close"], [_setBackgroundColorDecs, 2, "setBackgroundColor"], [[_decorator.bound, _imports.trace], 2, "getActivity"], [[_decorator.bound, _imports.trace], 2, "getOwnerId"], [[_decorator.bound, _imports.trace], 2, "getBackgroundColor"], [[_decorator.bound, _imports.trace], 2, "getConnectionState"], [[_decorator.bound, _imports.trace], 2, "getMainWindow"], [[_decorator.bound, _imports.trace], 2, "addObserver"], [[_decorator.bound, _imports.trace], 2, "removeObserver"], [[_decorator.bound, _imports.trace], 2, "getBoardActiveInfo"], [[_decorator.bound, _imports.trace], 2, "hasOperationPrivilege"], [_setOperationPrivilegeDecs, 2, "setOperationPrivilege"], [_setBoardWritableDecs, 2, "_setBoardWritable"], [_decorator.bound, 2, "_getToken"], [_decorator.bound, 2, "_handleRoomStateUpdated"], [_decorator.bound, 2, "_updateConnnectionState"], [_decorator.bound, 2, "_handleConnectionStateUpdated"], [_imports.trace, 2, "_connect"], [_imports.trace, 2, "_clean"]], []).e;
|
|
59
60
|
}
|
|
60
|
-
logger = (_initProto(this), (0, _logger.createLogger)({
|
|
61
|
+
[(_openDecs = [_decorator.bound, (0, _imports.trace)(['params'])], _setBackgroundColorDecs = [_decorator.bound, (0, _imports.trace)(['backgroundColor'])], _setOperationPrivilegeDecs = [_decorator.bound, (0, _imports.trace)(['hasPrivilege'])], _setBoardWritableDecs = (0, _imports.trace)(['granted']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
61
62
|
prefix: 'FcrWhiteboardControlImpl'
|
|
62
63
|
}));
|
|
63
64
|
_client = {};
|
|
@@ -108,10 +109,10 @@ class FcrWhiteboardControlImpl {
|
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
111
|
async active() {
|
|
111
|
-
return (0, _error.handleRequestError)(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, _type2.FcrSharePermissionState.ON),
|
|
112
|
+
return (0, _error.handleRequestError)(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, _type2.FcrSharePermissionState.ON), _imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'active failed');
|
|
112
113
|
}
|
|
113
114
|
async inactive() {
|
|
114
|
-
return (0, _error.handleRequestError)(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, _type2.FcrSharePermissionState.OFF),
|
|
115
|
+
return (0, _error.handleRequestError)(() => this._api.toggleWhiteboardActivityState(this._scene.sceneId, _type2.FcrSharePermissionState.OFF), _imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'inactive failed');
|
|
115
116
|
}
|
|
116
117
|
async open(params = {}) {
|
|
117
118
|
this._whiteboardPrivateParameters = params;
|
|
@@ -127,12 +128,14 @@ class FcrWhiteboardControlImpl {
|
|
|
127
128
|
async close() {
|
|
128
129
|
this._joined = false;
|
|
129
130
|
await this._clean();
|
|
131
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
130
132
|
}
|
|
131
133
|
async setBackgroundColor(backgroundColor) {
|
|
132
134
|
await this._api.setBackgroundColor({
|
|
133
135
|
roomId: this._scene.sceneId,
|
|
134
136
|
backgroundColor
|
|
135
137
|
});
|
|
138
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
136
139
|
}
|
|
137
140
|
getActivity() {
|
|
138
141
|
return this._scene.getScenePropertiesByKeyPath('widgets.netlessBoard').state === 1;
|
|
@@ -151,9 +154,11 @@ class FcrWhiteboardControlImpl {
|
|
|
151
154
|
}
|
|
152
155
|
addObserver(observer) {
|
|
153
156
|
this._observable.addObserver(observer);
|
|
157
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
154
158
|
}
|
|
155
159
|
removeObserver(observer) {
|
|
156
160
|
this._observable.removeObserver(observer);
|
|
161
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
157
162
|
}
|
|
158
163
|
getBoardActiveInfo() {
|
|
159
164
|
const {
|
|
@@ -163,7 +168,7 @@ class FcrWhiteboardControlImpl {
|
|
|
163
168
|
isActive: false,
|
|
164
169
|
ownerUserUuid: null
|
|
165
170
|
};
|
|
166
|
-
if (state ===
|
|
171
|
+
if (state === _type3.FcrBoardPropertiesState.ACTIVE) {
|
|
167
172
|
return {
|
|
168
173
|
isActive: true,
|
|
169
174
|
ownerUserId
|
|
@@ -183,6 +188,7 @@ class FcrWhiteboardControlImpl {
|
|
|
183
188
|
this._hasOperationPrivilege = hasPrivilege;
|
|
184
189
|
this._setBoardWritable(hasPrivilege);
|
|
185
190
|
}
|
|
191
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
186
192
|
}
|
|
187
193
|
async _setBoardWritable(granted) {
|
|
188
194
|
if (this._room) {
|
|
@@ -211,6 +217,7 @@ class FcrWhiteboardControlImpl {
|
|
|
211
217
|
}
|
|
212
218
|
}
|
|
213
219
|
}
|
|
220
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
214
221
|
}
|
|
215
222
|
_createPlugins() {
|
|
216
223
|
const plugins = (0, _whiteWebSdk.createPlugins)({
|
|
@@ -226,7 +233,7 @@ class FcrWhiteboardControlImpl {
|
|
|
226
233
|
return await (0, _error.handleRequestError)(() => this._api.getWhiteboardToken({
|
|
227
234
|
roomId,
|
|
228
235
|
userId
|
|
229
|
-
}),
|
|
236
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'get whiteboard token failed');
|
|
230
237
|
}
|
|
231
238
|
_handleRoomStateUpdated(state) {
|
|
232
239
|
const {
|
|
@@ -420,9 +427,10 @@ class FcrWhiteboardControlImpl {
|
|
|
420
427
|
}
|
|
421
428
|
this._room = undefined;
|
|
422
429
|
}
|
|
430
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
423
431
|
}
|
|
424
432
|
_addLogObserver() {
|
|
425
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onActive', 'onInactive', 'onBackgroundColorUpdated', 'onConnectionStateUpdated']));
|
|
433
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onActive', ['ownerId', 'operatorUser']], ['onInactive', ['reason', 'operatorUser']], ['onBackgroundColorUpdated', ['color', 'operatorUser']], ['onConnectionStateUpdated', ['state']]]));
|
|
426
434
|
}
|
|
427
435
|
}
|
|
428
436
|
exports.FcrWhiteboardControlImpl = FcrWhiteboardControlImpl;
|
|
@@ -54,7 +54,7 @@ export interface FcrWhiteboardControl {
|
|
|
54
54
|
* Sets whether the user has the permission to draw on the whiteboard.
|
|
55
55
|
* @param hasPrivilege
|
|
56
56
|
*/
|
|
57
|
-
setOperationPrivilege(hasPrivilege: boolean):
|
|
57
|
+
setOperationPrivilege(hasPrivilege: boolean): number;
|
|
58
58
|
/**
|
|
59
59
|
* Opens the whiteboard and creates a main window.
|
|
60
60
|
*/
|
|
@@ -62,7 +62,7 @@ export interface FcrWhiteboardControl {
|
|
|
62
62
|
/**
|
|
63
63
|
* Closes the whiteboard and releases the main window.
|
|
64
64
|
*/
|
|
65
|
-
close(): Promise<
|
|
65
|
+
close(): Promise<number>;
|
|
66
66
|
/**
|
|
67
67
|
* Activates the whiteboard.
|
|
68
68
|
*/
|
|
@@ -87,7 +87,7 @@ export interface FcrWhiteboardControl {
|
|
|
87
87
|
* Sets the background color of the whiteboard.
|
|
88
88
|
* @param color
|
|
89
89
|
*/
|
|
90
|
-
setBackgroundColor(color: string): Promise<
|
|
90
|
+
setBackgroundColor(color: string): Promise<number>;
|
|
91
91
|
/**
|
|
92
92
|
* Gets the background color of the whiteboard.
|
|
93
93
|
*/
|
|
@@ -104,12 +104,12 @@ export interface FcrWhiteboardControl {
|
|
|
104
104
|
* Adds an observer to the whiteboard.
|
|
105
105
|
* @param observer
|
|
106
106
|
*/
|
|
107
|
-
addObserver(observer: FcrWhiteboardObserver):
|
|
107
|
+
addObserver(observer: FcrWhiteboardObserver): number;
|
|
108
108
|
/**
|
|
109
109
|
* Removes the observer from the whiteboard.
|
|
110
110
|
* @param observer
|
|
111
111
|
*/
|
|
112
|
-
removeObserver(observer: FcrWhiteboardObserver):
|
|
112
|
+
removeObserver(observer: FcrWhiteboardObserver): number;
|
|
113
113
|
}
|
|
114
114
|
export interface FcrBoardSubWindow {
|
|
115
115
|
exportPdf(): Promise<ArrayBuffer>;
|
|
@@ -117,29 +117,30 @@ export interface FcrBoardSubWindow {
|
|
|
117
117
|
export declare enum FcrBoardEraserSize {
|
|
118
118
|
SMALL = 1,
|
|
119
119
|
MEDIUM = 2,
|
|
120
|
-
LARGE = 3
|
|
120
|
+
LARGE = 3,
|
|
121
|
+
GIANT = 4
|
|
121
122
|
}
|
|
122
123
|
export interface FcrBoardMainWindow_V1 {
|
|
123
124
|
/**
|
|
124
125
|
* Adds a page.
|
|
125
126
|
*/
|
|
126
|
-
addPage(): Promise<
|
|
127
|
+
addPage(): Promise<number>;
|
|
127
128
|
/**
|
|
128
129
|
* Removes a page.
|
|
129
130
|
*/
|
|
130
|
-
removePage(): Promise<
|
|
131
|
+
removePage(): Promise<number>;
|
|
131
132
|
/**
|
|
132
133
|
* Undoes the operation.
|
|
133
134
|
*/
|
|
134
|
-
undo(): Promise<
|
|
135
|
+
undo(): Promise<number>;
|
|
135
136
|
/**
|
|
136
137
|
* Redoes the operation.
|
|
137
138
|
*/
|
|
138
|
-
redo(): Promise<
|
|
139
|
+
redo(): Promise<number>;
|
|
139
140
|
/**
|
|
140
141
|
* Cleans the whiteboard.
|
|
141
142
|
*/
|
|
142
|
-
clean(): Promise<
|
|
143
|
+
clean(): Promise<number>;
|
|
143
144
|
/**
|
|
144
145
|
* Gets the snapshot image of the whiteboard.
|
|
145
146
|
*/
|
|
@@ -148,7 +149,7 @@ export interface FcrBoardMainWindow_V1 {
|
|
|
148
149
|
* Sets the background color of the whiteboard.
|
|
149
150
|
* @param color
|
|
150
151
|
*/
|
|
151
|
-
setBackgroundColor(color: string): Promise<
|
|
152
|
+
setBackgroundColor(color: string): Promise<number>;
|
|
152
153
|
/**
|
|
153
154
|
* Gets page info.
|
|
154
155
|
*/
|
|
@@ -156,46 +157,46 @@ export interface FcrBoardMainWindow_V1 {
|
|
|
156
157
|
/**
|
|
157
158
|
* Navigates to the previous page.
|
|
158
159
|
*/
|
|
159
|
-
prevPage(): Promise<
|
|
160
|
+
prevPage(): Promise<number>;
|
|
160
161
|
/**
|
|
161
162
|
* Navigate to the next page.
|
|
162
163
|
*/
|
|
163
|
-
nextPage(): Promise<
|
|
164
|
+
nextPage(): Promise<number>;
|
|
164
165
|
/**
|
|
165
166
|
* Sets the tool type.
|
|
166
167
|
* @param type
|
|
167
168
|
*/
|
|
168
|
-
setToolType(type: FcrBoardToolType): Promise<
|
|
169
|
+
setToolType(type: FcrBoardToolType): Promise<number>;
|
|
169
170
|
/**
|
|
170
171
|
* Sets the stroke width.
|
|
171
172
|
* @param strokeWidth
|
|
172
173
|
*/
|
|
173
|
-
setStrokeWidth(strokeWidth: number): Promise<
|
|
174
|
+
setStrokeWidth(strokeWidth: number): Promise<number>;
|
|
174
175
|
/**
|
|
175
176
|
* Sets the stroke color.
|
|
176
177
|
* @param color
|
|
177
178
|
*/
|
|
178
|
-
setStrokeColor(color: FcrColor): Promise<
|
|
179
|
+
setStrokeColor(color: FcrColor): Promise<number>;
|
|
179
180
|
/**
|
|
180
181
|
* Sets the text color.
|
|
181
182
|
* @param color
|
|
182
183
|
*/
|
|
183
|
-
setTextColor(color: FcrColor): Promise<
|
|
184
|
+
setTextColor(color: FcrColor): Promise<number>;
|
|
184
185
|
/**
|
|
185
186
|
* Sets the text size.
|
|
186
187
|
* @param textSize
|
|
187
188
|
*/
|
|
188
|
-
setTextSize(textSize: number): Promise<
|
|
189
|
+
setTextSize(textSize: number): Promise<number>;
|
|
189
190
|
/**
|
|
190
191
|
* Sets the fill color.
|
|
191
192
|
* @param color
|
|
192
193
|
*/
|
|
193
|
-
setFillColor(color: FcrColor): Promise<
|
|
194
|
+
setFillColor(color: FcrColor): Promise<number>;
|
|
194
195
|
/**
|
|
195
196
|
* Set eraser size.
|
|
196
197
|
* @param size small: 1, medium: 2, large: 3
|
|
197
198
|
*/
|
|
198
|
-
setEraserSize(size: FcrBoardEraserSize): Promise<
|
|
199
|
+
setEraserSize(size: FcrBoardEraserSize): Promise<number>;
|
|
199
200
|
/**
|
|
200
201
|
* Inserts an image.
|
|
201
202
|
* @param resourceUrl
|
|
@@ -204,13 +205,13 @@ export interface FcrBoardMainWindow_V1 {
|
|
|
204
205
|
* @param width
|
|
205
206
|
* @param height
|
|
206
207
|
*/
|
|
207
|
-
insertImage(resourceUrl: string, x: number, y: number, width: number, height: number): Promise<
|
|
208
|
+
insertImage(resourceUrl: string, x: number, y: number, width: number, height: number): Promise<number>;
|
|
208
209
|
/**
|
|
209
210
|
* Inserts a media.
|
|
210
211
|
* @param resourceUrl
|
|
211
212
|
* @param title
|
|
212
213
|
*/
|
|
213
|
-
insertMedia(resourceUrl: string, title?: string): Promise<
|
|
214
|
+
insertMedia(resourceUrl: string, title?: string): Promise<number>;
|
|
214
215
|
/**
|
|
215
216
|
* Gets the content view.
|
|
216
217
|
*/
|
|
@@ -246,12 +247,12 @@ export interface FcrBoardMainWindow_V1 {
|
|
|
246
247
|
* Adds an observer to the main window.
|
|
247
248
|
* @param observer
|
|
248
249
|
*/
|
|
249
|
-
addObserver(observer: FcrBoardWindowObserver):
|
|
250
|
+
addObserver(observer: FcrBoardWindowObserver): number;
|
|
250
251
|
/**
|
|
251
252
|
* Removes the observer from the main window.
|
|
252
253
|
* @param observer
|
|
253
254
|
*/
|
|
254
|
-
removeObserver(observer: FcrBoardWindowObserver):
|
|
255
|
+
removeObserver(observer: FcrBoardWindowObserver): number;
|
|
255
256
|
}
|
|
256
257
|
export type FcrBoardWindowObserver = {
|
|
257
258
|
/**
|
|
@@ -9,5 +9,6 @@ let FcrBoardEraserSize = exports.FcrBoardEraserSize = /*#__PURE__*/function (Fcr
|
|
|
9
9
|
FcrBoardEraserSize[FcrBoardEraserSize["SMALL"] = 1] = "SMALL";
|
|
10
10
|
FcrBoardEraserSize[FcrBoardEraserSize["MEDIUM"] = 2] = "MEDIUM";
|
|
11
11
|
FcrBoardEraserSize[FcrBoardEraserSize["LARGE"] = 3] = "LARGE";
|
|
12
|
+
FcrBoardEraserSize[FcrBoardEraserSize["GIANT"] = 4] = "GIANT";
|
|
12
13
|
return FcrBoardEraserSize;
|
|
13
14
|
}({});
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import { FcrBaseWhiteboardObserver, FcrObjectForgeInitConfig } from '../type';
|
|
2
|
-
import { FcrAnnotationControl, FcrStandaloneAnnotationControl } from './type';
|
|
3
|
-
import { FcrBaseWhiteboardControlImpl } from '../base';
|
|
4
1
|
import { WhiteboardOption } from '@netless/forge-whiteboard';
|
|
5
|
-
import { FcrBoardConfig } from '../whiteboard-control/type';
|
|
6
2
|
import type { RTMClient } from 'agora-rtm';
|
|
3
|
+
import { FcrCoreServiceApi } from '../../../service/api';
|
|
4
|
+
import { FcrBaseWhiteboardControlImpl } from '../base';
|
|
5
|
+
import { FcrBaseWhiteboardObserver, FcrBoardMainWindow, FcrObjectForgeInitConfig } from '../type';
|
|
6
|
+
import { FcrAnnotationConfig, FcrAnnotationControl, FcrAnnotationSceneConfig, FcrStandaloneAnnotationControl } from './type';
|
|
7
7
|
export declare class FcrAnnotationControlImpl extends FcrBaseWhiteboardControlImpl<FcrBaseWhiteboardObserver> implements FcrAnnotationControl {
|
|
8
8
|
protected rtmClient: RTMClient;
|
|
9
|
-
protected config:
|
|
9
|
+
protected config: FcrAnnotationConfig;
|
|
10
|
+
private _sceneConfig;
|
|
11
|
+
private _api;
|
|
10
12
|
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
11
|
-
constructor(rtmClient: RTMClient, config:
|
|
13
|
+
constructor(rtmClient: RTMClient, config: FcrAnnotationConfig, hasOperationPrivilege: boolean, forgeInitConfigFetcher: () => Promise<FcrObjectForgeInitConfig>, _sceneConfig: FcrAnnotationSceneConfig, _api: FcrCoreServiceApi);
|
|
14
|
+
syncScreenShareOwnerAnnotationOpenDone(): Promise<number>;
|
|
15
|
+
open(): Promise<FcrBoardMainWindow>;
|
|
12
16
|
protected getApplicationId(): string;
|
|
13
17
|
protected getWhiteboardOption(): WhiteboardOption;
|
|
14
18
|
}
|
|
15
19
|
export declare class FcrStandaloneAnnotationControlImpl extends FcrBaseWhiteboardControlImpl<FcrBaseWhiteboardObserver> implements FcrStandaloneAnnotationControl {
|
|
20
|
+
protected rtmClient: RTMClient;
|
|
21
|
+
protected config: FcrAnnotationConfig;
|
|
22
|
+
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
23
|
+
constructor(rtmClient: RTMClient, config: FcrAnnotationConfig, hasOperationPrivilege: boolean, forgeInitConfigFetcher: () => Promise<FcrObjectForgeInitConfig>);
|
|
24
|
+
open(): Promise<FcrBoardMainWindow>;
|
|
16
25
|
protected getApplicationId(): string;
|
|
17
26
|
protected getWhiteboardOption(): WhiteboardOption;
|
|
18
27
|
}
|