@100mslive/roomkit-react 0.3.22-alpha.2 → 0.3.22-alpha.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) 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/{HLSView-XRGOWFRB.js → HLSView-CSOBLYBP.js} +24 -38
  12. package/dist/HLSView-CSOBLYBP.js.map +7 -0
  13. package/dist/{PDFView-RJK44WVO.css → HLSView-QZMIDGI4.css} +3 -3
  14. package/dist/{EmbedView-Y24VRONT.css.map → HLSView-QZMIDGI4.css.map} +1 -1
  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-4VBHLZDR.js +34747 -0
  48. package/dist/chunk-4VBHLZDR.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 +22687 -22873
  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 +5125 -5444
  57. package/dist/meta.esbuild.json +6238 -9055
  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 +159 -11
  65. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +2 -23
  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-5G5WGPIO.css +0 -2780
  80. package/dist/ConferenceScreen-5G5WGPIO.css.map +0 -7
  81. package/dist/ConferenceScreen-KS5URW6Z.js +0 -1778
  82. package/dist/ConferenceScreen-KS5URW6Z.js.map +0 -7
  83. package/dist/EmbedView-BCRQ3GHV.js +0 -17
  84. package/dist/EmbedView-BCRQ3GHV.js.map +0 -7
  85. package/dist/EmbedView-Y24VRONT.css +0 -2780
  86. package/dist/EmojiReaction-NA5F5DWN.js +0 -11
  87. package/dist/EmojiReaction-NA5F5DWN.js.map +0 -7
  88. package/dist/HLSView-DC43TOIW.css +0 -2780
  89. package/dist/HLSView-DC43TOIW.css.map +0 -7
  90. package/dist/HLSView-XRGOWFRB.js.map +0 -7
  91. package/dist/LeaveScreen-3OZN3MU3.css +0 -2780
  92. package/dist/LeaveScreen-3OZN3MU3.css.map +0 -7
  93. package/dist/LeaveScreen-PC4KB6OG.js +0 -556
  94. package/dist/LeaveScreen-PC4KB6OG.js.map +0 -7
  95. package/dist/MoreSettings-KTRYHDB2.css +0 -2780
  96. package/dist/MoreSettings-KTRYHDB2.css.map +0 -7
  97. package/dist/MoreSettings-XLNYT7PW.js +0 -16
  98. package/dist/MoreSettings-XLNYT7PW.js.map +0 -7
  99. package/dist/PDFView-LJ7I3K3H.js +0 -84
  100. package/dist/PDFView-LJ7I3K3H.js.map +0 -7
  101. package/dist/PDFView-RJK44WVO.css.map +0 -7
  102. package/dist/Polls-AULCHMLW.js +0 -1584
  103. package/dist/Polls-AULCHMLW.js.map +0 -7
  104. package/dist/Polls-K4GO5ZOC.css +0 -2780
  105. package/dist/Polls-K4GO5ZOC.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/RaiseHand-E4OVMBW6.js +0 -10
  111. package/dist/RaiseHand-E4OVMBW6.js.map +0 -7
  112. package/dist/RoleProminence-LHUXHLVI.css +0 -2780
  113. package/dist/RoleProminence-LHUXHLVI.css.map +0 -7
  114. package/dist/RoleProminence-RWJP2Z36.js +0 -116
  115. package/dist/RoleProminence-RWJP2Z36.js.map +0 -7
  116. package/dist/RoomDetailsPane-6BM2FPWW.css +0 -2780
  117. package/dist/RoomDetailsPane-6BM2FPWW.css.map +0 -7
  118. package/dist/RoomDetailsPane-7OP2CNJW.js +0 -53
  119. package/dist/RoomDetailsPane-7OP2CNJW.js.map +0 -7
  120. package/dist/ScreenshareLayout-RHTD2PQT.css +0 -2780
  121. package/dist/ScreenshareLayout-RHTD2PQT.css.map +0 -7
  122. package/dist/ScreenshareLayout-TM7DLYLH.js +0 -358
  123. package/dist/ScreenshareLayout-TM7DLYLH.js.map +0 -7
  124. package/dist/SidePaneTabs-T7BKZ2AT.js +0 -1354
  125. package/dist/SidePaneTabs-T7BKZ2AT.js.map +0 -7
  126. package/dist/SidePaneTabs-TBUPHNAU.css +0 -2780
  127. package/dist/SidePaneTabs-TBUPHNAU.css.map +0 -7
  128. package/dist/VBPicker-M5VYFEUB.css +0 -2780
  129. package/dist/VBPicker-M5VYFEUB.css.map +0 -7
  130. package/dist/VBPicker-TQLIL3NC.js +0 -322
  131. package/dist/VBPicker-TQLIL3NC.js.map +0 -7
  132. package/dist/WaitingView-TLJ52XYA.js +0 -10
  133. package/dist/WaitingView-TLJ52XYA.js.map +0 -7
  134. package/dist/WhiteboardLayout-PZZTM2FW.css +0 -2780
  135. package/dist/WhiteboardLayout-PZZTM2FW.css.map +0 -7
  136. package/dist/WhiteboardLayout-YYZ5UVGG.js +0 -96
  137. package/dist/WhiteboardLayout-YYZ5UVGG.js.map +0 -7
  138. package/dist/android-perm-1.png +0 -0
  139. package/dist/audio-level.png +0 -0
  140. package/dist/chunk-42XPBCZO.js +0 -487
  141. package/dist/chunk-42XPBCZO.js.map +0 -7
  142. package/dist/chunk-4BQ3AMVG.js +0 -16802
  143. package/dist/chunk-4BQ3AMVG.js.map +0 -7
  144. package/dist/chunk-4L5OKEIV.js +0 -90
  145. package/dist/chunk-4L5OKEIV.js.map +0 -7
  146. package/dist/chunk-6BX3VCVC.js +0 -6337
  147. package/dist/chunk-6BX3VCVC.js.map +0 -7
  148. package/dist/chunk-A3COGXMF.js +0 -114
  149. package/dist/chunk-A3COGXMF.js.map +0 -7
  150. package/dist/chunk-B3HHL3ND.js +0 -178
  151. package/dist/chunk-B3HHL3ND.js.map +0 -7
  152. package/dist/chunk-B5NLX6N6.js +0 -41
  153. package/dist/chunk-B5NLX6N6.js.map +0 -7
  154. package/dist/chunk-BXBPZGSP.js +0 -161
  155. package/dist/chunk-BXBPZGSP.js.map +0 -7
  156. package/dist/chunk-DVVFWHQG.js +0 -136
  157. package/dist/chunk-DVVFWHQG.js.map +0 -7
  158. package/dist/chunk-GV2DTYSU.js +0 -262
  159. package/dist/chunk-GV2DTYSU.js.map +0 -7
  160. package/dist/chunk-KF2YEUWU.js +0 -254
  161. package/dist/chunk-KF2YEUWU.js.map +0 -7
  162. package/dist/chunk-KQXTIHI6.js +0 -59
  163. package/dist/chunk-KQXTIHI6.js.map +0 -7
  164. package/dist/chunk-MR3HE7HV.js +0 -830
  165. package/dist/chunk-MR3HE7HV.js.map +0 -7
  166. package/dist/chunk-OQBTPJPO.js +0 -71
  167. package/dist/chunk-OQBTPJPO.js.map +0 -7
  168. package/dist/chunk-P7OOTR7P.js +0 -2595
  169. package/dist/chunk-P7OOTR7P.js.map +0 -7
  170. package/dist/chunk-THDU2DKP.js +0 -30
  171. package/dist/chunk-THDU2DKP.js.map +0 -7
  172. package/dist/chunk-U4QYH2BP.js +0 -98
  173. package/dist/chunk-U4QYH2BP.js.map +0 -7
  174. package/dist/chunk-USEEH3QW.js +0 -418
  175. package/dist/chunk-USEEH3QW.js.map +0 -7
  176. package/dist/chunk-UZW3C3ML.js +0 -171
  177. package/dist/chunk-UZW3C3ML.js.map +0 -7
  178. package/dist/chunk-YDIB6WKJ.js +0 -576
  179. package/dist/chunk-YDIB6WKJ.js.map +0 -7
  180. package/dist/chunk-ZFTULCCP.js +0 -62
  181. package/dist/chunk-ZFTULCCP.js.map +0 -7
  182. package/dist/empty-chat.svg +0 -12
  183. package/dist/ios-perm-0.png +0 -0
  184. package/dist/pdf-share.png +0 -0
  185. package/dist/screen-share.png +0 -0
  186. package/dist/transaction_error.svg +0 -12
  187. package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +0 -18
  188. package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +0 -56
  189. package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +0 -24
  190. package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +0 -71
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.22-alpha.2",
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.2",
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.2",
81
- "@100mslive/hms-whiteboard": "0.0.12-alpha.2",
82
- "@100mslive/react-icons": "0.10.22-alpha.2",
83
- "@100mslive/react-sdk": "0.10.22-alpha.2",
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.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": "28706e825031dc6855e60a883b0fd981ef382297"
120
+ "gitHead": "1a7a504437501f10505fd18c1a06a0cc8c037fd9"
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,31 +1,60 @@
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
30
  import { TrackBulkUnmuteModal } from './TrackBulkUnmuteModal';
