@100mslive/roomkit-react 0.3.22-alpha.3 → 0.3.22-alpha.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. package/dist/Accordion/Accordion.d.ts +322 -134
  2. package/dist/Accordion/index.d.ts +322 -134
  3. package/dist/Avatar/Avatar.d.ts +141 -47
  4. package/dist/Button/Button.d.ts +141 -47
  5. package/dist/Checkbox/Checkbox.d.ts +322 -134
  6. package/dist/Collapsible/Collapsible.d.ts +483 -201
  7. package/dist/Divider/Divider.d.ts +322 -134
  8. package/dist/Dropdown/Dropdown.d.ts +1932 -804
  9. package/dist/Fieldset/Fieldset.d.ts +141 -47
  10. package/dist/Footer/Footer.d.ts +1288 -536
  11. package/dist/{PDFView-RMR33QH4.css → HLSView-CNAJ5SBZ.css} +3 -3
  12. package/dist/{LeaveScreen-ZAG5UJZL.css.map → HLSView-CNAJ5SBZ.css.map} +1 -1
  13. package/dist/{HLSView-EYGGK6BH.js → HLSView-YIWJTBCT.js} +24 -38
  14. package/dist/HLSView-YIWJTBCT.js.map +7 -0
  15. package/dist/IconButton/IconButton.d.ts +141 -47
  16. package/dist/Input/Input.d.ts +926 -362
  17. package/dist/Label/Label.d.ts +141 -47
  18. package/dist/Layout/Box.d.ts +141 -47
  19. package/dist/Layout/Flex.d.ts +141 -47
  20. package/dist/Link/Link.d.ts +141 -47
  21. package/dist/Modal/Dialog.d.ts +987 -329
  22. package/dist/Modal/DialogContent.d.ts +1127 -469
  23. package/dist/Pagination/StyledPagination.d.ts +644 -268
  24. package/dist/Popover/index.d.ts +483 -201
  25. package/dist/Prebuilt/IconButton.d.ts +322 -134
  26. package/dist/Prebuilt/components/Chat/ChatBody.d.ts +322 -134
  27. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +805 -335
  28. package/dist/Prebuilt/components/Settings/common.d.ts +322 -134
  29. package/dist/Progress/index.d.ts +322 -134
  30. package/dist/RadioGroup/RadioGroup.d.ts +483 -201
  31. package/dist/ReactSelect/ReactSelect.d.ts +1610 -670
  32. package/dist/Select/Select.d.ts +483 -201
  33. package/dist/Sheet/Sheet.d.ts +987 -329
  34. package/dist/Slider/Slider.d.ts +141 -47
  35. package/dist/Stats/StyledStats.d.ts +966 -402
  36. package/dist/Switch/Switch.d.ts +141 -47
  37. package/dist/Tabs/Tabs.d.ts +644 -268
  38. package/dist/Text/Text.d.ts +141 -47
  39. package/dist/TextArea/TextArea.d.ts +141 -47
  40. package/dist/Theme/base.config.d.ts +78 -26
  41. package/dist/Theme/stitches.config.d.ts +1514 -1067
  42. package/dist/TileMenu/StyledMenuTile.d.ts +1127 -469
  43. package/dist/Toast/Toast.d.ts +946 -382
  44. package/dist/Video/Video.d.ts +141 -47
  45. package/dist/VideoList/StyledVideoList.d.ts +483 -201
  46. package/dist/VideoTile/StyledVideoTile.d.ts +1610 -670
  47. package/dist/chunk-4UCH4XSJ.js +34759 -0
  48. package/dist/chunk-4UCH4XSJ.js.map +7 -0
  49. package/dist/index.cjs.css +2 -2
  50. package/dist/index.cjs.css.map +1 -1
  51. package/dist/index.cjs.js +22367 -22558
  52. package/dist/index.cjs.js.map +4 -4
  53. package/dist/index.css +2 -2
  54. package/dist/index.css.map +1 -1
  55. package/dist/index.js +15 -25
  56. package/dist/meta.cjs.json +5076 -5434
  57. package/dist/meta.esbuild.json +6290 -9146
  58. package/package.json +8 -8
  59. package/src/Avatar/Avatar.tsx +1 -1
  60. package/src/Popover/Popover.stories.tsx +1 -1
  61. package/src/Prebuilt/App.tsx +2 -6
  62. package/src/Prebuilt/components/Chat/Chat.tsx +8 -12
  63. package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
  64. package/src/Prebuilt/components/Notifications/Notifications.tsx +171 -13
  65. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +2 -9
  66. package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +5 -1
  67. package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +5 -7
  68. package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +1 -23
  69. package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +5 -13
  70. package/src/Prebuilt/components/StatsForNerds.jsx +3 -32
  71. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +31 -43
  72. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
  73. package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +1 -3
  74. package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +0 -6
  75. package/src/Prebuilt/layouts/HLSView.jsx +0 -1
  76. package/src/Prebuilt/layouts/PDFView.jsx +0 -1
  77. package/src/Prebuilt/layouts/SidePane.tsx +6 -12
  78. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +34 -35
  79. package/dist/ConferenceScreen-CSVWECB5.js +0 -1778
  80. package/dist/ConferenceScreen-CSVWECB5.js.map +0 -7
  81. package/dist/ConferenceScreen-YRURU3RV.css +0 -2780
  82. package/dist/ConferenceScreen-YRURU3RV.css.map +0 -7
  83. package/dist/EmbedView-N2E4DZQA.js +0 -17
  84. package/dist/EmbedView-N2E4DZQA.js.map +0 -7
  85. package/dist/EmbedView-S54NTHF5.css +0 -2780
  86. package/dist/EmbedView-S54NTHF5.css.map +0 -7
  87. package/dist/EmojiReaction-3X4ST4AU.js +0 -11
  88. package/dist/EmojiReaction-3X4ST4AU.js.map +0 -7
  89. package/dist/HLSView-EYGGK6BH.js.map +0 -7
  90. package/dist/HLSView-LBTFLMI4.css +0 -2780
  91. package/dist/HLSView-LBTFLMI4.css.map +0 -7
  92. package/dist/LeaveScreen-D6XU64JL.js +0 -556
  93. package/dist/LeaveScreen-D6XU64JL.js.map +0 -7
  94. package/dist/LeaveScreen-ZAG5UJZL.css +0 -2780
  95. package/dist/MoreSettings-R7B4BSNT.css +0 -2780
  96. package/dist/MoreSettings-R7B4BSNT.css.map +0 -7
  97. package/dist/MoreSettings-TBJVM7OY.js +0 -16
  98. package/dist/MoreSettings-TBJVM7OY.js.map +0 -7
  99. package/dist/PDFView-JOIJDP65.js +0 -84
  100. package/dist/PDFView-JOIJDP65.js.map +0 -7
  101. package/dist/PDFView-RMR33QH4.css.map +0 -7
  102. package/dist/Polls-IN3V2HFI.js +0 -1584
  103. package/dist/Polls-IN3V2HFI.js.map +0 -7
  104. package/dist/Polls-JW7JWGTE.css +0 -2780
  105. package/dist/Polls-JW7JWGTE.css.map +0 -7
  106. package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +0 -1
  107. package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +0 -1
  108. package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +0 -1
  109. package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +0 -1
  110. package/dist/Prebuilt/components/Notifications/RoleChangeNotification.d.ts +0 -1
  111. package/dist/RaiseHand-WES4KKMD.js +0 -10
  112. package/dist/RaiseHand-WES4KKMD.js.map +0 -7
  113. package/dist/RoleProminence-4ZBDBCMU.css +0 -2780
  114. package/dist/RoleProminence-4ZBDBCMU.css.map +0 -7
  115. package/dist/RoleProminence-PB32DLIB.js +0 -116
  116. package/dist/RoleProminence-PB32DLIB.js.map +0 -7
  117. package/dist/RoomDetailsPane-CZH2SNLE.js +0 -53
  118. package/dist/RoomDetailsPane-CZH2SNLE.js.map +0 -7
  119. package/dist/RoomDetailsPane-XWH2KEFI.css +0 -2780
  120. package/dist/RoomDetailsPane-XWH2KEFI.css.map +0 -7
  121. package/dist/ScreenshareLayout-XVENPVK3.js +0 -358
  122. package/dist/ScreenshareLayout-XVENPVK3.js.map +0 -7
  123. package/dist/ScreenshareLayout-YUW3KHAB.css +0 -2780
  124. package/dist/ScreenshareLayout-YUW3KHAB.css.map +0 -7
  125. package/dist/SidePaneTabs-QXCDHOGG.js +0 -1354
  126. package/dist/SidePaneTabs-QXCDHOGG.js.map +0 -7
  127. package/dist/SidePaneTabs-WQGVOWRP.css +0 -2780
  128. package/dist/SidePaneTabs-WQGVOWRP.css.map +0 -7
  129. package/dist/VBPicker-XN74N67R.js +0 -322
  130. package/dist/VBPicker-XN74N67R.js.map +0 -7
  131. package/dist/VBPicker-YDM2YIOM.css +0 -2780
  132. package/dist/VBPicker-YDM2YIOM.css.map +0 -7
  133. package/dist/WaitingView-77PRTIBV.js +0 -10
  134. package/dist/WaitingView-77PRTIBV.js.map +0 -7
  135. package/dist/WhiteboardLayout-FZC7SOSG.js +0 -96
  136. package/dist/WhiteboardLayout-FZC7SOSG.js.map +0 -7
  137. package/dist/WhiteboardLayout-MNTUWEVK.css +0 -2780
  138. package/dist/WhiteboardLayout-MNTUWEVK.css.map +0 -7
  139. package/dist/android-perm-1.png +0 -0
  140. package/dist/audio-level.png +0 -0
  141. package/dist/chunk-26D5FDBW.js +0 -16812
  142. package/dist/chunk-26D5FDBW.js.map +0 -7
  143. package/dist/chunk-2J5WS52X.js +0 -2595
  144. package/dist/chunk-2J5WS52X.js.map +0 -7
  145. package/dist/chunk-2LWOQMYY.js +0 -30
  146. package/dist/chunk-2LWOQMYY.js.map +0 -7
  147. package/dist/chunk-3MRQJSIY.js +0 -171
  148. package/dist/chunk-3MRQJSIY.js.map +0 -7
  149. package/dist/chunk-4X4WB7X3.js +0 -98
  150. package/dist/chunk-4X4WB7X3.js.map +0 -7
  151. package/dist/chunk-7QZJMUHM.js +0 -90
  152. package/dist/chunk-7QZJMUHM.js.map +0 -7
  153. package/dist/chunk-ABCV7TX5.js +0 -71
  154. package/dist/chunk-ABCV7TX5.js.map +0 -7
  155. package/dist/chunk-BQOT4DK7.js +0 -418
  156. package/dist/chunk-BQOT4DK7.js.map +0 -7
  157. package/dist/chunk-ENHSO6YN.js +0 -6337
  158. package/dist/chunk-ENHSO6YN.js.map +0 -7
  159. package/dist/chunk-JKWX7W4K.js +0 -161
  160. package/dist/chunk-JKWX7W4K.js.map +0 -7
  161. package/dist/chunk-LO4BXA4G.js +0 -114
  162. package/dist/chunk-LO4BXA4G.js.map +0 -7
  163. package/dist/chunk-MRVWNFXC.js +0 -59
  164. package/dist/chunk-MRVWNFXC.js.map +0 -7
  165. package/dist/chunk-OA4HW7HW.js +0 -262
  166. package/dist/chunk-OA4HW7HW.js.map +0 -7
  167. package/dist/chunk-PJQSPAFZ.js +0 -178
  168. package/dist/chunk-PJQSPAFZ.js.map +0 -7
  169. package/dist/chunk-QHQKY35W.js +0 -830
  170. package/dist/chunk-QHQKY35W.js.map +0 -7
  171. package/dist/chunk-QKXHQ6DV.js +0 -254
  172. package/dist/chunk-QKXHQ6DV.js.map +0 -7
  173. package/dist/chunk-RTWNTT77.js +0 -62
  174. package/dist/chunk-RTWNTT77.js.map +0 -7
  175. package/dist/chunk-TBXRX6MK.js +0 -576
  176. package/dist/chunk-TBXRX6MK.js.map +0 -7
  177. package/dist/chunk-TCOPR3BK.js +0 -487
  178. package/dist/chunk-TCOPR3BK.js.map +0 -7
  179. package/dist/chunk-VKORP2LF.js +0 -41
  180. package/dist/chunk-VKORP2LF.js.map +0 -7
  181. package/dist/chunk-YYVDCP5Z.js +0 -136
  182. package/dist/chunk-YYVDCP5Z.js.map +0 -7
  183. package/dist/empty-chat.svg +0 -12
  184. package/dist/ios-perm-0.png +0 -0
  185. package/dist/pdf-share.png +0 -0
  186. package/dist/screen-share.png +0 -0
  187. package/dist/transaction_error.svg +0 -12
  188. package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +0 -18
  189. package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +0 -56
  190. package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +0 -24
  191. package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +0 -71
  192. 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.3",
