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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. package/dist/{HLSView-P57IRMAR.js → HLSView-HNVYG5VE.js} +309 -151
  2. package/dist/HLSView-HNVYG5VE.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/Chat/ChatFooter.d.ts +7 -0
  7. package/dist/Prebuilt/components/Connection/ConnectionIndicator.d.ts +6 -0
  8. package/dist/Prebuilt/components/Connection/TileConnection.d.ts +10 -0
  9. package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +4 -0
  10. package/dist/Prebuilt/components/Footer/Footer.d.ts +6 -0
  11. package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +14 -0
  12. package/dist/Prebuilt/components/Footer/RoleOptions.d.ts +6 -0
  13. package/dist/Prebuilt/components/Header/Header.d.ts +2 -0
  14. package/dist/Prebuilt/components/Header/StreamActions.d.ts +11 -0
  15. package/dist/Prebuilt/components/InsetTile.d.ts +2 -0
  16. package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +8 -0
  17. package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +9 -0
  18. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2196 -0
  19. package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +11 -0
  20. package/dist/Prebuilt/components/Leave/LeaveRoom.d.ts +5 -0
  21. package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +8 -0
  22. package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +8 -0
  23. package/dist/Prebuilt/components/MoreSettings/MoreSettings.d.ts +6 -0
  24. package/dist/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.d.ts +6 -0
  25. package/dist/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.d.ts +6 -0
  26. package/dist/Prebuilt/components/Pagination.d.ts +6 -0
  27. package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +3 -0
  28. package/dist/Prebuilt/components/Preview/PreviewForm.d.ts +10 -0
  29. package/dist/Prebuilt/components/Preview/PreviewJoin.d.ts +16 -0
  30. package/dist/Prebuilt/components/RoleChangeRequestModal.d.ts +2 -0
  31. package/dist/Prebuilt/components/SecondaryTiles.d.ts +3 -0
  32. package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +3 -0
  33. package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +6 -0
  34. package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +12 -0
  35. package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +15 -0
  36. package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +3 -0
  37. package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +3 -0
  38. package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +9 -0
  39. package/dist/Prebuilt/components/hooks/useAutoStartStreaming.d.ts +1 -0
  40. package/dist/Prebuilt/components/hooks/useRedirectToLeave.d.ts +3 -0
  41. package/dist/Prebuilt/components/hooks/useRoleProminencePeers.d.ts +5 -0
  42. package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +13 -0
  43. package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +13 -0
  44. package/dist/Prebuilt/layouts/SidePane.d.ts +9 -0
  45. package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +7 -0
  46. package/dist/Prebuilt/plugins/whiteboard/ToggleWhiteboard.d.ts +5 -0
  47. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +1 -0
  48. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.d.ts +1 -0
  49. package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.d.ts +17 -0
  50. package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +6 -1
  51. package/dist/{VirtualBackground-GGCQJ5JM.js → VirtualBackground-UM2FOUHQ.js} +5 -11
  52. package/dist/VirtualBackground-UM2FOUHQ.js.map +7 -0
  53. package/dist/{chunk-P5X32KOD.js → chunk-364HP22I.js} +8 -5
  54. package/dist/chunk-364HP22I.js.map +7 -0
  55. package/dist/{chunk-OSM4QEQG.js → chunk-LYSAET4G.js} +3742 -5462
  56. package/dist/chunk-LYSAET4G.js.map +7 -0
  57. package/dist/chunk-POE7H4IE.js +898 -0
  58. package/dist/chunk-POE7H4IE.js.map +7 -0
  59. package/dist/conference-UWLJHMB2.js +5727 -0
  60. package/dist/conference-UWLJHMB2.js.map +7 -0
  61. package/dist/index.cjs.js +9655 -15326
  62. package/dist/index.cjs.js.map +4 -4
  63. package/dist/index.js +2 -2
  64. package/dist/meta.cjs.json +2513 -3456
  65. package/dist/meta.esbuild.json +2807 -3838
  66. package/package.json +8 -7
  67. package/src/Button/Button.tsx +2 -2
  68. package/src/Prebuilt/App.tsx +58 -53
  69. package/src/Prebuilt/{AppContext.jsx → AppContext.tsx} +11 -3
  70. package/src/Prebuilt/IconButton.jsx +11 -0
  71. package/src/Prebuilt/Prebuilt.stories.tsx +1 -0
  72. package/src/Prebuilt/common/{PeersSorter.js → PeersSorter.ts} +16 -11
  73. package/src/Prebuilt/common/constants.js +4 -114
  74. package/src/Prebuilt/common/hooks.js +34 -1
  75. package/src/Prebuilt/common/utils.js +1 -9
  76. package/src/Prebuilt/components/AppData/AppData.jsx +11 -15
  77. package/src/Prebuilt/components/AppData/useUISettings.js +6 -10
  78. package/src/Prebuilt/components/AudioVideoToggle.jsx +10 -2
  79. package/src/Prebuilt/components/AuthToken.jsx +11 -42
  80. package/src/Prebuilt/components/Chat/Chat.jsx +75 -27
  81. package/src/Prebuilt/components/Chat/ChatBody.jsx +95 -36
  82. package/src/Prebuilt/components/Chat/ChatFooter.tsx +199 -0
  83. package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +84 -0
  84. package/src/Prebuilt/components/Chat/ChatSelector.jsx +16 -17
  85. package/src/Prebuilt/components/Chat/ChatSelectorContainer.jsx +81 -0
  86. package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +5 -4
  87. package/src/Prebuilt/components/Connection/{ConnectionIndicator.jsx → ConnectionIndicator.tsx} +12 -4
  88. package/src/Prebuilt/components/Connection/TileConnection.tsx +71 -0
  89. package/src/Prebuilt/components/EmojiReaction.jsx +19 -22
  90. package/src/Prebuilt/components/Footer/{ChatToggle.jsx → ChatToggle.tsx} +13 -9
  91. package/src/Prebuilt/components/Footer/Footer.tsx +98 -0
  92. package/src/Prebuilt/components/Footer/ParticipantList.jsx +187 -179
  93. package/src/Prebuilt/components/Footer/RoleAccordion.tsx +94 -0
  94. package/src/Prebuilt/components/Footer/RoleOptions.tsx +155 -0
  95. package/src/Prebuilt/components/FullPageProgress.jsx +3 -3
  96. package/src/Prebuilt/components/HMSVideo/Controls.jsx +3 -2
  97. package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +63 -18
  98. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +2 -2
  99. package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
  100. package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +5 -6
  101. package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -3
  102. package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +38 -9
  103. package/src/Prebuilt/components/Header/{ConferencingHeader.jsx → Header.tsx} +9 -7
  104. package/src/Prebuilt/components/Header/HeaderComponents.jsx +13 -4
  105. package/src/Prebuilt/components/Header/{StreamActions.jsx → StreamActions.tsx} +54 -67
  106. package/src/Prebuilt/components/Header/common.jsx +5 -2
  107. package/src/Prebuilt/components/Header/index.tsx +1 -0
  108. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +23 -4
  109. package/src/Prebuilt/components/InsetTile.tsx +128 -0
  110. package/src/Prebuilt/components/{MoreSettings/SplitComponents/DesktopLeaveRoom.jsx → Leave/DesktopLeaveRoom.tsx} +67 -25
  111. package/src/Prebuilt/components/{EndSessionContent.jsx → Leave/EndSessionContent.tsx} +18 -11
  112. package/src/Prebuilt/components/Leave/LeaveAtoms.tsx +26 -0
  113. package/src/Prebuilt/components/Leave/LeaveCard.tsx +36 -0
  114. package/src/Prebuilt/components/Leave/LeaveRoom.tsx +66 -0
  115. package/src/Prebuilt/components/{LeaveSessionContent.jsx → Leave/LeaveSessionContent.tsx} +20 -6
  116. package/src/Prebuilt/components/{MoreSettings/SplitComponents/MwebLeaveRoom.jsx → Leave/MwebLeaveRoom.tsx} +43 -18
  117. package/src/Prebuilt/components/MetaActions.jsx +15 -23
  118. package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +5 -0
  119. package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +16 -7
  120. package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +1 -1
  121. package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +1 -4
  122. package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +27 -0
  123. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +216 -0
  124. package/src/Prebuilt/components/MoreSettings/SplitComponents/{MwebOptions.jsx → MwebOptions.tsx} +107 -45
  125. package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -1
  126. package/src/Prebuilt/components/Notifications/Notifications.jsx +46 -30
  127. package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +14 -2
  128. package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +10 -4
  129. package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +5 -11
  130. package/src/Prebuilt/components/PIP/PIPComponent.jsx +7 -16
  131. package/src/Prebuilt/components/PIP/PIPManager.js +1 -0
  132. package/src/Prebuilt/components/Pagination.tsx +60 -0
  133. package/src/Prebuilt/components/Playlist/Playlist.jsx +1 -6
  134. package/src/Prebuilt/components/PostLeave.jsx +7 -7
  135. package/src/Prebuilt/components/Preview/{PreviewContainer.jsx → PreviewContainer.tsx} +16 -15
  136. package/src/Prebuilt/components/Preview/{PreviewForm.jsx → PreviewForm.tsx} +16 -8
  137. package/src/Prebuilt/components/Preview/{PreviewJoin.jsx → PreviewJoin.tsx} +48 -22
  138. package/src/Prebuilt/components/RaiseHand.jsx +0 -7
  139. package/src/Prebuilt/components/RoleChangeRequestModal.tsx +119 -0
  140. package/src/Prebuilt/components/ScreenshareDisplay.jsx +4 -10
  141. package/src/Prebuilt/components/ScreenshareTile.jsx +43 -36
  142. package/src/Prebuilt/components/SecondaryTiles.tsx +36 -0
  143. package/src/Prebuilt/components/Settings/LayoutSettings.jsx +2 -12
  144. package/src/Prebuilt/components/Settings/NotificationSettings.jsx +3 -9
  145. package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -9
  146. package/src/Prebuilt/components/StatsForNerds.jsx +3 -1
  147. package/src/Prebuilt/components/TileMenu/TileMenu.jsx +16 -17
  148. package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +33 -27
  149. package/src/Prebuilt/components/Toast/ToastConfig.jsx +58 -15
  150. package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +65 -0
  151. package/src/Prebuilt/components/VideoLayouts/Grid.tsx +43 -0
  152. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +110 -0
  153. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +74 -0
  154. package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +59 -0
  155. package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +52 -0
  156. package/src/Prebuilt/components/VideoLayouts/interface.ts +10 -0
  157. package/src/Prebuilt/components/VideoTile.jsx +116 -74
  158. package/src/Prebuilt/components/conference.jsx +86 -85
  159. package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +57 -0
  160. package/src/Prebuilt/components/hooks/useMetadata.jsx +19 -3
  161. package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +34 -0
  162. package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +38 -0
  163. package/src/Prebuilt/components/hooks/useTileLayout.tsx +127 -0
  164. package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +26 -0
  165. package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +5 -72
  166. package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +4 -45
  167. package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +2 -17
  168. package/src/Prebuilt/components/peerTileUtils.jsx +1 -1
  169. package/src/Prebuilt/images/empty-chat.svg +12 -0
  170. package/src/Prebuilt/layouts/EmbedView.jsx +17 -50
  171. package/src/Prebuilt/layouts/HLSView.jsx +138 -51
  172. package/src/Prebuilt/layouts/PDFView.jsx +1 -11
  173. package/src/Prebuilt/layouts/SidePane.tsx +108 -0
  174. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +96 -0
  175. package/src/Prebuilt/layouts/WhiteboardView.jsx +10 -34
  176. package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -2
  177. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -4
  178. package/src/Prebuilt/plugins/whiteboard/{ToggleWhiteboard.jsx → ToggleWhiteboard.tsx} +5 -9
  179. package/src/Prebuilt/primitives/DialogContent.jsx +15 -11
  180. package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +17 -2
  181. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +36 -13
  182. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.ts +10 -0
  183. package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +65 -0
  184. package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +17 -6
  185. package/src/Prebuilt/services/FeatureFlags.jsx +0 -1
  186. package/src/VideoTile/StyledVideoTile.tsx +1 -0
  187. package/dist/HLSView-P57IRMAR.js.map +0 -7
  188. package/dist/PinnedTrackView-4FYJEBTB.js +0 -102
  189. package/dist/PinnedTrackView-4FYJEBTB.js.map +0 -7
  190. package/dist/VirtualBackground-GGCQJ5JM.js.map +0 -7
  191. package/dist/chunk-IVTWKQI3.js +0 -827
  192. package/dist/chunk-IVTWKQI3.js.map +0 -7
  193. package/dist/chunk-OSM4QEQG.js.map +0 -7
  194. package/dist/chunk-P5X32KOD.js.map +0 -7
  195. package/dist/chunk-RVCZPPTL.js +0 -1100
  196. package/dist/chunk-RVCZPPTL.js.map +0 -7
  197. package/dist/conference-P6I6ESVF.js +0 -8995
  198. package/dist/conference-P6I6ESVF.js.map +0 -7
  199. package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +0 -16
  200. package/src/Prebuilt/components/Chat/ChatFooter.jsx +0 -150
  201. package/src/Prebuilt/components/Chat/ChatHeader.jsx +0 -67
  202. package/src/Prebuilt/components/Connection/TileConnection.jsx +0 -39
  203. package/src/Prebuilt/components/EqualProminence.jsx +0 -180
  204. package/src/Prebuilt/components/FirstPersonDisplay.jsx +0 -50
  205. package/src/Prebuilt/components/Footer/Footer.jsx +0 -73
  206. package/src/Prebuilt/components/Header/Header.jsx +0 -8
  207. package/src/Prebuilt/components/Header/StreamingHeader.jsx +0 -54
  208. package/src/Prebuilt/components/LeaveCard.jsx +0 -19
  209. package/src/Prebuilt/components/LeaveRoom.jsx +0 -94
  210. package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +0 -10
  211. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.jsx +0 -219
  212. package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +0 -25
  213. package/src/Prebuilt/components/Pagination.jsx +0 -29
  214. package/src/Prebuilt/components/RoleChangeRequestModal.jsx +0 -26
  215. package/src/Prebuilt/components/VideoList.jsx +0 -73
  216. package/src/Prebuilt/components/gridView.jsx +0 -85
  217. package/src/Prebuilt/components/hooks/useFeatures.js +0 -22
  218. package/src/Prebuilt/components/hooks/useNavigation.js +0 -19
  219. package/src/Prebuilt/components/hooks/useSkipPreview.jsx +0 -20
  220. package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +0 -29
  221. package/src/Prebuilt/images/Logo.svg +0 -8
  222. package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +0 -34
  223. package/src/Prebuilt/layouts/InsetView.jsx +0 -260
  224. package/src/Prebuilt/layouts/PinnedTrackView.jsx +0 -59
  225. package/src/Prebuilt/layouts/SidePane.jsx +0 -52
  226. package/src/Prebuilt/layouts/mainGridView.jsx +0 -98
  227. package/src/Prebuilt/layouts/mainView.jsx +0 -141
  228. package/src/Prebuilt/layouts/screenShareView.jsx +0 -183
  229. /package/{src/Prebuilt/components/Header/index.jsx → dist/Prebuilt/components/Header/index.d.ts} +0 -0
  230. /package/src/Prebuilt/components/{ScreenShare.jsx → ScreenShareToggle.jsx} +0 -0
  231. /package/src/{assets → Prebuilt/images}/android-perm-1.png +0 -0
  232. /package/src/{assets → Prebuilt/images}/ios-perm-0.png +0 -0
