@100mslive/roomkit-react 0.1.5 → 0.1.6-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. package/dist/{HLSView-P57IRMAR.js → HLSView-PY2FKWX3.js} +191 -123
  2. package/dist/HLSView-PY2FKWX3.js.map +7 -0
  3. package/dist/Prebuilt/App.d.ts +3 -0
  4. package/dist/Prebuilt/AppContext.d.ts +13 -0
  5. package/dist/Prebuilt/common/PeersSorter.d.ts +21 -0
  6. package/dist/Prebuilt/components/Footer/Footer.d.ts +6 -0
  7. package/dist/Prebuilt/components/Header/Header.d.ts +2 -0
  8. package/dist/Prebuilt/components/InsetTile.d.ts +2 -0
  9. package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +7 -0
  10. package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +8 -0
  11. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2196 -0
  12. package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +12 -0
  13. package/dist/Prebuilt/components/Leave/LeaveRoom.d.ts +5 -0
  14. package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +6 -0
  15. package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +7 -0
  16. package/dist/Prebuilt/components/MoreSettings/MoreSettings.d.ts +6 -0
  17. package/dist/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.d.ts +6 -0
  18. package/dist/Prebuilt/components/Pagination.d.ts +6 -0
  19. package/dist/Prebuilt/components/Preview/PreviewForm.d.ts +10 -0
  20. package/dist/Prebuilt/components/SecondaryTiles.d.ts +3 -0
  21. package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +3 -0
  22. package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +5 -0
  23. package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +10 -0
  24. package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +12 -0
  25. package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +3 -0
  26. package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +3 -0
  27. package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +8 -0
  28. package/dist/Prebuilt/components/hooks/useRoleProminencePeers.d.ts +5 -0
  29. package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +12 -0
  30. package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +11 -0
  31. package/dist/Prebuilt/layouts/SidePane.d.ts +6 -0
  32. package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +6 -0
  33. package/dist/Prebuilt/plugins/whiteboard/ToggleWhiteboard.d.ts +5 -0
  34. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +1 -0
  35. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.d.ts +1 -0
  36. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.d.ts +17 -0
  37. package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +6 -1
  38. package/dist/{VirtualBackground-GGCQJ5JM.js → VirtualBackground-AYDHYLIZ.js} +5 -11
  39. package/dist/VirtualBackground-AYDHYLIZ.js.map +7 -0
  40. package/dist/{chunk-P5X32KOD.js → chunk-E2M2ZSOL.js} +8 -5
  41. package/dist/chunk-E2M2ZSOL.js.map +7 -0
  42. package/dist/chunk-GQD2AGWW.js +888 -0
  43. package/dist/chunk-GQD2AGWW.js.map +7 -0
  44. package/dist/{chunk-OSM4QEQG.js → chunk-RXTHJUMZ.js} +2462 -4738
  45. package/dist/chunk-RXTHJUMZ.js.map +7 -0
  46. package/dist/conference-V2XZGTKU.js +5927 -0
  47. package/dist/conference-V2XZGTKU.js.map +7 -0
  48. package/dist/index.cjs.js +9414 -15534
  49. package/dist/index.cjs.js.map +4 -4
  50. package/dist/index.js +2 -2
  51. package/dist/meta.cjs.json +2156 -3347
  52. package/dist/meta.esbuild.json +2601 -3885
  53. package/package.json +7 -7
  54. package/src/Button/Button.tsx +2 -2
  55. package/src/Prebuilt/App.tsx +49 -33
  56. package/src/Prebuilt/{AppContext.jsx → AppContext.tsx} +11 -3
  57. package/src/Prebuilt/IconButton.jsx +1 -0
  58. package/src/Prebuilt/Prebuilt.stories.tsx +1 -0
  59. package/src/Prebuilt/common/{PeersSorter.js → PeersSorter.ts} +15 -10
  60. package/src/Prebuilt/common/constants.js +3 -112
  61. package/src/Prebuilt/common/hooks.js +34 -1
  62. package/src/Prebuilt/common/utils.js +0 -8
  63. package/src/Prebuilt/components/AppData/AppData.jsx +3 -13
  64. package/src/Prebuilt/components/AppData/useUISettings.js +0 -4
  65. package/src/Prebuilt/components/AudioVideoToggle.jsx +6 -0
  66. package/src/Prebuilt/components/AuthToken.jsx +11 -42
  67. package/src/Prebuilt/components/Chat/Chat.jsx +57 -26
  68. package/src/Prebuilt/components/Chat/ChatBody.jsx +92 -32
  69. package/src/Prebuilt/components/Chat/ChatFooter.jsx +72 -48
  70. package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +73 -0
  71. package/src/Prebuilt/components/Chat/ChatSelector.jsx +16 -17
  72. package/src/Prebuilt/components/Chat/ChatSelectorContainer.jsx +81 -0
  73. package/src/Prebuilt/components/Connection/TileConnection.jsx +30 -12
  74. package/src/Prebuilt/components/EmojiReaction.jsx +18 -17
  75. package/src/Prebuilt/components/Footer/ChatToggle.jsx +1 -7
  76. package/src/Prebuilt/components/Footer/Footer.tsx +89 -0
  77. package/src/Prebuilt/components/Footer/ParticipantList.jsx +213 -173
  78. package/src/Prebuilt/components/Footer/RoleAccordion.jsx +78 -0
  79. package/src/Prebuilt/components/HMSVideo/Controls.jsx +2 -2
  80. package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +33 -10
  81. package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
  82. package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -3
  83. package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +38 -9
  84. package/src/Prebuilt/components/Header/{ConferencingHeader.jsx → Header.tsx} +9 -7
  85. package/src/Prebuilt/components/Header/HeaderComponents.jsx +13 -4
  86. package/src/Prebuilt/components/Header/StreamActions.jsx +33 -60
  87. package/src/Prebuilt/components/Header/index.tsx +1 -0
  88. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +17 -3
  89. package/src/Prebuilt/components/InsetTile.tsx +122 -0
  90. package/src/Prebuilt/components/{MoreSettings/SplitComponents/DesktopLeaveRoom.jsx → Leave/DesktopLeaveRoom.tsx} +50 -18
  91. package/src/Prebuilt/components/{EndSessionContent.jsx → Leave/EndSessionContent.tsx} +19 -9
  92. package/src/Prebuilt/components/Leave/LeaveAtoms.tsx +26 -0
  93. package/src/Prebuilt/components/{LeaveCard.jsx → Leave/LeaveCard.tsx} +22 -3
  94. package/src/Prebuilt/components/Leave/LeaveRoom.tsx +63 -0
  95. package/src/Prebuilt/components/{LeaveSessionContent.jsx → Leave/LeaveSessionContent.tsx} +13 -5
  96. package/src/Prebuilt/components/{MoreSettings/SplitComponents/MwebLeaveRoom.jsx → Leave/MwebLeaveRoom.tsx} +38 -13
  97. package/src/Prebuilt/components/MetaActions.jsx +15 -23
  98. package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +5 -0
  99. package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +12 -7
  100. package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +1 -1
  101. package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +1 -4
  102. package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +27 -0
  103. package/src/Prebuilt/components/MoreSettings/SplitComponents/{DesktopOptions.jsx → DesktopOptions.tsx} +86 -75
  104. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.jsx +20 -19
  105. package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -1
  106. package/src/Prebuilt/components/Notifications/Notifications.jsx +18 -11
  107. package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +14 -2
  108. package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +10 -4
  109. package/src/Prebuilt/components/PIP/PIPComponent.jsx +7 -16
  110. package/src/Prebuilt/components/PIP/PIPManager.js +1 -0
  111. package/src/Prebuilt/components/{Pagination.jsx → Pagination.tsx} +35 -6
  112. package/src/Prebuilt/components/Playlist/Playlist.jsx +1 -6
  113. package/src/Prebuilt/components/PostLeave.jsx +7 -7
  114. package/src/Prebuilt/components/Preview/PreviewContainer.jsx +5 -13
  115. package/src/Prebuilt/components/Preview/{PreviewForm.jsx → PreviewForm.tsx} +14 -4
  116. package/src/Prebuilt/components/Preview/PreviewJoin.jsx +9 -7
  117. package/src/Prebuilt/components/RaiseHand.jsx +0 -7
  118. package/src/Prebuilt/components/RoleChangeRequestModal.jsx +82 -6
  119. package/src/Prebuilt/components/ScreenshareDisplay.jsx +4 -10
  120. package/src/Prebuilt/components/ScreenshareTile.jsx +41 -33
  121. package/src/Prebuilt/components/SecondaryTiles.tsx +34 -0
  122. package/src/Prebuilt/components/Settings/LayoutSettings.jsx +2 -12
  123. package/src/Prebuilt/components/Settings/NotificationSettings.jsx +3 -9
  124. package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -9
  125. package/src/Prebuilt/components/StatsForNerds.jsx +3 -1
  126. package/src/Prebuilt/components/TileMenu/TileMenu.jsx +15 -16
  127. package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +21 -19
  128. package/src/Prebuilt/components/Toast/ToastConfig.jsx +53 -11
  129. package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +62 -0
  130. package/src/Prebuilt/components/VideoLayouts/Grid.tsx +41 -0
  131. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +92 -0
  132. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +60 -0
  133. package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +56 -0
  134. package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +36 -0
  135. package/src/Prebuilt/components/VideoLayouts/interface.ts +9 -0
  136. package/src/Prebuilt/components/VideoTile.jsx +93 -43
  137. package/src/Prebuilt/components/conference.jsx +24 -20
  138. package/src/Prebuilt/components/hooks/useMetadata.jsx +7 -0
  139. package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +38 -0
  140. package/src/Prebuilt/components/hooks/useTileLayout.tsx +121 -0
  141. package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +22 -0
  142. package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +5 -72
  143. package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +4 -45
  144. package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +2 -17
  145. package/src/Prebuilt/components/peerTileUtils.jsx +1 -1
  146. package/src/Prebuilt/images/empty-chat.svg +12 -0
  147. package/src/Prebuilt/layouts/EmbedView.jsx +17 -40
  148. package/src/Prebuilt/layouts/HLSView.jsx +83 -66
  149. package/src/Prebuilt/layouts/PDFView.jsx +1 -11
  150. package/src/Prebuilt/layouts/SidePane.tsx +96 -0
  151. package/src/Prebuilt/layouts/{mainView.jsx → VideoStreamingSection.tsx} +38 -47
  152. package/src/Prebuilt/layouts/WhiteboardView.jsx +10 -34
  153. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -4
  154. package/src/Prebuilt/plugins/whiteboard/{ToggleWhiteboard.jsx → ToggleWhiteboard.tsx} +5 -9
  155. package/src/Prebuilt/primitives/DialogContent.jsx +15 -11
  156. package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +17 -2
  157. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +36 -13
  158. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.ts +10 -0
  159. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +65 -0
  160. package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +17 -6
  161. package/dist/HLSView-P57IRMAR.js.map +0 -7
  162. package/dist/PinnedTrackView-4FYJEBTB.js +0 -102
  163. package/dist/PinnedTrackView-4FYJEBTB.js.map +0 -7
  164. package/dist/VirtualBackground-GGCQJ5JM.js.map +0 -7
  165. package/dist/chunk-IVTWKQI3.js +0 -827
  166. package/dist/chunk-IVTWKQI3.js.map +0 -7
  167. package/dist/chunk-OSM4QEQG.js.map +0 -7
  168. package/dist/chunk-P5X32KOD.js.map +0 -7
  169. package/dist/chunk-RVCZPPTL.js +0 -1100
  170. package/dist/chunk-RVCZPPTL.js.map +0 -7
  171. package/dist/conference-P6I6ESVF.js +0 -8995
  172. package/dist/conference-P6I6ESVF.js.map +0 -7
  173. package/src/Prebuilt/components/Chat/ChatHeader.jsx +0 -67
  174. package/src/Prebuilt/components/EqualProminence.jsx +0 -180
  175. package/src/Prebuilt/components/FirstPersonDisplay.jsx +0 -50
  176. package/src/Prebuilt/components/Footer/Footer.jsx +0 -73
  177. package/src/Prebuilt/components/Header/Header.jsx +0 -8
  178. package/src/Prebuilt/components/Header/StreamingHeader.jsx +0 -54
  179. package/src/Prebuilt/components/LeaveRoom.jsx +0 -94
  180. package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +0 -10
  181. package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +0 -25
  182. package/src/Prebuilt/components/gridView.jsx +0 -85
  183. package/src/Prebuilt/components/hooks/useFeatures.js +0 -22
  184. package/src/Prebuilt/components/hooks/useNavigation.js +0 -19
  185. package/src/Prebuilt/components/hooks/useSkipPreview.jsx +0 -20
  186. package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +0 -29
  187. package/src/Prebuilt/images/Logo.svg +0 -8
  188. package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +0 -34
  189. package/src/Prebuilt/layouts/InsetView.jsx +0 -260
  190. package/src/Prebuilt/layouts/PinnedTrackView.jsx +0 -59
  191. package/src/Prebuilt/layouts/SidePane.jsx +0 -52
  192. package/src/Prebuilt/layouts/mainGridView.jsx +0 -98
  193. package/src/Prebuilt/layouts/screenShareView.jsx +0 -183
  194. /package/{src/Prebuilt/components/Header/index.jsx → dist/Prebuilt/components/Header/index.d.ts} +0 -0
  195. /package/src/Prebuilt/components/{ScreenShare.jsx → ScreenShareToggle.jsx} +0 -0
  196. /package/src/{assets → Prebuilt/images}/android-perm-1.png +0 -0
  197. /package/src/{assets → Prebuilt/images}/ios-perm-0.png +0 -0
