@100mslive/roomkit-react 0.1.6-alpha.0 → 0.1.6-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HLSView-PY2FKWX3.js → HLSView-QMU5JK7U.js} +208 -118
- package/dist/HLSView-QMU5JK7U.js.map +7 -0
- package/dist/Prebuilt/AppContext.d.ts +1 -1
- package/dist/Prebuilt/components/Chat/ChatFooter.d.ts +7 -0
- package/dist/Prebuilt/components/Connection/ConnectionIndicator.d.ts +6 -0
- package/dist/Prebuilt/components/Connection/TileConnection.d.ts +10 -0
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +2 -0
- package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +14 -0
- package/dist/Prebuilt/components/Footer/RoleOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Header/StreamActions.d.ts +11 -0
- package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +4 -3
- package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +4 -3
- package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +1 -2
- package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +3 -1
- package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +4 -3
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +3 -0
- package/dist/Prebuilt/components/Preview/PreviewJoin.d.ts +16 -0
- package/dist/Prebuilt/components/RoleChangeRequestModal.d.ts +2 -0
- package/dist/Prebuilt/components/SecondaryTiles.d.ts +1 -1
- package/dist/Prebuilt/components/SidePaneTabs.d.ts +7 -0
- package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +1 -0
- package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +5 -3
- package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +6 -3
- package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +1 -1
- package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +1 -0
- package/dist/Prebuilt/components/hooks/useAutoStartStreaming.d.ts +1 -0
- package/dist/Prebuilt/components/hooks/useRedirectToLeave.d.ts +3 -0
- package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +2 -1
- package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +2 -0
- package/dist/Prebuilt/layouts/SidePane.d.ts +4 -1
- package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +2 -1
- package/dist/{VirtualBackground-AYDHYLIZ.js → VirtualBackground-37FXUPYO.js} +6 -6
- package/dist/VirtualBackground-37FXUPYO.js.map +7 -0
- package/dist/{chunk-GQD2AGWW.js → chunk-KBVIZGYW.js} +12 -2
- package/dist/{chunk-GQD2AGWW.js.map → chunk-KBVIZGYW.js.map} +2 -2
- package/dist/{chunk-RXTHJUMZ.js → chunk-WVGGQZK4.js} +986 -436
- package/dist/chunk-WVGGQZK4.js.map +7 -0
- package/dist/{chunk-E2M2ZSOL.js → chunk-ZKE2N5LH.js} +2 -2
- package/dist/{conference-V2XZGTKU.js → conference-FJJQ4TXX.js} +1136 -1301
- package/dist/conference-FJJQ4TXX.js.map +7 -0
- package/dist/index.cjs.js +3565 -3092
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +773 -525
- package/dist/meta.esbuild.json +833 -579
- package/package.json +8 -7
- package/src/Prebuilt/App.tsx +10 -21
- package/src/Prebuilt/AppContext.tsx +1 -1
- package/src/Prebuilt/IconButton.jsx +10 -0
- package/src/Prebuilt/common/PeersSorter.ts +1 -1
- package/src/Prebuilt/common/constants.js +1 -2
- package/src/Prebuilt/common/utils.js +1 -1
- package/src/Prebuilt/components/AppData/AppData.jsx +8 -2
- package/src/Prebuilt/components/AppData/useUISettings.js +6 -6
- package/src/Prebuilt/components/AudioVideoToggle.jsx +8 -6
- package/src/Prebuilt/components/Chat/Chat.jsx +24 -11
- package/src/Prebuilt/components/Chat/ChatBody.jsx +20 -21
- package/src/Prebuilt/components/Chat/{ChatFooter.jsx → ChatFooter.tsx} +38 -13
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +5 -4
- package/src/Prebuilt/components/Connection/{ConnectionIndicator.jsx → ConnectionIndicator.tsx} +12 -4
- package/src/Prebuilt/components/Connection/{TileConnection.jsx → TileConnection.tsx} +20 -6
- package/src/Prebuilt/components/EmojiReaction.jsx +2 -6
- package/src/Prebuilt/components/Footer/{ChatToggle.jsx → ChatToggle.tsx} +4 -1
- package/src/Prebuilt/components/Footer/Footer.tsx +30 -5
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +15 -49
- package/src/Prebuilt/components/Footer/{RoleAccordion.jsx → RoleAccordion.tsx} +33 -17
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +155 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +1 -0
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +39 -17
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +2 -2
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +5 -6
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +1 -1
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +8 -1
- package/src/Prebuilt/components/Header/{StreamActions.jsx → StreamActions.tsx} +23 -9
- package/src/Prebuilt/components/Header/common.jsx +5 -2
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +6 -1
- package/src/Prebuilt/components/InsetTile.tsx +15 -8
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +21 -11
- package/src/Prebuilt/components/Leave/EndSessionContent.tsx +2 -5
- package/src/Prebuilt/components/Leave/LeaveCard.tsx +1 -3
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +28 -25
- package/src/Prebuilt/components/Leave/LeaveSessionContent.tsx +8 -2
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +8 -8
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +4 -0
- package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +1 -1
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +9 -23
- package/src/Prebuilt/components/MoreSettings/SplitComponents/{MwebOptions.jsx → MwebOptions.tsx} +89 -28
- package/src/Prebuilt/components/Notifications/Notifications.jsx +44 -28
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +5 -11
- package/src/Prebuilt/components/Pagination.tsx +14 -12
- package/src/Prebuilt/components/Preview/{PreviewContainer.jsx → PreviewContainer.tsx} +11 -2
- package/src/Prebuilt/components/Preview/PreviewForm.tsx +6 -8
- package/src/Prebuilt/components/Preview/{PreviewJoin.jsx → PreviewJoin.tsx} +44 -21
- package/src/Prebuilt/components/{RoleChangeRequestModal.jsx → RoleChangeRequestModal.tsx} +36 -17
- package/src/Prebuilt/components/ScreenshareTile.jsx +6 -7
- package/src/Prebuilt/components/SecondaryTiles.tsx +12 -10
- package/src/Prebuilt/components/SidePaneTabs.tsx +120 -0
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +1 -1
- package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +14 -10
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +5 -4
- package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +13 -10
- package/src/Prebuilt/components/VideoLayouts/Grid.tsx +36 -34
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +33 -15
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +45 -31
- package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +12 -9
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +25 -9
- package/src/Prebuilt/components/VideoLayouts/interface.ts +1 -0
- package/src/Prebuilt/components/VideoTile.jsx +45 -53
- package/src/Prebuilt/components/conference.jsx +71 -74
- package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +57 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +19 -28
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +34 -0
- package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +1 -1
- package/src/Prebuilt/components/hooks/useTileLayout.tsx +24 -18
- package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +4 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +1 -11
- package/src/Prebuilt/layouts/HLSView.jsx +152 -82
- package/src/Prebuilt/layouts/SidePane.tsx +25 -11
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +11 -47
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +3 -3
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +2 -2
- package/src/Prebuilt/services/FeatureFlags.jsx +0 -1
- package/src/VideoTile/StyledVideoTile.tsx +1 -0
- package/dist/HLSView-PY2FKWX3.js.map +0 -7
- package/dist/VirtualBackground-AYDHYLIZ.js.map +0 -7
- package/dist/chunk-RXTHJUMZ.js.map +0 -7
- package/dist/conference-V2XZGTKU.js.map +0 -7
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +0 -16
- package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +0 -73
- package/src/Prebuilt/components/VideoList.jsx +0 -73
- /package/dist/{chunk-E2M2ZSOL.js.map → chunk-ZKE2N5LH.js.map} +0 -0
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"prebuilt",
|
|
11
11
|
"roomkit"
|
|
12
12
|
],
|
|
13
|
-
"version": "0.1.6-alpha.
|
|
13
|
+
"version": "0.1.6-alpha.2",
|
|
14
14
|
"author": "100ms",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"files": [
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"@types/lodash.merge": "^4.6.6",
|
|
63
63
|
"@types/mdx": "2.0.2",
|
|
64
64
|
"@types/react": "^18.1.0",
|
|
65
|
+
"@types/react-window": "^1.8.5",
|
|
65
66
|
"babel-loader": "^8.2.5",
|
|
66
67
|
"babel-plugin-react-require": "3.1.3",
|
|
67
68
|
"react": "^18.1.0",
|
|
@@ -75,11 +76,11 @@
|
|
|
75
76
|
"react": ">=17.0.2 <19.0.0"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
|
-
"@100mslive/hls-player": "0.1.15-alpha.
|
|
79
|
-
"@100mslive/hms-virtual-background": "1.11.15-alpha.
|
|
80
|
-
"@100mslive/react-icons": "0.8.15-alpha.
|
|
81
|
-
"@100mslive/react-sdk": "0.8.15-alpha.
|
|
82
|
-
"@100mslive/types-prebuilt": "0.
|
|
79
|
+
"@100mslive/hls-player": "0.1.15-alpha.2",
|
|
80
|
+
"@100mslive/hms-virtual-background": "1.11.15-alpha.2",
|
|
81
|
+
"@100mslive/react-icons": "0.8.15-alpha.2",
|
|
82
|
+
"@100mslive/react-sdk": "0.8.15-alpha.2",
|
|
83
|
+
"@100mslive/types-prebuilt": "0.12.0",
|
|
83
84
|
"@emoji-mart/data": "^1.0.6",
|
|
84
85
|
"@emoji-mart/react": "^1.0.1",
|
|
85
86
|
"@radix-ui/react-accordion": "1.0.0",
|
|
@@ -114,5 +115,5 @@
|
|
|
114
115
|
"uuid": "^8.3.2",
|
|
115
116
|
"worker-timers": "^7.0.40"
|
|
116
117
|
},
|
|
117
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "e9017621fb9f9594f985d47483ccab4bed324a35"
|
|
118
119
|
}
|
package/src/Prebuilt/App.tsx
CHANGED
|
@@ -13,8 +13,6 @@ import {
|
|
|
13
13
|
// @ts-ignore: No implicit Any
|
|
14
14
|
import { AppData } from './components/AppData/AppData';
|
|
15
15
|
// @ts-ignore: No implicit Any
|
|
16
|
-
import { BeamSpeakerLabelsLogging } from './components/AudioLevel/BeamSpeakerLabelsLogging';
|
|
17
|
-
// @ts-ignore: No implicit Any
|
|
18
16
|
import AuthToken from './components/AuthToken';
|
|
19
17
|
// @ts-ignore: No implicit Any
|
|
20
18
|
import { ErrorBoundary } from './components/ErrorBoundary';
|
|
@@ -40,6 +38,9 @@ import { HMSPrebuiltContext, useHMSPrebuiltContext } from './AppContext';
|
|
|
40
38
|
import { FlyingEmoji } from './plugins/FlyingEmoji';
|
|
41
39
|
// @ts-ignore: No implicit Any
|
|
42
40
|
import { RemoteStopScreenshare } from './plugins/RemoteStopScreenshare';
|
|
41
|
+
// @ts-ignore: No implicit Any
|
|
42
|
+
import { useIsNotificationDisabled } from './components/AppData/useUISettings';
|
|
43
|
+
import { useAutoStartStreaming } from './components/hooks/useAutoStartStreaming';
|
|
43
44
|
import {
|
|
44
45
|
useRoomLayoutLeaveScreen,
|
|
45
46
|
useRoomLayoutPreviewScreen,
|
|
@@ -76,16 +77,6 @@ export type HMSPrebuiltRefType = {
|
|
|
76
77
|
hmsNotifications: IHMSNotifications;
|
|
77
78
|
};
|
|
78
79
|
|
|
79
|
-
// TODO: remove now that there are options to change to portrait
|
|
80
|
-
const getAspectRatio = ({ width, height }: { width: number; height: number }) => {
|
|
81
|
-
const host = process.env.REACT_APP_HOST_NAME || '';
|
|
82
|
-
const portraitDomains = (process.env.REACT_APP_PORTRAIT_MODE_DOMAINS || '').split(',');
|
|
83
|
-
if (portraitDomains.includes(host) && width > height) {
|
|
84
|
-
return { width: height, height: width };
|
|
85
|
-
}
|
|
86
|
-
return { width, height };
|
|
87
|
-
};
|
|
88
|
-
|
|
89
80
|
export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps>(
|
|
90
81
|
(
|
|
91
82
|
{
|
|
@@ -102,9 +93,7 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps
|
|
|
102
93
|
},
|
|
103
94
|
ref,
|
|
104
95
|
) => {
|
|
105
|
-
const aspectRatio = '1-1';
|
|
106
96
|
const metadata = '';
|
|
107
|
-
const { 0: width, 1: height } = aspectRatio.split('-').map(el => parseInt(el));
|
|
108
97
|
const reactiveStore = useRef<HMSPrebuiltRefType>();
|
|
109
98
|
|
|
110
99
|
const [hydrated, setHydrated] = React.useState(false);
|
|
@@ -217,7 +206,6 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps
|
|
|
217
206
|
// no updates to the themes are fired if the name is same.
|
|
218
207
|
// TODO: cache the theme and do deep check to trigger name change in the theme
|
|
219
208
|
themeType={`${theme.name}-${Date.now()}`}
|
|
220
|
-
aspectRatio={getAspectRatio({ width, height })}
|
|
221
209
|
theme={{
|
|
222
210
|
//@ts-ignore: Prebuilt theme to match stiches theme
|
|
223
211
|
colors: theme.palette,
|
|
@@ -261,6 +249,7 @@ const Redirector = ({ showPreview }: { showPreview: boolean }) => {
|
|
|
261
249
|
const RouteList = () => {
|
|
262
250
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
|
263
251
|
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
|
252
|
+
useAutoStartStreaming();
|
|
264
253
|
return (
|
|
265
254
|
<Routes>
|
|
266
255
|
{isPreviewScreenEnabled ? (
|
|
@@ -268,7 +257,7 @@ const RouteList = () => {
|
|
|
268
257
|
<Route
|
|
269
258
|
path=":roomId/:role"
|
|
270
259
|
element={
|
|
271
|
-
<Suspense fallback={<FullPageProgress
|
|
260
|
+
<Suspense fallback={<FullPageProgress text="Loading preview..." />}>
|
|
272
261
|
<PreviewContainer />
|
|
273
262
|
</Suspense>
|
|
274
263
|
}
|
|
@@ -276,7 +265,7 @@ const RouteList = () => {
|
|
|
276
265
|
<Route
|
|
277
266
|
path=":roomId"
|
|
278
267
|
element={
|
|
279
|
-
<Suspense fallback={<FullPageProgress
|
|
268
|
+
<Suspense fallback={<FullPageProgress text="Loading preview..." />}>
|
|
280
269
|
<PreviewContainer />
|
|
281
270
|
</Suspense>
|
|
282
271
|
}
|
|
@@ -287,7 +276,7 @@ const RouteList = () => {
|
|
|
287
276
|
<Route
|
|
288
277
|
path=":roomId/:role"
|
|
289
278
|
element={
|
|
290
|
-
<Suspense fallback={<FullPageProgress
|
|
279
|
+
<Suspense fallback={<FullPageProgress text="Joining..." />}>
|
|
291
280
|
<Conference />
|
|
292
281
|
</Suspense>
|
|
293
282
|
}
|
|
@@ -295,7 +284,7 @@ const RouteList = () => {
|
|
|
295
284
|
<Route
|
|
296
285
|
path=":roomId"
|
|
297
286
|
element={
|
|
298
|
-
<Suspense fallback={<FullPageProgress
|
|
287
|
+
<Suspense fallback={<FullPageProgress text="Joining..." />}>
|
|
299
288
|
<Conference />
|
|
300
289
|
</Suspense>
|
|
301
290
|
}
|
|
@@ -350,16 +339,16 @@ function AppRoutes({
|
|
|
350
339
|
defaultAuthToken?: string;
|
|
351
340
|
}) {
|
|
352
341
|
const roomLayout = useRoomLayout();
|
|
342
|
+
const isNotificationsDisabled = useIsNotificationDisabled();
|
|
353
343
|
return (
|
|
354
344
|
<Router>
|
|
355
345
|
<>
|
|
356
346
|
<ToastContainer />
|
|
357
347
|
<Notifications />
|
|
358
348
|
<BackSwipe />
|
|
359
|
-
<FlyingEmoji />
|
|
349
|
+
{!isNotificationsDisabled && <FlyingEmoji />}
|
|
360
350
|
<RemoteStopScreenshare />
|
|
361
351
|
<KeyboardHandler />
|
|
362
|
-
<BeamSpeakerLabelsLogging />
|
|
363
352
|
<AuthToken authTokenByRoomCodeEndpoint={authTokenByRoomCodeEndpoint} defaultAuthToken={defaultAuthToken} />
|
|
364
353
|
{roomLayout && (
|
|
365
354
|
<Routes>
|
|
@@ -9,11 +9,21 @@ const IconButton = styled(BaseIconButton, {
|
|
|
9
9
|
r: '$1',
|
|
10
10
|
variants: {
|
|
11
11
|
active: {
|
|
12
|
+
true: {
|
|
13
|
+
color: '$on_surface_high',
|
|
14
|
+
backgroundColor: '$transparent',
|
|
15
|
+
},
|
|
12
16
|
false: {
|
|
13
17
|
border: '1px solid transparent',
|
|
14
18
|
color: '$on_primary_high',
|
|
15
19
|
},
|
|
16
20
|
},
|
|
21
|
+
disabled: {
|
|
22
|
+
true: {
|
|
23
|
+
backgroundColor: '$surface_brighter',
|
|
24
|
+
color: '$on_surface_low',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
17
27
|
},
|
|
18
28
|
});
|
|
19
29
|
|
|
@@ -60,7 +60,7 @@ class PeersSorter {
|
|
|
60
60
|
// delete to insert at beginning
|
|
61
61
|
this.lruPeers.delete(speaker.id);
|
|
62
62
|
const lruPeerArray = Array.from(this.lruPeers);
|
|
63
|
-
while (lruPeerArray.length >= this.tilesPerPage) {
|
|
63
|
+
while (lruPeerArray.length >= this.tilesPerPage && lruPeerArray.length) {
|
|
64
64
|
lruPeerArray.pop();
|
|
65
65
|
}
|
|
66
66
|
this.lruPeers = new Set([speaker.id, ...lruPeerArray]);
|
|
@@ -29,7 +29,6 @@ export const APP_DATA = {
|
|
|
29
29
|
appConfig: 'appConfig',
|
|
30
30
|
sidePane: 'sidePane',
|
|
31
31
|
hlsStats: 'hlsStats',
|
|
32
|
-
hlsViewerRole: 'hlsViewerRole',
|
|
33
32
|
waitingViewerRole: 'waitingViewerRole',
|
|
34
33
|
subscribedNotifications: 'subscribedNotifications',
|
|
35
34
|
logo: 'logo',
|
|
@@ -45,10 +44,10 @@ export const APP_DATA = {
|
|
|
45
44
|
pdfConfig: 'pdfConfig',
|
|
46
45
|
minimiseInset: 'minimiseInset',
|
|
47
46
|
activeScreensharePeerId: 'activeScreensharePeerId',
|
|
47
|
+
disableNotificiations: 'disableNotificiations',
|
|
48
48
|
};
|
|
49
49
|
export const UI_SETTINGS = {
|
|
50
50
|
isAudioOnly: 'isAudioOnly',
|
|
51
|
-
isHeadless: 'isHeadless',
|
|
52
51
|
maxTileCount: 'maxTileCount',
|
|
53
52
|
uiViewMode: 'uiViewMode',
|
|
54
53
|
showStatsOnTiles: 'showStatsOnTiles',
|
|
@@ -40,7 +40,7 @@ export const arrayIntersection = (a, b) => {
|
|
|
40
40
|
|
|
41
41
|
export const getMetadata = metadataString => {
|
|
42
42
|
try {
|
|
43
|
-
return metadataString
|
|
43
|
+
return !metadataString ? {} : JSON.parse(metadataString);
|
|
44
44
|
} catch (error) {
|
|
45
45
|
return {};
|
|
46
46
|
}
|
|
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
HMSRoomState,
|
|
4
4
|
selectAvailableRoleNames,
|
|
5
|
+
selectFullAppData,
|
|
5
6
|
selectHLSState,
|
|
6
7
|
selectIsConnectedToRoom,
|
|
7
8
|
selectLocalPeerRoleName,
|
|
@@ -36,7 +37,6 @@ export const getAppDetails = appDetails => {
|
|
|
36
37
|
const initialAppData = {
|
|
37
38
|
[APP_DATA.uiSettings]: {
|
|
38
39
|
[UI_SETTINGS.isAudioOnly]: false,
|
|
39
|
-
[UI_SETTINGS.isHeadless]: false,
|
|
40
40
|
[UI_SETTINGS.maxTileCount]: 9,
|
|
41
41
|
[UI_SETTINGS.showStatsOnTiles]: false,
|
|
42
42
|
[UI_SETTINGS.enableAmbientMusic]: false,
|
|
@@ -65,6 +65,7 @@ const initialAppData = {
|
|
|
65
65
|
[APP_DATA.authToken]: '',
|
|
66
66
|
[APP_DATA.minimiseInset]: false,
|
|
67
67
|
[APP_DATA.activeScreensharePeerId]: '',
|
|
68
|
+
[APP_DATA.disableNotificiations]: false,
|
|
68
69
|
};
|
|
69
70
|
|
|
70
71
|
export const AppData = React.memo(({ appDetails, tokenEndpoint }) => {
|
|
@@ -76,6 +77,7 @@ export const AppData = React.memo(({ appDetails, tokenEndpoint }) => {
|
|
|
76
77
|
const roleNames = useHMSStore(selectAvailableRoleNames);
|
|
77
78
|
const rolesMap = useHMSStore(selectRolesMap);
|
|
78
79
|
const localPeerRole = useHMSStore(selectLocalPeerRoleName);
|
|
80
|
+
const appData = useHMSStore(selectFullAppData);
|
|
79
81
|
|
|
80
82
|
useEffect(() => {
|
|
81
83
|
if (!isConnected && sidePane && sidePane !== SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
|
@@ -84,12 +86,16 @@ export const AppData = React.memo(({ appDetails, tokenEndpoint }) => {
|
|
|
84
86
|
}, [isConnected, sidePane, resetSidePane]);
|
|
85
87
|
|
|
86
88
|
useEffect(() => {
|
|
87
|
-
hmsActions.initAppData(
|
|
89
|
+
hmsActions.initAppData({
|
|
90
|
+
...initialAppData,
|
|
91
|
+
...appData,
|
|
92
|
+
});
|
|
88
93
|
hmsActions.setFrameworkInfo({
|
|
89
94
|
type: 'react-web',
|
|
90
95
|
isPrebuilt: true,
|
|
91
96
|
version: React.version,
|
|
92
97
|
});
|
|
98
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
93
99
|
}, [hmsActions]);
|
|
94
100
|
|
|
95
101
|
useEffect(() => {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useHMSVanillaStore,
|
|
12
12
|
} from '@100mslive/react-sdk';
|
|
13
13
|
import { UserPreferencesKeys, useUserPreferences } from '../hooks/useUserPreferences';
|
|
14
|
-
import { APP_DATA, SESSION_STORE_KEY
|
|
14
|
+
import { APP_DATA, SESSION_STORE_KEY } from '../../common/constants';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* fields saved related to UI settings in store's app data can be
|
|
@@ -46,11 +46,6 @@ export const useSetUiSettings = uiSettingKey => {
|
|
|
46
46
|
return [value, setValue];
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
export const useIsHeadless = () => {
|
|
50
|
-
const isHeadless = useUISettings(UI_SETTINGS.isHeadless);
|
|
51
|
-
return isHeadless;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
49
|
export const useWaitingViewerRole = () => {
|
|
55
50
|
return useHMSStore(selectAppData(APP_DATA.waitingViewerRole));
|
|
56
51
|
};
|
|
@@ -90,6 +85,11 @@ export const useSubscribedNotifications = notificationKey => {
|
|
|
90
85
|
return notificationPreference;
|
|
91
86
|
};
|
|
92
87
|
|
|
88
|
+
export const useIsNotificationDisabled = () => {
|
|
89
|
+
const notificationPreference = useHMSStore(selectAppDataByPath(APP_DATA.disableNotificiations));
|
|
90
|
+
return notificationPreference;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
93
|
export const useSetSubscribedNotifications = notificationKey => {
|
|
94
94
|
const value = useSubscribedNotifications(notificationKey);
|
|
95
95
|
const setValue = useSetAppData({
|
|
@@ -67,16 +67,17 @@ export const AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
67
67
|
const videoTrackId = useHMSStore(selectLocalVideoTrackID);
|
|
68
68
|
const localVideoTrack = useHMSStore(selectVideoTrackByID(videoTrackId));
|
|
69
69
|
const roomState = useHMSStore(selectRoomState);
|
|
70
|
-
const
|
|
71
|
-
const
|
|
70
|
+
const hasAudioDevices = audioInput?.length > 0;
|
|
71
|
+
const hasVideoDevices = videoInput?.length > 0;
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
74
|
<Fragment>
|
|
75
75
|
{toggleAudio ? (
|
|
76
|
-
hideOptions ? (
|
|
76
|
+
hideOptions || !hasAudioDevices ? (
|
|
77
77
|
<Tooltip title={`Turn ${isLocalAudioEnabled ? 'off' : 'on'} audio (${isMacOS ? '⌘' : 'ctrl'} + d)`}>
|
|
78
78
|
<IconButton
|
|
79
79
|
active={isLocalAudioEnabled}
|
|
80
|
+
disabled={!toggleAudio}
|
|
80
81
|
onClick={toggleAudio}
|
|
81
82
|
key="toggleAudio"
|
|
82
83
|
data-testid="audio_btn"
|
|
@@ -92,7 +93,7 @@ export const AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
92
93
|
) : (
|
|
93
94
|
<IconButtonWithOptions
|
|
94
95
|
options={formattedAudioInputList}
|
|
95
|
-
disabled={!
|
|
96
|
+
disabled={!toggleAudio}
|
|
96
97
|
onDisabledClick={toggleAudio}
|
|
97
98
|
tooltipMessage={`Turn ${isLocalAudioEnabled ? 'off' : 'on'} audio (${isMacOS ? '⌘' : 'ctrl'} + d)`}
|
|
98
99
|
icon={
|
|
@@ -110,11 +111,12 @@ export const AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
110
111
|
) : null}
|
|
111
112
|
|
|
112
113
|
{toggleVideo ? (
|
|
113
|
-
hideOptions ? (
|
|
114
|
+
hideOptions || !hasVideoDevices ? (
|
|
114
115
|
<Tooltip title={`Turn ${isLocalVideoEnabled ? 'off' : 'on'} video (${isMacOS ? '⌘' : 'ctrl'} + e)`}>
|
|
115
116
|
<IconButton
|
|
116
117
|
key="toggleVideo"
|
|
117
118
|
active={isLocalVideoEnabled}
|
|
119
|
+
disabled={!toggleVideo}
|
|
118
120
|
onClick={toggleVideo}
|
|
119
121
|
data-testid="video_btn"
|
|
120
122
|
className="__cancel-drag-event"
|
|
@@ -128,7 +130,7 @@ export const AudioVideoToggle = ({ hideOptions = false }) => {
|
|
|
128
130
|
</Tooltip>
|
|
129
131
|
) : (
|
|
130
132
|
<IconButtonWithOptions
|
|
131
|
-
disabled={!
|
|
133
|
+
disabled={!toggleVideo}
|
|
132
134
|
onDisabledClick={toggleVideo}
|
|
133
135
|
options={formattedVideoInputList}
|
|
134
136
|
tooltipMessage={`Turn ${isLocalVideoEnabled ? 'off' : 'on'} video (${isMacOS ? '⌘' : 'ctrl'} + e)`}
|
|
@@ -17,7 +17,7 @@ import { Text } from '../../../Text';
|
|
|
17
17
|
import { config as cssConfig } from '../../../Theme';
|
|
18
18
|
import { AnnotisedMessage, ChatBody } from './ChatBody';
|
|
19
19
|
import { ChatFooter } from './ChatFooter';
|
|
20
|
-
import {
|
|
20
|
+
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
|
21
21
|
import { useSetSubscribedChatSelector } from '../AppData/useUISettings';
|
|
22
22
|
import { useSetPinnedMessage } from '../hooks/useSetPinnedMessage';
|
|
23
23
|
import { useUnreadCount } from './useUnreadCount';
|
|
@@ -66,7 +66,7 @@ const PinnedMessage = ({ clearPinnedMessage }) => {
|
|
|
66
66
|
) : null;
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
export const Chat = ({ screenType }) => {
|
|
69
|
+
export const Chat = ({ screenType, hideControls = false }) => {
|
|
70
70
|
const notification = useHMSNotifications(HMSNotificationTypes.PEER_LEFT);
|
|
71
71
|
const [peerSelector, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER_ID);
|
|
72
72
|
const [roleSelector, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
|
@@ -76,10 +76,11 @@ export const Chat = ({ screenType }) => {
|
|
|
76
76
|
peerId: peerSelector && peerName ? peerSelector : '',
|
|
77
77
|
selection: roleSelector ? roleSelector : peerSelector && peerName ? peerName : 'Everyone',
|
|
78
78
|
});
|
|
79
|
-
const [isSelectorOpen
|
|
79
|
+
const [isSelectorOpen] = useState(false);
|
|
80
80
|
const listRef = useRef(null);
|
|
81
81
|
const hmsActions = useHMSActions();
|
|
82
82
|
const { setPinnedMessage } = useSetPinnedMessage();
|
|
83
|
+
|
|
83
84
|
useEffect(() => {
|
|
84
85
|
if (notification && notification.data && peerSelector === notification.data.id) {
|
|
85
86
|
setPeerSelector('');
|
|
@@ -92,8 +93,15 @@ export const Chat = ({ screenType }) => {
|
|
|
92
93
|
}, [notification, peerSelector, setPeerSelector]);
|
|
93
94
|
|
|
94
95
|
const storeMessageSelector = selectHMSMessagesCount;
|
|
96
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
|
95
97
|
const isMobile = useMedia(cssConfig.media.md);
|
|
96
98
|
|
|
99
|
+
let isScrolledToBottom = false;
|
|
100
|
+
if (listRef.current) {
|
|
101
|
+
const currentRef = listRef.current._outerRef;
|
|
102
|
+
isScrolledToBottom = currentRef.scrollHeight - currentRef.clientHeight - currentRef.scrollTop < 10;
|
|
103
|
+
}
|
|
104
|
+
|
|
97
105
|
const messagesCount = useHMSStore(storeMessageSelector) || 0;
|
|
98
106
|
const scrollToBottom = useCallback(
|
|
99
107
|
(unreadCount = 0) => {
|
|
@@ -109,13 +117,18 @@ export const Chat = ({ screenType }) => {
|
|
|
109
117
|
);
|
|
110
118
|
|
|
111
119
|
return (
|
|
112
|
-
<Flex
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
<Flex
|
|
121
|
+
direction="column"
|
|
122
|
+
css={{
|
|
123
|
+
size: '100%',
|
|
124
|
+
gap: '$4',
|
|
125
|
+
marginTop: hideControls && elements?.chat?.is_overlay ? '$17' : '0',
|
|
126
|
+
transition: 'margin 0.3s ease-in-out',
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
{isMobile && elements?.chat?.is_overlay ? null : (
|
|
130
|
+
<>{elements?.chat?.allow_pinning_messages ? <PinnedMessage clearPinnedMessage={setPinnedMessage} /> : null}</>
|
|
131
|
+
)}
|
|
119
132
|
|
|
120
133
|
<ChatBody
|
|
121
134
|
role={chatOptions.role}
|
|
@@ -140,7 +153,7 @@ export const Chat = ({ screenType }) => {
|
|
|
140
153
|
}}
|
|
141
154
|
peerId={chatOptions.peerId}
|
|
142
155
|
>
|
|
143
|
-
{!isSelectorOpen && (
|
|
156
|
+
{!isSelectorOpen && !isScrolledToBottom && (
|
|
144
157
|
<NewMessageIndicator role={chatOptions.role} peerId={chatOptions.peerId} scrollToBottom={scrollToBottom} />
|
|
145
158
|
)}
|
|
146
159
|
</ChatFooter>
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useHMSActions,
|
|
15
15
|
useHMSStore,
|
|
16
16
|
} from '@100mslive/react-sdk';
|
|
17
|
-
import {
|
|
17
|
+
import { PinIcon, VerticalMenuIcon } from '@100mslive/react-icons';
|
|
18
18
|
import { Dropdown } from '../../../Dropdown';
|
|
19
19
|
import { IconButton } from '../../../IconButton';
|
|
20
20
|
import { Box, Flex } from '../../../Layout';
|
|
@@ -22,7 +22,7 @@ import { Text } from '../../../Text';
|
|
|
22
22
|
import { config as cssConfig, styled } from '../../../Theme';
|
|
23
23
|
import { Tooltip } from '../../../Tooltip';
|
|
24
24
|
import emptyChat from '../../images/empty-chat.svg';
|
|
25
|
-
import {
|
|
25
|
+
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
|
26
26
|
import { useSetPinnedMessage } from '../hooks/useSetPinnedMessage';
|
|
27
27
|
|
|
28
28
|
const formatTime = date => {
|
|
@@ -126,10 +126,9 @@ const getMessageType = ({ roles, receiver }) => {
|
|
|
126
126
|
}
|
|
127
127
|
return receiver ? 'private' : '';
|
|
128
128
|
};
|
|
129
|
-
const ChatActions = ({ onPin, showPinAction
|
|
129
|
+
const ChatActions = ({ onPin, showPinAction }) => {
|
|
130
130
|
const [open, setOpen] = useState(false);
|
|
131
|
-
|
|
132
|
-
if (!isMobile && !showPinAction) {
|
|
131
|
+
if (!showPinAction) {
|
|
133
132
|
return null;
|
|
134
133
|
}
|
|
135
134
|
|
|
@@ -154,8 +153,7 @@ const ChatActions = ({ onPin, showPinAction, messageContent }) => {
|
|
|
154
153
|
Pin Message
|
|
155
154
|
</Text>
|
|
156
155
|
</Dropdown.Item>
|
|
157
|
-
{isMobile
|
|
158
|
-
{isMobile ? (
|
|
156
|
+
{/* {isMobile ? (
|
|
159
157
|
<Dropdown.Item
|
|
160
158
|
data-testid="copy_message_btn"
|
|
161
159
|
onClick={() => {
|
|
@@ -177,7 +175,7 @@ const ChatActions = ({ onPin, showPinAction, messageContent }) => {
|
|
|
177
175
|
Copy Message
|
|
178
176
|
</Text>
|
|
179
177
|
</Dropdown.Item>
|
|
180
|
-
) : null}
|
|
178
|
+
) : null} */}
|
|
181
179
|
</Dropdown.Content>
|
|
182
180
|
</Dropdown.Portal>
|
|
183
181
|
</Dropdown.Root>
|
|
@@ -203,7 +201,8 @@ const ChatMessage = React.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
|
203
201
|
}
|
|
204
202
|
}, [index, setRowHeight]);
|
|
205
203
|
const isMobile = useMedia(cssConfig.media.md);
|
|
206
|
-
|
|
204
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
|
205
|
+
const isOverlay = elements?.chat?.is_overlay && isMobile;
|
|
207
206
|
const hmsActions = useHMSActions();
|
|
208
207
|
const localPeerId = useHMSStore(selectLocalPeerID);
|
|
209
208
|
const permissions = useHMSStore(selectPermissions);
|
|
@@ -212,7 +211,7 @@ const ChatMessage = React.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
|
212
211
|
receiver: message.recipientPeer,
|
|
213
212
|
});
|
|
214
213
|
// show pin action only if peer has remove others permission and the message is of broadcast type
|
|
215
|
-
const showPinAction = permissions.removeOthers && !messageType;
|
|
214
|
+
const showPinAction = permissions.removeOthers && !messageType && elements?.chat?.allow_pinning_messages;
|
|
216
215
|
|
|
217
216
|
useEffect(() => {
|
|
218
217
|
if (message.id && !message.read && inView) {
|
|
@@ -233,7 +232,7 @@ const ChatMessage = React.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
|
233
232
|
css={{
|
|
234
233
|
flexWrap: 'wrap',
|
|
235
234
|
// Theme independent color, token should not be used for transparent chat
|
|
236
|
-
bg: messageType ? (
|
|
235
|
+
bg: messageType ? (isOverlay ? 'rgba(0, 0, 0, 0.64)' : '$surface_default') : undefined,
|
|
237
236
|
r: messageType ? '$1' : undefined,
|
|
238
237
|
px: messageType ? '$4' : '$2',
|
|
239
238
|
py: messageType ? '$4' : 0,
|
|
@@ -244,7 +243,7 @@ const ChatMessage = React.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
|
244
243
|
>
|
|
245
244
|
<Text
|
|
246
245
|
css={{
|
|
247
|
-
color: '$on_surface_high',
|
|
246
|
+
color: isOverlay ? '#FFF' : '$on_surface_high',
|
|
248
247
|
fontWeight: '$semiBold',
|
|
249
248
|
display: 'inline-flex',
|
|
250
249
|
alignItems: 'center',
|
|
@@ -255,23 +254,23 @@ const ChatMessage = React.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
|
255
254
|
>
|
|
256
255
|
<Flex align="baseline">
|
|
257
256
|
{message.senderName === 'You' || !message.senderName ? (
|
|
258
|
-
<SenderName as="span" variant="sm">
|
|
257
|
+
<SenderName as="span" variant="sm" css={{ color: isOverlay ? '#FFF' : '$on_surface_high' }}>
|
|
259
258
|
{message.senderName || 'Anonymous'}
|
|
260
259
|
</SenderName>
|
|
261
260
|
) : (
|
|
262
261
|
<Tooltip title={message.senderName} side="top" align="start">
|
|
263
|
-
<SenderName as="span" variant="sm">
|
|
262
|
+
<SenderName as="span" variant="sm" css={{ color: isOverlay ? '#FFF' : '$on_surface_high' }}>
|
|
264
263
|
{message.senderName}
|
|
265
264
|
</SenderName>
|
|
266
265
|
</Tooltip>
|
|
267
266
|
)}
|
|
268
|
-
{!
|
|
267
|
+
{!isOverlay ? (
|
|
269
268
|
<Text
|
|
270
269
|
as="span"
|
|
271
270
|
variant="xs"
|
|
272
271
|
css={{
|
|
273
272
|
ml: '$4',
|
|
274
|
-
color: '$
|
|
273
|
+
color: '$on_surface_medium',
|
|
275
274
|
flexShrink: 0,
|
|
276
275
|
}}
|
|
277
276
|
>
|
|
@@ -284,18 +283,17 @@ const ChatMessage = React.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
|
284
283
|
receiver={message.recipientPeer}
|
|
285
284
|
roles={message.recipientRoles}
|
|
286
285
|
/>
|
|
287
|
-
{!
|
|
288
|
-
<ChatActions onPin={onPin} showPinAction={showPinAction} messageContent={message.message} />
|
|
289
|
-
) : null}
|
|
286
|
+
{!isOverlay ? <ChatActions onPin={onPin} showPinAction={showPinAction} /> : null}
|
|
290
287
|
</Text>
|
|
291
288
|
<Text
|
|
292
|
-
variant="
|
|
289
|
+
variant="sm"
|
|
293
290
|
css={{
|
|
294
291
|
w: '100%',
|
|
295
292
|
mt: '$2',
|
|
296
293
|
wordBreak: 'break-word',
|
|
297
294
|
whiteSpace: 'pre-wrap',
|
|
298
295
|
userSelect: 'all',
|
|
296
|
+
color: isOverlay ? '#FFF' : '$on_surface_high',
|
|
299
297
|
}}
|
|
300
298
|
onClick={e => e.stopPropagation()}
|
|
301
299
|
>
|
|
@@ -395,8 +393,9 @@ export const ChatBody = React.forwardRef(({ role, peerId, scrollToBottom }, list
|
|
|
395
393
|
let messages = useHMSStore(storeMessageSelector);
|
|
396
394
|
messages = useMemo(() => messages?.filter(message => message.type === 'chat') || [], [messages]);
|
|
397
395
|
const isMobile = useMedia(cssConfig.media.md);
|
|
396
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
|
398
397
|
|
|
399
|
-
if (messages.length === 0 && !isMobile) {
|
|
398
|
+
if (messages.length === 0 && !(isMobile && elements?.chat?.is_overlay)) {
|
|
400
399
|
return (
|
|
401
400
|
<Flex
|
|
402
401
|
css={{
|