@@ -0,0 +1,108 @@
1
+ import React from 'react';
2
+ import { useMedia } from 'react-use';
3
+ import { ConferencingScreen } from '@100mslive/types-prebuilt';
4
+ import { selectAppData, selectVideoTrackByPeerID, useHMSStore } from '@100mslive/react-sdk';
5
+ // @ts-ignore: No implicit Any
6
+ import { Chat } from '../components/Chat/Chat';
7
+ // @ts-ignore: No implicit Any
8
+ import { ParticipantList } from '../components/Footer/ParticipantList';
9
+ // @ts-ignore: No implicit Any
10
+ import { StreamingLanding } from '../components/Streaming/StreamingLanding';
11
+ import { TileCustomisationProps } from '../components/VideoLayouts/GridLayout';
12
+ // @ts-ignore: No implicit Any
13
+ import VideoTile from '../components/VideoTile';
14
+ import { Box, Flex } from '../../Layout';
15
+ import { config as cssConfig } from '../../Theme';
16
+ import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
17
+ // @ts-ignore: No implicit Any
18
+ import { APP_DATA, SIDE_PANE_OPTIONS } from '../common/constants';
19
+
20
+ const SidePane = ({
21
+ screenType,
22
+ tileProps,
23
+ hideControls = false,
24
+ }: {
25
+ screenType: keyof ConferencingScreen;
26
+ tileProps: TileCustomisationProps;
27
+ hideControls: boolean;
28
+ }) => {
29
+ const isMobile = useMedia(cssConfig.media.md);
30
+ const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
31
+ const activeScreensharePeerId = useHMSStore(selectAppData(APP_DATA.activeScreensharePeerId));
32
+ const trackId = useHMSStore(selectVideoTrackByPeerID(activeScreensharePeerId))?.id;
33
+ const { elements } = useRoomLayoutConferencingScreen();
34
+ let ViewComponent;
35
+ if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS) {
36
+ ViewComponent = <ParticipantList />;
37
+ } else if (sidepane === SIDE_PANE_OPTIONS.CHAT) {
38
+ ViewComponent = <Chat screenType={screenType} hideControls={hideControls} />;
39
+ } else if (sidepane === SIDE_PANE_OPTIONS.STREAMING) {
40
+ ViewComponent = <StreamingLanding />;
41
+ }
42
+ if (!ViewComponent && !trackId) {
43
+ return null;
44
+ }
45
+
46
+ const mwebStreamingChat = isMobile && sidepane === SIDE_PANE_OPTIONS.CHAT && elements?.chat?.is_overlay;
47
+
48
+ return (
49
+ <Flex
50
+ direction="column"
51
+ justify="center"
52
+ css={{
53
+ w: '$100',
54
+ h: '100%',
55
+ flexShrink: 0,
56
+ gap: '$4',
57
+ '@md': { position: mwebStreamingChat ? 'absolute' : '', zIndex: 12 },
58
+ }}
59
+ >
60
+ {trackId && (
61
+ <VideoTile
62
+ peerId={activeScreensharePeerId}
63
+ trackId={trackId}
64
+ width="100%"
65
+ height={225}
66
+ rootCSS={{ p: 0, alignSelf: 'start', flexShrink: 0 }}
67
+ objectFit="contain"
68
+ {...tileProps}
69
+ />
70
+ )}
71
+ {!!ViewComponent && (
72
+ <Box
73
+ css={{
74
+ w: '$100',
75
+ h: mwebStreamingChat ? '0' : '100%',
76
+ p: '$10',
77
+ flex: '1 1 0',
78
+ minHeight: 0,
79
+ maxHeight: mwebStreamingChat ? '300px' : 'unset',
80
+ background: mwebStreamingChat
81
+ ? 'linear-gradient(180deg, rgba(0, 0, 0, 0.00) 35.94%, rgba(0, 0, 0, 0.64) 100%)'
82
+ : '$surface_dim',
83
+ r: '$1',
84
+ position: 'relative',
85
+ '@lg': {
86
+ w: '100%',
87
+ h: '100%',
88
+ ml: 0,
89
+ right: 0,
90
+ position: 'fixed',
91
+ bottom: 0,
92
+ borderRadius: 0,
93
+ zIndex: 10,
94
+ },
95
+ '@md': {
96
+ p: '$6 $8',
97
+ pb: mwebStreamingChat ? '$20' : '$12',
98
+ },
99
+ }}
100
+ >
101
+ {ViewComponent}
102
+ </Box>
103
+ )}
104
+ </Flex>
105
+ );
106
+ };
107
+
108
+ export default SidePane;
@@ -0,0 +1,96 @@
1
+ import React, { Suspense, useEffect } from 'react';
2
+ import {
3
+ ConferencingScreen,
4
+ DefaultConferencingScreen_Elements,
5
+ HLSLiveStreamingScreen_Elements,
6
+ } from '@100mslive/types-prebuilt';
7
+ import { selectIsConnectedToRoom, selectLocalPeerRoleName, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
8
+ // @ts-ignore: No implicit Any
9
+ import FullPageProgress from '../components/FullPageProgress';
10
+ import { GridLayout } from '../components/VideoLayouts/GridLayout';
11
+ import { Flex } from '../../Layout';
12
+ // @ts-ignore: No implicit Any
13
+ import { EmbedView } from './EmbedView';
14
+ // @ts-ignore: No implicit Any
15
+ import { PDFView } from './PDFView';
16
+ import SidePane from './SidePane';
17
+ // @ts-ignore: No implicit Any
18
+ import { WaitingView } from './WaitingView';
19
+ // import { useWhiteboardMetadata } from '../plugins/whiteboard';
20
+ import {
21
+ usePDFAnnotator,
22
+ useUrlToEmbed,
23
+ useWaitingViewerRole,
24
+ // @ts-ignore: No implicit Any
25
+ } from '../components/AppData/useUISettings';
26
+ // @ts-ignore: No implicit Any
27
+ import { SESSION_STORE_KEY } from '../common/constants';
28
+
29
+ // const WhiteboardView = React.lazy(() => import("./WhiteboardView"));
30
+ // @ts-ignore: No implicit Any
31
+ const HLSView = React.lazy(() => import('./HLSView'));
32
+
33
+ export const VideoStreamingSection = ({
34
+ screenType,
35
+ elements,
36
+ hideControls = false,
37
+ }: {
38
+ screenType: keyof ConferencingScreen;
39
+ elements: DefaultConferencingScreen_Elements | HLSLiveStreamingScreen_Elements;
40
+ hideControls: boolean;
41
+ }) => {
42
+ const localPeerRole = useHMSStore(selectLocalPeerRoleName);
43
+ // const { whiteboardOwner: whiteboardShared } = useWhiteboardMetadata();
44
+ const isConnected = useHMSStore(selectIsConnectedToRoom);
45
+ const hmsActions = useHMSActions();
46
+ const waitingViewerRole = useWaitingViewerRole();
47
+ const urlToIframe = useUrlToEmbed();
48
+ const pdfAnnotatorActive = usePDFAnnotator();
49
+
50
+ useEffect(() => {
51
+ if (!isConnected) {
52
+ return;
53
+ }
54
+ hmsActions.sessionStore.observe([SESSION_STORE_KEY.PINNED_MESSAGE, SESSION_STORE_KEY.SPOTLIGHT]);
55
+ // eslint-disable-next-line react-hooks/exhaustive-deps
56
+ }, [isConnected, hmsActions]);
57
+
58
+ if (!localPeerRole) {
59
+ // we don't know the role yet to decide how to render UI
60
+ return null;
61
+ }
62
+
63
+ let ViewComponent;
64
+ if (screenType === 'hls_live_streaming') {
65
+ ViewComponent = <HLSView />;
66
+ } else if (localPeerRole === waitingViewerRole) {
67
+ ViewComponent = <WaitingView />;
68
+ } else if (pdfAnnotatorActive) {
69
+ ViewComponent = <PDFView />;
70
+ } else if (urlToIframe) {
71
+ ViewComponent = <EmbedView />;
72
+ } else {
73
+ //@ts-ignore
74
+ ViewComponent = <GridLayout {...(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid} />;
75
+ }
76
+
77
+ return (
78
+ <Suspense fallback={<FullPageProgress />}>
79
+ <Flex
80
+ css={{
81
+ size: '100%',
82
+ position: 'relative',
83
+ gap: '$4',
84
+ }}
85
+ >
86
+ {ViewComponent}
87
+ <SidePane
88
+ screenType={screenType}
89
+ // @ts-ignore
90
+ tileProps={(elements as DefaultConferencingScreen_Elements)?.video_tile_layout?.grid}
91
+ hideControls={hideControls}
92
+ />
93
+ </Flex>
94
+ </Suspense>
95
+ );
96
+ };
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
- import { useMedia } from 'react-use';
3
2
  import { selectPeers, selectRoomID, useHMSStore } from '@100mslive/react-sdk';
4
- import { Box, Flex } from '../../Layout';
5
- import { config as cssConfig } from '../../Theme';
6
- import { SidePane } from './screenShareView';
3
+ import { SecondaryTiles } from '../components/SecondaryTiles';
4
+ import { ProminenceLayout } from '../components/VideoLayouts/ProminenceLayout';
5
+ import { Box } from '../../Layout';
7
6
  // import { Whiteboard } from '../plugins/whiteboard';
8
7
 
9
- const Editor = React.memo(({ roomId }) => {
8
+ const Editor = React.memo(() => {
10
9
  return (
11
10
  <Box
12
11
  css={{
@@ -26,38 +25,15 @@ const Editor = React.memo(({ roomId }) => {
26
25
  });
27
26
 
28
27
  const WhiteboardView = () => {
29
- // for smaller screen we will show sidebar in bottom
30
- const mediaQueryLg = cssConfig.media.lg;
31
- const showSidebarInBottom = useMedia(mediaQueryLg);
32
28
  const peers = useHMSStore(selectPeers);
33
29
  const roomId = useHMSStore(selectRoomID);
34
30
  return (
35
- <Flex
36
- css={{
37
- size: '100%',
38
- }}
39
- direction={showSidebarInBottom ? 'column' : 'row'}
40
- >
41
- <Editor roomId={roomId} />
42
- <Flex
43
- direction={{ '@initial': 'column', '@lg': 'row' }}
44
- css={{
45
- overflow: 'hidden',
46
- p: '$4',
47
- flex: '0 0 20%',
48
- '@lg': {
49
- flex: '1 1 0',
50
- },
51
- }}
52
- >
53
- <SidePane
54
- showSidebarInBottom={showSidebarInBottom}
55
- isPresenterInSmallTiles={true}
56
- smallTilePeers={peers}
57
- totalPeers={peers.length}
58
- />
59
- </Flex>
60
- </Flex>
31
+ <ProminenceLayout.Root>
32
+ <ProminenceLayout.ProminentSection>
33
+ <Editor roomId={roomId} />
34
+ </ProminenceLayout.ProminentSection>
35
+ <SecondaryTiles peers={peers} />
36
+ </ProminenceLayout.Root>
61
37
  );
62
38
  };
63
39
 
@@ -1,9 +1,16 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import { useMedia } from 'react-use';
3
- import { selectLocalPeerID, selectPeerNameByID, useHMSStore, useHMSVanillaStore } from '@100mslive/react-sdk';
3
+ import {
4
+ selectLocalPeerID,
5
+ selectPeerNameByID,
6
+ useCustomEvent,
7
+ useHMSStore,
8
+ useHMSVanillaStore,
9
+ } from '@100mslive/react-sdk';
4
10
  import { Box, Flex } from '../../Layout';
5
11
  import { Text } from '../../Text';
6
12
  import { config as cssConfig, keyframes } from '../../Theme';
13
+ import { EMOJI_REACTION_TYPE } from '../common/constants';
7
14
 
8
15
  let emojiCount = 1;
9
16
 
@@ -42,7 +49,7 @@ export function FlyingEmoji() {
42
49
  const startingPoints = useMemo(() => getStartingPoints(isMobile), [isMobile]);
43
50
 
44
51
  const showFlyingEmoji = useCallback(
45
- (emojiId, senderId) => {
52
+ ({ emojiId, senderId }) => {
46
53
  if (!emojiId || !senderId || document.hidden) {
47
54
  return;
48
55
  }
@@ -67,6 +74,11 @@ export function FlyingEmoji() {
67
74
  [localPeerId, vanillaStore, startingPoints],
68
75
  );
69
76
 
77
+ useCustomEvent({
78
+ type: EMOJI_REACTION_TYPE,
79
+ onEvent: showFlyingEmoji,
80
+ });
81
+
70
82
  useEffect(() => {
71
83
  window.showFlyingEmoji = showFlyingEmoji;
72
84
  }, [showFlyingEmoji]);
@@ -13,9 +13,7 @@ import { ActionTile } from '../../components/MoreSettings/ActionTile';
13
13
  import { Loading } from '../../../Loading';
14
14
  import { Tooltip } from '../../../Tooltip';
15
15
  import IconButton from '../../IconButton';
16
- import { useIsFeatureEnabled } from '../../components/hooks/useFeatures';
17
16
  import { getRandomVirtualBackground } from './vbutils';
18
- import { FEATURE_LIST } from '../../common/constants';
19
17
 
20
18
  export const VirtualBackground = ({
21
19
  asActionTile = false,
@@ -32,7 +30,6 @@ export const VirtualBackground = ({
32
30
  const [isVBOn, setIsVBOn] = useState(false);
33
31
  const localPeerVideoTrackID = useHMSStore(selectLocalVideoTrackID);
34
32
  const isVBPresent = useHMSStore(selectIsLocalVideoPluginPresent('HMSVB'));
35
- const isFeatureEnabled = useIsFeatureEnabled(FEATURE_LIST.VIDEO_PLUGINS);
36
33
 
37
34
  async function createPlugin() {
38
35
  if (!pluginRef.current) {
@@ -72,7 +69,7 @@ export const VirtualBackground = ({
72
69
  }
73
70
  }
74
71
 
75
- if (!isAllowedToPublish.video || !isVBSupported || !isFeatureEnabled) {
72
+ if (!isAllowedToPublish.video || !isVBSupported) {
76
73
  return null;
77
74
  }
78
75
  if (asActionTile) {
@@ -1,25 +1,21 @@
1
1
  import React from 'react';
2
- import { selectLocalPeerRoleName, useHMSStore } from '@100mslive/react-sdk';
2
+ import { ConferencingScreen } from '@100mslive/types-prebuilt';
3
3
  import { PencilDrawIcon } from '@100mslive/react-icons';
4
4
  import { Tooltip } from '../../../Tooltip';
5
+ // @ts-ignore: No implicit any
5
6
  import IconButton from '../../IconButton';
6
- import { useHLSViewerRole } from '../../components/AppData/useUISettings';
7
- import { useIsFeatureEnabled } from '../../components/hooks/useFeatures';
7
+ // @ts-ignore: No implicit any
8
8
  import { useWhiteboardMetadata } from './useWhiteboardMetadata';
9
- import { FEATURE_LIST } from '../../common/constants';
10
9
 
11
- export const ToggleWhiteboard = () => {
10
+ export const ToggleWhiteboard = ({ screenType }: { screenType: keyof ConferencingScreen }) => {
12
11
  const {
13
12
  whiteboardEnabled,
14
13
  whiteboardOwner: whiteboardActive,
15
14
  amIWhiteboardOwner,
16
15
  toggleWhiteboard,
17
16
  } = useWhiteboardMetadata();
18
- const hlsViewerRole = useHLSViewerRole();
19
- const localPeerRole = useHMSStore(selectLocalPeerRoleName);
20
- const isFeatureEnabled = useIsFeatureEnabled(FEATURE_LIST.WHITEBOARD);
21
17
 
22
- if (!whiteboardEnabled || localPeerRole === hlsViewerRole || !isFeatureEnabled) {
18
+ if (!whiteboardEnabled || screenType === 'hls_live_streaming') {
23
19
  return null;
24
20
  }
25
21
 
@@ -67,17 +67,21 @@ export const RequestDialog = ({ open = true, onOpenChange, title, body, actionTe
67
67
  {Icon ? Icon : null}
68
68
  <Text variant="h6">{title}</Text>
69
69
  </Dialog.Title>
70
- <Text
71
- variant="md"
72
- css={{
73
- fontWeight: 400,
74
- mt: '$4',
75
- mb: '$10',
76
- c: '$on_surface_medium',
77
- }}
78
- >
79
- {body}
80
- </Text>
70
+ {typeof body === 'string' ? (
71
+ <Text
72
+ variant="md"
73
+ css={{
74
+ fontWeight: 400,
75
+ mt: '$4',
76
+ mb: '$10',
77
+ c: '$on_surface_medium',
78
+ }}
79
+ >
80
+ {body}
81
+ </Text>
82
+ ) : (
83
+ <Box css={{ mt: '$4', mb: '$10' }}>{body}</Box>
84
+ )}
81
85
  <Flex justify="center" align="center" css={{ width: '100%', gap: '$md' }}>
82
86
  <Box css={{ width: '50%' }}>
83
87
  <Dialog.Close css={{ width: '100%' }}>
@@ -20,14 +20,29 @@ export const defaultLayout: Layout = {
20
20
  sub_title: 'Setup your audio and video before joining',
21
21
  },
22
22
  join_form: {
23
- join_btn_type: JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE,
23
+ join_btn_type: JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_ONLY,
24
24
  join_btn_label: 'Join Now',
25
25
  go_live_btn_label: 'Go Live',
26
26
  },
27
27
  },
28
28
  },
29
29
  },
30
- conferencing: {},
30
+ conferencing: {
31
+ default: {
32
+ elements: {
33
+ chat: {},
34
+ participant_list: {},
35
+ video_tile_layout: {
36
+ grid: {
37
+ enable_local_tile_inset: true,
38
+ prominent_roles: [],
39
+ enable_spotlighting_peer: true,
40
+ },
41
+ },
42
+ emoji_reactions: {},
43
+ },
44
+ },
45
+ },
31
46
  leave: {},
32
47
  },
33
48
  };
@@ -1,4 +1,4 @@
1
- import { useEffect, useRef, useState } from 'react';
1
+ import { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import type { GetResponse, Layout } from '@100mslive/types-prebuilt';
3
3
  import { defaultLayout } from '../constants';
4
4
 
@@ -25,33 +25,56 @@ export type useFetchRoomLayoutProps = {
25
25
 
26
26
  export type useFetchRoomLayoutResponse = {
27
27
  layout: Layout | undefined;
28
+ updateRoomLayoutForRole: (role: string) => void;
28
29
  };
29
30
 
30
31
  export const useFetchRoomLayout = ({
31
- endpoint = '',
32
+ endpoint = 'https://api.100ms.live/v2/layouts/ui',
32
33
  authToken = '',
33
34
  }: useFetchRoomLayoutProps): useFetchRoomLayoutResponse => {
34
35
  const [layout, setLayout] = useState<Layout | undefined>(undefined);
36
+ const layoutResp = useRef<GetResponse>();
35
37
  const isFetchInProgress = useRef(false);
38
+ const updateRoomLayoutForRole = useCallback((role: string) => {
39
+ if (!layoutResp.current) {
40
+ return;
41
+ }
42
+ const [layout] = (layoutResp.current?.data || []).filter(layout => layout.role === role);
43
+ if (layout) {
44
+ setLayout(layout);
45
+ }
46
+ }, []);
36
47
  useEffect(() => {
37
48
  (async () => {
38
49
  if (isFetchInProgress.current || !authToken) {
39
50
  return;
40
51
  }
41
- if (!endpoint) {
42
- setLayout(defaultLayout);
43
- }
44
52
  isFetchInProgress.current = true;
45
- const resp = await fetchWithRetry(endpoint, {
46
- headers: {
47
- Authorization: `Bearer ${authToken}`,
48
- },
49
- });
50
- const layoutResp: GetResponse = await resp.json();
51
- setLayout(layoutResp.data[0]);
53
+ try {
54
+ const resp = await fetchWithRetry(endpoint, {
55
+ headers: {
56
+ Authorization: `Bearer ${authToken}`,
57
+ },
58
+ });
59
+ layoutResp.current = await resp.json();
60
+ } catch (e) {
61
+ console.error('[Room Layout API]: Failed to fetch / process room layout. Resorting to default layout.', e);
62
+ layoutResp.current = {
63
+ data: [defaultLayout],
64
+ };
65
+ }
66
+ let layoutForRole = layoutResp.current?.data?.[0];
67
+ if (!layoutForRole) {
68
+ console.error(
69
+ '[Room Layout API]: Unable to figure out room layout from API response. Resorting to default layout.',
70
+ );
71
+ layoutForRole = defaultLayout;
72
+ }
73
+ const layout = layoutForRole;
74
+ setLayout(layout);
52
75
  isFetchInProgress.current = false;
53
76
  })();
54
77
  }, [authToken, endpoint]);
55
78
 
56
- return { layout };
79
+ return { layout, updateRoomLayoutForRole };
57
80
  };
@@ -0,0 +1,10 @@
1
+ import { useRoomLayout } from '..';
2
+
3
+ export const useInsetEnabled = (): boolean => {
4
+ const layout = useRoomLayout();
5
+ const { enable_local_tile_inset = true } =
6
+ //@ts-ignore
7
+ layout?.screens?.conferencing?.default?.elements?.video_tile_layout?.grid || {};
8
+
9
+ return enable_local_tile_inset;
10
+ };
@@ -0,0 +1,65 @@
1
+ import {
2
+ ConferencingScreen,
3
+ DefaultPreviewScreen_Elements,
4
+ LeaveScreen,
5
+ PreviewScreen,
6
+ Screens,
7
+ } from '@100mslive/types-prebuilt';
8
+ import { useRoomLayout } from '..';
9
+
10
+ export type useRoomLayoutScreenProps = {
11
+ screen: keyof Screens;
12
+ };
13
+
14
+ type useRoomLayoutScreenReturnType<T extends useRoomLayoutScreenProps> = T['screen'] extends 'conferencing'
15
+ ? ConferencingScreen
16
+ : T['screen'] extends 'leave'
17
+ ? LeaveScreen
18
+ : T['screen'] extends 'preview'
19
+ ? PreviewScreen
20
+ : undefined;
21
+
22
+ function useRoomLayoutScreen<T extends useRoomLayoutScreenProps>({
23
+ screen,
24
+ }: T): useRoomLayoutScreenReturnType<T> | undefined {
25
+ const roomLayout = useRoomLayout();
26
+ const screenProps = roomLayout?.screens?.[screen] as useRoomLayoutScreenReturnType<T> | undefined;
27
+ return screenProps;
28
+ }
29
+
30
+ export function useRoomLayoutPreviewScreen() {
31
+ const screenProps = useRoomLayoutScreen({ screen: 'preview' });
32
+ const isPreviewScreenEnabled = !!screenProps;
33
+ let elements: DefaultPreviewScreen_Elements | undefined;
34
+ let screenType: keyof PreviewScreen | undefined;
35
+ if (isPreviewScreenEnabled) {
36
+ screenType = Object.keys(screenProps)[0] as keyof PreviewScreen;
37
+ elements = screenProps[screenType]?.elements;
38
+ }
39
+ return {
40
+ isPreviewScreenEnabled,
41
+ elements,
42
+ screenType,
43
+ };
44
+ }
45
+
46
+ export function useRoomLayoutConferencingScreen() {
47
+ const screenProps = useRoomLayoutScreen({ screen: 'conferencing' }) || {};
48
+ const screenType = Object.keys(screenProps)[0] as keyof ConferencingScreen;
49
+ const elements = screenProps[screenType]?.elements;
50
+ // @ts-ignore
51
+ const hideSections: string[] = screenProps[screenType]?.hideSections || [];
52
+ return {
53
+ hideSections,
54
+ elements,
55
+ screenType,
56
+ };
57
+ }
58
+
59
+ export function useRoomLayoutLeaveScreen() {
60
+ const screenProps = useRoomLayoutScreen({ screen: 'leave' });
61
+ const isLeaveScreenEnabled = !!screenProps;
62
+ return {
63
+ isLeaveScreenEnabled,
64
+ };
65
+ }
@@ -3,14 +3,20 @@ import type { Layout } from '@100mslive/types-prebuilt';
3
3
  import merge from 'lodash.merge';
4
4
  // @ts-ignore: fix types
5
5
  import { useAuthToken } from '../../components/AppData/useUISettings';
6
- import { useFetchRoomLayout } from './hooks/useFetchRoomLayout';
6
+ import { useFetchRoomLayout, useFetchRoomLayoutResponse } from './hooks/useFetchRoomLayout';
7
7
 
8
8
  export type RoomLayoutProviderProps = {
9
9
  roomLayoutEndpoint?: string;
10
10
  overrideLayout?: Partial<Layout>;
11
11
  };
12
12
 
13
- export const RoomLayoutContext = React.createContext<Layout | undefined>(undefined);
13
+ export const RoomLayoutContext = React.createContext<
14
+ | {
15
+ layout: Layout | undefined;
16
+ updateRoomLayoutForRole: useFetchRoomLayoutResponse['updateRoomLayoutForRole'] | undefined;
17
+ }
18
+ | undefined
19
+ >(undefined);
14
20
 
15
21
  export const RoomLayoutProvider: React.FC<React.PropsWithChildren<RoomLayoutProviderProps>> = ({
16
22
  children,
@@ -18,9 +24,14 @@ export const RoomLayoutProvider: React.FC<React.PropsWithChildren<RoomLayoutProv
18
24
  overrideLayout,
19
25
  }) => {
20
26
  const authToken: string = useAuthToken();
21
- let { layout } = useFetchRoomLayout({ authToken, endpoint: roomLayoutEndpoint });
22
- layout = merge(layout, overrideLayout);
23
- return <RoomLayoutContext.Provider value={layout}>{children}</RoomLayoutContext.Provider>;
27
+ const { layout, updateRoomLayoutForRole } = useFetchRoomLayout({ authToken, endpoint: roomLayoutEndpoint });
28
+ const mergedLayout = authToken && layout ? merge(layout, overrideLayout) : layout;
29
+ return (
30
+ <RoomLayoutContext.Provider value={{ layout: mergedLayout, updateRoomLayoutForRole }}>
31
+ {children}
32
+ </RoomLayoutContext.Provider>
33
+ );
24
34
  };
25
35
 
26
- export const useRoomLayout = (): Layout | undefined => React.useContext(RoomLayoutContext);
36
+ export const useRoomLayout = () => React.useContext(RoomLayoutContext)?.layout;
37
+ export const useUpdateRoomLayout = () => React.useContext(RoomLayoutContext)?.updateRoomLayoutForRole;
@@ -8,7 +8,6 @@ export class FeatureFlags {
8
8
  process.env.REACT_APP_ENABLE_WHITEBOARD &&
9
9
  process.env.REACT_APP_PUSHER_APP_KEY &&
10
10
  process.env.REACT_APP_PUSHER_AUTHENDPOINT;
11
- static enableBeamSpeakersLogging = process.env.REACT_APP_ENABLE_BEAM_SPEAKERS_LOGGING === 'true';
12
11
 
13
12
  static init(roomId) {
14
13
  if (!window.HMS) {
@@ -14,6 +14,7 @@ const Container = styled('div', {
14
14
  width: '100%',
15
15
  height: '100%',
16
16
  position: 'relative',
17
+ overflow: 'hidden',
17
18
  borderRadius: '$2',
18
19
  display: 'flex',
19
20
  justifyContent: 'center',