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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. package/dist/{HLSView-F2K5VSTS.js → HLSView-P57IRMAR.js} +7 -11
  2. package/dist/{HLSView-F2K5VSTS.js.map → HLSView-P57IRMAR.js.map} +1 -1
  3. package/dist/PinnedTrackView-4FYJEBTB.js +102 -0
  4. package/dist/PinnedTrackView-4FYJEBTB.js.map +7 -0
  5. package/dist/Popover/index.d.ts +1 -0
  6. package/dist/Prebuilt/App.d.ts +25 -0
  7. package/dist/Prebuilt/index.d.ts +1 -0
  8. package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +1 -1
  9. package/dist/Sheet/Sheet.d.ts +3093 -0
  10. package/dist/Sheet/index.d.ts +1 -0
  11. package/dist/Theme/ThemeProvider.d.ts +4 -286
  12. package/dist/Theme/stitches.config.d.ts +1 -1
  13. package/dist/{VirtualBackground-S3XEPZ2T.js → VirtualBackground-GGCQJ5JM.js} +31 -7
  14. package/dist/VirtualBackground-GGCQJ5JM.js.map +7 -0
  15. package/dist/chunk-IVTWKQI3.js +827 -0
  16. package/dist/chunk-IVTWKQI3.js.map +7 -0
  17. package/dist/{chunk-42SWPN2C.js → chunk-OSM4QEQG.js} +3020 -2189
  18. package/dist/chunk-OSM4QEQG.js.map +7 -0
  19. package/dist/chunk-P5X32KOD.js +67 -0
  20. package/dist/chunk-P5X32KOD.js.map +7 -0
  21. package/dist/chunk-RVCZPPTL.js +1100 -0
  22. package/dist/chunk-RVCZPPTL.js.map +7 -0
  23. package/dist/{chunk-ESUJK7AT.js → conference-P6I6ESVF.js} +3136 -653
  24. package/dist/conference-P6I6ESVF.js.map +7 -0
  25. package/dist/index.cjs.js +15733 -15498
  26. package/dist/index.cjs.js.map +4 -4
  27. package/dist/index.js +4 -8
  28. package/dist/meta.cjs.json +3355 -3017
  29. package/dist/meta.esbuild.json +3534 -3329
  30. package/dist/utils/animations.d.ts +16 -0
  31. package/package.json +8 -10
  32. package/src/Button/Button.tsx +4 -4
  33. package/src/Dropdown/Dropdown.tsx +2 -2
  34. package/src/IconButton/IconButton.tsx +4 -2
  35. package/src/Pagination/StyledPagination.tsx +1 -0
  36. package/src/Popover/index.tsx +2 -1
  37. package/src/Prebuilt/{App.jsx → App.tsx} +95 -48
  38. package/src/Prebuilt/Prebuilt.stories.tsx +22 -8
  39. package/src/Prebuilt/common/constants.js +1 -2
  40. package/src/Prebuilt/common/hooks.js +8 -0
  41. package/src/Prebuilt/common/utils.js +15 -0
  42. package/src/Prebuilt/components/AppData/AppData.jsx +1 -2
  43. package/src/Prebuilt/components/AppData/useUISettings.js +0 -5
  44. package/src/Prebuilt/components/AudioVideoToggle.jsx +69 -26
  45. package/src/Prebuilt/components/AuthToken.jsx +3 -2
  46. package/src/Prebuilt/components/Chat/ChatSelector.jsx +1 -1
  47. package/src/Prebuilt/components/Connection/TileConnection.jsx +0 -1
  48. package/src/Prebuilt/components/EmojiReaction.jsx +23 -73
  49. package/src/Prebuilt/components/EndSessionContent.jsx +57 -0
  50. package/src/Prebuilt/components/EqualProminence.jsx +180 -0
  51. package/src/Prebuilt/components/ErrorBoundary.jsx +4 -10
  52. package/src/Prebuilt/components/Footer/EmojiCard.jsx +34 -0
  53. package/src/Prebuilt/components/Footer/Footer.jsx +73 -0
  54. package/src/Prebuilt/components/{Header → Footer}/ParticipantList.jsx +5 -5
  55. package/src/Prebuilt/components/Header/ConferencingHeader.jsx +27 -7
  56. package/src/Prebuilt/components/Header/HeaderComponents.jsx +16 -14
  57. package/src/Prebuilt/components/Header/StreamActions.jsx +101 -36
  58. package/src/Prebuilt/components/Header/StreamingHeader.jsx +1 -1
  59. package/src/Prebuilt/components/Header/common.jsx +164 -0
  60. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +1 -2
  61. package/src/Prebuilt/components/LeaveCard.jsx +19 -0
  62. package/src/Prebuilt/components/LeaveRoom.jsx +35 -143
  63. package/src/Prebuilt/components/LeaveSessionContent.jsx +45 -0
  64. package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +55 -0
  65. package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +96 -0
  66. package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +31 -54
  67. package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +48 -73
  68. package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +5 -221
  69. package/src/Prebuilt/components/MoreSettings/MuteAllContent.jsx +61 -0
  70. package/src/Prebuilt/components/MoreSettings/MuteAllModal.jsx +32 -49
  71. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopLeaveRoom.jsx +129 -0
  72. package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.jsx +219 -0
  73. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebLeaveRoom.jsx +100 -0
  74. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.jsx +259 -0
  75. package/src/Prebuilt/components/Notifications/Notifications.jsx +0 -2
  76. package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +0 -4
  77. package/src/Prebuilt/components/PIP/PIPComponent.jsx +30 -26
  78. package/src/Prebuilt/components/PIP/PIPManager.js +13 -0
  79. package/src/Prebuilt/components/PIP/index.jsx +2 -7
  80. package/src/Prebuilt/components/Pagination.jsx +4 -4
  81. package/src/Prebuilt/components/Preview/PreviewContainer.jsx +5 -13
  82. package/src/Prebuilt/components/Preview/PreviewForm.jsx +9 -5
  83. package/src/Prebuilt/components/Preview/PreviewJoin.jsx +20 -27
  84. package/src/Prebuilt/components/RaiseHand.jsx +27 -0
  85. package/src/Prebuilt/components/ScreenShare.jsx +1 -1
  86. package/src/Prebuilt/components/ScreenshareDisplay.jsx +2 -2
  87. package/src/Prebuilt/components/ScreenshareTile.jsx +2 -2
  88. package/src/Prebuilt/components/Settings/DeviceSettings.jsx +2 -1
  89. package/src/Prebuilt/components/Settings/LayoutSettings.jsx +1 -24
  90. package/src/Prebuilt/components/Settings/SettingsModal.jsx +152 -17
  91. package/src/Prebuilt/components/ShareMenuIcon.jsx +1 -0
  92. package/src/Prebuilt/components/TileMenu/TileMenu.jsx +133 -0
  93. package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +313 -0
  94. package/src/Prebuilt/components/VideoList.jsx +5 -33
  95. package/src/Prebuilt/components/VideoTile.jsx +30 -8
  96. package/src/Prebuilt/components/conference.jsx +14 -1
  97. package/src/Prebuilt/components/init/Init.jsx +0 -27
  98. package/src/Prebuilt/components/init/initUtils.js +0 -23
  99. package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +2 -1
  100. package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +1 -1
  101. package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +19 -8
  102. package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +1 -0
  103. package/src/Prebuilt/images/pdf-share.png +0 -0
  104. package/src/Prebuilt/images/screen-share.png +0 -0
  105. package/src/Prebuilt/index.ts +1 -0
  106. package/src/Prebuilt/layouts/EmbedView.jsx +0 -1
  107. package/src/Prebuilt/layouts/InsetView.jsx +65 -24
  108. package/src/Prebuilt/layouts/PDFView.jsx +0 -1
  109. package/src/Prebuilt/layouts/SidePane.jsx +8 -7
  110. package/src/Prebuilt/layouts/mainView.jsx +22 -31
  111. package/src/Prebuilt/layouts/screenShareView.jsx +0 -2
  112. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +25 -1
  113. package/src/Prebuilt/primitives/DialogContent.jsx +1 -1
  114. package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +1 -1
  115. package/src/Sheet/Sheet.mdx +19 -0
  116. package/src/Sheet/Sheet.stories.tsx +103 -0
  117. package/src/Sheet/Sheet.tsx +118 -0
  118. package/src/Sheet/index.ts +1 -0
  119. package/src/Theme/ThemeProvider.tsx +10 -13
  120. package/src/Theme/base.config.ts +1 -1
  121. package/src/Theme/stitches.config.ts +1 -1
  122. package/src/TileMenu/StyledMenuTile.tsx +2 -2
  123. package/src/TileMenu/TileMenu.tsx +2 -0
  124. package/src/VideoTile/StyledVideoTile.tsx +5 -0
  125. package/src/utils/animations.ts +18 -0
  126. package/dist/ActiveSpeakerView-V6O4K3BV.js +0 -39
  127. package/dist/ActiveSpeakerView-V6O4K3BV.js.map +0 -7
  128. package/dist/PinnedTrackView-7YQG4QKC.js +0 -70
  129. package/dist/PinnedTrackView-7YQG4QKC.js.map +0 -7
  130. package/dist/VirtualBackground-S3XEPZ2T.js.map +0 -7
  131. package/dist/chunk-42SWPN2C.js.map +0 -7
  132. package/dist/chunk-4NEZLVVH.js +0 -811
  133. package/dist/chunk-4NEZLVVH.js.map +0 -7
  134. package/dist/chunk-4ZBEFSRC.js +0 -58
  135. package/dist/chunk-4ZBEFSRC.js.map +0 -7
  136. package/dist/chunk-ESUJK7AT.js.map +0 -7
  137. package/dist/chunk-R6PDR5WZ.js +0 -243
  138. package/dist/chunk-R6PDR5WZ.js.map +0 -7
  139. package/dist/conference-7QKOMJPP.js +0 -3697
  140. package/dist/conference-7QKOMJPP.js.map +0 -7
  141. package/dist/transcription-RJA4V6PC.js +0 -356
  142. package/dist/transcription-RJA4V6PC.js.map +0 -7
  143. package/src/Prebuilt/common/useSortedPeers.js +0 -28
  144. package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +0 -96
  145. package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.stories.tsx +0 -46
  146. package/src/Prebuilt/components/Footer/ConferencingFooter.jsx +0 -101
  147. package/src/Prebuilt/components/Footer/StreamingFooter.jsx +0 -71
  148. package/src/Prebuilt/components/Footer.jsx +0 -8
  149. package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +0 -67
  150. package/src/Prebuilt/components/TileMenu.jsx +0 -268
  151. package/src/Prebuilt/index.d.ts +0 -20
  152. package/src/Prebuilt/index.js +0 -2
