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,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ConnectType = void 0;
|
|
8
|
+
var ConnectType = exports.ConnectType = /*#__PURE__*/function (ConnectType) {
|
|
9
|
+
ConnectType[ConnectType["NONE"] = 0] = "NONE";
|
|
10
|
+
ConnectType[ConnectType["COMPUTER"] = 1] = "COMPUTER";
|
|
11
|
+
ConnectType[ConnectType["PHONE"] = 2] = "PHONE";
|
|
12
|
+
return ConnectType;
|
|
13
|
+
}({});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.FcrMobileActionBar = void 0;
|
|
8
|
+
var _mobile = require("agora-ui-foundation/lib/components/action-bar/device/mobile");
|
|
9
|
+
var _mobxReact = require("mobx-react");
|
|
10
|
+
require("./index.css");
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
var _context = require("./context");
|
|
13
|
+
var _globalContext = require("../../common/global-context");
|
|
14
|
+
var _morePopup = require("./more-popup");
|
|
15
|
+
var _context2 = require("../layout/context");
|
|
16
|
+
var _store = require("../layout/store");
|
|
17
|
+
var _index2 = require("./member-list-popup/index");
|
|
18
|
+
var _bottomIcons = require("./bottom-icons");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
var FcrMobileActionBar = exports.FcrMobileActionBar = (0, _mobxReact.observer)(function () {
|
|
21
|
+
var _useContext = (0, _react.useContext)(_context2.LayoutStoreContext),
|
|
22
|
+
updateCurrentModule = _useContext.updateCurrentModule,
|
|
23
|
+
unreadMsgCnt = _useContext.unreadMsgCnt;
|
|
24
|
+
var _useContext2 = (0, _react.useContext)(_context.ActionBarContext),
|
|
25
|
+
enableMicrophone = _useContext2.enableMicrophone,
|
|
26
|
+
enableCamera = _useContext2.enableCamera,
|
|
27
|
+
setParticipantsPopoverOpened = _useContext2.setParticipantsPopoverOpened,
|
|
28
|
+
participantsPopoverOpened = _useContext2.participantsPopoverOpened;
|
|
29
|
+
var _useContext3 = (0, _react.useContext)(_globalContext.FcrMobileGlobalContext),
|
|
30
|
+
participantStore = _useContext3.participantStore;
|
|
31
|
+
var localUser = participantStore.localUser,
|
|
32
|
+
participantCount = participantStore.participantCount;
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
34
|
+
className: "fcr-bottom-action-main-wrap",
|
|
35
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
36
|
+
className: "fcr-bottom-action-item",
|
|
37
|
+
onClick: function onClick() {
|
|
38
|
+
enableMicrophone(!localUser.hasAudio);
|
|
39
|
+
},
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mobile.MicrophoneDevice, {
|
|
41
|
+
isMuted: !localUser.hasAudio
|
|
42
|
+
})
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
44
|
+
className: "fcr-bottom-action-item",
|
|
45
|
+
onClick: function onClick() {
|
|
46
|
+
enableCamera(!localUser.hasVideo);
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mobile.CameraDevice, {
|
|
49
|
+
isMuted: !localUser.hasVideo
|
|
50
|
+
})
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
52
|
+
className: "fcr-bottom-action-item",
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomIcons.PeopleIcon, {
|
|
54
|
+
setParticipantsPopoverOpened: setParticipantsPopoverOpened,
|
|
55
|
+
count: participantCount
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
58
|
+
className: "fcr-bottom-action-item",
|
|
59
|
+
onClick: function onClick() {
|
|
60
|
+
updateCurrentModule(_store.SlotsType.Chat);
|
|
61
|
+
},
|
|
62
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomIcons.ChatIcon, {
|
|
63
|
+
unreadMsgCnt: unreadMsgCnt
|
|
64
|
+
})
|
|
65
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
66
|
+
className: "fcr-bottom-action-item",
|
|
67
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_bottomIcons.MobileMoreIcon, {})
|
|
68
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_morePopup.FcrMobileMorePopup, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.FcrMobileParticipantsPopup, {
|
|
69
|
+
visible: participantsPopoverOpened,
|
|
70
|
+
onClose: function onClose() {
|
|
71
|
+
return setParticipantsPopoverOpened(false);
|
|
72
|
+
}
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UIModule } from '../../base';
|
|
2
|
+
import { FcrStreamControl, FcrUserControl } from 'fcr-core';
|
|
3
|
+
export declare class AudioStreamUIModule extends UIModule {
|
|
4
|
+
private _streamControl;
|
|
5
|
+
private _userControl;
|
|
6
|
+
private _streamObserver;
|
|
7
|
+
constructor({ streamControl, userControl, }: {
|
|
8
|
+
streamControl: FcrStreamControl;
|
|
9
|
+
userControl: FcrUserControl;
|
|
10
|
+
});
|
|
11
|
+
init(): void;
|
|
12
|
+
getComponent(): null;
|
|
13
|
+
protected onUnload(): void;
|
|
14
|
+
private _handleStreamsAdded;
|
|
15
|
+
private _handleStreamsUpdated;
|
|
16
|
+
private _handleStreamsRemoved;
|
|
17
|
+
private _playRemoteAudio;
|
|
18
|
+
release(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
require("core-js/modules/es.reflect.construct.js");
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.AudioStreamUIModule = void 0;
|
|
10
|
+
require("core-js/modules/es.array.for-each.js");
|
|
11
|
+
require("core-js/modules/es.array.map.js");
|
|
12
|
+
require("core-js/modules/es.function.bind.js");
|
|
13
|
+
require("core-js/modules/es.object.to-string.js");
|
|
14
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
15
|
+
require("core-js/modules/esnext.async-iterator.map.js");
|
|
16
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
17
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
18
|
+
require("core-js/modules/esnext.iterator.map.js");
|
|
19
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
20
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
22
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
24
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
25
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
26
|
+
var _base = require("../../base");
|
|
27
|
+
var _fcrCore = require("fcr-core");
|
|
28
|
+
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)); }
|
|
29
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
30
|
+
var AudioStreamUIModule = exports.AudioStreamUIModule = /*#__PURE__*/function (_UIModule) {
|
|
31
|
+
function AudioStreamUIModule(_ref) {
|
|
32
|
+
var _this;
|
|
33
|
+
var streamControl = _ref.streamControl,
|
|
34
|
+
userControl = _ref.userControl;
|
|
35
|
+
(0, _classCallCheck2["default"])(this, AudioStreamUIModule);
|
|
36
|
+
_this = _callSuper(this, AudioStreamUIModule);
|
|
37
|
+
(0, _defineProperty2["default"])(_this, "_handleStreamsAdded", function (_roomId, events) {
|
|
38
|
+
var streams = events.map(function (event) {
|
|
39
|
+
return event.modifiedStream;
|
|
40
|
+
});
|
|
41
|
+
streams.forEach(function (stream) {
|
|
42
|
+
_this.logger.info('[AudioStreamUIModule] _handleStreamsAdded stream.audioSourceId: ', stream.audioSourceId);
|
|
43
|
+
});
|
|
44
|
+
_this._playRemoteAudio(streams);
|
|
45
|
+
});
|
|
46
|
+
(0, _defineProperty2["default"])(_this, "_handleStreamsUpdated", function (_roomId, events) {
|
|
47
|
+
var streams = events.map(function (event) {
|
|
48
|
+
return event.modifiedStream;
|
|
49
|
+
});
|
|
50
|
+
streams.forEach(function (stream) {
|
|
51
|
+
_this.logger.info('[AudioStreamUIModule] _handleStreamsUpdated stream.audioSourceId: ', stream.audioSourceId);
|
|
52
|
+
});
|
|
53
|
+
_this._playRemoteAudio(streams);
|
|
54
|
+
});
|
|
55
|
+
(0, _defineProperty2["default"])(_this, "_handleStreamsRemoved", function (_roomId, events) {
|
|
56
|
+
events.forEach(function (event) {
|
|
57
|
+
if (event.modifiedStream.owner.userId === _this._userControl.getLocalUser().userId) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
_this.logger.info('stop play remote audio', event.modifiedStream.streamId);
|
|
61
|
+
_this._streamControl.stopPlayRemoteAudioStream(event.modifiedStream.streamId);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
(0, _defineProperty2["default"])(_this, "_playRemoteAudio", function (streams) {
|
|
65
|
+
streams.forEach(function (stream) {
|
|
66
|
+
if (stream.owner.userId !== _this._userControl.getLocalUser().userId) {
|
|
67
|
+
if ((stream.streamType === _fcrCore.FcrStreamType.AUDIO || stream.streamType === _fcrCore.FcrStreamType.BOTH) && stream.audioSourceState === _fcrCore.FcrMediaSourceState.OPEN) {
|
|
68
|
+
_this.logger.info('start play remote audio', stream.streamId);
|
|
69
|
+
_this._streamControl.startPlayRemoteAudioStream(stream.streamId);
|
|
70
|
+
} else {
|
|
71
|
+
_this.logger.info('stop play remote audio', stream.streamId);
|
|
72
|
+
_this._streamControl.stopPlayRemoteAudioStream(stream.streamId);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
_this._streamControl = streamControl;
|
|
78
|
+
_this._userControl = userControl;
|
|
79
|
+
_this.init();
|
|
80
|
+
_this._streamObserver = {
|
|
81
|
+
onStreamsAdded: _this._handleStreamsAdded.bind(_this),
|
|
82
|
+
onStreamsUpdated: _this._handleStreamsUpdated.bind(_this),
|
|
83
|
+
onStreamsRemoved: _this._handleStreamsRemoved.bind(_this)
|
|
84
|
+
};
|
|
85
|
+
streamControl.addObserver(_this._streamObserver);
|
|
86
|
+
return _this;
|
|
87
|
+
}
|
|
88
|
+
(0, _inherits2["default"])(AudioStreamUIModule, _UIModule);
|
|
89
|
+
return (0, _createClass2["default"])(AudioStreamUIModule, [{
|
|
90
|
+
key: "init",
|
|
91
|
+
value: function init() {
|
|
92
|
+
var streams = this._streamControl.getStreamList();
|
|
93
|
+
this._playRemoteAudio(streams);
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "getComponent",
|
|
97
|
+
value: function getComponent() {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "onUnload",
|
|
102
|
+
value: function onUnload() {}
|
|
103
|
+
}, {
|
|
104
|
+
key: "release",
|
|
105
|
+
value: function release() {
|
|
106
|
+
this._streamControl.removeObserver(this._streamObserver);
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
109
|
+
}(_base.UIModule);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UIModule } from '../../base';
|
|
2
|
+
import { FcrStreamControl, FcrUserControl } from 'fcr-core';
|
|
3
|
+
import { FcrDeviceStore } from '../../common/device-store';
|
|
4
|
+
export declare class AudioStreamUIModule extends UIModule {
|
|
5
|
+
private _streamControl;
|
|
6
|
+
private _userControl;
|
|
7
|
+
private _streamObserver;
|
|
8
|
+
private _deviceStore;
|
|
9
|
+
constructor({ streamControl, userControl, deviceStore, }: {
|
|
10
|
+
streamControl: FcrStreamControl;
|
|
11
|
+
userControl: FcrUserControl;
|
|
12
|
+
deviceStore: FcrDeviceStore;
|
|
13
|
+
});
|
|
14
|
+
init(): void;
|
|
15
|
+
private _handleAutoPlayFailed;
|
|
16
|
+
private _handleAudioContextStateChanged;
|
|
17
|
+
private _playCurrentStreams;
|
|
18
|
+
getComponent(): null;
|
|
19
|
+
protected onUnload(): void;
|
|
20
|
+
private _handleStreamsAdded;
|
|
21
|
+
private _handleStreamsUpdated;
|
|
22
|
+
private _handleStreamsRemoved;
|
|
23
|
+
private _playRemoteAudio;
|
|
24
|
+
release(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
require("core-js/modules/es.reflect.construct.js");
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.AudioStreamUIModule = void 0;
|
|
10
|
+
require("core-js/modules/es.array.for-each.js");
|
|
11
|
+
require("core-js/modules/es.array.map.js");
|
|
12
|
+
require("core-js/modules/es.function.bind.js");
|
|
13
|
+
require("core-js/modules/es.object.to-string.js");
|
|
14
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
15
|
+
require("core-js/modules/esnext.async-iterator.map.js");
|
|
16
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
17
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
18
|
+
require("core-js/modules/esnext.iterator.map.js");
|
|
19
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
20
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
21
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
22
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
23
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
24
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
25
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
26
|
+
var _base = require("../../base");
|
|
27
|
+
var _fcrCore = require("fcr-core");
|
|
28
|
+
var _agoraRtcSdkNg = _interopRequireDefault(require("agora-rtc-sdk-ng"));
|
|
29
|
+
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)); }
|
|
30
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
|
+
var AudioStreamUIModule = exports.AudioStreamUIModule = /*#__PURE__*/function (_UIModule) {
|
|
32
|
+
function AudioStreamUIModule(_ref) {
|
|
33
|
+
var _this;
|
|
34
|
+
var streamControl = _ref.streamControl,
|
|
35
|
+
userControl = _ref.userControl,
|
|
36
|
+
deviceStore = _ref.deviceStore;
|
|
37
|
+
(0, _classCallCheck2["default"])(this, AudioStreamUIModule);
|
|
38
|
+
_this = _callSuper(this, AudioStreamUIModule);
|
|
39
|
+
(0, _defineProperty2["default"])(_this, "_handleStreamsAdded", function (_roomId, events) {
|
|
40
|
+
var streams = events.map(function (event) {
|
|
41
|
+
return event.modifiedStream;
|
|
42
|
+
});
|
|
43
|
+
streams.forEach(function (stream) {
|
|
44
|
+
_this.logger.info('[AudioStreamUIModule] _handleStreamsAdded stream.audioSourceId: ', stream.audioSourceId);
|
|
45
|
+
});
|
|
46
|
+
_this._playRemoteAudio(streams);
|
|
47
|
+
});
|
|
48
|
+
(0, _defineProperty2["default"])(_this, "_handleStreamsUpdated", function (_roomId, events) {
|
|
49
|
+
var streams = events.map(function (event) {
|
|
50
|
+
return event.modifiedStream;
|
|
51
|
+
});
|
|
52
|
+
streams.forEach(function (stream) {
|
|
53
|
+
_this.logger.info('[AudioStreamUIModule] _handleStreamsUpdated stream.audioSourceId: ', stream.audioSourceId);
|
|
54
|
+
});
|
|
55
|
+
_this._playRemoteAudio(streams);
|
|
56
|
+
});
|
|
57
|
+
(0, _defineProperty2["default"])(_this, "_handleStreamsRemoved", function (_roomId, events) {
|
|
58
|
+
events.forEach(function (event) {
|
|
59
|
+
if (event.modifiedStream.owner.userId === _this._userControl.getLocalUser().userId) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
_this.logger.info('stop play remote audio', event.modifiedStream.streamId);
|
|
63
|
+
_this._streamControl.stopPlayRemoteAudioStream(event.modifiedStream.streamId);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
(0, _defineProperty2["default"])(_this, "_playRemoteAudio", function (streams) {
|
|
67
|
+
streams.forEach(function (stream) {
|
|
68
|
+
if (stream.owner.userId !== _this._userControl.getLocalUser().userId) {
|
|
69
|
+
if ((stream.streamType === _fcrCore.FcrStreamType.AUDIO || stream.streamType === _fcrCore.FcrStreamType.BOTH) && stream.audioSourceState === _fcrCore.FcrMediaSourceState.OPEN) {
|
|
70
|
+
_this.logger.info('start play remote audio', stream.streamId);
|
|
71
|
+
_this._streamControl.startPlayRemoteAudioStream(stream.streamId);
|
|
72
|
+
} else {
|
|
73
|
+
_this.logger.info('stop play remote audio', stream.streamId);
|
|
74
|
+
_this._streamControl.stopPlayRemoteAudioStream(stream.streamId);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
_this._streamControl = streamControl;
|
|
80
|
+
_this._userControl = userControl;
|
|
81
|
+
_this._deviceStore = deviceStore;
|
|
82
|
+
_this.init();
|
|
83
|
+
_this._streamObserver = {
|
|
84
|
+
onStreamsAdded: _this._handleStreamsAdded.bind(_this),
|
|
85
|
+
onStreamsUpdated: _this._handleStreamsUpdated.bind(_this),
|
|
86
|
+
onStreamsRemoved: _this._handleStreamsRemoved.bind(_this)
|
|
87
|
+
};
|
|
88
|
+
_this._streamControl.addObserver(_this._streamObserver);
|
|
89
|
+
return _this;
|
|
90
|
+
}
|
|
91
|
+
(0, _inherits2["default"])(AudioStreamUIModule, _UIModule);
|
|
92
|
+
return (0, _createClass2["default"])(AudioStreamUIModule, [{
|
|
93
|
+
key: "init",
|
|
94
|
+
value: function init() {
|
|
95
|
+
this._playCurrentStreams();
|
|
96
|
+
_agoraRtcSdkNg["default"].on('autoplay-failed', this._handleAutoPlayFailed);
|
|
97
|
+
_agoraRtcSdkNg["default"].on('audio-context-state-changed', this._handleAudioContextStateChanged);
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "_handleAutoPlayFailed",
|
|
101
|
+
value: function _handleAutoPlayFailed() {
|
|
102
|
+
console.log('[AudioStreamUIModule] auto play fail');
|
|
103
|
+
this._deviceStore.setAutoPlayFailedDialogShow(true);
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "_handleAudioContextStateChanged",
|
|
107
|
+
value: function _handleAudioContextStateChanged(currState, _prevState) {
|
|
108
|
+
if (currState === 'interrupted') {
|
|
109
|
+
this._deviceStore.setAutoPlayFailedDialogShow(true);
|
|
110
|
+
}
|
|
111
|
+
if (currState === 'running') {
|
|
112
|
+
this._deviceStore.setAutoPlayFailedDialogShow(false);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
key: "_playCurrentStreams",
|
|
117
|
+
value: function _playCurrentStreams() {
|
|
118
|
+
var streams = this._streamControl.getStreamList();
|
|
119
|
+
this._playRemoteAudio(streams);
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "getComponent",
|
|
123
|
+
value: function getComponent() {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "onUnload",
|
|
128
|
+
value: function onUnload() {}
|
|
129
|
+
}, {
|
|
130
|
+
key: "release",
|
|
131
|
+
value: function release() {
|
|
132
|
+
this._streamControl.removeObserver(this._streamObserver);
|
|
133
|
+
}
|
|
134
|
+
}]);
|
|
135
|
+
}(_base.UIModule);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.fcr-message-bar {
|
|
2
|
+
height: 100%;
|
|
3
|
+
width: 100%;
|
|
4
|
+
padding: 4px;
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 4px 8px 14px;
|
|
9
|
+
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
color: var(--fcr_ui_scene_icontext1);
|
|
13
|
+
line-height: 10px;
|
|
14
|
+
|
|
15
|
+
border-top-left-radius: var(--fcr_cornerradius_m);
|
|
16
|
+
border-top-right-radius: var(--fcr_cornerradius_m);
|
|
17
|
+
|
|
18
|
+
margin-bottom: -10px;
|
|
19
|
+
|
|
20
|
+
background-color: var(--fcr_web_ui_scene_fill4_popup);
|
|
21
|
+
|
|
22
|
+
min-height: calc(32px + 10px);
|
|
23
|
+
|
|
24
|
+
position: relative;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.fcr-message-bar > span:first-child {
|
|
28
|
+
margin-right: 4px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.fcr-message-bar > .fcr-select-wrapper {
|
|
32
|
+
height: 24px;
|
|
33
|
+
width: 35px;
|
|
34
|
+
}
|
|
35
|
+
.fcr-message-bar > .fcr-select-wrapper > .fcr-select > .fcr-select__selected {
|
|
36
|
+
height: 24px;
|
|
37
|
+
width: 35px;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
padding: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.fcr-message-bar > .fcr-select-wrapper > .fcr-select {
|
|
45
|
+
justify-content: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.fcr-message-bar > .fcr-select-wrapper > .fcr-select > .fcr-select__selected > .fcr-select__icon {
|
|
49
|
+
height: 16px;
|
|
50
|
+
width: 16px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.fcr-message-bar > .fcr-select-wrapper > .fcr-select > .fcr-select__selected > span {
|
|
54
|
+
font-family: 'Helvetica Neue';
|
|
55
|
+
font-size: 12px;
|
|
56
|
+
font-weight: 300;
|
|
57
|
+
line-height: 12px;
|
|
58
|
+
display: flex;
|
|
59
|
+
justify-content: flex-end;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.fcr-message-bar > .fcr-select-wrapper > .fcr-select > .fcr-select__options > .fcr-select__option {
|
|
63
|
+
display: flex;
|
|
64
|
+
padding: 4px 4px 4px 6px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.fcr-tip-all {
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.fcr-tip-private {
|
|
71
|
+
color: var(--fcr_ui_scene_ramp_yellow6);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.fcr-message-bar .fcr-icon-text-wrapper svg {
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
width: 16px;
|
|
77
|
+
height: 16px;
|
|
78
|
+
margin-left: 4px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.fcr-msg-bar-break-max-width {
|
|
82
|
+
max-width: 75px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.fcr-msg-bar-private {
|
|
86
|
+
/* zx1-TODO: color */
|
|
87
|
+
/* background-color: var(--fcr_ui_scene_ramp_2yellow6); */
|
|
88
|
+
background-color: #ffc700;
|
|
89
|
+
border-radius: var(--fcr_cornerradius_xxs);
|
|
90
|
+
font-size: 12px;
|
|
91
|
+
padding: 4px;
|
|
92
|
+
margin-left: 4px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.fcr-msg-bar-private .fcr-icon-text__text {
|
|
96
|
+
color: var(--fcr_ui_scene_white10);
|
|
97
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import './index.css';
|
|
3
|
+
import { FcrUserInfo } from 'fcr-core/lib/type';
|
|
4
|
+
export interface MessageBarProps {
|
|
5
|
+
styles?: CSSProperties;
|
|
6
|
+
users?: FcrUserInfo[];
|
|
7
|
+
onTargetChange?: (target: FcrUserInfo) => void;
|
|
8
|
+
selectedUserId?: string;
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const MessageBar: ({ styles, users, selectedUserId, onClick, }: React.PropsWithChildren<MessageBarProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.symbol.js");
|
|
4
|
+
require("core-js/modules/es.array.filter.js");
|
|
5
|
+
require("core-js/modules/es.array.for-each.js");
|
|
6
|
+
require("core-js/modules/es.array.push.js");
|
|
7
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
8
|
+
require("core-js/modules/es.object.define-property.js");
|
|
9
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
10
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
11
|
+
require("core-js/modules/es.object.keys.js");
|
|
12
|
+
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
13
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
14
|
+
require("core-js/modules/esnext.iterator.filter.js");
|
|
15
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
16
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
17
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
Object.defineProperty(exports, "__esModule", {
|
|
19
|
+
value: true
|
|
20
|
+
});
|
|
21
|
+
exports.MessageBar = void 0;
|
|
22
|
+
require("core-js/modules/es.array.find.js");
|
|
23
|
+
require("core-js/modules/es.object.to-string.js");
|
|
24
|
+
require("core-js/modules/esnext.async-iterator.find.js");
|
|
25
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
26
|
+
require("core-js/modules/esnext.iterator.find.js");
|
|
27
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
28
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
29
|
+
var _type = require("agora-ui-foundation/lib/components/icon/type");
|
|
30
|
+
var _textBubble = require("agora-ui-foundation/lib/components/text-bubble");
|
|
31
|
+
var _iconText = require("agora-ui-foundation/lib/components/icon-text");
|
|
32
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
33
|
+
var _react = require("react");
|
|
34
|
+
require("./index.css");
|
|
35
|
+
var _store = require("../store");
|
|
36
|
+
var _mobxReact = require("mobx-react");
|
|
37
|
+
var _contex = require("../contex");
|
|
38
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
39
|
+
var _context = require("../../layout/context");
|
|
40
|
+
var _store2 = require("../../layout/store");
|
|
41
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
42
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
43
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
44
|
+
var MessageBar = exports.MessageBar = (0, _mobxReact.observer)(function (_ref) {
|
|
45
|
+
var _users$find$userName, _users$find;
|
|
46
|
+
var styles = _ref.styles,
|
|
47
|
+
_ref$users = _ref.users,
|
|
48
|
+
users = _ref$users === void 0 ? [] : _ref$users,
|
|
49
|
+
_ref$selectedUserId = _ref.selectedUserId,
|
|
50
|
+
selectedUserId = _ref$selectedUserId === void 0 ? _store.USER_ALL : _ref$selectedUserId,
|
|
51
|
+
_onClick = _ref.onClick;
|
|
52
|
+
var t = (0, _i18n.useI18n)();
|
|
53
|
+
var cls = (0, _classnames["default"])('fcr-message-bar', {});
|
|
54
|
+
// 每次打开聊天窗, 默认 All
|
|
55
|
+
var _useState = (0, _react.useState)(t('fmt_chat_labels_sendto')),
|
|
56
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
57
|
+
tips = _useState2[0],
|
|
58
|
+
setTips = _useState2[1];
|
|
59
|
+
var _useState3 = (0, _react.useState)(false),
|
|
60
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
61
|
+
popoverOpened = _useState4[0],
|
|
62
|
+
setPopoverOpened = _useState4[1];
|
|
63
|
+
(0, _react.useEffect)(function () {
|
|
64
|
+
setTips(selectedUserId === _store.USER_ALL ? t('fmt_chat_labels_sendto') : t('fmt_chats_label_privatechat'));
|
|
65
|
+
}, [selectedUserId]);
|
|
66
|
+
var _useContext = (0, _react.useContext)(_contex.StoreContext),
|
|
67
|
+
chatRoomStores = _useContext.chatRoomStores,
|
|
68
|
+
activeTabIndex = _useContext.activeTabIndex;
|
|
69
|
+
var _ref2 = chatRoomStores[activeTabIndex],
|
|
70
|
+
privateTargetUser = _ref2.privateTargetUser,
|
|
71
|
+
localIsManager = _ref2.localIsManager;
|
|
72
|
+
var _useContext2 = (0, _react.useContext)(_context.LayoutStoreContext),
|
|
73
|
+
updateCurrentModule = _useContext2.updateCurrentModule;
|
|
74
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
75
|
+
className: cls,
|
|
76
|
+
style: _objectSpread({}, styles),
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
78
|
+
className: "fcr-tip-".concat(selectedUserId === _store.USER_ALL ? t('fmt_chat_option_all') : t('fmt_chats_label_privatechat')),
|
|
79
|
+
children: tips
|
|
80
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
81
|
+
onClick: function onClick() {
|
|
82
|
+
if ((users === null || users === void 0 ? void 0 : users.length) <= 1) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
setPopoverOpened(!popoverOpened);
|
|
86
|
+
updateCurrentModule(_store2.SlotsType.ChatSelect);
|
|
87
|
+
_onClick && _onClick();
|
|
88
|
+
},
|
|
89
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_textBubble.TextBubble, {
|
|
90
|
+
styles: {
|
|
91
|
+
padding: '4px 1px 4px 4px',
|
|
92
|
+
borderRadius: 6,
|
|
93
|
+
backgroundColor: 'var(--fcr_web_ui_scene_fill2)'
|
|
94
|
+
},
|
|
95
|
+
txt: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconText.IconText, {
|
|
96
|
+
classnames: {
|
|
97
|
+
'fcr-break-one-line fcr-word-break': true,
|
|
98
|
+
'fcr-msg-bar-break-max-width': true
|
|
99
|
+
}
|
|
100
|
+
// TODO: 当选中的 uid 为 None 时,需要提示选择管理员
|
|
101
|
+
,
|
|
102
|
+
txt: privateTargetUser.userId === _store.USER_NONE && !localIsManager ? t('fmt_chat_tips_selecthost') : (_users$find$userName = (_users$find = users.find(function (user) {
|
|
103
|
+
return user.userId === selectedUserId;
|
|
104
|
+
})) === null || _users$find === void 0 ? void 0 : _users$find.userName) !== null && _users$find$userName !== void 0 ? _users$find$userName : _store.USER_ALL,
|
|
105
|
+
icon: _type.FcrIconType.CHEVRON_RIGHT,
|
|
106
|
+
colors: {
|
|
107
|
+
iconPrimary: 'var(--fcr_ui_scene_ramp_brand6)'
|
|
108
|
+
},
|
|
109
|
+
iconTransform: popoverOpened,
|
|
110
|
+
enable: true,
|
|
111
|
+
isHideIcon: (users === null || users === void 0 ? void 0 : users.length) <= 1,
|
|
112
|
+
onClick: function onClick() {
|
|
113
|
+
setPopoverOpened(!popoverOpened);
|
|
114
|
+
},
|
|
115
|
+
iconReverse: true
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
}), privateTargetUser.userId !== _store.USER_ALL && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
119
|
+
className: 'fcr-msg-bar-private',
|
|
120
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconText.IconText, {
|
|
121
|
+
txt: "Private",
|
|
122
|
+
icon: _type.FcrIconType.CHAT_PRIVATE,
|
|
123
|
+
colors: {
|
|
124
|
+
iconPrimary: 'var(--fcr_ui_scene_white10)'
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
});
|