13
+ "version": "0.3.22-alpha.5",
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.3",
78
+ "@100mslive/hls-player": "0.3.22-alpha.5",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.22-alpha.3",
81
- "@100mslive/hms-whiteboard": "0.0.12-alpha.3",
82
- "@100mslive/react-icons": "0.10.22-alpha.3",
83
- "@100mslive/react-sdk": "0.10.22-alpha.3",
80
+ "@100mslive/hms-virtual-background": "1.13.22-alpha.5",
81
+ "@100mslive/hms-whiteboard": "0.0.12-alpha.5",
82
+ "@100mslive/react-icons": "0.10.22-alpha.5",
83
+ "@100mslive/react-sdk": "0.10.22-alpha.5",
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.3.1-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": "a8567a9c3235539b3b59e687337b344f22b5375c"
120
+ "gitHead": "ea03b55cbe2eb69e38a37f0582e1c35f78918bf1"
121
121
  }
@@ -13,7 +13,7 @@ export const StyledAvatar = styled('div', {
13
13
  ...flexCenter,
14
14
  color: '$colors$on_primary_high',
15
15
  fontFamily: '$sans',
16
- aspectRatio: '1',
16
+ aspectRatio: 1,
17
17
  fontWeight: 600,
18
18
  fontSize: '$space$9',
19
19
  variants: {
@@ -32,7 +32,7 @@ const Template: ComponentStory<typeof Popover.Root> = () => (
32
32
  <Button
33
33
  variant="standard"
34
34
  css={{
35
- aspectRatio: '1',
35
+ aspectRatio: 1,
36
36
  r: '$round',
37
37
  p: '$2 $2',
38
38
  bg: '$background_default',
@@ -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, Suspense, useCallback, useRef } from 'react';
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
- <Suspense fallback={<></>}>
68
+ <>
71
69
  <RaiseHand css={{ bg: '$surface_default' }} />
72
70
  <MoreSettings elements={elements} screenType={screenType} />
73
- </Suspense>
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
- <Suspense fallback={<></>}>
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/sets/14/apple.json';
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,71 @@
1
1
  /* eslint-disable no-case-declarations */
2
- import React, { useCallback } from 'react';
3
- import { HMSRoleChangeRequest, HMSRoomState, selectRoomState, useCustomEvent, useHMSStore } from '@100mslive/react-sdk';
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 { useIsNotificationDisabled } from '../AppData/useUISettings';
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
+ HMSNotificationTypes.NAME_UPDATED,
48
+ HMSNotificationTypes.ERROR,
49
+ HMSNotificationTypes.ROLE_UPDATED,
50
+ HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST,
51
+ HMSNotificationTypes.REMOVED_FROM_ROOM,
52
+ HMSNotificationTypes.ROOM_ENDED,
53
+ HMSNotificationTypes.DEVICE_CHANGE_UPDATE,
54
+ HMSNotificationTypes.POLL_STARTED,
55
+ HMSNotificationTypes.POLL_STOPPED,
56
+ HMSNotificationTypes.NEW_MESSAGE,
57
+ ]);
58
+ const subscribedNotifications = useSubscribedNotifications() || {};
28
59
  const roomState = useHMSStore(selectRoomState);
60
+ const updateRoomLayoutForRole = useUpdateRoomLayout();
29
61
  const isNotificationDisabled = useIsNotificationDisabled();
62
+ const screenProps = useRoomLayoutConferencingScreen();
63
+ const vanillaStore = useHMSVanillaStore();
64
+ const togglePollView = usePollViewToggle();
65
+ const { showNotification } = useAwayNotifications();
66
+ const amIScreenSharing = useHMSStore(selectIsLocalScreenShared);
67
+ const logoURL = useRoomLayout()?.logo?.url;
68
+ const { pipWindow } = usePIPWindow();
30
69
 
31
70
  const handleRoleChangeDenied = useCallback((request: HMSRoleChangeRequest & { peerName: string }) => {
32
71
  ToastManager.addToast({
@@ -37,6 +76,130 @@ export function Notifications() {
37
76
 
38
77
  useCustomEvent({ type: ROLE_CHANGE_DECLINED, onEvent: handleRoleChangeDenied });
39
78
 
79
+ useEffect(() => {
80
+ if (!notification || isNotificationDisabled) {
81
+ return;
82
+ }
83
+ switch (notification.type) {
84
+ case HMSNotificationTypes.NAME_UPDATED:
85
+ console.log(notification.data.id + ' changed their name to ' + notification.data.name);
86
+ break;
87
+ case HMSNotificationTypes.ERROR:
88
+ if (notification.data?.isTerminal && notification.data?.action !== 'INIT') {
89
+ if ([500, 6008].includes(notification.data?.code)) {
90
+ ToastManager.addToast({
91
+ title: `Error: ${notification.data?.message}`,
92
+ });
93
+ } else if (notification.data?.message === 'role limit reached') {
94
+ ToastManager.addToast({
95
+ title: 'The room is currently full, try joining later',
96
+ close: true,
97
+ icon: (
98
+ <Box css={{ color: '$alert_error_default' }}>
99
+ <GroupIcon />
100
+ </Box>
101
+ ),
102
+ });
103
+ } else {
104
+ ToastManager.addToast({
105
+ title:
106
+ notification.data?.message ||
107
+ 'We couldn’t reconnect you. When you’re back online, try joining the room.',
108
+ close: false,
109
+ });
110
+ }
111
+ return;
112
+ }
113
+ // Autoplay error or user denied screen share (cancelled browser pop-up)
114
+ if (notification.data?.code === 3008 || notification.data?.code === 3001 || notification.data?.code === 3011) {
115
+ return;
116
+ }
117
+ if (notification.data?.action === 'INIT') {
118
+ return;
119
+ }
120
+ if (!subscribedNotifications.ERROR) return;
121
+ ToastManager.addToast({
122
+ title: `Error: ${notification.data?.message} - ${notification.data?.description}`,
123
+ duration: 8000,
124
+ });
125
+ break;
126
+ case HMSNotificationTypes.ROLE_UPDATED: {
127
+ if (notification.data?.isLocal && notification.data?.roleName) {
128
+ ToastManager.addToast({
129
+ title: `You are now a ${notification.data.roleName}`,
130
+ });
131
+ updateRoomLayoutForRole?.(notification.data.roleName);
132
+ }
133
+ break;
134
+ }
135
+ case HMSNotificationTypes.CHANGE_TRACK_STATE_REQUEST:
136
+ const track = notification.data?.track;
137
+ if (!notification.data.enabled) {
138
+ ToastManager.addToast({
139
+ title: `Your ${track.source} ${track.type} was muted by
140
+ ${notification.data.requestedBy?.name}.`,
141
+ });
142
+ }
143
+ break;
144
+ case HMSNotificationTypes.REMOVED_FROM_ROOM:
145
+ case HMSNotificationTypes.ROOM_ENDED:
146
+ ToastManager.addToast({
147
+ title: `${notification.message}.
148
+ ${notification.data.reason && `Reason: ${notification.data.reason}`}`,
149
+ });
150
+ break;
151
+ case HMSNotificationTypes.DEVICE_CHANGE_UPDATE:
152
+ ToastManager.addToast({
153
+ title: notification.message,
154
+ });
155
+ break;
156
+
157
+ case HMSNotificationTypes.POLL_STARTED:
158
+ if (notification.data.startedBy !== localPeerID && screenProps.screenType !== 'hls_live_streaming') {
159
+ const pollStartedBy = vanillaStore.getState(selectPeerNameByID(notification.data.startedBy)) || 'Participant';
160
+
161
+ const pollToastID = ToastManager.addToast({
162
+ title: `${pollStartedBy} started a ${notification.data.type}: ${notification.data.title}`,
163
+ action: (
164
+ <Button
165
+ onClick={() => togglePollView(notification.data.id)}
166
+ variant="standard"
167
+ css={{
168
+ backgroundColor: '$surface_bright',
169
+ fontWeight: '$semiBold',
170
+ color: '$on_surface_high',
171
+ p: '$xs $md',
172
+ }}
173
+ >
174
+ {notification.data.type === 'quiz' ? 'Answer' : 'Vote'}
175
+ </Button>
176
+ ),
177
+ duration: Infinity,
178
+ });
179
+ pollToastKey[notification.data.id] = pollToastID;
180
+ }
181
+ break;
182
+ case HMSNotificationTypes.POLL_STOPPED:
183
+ const pollID = notification?.data.id;
184
+ if (pollID && pollToastKey?.[pollID]) {
185
+ ToastManager.removeToast(pollToastKey?.[notification.data.id]);
186
+ delete pollToastKey[notification?.data.id];
187
+ }
188
+ break;
189
+ case HMSNotificationTypes.NEW_MESSAGE:
190
+ if (amIScreenSharing && !notification.data?.ignored && !pipWindow) {
191
+ showNotification(`New message from ${notification.data.senderName}`, {
192
+ body: notification.data.message,
193
+ icon: logoURL,
194
+ });
195
+ }
196
+ break;
197
+ default:
198
+ break;
199
+ }
200
+ // eslint-disable-next-line react-hooks/exhaustive-deps
201
+ }, [notification, subscribedNotifications.ERROR, subscribedNotifications.METADATA_UPDATED]);
202
+
40
203
  if (isNotificationDisabled) {
41
204
  return null;
42
205
  }
@@ -47,12 +210,7 @@ export function Notifications() {
47
210
  <TrackBulkUnmuteModal />
48
211
  <TrackNotifications />
49
212
  {roomState === HMSRoomState.Connected ? <PeerNotifications /> : null}
50
- <RoleChangeNotification />
51
- <PollNotificationModal />
52
- <MessageNotifications />
53
- <DeviceChangeNotifications />
54
213
  <ReconnectNotifications />
55
- <ErrorNotifications />
56
214
  <AutoplayBlockedModal />
57
215
  <PermissionErrorNotificationModal />
58
216
  <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 = [HMSNotificationTypes.RECONNECTED, HMSNotificationTypes.RECONNECTING];
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(notificationTypes);
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
- switch (notification.type) {
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(notificationTypes);
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
- height: 'min(656px, 90%)',
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 DebugInfo = ({ details }) => {
241
- return (
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={{