@@ -1,26 +1,102 @@
1
- import React from 'react';
2
- import { selectRoleChangeRequest, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
3
- import { RequestDialog } from '../primitives/DialogContent';
1
+ import React, { useEffect } from 'react';
2
+ import {
3
+ selectLocalPeerName,
4
+ selectLocalPeerRoleName,
5
+ selectRoleChangeRequest,
6
+ useHMSActions,
7
+ useHMSStore,
8
+ } from '@100mslive/react-sdk';
9
+ import { PreviewControls, PreviewTile } from './Preview/PreviewJoin';
10
+ import { Box, Button, Dialog, Flex, Text } from '../../';
4
11
  import { useIsHeadless } from './AppData/useUISettings';
12
+ import { useMyMetadata } from './hooks/useMetadata';
13
+ import { ROLE_CHANGE_DECLINED } from '../common/constants';
5
14
 
6
15
  export const RoleChangeRequestModal = () => {
7
16
  const hmsActions = useHMSActions();
8
17
  const isHeadless = useIsHeadless();
18
+ const { setPrevRole } = useMyMetadata();
19
+ const currentRole = useHMSStore(selectLocalPeerRoleName);
9
20
  const roleChangeRequest = useHMSStore(selectRoleChangeRequest);
21
+ const name = useHMSStore(selectLocalPeerName);
22
+
23
+ useEffect(() => {
24
+ if (!roleChangeRequest?.role || isHeadless) {
25
+ return;
26
+ }
27
+
28
+ hmsActions.preview({ asRole: roleChangeRequest.role.name });
29
+ }, [hmsActions, roleChangeRequest, isHeadless]);
10
30
 
11
31
  if (!roleChangeRequest?.role || isHeadless) {
12
32
  return null;
13
33
  }
14
34
 
35
+ const body = (
36
+ <>
37
+ <Text css={{ fontWeight: 400, c: '$on_surface_medium', textAlign: 'center' }}>
38
+ Setup your audio and video before joining
39
+ </Text>
40
+ <Flex
41
+ align="center"
42
+ justify="center"
43
+ css={{
44
+ '@sm': { width: '100%' },
45
+ flexDirection: 'column',
46
+ mt: '$6',
47
+ }}
48
+ >
49
+ <PreviewTile name={name} />
50
+ <PreviewControls />
51
+ </Flex>
52
+ </>
53
+ );
54
+
15
55
  return (
16
56
  <RequestDialog
17
- title="Role Change Request"
18
- onOpenChange={value => !value && hmsActions.rejectChangeRole(roleChangeRequest)}
19
- body={`${roleChangeRequest?.requestedBy?.name} has requested you to change your role to ${roleChangeRequest?.role?.name}.`}
57
+ title={`You're invited to join the ${roleChangeRequest.role.name} role`}
58
+ onOpenChange={async value => {
59
+ if (!value) {
60
+ await hmsActions.rejectChangeRole(roleChangeRequest);
61
+ await hmsActions.sendDirectMessage('', roleChangeRequest.requestedBy?.id, ROLE_CHANGE_DECLINED);
62
+ await hmsActions.cancelMidCallPreview();
63
+ }
64
+ }}
65
+ body={body}
20
66
  onAction={() => {
21
67
  hmsActions.acceptChangeRole(roleChangeRequest);
68
+ setPrevRole(currentRole);
22
69
  }}
23
70
  actionText="Accept"
24
71
  />
25
72
  );
26
73
  };
74
+
75
+ const RequestDialog = ({ open = true, onOpenChange, title, body, actionText = 'Accept', onAction, Icon }) => (
76
+ <Dialog.Root open={open} onOpenChange={onOpenChange}>
77
+ <Dialog.Portal>
78
+ <Dialog.Overlay />
79
+ <Dialog.Content css={{ p: '$10' }}>
80
+ <Dialog.Title css={{ p: 0, display: 'flex', flexDirection: 'row', gap: '$md', justifyContent: 'center' }}>
81
+ {Icon ? Icon : null}
82
+ <Text variant="h6">{title}</Text>
83
+ </Dialog.Title>
84
+ <Box css={{ mt: '$4', mb: '$10' }}>{body}</Box>
85
+ <Flex justify="center" align="center" css={{ width: '100%', gap: '$md' }}>
86
+ <Box css={{ width: '50%' }}>
87
+ <Dialog.Close css={{ width: '100%' }}>
88
+ <Button variant="standard" outlined css={{ width: '100%' }}>
89
+ Cancel
90
+ </Button>
91
+ </Dialog.Close>
92
+ </Box>
93
+ <Box css={{ width: '50%' }}>
94
+ <Button variant="primary" css={{ width: '100%' }} onClick={onAction}>
95
+ {actionText}
96
+ </Button>
97
+ </Box>
98
+ </Flex>
99
+ </Dialog.Content>
100
+ </Dialog.Portal>
101
+ </Dialog.Root>
102
+ );
@@ -14,24 +14,18 @@ export const ScreenshareDisplay = () => {
14
14
  align="center"
15
15
  justify="center"
16
16
  css={{
17
- position: 'relative',
18
- overflow: 'hidden',
19
- w: '37.5rem',
20
- maxWidth: '80%',
21
- h: '100%',
22
- r: '$3',
23
- m: '0 auto',
24
- color: '$on_surface_high',
17
+ size: '100%',
25
18
  bg: '$background_default',
26
- textAlign: 'center',
19
+ color: '$on_surface_high',
27
20
  }}
28
21
  >
29
22
  <ShareScreenIcon width={48} height={48} />
30
- <Text variant="h5" css={{ m: '$8 0', color: '$on_surface_high' }}>
23
+ <Text variant="h5" css={{ m: '$8 0' }}>
31
24
  You are sharing your screen
32
25
  </Text>
33
26
  <Button
34
27
  variant="danger"
28
+ css={{ fontWeight: '$semiBold' }}
35
29
  onClick={async () => {
36
30
  await hmsActions.setScreenShareEnabled(false);
37
31
  }}
@@ -14,6 +14,7 @@ import { VideoTileStats } from '../../Stats';
14
14
  import { Video } from '../../Video';
15
15
  import { StyledVideoTile } from '../../VideoTile';
16
16
  import { getVideoTileLabel } from './peerTileUtils';
17
+ import { ScreenshareDisplay } from './ScreenshareDisplay';
17
18
  import { useIsHeadless, useUISettings } from './AppData/useUISettings';
18
19
  import { UI_SETTINGS } from '../common/constants';
19
20
 
@@ -21,6 +22,7 @@ const labelStyles = {
21
22
  position: 'unset',
22
23
  width: '100%',
23
24
  textAlign: 'center',
25
+ c: '$on_surface_high',
24
26
  transform: 'none',
25
27
  mt: '$2',
26
28
  flexShrink: 0,
@@ -48,40 +50,46 @@ const Tile = ({ peerId, width = '100%', height = '100%' }) => {
48
50
  });
49
51
  const isFullScreenSupported = screenfull.isEnabled;
50
52
  const audioTrack = useHMSStore(selectScreenShareAudioByPeerID(peer?.id));
53
+
54
+ if (isLocal && !['browser', 'window', 'application'].includes(track?.displaySurface)) {
55
+ return <ScreenshareDisplay />;
56
+ }
57
+
58
+ if (!peer) {
59
+ return null;
60
+ }
51
61
  return (
52
- <StyledVideoTile.Root css={{ width, height, p: 0 }} data-testid="screenshare_tile">
53
- {peer ? (
54
- <StyledVideoTile.Container
55
- transparentBg
56
- ref={fullscreenRef}
57
- css={{ flexDirection: 'column' }}
58
- onMouseEnter={() => setIsMouseHovered(true)}
59
- onMouseLeave={() => {
60
- setIsMouseHovered(false);
61
- }}
62
- >
63
- {showStatsOnTiles ? (
64
- <VideoTileStats audioTrackID={audioTrack?.id} videoTrackID={track?.id} peerID={peerId} isLocal={isLocal} />
65
- ) : null}
66
- {isFullScreenSupported && !isHeadless ? (
67
- <StyledVideoTile.FullScreenButton onClick={() => setFullscreen(!fullscreen)}>
68
- {isFullscreen ? <ShrinkIcon /> : <ExpandIcon />}
69
- </StyledVideoTile.FullScreenButton>
70
- ) : null}
71
- {track ? (
72
- <Video
73
- screenShare={true}
74
- mirror={peer.isLocal && track?.source === 'regular'}
75
- attach={!isAudioOnly}
76
- trackId={track.id}
77
- />
78
- ) : null}
79
- <StyledVideoTile.Info css={labelStyles}>{label}</StyledVideoTile.Info>
80
- {isMouseHovered && !isHeadless && !peer?.isLocal ? (
81
- <TileMenu isScreenshare peerID={peer?.id} audioTrackID={audioTrack?.id} videoTrackID={track?.id} />
82
- ) : null}
83
- </StyledVideoTile.Container>
84
- ) : null}
62
+ <StyledVideoTile.Root css={{ width, height, p: 0, mb: '$4', minHeight: 0 }} data-testid="screenshare_tile">
63
+ <StyledVideoTile.Container
64
+ transparentBg
65
+ ref={fullscreenRef}
66
+ css={{ flexDirection: 'column' }}
67
+ onMouseEnter={() => setIsMouseHovered(true)}
68
+ onMouseLeave={() => {
69
+ setIsMouseHovered(false);
70
+ }}
71
+ >
72
+ {showStatsOnTiles ? (
73
+ <VideoTileStats audioTrackID={audioTrack?.id} videoTrackID={track?.id} peerID={peerId} isLocal={isLocal} />
74
+ ) : null}
75
+ {isFullScreenSupported && !isHeadless ? (
76
+ <StyledVideoTile.FullScreenButton onClick={() => setFullscreen(!fullscreen)}>
77
+ {isFullscreen ? <ShrinkIcon /> : <ExpandIcon />}
78
+ </StyledVideoTile.FullScreenButton>
79
+ ) : null}
80
+ {track ? (
81
+ <Video
82
+ screenShare={true}
83
+ mirror={peer.isLocal && track?.source === 'regular'}
84
+ attach={!isAudioOnly}
85
+ trackId={track.id}
86
+ />
87
+ ) : null}
88
+ <StyledVideoTile.Info css={labelStyles}>{label}</StyledVideoTile.Info>
89
+ {isMouseHovered && !isHeadless && !peer?.isLocal ? (
90
+ <TileMenu isScreenshare peerID={peer?.id} audioTrackID={audioTrack?.id} videoTrackID={track?.id} />
91
+ ) : null}
92
+ </StyledVideoTile.Container>
85
93
  </StyledVideoTile.Root>
86
94
  );
87
95
  };
@@ -0,0 +1,34 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useMedia } from 'react-use';
3
+ import { LayoutProps } from './VideoLayouts/interface';
4
+ import { ProminenceLayout } from './VideoLayouts/ProminenceLayout';
5
+ import { config as cssConfig } from '../../Theme';
6
+ import { Pagination } from './Pagination';
7
+ import { usePagesWithTiles } from './hooks/useTileLayout';
8
+
9
+ export const SecondaryTiles = ({ peers, onPageChange, onPageSize }: LayoutProps) => {
10
+ const isMobile = useMedia(cssConfig.media.md);
11
+ const maxTileCount = isMobile ? 2 : 4;
12
+ const pagesWithTiles = usePagesWithTiles({ peers, maxTileCount });
13
+ const [page, setPage] = useState(0);
14
+ const pageSize = pagesWithTiles[0]?.length || 0;
15
+
16
+ useEffect(() => {
17
+ if (pageSize > 0) {
18
+ onPageSize?.(pageSize);
19
+ }
20
+ }, [pageSize, onPageSize]);
21
+
22
+ return (
23
+ <ProminenceLayout.SecondarySection tiles={pagesWithTiles[page]}>
24
+ <Pagination
25
+ page={page}
26
+ onPageChange={page => {
27
+ setPage(page);
28
+ onPageChange?.(page);
29
+ }}
30
+ numPages={pagesWithTiles.length}
31
+ />
32
+ </ProminenceLayout.SecondarySection>
33
+ );
34
+ };
@@ -4,13 +4,13 @@ import { Box, Flex, Slider, Text } from '../../../';
4
4
  import SwitchWithLabel from './SwitchWithLabel';
