fcr-ui-scene 3.7.7-rc.1 → 3.7.8
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/creator/provider-initializer.browser.js +2 -2
- package/lib/creator/provider-initializer.electron.js +2 -2
- package/lib/creator.d.ts +36 -0
- package/lib/creator.js +465 -0
- package/lib/electron/bootstrap-sdk.js +70 -33
- package/lib/electron/hang-detection/index.d.ts +3 -0
- package/lib/electron/hang-detection/index.js +15 -0
- package/lib/electron/hang-detection/manager.d.ts +28 -0
- package/lib/electron/hang-detection/manager.js +231 -0
- package/lib/electron/hang-detection/types.d.ts +14 -0
- package/lib/electron/hang-detection/types.js +6 -0
- package/lib/electron/until.d.ts +1 -4
- package/lib/electron/until.js +9 -4
- package/lib/modules/action-bar/components/screen-share/index.electron.js +1 -1
- package/lib/modules/action-bar/index.d.ts +56 -0
- package/lib/modules/action-bar/index.dev.d.ts +0 -0
- package/lib/modules/action-bar/index.dev.js +94 -0
- package/lib/modules/action-bar/index.js +108 -0
- package/lib/modules/action-bar/store.d.ts +256 -0
- package/lib/modules/action-bar/store.js +1572 -0
- package/lib/modules/action-bar/types.d.ts +90 -0
- package/lib/modules/action-bar/types.js +6 -0
- package/lib/modules/action-bar/view.d.ts +5 -0
- package/lib/modules/action-bar/view.js +112 -0
- package/lib/modules/annotation/annotation-index.d.ts +2 -0
- package/lib/modules/annotation/annotation-index.js +80 -0
- package/lib/modules/annotation/annotation-toolbar-store.d.ts +75 -0
- package/lib/modules/annotation/annotation-toolbar-store.js +459 -0
- package/lib/modules/annotation/board-cursor.css +77 -0
- package/lib/modules/annotation/components/color-picker/components/color.d.ts +5 -0
- package/lib/modules/annotation/components/color-picker/components/color.js +38 -0
- package/lib/modules/annotation/components/color-picker/components/panel.d.ts +1 -0
- package/lib/modules/annotation/components/color-picker/components/panel.js +109 -0
- package/lib/modules/annotation/components/color-picker/components/picker.d.ts +1 -0
- package/lib/modules/annotation/components/color-picker/components/picker.js +75 -0
- package/lib/modules/annotation/components/color-picker/index.d.ts +2 -0
- package/lib/modules/annotation/components/color-picker/index.js +47 -0
- package/lib/modules/annotation/components/eraser-picker.d.ts +4 -0
- package/lib/modules/annotation/components/eraser-picker.js +144 -0
- package/lib/modules/annotation/components/expansion/index.d.ts +1 -0
- package/lib/modules/annotation/components/expansion/index.js +100 -0
- package/lib/modules/annotation/components/extra-tool-picker.d.ts +1 -0
- package/lib/modules/annotation/components/extra-tool-picker.js +62 -0
- package/lib/modules/annotation/components/history.d.ts +2 -0
- package/lib/modules/annotation/components/history.js +78 -0
- package/lib/modules/annotation/components/icons/fold-icon.d.ts +2 -0
- package/lib/modules/annotation/components/icons/fold-icon.js +41 -0
- package/lib/modules/annotation/components/icons/move-icon.d.ts +1 -0
- package/lib/modules/annotation/components/icons/move-icon.js +66 -0
- package/lib/modules/annotation/components/item/index.d.ts +1 -0
- package/lib/modules/annotation/components/item/index.js +43 -0
- package/lib/modules/annotation/components/move-handle.d.ts +5 -0
- package/lib/modules/annotation/components/move-handle.js +134 -0
- package/lib/modules/annotation/components/pen-picker.d.ts +4 -0
- package/lib/modules/annotation/components/pen-picker.js +155 -0
- package/lib/modules/annotation/components/screen-capture-picker.d.ts +4 -0
- package/lib/modules/annotation/components/screen-capture-picker.js +85 -0
- package/lib/modules/annotation/components/shape-picker.d.ts +4 -0
- package/lib/modules/annotation/components/shape-picker.js +210 -0
- package/lib/modules/annotation/hooks/index.d.ts +14 -0
- package/lib/modules/annotation/hooks/index.js +292 -0
- package/lib/modules/annotation/index.d.ts +45 -0
- package/lib/modules/annotation/index.js +168 -0
- package/lib/modules/annotation/store.d.ts +98 -0
- package/lib/modules/annotation/store.js +621 -0
- package/lib/modules/annotation/style.css +36 -0
- package/lib/modules/annotation/view.d.ts +3 -0
- package/lib/modules/annotation/view.js +44 -0
- package/lib/modules/components/control-bar/components/switch-theme/index.js +4 -2
- package/lib/modules/components/control-bar/index.js +1 -3
- package/lib/modules/components/device-control/store.d.ts +42 -0
- package/lib/modules/components/device-control/store.js +241 -0
- package/lib/modules/components/leave-meeting/store.d.ts +39 -0
- package/lib/modules/components/leave-meeting/store.js +270 -0
- package/lib/modules/control-bar/components/annotation-button/index.d.ts +1 -0
- package/lib/modules/control-bar/components/annotation-button/index.js +72 -0
- package/lib/modules/control-bar/types.d.ts +20 -0
- package/lib/modules/control-bar/types.js +6 -0
- package/lib/modules/dialog/dialogs/pre-setting/index.css +26 -0
- package/lib/modules/dialog/dialogs/pre-setting/index.d.ts +6 -0
- package/lib/modules/dialog/dialogs/pre-setting/index.js +62 -0
- package/lib/modules/dialog/dialogs/widget/electron.d.ts +6 -0
- package/lib/modules/dialog/dialogs/widget/electron.js +38 -0
- package/lib/modules/dialog/hooks/use-popover-watcher.d.ts +14 -0
- package/lib/modules/dialog/hooks/use-popover-watcher.js +110 -0
- package/lib/modules/dialog/hooks/useElectron.d.ts +28 -0
- package/lib/modules/dialog/hooks/useElectron.js +277 -0
- package/lib/modules/dialog/store.d.ts +135 -0
- package/lib/modules/dialog/store.js +616 -0
- package/lib/modules/event-confirm/components/window/index.d.ts +4 -0
- package/lib/modules/event-confirm/components/window/index.js +197 -0
- package/lib/modules/event-confirm/index.css +24 -0
- package/lib/modules/event-confirm/index.d.ts +27 -0
- package/lib/modules/event-confirm/index.js +76 -0
- package/lib/modules/event-confirm/store.d.ts +45 -0
- package/lib/modules/event-confirm/store.js +345 -0
- package/lib/modules/event-confirm/view.d.ts +2 -0
- package/lib/modules/event-confirm/view.js +53 -0
- package/lib/modules/event-toast/store.d.ts +27 -0
- package/lib/modules/event-toast/store.js +205 -0
- package/lib/modules/layout/store.d.ts +176 -0
- package/lib/modules/layout/store.js +1466 -0
- package/lib/modules/participant/store.base.js +0 -1
- package/lib/modules/participant/store.d.ts +222 -0
- package/lib/modules/participant/store.js +1927 -0
- package/lib/modules/pc-audio-connect/index.d.ts +22 -0
- package/lib/modules/pc-audio-connect/index.js +67 -0
- package/lib/modules/pc-audio-connect/store.d.ts +46 -0
- package/lib/modules/pc-audio-connect/store.js +304 -0
- package/lib/modules/setting/common/advance-link.d.ts +3 -0
- package/lib/modules/setting/common/advance-link.js +27 -0
- package/lib/modules/setting/common/index.css +26 -0
- package/lib/modules/setting/common/useNamespace.d.ts +15 -0
- package/lib/modules/setting/common/useNamespace.js +66 -0
- package/lib/modules/setting/dialog-wrapper.d.ts +2 -0
- package/lib/modules/setting/dialog-wrapper.js +110 -0
- package/lib/modules/setting/store.d.ts +261 -0
- package/lib/modules/setting/store.js +1321 -0
- package/lib/modules/share-screen/store.d.ts +148 -0
- package/lib/modules/share-screen/store.electron.js +9 -0
- package/lib/modules/share-screen/store.js +950 -0
- package/lib/modules/share-screen/types.d.ts +26 -0
- package/lib/modules/share-screen/types.js +6 -0
- package/lib/modules/state-bar/store.base.electron.js +6 -2
- package/lib/modules/state-bar/store.d.ts +124 -0
- package/lib/modules/state-bar/store.js +664 -0
- package/lib/modules/whiteboard/components/progress/electron.d.ts +1 -0
- package/lib/modules/whiteboard/components/progress/electron.js +33 -0
- package/lib/modules/widget/store.d.ts +14 -0
- package/lib/modules/widget/store.js +28 -0
- package/lib/providers/annotation-provider.d.ts +124 -0
- package/lib/providers/annotation-provider.js +369 -0
- package/lib/providers/board-share/bar-control/base.d.ts +2 -0
- package/lib/providers/board-share/bar-control/base.js +13 -3
- package/lib/providers/board-share/bar-control/electron.d.ts +1 -0
- package/lib/providers/board-share/bar-control/electron.js +15 -4
- package/lib/providers/board-share/provider.base.d.ts +1 -0
- package/lib/providers/board-share/provider.base.js +3 -1
- package/lib/providers/board-share/provider.electron.d.ts +1 -0
- package/lib/providers/board-share/provider.electron.js +8 -2
- package/lib/providers/board-share/type.d.ts +2 -0
- package/lib/providers/dialog/provider.electron.js +10 -2
- package/lib/providers/dialog-provider.d.ts +137 -0
- package/lib/providers/dialog-provider.js +194 -0
- package/lib/providers/message-provider.d.ts +69 -0
- package/lib/providers/message-provider.js +140 -0
- package/lib/providers/room-provider.d.ts +194 -0
- package/lib/providers/room-provider.js +916 -0
- package/lib/providers/screen-share/strategy/browser.js +50 -3
- package/lib/providers/screen-share/strategy/electron.js +77 -8
- package/lib/providers/screen-share/stream-state-sync.d.ts +3 -1
- package/lib/providers/screen-share/stream-state-sync.js +133 -40
- package/lib/providers/screen-share-provider.d.ts +244 -0
- package/lib/providers/screen-share-provider.js +835 -0
- package/lib/providers/sharing-provider.d.ts +42 -0
- package/lib/providers/sharing-provider.js +221 -0
- package/lib/providers/user-setting-storage-provider.d.ts +21 -0
- package/lib/providers/user-setting-storage-provider.js +65 -0
- package/lib/providers/whiteboard-provider.d.ts +24 -0
- package/lib/providers/whiteboard-provider.js +127 -0
- package/lib/shared-data-source/annotation-data.d.ts +17 -0
- package/lib/shared-data-source/annotation-data.js +110 -0
- package/lib/shared-data-source/app-list-data.d.ts +34 -0
- package/lib/shared-data-source/app-list-data.js +133 -0
- package/lib/shared-data-source/chat-data.d.ts +25 -0
- package/lib/shared-data-source/chat-data.js +139 -0
- package/lib/shared-data-source/config.d.ts +35 -0
- package/lib/shared-data-source/config.js +40 -0
- package/lib/shared-data-source/confirm-data.d.ts +25 -0
- package/lib/shared-data-source/confirm-data.js +97 -0
- package/lib/shared-data-source/device-privilege-data.d.ts +8 -0
- package/lib/shared-data-source/device-privilege-data.js +25 -0
- package/lib/shared-data-source/interpreter.d.ts +77 -0
- package/lib/shared-data-source/interpreter.js +247 -0
- package/lib/shared-data-source/layout-data.d.ts +31 -0
- package/lib/shared-data-source/layout-data.js +189 -0
- package/lib/shared-data-source/meeting-time.d.ts +90 -0
- package/lib/shared-data-source/meeting-time.js +416 -0
- package/lib/shared-data-source/member-data.d.ts +139 -0
- package/lib/shared-data-source/member-data.js +517 -0
- package/lib/shared-data-source/pin-data.d.ts +13 -0
- package/lib/shared-data-source/pin-data.js +111 -0
- package/lib/shared-data-source/screen-share-data.d.ts +364 -0
- package/lib/shared-data-source/screen-share-data.js +520 -0
- package/lib/shared-data-source/security-data.d.ts +39 -0
- package/lib/shared-data-source/security-data.js +156 -0
- package/lib/shared-data-source/setting.d.ts +67 -0
- package/lib/shared-data-source/setting.js +220 -0
- package/lib/shared-data-source/speaker-spotlight.d.ts +5 -0
- package/lib/shared-data-source/speaker-spotlight.js +15 -0
- package/lib/shared-data-source/video-window.d.ts +165 -0
- package/lib/shared-data-source/video-window.js +1266 -0
- package/lib/shared-data-source/waiting-room.d.ts +46 -0
- package/lib/shared-data-source/waiting-room.js +222 -0
- package/lib/shared-data-source/whiteboard-data.d.ts +68 -0
- package/lib/shared-data-source/whiteboard-data.js +347 -0
- package/lib/utilities/board-context.d.ts +4 -0
- package/lib/utilities/board-context.js +12 -0
- package/lib/utilities/copyText.d.ts +2 -0
- package/lib/utilities/copyText.js +48 -0
- package/lib/utilities/renderer-event.d.ts +10 -0
- package/lib/utilities/renderer-event.js +95 -0
- package/lib/utilities/screen-capture-permission.d.ts +2 -0
- package/lib/utilities/screen-capture-permission.js +24 -0
- package/lib/utilities/screen.d.ts +3 -0
- package/lib/utilities/screen.js +53 -0
- package/lib/utilities/video-track-render-context.d.ts +6 -0
- package/lib/utilities/video-track-render-context.js +9 -0
- package/lib/waiting-room-control-manager.d.ts +28 -0
- package/lib/waiting-room-control-manager.js +230 -0
- package/package.json +5 -5
|
@@ -61,7 +61,7 @@ var _type = require("fcr-core/lib/type");
|
|
|
61
61
|
var _mobx = require("mobx");
|
|
62
62
|
var _base = require("./base");
|
|
63
63
|
var _FcrUIBoardControlShareProviderImpl;
|
|
64
|
-
var _initProto, _setControlEnableDecs, _setSharingUserDecs, _setBackgroundColorDecs, _setWhiteboardToolDecs, _setThemeDecs, _setIsDualDisplayModeDecs, _handleSubProcessStateUpdatedDecs, _ref;
|
|
64
|
+
var _initProto, _setControlEnableDecs, _setSharingUserDecs, _updateSubProcessBackgroundColorDecs, _setBackgroundColorDecs, _setWhiteboardToolDecs, _setThemeDecs, _setIsDualDisplayModeDecs, _handleSubProcessStateUpdatedDecs, _ref;
|
|
65
65
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
66
66
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
67
67
|
function _superPropGet(t, o, e, r) { var p = (0, _get2["default"])((0, _getPrototypeOf2["default"])(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
@@ -70,7 +70,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
70
70
|
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); }
|
|
71
71
|
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; }
|
|
72
72
|
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; }
|
|
73
|
-
_ref = (_setControlEnableDecs = [_mobx.action, _mobx.action.bound], _setSharingUserDecs = [_mobx.action, _mobx.action.bound], _setBackgroundColorDecs = [_mobx.action, _mobx.action.bound], _setWhiteboardToolDecs = [_mobx.action, _mobx.action.bound], _setThemeDecs = [_mobx.action, _mobx.action.bound], _setIsDualDisplayModeDecs = [_mobx.action, _mobx.action.bound], _handleSubProcessStateUpdatedDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
73
|
+
_ref = (_setControlEnableDecs = [_mobx.action, _mobx.action.bound], _setSharingUserDecs = [_mobx.action, _mobx.action.bound], _updateSubProcessBackgroundColorDecs = [_mobx.action, _mobx.action.bound], _setBackgroundColorDecs = [_mobx.action, _mobx.action.bound], _setWhiteboardToolDecs = [_mobx.action, _mobx.action.bound], _setThemeDecs = [_mobx.action, _mobx.action.bound], _setIsDualDisplayModeDecs = [_mobx.action, _mobx.action.bound], _handleSubProcessStateUpdatedDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
74
74
|
var FcrUIBoardControlShareProviderImpl = exports.FcrUIBoardControlShareProviderImpl = /*#__PURE__*/function (_FcrUIBoardControlSha) {
|
|
75
75
|
function FcrUIBoardControlShareProviderImpl(privilegeProvider, boardControl, _fcrUIMainWindowRenderer) {
|
|
76
76
|
var _this;
|
|
@@ -110,6 +110,13 @@ var FcrUIBoardControlShareProviderImpl = exports.FcrUIBoardControlShareProviderI
|
|
|
110
110
|
value: function setSharingUser(userInfo) {
|
|
111
111
|
this.sharingUserInfo = userInfo;
|
|
112
112
|
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "updateSubProcessBackgroundColor",
|
|
115
|
+
value: function updateSubProcessBackgroundColor(color) {
|
|
116
|
+
if (this._isDualDisplayMode) {
|
|
117
|
+
this._fcrUIMainWindowRenderer.notifyObservers('onBackgroundColorUpdated', color);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
113
120
|
}, {
|
|
114
121
|
key: "setBackgroundColor",
|
|
115
122
|
value: function setBackgroundColor(color) {
|
|
@@ -184,11 +191,15 @@ var FcrUIBoardControlShareProviderImpl = exports.FcrUIBoardControlShareProviderI
|
|
|
184
191
|
}, {
|
|
185
192
|
key: "_handleSubProcessStateUpdated",
|
|
186
193
|
value: function _handleSubProcessStateUpdated(state) {
|
|
194
|
+
var _this3 = this;
|
|
187
195
|
this.connectionState = state;
|
|
188
196
|
if (state === _type.FcrConnectionState.CONNECTED) {
|
|
189
197
|
_superPropGet(FcrUIBoardControlShareProviderImpl, "setShowLoading", this, 3)([false]);
|
|
190
198
|
_superPropGet(FcrUIBoardControlShareProviderImpl, "setJoinSuccess", this, 3)([true]);
|
|
191
|
-
setTimeout(
|
|
199
|
+
setTimeout(function () {
|
|
200
|
+
_this3.updateSubProcessBackgroundColor(_this3.currentTheme.background);
|
|
201
|
+
_this3.resetWhiteboardTool();
|
|
202
|
+
});
|
|
192
203
|
}
|
|
193
204
|
if (state === _type.FcrConnectionState.CONNECTING || state === _type.FcrConnectionState.DISCONNECTED) {
|
|
194
205
|
_superPropGet(FcrUIBoardControlShareProviderImpl, "setShowLoading", this, 3)([true]);
|
|
@@ -199,7 +210,7 @@ var FcrUIBoardControlShareProviderImpl = exports.FcrUIBoardControlShareProviderI
|
|
|
199
210
|
}]);
|
|
200
211
|
}(_base.FcrUIBoardControlShareProviderBase);
|
|
201
212
|
_FcrUIBoardControlShareProviderImpl = FcrUIBoardControlShareProviderImpl;
|
|
202
|
-
var _applyDecs$e = _applyDecs(_FcrUIBoardControlShareProviderImpl, [[_setControlEnableDecs, 18, "setControlEnable"], [_setSharingUserDecs, 18, "setSharingUser"], [_setBackgroundColorDecs, 18, "setBackgroundColor"], [_setWhiteboardToolDecs, 18, "setWhiteboardTool"], [_setThemeDecs, 18, "setTheme"], [_imports.bound, 2, "saveDraft"], [_imports.bound, 2, "inActive"], [_setIsDualDisplayModeDecs, 18, "setIsDualDisplayMode"], [_handleSubProcessStateUpdatedDecs, 18, "_handleSubProcessStateUpdated"]], [], 0, void 0, _base.FcrUIBoardControlShareProviderBase).e;
|
|
213
|
+
var _applyDecs$e = _applyDecs(_FcrUIBoardControlShareProviderImpl, [[_setControlEnableDecs, 18, "setControlEnable"], [_setSharingUserDecs, 18, "setSharingUser"], [_updateSubProcessBackgroundColorDecs, 18, "updateSubProcessBackgroundColor"], [_setBackgroundColorDecs, 18, "setBackgroundColor"], [_setWhiteboardToolDecs, 18, "setWhiteboardTool"], [_setThemeDecs, 18, "setTheme"], [_imports.bound, 2, "saveDraft"], [_imports.bound, 2, "inActive"], [_setIsDualDisplayModeDecs, 18, "setIsDualDisplayMode"], [_handleSubProcessStateUpdatedDecs, 18, "_handleSubProcessStateUpdated"]], [], 0, void 0, _base.FcrUIBoardControlShareProviderBase).e;
|
|
203
214
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
204
215
|
_initProto = _applyDecs$e2[0];
|
|
205
216
|
_applyDecs$e;
|
|
@@ -18,6 +18,7 @@ export declare abstract class FcrUIBoardShareProviderBase implements FcrUIBoardS
|
|
|
18
18
|
protected _boardMainWindow: FcrBoardMainWindow | undefined;
|
|
19
19
|
private _userControl;
|
|
20
20
|
private _dialogProvider;
|
|
21
|
+
private _userId;
|
|
21
22
|
private _observer;
|
|
22
23
|
private _boardObserver;
|
|
23
24
|
protected get boardMainWindow(): FcrBoardMainWindow;
|
|
@@ -116,6 +116,7 @@ var FcrUIBoardShareProviderBase = exports.FcrUIBoardShareProviderBase = /*#__PUR
|
|
|
116
116
|
this._sharingControl.addObserver(this._observer);
|
|
117
117
|
this._addLogger();
|
|
118
118
|
this.boardState = this._sharingControl.getWhiteboardState();
|
|
119
|
+
this._userId = this._userControl.getLocalUser().userId;
|
|
119
120
|
if (this.isActive) {
|
|
120
121
|
this._boardControl.open();
|
|
121
122
|
}
|
|
@@ -198,7 +199,7 @@ var FcrUIBoardShareProviderBase = exports.FcrUIBoardShareProviderBase = /*#__PUR
|
|
|
198
199
|
key: "isMyBoard",
|
|
199
200
|
get: function get() {
|
|
200
201
|
if (this.isActive) {
|
|
201
|
-
return this.ownerUser.userId === this.
|
|
202
|
+
return this.ownerUser.userId === this._userId;
|
|
202
203
|
} else {
|
|
203
204
|
throw new Error('get isMyBoard failed, no user is sharing board currently');
|
|
204
205
|
}
|
|
@@ -372,6 +373,7 @@ var FcrUIBoardShareProviderBase = exports.FcrUIBoardShareProviderBase = /*#__PUR
|
|
|
372
373
|
});
|
|
373
374
|
if (theme) {
|
|
374
375
|
this.boardBarControl.toolbarState.themeColors = theme.colors;
|
|
376
|
+
this.boardBarControl.setCurrentTheme(theme);
|
|
375
377
|
} else {
|
|
376
378
|
this.logger.warn("setBackgroundColor ".concat(color, " not match in theme"));
|
|
377
379
|
}
|
|
@@ -83,7 +83,8 @@ var FcrUIBoardShareProviderImpl = exports.FcrUIBoardShareProviderImpl = /*#__PUR
|
|
|
83
83
|
onUndoStateUpdated: _this._handleUndoStateUpdated
|
|
84
84
|
});
|
|
85
85
|
(0, _defineProperty2["default"])(_this, "_boardControlObserver", {
|
|
86
|
-
onConnectionStateUpdated: _this._handleStateUpdated
|
|
86
|
+
onConnectionStateUpdated: _this._handleStateUpdated,
|
|
87
|
+
onBackgroundColorUpdated: _this._handleBackgroundColorUpdatedForSubProcess
|
|
87
88
|
});
|
|
88
89
|
_this._objectManager = _objectManager;
|
|
89
90
|
_this._mainWindowRenderer = _mainWindowRenderer;
|
|
@@ -154,10 +155,15 @@ var FcrUIBoardShareProviderImpl = exports.FcrUIBoardShareProviderImpl = /*#__PUR
|
|
|
154
155
|
this.boardMainWindow.setStrokeColor(this._boardBarControl.currentTheme.colors[2]);
|
|
155
156
|
this.boardBarControl.resetWhiteboardTool();
|
|
156
157
|
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "_handleBackgroundColorUpdatedForSubProcess",
|
|
160
|
+
value: function _handleBackgroundColorUpdatedForSubProcess(color) {
|
|
161
|
+
this._boardBarControl.updateSubProcessBackgroundColor(color);
|
|
162
|
+
}
|
|
157
163
|
}]);
|
|
158
164
|
}(_provider.FcrUIBoardShareProviderBase);
|
|
159
165
|
_FcrUIBoardShareProviderImpl = FcrUIBoardShareProviderImpl;
|
|
160
|
-
var _applyDecs$e = _applyDecs(_FcrUIBoardShareProviderImpl, [[_decorator.bound, 2, "captureScreen"], [_handleStateUpdatedDecs, 18, "_handleStateUpdated"], [_handleRedoStateUpdatedDecs, 18, "_handleRedoStateUpdated"], [_handleUndoStateUpdatedDecs, 18, "_handleUndoStateUpdated"], [_decorator.bound, 2, "_resetWhiteboardTool"]], [], 0, void 0, _provider.FcrUIBoardShareProviderBase).e;
|
|
166
|
+
var _applyDecs$e = _applyDecs(_FcrUIBoardShareProviderImpl, [[_decorator.bound, 2, "captureScreen"], [_handleStateUpdatedDecs, 18, "_handleStateUpdated"], [_handleRedoStateUpdatedDecs, 18, "_handleRedoStateUpdated"], [_handleUndoStateUpdatedDecs, 18, "_handleUndoStateUpdated"], [_decorator.bound, 2, "_resetWhiteboardTool"], [_decorator.bound, 2, "_handleBackgroundColorUpdatedForSubProcess"]], [], 0, void 0, _provider.FcrUIBoardShareProviderBase).e;
|
|
161
167
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
162
168
|
_initProto = _applyDecs$e2[0];
|
|
163
169
|
_applyDecs$e;
|
|
@@ -142,12 +142,14 @@ export interface FcrUIBoardBarControl {
|
|
|
142
142
|
get toolbarState(): FcrToolbarState;
|
|
143
143
|
release(): void;
|
|
144
144
|
setSharingUser: (userInfo: FcrUserInfo) => void;
|
|
145
|
+
updateSubProcessBackgroundColor: (color: string) => void;
|
|
145
146
|
setBackgroundColor: (color: string) => void;
|
|
146
147
|
setWhiteboardTool: (tool: {
|
|
147
148
|
action: WhiteboardToolAction;
|
|
148
149
|
tool: FcrBoardToolType | FcrBoardShape | string | number;
|
|
149
150
|
}) => void;
|
|
150
151
|
setTheme: (theme: WhiteboardThemeType) => void;
|
|
152
|
+
setCurrentTheme: (theme: Required<WhiteboardThemeType>) => void;
|
|
151
153
|
setControlEnable: (enable: boolean) => void;
|
|
152
154
|
setShowLoading: (show: boolean) => void;
|
|
153
155
|
setCommonColors: (colors: string[]) => void;
|
|
@@ -48,6 +48,7 @@ require("core-js/modules/es.string.includes.js");
|
|
|
48
48
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
49
49
|
require("core-js/modules/esnext.iterator.find.js");
|
|
50
50
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
51
|
+
require("core-js/modules/web.timers.js");
|
|
51
52
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
52
53
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
53
54
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -221,6 +222,7 @@ var FcrUIElectronDialogProviderImpl = exports.FcrUIElectronDialogProviderImpl =
|
|
|
221
222
|
}
|
|
222
223
|
},
|
|
223
224
|
onClosed: function onClosed() {
|
|
225
|
+
_this2.logger.warn("dialog provider openWithKeyAndId onClosed dialogKey: ".concat(dialogKey, " dialogId: ").concat(dialogId));
|
|
224
226
|
window.removeObserver(windowObserver);
|
|
225
227
|
_this2.dialogKeyMap["delete"](dialogKey);
|
|
226
228
|
_this2.dialogIdMap["delete"](dialogId);
|
|
@@ -241,9 +243,15 @@ var FcrUIElectronDialogProviderImpl = exports.FcrUIElectronDialogProviderImpl =
|
|
|
241
243
|
window.addObserver(windowObserver);
|
|
242
244
|
window.setPreventClose(true);
|
|
243
245
|
window.show(showOptions);
|
|
244
|
-
if (params
|
|
246
|
+
if (params && params.alwaysOnTop) {
|
|
245
247
|
window.setAlwaysOnTop(true, 'pop-up-menu');
|
|
246
248
|
}
|
|
249
|
+
setTimeout(function () {
|
|
250
|
+
_this2.logger.warn("dialog provider openWithKeyAndId setTimeout dialogKey: ".concat(dialogKey, " dialogId: ").concat(dialogId, ",title: ").concat(window.getTitle(), ",isVisible: ").concat(window.isVisible(), ",showOptions: ").concat((0, _imports.jsonstring)(showOptions)));
|
|
251
|
+
if (!window.isVisible() && _this2.dialogKeyMap.has(dialogKey) && _this2.dialogIdMap.has(dialogId)) {
|
|
252
|
+
window.show(showOptions);
|
|
253
|
+
}
|
|
254
|
+
}, 1000);
|
|
247
255
|
this.observable.notifyObservers('onDialogOpen', dialogKey, dialogId, params);
|
|
248
256
|
}
|
|
249
257
|
}, {
|
|
@@ -263,7 +271,7 @@ var FcrUIElectronDialogProviderImpl = exports.FcrUIElectronDialogProviderImpl =
|
|
|
263
271
|
}]);
|
|
264
272
|
}(_provider.FcrUIDialogProviderBase);
|
|
265
273
|
_FcrUIElectronDialogProviderImpl = FcrUIElectronDialogProviderImpl;
|
|
266
|
-
var _applyDecs$e = _applyDecs(_FcrUIElectronDialogProviderImpl, [[_decorator.trace, 2, "openDialog"], [_decorator.trace, 2, "openDialogWithId"], [_decorator.trace, 2, "closeDialog"], [_decorator.trace, 2, "closeDialogById"], [_decorator.trace, 2, "setSharingDisplayBounds"]], [], 0, void 0, _provider.FcrUIDialogProviderBase).e;
|
|
274
|
+
var _applyDecs$e = _applyDecs(_FcrUIElectronDialogProviderImpl, [[_decorator.trace, 2, "openDialog"], [_decorator.trace, 2, "openDialogWithId"], [_decorator.trace, 2, "closeDialog"], [_decorator.trace, 2, "closeDialogById"], [_decorator.trace, 2, "openWithKeyAndId"], [_decorator.trace, 2, "setSharingDisplayBounds"]], [], 0, void 0, _provider.FcrUIDialogProviderBase).e;
|
|
267
275
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
268
276
|
_initProto = _applyDecs$e2[0];
|
|
269
277
|
_applyDecs$e;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { FcrUIAction, FcrUIDialogKey } from '../utilities/constant';
|
|
2
|
+
import { DeviceSettingDialogConfig } from '../modules/setting/store';
|
|
3
|
+
import { ConfirmContentProps } from 'agora-ui-foundation/lib/components/confirm-content';
|
|
4
|
+
export interface FcrUIDialogObserver {
|
|
5
|
+
onEvent?(action: FcrUIAction, payload?: unknown): void;
|
|
6
|
+
onDialogOpened?(dialogKey: FcrUIDialogKey, dialogId: string, params?: unknown): void;
|
|
7
|
+
onDialogClosed?(dialogId: string): void;
|
|
8
|
+
onOpenSettingDialog?(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare enum FcrDialogInterceptorEventName {
|
|
11
|
+
ON_CLOSE = "onClose"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* FcrUIDialogProvider 接口定义了一系列用于管理和操作对话框的方法。
|
|
15
|
+
* 这些方法涵盖了打开、关闭各种类型对话框的功能,以及对对话框事件观察者的管理。
|
|
16
|
+
*/
|
|
17
|
+
export interface FcrUIDialogProvider {
|
|
18
|
+
/**
|
|
19
|
+
* 打开指定类型的对话框。
|
|
20
|
+
*
|
|
21
|
+
* @param dialogKey - 对话框的唯一标识键,用于指定要打开的对话框类型。
|
|
22
|
+
* @param instanceId - 可选参数,对话框实例的唯一标识符,用于区分同一类型的不同对话框实例。
|
|
23
|
+
* @param params - 可选参数,传递给对话框的额外参数,类型为 unknown 表示可以是任意类型。
|
|
24
|
+
* @returns 返回打开对话框的唯一标识符,可用于后续关闭操作。
|
|
25
|
+
*/
|
|
26
|
+
openDialog(dialogKey: FcrUIDialogKey, instanceId?: string, params?: unknown): string;
|
|
27
|
+
/**
|
|
28
|
+
* 关闭指定标识符的对话框。
|
|
29
|
+
*
|
|
30
|
+
* @param dialogId - 要关闭对话框的唯一标识符,该标识符通常由 openDialog 方法返回。
|
|
31
|
+
*/
|
|
32
|
+
closeDialog(dialogId: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* 打开确认对话框。
|
|
35
|
+
*
|
|
36
|
+
* @param params - 确认对话框的配置参数,包含确认内容的属性以及可选的对话框唯一键和显示时长。
|
|
37
|
+
* @param mulitple - 可选参数,布尔值,指示是否允许多个确认对话框同时存在。
|
|
38
|
+
* @returns 返回打开确认对话框的唯一标识符,可用于后续关闭操作。
|
|
39
|
+
*/
|
|
40
|
+
openConfirmDialog(params: ConfirmContentProps & {
|
|
41
|
+
key?: string;
|
|
42
|
+
duration?: number;
|
|
43
|
+
}, mulitple?: boolean): string;
|
|
44
|
+
/**
|
|
45
|
+
* 关闭指定标识符的确认对话框。
|
|
46
|
+
*
|
|
47
|
+
* @param dialogId - 要关闭确认对话框的唯一标识符,该标识符通常由 openConfirmDialog 方法返回。
|
|
48
|
+
*/
|
|
49
|
+
closeConfirm(dialogId: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* 打开设备设置对话框。
|
|
52
|
+
*
|
|
53
|
+
* @param config - 设备设置对话框的配置参数,为 DeviceSettingDialogConfig 类型的部分属性对象。
|
|
54
|
+
*/
|
|
55
|
+
openDeviceSettingDialog(config: Partial<DeviceSettingDialogConfig>): void;
|
|
56
|
+
/**
|
|
57
|
+
* 关闭设备设置对话框。
|
|
58
|
+
*/
|
|
59
|
+
closeDeviceSettingDialog(): void;
|
|
60
|
+
/**
|
|
61
|
+
* 打开直播流对话框。
|
|
62
|
+
*/
|
|
63
|
+
openLiveStreamingDialog(): void;
|
|
64
|
+
/**
|
|
65
|
+
* 关闭直播流对话框。
|
|
66
|
+
*/
|
|
67
|
+
closeLiveStreamingDialog(): void;
|
|
68
|
+
/**
|
|
69
|
+
* 打开邀请对话框。
|
|
70
|
+
*/
|
|
71
|
+
openInviteDialog(): void;
|
|
72
|
+
/**
|
|
73
|
+
* 关闭邀请对话框。
|
|
74
|
+
*/
|
|
75
|
+
closeInviteDialog(): void;
|
|
76
|
+
/**
|
|
77
|
+
* 关闭等待室对话框。
|
|
78
|
+
*/
|
|
79
|
+
closeWaitingRoomDialog(): void;
|
|
80
|
+
/**
|
|
81
|
+
* 关闭移除准入等待室对话框。
|
|
82
|
+
*
|
|
83
|
+
* @param dialogKey - 要关闭的移除准入等待室对话框的唯一标识键。
|
|
84
|
+
*/
|
|
85
|
+
closeRemoveAdmitWaitingRoomDialog(dialogKey: FcrUIDialogKey): void;
|
|
86
|
+
/**
|
|
87
|
+
* 添加对话框事件观察者。
|
|
88
|
+
* 观察者可以监听对话框的各种事件,如打开、关闭等。
|
|
89
|
+
*
|
|
90
|
+
* @param observer - 要添加的观察者对象,类型为 FcrUIDialogObserver。
|
|
91
|
+
*/
|
|
92
|
+
addObserver(observer: FcrUIDialogObserver): void;
|
|
93
|
+
/**
|
|
94
|
+
* 移除对话框事件观察者。
|
|
95
|
+
* 移除后,该观察者将不再接收对话框的事件通知。
|
|
96
|
+
*
|
|
97
|
+
* @param observer - 要移除的观察者对象,类型为 FcrUIDialogObserver。
|
|
98
|
+
*/
|
|
99
|
+
removeObserver(observer: FcrUIDialogObserver): void;
|
|
100
|
+
/**
|
|
101
|
+
* 新增弹窗拦截器
|
|
102
|
+
* @param key - 弹窗拦截器的唯一标识符
|
|
103
|
+
* @param interceptor - 弹窗拦截器函数,返回值为 boolean,true 表示拦截弹窗,false 表示不拦截弹窗
|
|
104
|
+
*/
|
|
105
|
+
addInterceptor(key: FcrDialogInterceptorEventName, interceptor: (dialogKey: FcrUIDialogKey) => boolean): void;
|
|
106
|
+
/**
|
|
107
|
+
* 执行弹窗拦截器
|
|
108
|
+
* @param key - 弹窗拦截器的唯一标识符
|
|
109
|
+
* @param dialogKey - 弹窗的唯一标识符
|
|
110
|
+
*/
|
|
111
|
+
emitIntercepter(key: FcrDialogInterceptorEventName, dialogKey: FcrUIDialogKey): boolean;
|
|
112
|
+
}
|
|
113
|
+
export declare class FcrUIDialogProviderImpl implements FcrUIDialogProvider {
|
|
114
|
+
openConfirmDialog(params: ConfirmContentProps & {
|
|
115
|
+
key?: string;
|
|
116
|
+
duration?: number;
|
|
117
|
+
}, mulitple?: boolean): string;
|
|
118
|
+
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
119
|
+
private _observable;
|
|
120
|
+
private _interceptor;
|
|
121
|
+
addInterceptor(key: FcrDialogInterceptorEventName, interceptor: (dialogKey: FcrUIDialogKey) => boolean): void;
|
|
122
|
+
emitIntercepter(key: FcrDialogInterceptorEventName, dialogKey: FcrUIDialogKey): boolean;
|
|
123
|
+
sendEvent(action: FcrUIAction, payload?: unknown): void;
|
|
124
|
+
openInviteDialog(): void;
|
|
125
|
+
closeInviteDialog(): void;
|
|
126
|
+
closeWaitingRoomDialog(): void;
|
|
127
|
+
closeRemoveAdmitWaitingRoomDialog(dialogKey: FcrUIDialogKey): void;
|
|
128
|
+
openDeviceSettingDialog(config: Partial<DeviceSettingDialogConfig>): void;
|
|
129
|
+
closeDeviceSettingDialog(): void;
|
|
130
|
+
openLiveStreamingDialog(): void;
|
|
131
|
+
closeLiveStreamingDialog(): void;
|
|
132
|
+
openDialog(dialogKey: FcrUIDialogKey, instanceId?: string, params?: unknown): string;
|
|
133
|
+
closeDialog(dialogId: string): void;
|
|
134
|
+
closeConfirm(dialogId: string): void;
|
|
135
|
+
addObserver(observer: FcrUIDialogObserver): void;
|
|
136
|
+
removeObserver(observer: FcrUIDialogObserver): void;
|
|
137
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.symbol.description.js");
|
|
5
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
6
|
+
require("core-js/modules/es.error.cause.js");
|
|
7
|
+
require("core-js/modules/es.error.to-string.js");
|
|
8
|
+
require("core-js/modules/es.array.from.js");
|
|
9
|
+
require("core-js/modules/es.array.is-array.js");
|
|
10
|
+
require("core-js/modules/es.array.iterator.js");
|
|
11
|
+
require("core-js/modules/es.array.slice.js");
|
|
12
|
+
require("core-js/modules/es.date.to-string.js");
|
|
13
|
+
require("core-js/modules/es.function.name.js");
|
|
14
|
+
require("core-js/modules/es.object.define-property.js");
|
|
15
|
+
require("core-js/modules/es.object.to-string.js");
|
|
16
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
17
|
+
require("core-js/modules/es.regexp.test.js");
|
|
18
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
19
|
+
require("core-js/modules/es.string.iterator.js");
|
|
20
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
21
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
exports.FcrUIDialogProviderImpl = exports.FcrDialogInterceptorEventName = void 0;
|
|
26
|
+
require("core-js/modules/es.array.concat.js");
|
|
27
|
+
require("core-js/modules/es.array.push.js");
|
|
28
|
+
require("core-js/modules/es.date.now.js");
|
|
29
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
30
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
31
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
32
|
+
var _base = require("../base");
|
|
33
|
+
var _constant = require("../utilities/constant");
|
|
34
|
+
var _imports = require("fcr-core/lib/imports");
|
|
35
|
+
var _logger = require("../utilities/logger");
|
|
36
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
37
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
38
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
39
|
+
var FcrDialogInterceptorEventName = exports.FcrDialogInterceptorEventName = /*#__PURE__*/function (FcrDialogInterceptorEventName) {
|
|
40
|
+
FcrDialogInterceptorEventName["ON_CLOSE"] = "onClose";
|
|
41
|
+
return FcrDialogInterceptorEventName;
|
|
42
|
+
}({});
|
|
43
|
+
/**
|
|
44
|
+
* FcrUIDialogProvider 接口定义了一系列用于管理和操作对话框的方法。
|
|
45
|
+
* 这些方法涵盖了打开、关闭各种类型对话框的功能,以及对对话框事件观察者的管理。
|
|
46
|
+
*/
|
|
47
|
+
var FcrUIDialogProviderImpl = exports.FcrUIDialogProviderImpl = /*#__PURE__*/function () {
|
|
48
|
+
function FcrUIDialogProviderImpl() {
|
|
49
|
+
(0, _classCallCheck2["default"])(this, FcrUIDialogProviderImpl);
|
|
50
|
+
(0, _defineProperty2["default"])(this, "logger", (0, _logger.createLogger)({
|
|
51
|
+
prefix: 'FcrUIDialogProviderImpl'
|
|
52
|
+
}));
|
|
53
|
+
(0, _defineProperty2["default"])(this, "_observable", new _imports.AgoraObservable());
|
|
54
|
+
(0, _defineProperty2["default"])(this, "_interceptor", {});
|
|
55
|
+
}
|
|
56
|
+
return (0, _createClass2["default"])(FcrUIDialogProviderImpl, [{
|
|
57
|
+
key: "openConfirmDialog",
|
|
58
|
+
value: function openConfirmDialog(params, mulitple) {
|
|
59
|
+
var dialogKey = _constant.FcrUIDialogKey.CONFIRM;
|
|
60
|
+
var dialogId = mulitple ? "".concat(dialogKey, "_").concat(Date.now()) : "".concat(dialogKey, "_").concat(params.key || params.title || params.content);
|
|
61
|
+
this.sendEvent(_constant.FcrUIAction.OPEN_DIALOG, {
|
|
62
|
+
dialogKey: dialogKey,
|
|
63
|
+
dialogId: dialogId,
|
|
64
|
+
params: params
|
|
65
|
+
});
|
|
66
|
+
return dialogId;
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "addInterceptor",
|
|
70
|
+
value: function addInterceptor(key, interceptor) {
|
|
71
|
+
if (this._interceptor[key]) {
|
|
72
|
+
this._interceptor[key].push(interceptor);
|
|
73
|
+
} else {
|
|
74
|
+
this._interceptor[key] = [interceptor];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
key: "emitIntercepter",
|
|
79
|
+
value: function emitIntercepter(key, dialogKey) {
|
|
80
|
+
var interceptors = this._interceptor[key];
|
|
81
|
+
if (interceptors) {
|
|
82
|
+
var _iterator = _createForOfIteratorHelper(interceptors),
|
|
83
|
+
_step;
|
|
84
|
+
try {
|
|
85
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
86
|
+
var _interceptor = _step.value;
|
|
87
|
+
return _interceptor(dialogKey);
|
|
88
|
+
}
|
|
89
|
+
} catch (err) {
|
|
90
|
+
_iterator.e(err);
|
|
91
|
+
} finally {
|
|
92
|
+
_iterator.f();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "sendEvent",
|
|
99
|
+
value: function sendEvent(action, payload) {
|
|
100
|
+
var start = Date.now();
|
|
101
|
+
try {
|
|
102
|
+
this._observable.notifyObservers('onEvent', action, payload);
|
|
103
|
+
} finally {
|
|
104
|
+
var end = Date.now();
|
|
105
|
+
var time = end - start;
|
|
106
|
+
if (time >= 10) {
|
|
107
|
+
this.logger.warn("[FcrUIDialogProviderImpl] sendEvent ".concat(_constant.FcrUIAction[action], ", payload: ").concat(payload, ", handlers took: ").concat(end - start, "ms"));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "openInviteDialog",
|
|
113
|
+
value: function openInviteDialog() {
|
|
114
|
+
this.openDialog(_constant.FcrUIDialogKey.INVITE);
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "closeInviteDialog",
|
|
118
|
+
value: function closeInviteDialog() {
|
|
119
|
+
this.closeDialog(_constant.FcrUIDialogKey.INVITE);
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "closeWaitingRoomDialog",
|
|
123
|
+
value: function closeWaitingRoomDialog() {
|
|
124
|
+
this.sendEvent(_constant.FcrUIAction.CLOSE_WAITING_ROOM_DIALOG);
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "closeRemoveAdmitWaitingRoomDialog",
|
|
128
|
+
value: function closeRemoveAdmitWaitingRoomDialog(dialogKey) {
|
|
129
|
+
this.sendEvent(_constant.FcrUIAction.CLOSE_REMOVE_ADMIT_WAITING_ROOM_DIALOG, dialogKey);
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
key: "openDeviceSettingDialog",
|
|
133
|
+
value: function openDeviceSettingDialog(config) {
|
|
134
|
+
//this.openDialog(FcrUIDialogKey.DEVICE_SETTINGS); // openDialog 方法会统一处理 dialog 窗口的逻辑,如果移除,会在二次点击时无法 focus
|
|
135
|
+
// this.sendEvent(FcrUIAction.OPEN_DEVICE_SETTING_DIALOG, { dialogId, ...config });
|
|
136
|
+
this.sendEvent(_constant.FcrUIAction.OPEN_DEVICE_SETTING_DIALOG, config);
|
|
137
|
+
this._observable.notifyObservers('onOpenSettingDialog');
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
key: "closeDeviceSettingDialog",
|
|
141
|
+
value: function closeDeviceSettingDialog() {
|
|
142
|
+
this.closeDialog(_constant.FcrUIDialogKey.DEVICE_SETTINGS);
|
|
143
|
+
}
|
|
144
|
+
}, {
|
|
145
|
+
key: "openLiveStreamingDialog",
|
|
146
|
+
value: function openLiveStreamingDialog() {
|
|
147
|
+
this.sendEvent(_constant.FcrUIAction.OPEN_LIVE_STEAMING_DIALOG);
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
150
|
+
key: "closeLiveStreamingDialog",
|
|
151
|
+
value: function closeLiveStreamingDialog() {
|
|
152
|
+
this.sendEvent(_constant.FcrUIAction.CLOSE_LIVE_STEAMING_DIALOG);
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: "openDialog",
|
|
156
|
+
value: function openDialog(dialogKey, instanceId, params) {
|
|
157
|
+
var dialogId = "".concat(dialogKey, "_").concat(instanceId || dialogKey);
|
|
158
|
+
this.sendEvent(_constant.FcrUIAction.OPEN_DIALOG, {
|
|
159
|
+
dialogKey: dialogKey,
|
|
160
|
+
dialogId: dialogId,
|
|
161
|
+
params: params
|
|
162
|
+
});
|
|
163
|
+
this._observable.notifyObservers('onDialogOpened', dialogKey, dialogId, params);
|
|
164
|
+
return dialogId;
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
key: "closeDialog",
|
|
168
|
+
value: function closeDialog(dialogId) {
|
|
169
|
+
this.sendEvent(_constant.FcrUIAction.CLOSE_DIALOG, {
|
|
170
|
+
dialogId: dialogId
|
|
171
|
+
});
|
|
172
|
+
this._observable.notifyObservers('onDialogClosed', dialogId);
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
key: "closeConfirm",
|
|
176
|
+
value: function closeConfirm(dialogId) {
|
|
177
|
+
this.sendEvent(_constant.FcrUIAction.CLOSE_DIALOG, {
|
|
178
|
+
dialogId: dialogId,
|
|
179
|
+
dialogKey: _constant.FcrUIDialogKey.CONFIRM
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: "addObserver",
|
|
184
|
+
value: function addObserver(observer) {
|
|
185
|
+
this._observable.addObserver(observer);
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
key: "removeObserver",
|
|
189
|
+
value: function removeObserver(observer) {
|
|
190
|
+
this._observable.removeObserver(observer);
|
|
191
|
+
}
|
|
192
|
+
}]);
|
|
193
|
+
}();
|
|
194
|
+
(0, _base.registerDependency)('dialogProvider');
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { FcrUIToastParams, FcrUINotificationParams, FcrUINotificationContentType } from '../type';
|
|
2
|
+
import { FcrUIAction } from '../utilities/constant';
|
|
3
|
+
interface FcrUIEventObserver {
|
|
4
|
+
onEvent?(action: FcrUIAction, payload?: unknown): void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* FcrUIMessageProvider 接口定义了一系列用于管理和操作 UI 消息的方法。
|
|
8
|
+
* 这些方法涵盖了显示不同类型消息(如 Toast 提示、通知等)、关闭通知以及管理消息事件观察者的功能。
|
|
9
|
+
*/
|
|
10
|
+
export interface FcrUIMessageProvider {
|
|
11
|
+
/**
|
|
12
|
+
* 显示一个 Toast 提示消息。
|
|
13
|
+
* Toast 通常是短暂显示的轻量级消息,用于向用户传达简单的信息。
|
|
14
|
+
*
|
|
15
|
+
* @param params - 显示 Toast 提示所需的参数,类型为 FcrUIToastParams,
|
|
16
|
+
* 该参数包含了 Toast 的内容、显示时长等相关配置信息。
|
|
17
|
+
*/
|
|
18
|
+
showToast(params: FcrUIToastParams): void;
|
|
19
|
+
/**
|
|
20
|
+
* 显示一个通知消息。
|
|
21
|
+
* 通知通常用于向用户展示更重要、更详细的信息,可能会在界面上停留一段时间。
|
|
22
|
+
*
|
|
23
|
+
* @param params - 显示通知所需的参数,类型为 FcrUINotificationParams,
|
|
24
|
+
* 该参数包含了通知的标题、内容、图标等相关配置信息。
|
|
25
|
+
*/
|
|
26
|
+
showNotification(params: FcrUINotificationParams): void;
|
|
27
|
+
/**
|
|
28
|
+
* 关闭指定类型的通知消息。
|
|
29
|
+
*
|
|
30
|
+
* @param key - 要关闭的通知的内容类型标识,类型为 FcrUINotificationContentType,
|
|
31
|
+
* 通过该标识可以准确地关闭特定类型的通知。
|
|
32
|
+
*/
|
|
33
|
+
closeNotification(key: FcrUINotificationContentType): void;
|
|
34
|
+
/**
|
|
35
|
+
* 在聊天界面显示一个 Toast 提示消息。
|
|
36
|
+
* 与普通的 showToast 方法不同,此方法专门用于在聊天场景中显示提示。
|
|
37
|
+
*
|
|
38
|
+
* @param params - 显示聊天 Toast 提示所需的参数,类型为 FcrUIToastParams,
|
|
39
|
+
* 同样包含了 Toast 的内容、显示时长等相关配置信息。
|
|
40
|
+
*/
|
|
41
|
+
showChatToast(params: FcrUIToastParams): void;
|
|
42
|
+
/**
|
|
43
|
+
* 添加一个消息事件观察者。
|
|
44
|
+
* 观察者可以监听 UI 消息的各种事件,如消息显示、关闭等。
|
|
45
|
+
*
|
|
46
|
+
* @param observer - 要添加的观察者对象,类型为 FcrUIEventObserver,
|
|
47
|
+
* 该对象应该实现了相应的事件处理方法。
|
|
48
|
+
*/
|
|
49
|
+
addObserver(observer: FcrUIEventObserver): void;
|
|
50
|
+
/**
|
|
51
|
+
* 移除一个消息事件观察者。
|
|
52
|
+
* 移除后,该观察者将不再接收 UI 消息的事件通知。
|
|
53
|
+
*
|
|
54
|
+
* @param observer - 要移除的观察者对象,类型为 FcrUIEventObserver。
|
|
55
|
+
*/
|
|
56
|
+
removeObserver(observer: FcrUIEventObserver): void;
|
|
57
|
+
}
|
|
58
|
+
export declare class FcrUIMessageProviderImpl implements FcrUIMessageProvider {
|
|
59
|
+
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
60
|
+
private _observable;
|
|
61
|
+
sendEvent(action: FcrUIAction, payload?: unknown): void;
|
|
62
|
+
showToast(params: FcrUIToastParams): void;
|
|
63
|
+
showNotification(params: FcrUINotificationParams): void;
|
|
64
|
+
closeNotification(key: FcrUINotificationContentType): void;
|
|
65
|
+
showChatToast(params: FcrUIToastParams): void;
|
|
66
|
+
addObserver(observer: FcrUIEventObserver): void;
|
|
67
|
+
removeObserver(observer: FcrUIEventObserver): void;
|
|
68
|
+
}
|
|
69
|
+
export {};
|