19
31
  import { TrackNotifications } from './TrackNotifications';
20
32
  import { TrackUnmuteModal } from './TrackUnmuteModal';
21
33
  import { TranscriptionNotifications } from './TranscriptionNotifications';
34
+ import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
22
35
  // @ts-ignore: No implicit Any
23
- 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';
24
40
  import { ROLE_CHANGE_DECLINED } from '../../common/constants';
25
41
 
42
+ const pollToastKey: Record<string, string> = {};
43
+
26
44
  export function Notifications() {
45
+ const localPeerID = useHMSStore(selectLocalPeerID);
46
+ const notification = useHMSNotifications();
47
+ const subscribedNotifications = useSubscribedNotifications() || {};
27
48
  const roomState = useHMSStore(selectRoomState);
49
+ const updateRoomLayoutForRole = useUpdateRoomLayout();
28
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();
29
58
 
30
59
  const handleRoleChangeDenied = useCallback((request: HMSRoleChangeRequest & { peerName: string }) => {
31
60
  ToastManager.addToast({
@@ -36,6 +65,129 @@ export function Notifications() {
36
65
 
37
66
  useCustomEvent({ type: ROLE_CHANGE_DECLINED, onEvent: handleRoleChangeDenied });
38
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
+
39
191
  if (isNotificationDisabled) {
40
192
  return null;
41
193
  }
@@ -46,11 +198,7 @@ export function Notifications() {
46
198
  <TrackBulkUnmuteModal />
47
199
  <TrackNotifications />
48
200
  {roomState === HMSRoomState.Connected ? <PeerNotifications /> : null}
49
- <PollNotificationModal />
50
- <MessageNotifications />
51
- <DeviceChangeNotifications />
52
201
  <ReconnectNotifications />
53
- <ErrorNotifications />
54
202
  <AutoplayBlockedModal />
55
203
  <PermissionErrorNotificationModal />
56
204
  <InitErrorModal />
@@ -1,28 +1,19 @@
1
1
  import { useEffect } from 'react';
2
2
  import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
3
- import { useUpdateRoomLayout } from '../../provider/roomLayoutProvider';
4
3
  // @ts-ignore: No implicit Any
5
4
  import { ToastBatcher } from '../Toast/ToastBatcher';
6
5
  // @ts-ignore: No implicit Any
7
- import { ToastManager } from '../Toast/ToastManager';
8
- // @ts-ignore: No implicit Any
9
6
  import { useSetSubscribedChatSelector, useSubscribedNotifications } from '../AppData/useUISettings';
10
7
  // @ts-ignore: No implicit Any
11
8
  import { CHAT_SELECTOR, SUBSCRIBED_NOTIFICATIONS } from '../../common/constants';
12
9
 
13
- const notificationTypes = [
14
- HMSNotificationTypes.PEER_JOINED,
15
- HMSNotificationTypes.PEER_LEFT,
16
- HMSNotificationTypes.NAME_UPDATED,
17
- HMSNotificationTypes.ROLE_UPDATED,
18
- ];
10
+ const notificationTypes = [HMSNotificationTypes.PEER_JOINED, HMSNotificationTypes.PEER_LEFT];
19
11
 
20
12
  export const PeerNotifications = () => {
21
13
  const notification = useHMSNotifications(notificationTypes);
22
14
  const isPeerJoinSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_JOINED);
23
15
  const isPeerLeftSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_LEFT);
24
16
  const [selectedPeer, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER);
25
- const updateRoomLayoutForRole = useUpdateRoomLayout();
26
17
 
27
18
  useEffect(() => {
28
19
  if (!notification?.data) {
@@ -44,23 +35,11 @@ export const PeerNotifications = () => {
44
35
  return;
45
36
  }
46
37
  break;
47
- case HMSNotificationTypes.NAME_UPDATED:
48
- console.log(notification.data.id + ' changed their name to ' + notification.data.name);
49
- return;
50
- case HMSNotificationTypes.ROLE_UPDATED: {
51
- if (notification.data?.isLocal && notification.data?.roleName) {
52
- ToastManager.addToast({
53
- title: `You are now a ${notification.data.roleName}`,
54
- });
55
- updateRoomLayoutForRole?.(notification.data.roleName);
56
- }
57
- return;
58
- }
59
38
  default:
60
39
  return;
61
40
  }
62
41
  ToastBatcher.showToast({ notification });
63
- }, [notification]);
42
+ }, [notification, isPeerJoinSubscribed, isPeerLeftSubscribed, selectedPeer.id, setPeerSelector]);
64
43
 
65
44
  return null;
66
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={{