5
5
  import { useSetUiSettings } from '../AppData/useUISettings';
6
6
  import { settingOverflow } from './common.js';
7
- import { UI_MODE_ACTIVE_SPEAKER, UI_MODE_GRID, UI_SETTINGS } from '../../common/constants';
7
+ import { UI_SETTINGS } from '../../common/constants';
8
8
 
9
9
  export const LayoutSettings = () => {
10
10
  const hmsActions = useHMSActions();
11
11
  const isLocalVideoEnabled = useHMSStore(selectIsLocalVideoEnabled);
12
12
  const isLocalScreenShared = useHMSStore(selectIsLocalScreenShared);
13
- const [{ isAudioOnly, uiViewMode, maxTileCount, mirrorLocalVideo }, setUISettings] = useSetUiSettings();
13
+ const [{ isAudioOnly, maxTileCount, mirrorLocalVideo }, setUISettings] = useSetUiSettings();
14
14
  const toggleIsAudioOnly = useCallback(
15
15
  async isAudioOnlyModeOn => {
16
16
  if (isAudioOnlyModeOn) {
@@ -25,16 +25,6 @@ export const LayoutSettings = () => {
25
25
 
26
26
  return (
27
27
  <Box className={settingOverflow()}>
28
- <SwitchWithLabel
29
- checked={uiViewMode === UI_MODE_ACTIVE_SPEAKER}
30
- onChange={value => {
31
- setUISettings({
32
- [UI_SETTINGS.uiViewMode]: value ? UI_MODE_ACTIVE_SPEAKER : UI_MODE_GRID,
33
- });
34
- }}
35
- id="activeSpeakerMode"
36
- label="Active Speaker Mode"
37
- />
38
28
  <SwitchWithLabel label="Audio Only Mode" id="audioOnlyMode" checked={isAudioOnly} onChange={toggleIsAudioOnly} />
39
29
  <SwitchWithLabel
40
30
  label="Mirror Local Video"
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { AlertOctagonIcon, ChatIcon, ExitIcon, HandIcon, PersonIcon } from '@100mslive/react-icons';
2
+ import { AlertOctagonIcon, HandIcon, PeopleAddIcon, PeopleRemoveIcon } from '@100mslive/react-icons';
3
3
  import { Box } from '../../../';
4
4
  import SwitchWithLabel from './SwitchWithLabel';
5
5
  import { useSetSubscribedNotifications, useSubscribedNotifications } from '../AppData/useUISettings';
@@ -29,21 +29,15 @@ export const NotificationSettings = () => {
29
29
  <NotificationItem
30
30
  label="Peer Joined"
31
31
  type={SUBSCRIBED_NOTIFICATIONS.PEER_JOINED}
32
- icon={<PersonIcon />}
32
+ icon={<PeopleAddIcon />}
33
33
  checked={subscribedNotifications.PEER_JOINED}
34
34
  />
35
35
  <NotificationItem
36
36
  label="Peer Leave"
37
37
  type={SUBSCRIBED_NOTIFICATIONS.PEER_LEFT}
38
- icon={<ExitIcon />}
38
+ icon={<PeopleRemoveIcon />}
39
39
  checked={subscribedNotifications.PEER_LEFT}
40
40
  />
41
- <NotificationItem
42
- label="New Message"
43
- type={SUBSCRIBED_NOTIFICATIONS.NEW_MESSAGE}
44
- icon={<ChatIcon />}
45
- checked={subscribedNotifications.NEW_MESSAGE}
46
- />
47
41
  <NotificationItem
48
42
  label="Hand Raised"
49
43
  type={SUBSCRIBED_NOTIFICATIONS.METADATA_UPDATED}
@@ -1,6 +1,5 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
2
  import { useMedia } from 'react-use';
3
- import { selectLocalPeerRoleName, useHMSStore } from '@100mslive/react-sdk';
4
3
  import { ChevronLeftIcon, CrossIcon } from '@100mslive/react-icons';
5
4
  import { HorizontalDivider } from '../../../Divider';
6
5
  import { IconButton } from '../../../IconButton';
@@ -10,17 +9,12 @@ import { Sheet } from '../../../Sheet';
10
9
  import { Tabs } from '../../../Tabs';
11
10
  import { Text } from '../../../Text';
12
11
  import { config as cssConfig } from '../../../Theme';
13
- import { useHLSViewerRole } from '../AppData/useUISettings';
14
12
  import { settingContent, settingsList } from './common.js';
15
13
 
16
- const SettingsModal = ({ open, onOpenChange, children = <></> }) => {
14
+ const SettingsModal = ({ open, onOpenChange, screenType, children = <></> }) => {
17
15
  const mediaQueryLg = cssConfig.media.md;
18
16
  const isMobile = useMedia(mediaQueryLg);
19
17
 
20
- const hlsViewerRole = useHLSViewerRole();
21
- const localPeerRole = useHMSStore(selectLocalPeerRoleName);
22
- const isHlsViewer = hlsViewerRole === localPeerRole;
23
-
24
18
  const [showSetting, setShowSetting] = useState(() =>
25
19
  settingsList.reduce((obj, { tabName }) => ({ ...obj, [tabName]: true }), {}),
26
20
  );
@@ -31,10 +25,10 @@ const SettingsModal = ({ open, onOpenChange, children = <></> }) => {
31
25
  );
32
26
 
33
27
  useEffect(() => {
34
- if (isHlsViewer) {
28
+ if (screenType === 'hls_live_streaming') {
35
29
  hideSettingByTabName('layout')(true);
36
30
  }
37
- }, [isHlsViewer, hideSettingByTabName]);
31
+ }, [screenType, hideSettingByTabName]);
38
32
 
39
33
  const [selection, setSelection] = useState(() => Object.keys(showSetting).find(key => showSetting[key]) ?? '');
40
34
  const resetSelection = useCallback(() => {
@@ -76,7 +76,9 @@ export const StatsForNerds = ({ onOpenChange }) => {
76
76
  minWidth: 0,
77
77
  }}
78
78
  >
79
- <Label variant="body2">Stats For</Label>
79
+ <Label variant="body2" css={{ c: '$on_surface_high' }}>
80
+ Stats For
81
+ </Label>
80
82
  <Dropdown.Root data-testid="dialog_select_Stats For" open={open} onOpenChange={setOpen}>
81
83
  <DialogDropdownTrigger
82
84
  title={selectedStat.label || 'Select Stats'}
@@ -4,7 +4,6 @@ import {
4
4
  selectLocalPeerID,
5
5
  selectPeerByID,
6
6
  selectPermissions,
7
- selectTemplateAppData,
8
7
  selectTrackByID,
9
8
  selectVideoTrackByPeerID,
10
9
  useHMSStore,
@@ -19,28 +18,29 @@ import { StyledMenuTile } from '../../../TileMenu';
19
18
  import { ChangeNameModal } from '../MoreSettings/ChangeNameModal';
20
19
  import { TileMenuContent } from './TileMenuContent';
21
20
  import { useDropdownList } from '../hooks/useDropdownList';
22
- import { useIsFeatureEnabled } from '../hooks/useFeatures';
23
- import { FEATURE_LIST } from '../../common/constants';
24
21
 
25
22
  /**
26
23
  * Taking peerID as peer won't necesarilly have tracks
27
24
  */
28
- const TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, canMinimise }) => {
25
+ const TileMenu = ({
26
+ audioTrackID,
27
+ videoTrackID,
28
+ peerID,
29
+ isScreenshare = false,
30
+ canMinimise,
31
+ enableSpotlightingPeer = true,
32
+ }) => {
29
33
  const [open, setOpen] = useState(false);
30
34
  const { theme } = useTheme();
31
35
 
32
36
  const localPeerID = useHMSStore(selectLocalPeerID);
33
37
  const isLocal = localPeerID === peerID;
34
- const { removeOthers, changeRole } = useHMSStore(selectPermissions);
38
+ const { removeOthers } = useHMSStore(selectPermissions);
35
39
  const { setVolume, toggleAudio, toggleVideo } = useRemoteAVToggle(audioTrackID, videoTrackID);
36
- const showSpotlight = changeRole;
40
+ const showSpotlight = enableSpotlightingPeer;
37
41
 
38
42
  const isPrimaryVideoTrack = useHMSStore(selectVideoTrackByPeerID(peerID))?.id === videoTrackID;
39
- const uiMode = useHMSStore(selectTemplateAppData).uiMode;
40
- const isInset = uiMode === 'inset';
41
-
42
- const isPinEnabled = useIsFeatureEnabled(FEATURE_LIST.PIN_TILE);
43
- const showPinAction = isPinEnabled && (audioTrackID || (videoTrackID && isPrimaryVideoTrack)) && !isInset;
43
+ const showPinAction = audioTrackID || (videoTrackID && isPrimaryVideoTrack);
44
44
 
45
45
  const track = useHMSStore(selectTrackByID(videoTrackID));
46
46
  const hideSimulcastLayers = !track?.layerDefinitions?.length || track.degraded || !track.enabled;
@@ -53,9 +53,6 @@ const TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, c
53
53
  return null;
54
54
  }
55
55
 
56
- if (isInset && isLocal) {
57
- return null;
58
- }
59
56
  const openNameChangeModal = () => setShowNameChangeModal(true);
60
57
 
61
58
  const props = {
@@ -114,13 +111,13 @@ const TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, c
114
111
  <CrossIcon />
115
112
  </Sheet.Close>
116
113
  </Flex>
117
- <Box css={{ px: '$8', pb: '$10' }}>
114
+ <Box css={{ px: '$8', pb: '$8', maxHeight: '80vh', overflowY: 'auto' }}>
118
115
  <TileMenuContent {...props} closeSheetOnClick={() => setOpen(false)} />
119
116
  </Box>
120
117
  </Sheet.Content>
121
118
  </Sheet.Root>
122
119
  ) : (
123
- <StyledMenuTile.Content side="top" align="end">
120
+ <StyledMenuTile.Content side="top" align="end" css={{ maxHeight: '$80', overflowY: 'auto' }}>
124
121
  <TileMenuContent {...props} />
125
122
  </StyledMenuTile.Content>
126
123
  )}
@@ -130,4 +127,6 @@ const TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, c
130
127
  );
131
128
  };
132
129
 
130
+ export { isSameTile } from './TileMenuContent';
131
+
133
132
  export default TileMenu;
@@ -28,10 +28,9 @@ import { StyledMenuTile } from '../../../TileMenu';
28
28
  import { ToastManager } from '../Toast/ToastManager';
29
29
  import { useSetAppDataByKey } from '../AppData/useUISettings';
30
30
  import { useDropdownSelection } from '../hooks/useDropdownSelection';
31
- import { useIsFeatureEnabled } from '../hooks/useFeatures';
32
- import { APP_DATA, FEATURE_LIST, REMOTE_STOP_SCREENSHARE_TYPE, SESSION_STORE_KEY } from '../../common/constants';
31
+ import { APP_DATA, REMOTE_STOP_SCREENSHARE_TYPE, SESSION_STORE_KEY } from '../../common/constants';
33
32
 
34
- const isSameTile = ({ trackId, videoTrackID, audioTrackID }) =>
33
+ export const isSameTile = ({ trackId, videoTrackID, audioTrackID }) =>
35
34
  trackId && ((videoTrackID && videoTrackID === trackId) || (audioTrackID && audioTrackID === trackId));
36
35
 
37
36
  const spacingCSS = { '@md': { my: '$8', fontWeight: '$semiBold', fontSize: 'sm' } };
@@ -138,11 +137,18 @@ const SimulcastLayers = ({ trackId }) => {
138
137
  textTransform: 'capitalize',
139
138
  mr: '$2',
140
139
  fontWeight: track.preferredLayer === layer.layer ? '$semiBold' : '$regular',
140
+ color: track.preferredLayer === layer.layer ? '$on_primary_high' : '$on_surface_high',
141
141
  }}
142
142
  >
143
143
  {layer.layer}
144
144
  </Text>
145
- <Text as="span" variant="xs" css={{ color: '$on_surface_medium' }}>
145
+ <Text
146
+ as="span"
147
+ variant="xs"
148
+ css={{
149
+ color: track.preferredLayer === layer.layer ? '$on_primary_high' : '$on_surface_high',
150
+ }}
151
+ >
146
152
  {layer.resolution.width}x{layer.resolution.height}
147
153
  </Text>
148
154
  </StyledMenuTile.ItemButton>
@@ -204,27 +210,23 @@ export const TileMenuContent = props => {
204
210
  type: REMOTE_STOP_SCREENSHARE_TYPE,
205
211
  });
206
212
 
207
- const isChangeNameEnabled = useIsFeatureEnabled(FEATURE_LIST.CHANGE_NAME);
208
-
209
213
  return isLocal ? (
210
214
  (showPinAction || canMinimise) && (
211
215
  <>
212
216
  {showPinAction && <PinActions audioTrackID={audioTrackID} videoTrackID={videoTrackID} />}
213
217
  {showSpotlight && <SpotlightActions peerId={peerID} onSpotLightClick={() => closeSheetOnClick()} />}
214
218
  {canMinimise && <MinimiseInset />}
215
- {isChangeNameEnabled ? (
216
- <StyledMenuTile.ItemButton
217
- onClick={() => {
218
- openNameChangeModal();
219
- closeSheetOnClick();
220
- }}
221
- >
222
- <PencilIcon />
223
- <Text variant="sm" css={{ fontWeight: '$semiBold' }}>
224
- Change Name
225
- </Text>
226
- </StyledMenuTile.ItemButton>
227
- ) : null}
219
+ <StyledMenuTile.ItemButton
220
+ onClick={() => {
221
+ openNameChangeModal();
222
+ closeSheetOnClick();
223
+ }}
224
+ >
225
+ <PencilIcon />
226
+ <Text variant="sm" css={{ '@md': { fontWeight: '$semiBold' }, c: '$on_surface_high' }}>
227
+ Change Name
228
+ </Text>
229
+ </StyledMenuTile.ItemButton>
228
230
  </>
229
231
  )
230
232
  ) : (