@100mslive/roomkit-react 0.3.22-alpha.3 → 0.3.22-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Accordion/Accordion.d.ts +322 -134
- package/dist/Accordion/index.d.ts +322 -134
- package/dist/Avatar/Avatar.d.ts +141 -47
- package/dist/Button/Button.d.ts +141 -47
- package/dist/Checkbox/Checkbox.d.ts +322 -134
- package/dist/Collapsible/Collapsible.d.ts +483 -201
- package/dist/Divider/Divider.d.ts +322 -134
- package/dist/Dropdown/Dropdown.d.ts +1932 -804
- package/dist/Fieldset/Fieldset.d.ts +141 -47
- package/dist/Footer/Footer.d.ts +1288 -536
- package/dist/{HLSView-EYGGK6BH.js → HLSView-CSOBLYBP.js} +24 -38
- package/dist/HLSView-CSOBLYBP.js.map +7 -0
- package/dist/{PDFView-RMR33QH4.css → HLSView-QZMIDGI4.css} +3 -3
- package/dist/{LeaveScreen-ZAG5UJZL.css.map → HLSView-QZMIDGI4.css.map} +1 -1
- package/dist/IconButton/IconButton.d.ts +141 -47
- package/dist/Input/Input.d.ts +926 -362
- package/dist/Label/Label.d.ts +141 -47
- package/dist/Layout/Box.d.ts +141 -47
- package/dist/Layout/Flex.d.ts +141 -47
- package/dist/Link/Link.d.ts +141 -47
- package/dist/Modal/Dialog.d.ts +987 -329
- package/dist/Modal/DialogContent.d.ts +1127 -469
- package/dist/Pagination/StyledPagination.d.ts +644 -268
- package/dist/Popover/index.d.ts +483 -201
- package/dist/Prebuilt/IconButton.d.ts +322 -134
- package/dist/Prebuilt/components/Chat/ChatBody.d.ts +322 -134
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +805 -335
- package/dist/Prebuilt/components/Settings/common.d.ts +322 -134
- package/dist/Progress/index.d.ts +322 -134
- package/dist/RadioGroup/RadioGroup.d.ts +483 -201
- package/dist/ReactSelect/ReactSelect.d.ts +1610 -670
- package/dist/Select/Select.d.ts +483 -201
- package/dist/Sheet/Sheet.d.ts +987 -329
- package/dist/Slider/Slider.d.ts +141 -47
- package/dist/Stats/StyledStats.d.ts +966 -402
- package/dist/Switch/Switch.d.ts +141 -47
- package/dist/Tabs/Tabs.d.ts +644 -268
- package/dist/Text/Text.d.ts +141 -47
- package/dist/TextArea/TextArea.d.ts +141 -47
- package/dist/Theme/base.config.d.ts +78 -26
- package/dist/Theme/stitches.config.d.ts +1514 -1067
- package/dist/TileMenu/StyledMenuTile.d.ts +1127 -469
- package/dist/Toast/Toast.d.ts +946 -382
- package/dist/Video/Video.d.ts +141 -47
- package/dist/VideoList/StyledVideoList.d.ts +483 -201
- package/dist/VideoTile/StyledVideoTile.d.ts +1610 -670
- package/dist/chunk-4VBHLZDR.js +34747 -0
- package/dist/chunk-4VBHLZDR.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +22358 -22561
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +15 -25
- package/dist/meta.cjs.json +5299 -5657
- package/dist/meta.esbuild.json +6290 -9146
- package/package.json +8 -8
- package/src/Avatar/Avatar.tsx +1 -1
- package/src/Popover/Popover.stories.tsx +1 -1
- package/src/Prebuilt/App.tsx +2 -6
- package/src/Prebuilt/components/Chat/Chat.tsx +8 -12
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
- package/src/Prebuilt/components/Notifications/Notifications.tsx +159 -13
- package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +2 -9
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +5 -1
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +5 -7
- package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +1 -23
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +5 -13
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -32
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +31 -43
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
- package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +1 -3
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +0 -6
- package/src/Prebuilt/layouts/HLSView.jsx +0 -1
- package/src/Prebuilt/layouts/PDFView.jsx +0 -1
- package/src/Prebuilt/layouts/SidePane.tsx +6 -12
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +34 -35
- package/dist/ConferenceScreen-CSVWECB5.js +0 -1778
- package/dist/ConferenceScreen-CSVWECB5.js.map +0 -7
- package/dist/ConferenceScreen-YRURU3RV.css +0 -2780
- package/dist/ConferenceScreen-YRURU3RV.css.map +0 -7
- package/dist/EmbedView-N2E4DZQA.js +0 -17
- package/dist/EmbedView-N2E4DZQA.js.map +0 -7
- package/dist/EmbedView-S54NTHF5.css +0 -2780
- package/dist/EmbedView-S54NTHF5.css.map +0 -7
- package/dist/EmojiReaction-3X4ST4AU.js +0 -11
- package/dist/EmojiReaction-3X4ST4AU.js.map +0 -7
- package/dist/HLSView-EYGGK6BH.js.map +0 -7
- package/dist/HLSView-LBTFLMI4.css +0 -2780
- package/dist/HLSView-LBTFLMI4.css.map +0 -7
- package/dist/LeaveScreen-D6XU64JL.js +0 -556
- package/dist/LeaveScreen-D6XU64JL.js.map +0 -7
- package/dist/LeaveScreen-ZAG5UJZL.css +0 -2780
- package/dist/MoreSettings-R7B4BSNT.css +0 -2780
- package/dist/MoreSettings-R7B4BSNT.css.map +0 -7
- package/dist/MoreSettings-TBJVM7OY.js +0 -16
- package/dist/MoreSettings-TBJVM7OY.js.map +0 -7
- package/dist/PDFView-JOIJDP65.js +0 -84
- package/dist/PDFView-JOIJDP65.js.map +0 -7
- package/dist/PDFView-RMR33QH4.css.map +0 -7
- package/dist/Polls-IN3V2HFI.js +0 -1584
- package/dist/Polls-IN3V2HFI.js.map +0 -7
- package/dist/Polls-JW7JWGTE.css +0 -2780
- package/dist/Polls-JW7JWGTE.css.map +0 -7
- package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/RoleChangeNotification.d.ts +0 -1
- package/dist/RaiseHand-WES4KKMD.js +0 -10
- package/dist/RaiseHand-WES4KKMD.js.map +0 -7
- package/dist/RoleProminence-4ZBDBCMU.css +0 -2780
- package/dist/RoleProminence-4ZBDBCMU.css.map +0 -7
- package/dist/RoleProminence-PB32DLIB.js +0 -116
- package/dist/RoleProminence-PB32DLIB.js.map +0 -7
- package/dist/RoomDetailsPane-CZH2SNLE.js +0 -53
- package/dist/RoomDetailsPane-CZH2SNLE.js.map +0 -7
- package/dist/RoomDetailsPane-XWH2KEFI.css +0 -2780
- package/dist/RoomDetailsPane-XWH2KEFI.css.map +0 -7
- package/dist/ScreenshareLayout-XVENPVK3.js +0 -358
- package/dist/ScreenshareLayout-XVENPVK3.js.map +0 -7
- package/dist/ScreenshareLayout-YUW3KHAB.css +0 -2780
- package/dist/ScreenshareLayout-YUW3KHAB.css.map +0 -7
- package/dist/SidePaneTabs-QXCDHOGG.js +0 -1354
- package/dist/SidePaneTabs-QXCDHOGG.js.map +0 -7
- package/dist/SidePaneTabs-WQGVOWRP.css +0 -2780
- package/dist/SidePaneTabs-WQGVOWRP.css.map +0 -7
- package/dist/VBPicker-XN74N67R.js +0 -322
- package/dist/VBPicker-XN74N67R.js.map +0 -7
- package/dist/VBPicker-YDM2YIOM.css +0 -2780
- package/dist/VBPicker-YDM2YIOM.css.map +0 -7
- package/dist/WaitingView-77PRTIBV.js +0 -10
- package/dist/WaitingView-77PRTIBV.js.map +0 -7
- package/dist/WhiteboardLayout-FZC7SOSG.js +0 -96
- package/dist/WhiteboardLayout-FZC7SOSG.js.map +0 -7
- package/dist/WhiteboardLayout-MNTUWEVK.css +0 -2780
- package/dist/WhiteboardLayout-MNTUWEVK.css.map +0 -7
- package/dist/android-perm-1.png +0 -0
- package/dist/audio-level.png +0 -0
- package/dist/chunk-26D5FDBW.js +0 -16812
- package/dist/chunk-26D5FDBW.js.map +0 -7
- package/dist/chunk-2J5WS52X.js +0 -2595
- package/dist/chunk-2J5WS52X.js.map +0 -7
- package/dist/chunk-2LWOQMYY.js +0 -30
- package/dist/chunk-2LWOQMYY.js.map +0 -7
- package/dist/chunk-3MRQJSIY.js +0 -171
- package/dist/chunk-3MRQJSIY.js.map +0 -7
- package/dist/chunk-4X4WB7X3.js +0 -98
- package/dist/chunk-4X4WB7X3.js.map +0 -7
- package/dist/chunk-7QZJMUHM.js +0 -90
- package/dist/chunk-7QZJMUHM.js.map +0 -7
- package/dist/chunk-ABCV7TX5.js +0 -71
- package/dist/chunk-ABCV7TX5.js.map +0 -7
- package/dist/chunk-BQOT4DK7.js +0 -418
- package/dist/chunk-BQOT4DK7.js.map +0 -7
- package/dist/chunk-ENHSO6YN.js +0 -6337
- package/dist/chunk-ENHSO6YN.js.map +0 -7
- package/dist/chunk-JKWX7W4K.js +0 -161
- package/dist/chunk-JKWX7W4K.js.map +0 -7
- package/dist/chunk-LO4BXA4G.js +0 -114
- package/dist/chunk-LO4BXA4G.js.map +0 -7
- package/dist/chunk-MRVWNFXC.js +0 -59
- package/dist/chunk-MRVWNFXC.js.map +0 -7
- package/dist/chunk-OA4HW7HW.js +0 -262
- package/dist/chunk-OA4HW7HW.js.map +0 -7
- package/dist/chunk-PJQSPAFZ.js +0 -178
- package/dist/chunk-PJQSPAFZ.js.map +0 -7
- package/dist/chunk-QHQKY35W.js +0 -830
- package/dist/chunk-QHQKY35W.js.map +0 -7
- package/dist/chunk-QKXHQ6DV.js +0 -254
- package/dist/chunk-QKXHQ6DV.js.map +0 -7
- package/dist/chunk-RTWNTT77.js +0 -62
- package/dist/chunk-RTWNTT77.js.map +0 -7
- package/dist/chunk-TBXRX6MK.js +0 -576
- package/dist/chunk-TBXRX6MK.js.map +0 -7
- package/dist/chunk-TCOPR3BK.js +0 -487
- package/dist/chunk-TCOPR3BK.js.map +0 -7
- package/dist/chunk-VKORP2LF.js +0 -41
- package/dist/chunk-VKORP2LF.js.map +0 -7
- package/dist/chunk-YYVDCP5Z.js +0 -136
- package/dist/chunk-YYVDCP5Z.js.map +0 -7
- package/dist/empty-chat.svg +0 -12
- package/dist/ios-perm-0.png +0 -0
- package/dist/pdf-share.png +0 -0
- package/dist/screen-share.png +0 -0
- package/dist/transaction_error.svg +0 -12
- package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +0 -18
- package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +0 -56
- package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +0 -24
- package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +0 -71
- package/src/Prebuilt/components/Notifications/RoleChangeNotification.tsx +0 -24
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"prebuilt",
|
11
11
|
"roomkit"
|
12
12
|
],
|
13
|
-
"version": "0.3.22-alpha.
|
13
|
+
"version": "0.3.22-alpha.4",
|
14
14
|
"author": "100ms",
|
15
15
|
"license": "MIT",
|
16
16
|
"repository": {
|
@@ -75,12 +75,12 @@
|
|
75
75
|
"react": ">=17.0.2 <19.0.0"
|
76
76
|
},
|
77
77
|
"dependencies": {
|
78
|
-
"@100mslive/hls-player": "0.3.22-alpha.
|
78
|
+
"@100mslive/hls-player": "0.3.22-alpha.4",
|
79
79
|
"@100mslive/hms-noise-cancellation": "0.0.1",
|
80
|
-
"@100mslive/hms-virtual-background": "1.13.22-alpha.
|
81
|
-
"@100mslive/hms-whiteboard": "0.0.12-alpha.
|
82
|
-
"@100mslive/react-icons": "0.10.22-alpha.
|
83
|
-
"@100mslive/react-sdk": "0.10.22-alpha.
|
80
|
+
"@100mslive/hms-virtual-background": "1.13.22-alpha.4",
|
81
|
+
"@100mslive/hms-whiteboard": "0.0.12-alpha.4",
|
82
|
+
"@100mslive/react-icons": "0.10.22-alpha.4",
|
83
|
+
"@100mslive/react-sdk": "0.10.22-alpha.4",
|
84
84
|
"@100mslive/types-prebuilt": "0.12.12",
|
85
85
|
"@emoji-mart/data": "^1.0.6",
|
86
86
|
"@emoji-mart/react": "^1.0.1",
|
@@ -99,7 +99,7 @@
|
|
99
99
|
"@radix-ui/react-tabs": "1.0.0",
|
100
100
|
"@radix-ui/react-toast": "1.0.0",
|
101
101
|
"@radix-ui/react-tooltip": "1.0.6",
|
102
|
-
"@stitches/react": "1.
|
102
|
+
"@stitches/react": "^1.2.8",
|
103
103
|
"emoji-mart": "^5.2.2",
|
104
104
|
"eventemitter2": "^6.4.9",
|
105
105
|
"lodash.merge": "^4.6.2",
|
@@ -117,5 +117,5 @@
|
|
117
117
|
"uuid": "^8.3.2",
|
118
118
|
"worker-timers": "^7.0.40"
|
119
119
|
},
|
120
|
-
"gitHead": "
|
120
|
+
"gitHead": "1a7a504437501f10505fd18c1a06a0cc8c037fd9"
|
121
121
|
}
|
package/src/Avatar/Avatar.tsx
CHANGED
package/src/Prebuilt/App.tsx
CHANGED
@@ -13,12 +13,14 @@ import {
|
|
13
13
|
import { AppData } from './components/AppData/AppData';
|
14
14
|
// @ts-ignore: No implicit Any
|
15
15
|
import AuthToken from './components/AuthToken';
|
16
|
+
import { ConferenceScreen } from './components/ConferenceScreen';
|
16
17
|
// @ts-ignore: No implicit Any
|
17
18
|
import { ErrorBoundary } from './components/ErrorBoundary';
|
18
19
|
// @ts-ignore: No implicit Any
|
19
20
|
import { Init } from './components/init/Init';
|
20
21
|
// @ts-ignore: No implicit Any
|
21
22
|
import { KeyboardHandler } from './components/Input/KeyboardInputManager';
|
23
|
+
import { LeaveScreen } from './components/LeaveScreen';
|
22
24
|
import { MwebLandscapePrompt } from './components/MwebLandscapePrompt';
|
23
25
|
import { Notifications } from './components/Notifications';
|
24
26
|
import { PIPProvider } from './components/PIP/PIPProvider';
|
@@ -48,12 +50,6 @@ import {
|
|
48
50
|
import { FeatureFlags } from './services/FeatureFlags';
|
49
51
|
// @ts-ignore: No implicit Any
|
50
52
|
import { DEFAULT_PORTAL_CONTAINER } from './common/constants';
|
51
|
-
const LeaveScreen = React.lazy(() =>
|
52
|
-
import('./components/LeaveScreen').then(module => ({ default: module.LeaveScreen })),
|
53
|
-
);
|
54
|
-
const ConferenceScreen = React.lazy(() =>
|
55
|
-
import('./components/ConferenceScreen').then(module => ({ default: module.ConferenceScreen })),
|
56
|
-
);
|
57
53
|
|
58
54
|
export type HMSPrebuiltOptions = {
|
59
55
|
userName?: string;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { MutableRefObject,
|
1
|
+
import React, { MutableRefObject, useCallback, useRef } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
3
|
import { VariableSizeList } from 'react-window';
|
4
4
|
import { selectSessionStore, selectUnreadHMSMessagesCount } from '@100mslive/hms-video-store';
|
@@ -8,6 +8,10 @@ import { ChevronDownIcon } from '@100mslive/react-icons';
|
|
8
8
|
import { Button } from '../../../Button';
|
9
9
|
import { Box, Flex } from '../../../Layout';
|
10
10
|
import { config as cssConfig } from '../../../Theme';
|
11
|
+
// @ts-ignore: No implicit any
|
12
|
+
import { EmojiReaction } from '../EmojiReaction';
|
13
|
+
import { MoreSettings } from '../MoreSettings/MoreSettings';
|
14
|
+
import { RaiseHand } from '../RaiseHand';
|
11
15
|
import { ChatBody } from './ChatBody';
|
12
16
|
import { ChatFooter } from './ChatFooter';
|
13
17
|
import { ChatBlocked, ChatPaused } from './ChatStates';
|
@@ -17,12 +21,6 @@ import { useSidepaneResetOnLayoutUpdate } from '../AppData/useSidepaneResetOnLay
|
|
17
21
|
import { useIsPeerBlacklisted } from '../hooks/useChatBlacklist';
|
18
22
|
import { useLandscapeHLSStream, useMobileHLSStream } from '../../common/hooks';
|
19
23
|
import { SESSION_STORE_KEY, SIDE_PANE_OPTIONS } from '../../common/constants';
|
20
|
-
const MoreSettings = React.lazy(() =>
|
21
|
-
import('../MoreSettings/MoreSettings').then(module => ({ default: module.MoreSettings })),
|
22
|
-
);
|
23
|
-
const RaiseHand = React.lazy(() => import('../RaiseHand').then(module => ({ default: module.RaiseHand })));
|
24
|
-
// @ts-ignore: No implicit any
|
25
|
-
const EmojiReaction = React.lazy(() => import('../EmojiReaction').then(module => ({ default: module.EmojiReaction })));
|
26
24
|
|
27
25
|
export const Chat = () => {
|
28
26
|
const { elements, screenType } = useRoomLayoutConferencingScreen();
|
@@ -67,10 +65,10 @@ export const Chat = () => {
|
|
67
65
|
<ChatPaused />
|
68
66
|
<ChatBlocked />
|
69
67
|
{streaming && (!isChatEnabled || isLocalPeerBlacklisted) && (
|
70
|
-
|
68
|
+
<>
|
71
69
|
<RaiseHand css={{ bg: '$surface_default' }} />
|
72
70
|
<MoreSettings elements={elements} screenType={screenType} />
|
73
|
-
|
71
|
+
</>
|
74
72
|
)}
|
75
73
|
</Flex>
|
76
74
|
{isMobile && elements?.chat?.is_overlay && !streaming ? <PinnedMessage /> : null}
|
@@ -131,9 +129,7 @@ export const Chat = () => {
|
|
131
129
|
.otherwise(() => ({})),
|
132
130
|
}}
|
133
131
|
>
|
134
|
-
<
|
135
|
-
<EmojiReaction />
|
136
|
-
</Suspense>
|
132
|
+
<EmojiReaction />
|
137
133
|
</Box>
|
138
134
|
)}
|
139
135
|
</Flex>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react';
|
2
2
|
import { useMedia } from 'react-use';
|
3
|
-
import data from '@emoji-mart/data
|
3
|
+
import data from '@emoji-mart/data';
|
4
4
|
import Picker from '@emoji-mart/react';
|
5
5
|
import { HMSException, selectLocalPeer, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
|
6
6
|
import { EmojiIcon, PauseCircleIcon, SendIcon, VerticalMenuIcon } from '@100mslive/react-icons';
|
@@ -1,32 +1,60 @@
|
|
1
1
|
/* eslint-disable no-case-declarations */
|
2
|
-
import React, { useCallback } from 'react';
|
3
|
-
import {
|
2
|
+
import React, { useCallback, useEffect } from 'react';
|
3
|
+
import {
|
4
|
+
HMSNotificationTypes,
|
5
|
+
HMSRoleChangeRequest,
|
6
|
+
HMSRoomState,
|
7
|
+
selectIsLocalScreenShared,
|
8
|
+
selectLocalPeerID,
|
9
|
+
selectPeerNameByID,
|
10
|
+
selectRoomState,
|
11
|
+
useAwayNotifications,
|
12
|
+
useCustomEvent,
|
13
|
+
useHMSNotifications,
|
14
|
+
useHMSStore,
|
15
|
+
useHMSVanillaStore,
|
16
|
+
} from '@100mslive/react-sdk';
|
17
|
+
import { GroupIcon } from '@100mslive/react-icons';
|
18
|
+
import { Box, Button } from '../../..';
|
19
|
+
import { useRoomLayout, useUpdateRoomLayout } from '../../provider/roomLayoutProvider';
|
4
20
|
// @ts-ignore: No implicit Any
|
5
21
|
import { ToastManager } from '../Toast/ToastManager';
|
6
22
|
import { AutoplayBlockedModal } from './AutoplayBlockedModal';
|
7
23
|
import { ChatNotifications } from './ChatNotifications';
|
8
|
-
import { DeviceChangeNotifications } from './DeviceChangeNotifications';
|
9
24
|
import { DeviceInUseError } from './DeviceInUseError';
|
10
|
-
import { ErrorNotifications } from './ErrorNotifications';
|
11
25
|
import { HandRaisedNotifications } from './HandRaisedNotifications';
|
12
26
|
import { InitErrorModal } from './InitErrorModal';
|
13
|
-
import { MessageNotifications } from './MessageNotifications';
|
14
27
|
import { PeerNotifications } from './PeerNotifications';
|
15
28
|
import { PermissionErrorNotificationModal } from './PermissionErrorModal';
|
16
|
-
import { PollNotificationModal } from './PollNotificationModal';
|
17
29
|
import { ReconnectNotifications } from './ReconnectNotifications';
|
18
|
-
import { RoleChangeNotification } from './RoleChangeNotification';
|
19
30
|
import { TrackBulkUnmuteModal } from './TrackBulkUnmuteModal';
|
20
31
|
import { TrackNotifications } from './TrackNotifications';
|
21
32
|
import { TrackUnmuteModal } from './TrackUnmuteModal';
|
22
33
|
import { TranscriptionNotifications } from './TranscriptionNotifications';
|
34
|
+
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
23
35
|
// @ts-ignore: No implicit Any
|
24
|
-
import {
|
36
|
+
import { usePollViewToggle } from '../AppData/useSidepane';
|
37
|
+
// @ts-ignore: No implicit Any
|
38
|
+
import { useIsNotificationDisabled, useSubscribedNotifications } from '../AppData/useUISettings';
|
39
|
+
import { usePIPWindow } from '../PIP/usePIPWindow';
|
25
40
|
import { ROLE_CHANGE_DECLINED } from '../../common/constants';
|
26
41
|
|
42
|
+
const pollToastKey: Record<string, string> = {};
|
43
|
+
|
27
44
|
export function Notifications() {
|
45
|
+
const localPeerID = useHMSStore(selectLocalPeerID);
|
46
|
+
const notification = useHMSNotifications();
|
47
|
+
const subscribedNotifications = useSubscribedNotifications() || {};
|
28
48
|
const roomState = useHMSStore(selectRoomState);
|
49
|
+
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
29
50
|
const isNotificationDisabled = useIsNotificationDisabled();
|
51
|
+
const screenProps = useRoomLayoutConferencingScreen();
|
52
|
+
const vanillaStore = useHMSVanillaStore();
|
53
|
+
const togglePollView = usePollViewToggle();
|
54
|
+
const { showNotification } = useAwayNotifications();
|
55
|
+
const amIScreenSharing = useHMSStore(selectIsLocalScreenShared);
|
56
|
+
const logoURL = useRoomLayout()?.logo?.url;
|
57
|
+
const { pipWindow } = usePIPWindow();
|
30
58
|
|
31
59
|
const handleRoleChangeDenied = useCallback((request: HMSRoleChangeRequest & { peerName: string }) => {
|
32
60
|
ToastManager.addToast({
|
@@ -37,6 +65,129 @@ export function Notifications() {
|
|
37
65
|
|
38
66
|
useCustomEvent({ type: ROLE_CHANGE_DECLINED, onEvent: handleRoleChangeDenied });
|
39
67
|
|
68
|
+
useEffect(() => {
|
69
|
+
if (!notification || isNotificationDisabled) {
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
switch (notification.type) {
|
73
|
+
case HMSNotificationTypes.NAME_UPDATED:
|
74
|
+
console.log(notification.data.id + ' changed their name to ' + notification.data.name);
|
75
|
+
break;
|
76
|
+
case HMSNotificationTypes.ERROR:
|
77
|
+
if (notification.data?.isTerminal && notification.data?.action !== 'INIT') {
|
78
|
+
if ([500, 6008].includes(notification.data?.code)) {
|
79
|
+
ToastManager.addToast({
|
80
|
+
title: `Error: ${notification.data?.message}`,
|
81
|
+
});
|
82
|
+
} else if (notification.data?.message === 'role limit reached') {
|
83
|
+
ToastManager.addToast({
|
84
|
+
title: 'The room is currently full, try joining later',
|
85
|
+
close: true,
|
86
|
+
icon: (
|
87
|
+
<Box css={{ color: '$alert_error_default' }}>
|
88
|
+
<GroupIcon />
|
89
|
+
</Box>
|
90
|
+
),
|
91
|
+
});
|
92
|
+
} else {
|
93
|
+
ToastManager.addToast({
|
94
|
+
title:
|
95
|
+
notification.data?.message ||
|
96
|
+
'We couldn’t reconnect you. When you’re back online, try joining the room.',
|
97
|
+
close: false,
|
98
|
+
});
|
99
|
+
}
|
100
|
+
return;
|
101
|
+
}
|
102
|
+
// Autoplay error or user denied screen share (cancelled browser pop-up)
|
103
|
+
if (notification.data?.code === 3008 || notification.data?.code === 3001 || notification.data?.code === 3011) {
|
104
|
+
return;
|
105
|
+
}
|
106
|
+
if (notification.data?.action === 'INIT') {
|
107
|
+
return;
|
108
|
+
}
|
109
|
+
if (!subscribedNotifications.ERROR) return;
|
110
|
+
ToastManager.addToast({
|
111
|
+
title: `Error: ${notification.data?.message} - ${notification.data?.description}`,
|
112
|
+
});
|
113
|
+
break;
|
114
|
+
case HMSNotificationTypes.ROLE_UPDATED: {
|
115
|
+
if (notification.data?.isLocal && notification.data?.roleName) {
|
116
|
+
ToastManager.addToast({
|
117
|
+
title: `You are now a ${notification.data.roleName}`,
|
118
|
+
});
|
119
|
+
updateRoomLayoutForRole?.(notification.data.roleName);
|
120
|
+
}
|
121
|
+
break;
|
122
|
+
}
|
123
|
+
case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
|
124
|
+
const track = notification.data?.track;
|
125
|
+
if (!notification.data.enabled) {
|
126
|
+
ToastManager.addToast({
|
127
|
+
title: `Your ${track.source} ${track.type} was muted by
|
128
|
+
${notification.data.requestedBy?.name}.`,
|
129
|
+
});
|
130
|
+
}
|
131
|
+
break;
|
132
|
+
case HMSNotificationTypes.REMOVED_FROM_ROOM:
|
133
|
+
case HMSNotificationTypes.ROOM_ENDED:
|
134
|
+
ToastManager.addToast({
|
135
|
+
title: `${notification.message}.
|
136
|
+
${notification.data.reason && `Reason: ${notification.data.reason}`}`,
|
137
|
+
});
|
138
|
+
break;
|
139
|
+
case HMSNotificationTypes.DEVICE_CHANGE_UPDATE:
|
140
|
+
ToastManager.addToast({
|
141
|
+
title: notification.message,
|
142
|
+
});
|
143
|
+
break;
|
144
|
+
|
145
|
+
case HMSNotificationTypes.POLL_STARTED:
|
146
|
+
if (notification.data.startedBy !== localPeerID && screenProps.screenType !== 'hls_live_streaming') {
|
147
|
+
const pollStartedBy = vanillaStore.getState(selectPeerNameByID(notification.data.startedBy)) || 'Participant';
|
148
|
+
|
149
|
+
const pollToastID = ToastManager.addToast({
|
150
|
+
title: `${pollStartedBy} started a ${notification.data.type}: ${notification.data.title}`,
|
151
|
+
action: (
|
152
|
+
<Button
|
153
|
+
onClick={() => togglePollView(notification.data.id)}
|
154
|
+
variant="standard"
|
155
|
+
css={{
|
156
|
+
backgroundColor: '$surface_bright',
|
157
|
+
fontWeight: '$semiBold',
|
158
|
+
color: '$on_surface_high',
|
159
|
+
p: '$xs $md',
|
160
|
+
}}
|
161
|
+
>
|
162
|
+
{notification.data.type === 'quiz' ? 'Answer' : 'Vote'}
|
163
|
+
</Button>
|
164
|
+
),
|
165
|
+
duration: Infinity,
|
166
|
+
});
|
167
|
+
pollToastKey[notification.data.id] = pollToastID;
|
168
|
+
}
|
169
|
+
break;
|
170
|
+
case HMSNotificationTypes.POLL_STOPPED:
|
171
|
+
const pollID = notification?.data.id;
|
172
|
+
if (pollID && pollToastKey?.[pollID]) {
|
173
|
+
ToastManager.removeToast(pollToastKey?.[notification.data.id]);
|
174
|
+
delete pollToastKey[notification?.data.id];
|
175
|
+
}
|
176
|
+
break;
|
177
|
+
case HMSNotificationTypes.NEW_MESSAGE:
|
178
|
+
if (amIScreenSharing && !notification.data?.ignored && !pipWindow) {
|
179
|
+
showNotification(`New message from ${notification.data.senderName}`, {
|
180
|
+
body: notification.data.message,
|
181
|
+
icon: logoURL,
|
182
|
+
});
|
183
|
+
}
|
184
|
+
break;
|
185
|
+
default:
|
186
|
+
break;
|
187
|
+
}
|
188
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
189
|
+
}, [notification, subscribedNotifications.ERROR, subscribedNotifications.METADATA_UPDATED]);
|
190
|
+
|
40
191
|
if (isNotificationDisabled) {
|
41
192
|
return null;
|
42
193
|
}
|
@@ -47,12 +198,7 @@ export function Notifications() {
|
|
47
198
|
<TrackBulkUnmuteModal />
|
48
199
|
<TrackNotifications />
|
49
200
|
{roomState === HMSRoomState.Connected ? <PeerNotifications /> : null}
|
50
|
-
<RoleChangeNotification />
|
51
|
-
<PollNotificationModal />
|
52
|
-
<MessageNotifications />
|
53
|
-
<DeviceChangeNotifications />
|
54
201
|
<ReconnectNotifications />
|
55
|
-
<ErrorNotifications />
|
56
202
|
<AutoplayBlockedModal />
|
57
203
|
<PermissionErrorNotificationModal />
|
58
204
|
<InitErrorModal />
|
@@ -7,11 +7,7 @@ import { useSetSubscribedChatSelector, useSubscribedNotifications } from '../App
|
|
7
7
|
// @ts-ignore: No implicit Any
|
8
8
|
import { CHAT_SELECTOR, SUBSCRIBED_NOTIFICATIONS } from '../../common/constants';
|
9
9
|
|
10
|
-
const notificationTypes = [
|
11
|
-
HMSNotificationTypes.PEER_JOINED,
|
12
|
-
HMSNotificationTypes.PEER_LEFT,
|
13
|
-
HMSNotificationTypes.NAME_UPDATED,
|
14
|
-
];
|
10
|
+
const notificationTypes = [HMSNotificationTypes.PEER_JOINED, HMSNotificationTypes.PEER_LEFT];
|
15
11
|
|
16
12
|
export const PeerNotifications = () => {
|
17
13
|
const notification = useHMSNotifications(notificationTypes);
|
@@ -39,14 +35,11 @@ export const PeerNotifications = () => {
|
|
39
35
|
return;
|
40
36
|
}
|
41
37
|
break;
|
42
|
-
case HMSNotificationTypes.NAME_UPDATED:
|
43
|
-
console.log(notification.data.id + ' changed their name to ' + notification.data.name);
|
44
|
-
return;
|
45
38
|
default:
|
46
39
|
return;
|
47
40
|
}
|
48
41
|
ToastBatcher.showToast({ notification });
|
49
|
-
}, [notification]);
|
42
|
+
}, [notification, isPeerJoinSubscribed, isPeerLeftSubscribed, selectedPeer.id, setPeerSelector]);
|
50
43
|
|
51
44
|
return null;
|
52
45
|
};
|
@@ -5,7 +5,11 @@ import { ToastConfig } from '../Toast/ToastConfig';
|
|
5
5
|
// @ts-ignore: No implicit Any
|
6
6
|
import { ToastManager } from '../Toast/ToastManager';
|
7
7
|
|
8
|
-
const notificationTypes = [
|
8
|
+
const notificationTypes = [
|
9
|
+
HMSNotificationTypes.RECONNECTED,
|
10
|
+
HMSNotificationTypes.RECONNECTING,
|
11
|
+
HMSNotificationTypes.ERROR,
|
12
|
+
];
|
9
13
|
let notificationId: string | null = null;
|
10
14
|
|
11
15
|
export const ReconnectNotifications = () => {
|
@@ -9,16 +9,14 @@ import { MicOnIcon } from '@100mslive/react-icons';
|
|
9
9
|
// @ts-ignore: No implicit Any
|
10
10
|
import { RequestDialog } from '../../primitives/DialogContent';
|
11
11
|
|
12
|
-
const notificationTypes = [
|
13
|
-
HMSNotificationTypes.CHANGE_MULTI_TRACK_STATE_REQUEST,
|
14
|
-
HMSNotificationTypes.ROOM_ENDED,
|
15
|
-
HMSNotificationTypes.REMOVED_FROM_ROOM,
|
16
|
-
];
|
17
|
-
|
18
12
|
export const TrackBulkUnmuteModal = () => {
|
19
13
|
const hmsActions = useHMSActions();
|
20
14
|
const [muteNotification, setMuteNotification] = useState<HMSChangeMultiTrackStateRequest | null>(null);
|
21
|
-
const notification = useHMSNotifications(
|
15
|
+
const notification = useHMSNotifications([
|
16
|
+
HMSNotificationTypes.CHANGE_MULTI_TRACK_STATE_REQUEST,
|
17
|
+
HMSNotificationTypes.ROOM_ENDED,
|
18
|
+
HMSNotificationTypes.REMOVED_FROM_ROOM,
|
19
|
+
]);
|
22
20
|
|
23
21
|
useEffect(() => {
|
24
22
|
switch (notification?.type) {
|
@@ -1,39 +1,17 @@
|
|
1
1
|
import { useEffect } from 'react';
|
2
2
|
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
3
|
-
// @ts-ignore: No implicit Any
|
4
|
-
import { ToastManager } from '../Toast/ToastManager';
|
5
3
|
|
6
4
|
const notificationTypes = [
|
7
5
|
HMSNotificationTypes.TRACK_ADDED,
|
8
6
|
HMSNotificationTypes.TRACK_REMOVED,
|
9
7
|
HMSNotificationTypes.TRACK_MUTED,
|
10
8
|
HMSNotificationTypes.TRACK_UNMUTED,
|
11
|
-
HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
|
12
9
|
];
|
13
|
-
|
14
10
|
export const TrackNotifications = () => {
|
15
11
|
const notification = useHMSNotifications(notificationTypes);
|
16
12
|
useEffect(() => {
|
17
13
|
if (notification) {
|
18
|
-
|
19
|
-
case HMSNotificationTypes.TRACK_ADDED:
|
20
|
-
case HMSNotificationTypes.TRACK_REMOVED:
|
21
|
-
case HMSNotificationTypes.TRACK_MUTED:
|
22
|
-
case HMSNotificationTypes.TRACK_UNMUTED:
|
23
|
-
console.debug(`[${notification.type}]`, notification);
|
24
|
-
break;
|
25
|
-
case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
|
26
|
-
{
|
27
|
-
const track = notification.data?.track;
|
28
|
-
if (!notification.data.enabled) {
|
29
|
-
ToastManager.addToast({
|
30
|
-
title: `Your ${track.source} ${track.type} was muted by
|
31
|
-
${notification.data.requestedBy?.name}.`,
|
32
|
-
});
|
33
|
-
}
|
34
|
-
}
|
35
|
-
break;
|
36
|
-
}
|
14
|
+
console.debug(`[${notification.type}]`, notification);
|
37
15
|
}
|
38
16
|
}, [notification]);
|
39
17
|
|
@@ -8,28 +8,20 @@ import {
|
|
8
8
|
import { MicOnIcon } from '@100mslive/react-icons';
|
9
9
|
// @ts-ignore: No implicit Any
|
10
10
|
import { RequestDialog } from '../../primitives/DialogContent';
|
11
|
-
// @ts-ignore: No implicit Any
|
12
|
-
import { ToastManager } from '../Toast/ToastManager';
|
13
|
-
|
14
|
-
const notificationTypes = [
|
15
|
-
HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
|
16
|
-
HMSNotificationTypes.ROOM_ENDED,
|
17
|
-
HMSNotificationTypes.REMOVED_FROM_ROOM,
|
18
|
-
];
|
19
11
|
|
20
12
|
export const TrackUnmuteModal = () => {
|
21
13
|
const hmsActions = useHMSActions();
|
22
|
-
const notification = useHMSNotifications(
|
14
|
+
const notification = useHMSNotifications([
|
15
|
+
HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
|
16
|
+
HMSNotificationTypes.ROOM_ENDED,
|
17
|
+
HMSNotificationTypes.REMOVED_FROM_ROOM,
|
18
|
+
]);
|
23
19
|
const [muteNotification, setMuteNotification] = useState<HMSChangeTrackStateRequest | null>(null);
|
24
20
|
|
25
21
|
useEffect(() => {
|
26
22
|
switch (notification?.type) {
|
27
23
|
case HMSNotificationTypes.REMOVED_FROM_ROOM:
|
28
24
|
case HMSNotificationTypes.ROOM_ENDED:
|
29
|
-
ToastManager.addToast({
|
30
|
-
title: `${notification.message}.
|
31
|
-
${notification.data.reason && `Reason: ${notification.data.reason}`}`,
|
32
|
-
});
|
33
25
|
setMuteNotification(null);
|
34
26
|
break;
|
35
27
|
case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
|
@@ -5,11 +5,9 @@ import {
|
|
5
5
|
selectLocalPeerID,
|
6
6
|
selectPeersMap,
|
7
7
|
selectTracksMap,
|
8
|
-
useHMSActions,
|
9
8
|
useHMSStatsStore,
|
10
9
|
useHMSStore,
|
11
10
|
} from '@100mslive/react-sdk';
|
12
|
-
import { Accordion } from '../../Accordion';
|
13
11
|
import { HorizontalDivider } from '../../Divider';
|
14
12
|
import { Dropdown } from '../../Dropdown';
|
15
13
|
import { Label } from '../../Label';
|
@@ -29,8 +27,6 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
29
27
|
() => [{ id: 'local-peer', label: 'Local Peer Stats' }, ...tracksWithLabels],
|
30
28
|
[tracksWithLabels],
|
31
29
|
);
|
32
|
-
const hmsActions = useHMSActions();
|
33
|
-
const details = hmsActions.getDebugInfo();
|
34
30
|
const [selectedStat, setSelectedStat] = useState(statsOptions[0]);
|
35
31
|
const [showStatsOnTiles, setShowStatsOnTiles] = useSetUiSettings(UI_SETTINGS.showStatsOnTiles);
|
36
32
|
const [open, setOpen] = useState(false);
|
@@ -50,7 +46,7 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
50
46
|
<Dialog.Content
|
51
47
|
css={{
|
52
48
|
width: 'min(500px, 95%)',
|
53
|
-
|
49
|
+
maxHeight: '100%',
|
54
50
|
overflowY: 'auto',
|
55
51
|
}}
|
56
52
|
>
|
@@ -74,7 +70,6 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
74
70
|
</Text>
|
75
71
|
</Flex>
|
76
72
|
{/* Select */}
|
77
|
-
|
78
73
|
<Flex
|
79
74
|
direction="column"
|
80
75
|
css={{
|
@@ -124,9 +119,6 @@ export const StatsForNerds = ({ onOpenChange }) => {
|
|
124
119
|
) : (
|
125
120
|
<TrackStats trackID={selectedStat.id} layer={selectedStat.layer} local={selectedStat.local} />
|
126
121
|
)}
|
127
|
-
<Flex justify="start" gap={4} css={{ m: '$10 0', w: '100%' }}>
|
128
|
-
<DebugInfo details={details} />
|
129
|
-
</Flex>
|
130
122
|
</Dialog.Content>
|
131
123
|
</Dialog.Portal>
|
132
124
|
</Dialog.Root>
|
@@ -237,29 +229,8 @@ const TrackStats = ({ trackID, layer, local }) => {
|
|
237
229
|
);
|
238
230
|
};
|
239
231
|
|
240
|
-
const
|
241
|
-
|
242
|
-
<Accordion.Root type="single" collapsible css={{ w: '100%' }}>
|
243
|
-
<Accordion.Item value="Debug Info">
|
244
|
-
<Accordion.Header>
|
245
|
-
<Label variant="body2" css={{ c: '$on_surface_high' }}>
|
246
|
-
Debug Info
|
247
|
-
</Label>
|
248
|
-
</Accordion.Header>
|
249
|
-
<Accordion.Content>
|
250
|
-
<Flex css={{ flexWrap: 'wrap', mt: '$10', gap: '$10' }}>
|
251
|
-
<StatsRow css={{ w: '100%' }} label="Websocket URL" value={details?.websocketURL} />
|
252
|
-
<StatsRow css={{ w: '100%' }} label="Init Endpoint" value={details?.initEndpoint} />
|
253
|
-
<StatsRow css={{ w: '100%' }} label="Enabled flags" value={details?.enabledFlags?.join(', ')} />
|
254
|
-
</Flex>
|
255
|
-
</Accordion.Content>
|
256
|
-
</Accordion.Item>
|
257
|
-
</Accordion.Root>
|
258
|
-
);
|
259
|
-
};
|
260
|
-
|
261
|
-
const StatsRow = React.memo(({ label, value, css }) => (
|
262
|
-
<Box css={{ bg: '$surface_bright', w: 'calc(50% - $6)', p: '$8', r: '$3', ...css }}>
|
232
|
+
const StatsRow = React.memo(({ label, value }) => (
|
233
|
+
<Box css={{ bg: '$surface_bright', w: 'calc(50% - $6)', p: '$8', r: '$3' }}>
|
263
234
|
<Text
|
264
235
|
variant="overline"
|
265
236
|
css={{
|