@@ -1,27 +1,20 @@
1
1
  import React, { Fragment, useEffect, useState } from 'react';
2
- import { selectLocalPeerID, useHMSStore, useVideoList } from '@100mslive/react-sdk';
2
+ import { useVideoList } from '@100mslive/react-sdk';
3
3
  import { useTheme } from '../../Theme';
4
4
  import { StyledVideoList } from '../../VideoList';
5
5
  import { Pagination } from './Pagination';
6
6
  import ScreenshareTile from './ScreenshareTile';
7
7
  import VideoTile from './VideoTile';
8
- import useSortedPeers from '../common/useSortedPeers';
9
8
  import { useAppConfig } from './AppData/useAppConfig';
10
- import { useIsHeadless, useUISettings } from './AppData/useUISettings';
11
- import { UI_SETTINGS } from '../common/constants';
9
+ import { useIsHeadless } from './AppData/useUISettings';
12
10
 
13
11
  const List = ({ maxTileCount, peers, maxColCount, maxRowCount, includeScreenShareForPeer }) => {
14
12
  const { aspectRatio } = useTheme();
15
13
  const tileOffset = useAppConfig('headlessConfig', 'tileOffset');
16
14
  const isHeadless = useIsHeadless();
17
- const hideLocalVideo = useUISettings(UI_SETTINGS.hideLocalVideo);
18
- const localPeerId = useHMSStore(selectLocalPeerID);
19
- let sortedPeers = useSortedPeers({ peers, maxTileCount });
20
- if (hideLocalVideo && sortedPeers.length > 1) {
21
- sortedPeers = filterPeerId(sortedPeers, localPeerId);
22
- }
15
+
23
16
  const { ref, pagesWithTiles } = useVideoList({
24
- peers: sortedPeers,
17
+ peers,
25
18
  maxTileCount,
26
19
  maxColCount,
27
20
  maxRowCount,
@@ -62,7 +55,7 @@ const List = ({ maxTileCount, peers, maxColCount, maxRowCount, includeScreenShar
62
55
  : null}
63
56
  </StyledVideoList.Container>
64
57
  {!isHeadless && pagesWithTiles.length > 1 ? (
65
- <Pagination page={page} setPage={setPage} numPages={pagesWithTiles.length} />
58
+ <Pagination page={page} onPageChange={setPage} numPages={pagesWithTiles.length} />
66
59
  ) : null}
67
60
  </StyledVideoList.Root>
68
61
  );
@@ -70,27 +63,6 @@ const List = ({ maxTileCount, peers, maxColCount, maxRowCount, includeScreenShar
70
63
 
71
64
  const VideoList = React.memo(List);
72
65
 
73
- /**
74
- * returns a new array of peers with the peer with peerId removed,
75
- * keeps the reference same if peer is not found
76
- */
77
- function filterPeerId(peers, peerId) {
78
- const oldPeers = peers; // to keep the reference same if peer is not found
79
- let foundPeerToFilterOut = false;
80
- peers = [];
81
- for (let i = 0; i < oldPeers.length; i++) {
82
- if (oldPeers[i].id === peerId) {
83
- foundPeerToFilterOut = true;
84
- } else {
85
- peers.push(oldPeers[i]);
86
- }
87
- }
88
- if (!foundPeerToFilterOut) {
89
- peers = oldPeers;
90
- }
91
- return peers;
92
- }
93
-
94
66
  const getOffset = ({ tileOffset, isHeadless }) => {
95
67
  if (!isHeadless || isNaN(Number(tileOffset))) {
96
68
  return 32;
@@ -1,4 +1,5 @@
1
1
  import React, { Fragment, useCallback, useMemo, useState } from 'react';
2
+ import { useMedia } from 'react-use';
2
3
  import {
3
4
  selectAudioTrackByPeerID,
4
5
  selectIsPeerAudioEnabled,
@@ -9,20 +10,32 @@ import {
9
10
  selectVideoTrackByPeerID,
10
11
  useHMSStore,
11
12
  } from '@100mslive/react-sdk';
12
- import { BrbIcon, HandRaiseFilledIcon, MicOffIcon } from '@100mslive/react-icons';
13
+ import { BrbTileIcon, HandIcon, MicOffIcon } from '@100mslive/react-icons';
13
14
  import TileConnection from './Connection/TileConnection';
15
+ import TileMenu from './TileMenu/TileMenu';
14
16
  import { useBorderAudioLevel } from '../../AudioLevel';
15
17
  import { Avatar } from '../../Avatar';
16
18
  import { VideoTileStats } from '../../Stats';
19
+ import { config as cssConfig } from '../../Theme';
17
20
  import { Video } from '../../Video';
18
21
  import { StyledVideoTile } from '../../VideoTile';
19
22
  import { getVideoTileLabel } from './peerTileUtils';
20
- import TileMenu from './TileMenu';
21
23
  import { useAppConfig } from './AppData/useAppConfig';
22
24
  import { useIsHeadless, useUISettings } from './AppData/useUISettings';
25
+ import { useShowStreamingUI } from '../common/hooks';
23
26
  import { UI_SETTINGS } from '../common/constants';
24
27
 
25
- const Tile = ({ peerId, trackId, width, height, objectFit = 'cover', rootCSS = {}, containerCSS = {} }) => {
28
+ const Tile = ({
29
+ peerId,
30
+ trackId,
31
+ width,
32
+ height,
33
+ objectFit = 'cover',
34
+ canMinimise = false,
35
+ isDragabble = false,
36
+ rootCSS = {},
37
+ containerCSS = {},
38
+ }) => {
26
39
  const trackSelector = trackId ? selectVideoTrackByID(trackId) : selectVideoTrackByPeerID(peerId);
27
40
  const track = useHMSStore(trackSelector);
28
41
  const peerName = useHMSStore(selectPeerNameByID(peerId));
@@ -38,6 +51,8 @@ const Tile = ({ peerId, trackId, width, height, objectFit = 'cover', rootCSS = {
38
51
  const borderAudioRef = useBorderAudioLevel(audioTrack?.id);
39
52
  const isVideoDegraded = track?.degraded;
40
53
  const isLocal = localPeerID === peerId;
54
+ const isMobile = useMedia(cssConfig.media.md);
55
+ const showStreamingUI = useShowStreamingUI();
41
56
  const label = getVideoTileLabel({
42
57
  peerName,
43
58
  track,
@@ -123,11 +138,18 @@ const Tile = ({ peerId, trackId, width, height, objectFit = 'cover', rootCSS = {
123
138
  <MicOffIcon />
124
139
  </StyledVideoTile.AudioIndicator>
125
140
  ) : null}
126
- {isMouseHovered && !isHeadless ? (
127
- <TileMenu peerID={peerId} audioTrackID={audioTrack?.id} videoTrackID={track?.id} />
141
+ {(isMouseHovered || isDragabble) && !isHeadless ? (
142
+ <TileMenu
143
+ peerID={peerId}
144
+ audioTrackID={audioTrack?.id}
145
+ videoTrackID={track?.id}
146
+ canMinimise={canMinimise}
147
+ />
128
148
  ) : null}
129
149
  <PeerMetadata peerId={peerId} />
130
- <TileConnection hideLabel={hideLabel} name={label} isTile peerId={peerId} width={width} />
150
+ {showStreamingUI && isMobile ? null : (
151
+ <TileConnection hideLabel={hideLabel} name={label} isTile peerId={peerId} width={width} />
152
+ )}
131
153
  </StyledVideoTile.Container>
132
154
  ) : null}
133
155
  </StyledVideoTile.Root>
@@ -145,12 +167,12 @@ const PeerMetadata = ({ peerId }) => {
145
167
  <Fragment>
146
168
  {isHandRaised ? (
147
169
  <StyledVideoTile.AttributeBox css={metaStyles} data-testid="raiseHand_icon_onTile">
148
- <HandRaiseFilledIcon width={40} height={40} />
170
+ <HandIcon width={24} height={24} />
149
171
  </StyledVideoTile.AttributeBox>
150
172
  ) : null}
151
173
  {isBRB ? (
152
174
  <StyledVideoTile.AttributeBox css={metaStyles} data-testid="brb_icon_onTile">
153
- <BrbIcon width={40} height={40} />
175
+ <BrbTileIcon width={24} height={24} />
154
176
  </StyledVideoTile.AttributeBox>
155
177
  ) : null}
156
178
  </Fragment>
@@ -9,11 +9,13 @@ import {
9
9
  useHMSActions,
10
10
  useHMSStore,
11
11
  } from '@100mslive/react-sdk';
12
+ import { Footer } from './Footer/Footer';
12
13
  import { HLSFailureModal } from './Notifications/HLSFailureModal';
14
+ import { ActivatedPIP } from './PIP/PIPComponent';
15
+ import { PictureInPicture } from './PIP/PIPManager';
13
16
  import { Box, Flex } from '../../Layout';
14
17
  import { useHMSPrebuiltContext } from '../AppContext';
15
18
  import { ConferenceMainView } from '../layouts/mainView';
16
- import { Footer } from './Footer';
17
19
  import FullPageProgress from './FullPageProgress';
18
20
  import { Header } from './Header';
19
21
  import { RoleChangeRequestModal } from './RoleChangeRequestModal';
@@ -106,6 +108,12 @@ const Conference = () => {
106
108
  }
107
109
  }, [isHeadless, hmsActions]);
108
110
 
111
+ useEffect(() => {
112
+ return () => {
113
+ PictureInPicture.stop().catch(error => console.error('stopping pip', error));
114
+ };
115
+ }, []);
116
+
109
117
  if (!isConnectedToRoom) {
110
118
  return <FullPageProgress loadingText="Joining..." />;
111
119
  }
@@ -137,7 +145,11 @@ const Conference = () => {
137
145
  w: '100%',
138
146
  flex: '1 1 0',
139
147
  minHeight: 0,
148
+ px: '$10',
140
149
  paddingBottom: 'env(safe-area-inset-bottom)',
150
+ '@lg': {
151
+ px: '$4',
152
+ },
141
153
  }}
142
154
  id="conferencing"
143
155
  data-testid="conferencing"
@@ -164,6 +176,7 @@ const Conference = () => {
164
176
  )}
165
177
  <RoleChangeRequestModal />
166
178
  <HLSFailureModal />
179
+ <ActivatedPIP />
167
180
  </Flex>
168
181
  );
169
182
  };
@@ -1,20 +1,8 @@
1
1
  import React, { useEffect } from 'react';
2
- import {
3
- selectLocalPeerID,
4
- selectLocalPeerName,
5
- selectLocalPeerRoleName,
6
- selectSessionId,
7
- useHMSStore,
8
- } from '@100mslive/react-sdk';
9
2
  import { useTheme } from '../../../';
10
- import { setUpZipy } from './initUtils';
11
3
  import { FeatureFlagsInit } from '../../services/FeatureFlags';
12
4
 
13
5
  const Init = () => {
14
- const localPeerID = useHMSStore(selectLocalPeerID);
15
- const localPeerRole = useHMSStore(selectLocalPeerRoleName);
16
- const localPeerName = useHMSStore(selectLocalPeerName);
17
- const sessionId = useHMSStore(selectSessionId);
18
6
  const { toggleTheme } = useTheme();
19
7
 
20
8
  useEffect(() => {
@@ -37,21 +25,6 @@ const Init = () => {
37
25
  };
38
26
  }, []);
39
27
 
40
- useEffect(() => {
41
- if (localPeerID && localPeerRole && localPeerName) {
42
- const peerData = {
43
- localPeer: {
44
- id: localPeerID,
45
- name: localPeerName,
46
- roleName: localPeerRole,
47
- },
48
- sessionId,
49
- };
50
- setUpZipy(peerData);
51
- }
52
- // eslint-disable-next-line
53
- }, [localPeerID, localPeerName, localPeerRole, sessionId]);
54
-
55
28
  return <FeatureFlagsInit />;
56
29
  };
57
30
 
@@ -1,26 +1,3 @@
1
- import { identify } from 'zipyai';
2
-
3
- const zipyKey = process.env.REACT_APP_ZIPY_KEY;
4
- export const setUpZipy = ({ localPeer, roomId, sessionId }) => {
5
- if (!zipyKey) {
6
- return;
7
- }
8
-
9
- let domain;
10
- if (typeof window !== 'undefined') {
11
- domain = window.location.hostname;
12
- }
13
-
14
- identify(localPeer.id, {
15
- firstName: localPeer.name,
16
- customerName: domain,
17
- email: domain,
18
- role: localPeer.roleName,
19
- sessionId,
20
- roomId,
21
- });
22
- };
23
-
24
1
  // interface RoleConfig {
25
2
  // center?: HMSRoleName[];
26
3
  // sidepane?: HMSRoleName[];
@@ -22,6 +22,7 @@ export function PDFFileOptions({ onOpenChange }) {
22
22
  w: 'min(420px,80%)',
23
23
  overflow: 'auto',
24
24
  p: '$10',
25
+ bg: '$surface_dim',
25
26
  }}
26
27
  >
27
28
  <Flex direction="column">
@@ -76,7 +77,7 @@ export function PDFFileOptions({ onOpenChange }) {
76
77
  onChange={e => {
77
78
  setPDFURL(e.target.value);
78
79
  }}
79
- placeholder="Add PDF URL"
80
+ placeholder="Paste PDF URL"
80
81
  type="text"
81
82
  error={!isPDFUrlValid}
82
83
  />
@@ -9,7 +9,7 @@ export const PDFInfo = () => {
9
9
  css={{
10
10
  px: '$8',
11
11
  py: '$3',
12
- bg: '$surface_bright',
12
+ bg: '$surface_default',
13
13
  r: '$1',
14
14
  outline: 'none',
15
15
  border: '1px solid $border_bright',
@@ -1,6 +1,8 @@
1
1
  import React, { Fragment, useState } from 'react';
2
2
  import { useScreenShare } from '@100mslive/react-sdk';
3
- import { PdfShare, ScreenShare, StarIcon, VerticalMenuIcon } from '@100mslive/react-icons';
3
+ import { StarIcon, VerticalMenuIcon } from '@100mslive/react-icons';
4
+ import PDFShareImg from './../../images/pdf-share.png';
5
+ import ScreenShareImg from './../../images/screen-share.png';
4
6
  import { Box, Button, Dropdown, Flex, IconButton, Text, Tooltip } from '../../../';
5
7
  import { ShareMenuIcon } from '../ShareMenuIcon';
6
8
  import { PDFFileOptions } from './pdfFileOptions';
@@ -28,7 +30,11 @@ export function ShareScreenOptions() {
28
30
  const { toggleScreenShare } = useScreenShare();
29
31
  return (
30
32
  <Fragment>
31
- <Dropdown.Root open={openModals.has(MODALS.SHARE)} onOpenChange={value => updateState(MODALS.SHARE, value)}>
33
+ <Dropdown.Root
34
+ open={openModals.has(MODALS.SHARE)}
35
+ onOpenChange={value => updateState(MODALS.SHARE, value)}
36
+ modal={false}
37
+ >
32
38
  <Dropdown.Trigger asChild data-testid="sharing_btn" disabled={amIScreenSharing}>
33
39
  <ShareMenuIcon disabled={amIScreenSharing}>
34
40
  <Tooltip title="Share">
@@ -44,6 +50,7 @@ export function ShareScreenOptions() {
44
50
  w: '$96',
45
51
  maxHeight: '$96',
46
52
  p: 0,
53
+ bg: '$surface_dim',
47
54
  }}
48
55
  >
49
56
  <Dropdown.Item
@@ -95,12 +102,14 @@ export function ShareScreenOptions() {
95
102
  pb: '0',
96
103
  }}
97
104
  >
98
- <ScreenShare
105
+ <img
106
+ src={ScreenShareImg}
107
+ alt="screen-share"
99
108
  width="100%"
100
109
  height="100%"
101
110
  style={{
102
- borderTopLeftRadius: '$0',
103
- borderTopRightRadius: '$0',
111
+ borderTopLeftRadius: '0.5rem', // TODO: create image component to solve for style hardcoding
112
+ borderTopRightRadius: '0.5rem',
104
113
  }}
105
114
  />
106
115
  </IconButton>
@@ -139,12 +148,14 @@ export function ShareScreenOptions() {
139
148
  pb: '0',
140
149
  }}
141
150
  >
142
- <PdfShare
151
+ <img
152
+ src={PDFShareImg}
153
+ alt="pdf-share"
143
154
  width="100%"
144
155
  height="100%"
145
156
  style={{
146
- borderTopLeftRadius: '$0',
147
- borderTopRightRadius: '$0',
157
+ borderTopLeftRadius: '0.5rem', // TODO: create image component to solve for style hardcoding
158
+ borderTopRightRadius: '0.5rem',
148
159
  }}
149
160
  />
150
161
  <Flex
@@ -25,6 +25,7 @@ export const UploadedFile = ({
25
25
  w: 'min(420px,80%)',
26
26
  overflow: 'auto',
27
27
  p: '$10',
28
+ bg: '$surface_dim',
28
29
  }}
29
30
  >
30
31
  <Flex direction="column">
@@ -0,0 +1 @@
1
+ export * from './App';
@@ -120,7 +120,6 @@ const EmbedComponent = () => {
120
120
  <Box
121
121
  ref={iframeRef}
122
122
  css={{
123
- mx: '$8',
124
123
  flex: '3 1 0',
125
124
  '@lg': {
126
125
  flex: '2 1 0',
@@ -1,11 +1,22 @@
1
1
  import React, { Fragment, useEffect, useRef } from 'react';
2
2
  import Draggable from 'react-draggable';
3
3
  import { useMedia } from 'react-use';
4
- import { selectAppData, selectLocalPeer, selectRemotePeers, selectRolesMap, useHMSStore } from '@100mslive/react-sdk';
4
+ import {
5
+ selectIsAllowedToPublish,
6
+ selectLocalPeer,
7
+ selectRemotePeers,
8
+ selectRolesMap,
9
+ useHMSStore,
10
+ } from '@100mslive/react-sdk';
11
+ import { ExpandIcon } from '@100mslive/react-icons';
12
+ import { AudioVideoToggle } from '../components/AudioVideoToggle';
5
13
  import { FirstPersonDisplay } from '../components/FirstPersonDisplay';
6
14
  import VideoTile from '../components/VideoTile';
7
15
  import { Box, Flex } from '../../Layout';
16
+ import { Text } from '../../Text';
8
17
  import { config as cssConfig } from '../../Theme';
18
+ import IconButton from '../IconButton';
19
+ import { useSetAppDataByKey } from '../components/AppData/useUISettings';
9
20
  import { useRolePreference } from '../components/hooks/useFeatures';
10
21
  import { APP_DATA } from '../common/constants';
11
22
 
@@ -152,20 +163,36 @@ export function InsetView() {
152
163
  );
153
164
  }
154
165
 
155
- const InsetTile = ({ isMobile, roleMap, isLandscape }) => {
166
+ const MinimisedTile = ({ setMinimised }) => {
167
+ return (
168
+ <Flex align="center" css={{ gap: '$6', r: '$1', bg: '$surface_default', p: '$4', color: '$on_surface_high' }}>
169
+ <AudioVideoToggle hideOptions={true} />
170
+ <Text>You</Text>
171
+ <IconButton
172
+ onClick={() => setMinimised(false)}
173
+ css={{ bg: 'transparent', border: 'transparent' }}
174
+ className="__cancel-drag-event"
175
+ >
176
+ <ExpandIcon />
177
+ </IconButton>
178
+ </Flex>
179
+ );
180
+ };
181
+
182
+ export const InsetTile = () => {
183
+ const isMobile = useMedia(cssConfig.media.md);
184
+ const isLandscape = useMedia(cssConfig.media.ls);
156
185
  const localPeer = useHMSStore(selectLocalPeer);
157
- const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
158
- const aspectRatio = getAspectRatio({
159
- roleMap,
160
- roleName: localPeer.roleName,
161
- isMobile,
162
- });
186
+ const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
187
+ const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
188
+ const aspectRatio = isMobile ? 9 / 16 : 16 / 9;
163
189
  let height = 180;
164
190
  let width = height * aspectRatio;
165
191
  if (isLandscape && width > 240) {
166
192
  width = 240;
167
193
  height = width / aspectRatio;
168
194
  }
195
+
169
196
  const nodeRef = useRef(null);
170
197
 
171
198
  useEffect(() => {
@@ -188,31 +215,45 @@ const InsetTile = ({ isMobile, roleMap, isLandscape }) => {
188
215
  };
189
216
  }, []);
190
217
 
218
+ if (!isAllowedToPublish.audio && !isAllowedToPublish.video) {
219
+ return null;
220
+ }
221
+
191
222
  return (
192
- <Draggable bounds="parent" nodeRef={nodeRef}>
223
+ <Draggable bounds="parent" nodeRef={nodeRef} cancel=".__cancel-drag-event">
193
224
  <Box
194
225
  ref={nodeRef}
195
226
  css={{
196
227
  position: 'absolute',
197
228
  bottom: 0,
198
- right: sidepane ? '$100' : '$10',
199
- mr: sidepane ? '$14' : 0,
200
- boxShadow: '0 0 8px 0 rgba(0,0,0,0.3)',
229
+ right: 0,
201
230
  zIndex: 10,
202
- aspectRatio: aspectRatio,
203
- h: height,
231
+ boxShadow: '0 0 8px 0 rgba(0,0,0,0.3)',
232
+ r: '$2',
233
+ ...(!minimised
234
+ ? {
235
+ aspectRatio: aspectRatio,
236
+ h: height,
237
+ }
238
+ : {}),
204
239
  }}
205
240
  >
206
- <VideoTile
207
- peerId={localPeer.id}
208
- trackid={localPeer.videoTrack}
209
- rootCSS={{
210
- size: '100%',
211
- padding: 0,
212
- }}
213
- width={width}
214
- height={height}
215
- />
241
+ {minimised ? (
242
+ <MinimisedTile setMinimised={setMinimised} />
243
+ ) : (
244
+ <VideoTile
245
+ peerId={localPeer.id}
246
+ trackid={localPeer.videoTrack}
247
+ rootCSS={{
248
+ size: '100%',
249
+ padding: 0,
250
+ }}
251
+ width={width}
252
+ height={height}
253
+ isDragabble={isMobile}
254
+ canMinimise
255
+ />
256
+ )}
216
257
  </Box>
217
258
  </Draggable>
218
259
  );
@@ -80,7 +80,6 @@ export const PDFEmbedComponent = () => {
80
80
  <Box
81
81
  ref={iframeRef}
82
82
  css={{
83
- mx: '$8',
84
83
  flex: '3 1 0',
85
84
  '@lg': {
86
85
  flex: '2 1 0',
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { selectAppData, useHMSStore } from '@100mslive/react-sdk';
3
3
  import { Chat } from '../components/Chat/Chat';
4
- import { ParticipantList } from '../components/Header/ParticipantList';
4
+ import { ParticipantList } from '../components/Footer/ParticipantList';
5
5
  import { StreamingLanding } from '../components/Streaming/StreamingLanding';
6
6
  import { Box } from '../../Layout';
7
7
  import { APP_DATA, SIDE_PANE_OPTIONS } from '../common/constants';
@@ -22,23 +22,24 @@ const SidePane = ({ css = {} }) => {
22
22
  return (
23
23
  <Box
24
24
  css={{
25
- position: 'absolute',
26
25
  w: '$100',
27
26
  h: '100%',
28
27
  p: '$10',
29
28
  bg: '$surface_default',
30
29
  r: '$1',
31
- top: 0,
32
- right: '$10',
33
- zIndex: 10,
34
- boxShadow: '$md',
30
+ ml: '$8',
31
+ flexShrink: 0,
32
+ position: 'relative',
35
33
  ...css,
36
34
  '@lg': {
37
35
  w: '100%',
36
+ h: '100%',
37
+ ml: 0,
38
38
  right: 0,
39
39
  position: 'fixed',
40
40
  bottom: 0,
41
- height: 'unset',
41
+ r: 0,
42
+ zIndex: 10,
42
43
  ...(css['@lg'] || {}),
43
44
  },
44
45
  }}