fcr-ui-scene-mobile 3.4.0
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/assets/ground_glass_bg.png +0 -0
- package/lib/base.d.ts +11 -0
- package/lib/base.js +39 -0
- package/lib/common/device-store.d.ts +86 -0
- package/lib/common/device-store.js +642 -0
- package/lib/common/device-stream-store.d.ts +26 -0
- package/lib/common/device-stream-store.js +298 -0
- package/lib/common/event-store.d.ts +124 -0
- package/lib/common/event-store.js +249 -0
- package/lib/common/global-context.d.ts +11 -0
- package/lib/common/global-context.js +9 -0
- package/lib/common/member-list-data-source.d.ts +28 -0
- package/lib/common/member-list-data-source.js +305 -0
- package/lib/common/participant-store.d.ts +195 -0
- package/lib/common/participant-store.js +1577 -0
- package/lib/common/security-store.d.ts +119 -0
- package/lib/common/security-store.js +948 -0
- package/lib/common/setting-store.d.ts +181 -0
- package/lib/common/setting-store.js +797 -0
- package/lib/common/type.d.ts +73 -0
- package/lib/common/type.js +22 -0
- package/lib/config/default-config.d.ts +32 -0
- package/lib/config/default-config.js +39 -0
- package/lib/config/setting-config.d.ts +16 -0
- package/lib/config/setting-config.js +17 -0
- package/lib/creator.d.ts +10 -0
- package/lib/creator.js +49 -0
- package/lib/global.d.ts +8 -0
- package/lib/hooks/meeting-time.d.ts +15 -0
- package/lib/hooks/meeting-time.js +92 -0
- package/lib/hooks/useIsNodePresent.d.ts +4 -0
- package/lib/hooks/useIsNodePresent.js +53 -0
- package/lib/hooks/useOnRefMount.d.ts +2 -0
- package/lib/hooks/useOnRefMount.js +27 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +50 -0
- package/lib/mobile-global.css +28 -0
- package/lib/modules/action-bar/bottom-icons.d.ts +17 -0
- package/lib/modules/action-bar/bottom-icons.js +160 -0
- package/lib/modules/action-bar/context.d.ts +2 -0
- package/lib/modules/action-bar/context.js +9 -0
- package/lib/modules/action-bar/index.css +33 -0
- package/lib/modules/action-bar/index.d.ts +27 -0
- package/lib/modules/action-bar/index.js +46 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.css +130 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.d.ts +19 -0
- package/lib/modules/action-bar/member-list-popup/attendee/index.js +252 -0
- package/lib/modules/action-bar/member-list-popup/attendee/list.d.ts +1 -0
- package/lib/modules/action-bar/member-list-popup/attendee/list.js +82 -0
- package/lib/modules/action-bar/member-list-popup/index.css +35 -0
- package/lib/modules/action-bar/member-list-popup/index.d.ts +7 -0
- package/lib/modules/action-bar/member-list-popup/index.js +40 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.css +0 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.d.ts +12 -0
- package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.js +58 -0
- package/lib/modules/action-bar/more-popup/index.css +71 -0
- package/lib/modules/action-bar/more-popup/index.d.ts +2 -0
- package/lib/modules/action-bar/more-popup/index.js +126 -0
- package/lib/modules/action-bar/store.d.ts +196 -0
- package/lib/modules/action-bar/store.js +1425 -0
- package/lib/modules/action-bar/type.d.ts +6 -0
- package/lib/modules/action-bar/type.js +13 -0
- package/lib/modules/action-bar/view.d.ts +2 -0
- package/lib/modules/action-bar/view.js +75 -0
- package/lib/modules/audio-stream/ index.d.ts +19 -0
- package/lib/modules/audio-stream/ index.js +109 -0
- package/lib/modules/audio-stream/index.d.ts +25 -0
- package/lib/modules/audio-stream/index.js +135 -0
- package/lib/modules/chat/chat-bar/index.css +97 -0
- package/lib/modules/chat/chat-bar/index.d.ts +12 -0
- package/lib/modules/chat/chat-bar/index.js +129 -0
- package/lib/modules/chat/chat-notification/index.css +71 -0
- package/lib/modules/chat/chat-notification/index.d.ts +3 -0
- package/lib/modules/chat/chat-notification/index.js +75 -0
- package/lib/modules/chat/chat-select/index.css +183 -0
- package/lib/modules/chat/chat-select/index.d.ts +12 -0
- package/lib/modules/chat/chat-select/index.js +223 -0
- package/lib/modules/chat/contex.d.ts +2 -0
- package/lib/modules/chat/contex.js +9 -0
- package/lib/modules/chat/demo-wrapper.d.ts +1 -0
- package/lib/modules/chat/demo-wrapper.js +42 -0
- package/lib/modules/chat/index.css +108 -0
- package/lib/modules/chat/index.d.ts +28 -0
- package/lib/modules/chat/index.dev.d.ts +1 -0
- package/lib/modules/chat/index.dev.js +58 -0
- package/lib/modules/chat/index.js +208 -0
- package/lib/modules/chat/message-list.d.ts +22 -0
- package/lib/modules/chat/message-list.js +617 -0
- package/lib/modules/chat/mock.d.ts +2 -0
- package/lib/modules/chat/mock.js +283 -0
- package/lib/modules/chat/store.d.ts +183 -0
- package/lib/modules/chat/store.js +1101 -0
- package/lib/modules/chat/util.d.ts +6 -0
- package/lib/modules/chat/util.js +69 -0
- package/lib/modules/chat/view.d.ts +11 -0
- package/lib/modules/chat/view.js +414 -0
- package/lib/modules/layout/bottom-drawer/index.css +34 -0
- package/lib/modules/layout/bottom-drawer/index.d.ts +3 -0
- package/lib/modules/layout/bottom-drawer/index.js +129 -0
- package/lib/modules/layout/components/Layout.d.ts +1 -0
- package/lib/modules/layout/components/Layout.js +98 -0
- package/lib/modules/layout/components/equip-request-popup/index.css +30 -0
- package/lib/modules/layout/components/equip-request-popup/index.d.ts +3 -0
- package/lib/modules/layout/components/equip-request-popup/index.js +78 -0
- package/lib/modules/layout/components/index.css +78 -0
- package/lib/modules/layout/components/index.d.ts +2 -0
- package/lib/modules/layout/components/index.js +25 -0
- package/lib/modules/layout/context.d.ts +2 -0
- package/lib/modules/layout/context.js +9 -0
- package/lib/modules/layout/drawer-header/index.css +27 -0
- package/lib/modules/layout/drawer-header/index.d.ts +10 -0
- package/lib/modules/layout/drawer-header/index.js +54 -0
- package/lib/modules/layout/index.css +22 -0
- package/lib/modules/layout/index.d.ts +8 -0
- package/lib/modules/layout/index.js +47 -0
- package/lib/modules/layout/store.d.ts +59 -0
- package/lib/modules/layout/store.js +379 -0
- package/lib/modules/layout/type.d.ts +65 -0
- package/lib/modules/layout/type.js +52 -0
- package/lib/modules/layout/view.d.ts +2 -0
- package/lib/modules/layout/view.js +10 -0
- package/lib/modules/member-layout/context.d.ts +2 -0
- package/lib/modules/member-layout/context.js +9 -0
- package/lib/modules/member-layout/data.d.ts +2 -0
- package/lib/modules/member-layout/data.js +304 -0
- package/lib/modules/member-layout/grid/index.css +98 -0
- package/lib/modules/member-layout/grid/index.d.ts +21 -0
- package/lib/modules/member-layout/grid/index.js +316 -0
- package/lib/modules/member-layout/index.css +88 -0
- package/lib/modules/member-layout/index.d.ts +8 -0
- package/lib/modules/member-layout/index.js +45 -0
- package/lib/modules/member-layout/share-toast/index.css +30 -0
- package/lib/modules/member-layout/share-toast/index.d.ts +5 -0
- package/lib/modules/member-layout/share-toast/index.js +43 -0
- package/lib/modules/member-layout/speaker/index.css +30 -0
- package/lib/modules/member-layout/speaker/index.d.ts +9 -0
- package/lib/modules/member-layout/speaker/index.js +28 -0
- package/lib/modules/member-layout/store.d.ts +70 -0
- package/lib/modules/member-layout/store.js +479 -0
- package/lib/modules/member-layout/user/index.css +121 -0
- package/lib/modules/member-layout/user/index.d.ts +34 -0
- package/lib/modules/member-layout/user/index.js +355 -0
- package/lib/modules/member-layout/user/types.d.ts +16 -0
- package/lib/modules/member-layout/user/types.js +6 -0
- package/lib/modules/member-layout/view.d.ts +2 -0
- package/lib/modules/member-layout/view.js +225 -0
- package/lib/modules/state-bar/context.d.ts +2 -0
- package/lib/modules/state-bar/context.js +9 -0
- package/lib/modules/state-bar/index.css +79 -0
- package/lib/modules/state-bar/index.d.ts +17 -0
- package/lib/modules/state-bar/index.js +55 -0
- package/lib/modules/state-bar/leaving-room/index.css +14 -0
- package/lib/modules/state-bar/leaving-room/index.d.ts +7 -0
- package/lib/modules/state-bar/leaving-room/index.js +38 -0
- package/lib/modules/state-bar/meeting-detail/index.css +72 -0
- package/lib/modules/state-bar/meeting-detail/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/index.js +59 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/copy.d.ts +4 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/copy.js +81 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.css +92 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/meeting-info/index.js +188 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.css +27 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.d.ts +2 -0
- package/lib/modules/state-bar/meeting-detail/net-quality/index.js +87 -0
- package/lib/modules/state-bar/store.d.ts +76 -0
- package/lib/modules/state-bar/store.js +561 -0
- package/lib/modules/state-bar/view.d.ts +7 -0
- package/lib/modules/state-bar/view.js +215 -0
- package/lib/modules/whiteboard/app.d.ts +2 -0
- package/lib/modules/whiteboard/app.js +41 -0
- package/lib/modules/whiteboard/components/control-bar/index.css +53 -0
- package/lib/modules/whiteboard/components/control-bar/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/control-bar/index.js +156 -0
- package/lib/modules/whiteboard/components/control-bar/store.d.ts +35 -0
- package/lib/modules/whiteboard/components/control-bar/store.js +288 -0
- package/lib/modules/whiteboard/components/loading/index.css +76 -0
- package/lib/modules/whiteboard/components/loading/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/loading/index.js +68 -0
- package/lib/modules/whiteboard/components/loading/loading.png +0 -0
- package/lib/modules/whiteboard/components/multi-window/index.css +65 -0
- package/lib/modules/whiteboard/components/multi-window/index.d.ts +5 -0
- package/lib/modules/whiteboard/components/multi-window/index.js +39 -0
- package/lib/modules/whiteboard/components/pagination/index.css +228 -0
- package/lib/modules/whiteboard/components/pagination/index.d.ts +15 -0
- package/lib/modules/whiteboard/components/pagination/index.js +163 -0
- package/lib/modules/whiteboard/components/pagination/store.d.ts +18 -0
- package/lib/modules/whiteboard/components/pagination/store.js +17 -0
- package/lib/modules/whiteboard/components/progress/index.d.ts +5 -0
- package/lib/modules/whiteboard/components/progress/index.js +43 -0
- package/lib/modules/whiteboard/components/progress/style.css +52 -0
- package/lib/modules/whiteboard/components/scene-pagination.d.ts +1 -0
- package/lib/modules/whiteboard/components/scene-pagination.js +30 -0
- package/lib/modules/whiteboard/components/switch-theme/index.css +98 -0
- package/lib/modules/whiteboard/components/switch-theme/index.d.ts +3 -0
- package/lib/modules/whiteboard/components/switch-theme/index.js +89 -0
- package/lib/modules/whiteboard/components/switch-theme/item.d.ts +9 -0
- package/lib/modules/whiteboard/components/switch-theme/item.js +53 -0
- package/lib/modules/whiteboard/components/switch-theme/libs.d.ts +4 -0
- package/lib/modules/whiteboard/components/switch-theme/libs.js +29 -0
- package/lib/modules/whiteboard/components/toolbar/ style.css +588 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.d.ts +5 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.js +38 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.js +107 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.js +59 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.js +44 -0
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +89 -0
- package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.js +63 -0
- package/lib/modules/whiteboard/components/toolbar/components/history.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/history.js +46 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.js +39 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.d.ts +1 -0
- package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.js +66 -0
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.d.ts +5 -0
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +134 -0
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +106 -0
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.d.ts +4 -0
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +168 -0
- package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +14 -0
- package/lib/modules/whiteboard/components/toolbar/hooks/index.js +211 -0
- package/lib/modules/whiteboard/components/toolbar/index.d.ts +2 -0
- package/lib/modules/whiteboard/components/toolbar/index.js +183 -0
- package/lib/modules/whiteboard/components/toolbar/store.d.ts +51 -0
- package/lib/modules/whiteboard/components/toolbar/store.js +248 -0
- package/lib/modules/whiteboard/context.d.ts +69 -0
- package/lib/modules/whiteboard/context.js +36 -0
- package/lib/modules/whiteboard/index.d.ts +119 -0
- package/lib/modules/whiteboard/index.js +1134 -0
- package/lib/modules/whiteboard/style.css +143 -0
- package/lib/modules/whiteboard/type.d.ts +94 -0
- package/lib/modules/whiteboard/type.js +89 -0
- package/lib/modules/whiteboard/utils.d.ts +12 -0
- package/lib/modules/whiteboard/utils.js +36 -0
- package/lib/plugins/css-preset-plugin.d.ts +1 -0
- package/lib/plugins/css-preset-plugin.js +29 -0
- package/lib/plugins/module-dev-plugin.d.ts +12 -0
- package/lib/plugins/module-dev-plugin.js +183 -0
- package/lib/plugins/multi-lang-plugin.d.ts +1 -0
- package/lib/plugins/multi-lang-plugin.js +19 -0
- package/lib/plugins/rtm-plugin.d.ts +1 -0
- package/lib/plugins/rtm-plugin.js +5 -0
- package/lib/plugins/web-rtc-plugin.d.ts +1 -0
- package/lib/plugins/web-rtc-plugin.js +5 -0
- package/lib/translations/enUS.d.ts +1855 -0
- package/lib/translations/enUS.js +1895 -0
- package/lib/translations/zhCN.d.ts +1852 -0
- package/lib/translations/zhCN.js +1892 -0
- package/lib/type.d.ts +121 -0
- package/lib/type.js +46 -0
- package/lib/ui-manager.d.ts +32 -0
- package/lib/ui-manager.js +426 -0
- package/lib/ui-scene.d.ts +14 -0
- package/lib/ui-scene.js +141 -0
- package/lib/utilities/board-context.d.ts +4 -0
- package/lib/utilities/board-context.js +12 -0
- package/lib/utilities/constant.d.ts +286 -0
- package/lib/utilities/constant.js +271 -0
- package/lib/utilities/copyText.d.ts +2 -0
- package/lib/utilities/copyText.js +43 -0
- package/lib/utilities/extract.d.ts +5 -0
- package/lib/utilities/extract.js +117 -0
- package/lib/utilities/hooks.d.ts +14 -0
- package/lib/utilities/hooks.js +101 -0
- package/lib/utilities/mute-action.d.ts +4 -0
- package/lib/utilities/mute-action.js +48 -0
- package/lib/utilities/parameters.d.ts +7 -0
- package/lib/utilities/parameters.js +20 -0
- package/lib/utilities/regex.d.ts +1 -0
- package/lib/utilities/regex.js +14 -0
- package/lib/utilities/tools.d.ts +27 -0
- package/lib/utilities/tools.js +169 -0
- package/lib/utilities/useNamespace.d.ts +15 -0
- package/lib/utilities/useNamespace.js +66 -0
- package/package.json +63 -0
|
@@ -0,0 +1,298 @@
|
|
|
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.to-primitive.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.is-array.js");
|
|
9
|
+
require("core-js/modules/es.array.iterator.js");
|
|
10
|
+
require("core-js/modules/es.array.push.js");
|
|
11
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
12
|
+
require("core-js/modules/es.function.bind.js");
|
|
13
|
+
require("core-js/modules/es.function.name.js");
|
|
14
|
+
require("core-js/modules/es.map.js");
|
|
15
|
+
require("core-js/modules/es.number.constructor.js");
|
|
16
|
+
require("core-js/modules/es.object.create.js");
|
|
17
|
+
require("core-js/modules/es.object.define-property.js");
|
|
18
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
19
|
+
require("core-js/modules/es.string.iterator.js");
|
|
20
|
+
require("core-js/modules/esnext.function.metadata.js");
|
|
21
|
+
require("core-js/modules/esnext.map.delete-all.js");
|
|
22
|
+
require("core-js/modules/esnext.map.emplace.js");
|
|
23
|
+
require("core-js/modules/esnext.map.every.js");
|
|
24
|
+
require("core-js/modules/esnext.map.filter.js");
|
|
25
|
+
require("core-js/modules/esnext.map.find.js");
|
|
26
|
+
require("core-js/modules/esnext.map.find-key.js");
|
|
27
|
+
require("core-js/modules/esnext.map.includes.js");
|
|
28
|
+
require("core-js/modules/esnext.map.key-of.js");
|
|
29
|
+
require("core-js/modules/esnext.map.map-keys.js");
|
|
30
|
+
require("core-js/modules/esnext.map.map-values.js");
|
|
31
|
+
require("core-js/modules/esnext.map.merge.js");
|
|
32
|
+
require("core-js/modules/esnext.map.reduce.js");
|
|
33
|
+
require("core-js/modules/esnext.map.some.js");
|
|
34
|
+
require("core-js/modules/esnext.map.update.js");
|
|
35
|
+
require("core-js/modules/esnext.symbol.metadata.js");
|
|
36
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
37
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
38
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
39
|
+
Object.defineProperty(exports, "__esModule", {
|
|
40
|
+
value: true
|
|
41
|
+
});
|
|
42
|
+
exports.FcrDeviceStreamStore = void 0;
|
|
43
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
44
|
+
require("core-js/modules/es.array.find.js");
|
|
45
|
+
require("core-js/modules/es.object.to-string.js");
|
|
46
|
+
require("core-js/modules/esnext.async-iterator.find.js");
|
|
47
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
48
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
49
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
50
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
51
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
52
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
53
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
54
|
+
var _fcrCore = require("fcr-core");
|
|
55
|
+
var _decorator = require("agora-foundation/lib/decorator");
|
|
56
|
+
var _mobx = require("mobx");
|
|
57
|
+
var _toast = require("agora-ui-foundation/lib/components/toast");
|
|
58
|
+
var _type = require("agora-rte-sdk/lib/core/scene/type");
|
|
59
|
+
var _type2 = require("agora-rte-sdk/lib/core/rtc/type");
|
|
60
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
61
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
62
|
+
var _FcrDeviceStreamStore;
|
|
63
|
+
var _initProto, _enableCameraWithStreamDecs, _enableMicrophoneWithStreamDecs, _ref;
|
|
64
|
+
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 set(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 k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(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 s(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)]; } }; }
|
|
65
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
66
|
+
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); }
|
|
67
|
+
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; }
|
|
68
|
+
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; }
|
|
69
|
+
_ref = (_enableCameraWithStreamDecs = [_mobx.action, _mobx.action.bound], _enableMicrophoneWithStreamDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
70
|
+
var FcrDeviceStreamStore = exports.FcrDeviceStreamStore = /*#__PURE__*/function () {
|
|
71
|
+
function FcrDeviceStreamStore(_ref2) {
|
|
72
|
+
var _this = this;
|
|
73
|
+
var roomControl = _ref2.roomControl,
|
|
74
|
+
securityStore = _ref2.securityStore,
|
|
75
|
+
deviceStore = _ref2.deviceStore;
|
|
76
|
+
(0, _classCallCheck2["default"])(this, FcrDeviceStreamStore);
|
|
77
|
+
(0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.getLogger)()));
|
|
78
|
+
this._deviceStore = deviceStore;
|
|
79
|
+
this._roomControl = roomControl;
|
|
80
|
+
this._securityStore = securityStore;
|
|
81
|
+
var streamControl = this._roomControl.getStreamControl();
|
|
82
|
+
streamControl.addObserver({
|
|
83
|
+
onStreamsAdded: function onStreamsAdded(_, e) {
|
|
84
|
+
var _e$find;
|
|
85
|
+
var localCameraStream = (_e$find = e.find(function (event) {
|
|
86
|
+
return event.modifiedStream.owner.userId === _this._localUser.userId && event.modifiedStream.videoSourceType === _type2.AgoraRtcVideoSourceType.CAMERA;
|
|
87
|
+
})) === null || _e$find === void 0 ? void 0 : _e$find.modifiedStream;
|
|
88
|
+
if (localCameraStream) {
|
|
89
|
+
_this._bindLocalAudioStream();
|
|
90
|
+
_this._bindLocalVideoStream();
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
onStreamsUpdated: function onStreamsUpdated(_, e) {
|
|
94
|
+
var _e$find2;
|
|
95
|
+
var localCameraStream = (_e$find2 = e.find(function (event) {
|
|
96
|
+
return event.modifiedStream.owner.userId === _this._localUser.userId && event.modifiedStream.videoSourceType === _type2.AgoraRtcVideoSourceType.CAMERA;
|
|
97
|
+
})) === null || _e$find2 === void 0 ? void 0 : _e$find2.modifiedStream;
|
|
98
|
+
if (localCameraStream) {
|
|
99
|
+
if (localCameraStream.streamType === _type.AgoraRteMediaStreamType.AUDIO || localCameraStream.streamType === _type.AgoraRteMediaStreamType.NONE) {
|
|
100
|
+
if (_this._deviceStore.cameraEnabled) {
|
|
101
|
+
_this._deviceStore.setCameraEnabled(false);
|
|
102
|
+
_toast.FcrToastApi.open({
|
|
103
|
+
toastProps: {
|
|
104
|
+
type: 'error',
|
|
105
|
+
content: (0, _i18n.transI18n)('fmt_uimanager_tips_urturnedoff')
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (localCameraStream.streamType === _type.AgoraRteMediaStreamType.VIDEO || localCameraStream.streamType === _type.AgoraRteMediaStreamType.NONE) {
|
|
111
|
+
if (_this._deviceStore.microphoneEnabled) {
|
|
112
|
+
_this._deviceStore.setMicrophoneEnabled(false);
|
|
113
|
+
_toast.FcrToastApi.open({
|
|
114
|
+
toastProps: {
|
|
115
|
+
type: 'error',
|
|
116
|
+
content: (0, _i18n.transI18n)('fmt_uimanager_tips_urmuted')
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
_this._bindLocalAudioStream();
|
|
122
|
+
_this._bindLocalVideoStream();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// const { cameraDeviceId, microphoneDeviceId } = this._deviceStore.currentDeviceId;
|
|
128
|
+
|
|
129
|
+
// this._cameraDeviceId = cameraDeviceId;
|
|
130
|
+
|
|
131
|
+
// this._microphoneDeviceId = microphoneDeviceId;
|
|
132
|
+
|
|
133
|
+
this._initLocalStream();
|
|
134
|
+
}
|
|
135
|
+
return (0, _createClass2["default"])(FcrDeviceStreamStore, [{
|
|
136
|
+
key: "_localUser",
|
|
137
|
+
get: function get() {
|
|
138
|
+
return this._roomControl.getUserControl().getLocalUser();
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
key: "_localCameraStream",
|
|
142
|
+
get: function get() {
|
|
143
|
+
var localStreams = this._roomControl.getStreamControl().getStreamsByUserId(this._localUser.userId);
|
|
144
|
+
return localStreams.find(function (stream) {
|
|
145
|
+
return stream.videoSourceType === _type2.AgoraRtcVideoSourceType.CAMERA;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
key: "localAudioStream",
|
|
150
|
+
get: function get() {
|
|
151
|
+
var localStreams = this._roomControl.getStreamControl().getStreamsByUserId(this._localUser.userId);
|
|
152
|
+
return localStreams.find(function (stream) {
|
|
153
|
+
return stream.streamType === _type.AgoraRteMediaStreamType.AUDIO;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "_canStartLocalVideo",
|
|
158
|
+
get: function get() {
|
|
159
|
+
return this._securityStore.hasStartVideoPermission(_fcrCore.FcrPrivilegeUserRole.SELF);
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "_canStartLocalAudio",
|
|
163
|
+
get: function get() {
|
|
164
|
+
return this._securityStore.hasUnmutePermission(_fcrCore.FcrPrivilegeUserRole.SELF);
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
key: "enableCameraWithStream",
|
|
168
|
+
value: function () {
|
|
169
|
+
var _enableCameraWithStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(enable) {
|
|
170
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
171
|
+
while (1) switch (_context.prev = _context.next) {
|
|
172
|
+
case 0:
|
|
173
|
+
if (!(enable && !this._canStartLocalVideo)) {
|
|
174
|
+
_context.next = 3;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
_toast.FcrToastApi.open({
|
|
178
|
+
toastProps: {
|
|
179
|
+
type: 'warn',
|
|
180
|
+
content: (0, _i18n.transI18n)('fmt_uimanager_tips_norightsvideo')
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return _context.abrupt("return");
|
|
184
|
+
case 3:
|
|
185
|
+
if (!(this._localCameraStream && enable)) {
|
|
186
|
+
_context.next = 7;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
if (!(this._localCameraStream.streamType === _fcrCore.FcrStreamType.NONE || this._localCameraStream.streamType === _fcrCore.FcrStreamType.AUDIO)) {
|
|
190
|
+
_context.next = 7;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
_context.next = 7;
|
|
194
|
+
return this._roomControl.getStreamControl().updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this._localCameraStream.streamId, {
|
|
195
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE,
|
|
196
|
+
audioPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
197
|
+
}));
|
|
198
|
+
case 7:
|
|
199
|
+
this._deviceStore.setCameraEnabled(enable);
|
|
200
|
+
case 8:
|
|
201
|
+
case "end":
|
|
202
|
+
return _context.stop();
|
|
203
|
+
}
|
|
204
|
+
}, _callee, this);
|
|
205
|
+
}));
|
|
206
|
+
function enableCameraWithStream(_x) {
|
|
207
|
+
return _enableCameraWithStream.apply(this, arguments);
|
|
208
|
+
}
|
|
209
|
+
return enableCameraWithStream;
|
|
210
|
+
}()
|
|
211
|
+
}, {
|
|
212
|
+
key: "enableMicrophoneWithStream",
|
|
213
|
+
value: function () {
|
|
214
|
+
var _enableMicrophoneWithStream = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(enable) {
|
|
215
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
216
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
217
|
+
case 0:
|
|
218
|
+
this._setMicrophoneEnabled(enable);
|
|
219
|
+
case 1:
|
|
220
|
+
case "end":
|
|
221
|
+
return _context2.stop();
|
|
222
|
+
}
|
|
223
|
+
}, _callee2, this);
|
|
224
|
+
}));
|
|
225
|
+
function enableMicrophoneWithStream(_x2) {
|
|
226
|
+
return _enableMicrophoneWithStream.apply(this, arguments);
|
|
227
|
+
}
|
|
228
|
+
return enableMicrophoneWithStream;
|
|
229
|
+
}()
|
|
230
|
+
}, {
|
|
231
|
+
key: "_setMicrophoneEnabled",
|
|
232
|
+
value: function () {
|
|
233
|
+
var _setMicrophoneEnabled2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(enable) {
|
|
234
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
235
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
236
|
+
case 0:
|
|
237
|
+
if (!(enable && !this._canStartLocalAudio)) {
|
|
238
|
+
_context3.next = 3;
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
_toast.FcrToastApi.open({
|
|
242
|
+
toastProps: {
|
|
243
|
+
type: 'warn',
|
|
244
|
+
content: (0, _i18n.transI18n)('fmt_uimanager_tips_norightsaudio')
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
return _context3.abrupt("return");
|
|
248
|
+
case 3:
|
|
249
|
+
if (!(this._localCameraStream && enable)) {
|
|
250
|
+
_context3.next = 7;
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
if (!(this._localCameraStream.streamType === _fcrCore.FcrStreamType.NONE || this._localCameraStream.streamType === _fcrCore.FcrStreamType.VIDEO)) {
|
|
254
|
+
_context3.next = 7;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
_context3.next = 7;
|
|
258
|
+
return this._roomControl.getStreamControl().updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this._localCameraStream.streamId, {
|
|
259
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION,
|
|
260
|
+
audioPrivilege: _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE
|
|
261
|
+
}));
|
|
262
|
+
case 7:
|
|
263
|
+
this._deviceStore.setMicrophoneEnabled(enable);
|
|
264
|
+
case 8:
|
|
265
|
+
case "end":
|
|
266
|
+
return _context3.stop();
|
|
267
|
+
}
|
|
268
|
+
}, _callee3, this);
|
|
269
|
+
}));
|
|
270
|
+
function _setMicrophoneEnabled(_x3) {
|
|
271
|
+
return _setMicrophoneEnabled2.apply(this, arguments);
|
|
272
|
+
}
|
|
273
|
+
return _setMicrophoneEnabled;
|
|
274
|
+
}()
|
|
275
|
+
}, {
|
|
276
|
+
key: "release",
|
|
277
|
+
value: function release() {}
|
|
278
|
+
}, {
|
|
279
|
+
key: "_initLocalStream",
|
|
280
|
+
value: function _initLocalStream() {
|
|
281
|
+
if (this._localCameraStream) {
|
|
282
|
+
this._bindLocalVideoStream();
|
|
283
|
+
this._bindLocalAudioStream();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}, {
|
|
287
|
+
key: "_bindLocalAudioStream",
|
|
288
|
+
value: function _bindLocalAudioStream() {}
|
|
289
|
+
}, {
|
|
290
|
+
key: "_bindLocalVideoStream",
|
|
291
|
+
value: function _bindLocalVideoStream() {}
|
|
292
|
+
}]);
|
|
293
|
+
}();
|
|
294
|
+
_FcrDeviceStreamStore = FcrDeviceStreamStore;
|
|
295
|
+
var _applyDecs$e = _applyDecs(_FcrDeviceStreamStore, [[_enableCameraWithStreamDecs, 18, "enableCameraWithStream"], [_enableMicrophoneWithStreamDecs, 18, "enableMicrophoneWithStream"], [_decorator.bound, 2, "_bindLocalAudioStream"], [_decorator.bound, 2, "_bindLocalVideoStream"]], []).e;
|
|
296
|
+
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
297
|
+
_initProto = _applyDecs$e2[0];
|
|
298
|
+
_applyDecs$e;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { DialogKey, UIAction } from '../utilities/constant';
|
|
2
|
+
import { FcrUserInfo } from 'fcr-core/lib/type';
|
|
3
|
+
import { FcrUIExitReason } from '../type';
|
|
4
|
+
import { ToastSize } from 'agora-ui-foundation/lib/components/toast';
|
|
5
|
+
import { FcrIconType } from 'agora-ui-foundation/lib/components/icon/type';
|
|
6
|
+
import { ButtonType } from 'agora-ui-foundation/lib/components/button';
|
|
7
|
+
import { ConfirmContentProps } from 'agora-ui-foundation/lib/components/confirm-content';
|
|
8
|
+
import { FcrChatRoomReceiveBaseMessage } from 'fcr-core/lib/room-control/chatroom-control/type';
|
|
9
|
+
import { SlotsType } from '../modules/layout/store';
|
|
10
|
+
import { CustomSetting } from './setting-store';
|
|
11
|
+
export interface FcrUIDialogParams {
|
|
12
|
+
dialogKey: DialogKey;
|
|
13
|
+
dialogId: string;
|
|
14
|
+
params?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface FcrUIToastParams {
|
|
17
|
+
type: 'error' | 'warn' | 'info' | 'normal';
|
|
18
|
+
message: string;
|
|
19
|
+
duration?: number;
|
|
20
|
+
id?: string;
|
|
21
|
+
size?: ToastSize;
|
|
22
|
+
customRootClass?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FcrUIConfirmDialogParams {
|
|
25
|
+
title: string;
|
|
26
|
+
content: React.ReactNode;
|
|
27
|
+
icon?: FcrIconType;
|
|
28
|
+
okText?: string;
|
|
29
|
+
cancelText?: string;
|
|
30
|
+
showCancel?: boolean;
|
|
31
|
+
closable?: boolean;
|
|
32
|
+
onConfirm?: () => void;
|
|
33
|
+
onOk?: () => void;
|
|
34
|
+
onCancel?: () => void;
|
|
35
|
+
alignCenter?: boolean;
|
|
36
|
+
width?: number;
|
|
37
|
+
height?: number;
|
|
38
|
+
buttonBlock?: boolean;
|
|
39
|
+
cancelType?: ButtonType;
|
|
40
|
+
}
|
|
41
|
+
export interface FcrUIUpdateAsideParams {
|
|
42
|
+
participant?: boolean;
|
|
43
|
+
chat?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface FcrUINewChatMessagesParams {
|
|
46
|
+
latestMessage: FcrChatRoomReceiveBaseMessage;
|
|
47
|
+
count: number;
|
|
48
|
+
type: string;
|
|
49
|
+
}
|
|
50
|
+
export interface FcrMobileSetSlotTypeParams {
|
|
51
|
+
type: SlotsType;
|
|
52
|
+
}
|
|
53
|
+
export interface FcrUIToggleLayoutParams {
|
|
54
|
+
layout: 'speaker' | 'gallery';
|
|
55
|
+
manual?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface FcrUIToggleLayoutSizeParams {
|
|
58
|
+
size: 16 | 25;
|
|
59
|
+
}
|
|
60
|
+
export interface FcrUILayoutSizeChangedParams extends FcrUIToggleLayoutSizeParams {
|
|
61
|
+
}
|
|
62
|
+
export interface FcrUISetMainSpeakerParams {
|
|
63
|
+
userId: string;
|
|
64
|
+
}
|
|
65
|
+
export interface FcrUIVisibilityStateParams {
|
|
66
|
+
visibility: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface FcrUIUpdateShareScreenParams {
|
|
69
|
+
isOpen: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface FcrCloudRecordingParams {
|
|
72
|
+
action: 'start' | 'pause' | 'resume' | 'stop';
|
|
73
|
+
}
|
|
74
|
+
export interface FcrHandleDeviceActionParams {
|
|
75
|
+
enable?: boolean;
|
|
76
|
+
view?: HTMLDivElement;
|
|
77
|
+
}
|
|
78
|
+
export interface FcrSpotlightStreamChangedParams {
|
|
79
|
+
type: 'add' | 'remove';
|
|
80
|
+
streamId: string;
|
|
81
|
+
}
|
|
82
|
+
export interface FcrUIEventObserver {
|
|
83
|
+
onEvent?(action: UIAction, payload?: unknown): void;
|
|
84
|
+
}
|
|
85
|
+
export declare class FcrUIEventStore {
|
|
86
|
+
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
87
|
+
private _observable;
|
|
88
|
+
sendEvent(action: UIAction, payload?: unknown): void;
|
|
89
|
+
showToast(params: FcrUIToastParams): void;
|
|
90
|
+
showChatToast(params: FcrUIToastParams): void;
|
|
91
|
+
openConfirmDialog(params: ConfirmContentProps & {
|
|
92
|
+
height?: number;
|
|
93
|
+
}): string;
|
|
94
|
+
openDialog(dialogKey: DialogKey, instanceId?: string, params?: unknown): string;
|
|
95
|
+
closeDialog(dialogId: string): void;
|
|
96
|
+
startShareScreen(): void;
|
|
97
|
+
stopShareScreen(): void;
|
|
98
|
+
updateAside(params: FcrUIUpdateAsideParams): void;
|
|
99
|
+
receiveNewChatMessages(params: FcrUINewChatMessagesParams): void;
|
|
100
|
+
toggleLayout(params: FcrUIToggleLayoutParams): void;
|
|
101
|
+
notifyLayoutChanged(params: FcrUIToggleLayoutParams): void;
|
|
102
|
+
toggleLayoutSize(params: FcrUIToggleLayoutSizeParams): void;
|
|
103
|
+
notifyLayoutSizeChanged(params: FcrUILayoutSizeChangedParams): void;
|
|
104
|
+
setMainSpeaker(params: FcrUISetMainSpeakerParams): void;
|
|
105
|
+
setUserPinState(userId: string): void;
|
|
106
|
+
updateShareState(isOpen: boolean): void;
|
|
107
|
+
closeDeviceSettingDialog(): void;
|
|
108
|
+
openLiveStreamingDialog(): void;
|
|
109
|
+
closeLiveStreamingDialog(): void;
|
|
110
|
+
stopLiveStreaming(): void;
|
|
111
|
+
openInviteDialog(): void;
|
|
112
|
+
closeInviteDialog(): void;
|
|
113
|
+
closeWaitingRoomDialog(): void;
|
|
114
|
+
closeConfirmDialog(): void;
|
|
115
|
+
exitRoom(reason: FcrUIExitReason, roomType: number): void;
|
|
116
|
+
localUserKickedOutInMainRoom(): void;
|
|
117
|
+
cloudRecording(action: FcrCloudRecordingParams['action']): void;
|
|
118
|
+
addObserver(observer: FcrUIEventObserver): void;
|
|
119
|
+
removeObserver(observer: FcrUIEventObserver): void;
|
|
120
|
+
notifyChatUpdateTarget(user: FcrUserInfo): void;
|
|
121
|
+
notifyChatResetTarget(): void;
|
|
122
|
+
notifyCustomSettingsChanged(settings: CustomSetting): void;
|
|
123
|
+
release(): void;
|
|
124
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.FcrUIEventStore = void 0;
|
|
9
|
+
require("core-js/modules/es.array.concat.js");
|
|
10
|
+
require("core-js/modules/es.date.now.js");
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
var _observable = require("agora-foundation/lib/utilities/observable");
|
|
15
|
+
var _constant = require("../utilities/constant");
|
|
16
|
+
var _type = require("../type");
|
|
17
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
18
|
+
var _toast = require("agora-ui-foundation/lib/components/toast");
|
|
19
|
+
var _chat = require("../modules/chat");
|
|
20
|
+
var FcrUIEventStore = exports.FcrUIEventStore = /*#__PURE__*/function () {
|
|
21
|
+
function FcrUIEventStore() {
|
|
22
|
+
(0, _classCallCheck2["default"])(this, FcrUIEventStore);
|
|
23
|
+
(0, _defineProperty2["default"])(this, "logger", (0, _logger.getLogger)());
|
|
24
|
+
(0, _defineProperty2["default"])(this, "_observable", new _observable.AgoraObservable());
|
|
25
|
+
}
|
|
26
|
+
return (0, _createClass2["default"])(FcrUIEventStore, [{
|
|
27
|
+
key: "sendEvent",
|
|
28
|
+
value: function sendEvent(action, payload) {
|
|
29
|
+
var start = Date.now();
|
|
30
|
+
try {
|
|
31
|
+
this._observable.notifyObservers('onEvent', action, payload);
|
|
32
|
+
} finally {
|
|
33
|
+
var end = Date.now();
|
|
34
|
+
var time = end - start;
|
|
35
|
+
if (time >= 10) {
|
|
36
|
+
this.logger.warn("[FcrUIEventStore] sendEvent ".concat(_constant.UIAction[action], ", payload: ").concat(payload, ", handlers took: ").concat(end - start, "ms"));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "showToast",
|
|
42
|
+
value: function showToast(params) {
|
|
43
|
+
var _params$duration;
|
|
44
|
+
_toast.FcrToastApi.open({
|
|
45
|
+
id: params === null || params === void 0 ? void 0 : params.id,
|
|
46
|
+
toastProps: {
|
|
47
|
+
type: params.type,
|
|
48
|
+
content: params.message
|
|
49
|
+
},
|
|
50
|
+
customRootClass: params === null || params === void 0 ? void 0 : params.customRootClass,
|
|
51
|
+
duration: (_params$duration = params.duration) !== null && _params$duration !== void 0 ? _params$duration : 3000
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
key: "showChatToast",
|
|
56
|
+
value: function showChatToast(params) {
|
|
57
|
+
var _params$duration2;
|
|
58
|
+
_toast.FcrToastApi.open({
|
|
59
|
+
id: params === null || params === void 0 ? void 0 : params.id,
|
|
60
|
+
toastProps: {
|
|
61
|
+
type: params.type,
|
|
62
|
+
content: params.message
|
|
63
|
+
},
|
|
64
|
+
customRootClass: _chat.CHAT_WRAPPER_CLASS,
|
|
65
|
+
duration: (_params$duration2 = params.duration) !== null && _params$duration2 !== void 0 ? _params$duration2 : 3000
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "openConfirmDialog",
|
|
70
|
+
value: function openConfirmDialog(params) {
|
|
71
|
+
var dialogKey = _constant.DialogKey.CONFIRM;
|
|
72
|
+
var dialogId = "".concat(dialogKey, "_").concat(Date.now());
|
|
73
|
+
this.sendEvent(_constant.UIAction.OPEN_DIALOG, {
|
|
74
|
+
dialogKey: dialogKey,
|
|
75
|
+
dialogId: dialogId,
|
|
76
|
+
params: params
|
|
77
|
+
});
|
|
78
|
+
return dialogId;
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "openDialog",
|
|
82
|
+
value: function openDialog(dialogKey, instanceId, params) {
|
|
83
|
+
var dialogId = "".concat(dialogKey, "_").concat(instanceId || dialogKey);
|
|
84
|
+
this.sendEvent(_constant.UIAction.OPEN_DIALOG, {
|
|
85
|
+
dialogKey: dialogKey,
|
|
86
|
+
dialogId: dialogId,
|
|
87
|
+
params: params
|
|
88
|
+
});
|
|
89
|
+
return dialogId;
|
|
90
|
+
}
|
|
91
|
+
}, {
|
|
92
|
+
key: "closeDialog",
|
|
93
|
+
value: function closeDialog(dialogId) {
|
|
94
|
+
this.sendEvent(_constant.UIAction.CLOSE_DIALOG, {
|
|
95
|
+
dialogId: dialogId
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "startShareScreen",
|
|
100
|
+
value: function startShareScreen() {
|
|
101
|
+
this.sendEvent(_constant.UIAction.START_SHARE_SCREEN);
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "stopShareScreen",
|
|
105
|
+
value: function stopShareScreen() {
|
|
106
|
+
this.sendEvent(_constant.UIAction.STOP_SHARE_SCREEN);
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
key: "updateAside",
|
|
110
|
+
value: function updateAside(params) {
|
|
111
|
+
this.sendEvent(_constant.UIAction.UPDATE_ASIDE, params);
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "receiveNewChatMessages",
|
|
115
|
+
value: function receiveNewChatMessages(params) {
|
|
116
|
+
this.sendEvent(_constant.UIAction.RECEIVE_NEW_CHAT_MESSAGES, params);
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "toggleLayout",
|
|
120
|
+
value: function toggleLayout(params) {
|
|
121
|
+
this.sendEvent(_constant.UIAction.TOGGLE_LAYOUT, params);
|
|
122
|
+
}
|
|
123
|
+
}, {
|
|
124
|
+
key: "notifyLayoutChanged",
|
|
125
|
+
value: function notifyLayoutChanged(params) {
|
|
126
|
+
this.sendEvent(_constant.UIAction.LAYOUT_CHANGED, params);
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "toggleLayoutSize",
|
|
130
|
+
value: function toggleLayoutSize(params) {
|
|
131
|
+
this.sendEvent(_constant.UIAction.TOGGLE_LAYOUT_SIZE, params);
|
|
132
|
+
}
|
|
133
|
+
}, {
|
|
134
|
+
key: "notifyLayoutSizeChanged",
|
|
135
|
+
value: function notifyLayoutSizeChanged(params) {
|
|
136
|
+
this.sendEvent(_constant.UIAction.LAYOUT_SIZE_CHANGED, params);
|
|
137
|
+
}
|
|
138
|
+
}, {
|
|
139
|
+
key: "setMainSpeaker",
|
|
140
|
+
value: function setMainSpeaker(params) {
|
|
141
|
+
this.sendEvent(_constant.UIAction.SET_MAIN_SPEAKER, params);
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
key: "setUserPinState",
|
|
145
|
+
value: function setUserPinState(userId) {
|
|
146
|
+
this.sendEvent(_constant.UIAction.SET_USER_PIN_STATE, {
|
|
147
|
+
userId: userId
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
key: "updateShareState",
|
|
152
|
+
value: function updateShareState(isOpen) {
|
|
153
|
+
this.sendEvent(_constant.UIAction.UPDATE_SHARE_STATE, {
|
|
154
|
+
isOpen: isOpen
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
key: "closeDeviceSettingDialog",
|
|
159
|
+
value: function closeDeviceSettingDialog() {
|
|
160
|
+
this.closeDialog(_constant.DialogKey.DEVICE_SETTINGS);
|
|
161
|
+
}
|
|
162
|
+
}, {
|
|
163
|
+
key: "openLiveStreamingDialog",
|
|
164
|
+
value: function openLiveStreamingDialog() {
|
|
165
|
+
this.sendEvent(_constant.UIAction.OPEN_LIVE_STEAMING_DIALOG);
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
key: "closeLiveStreamingDialog",
|
|
169
|
+
value: function closeLiveStreamingDialog() {
|
|
170
|
+
this.sendEvent(_constant.UIAction.CLOSE_LIVE_STEAMING_DIALOG);
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "stopLiveStreaming",
|
|
174
|
+
value: function stopLiveStreaming() {
|
|
175
|
+
this.sendEvent(_constant.UIAction.STOP_LIVE_STREAMING);
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
key: "openInviteDialog",
|
|
179
|
+
value: function openInviteDialog() {
|
|
180
|
+
this.sendEvent(_constant.UIAction.OPEN_INVITE_DIALOG);
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: "closeInviteDialog",
|
|
184
|
+
value: function closeInviteDialog() {
|
|
185
|
+
this.sendEvent(_constant.UIAction.CLOSE_INVITE_DIALOG);
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
key: "closeWaitingRoomDialog",
|
|
189
|
+
value: function closeWaitingRoomDialog() {
|
|
190
|
+
this.sendEvent(_constant.UIAction.CLOSE_WAITING_ROOM_DIALOG);
|
|
191
|
+
}
|
|
192
|
+
}, {
|
|
193
|
+
key: "closeConfirmDialog",
|
|
194
|
+
value: function closeConfirmDialog() {
|
|
195
|
+
this.closeDialog(_constant.DialogKey.CONFIRM);
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
key: "exitRoom",
|
|
199
|
+
value: function exitRoom(reason, roomType) {
|
|
200
|
+
this.sendEvent(_constant.UIAction.EXIT_ROOM, {
|
|
201
|
+
reason: reason,
|
|
202
|
+
roomType: roomType
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}, {
|
|
206
|
+
key: "localUserKickedOutInMainRoom",
|
|
207
|
+
value: function localUserKickedOutInMainRoom() {
|
|
208
|
+
this.sendEvent(_constant.UIAction.EXIT_ROOM, {
|
|
209
|
+
reason: _type.FcrUIExitReason.KICKED_OUT,
|
|
210
|
+
roomType: _constant.RoomType.MAIN_ROOM
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
key: "cloudRecording",
|
|
215
|
+
value: function cloudRecording(action) {
|
|
216
|
+
this.sendEvent(_constant.UIAction.CLOUD_RECORDING, {
|
|
217
|
+
action: action
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}, {
|
|
221
|
+
key: "addObserver",
|
|
222
|
+
value: function addObserver(observer) {
|
|
223
|
+
this._observable.addObserver(observer);
|
|
224
|
+
}
|
|
225
|
+
}, {
|
|
226
|
+
key: "removeObserver",
|
|
227
|
+
value: function removeObserver(observer) {
|
|
228
|
+
this._observable.removeObserver(observer);
|
|
229
|
+
}
|
|
230
|
+
}, {
|
|
231
|
+
key: "notifyChatUpdateTarget",
|
|
232
|
+
value: function notifyChatUpdateTarget(user) {
|
|
233
|
+
this.sendEvent(_constant.UIAction.CHAT_UPDATE_TARGET, user);
|
|
234
|
+
}
|
|
235
|
+
}, {
|
|
236
|
+
key: "notifyChatResetTarget",
|
|
237
|
+
value: function notifyChatResetTarget() {
|
|
238
|
+
this.sendEvent(_constant.UIAction.CHAT_RESET_TARGET);
|
|
239
|
+
}
|
|
240
|
+
}, {
|
|
241
|
+
key: "notifyCustomSettingsChanged",
|
|
242
|
+
value: function notifyCustomSettingsChanged(settings) {
|
|
243
|
+
this.sendEvent(_constant.UIAction.CUSTOM_SETTINGS_CHANGED, settings);
|
|
244
|
+
}
|
|
245
|
+
}, {
|
|
246
|
+
key: "release",
|
|
247
|
+
value: function release() {}
|
|
248
|
+
}]);
|
|
249
|
+
}();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FcrDeviceStore } from './device-store';
|
|
2
|
+
import { SettingStore } from './setting-store';
|
|
3
|
+
import { FcrSecurityStore } from './security-store';
|
|
4
|
+
import { FcrParticipantStore } from './participant-store';
|
|
5
|
+
export interface GlobalContext {
|
|
6
|
+
deviceStore: FcrDeviceStore;
|
|
7
|
+
settingStore: SettingStore;
|
|
8
|
+
securityStore: FcrSecurityStore;
|
|
9
|
+
participantStore: FcrParticipantStore;
|
|
10
|
+
}
|
|
11
|
+
export declare const FcrMobileGlobalContext: import("react").Context<GlobalContext>;
|