@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,183 +0,0 @@
1
- import React, { Fragment, useCallback, useMemo } from 'react';
2
- import { useMedia } from 'react-use';
3
- import {
4
- selectLocalPeerID,
5
- selectLocalPeerRoleName,
6
- selectPeers,
7
- selectPeerScreenSharing,
8
- selectPeerSharingVideoPlaylist,
9
- selectScreenShareByPeerID,
10
- useHMSStore,
11
- } from '@100mslive/react-sdk';
12
- import { VideoPlayer } from '../components/Playlist/VideoPlayer';
13
- import { ScreenshareDisplay } from '../components/ScreenshareDisplay';
14
- import ScreenshareTile from '../components/ScreenshareTile';
15
- import VideoList from '../components/VideoList';
16
- import VideoTile from '../components/VideoTile';
17
- import { Box, Flex } from '../../Layout';
18
- import { config as cssConfig } from '../../Theme';
19
-
20
- const ScreenShareView = () => {
21
- // for smaller screen we will show sidebar in bottom
22
- const mediaQueryLg = cssConfig.media.xl;
23
- const showSidebarInBottom = useMedia(mediaQueryLg);
24
- const peers = useHMSStore(selectPeers);
25
- const localPeerID = useHMSStore(selectLocalPeerID);
26
- const localPeerRole = useHMSStore(selectLocalPeerRoleName);
27
- const peerPresenting = useHMSStore(selectPeerScreenSharing);
28
- const peerSharingPlaylist = useHMSStore(selectPeerSharingVideoPlaylist);
29
- const isPresenterFromMyRole = peerPresenting?.roleName?.toLowerCase() === localPeerRole?.toLowerCase();
30
- const amIPresenting = localPeerID === peerPresenting?.id;
31
- const showPresenterInSmallTile = showSidebarInBottom || amIPresenting || isPresenterFromMyRole;
32
-
33
- const smallTilePeers = useMemo(() => {
34
- const smallTilePeers = peers.filter(peer => peer.id !== peerPresenting?.id);
35
- if (showPresenterInSmallTile && peerPresenting) {
36
- smallTilePeers.unshift(peerPresenting); // put presenter on first page
37
- }
38
- return smallTilePeers;
39
- }, [peers, peerPresenting, showPresenterInSmallTile]);
40
-
41
- return (
42
- <Flex
43
- css={{
44
- size: '100%',
45
- }}
46
- direction={showSidebarInBottom ? 'column' : 'row'}
47
- >
48
- <ScreenShareComponent
49
- amIPresenting={amIPresenting}
50
- peerPresenting={peerPresenting}
51
- peerSharingPlaylist={peerSharingPlaylist}
52
- />
53
- <Flex
54
- direction={{ '@initial': 'column', '@lg': 'row' }}
55
- css={{
56
- overflow: 'hidden',
57
- p: '$4 $8',
58
- flex: '0 0 20%',
59
- '@xl': {
60
- flex: '1 1 0',
61
- },
62
- }}
63
- >
64
- <SidePane
65
- showSidebarInBottom={showSidebarInBottom}
66
- peerScreenSharing={peerPresenting}
67
- isPresenterInSmallTiles={showPresenterInSmallTile}
68
- smallTilePeers={smallTilePeers}
69
- totalPeers={peers.length}
70
- />
71
- </Flex>
72
- </Flex>
73
- );
74
- };
75
-
76
- // Sidepane will show the camera stream of the main peer who is screensharing
77
- // and both camera + screen(if applicable) of others
78
- export const SidePane = ({
79
- isPresenterInSmallTiles,
80
- peerScreenSharing, // the peer who is screensharing
81
- smallTilePeers,
82
- showSidebarInBottom,
83
- }) => {
84
- // The main peer's screenshare is already being shown in center view
85
- const shouldShowScreenFn = useCallback(
86
- peer => peerScreenSharing && peer.id !== peerScreenSharing.id,
87
- [peerScreenSharing],
88
- );
89
- return (
90
- <Fragment>
91
- {!isPresenterInSmallTiles && <LargeTilePeerView peerScreenSharing={peerScreenSharing} />}
92
- <SmallTilePeersView
93
- showSidebarInBottom={showSidebarInBottom}
94
- smallTilePeers={smallTilePeers}
95
- shouldShowScreenFn={shouldShowScreenFn}
96
- />
97
- </Fragment>
98
- );
99
- };
100
-
101
- const ScreenShareComponent = ({ amIPresenting, peerPresenting, peerSharingPlaylist }) => {
102
- const screenshareTrack = useHMSStore(selectScreenShareByPeerID(peerPresenting?.id));
103
-
104
- if (peerSharingPlaylist) {
105
- return (
106
- <Box
107
- css={{
108
- flex: '3 1 0',
109
- '@xl': {
110
- flex: '2 1 0',
111
- display: 'flex',
112
- alignItems: 'center',
113
- },
114
- }}
115
- >
116
- <VideoPlayer peerId={peerSharingPlaylist.id} />
117
- </Box>
118
- );
119
- }
120
-
121
- return (
122
- <Box
123
- css={{
124
- flex: '3 1 0',
125
- '@xl': { ml: '$4', maxHeight: '80%', minHeight: 0 },
126
- }}
127
- >
128
- {peerPresenting &&
129
- (amIPresenting && !['browser', 'window', 'application'].includes(screenshareTrack?.displaySurface) ? (
130
- <Box css={{ objectFit: 'contain', h: '100%' }}>
131
- <ScreenshareDisplay />
132
- </Box>
133
- ) : (
134
- <ScreenshareTile peerId={peerPresenting?.id} />
135
- ))}
136
- </Box>
137
- );
138
- };
139
-
140
- const SmallTilePeersView = ({ smallTilePeers, shouldShowScreenFn, showSidebarInBottom }) => {
141
- return (
142
- <Flex
143
- css={{
144
- flex: '2 1 0',
145
- }}
146
- >
147
- {smallTilePeers && smallTilePeers.length > 0 && (
148
- <VideoList
149
- peers={smallTilePeers}
150
- maxColCount={showSidebarInBottom ? undefined : 1}
151
- maxRowCount={showSidebarInBottom ? 1 : undefined}
152
- includeScreenShareForPeer={shouldShowScreenFn}
153
- />
154
- )}
155
- </Flex>
156
- );
157
- };
158
-
159
- const LargeTilePeerView = ({ peerScreenSharing, showStatsOnTiles }) => {
160
- return peerScreenSharing ? (
161
- <Box
162
- css={{
163
- flex: '1 1 0',
164
- minHeight: '25%',
165
- py: '$4',
166
- '@lg': {
167
- mr: '$4',
168
- minHeight: 'unset',
169
- py: 0,
170
- },
171
- '@sm': {
172
- height: '100%',
173
- maxHeight: '75%',
174
- alignSelf: 'center',
175
- },
176
- }}
177
- >
178
- <VideoTile showStatsOnTiles={showStatsOnTiles} width="100%" height="100%" peerId={peerScreenSharing.id} />
179
- </Box>
180
- ) : null;
181
- };
182
-
183
- export default ScreenShareView;
File without changes