@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.
- package/dist/{HLSView-P57IRMAR.js → HLSView-HNVYG5VE.js} +309 -151
- package/dist/HLSView-HNVYG5VE.js.map +7 -0
- package/dist/Prebuilt/App.d.ts +3 -0
- package/dist/Prebuilt/AppContext.d.ts +13 -0
- package/dist/Prebuilt/common/PeersSorter.d.ts +21 -0
- 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 +4 -0
- package/dist/Prebuilt/components/Footer/Footer.d.ts +6 -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/Header.d.ts +2 -0
- package/dist/Prebuilt/components/Header/StreamActions.d.ts +11 -0
- package/dist/Prebuilt/components/InsetTile.d.ts +2 -0
- package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +8 -0
- package/dist/Prebuilt/components/Leave/EndSessionContent.d.ts +9 -0
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +2196 -0
- package/dist/Prebuilt/components/Leave/LeaveCard.d.ts +11 -0
- package/dist/Prebuilt/components/Leave/LeaveRoom.d.ts +5 -0
- package/dist/Prebuilt/components/Leave/LeaveSessionContent.d.ts +8 -0
- package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +8 -0
- package/dist/Prebuilt/components/MoreSettings/MoreSettings.d.ts +6 -0
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.d.ts +6 -0
- package/dist/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.d.ts +6 -0
- package/dist/Prebuilt/components/Pagination.d.ts +6 -0
- package/dist/Prebuilt/components/Preview/PreviewContainer.d.ts +3 -0
- package/dist/Prebuilt/components/Preview/PreviewForm.d.ts +10 -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 +3 -0
- package/dist/Prebuilt/components/VideoLayouts/EqualProminence.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/Grid.d.ts +6 -0
- package/dist/Prebuilt/components/VideoLayouts/GridLayout.d.ts +12 -0
- package/dist/Prebuilt/components/VideoLayouts/ProminenceLayout.d.ts +15 -0
- package/dist/Prebuilt/components/VideoLayouts/RoleProminence.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/ScreenshareLayout.d.ts +3 -0
- package/dist/Prebuilt/components/VideoLayouts/interface.d.ts +9 -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/useRoleProminencePeers.d.ts +5 -0
- package/dist/Prebuilt/components/hooks/useTileLayout.d.ts +13 -0
- package/dist/Prebuilt/components/hooks/useVideoTileLayout.d.ts +13 -0
- package/dist/Prebuilt/layouts/SidePane.d.ts +9 -0
- package/dist/Prebuilt/layouts/VideoStreamingSection.d.ts +7 -0
- package/dist/Prebuilt/plugins/whiteboard/ToggleWhiteboard.d.ts +5 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +1 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.d.ts +1 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.d.ts +17 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +6 -1
- package/dist/{VirtualBackground-GGCQJ5JM.js → VirtualBackground-UM2FOUHQ.js} +5 -11
- package/dist/VirtualBackground-UM2FOUHQ.js.map +7 -0
- package/dist/{chunk-P5X32KOD.js → chunk-364HP22I.js} +8 -5
- package/dist/chunk-364HP22I.js.map +7 -0
- package/dist/{chunk-OSM4QEQG.js → chunk-LYSAET4G.js} +3742 -5462
- package/dist/chunk-LYSAET4G.js.map +7 -0
- package/dist/chunk-POE7H4IE.js +898 -0
- package/dist/chunk-POE7H4IE.js.map +7 -0
- package/dist/conference-UWLJHMB2.js +5727 -0
- package/dist/conference-UWLJHMB2.js.map +7 -0
- package/dist/index.cjs.js +9655 -15326
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +2513 -3456
- package/dist/meta.esbuild.json +2807 -3838
- package/package.json +8 -7
- package/src/Button/Button.tsx +2 -2
- package/src/Prebuilt/App.tsx +58 -53
- package/src/Prebuilt/{AppContext.jsx → AppContext.tsx} +11 -3
- package/src/Prebuilt/IconButton.jsx +11 -0
- package/src/Prebuilt/Prebuilt.stories.tsx +1 -0
- package/src/Prebuilt/common/{PeersSorter.js → PeersSorter.ts} +16 -11
- package/src/Prebuilt/common/constants.js +4 -114
- package/src/Prebuilt/common/hooks.js +34 -1
- package/src/Prebuilt/common/utils.js +1 -9
- package/src/Prebuilt/components/AppData/AppData.jsx +11 -15
- package/src/Prebuilt/components/AppData/useUISettings.js +6 -10
- package/src/Prebuilt/components/AudioVideoToggle.jsx +10 -2
- package/src/Prebuilt/components/AuthToken.jsx +11 -42
- package/src/Prebuilt/components/Chat/Chat.jsx +75 -27
- package/src/Prebuilt/components/Chat/ChatBody.jsx +95 -36
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +199 -0
- package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +84 -0
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +16 -17
- package/src/Prebuilt/components/Chat/ChatSelectorContainer.jsx +81 -0
- 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.tsx +71 -0
- package/src/Prebuilt/components/EmojiReaction.jsx +19 -22
- package/src/Prebuilt/components/Footer/{ChatToggle.jsx → ChatToggle.tsx} +13 -9
- package/src/Prebuilt/components/Footer/Footer.tsx +98 -0
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +187 -179
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +94 -0
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +155 -0
- package/src/Prebuilt/components/FullPageProgress.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/Controls.jsx +3 -2
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +63 -18
- package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +2 -2
- package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +5 -6
- package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +38 -9
- package/src/Prebuilt/components/Header/{ConferencingHeader.jsx → Header.tsx} +9 -7
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +13 -4
- package/src/Prebuilt/components/Header/{StreamActions.jsx → StreamActions.tsx} +54 -67
- package/src/Prebuilt/components/Header/common.jsx +5 -2
- package/src/Prebuilt/components/Header/index.tsx +1 -0
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +23 -4
- package/src/Prebuilt/components/InsetTile.tsx +128 -0
- package/src/Prebuilt/components/{MoreSettings/SplitComponents/DesktopLeaveRoom.jsx → Leave/DesktopLeaveRoom.tsx} +67 -25
- package/src/Prebuilt/components/{EndSessionContent.jsx → Leave/EndSessionContent.tsx} +18 -11
- package/src/Prebuilt/components/Leave/LeaveAtoms.tsx +26 -0
- package/src/Prebuilt/components/Leave/LeaveCard.tsx +36 -0
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +66 -0
- package/src/Prebuilt/components/{LeaveSessionContent.jsx → Leave/LeaveSessionContent.tsx} +20 -6
- package/src/Prebuilt/components/{MoreSettings/SplitComponents/MwebLeaveRoom.jsx → Leave/MwebLeaveRoom.tsx} +43 -18
- package/src/Prebuilt/components/MetaActions.jsx +15 -23
- package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +5 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +16 -7
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +1 -1
- package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +1 -4
- package/src/Prebuilt/components/MoreSettings/MoreSettings.tsx +27 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +216 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/{MwebOptions.jsx → MwebOptions.tsx} +107 -45
- package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -1
- package/src/Prebuilt/components/Notifications/Notifications.jsx +46 -30
- package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +14 -2
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +10 -4
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +5 -11
- package/src/Prebuilt/components/PIP/PIPComponent.jsx +7 -16
- package/src/Prebuilt/components/PIP/PIPManager.js +1 -0
- package/src/Prebuilt/components/Pagination.tsx +60 -0
- package/src/Prebuilt/components/Playlist/Playlist.jsx +1 -6
- package/src/Prebuilt/components/PostLeave.jsx +7 -7
- package/src/Prebuilt/components/Preview/{PreviewContainer.jsx → PreviewContainer.tsx} +16 -15
- package/src/Prebuilt/components/Preview/{PreviewForm.jsx → PreviewForm.tsx} +16 -8
- package/src/Prebuilt/components/Preview/{PreviewJoin.jsx → PreviewJoin.tsx} +48 -22
- package/src/Prebuilt/components/RaiseHand.jsx +0 -7
- package/src/Prebuilt/components/RoleChangeRequestModal.tsx +119 -0
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +4 -10
- package/src/Prebuilt/components/ScreenshareTile.jsx +43 -36
- package/src/Prebuilt/components/SecondaryTiles.tsx +36 -0
- package/src/Prebuilt/components/Settings/LayoutSettings.jsx +2 -12
- package/src/Prebuilt/components/Settings/NotificationSettings.jsx +3 -9
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -9
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -1
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +16 -17
- package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +33 -27
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +58 -15
- package/src/Prebuilt/components/VideoLayouts/EqualProminence.tsx +65 -0
- package/src/Prebuilt/components/VideoLayouts/Grid.tsx +43 -0
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +110 -0
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +74 -0
- package/src/Prebuilt/components/VideoLayouts/RoleProminence.tsx +59 -0
- package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +52 -0
- package/src/Prebuilt/components/VideoLayouts/interface.ts +10 -0
- package/src/Prebuilt/components/VideoTile.jsx +116 -74
- package/src/Prebuilt/components/conference.jsx +86 -85
- package/src/Prebuilt/components/hooks/useAutoStartStreaming.tsx +57 -0
- package/src/Prebuilt/components/hooks/useMetadata.jsx +19 -3
- package/src/Prebuilt/components/hooks/useRedirectToLeave.tsx +34 -0
- package/src/Prebuilt/components/hooks/useRoleProminencePeers.tsx +38 -0
- package/src/Prebuilt/components/hooks/useTileLayout.tsx +127 -0
- package/src/Prebuilt/components/hooks/useVideoTileLayout.ts +26 -0
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +5 -72
- package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +4 -45
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +2 -17
- package/src/Prebuilt/components/peerTileUtils.jsx +1 -1
- package/src/Prebuilt/images/empty-chat.svg +12 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +17 -50
- package/src/Prebuilt/layouts/HLSView.jsx +138 -51
- package/src/Prebuilt/layouts/PDFView.jsx +1 -11
- package/src/Prebuilt/layouts/SidePane.tsx +108 -0
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +96 -0
- package/src/Prebuilt/layouts/WhiteboardView.jsx +10 -34
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +14 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -4
- package/src/Prebuilt/plugins/whiteboard/{ToggleWhiteboard.jsx → ToggleWhiteboard.tsx} +5 -9
- package/src/Prebuilt/primitives/DialogContent.jsx +15 -11
- package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +17 -2
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +36 -13
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useInsetEnabled.ts +10 -0
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +65 -0
- package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +17 -6
- package/src/Prebuilt/services/FeatureFlags.jsx +0 -1
- package/src/VideoTile/StyledVideoTile.tsx +1 -0
- package/dist/HLSView-P57IRMAR.js.map +0 -7
- package/dist/PinnedTrackView-4FYJEBTB.js +0 -102
- package/dist/PinnedTrackView-4FYJEBTB.js.map +0 -7
- package/dist/VirtualBackground-GGCQJ5JM.js.map +0 -7
- package/dist/chunk-IVTWKQI3.js +0 -827
- package/dist/chunk-IVTWKQI3.js.map +0 -7
- package/dist/chunk-OSM4QEQG.js.map +0 -7
- package/dist/chunk-P5X32KOD.js.map +0 -7
- package/dist/chunk-RVCZPPTL.js +0 -1100
- package/dist/chunk-RVCZPPTL.js.map +0 -7
- package/dist/conference-P6I6ESVF.js +0 -8995
- package/dist/conference-P6I6ESVF.js.map +0 -7
- package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +0 -16
- package/src/Prebuilt/components/Chat/ChatFooter.jsx +0 -150
- package/src/Prebuilt/components/Chat/ChatHeader.jsx +0 -67
- package/src/Prebuilt/components/Connection/TileConnection.jsx +0 -39
- package/src/Prebuilt/components/EqualProminence.jsx +0 -180
- package/src/Prebuilt/components/FirstPersonDisplay.jsx +0 -50
- package/src/Prebuilt/components/Footer/Footer.jsx +0 -73
- package/src/Prebuilt/components/Header/Header.jsx +0 -8
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +0 -54
- package/src/Prebuilt/components/LeaveCard.jsx +0 -19
- package/src/Prebuilt/components/LeaveRoom.jsx +0 -94
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +0 -10
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.jsx +0 -219
- package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +0 -25
- package/src/Prebuilt/components/Pagination.jsx +0 -29
- package/src/Prebuilt/components/RoleChangeRequestModal.jsx +0 -26
- package/src/Prebuilt/components/VideoList.jsx +0 -73
- package/src/Prebuilt/components/gridView.jsx +0 -85
- package/src/Prebuilt/components/hooks/useFeatures.js +0 -22
- package/src/Prebuilt/components/hooks/useNavigation.js +0 -19
- package/src/Prebuilt/components/hooks/useSkipPreview.jsx +0 -20
- package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +0 -29
- package/src/Prebuilt/images/Logo.svg +0 -8
- package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +0 -34
- package/src/Prebuilt/layouts/InsetView.jsx +0 -260
- package/src/Prebuilt/layouts/PinnedTrackView.jsx +0 -59
- package/src/Prebuilt/layouts/SidePane.jsx +0 -52
- package/src/Prebuilt/layouts/mainGridView.jsx +0 -98
- package/src/Prebuilt/layouts/mainView.jsx +0 -141
- package/src/Prebuilt/layouts/screenShareView.jsx +0 -183
- /package/{src/Prebuilt/components/Header/index.jsx → dist/Prebuilt/components/Header/index.d.ts} +0 -0
- /package/src/Prebuilt/components/{ScreenShare.jsx → ScreenShareToggle.jsx} +0 -0
- /package/src/{assets → Prebuilt/images}/android-perm-1.png +0 -0
- /package/src/{assets → Prebuilt/images}/ios-perm-0.png +0 -0
@@ -1,8 +1,8 @@
|
|
1
1
|
import React, { useEffect } from 'react';
|
2
|
-
import { useSearchParam } from 'react-use';
|
3
2
|
import {
|
4
3
|
HMSRoomState,
|
5
4
|
selectAvailableRoleNames,
|
5
|
+
selectFullAppData,
|
6
6
|
selectHLSState,
|
7
7
|
selectIsConnectedToRoom,
|
8
8
|
selectLocalPeerRoleName,
|
@@ -17,16 +17,11 @@ import { normalizeAppPolicyConfig } from '../init/initUtils';
|
|
17
17
|
import { UserPreferencesKeys, useUserPreferences } from '../hooks/useUserPreferences';
|
18
18
|
import { useIsSidepaneTypeOpen, useSidepaneReset, useSidepaneState, useSidepaneToggle } from './useSidepane';
|
19
19
|
import { useSetAppDataByKey } from './useUISettings';
|
20
|
-
import { getMetadata } from '../../common/utils';
|
21
20
|
import {
|
22
21
|
APP_DATA,
|
23
22
|
CHAT_SELECTOR,
|
24
|
-
DEFAULT_HLS_ROLE_KEY,
|
25
|
-
DEFAULT_HLS_VIEWER_ROLE,
|
26
23
|
DEFAULT_WAITING_VIEWER_ROLE,
|
27
|
-
QUERY_PARAM_VIEW_MODE,
|
28
24
|
SIDE_PANE_OPTIONS,
|
29
|
-
UI_MODE_ACTIVE_SPEAKER,
|
30
25
|
UI_MODE_GRID,
|
31
26
|
UI_SETTINGS,
|
32
27
|
} from '../../common/constants';
|
@@ -42,7 +37,6 @@ export const getAppDetails = appDetails => {
|
|
42
37
|
const initialAppData = {
|
43
38
|
[APP_DATA.uiSettings]: {
|
44
39
|
[UI_SETTINGS.isAudioOnly]: false,
|
45
|
-
[UI_SETTINGS.isHeadless]: false,
|
46
40
|
[UI_SETTINGS.maxTileCount]: 9,
|
47
41
|
[UI_SETTINGS.showStatsOnTiles]: false,
|
48
42
|
[UI_SETTINGS.enableAmbientMusic]: false,
|
@@ -66,11 +60,12 @@ const initialAppData = {
|
|
66
60
|
[APP_DATA.hlsStarted]: false,
|
67
61
|
[APP_DATA.rtmpStarted]: false,
|
68
62
|
[APP_DATA.recordingStarted]: false,
|
69
|
-
[APP_DATA.hlsViewerRole]: DEFAULT_HLS_VIEWER_ROLE,
|
70
63
|
[APP_DATA.waitingViewerRole]: DEFAULT_WAITING_VIEWER_ROLE,
|
71
64
|
[APP_DATA.dropdownList]: [],
|
72
65
|
[APP_DATA.authToken]: '',
|
73
66
|
[APP_DATA.minimiseInset]: false,
|
67
|
+
[APP_DATA.activeScreensharePeerId]: '',
|
68
|
+
[APP_DATA.disableNotificiations]: false,
|
74
69
|
};
|
75
70
|
|
76
71
|
export const AppData = React.memo(({ appDetails, tokenEndpoint }) => {
|
@@ -82,7 +77,7 @@ export const AppData = React.memo(({ appDetails, tokenEndpoint }) => {
|
|
82
77
|
const roleNames = useHMSStore(selectAvailableRoleNames);
|
83
78
|
const rolesMap = useHMSStore(selectRolesMap);
|
84
79
|
const localPeerRole = useHMSStore(selectLocalPeerRoleName);
|
85
|
-
const
|
80
|
+
const appData = useHMSStore(selectFullAppData);
|
86
81
|
|
87
82
|
useEffect(() => {
|
88
83
|
if (!isConnected && sidePane && sidePane !== SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
@@ -91,29 +86,30 @@ export const AppData = React.memo(({ appDetails, tokenEndpoint }) => {
|
|
91
86
|
}, [isConnected, sidePane, resetSidePane]);
|
92
87
|
|
93
88
|
useEffect(() => {
|
94
|
-
hmsActions.initAppData(
|
89
|
+
hmsActions.initAppData({
|
90
|
+
...initialAppData,
|
91
|
+
...appData,
|
92
|
+
});
|
95
93
|
hmsActions.setFrameworkInfo({
|
96
94
|
type: 'react-web',
|
97
95
|
isPrebuilt: true,
|
98
96
|
version: React.version,
|
99
97
|
});
|
98
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
100
99
|
}, [hmsActions]);
|
101
100
|
|
102
101
|
useEffect(() => {
|
103
102
|
const uiSettings = preferences || {};
|
104
103
|
const updatedSettings = {
|
105
104
|
...uiSettings,
|
106
|
-
[UI_SETTINGS.uiViewMode]:
|
107
|
-
? UI_MODE_ACTIVE_SPEAKER
|
108
|
-
: uiSettings.uiViewMode || UI_MODE_GRID,
|
105
|
+
[UI_SETTINGS.uiViewMode]: uiSettings.uiViewMode || UI_MODE_GRID,
|
109
106
|
};
|
110
107
|
hmsActions.setAppData(APP_DATA.uiSettings, updatedSettings, true);
|
111
|
-
}, [preferences,
|
108
|
+
}, [preferences, hmsActions]);
|
112
109
|
|
113
110
|
useEffect(() => {
|
114
111
|
const appData = {
|
115
112
|
[APP_DATA.tokenEndpoint]: tokenEndpoint,
|
116
|
-
[APP_DATA.hlsViewerRole]: getMetadata(appDetails)[DEFAULT_HLS_ROLE_KEY] || DEFAULT_HLS_VIEWER_ROLE,
|
117
113
|
[APP_DATA.appConfig]: getAppDetails(appDetails),
|
118
114
|
};
|
119
115
|
for (const key in appData) {
|
@@ -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,15 +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
|
-
export const useHLSViewerRole = () => {
|
55
|
-
return useHMSStore(selectAppData(APP_DATA.hlsViewerRole));
|
56
|
-
};
|
57
|
-
|
58
49
|
export const useWaitingViewerRole = () => {
|
59
50
|
return useHMSStore(selectAppData(APP_DATA.waitingViewerRole));
|
60
51
|
};
|
@@ -94,6 +85,11 @@ export const useSubscribedNotifications = notificationKey => {
|
|
94
85
|
return notificationPreference;
|
95
86
|
};
|
96
87
|
|
88
|
+
export const useIsNotificationDisabled = () => {
|
89
|
+
const notificationPreference = useHMSStore(selectAppDataByPath(APP_DATA.disableNotificiations));
|
90
|
+
return notificationPreference;
|
91
|
+
};
|
92
|
+
|
97
93
|
export const useSetSubscribedNotifications = notificationKey => {
|
98
94
|
const value = useSubscribedNotifications(notificationKey);
|
99
95
|
const setValue = useSetAppData({
|
@@ -67,14 +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 hasAudioDevices = audioInput?.length > 0;
|
71
|
+
const hasVideoDevices = videoInput?.length > 0;
|
70
72
|
|
71
73
|
return (
|
72
74
|
<Fragment>
|
73
75
|
{toggleAudio ? (
|
74
|
-
hideOptions ? (
|
76
|
+
hideOptions || !hasAudioDevices ? (
|
75
77
|
<Tooltip title={`Turn ${isLocalAudioEnabled ? 'off' : 'on'} audio (${isMacOS ? '⌘' : 'ctrl'} + d)`}>
|
76
78
|
<IconButton
|
77
79
|
active={isLocalAudioEnabled}
|
80
|
+
disabled={!toggleAudio}
|
78
81
|
onClick={toggleAudio}
|
79
82
|
key="toggleAudio"
|
80
83
|
data-testid="audio_btn"
|
@@ -90,6 +93,8 @@ export const AudioVideoToggle = ({ hideOptions = false }) => {
|
|
90
93
|
) : (
|
91
94
|
<IconButtonWithOptions
|
92
95
|
options={formattedAudioInputList}
|
96
|
+
disabled={!toggleAudio}
|
97
|
+
onDisabledClick={toggleAudio}
|
93
98
|
tooltipMessage={`Turn ${isLocalAudioEnabled ? 'off' : 'on'} audio (${isMacOS ? '⌘' : 'ctrl'} + d)`}
|
94
99
|
icon={
|
95
100
|
!isLocalAudioEnabled ? (
|
@@ -106,11 +111,12 @@ export const AudioVideoToggle = ({ hideOptions = false }) => {
|
|
106
111
|
) : null}
|
107
112
|
|
108
113
|
{toggleVideo ? (
|
109
|
-
hideOptions ? (
|
114
|
+
hideOptions || !hasVideoDevices ? (
|
110
115
|
<Tooltip title={`Turn ${isLocalVideoEnabled ? 'off' : 'on'} video (${isMacOS ? '⌘' : 'ctrl'} + e)`}>
|
111
116
|
<IconButton
|
112
117
|
key="toggleVideo"
|
113
118
|
active={isLocalVideoEnabled}
|
119
|
+
disabled={!toggleVideo}
|
114
120
|
onClick={toggleVideo}
|
115
121
|
data-testid="video_btn"
|
116
122
|
className="__cancel-drag-event"
|
@@ -124,6 +130,8 @@ export const AudioVideoToggle = ({ hideOptions = false }) => {
|
|
124
130
|
</Tooltip>
|
125
131
|
) : (
|
126
132
|
<IconButtonWithOptions
|
133
|
+
disabled={!toggleVideo}
|
134
|
+
onDisabledClick={toggleVideo}
|
127
135
|
options={formattedVideoInputList}
|
128
136
|
tooltipMessage={`Turn ${isLocalVideoEnabled ? 'off' : 'on'} video (${isMacOS ? '⌘' : 'ctrl'} + e)`}
|
129
137
|
icon={
|
@@ -1,14 +1,10 @@
|
|
1
|
-
import React, { useEffect,
|
2
|
-
import { matchPath, useLocation } from 'react-router-dom';
|
3
|
-
import { useSearchParam } from 'react-use';
|
4
|
-
import { v4 as uuid } from 'uuid';
|
1
|
+
import React, { useEffect, useState } from 'react';
|
5
2
|
import { useHMSActions } from '@100mslive/react-sdk';
|
6
3
|
import { styled } from '../../Theme';
|
7
4
|
import { useHMSPrebuiltContext } from '../AppContext';
|
8
5
|
import { ErrorDialog } from '../primitives/DialogContent';
|
9
6
|
import { useSetAppDataByKey, useTokenEndpoint } from './AppData/useUISettings';
|
10
|
-
import
|
11
|
-
import { APP_DATA, QUERY_PARAM_AUTH_TOKEN } from '../common/constants';
|
7
|
+
import { APP_DATA } from '../common/constants';
|
12
8
|
|
13
9
|
/**
|
14
10
|
* query params exposed -
|
@@ -19,20 +15,12 @@ import { APP_DATA, QUERY_PARAM_AUTH_TOKEN } from '../common/constants';
|
|
19
15
|
* auth_token=123 => uses the passed in token to join instead of fetching from token endpoint
|
20
16
|
* ui_mode=activespeaker => lands in active speaker mode after joining the room
|
21
17
|
*/
|
22
|
-
const AuthToken = React.memo(({ authTokenByRoomCodeEndpoint }) => {
|
18
|
+
const AuthToken = React.memo(({ authTokenByRoomCodeEndpoint, defaultAuthToken }) => {
|
23
19
|
const hmsActions = useHMSActions();
|
24
20
|
const tokenEndpoint = useTokenEndpoint();
|
25
|
-
const {
|
26
|
-
const location = useLocation();
|
27
|
-
const matches = useMemo(
|
28
|
-
() =>
|
29
|
-
matchPath(`${showPreview ? 'preview' : 'meeting'}/:roomId/:role`, location.pathname) ||
|
30
|
-
matchPath(`${showPreview ? 'preview' : 'meeting'}/:roomCode/`, location.pathname),
|
31
|
-
[location, showPreview],
|
32
|
-
);
|
33
|
-
const { roomCode: urlRoomCode, roomId: urlRoomId, role: userRole } = matches?.params || {};
|
21
|
+
const { roomCode, userId } = useHMSPrebuiltContext();
|
34
22
|
const [error, setError] = useState({ title: '', body: '' });
|
35
|
-
let authToken =
|
23
|
+
let authToken = defaultAuthToken;
|
36
24
|
const [, setAuthTokenInAppData] = useSetAppDataByKey(APP_DATA.authToken);
|
37
25
|
|
38
26
|
useEffect(() => {
|
@@ -40,34 +28,15 @@ const AuthToken = React.memo(({ authTokenByRoomCodeEndpoint }) => {
|
|
40
28
|
setAuthTokenInAppData(authToken);
|
41
29
|
return;
|
42
30
|
}
|
43
|
-
if (!tokenEndpoint && !
|
31
|
+
if (!tokenEndpoint && !roomCode) {
|
44
32
|
return;
|
45
33
|
}
|
46
|
-
const code = !userRole && (roomCode || urlRoomCode);
|
47
34
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
.then(token => {
|
54
|
-
setAuthTokenInAppData(token);
|
55
|
-
})
|
56
|
-
.catch(error => {
|
57
|
-
setError(convertError(error));
|
58
|
-
});
|
59
|
-
}, [
|
60
|
-
hmsActions,
|
61
|
-
tokenEndpoint,
|
62
|
-
urlRoomId,
|
63
|
-
urlRoomCode,
|
64
|
-
userRole,
|
65
|
-
authToken,
|
66
|
-
authTokenByRoomCodeEndpoint,
|
67
|
-
setAuthTokenInAppData,
|
68
|
-
roomCode,
|
69
|
-
userId,
|
70
|
-
]);
|
35
|
+
hmsActions
|
36
|
+
.getAuthTokenByRoomCode({ roomCode, userId }, { endpoint: authTokenByRoomCodeEndpoint })
|
37
|
+
.then(token => setAuthTokenInAppData(token))
|
38
|
+
.catch(error => setError(convertError(error)));
|
39
|
+
}, [hmsActions, tokenEndpoint, authToken, authTokenByRoomCodeEndpoint, setAuthTokenInAppData, roomCode, userId]);
|
71
40
|
|
72
41
|
if (error.title) {
|
73
42
|
return <ErrorDialog title={error.title}>{error.body}</ErrorDialog>;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
2
3
|
import {
|
3
4
|
HMSNotificationTypes,
|
4
5
|
selectHMSMessagesCount,
|
@@ -13,31 +14,37 @@ import { ChevronDownIcon, CrossIcon, PinIcon } from '@100mslive/react-icons';
|
|
13
14
|
import { Button } from '../../../Button';
|
14
15
|
import { Box, Flex } from '../../../Layout';
|
15
16
|
import { Text } from '../../../Text';
|
16
|
-
import
|
17
|
+
import { config as cssConfig } from '../../../Theme';
|
17
18
|
import { AnnotisedMessage, ChatBody } from './ChatBody';
|
18
19
|
import { ChatFooter } from './ChatFooter';
|
19
|
-
import {
|
20
|
+
import { ChatParticipantHeader } from './ChatParticipantHeader';
|
21
|
+
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
|
20
22
|
import { useSetSubscribedChatSelector } from '../AppData/useUISettings';
|
21
23
|
import { useSetPinnedMessage } from '../hooks/useSetPinnedMessage';
|
22
24
|
import { useUnreadCount } from './useUnreadCount';
|
23
25
|
import { CHAT_SELECTOR, SESSION_STORE_KEY } from '../../common/constants';
|
24
26
|
|
27
|
+
const PINNED_MESSAGE_LENGTH = 80;
|
28
|
+
|
25
29
|
const PinnedMessage = ({ clearPinnedMessage }) => {
|
26
30
|
const permissions = useHMSStore(selectPermissions);
|
27
31
|
const pinnedMessage = useHMSStore(selectSessionStore(SESSION_STORE_KEY.PINNED_MESSAGE));
|
32
|
+
const formattedPinnedMessage =
|
33
|
+
pinnedMessage?.length && pinnedMessage.length > PINNED_MESSAGE_LENGTH
|
34
|
+
? `${pinnedMessage.slice(0, PINNED_MESSAGE_LENGTH)}...`
|
35
|
+
: pinnedMessage;
|
28
36
|
|
29
37
|
return pinnedMessage ? (
|
30
38
|
<Flex
|
31
|
-
|
39
|
+
title={pinnedMessage}
|
40
|
+
css={{ p: '$4', color: '$on_surface_medium', bg: '$surface_default', r: '$1', gap: '$4', mb: '$8', mt: '$8' }}
|
32
41
|
align="center"
|
33
42
|
justify="between"
|
34
43
|
>
|
35
|
-
<
|
36
|
-
|
37
|
-
</Box>
|
44
|
+
<PinIcon />
|
45
|
+
|
38
46
|
<Box
|
39
47
|
css={{
|
40
|
-
ml: '$8',
|
41
48
|
color: '$on_surface_medium',
|
42
49
|
w: '100%',
|
43
50
|
maxHeight: '$18',
|
@@ -45,19 +52,22 @@ const PinnedMessage = ({ clearPinnedMessage }) => {
|
|
45
52
|
}}
|
46
53
|
>
|
47
54
|
<Text variant="sm">
|
48
|
-
<AnnotisedMessage message={
|
55
|
+
<AnnotisedMessage message={formattedPinnedMessage} />
|
49
56
|
</Text>
|
50
57
|
</Box>
|
51
58
|
{permissions.removeOthers && (
|
52
|
-
<
|
59
|
+
<Flex
|
60
|
+
onClick={() => clearPinnedMessage()}
|
61
|
+
css={{ cursor: 'pointer', color: '$on_surface_medium', '&:hover': { color: '$on_surface_high' } }}
|
62
|
+
>
|
53
63
|
<CrossIcon />
|
54
|
-
</
|
64
|
+
</Flex>
|
55
65
|
)}
|
56
66
|
</Flex>
|
57
67
|
) : null;
|
58
68
|
};
|
59
69
|
|
60
|
-
export const Chat = () => {
|
70
|
+
export const Chat = ({ screenType, hideControls = false }) => {
|
61
71
|
const notification = useHMSNotifications(HMSNotificationTypes.PEER_LEFT);
|
62
72
|
const [peerSelector, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER_ID);
|
63
73
|
const [roleSelector, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
@@ -71,6 +81,7 @@ export const Chat = () => {
|
|
71
81
|
const listRef = useRef(null);
|
72
82
|
const hmsActions = useHMSActions();
|
73
83
|
const { setPinnedMessage } = useSetPinnedMessage();
|
84
|
+
|
74
85
|
useEffect(() => {
|
75
86
|
if (notification && notification.data && peerSelector === notification.data.id) {
|
76
87
|
setPeerSelector('');
|
@@ -83,6 +94,14 @@ export const Chat = () => {
|
|
83
94
|
}, [notification, peerSelector, setPeerSelector]);
|
84
95
|
|
85
96
|
const storeMessageSelector = selectHMSMessagesCount;
|
97
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
98
|
+
const isMobile = useMedia(cssConfig.media.md);
|
99
|
+
|
100
|
+
let isScrolledToBottom = false;
|
101
|
+
if (listRef.current) {
|
102
|
+
const currentRef = listRef.current._outerRef;
|
103
|
+
isScrolledToBottom = currentRef.scrollHeight - currentRef.clientHeight - currentRef.scrollTop < 10;
|
104
|
+
}
|
86
105
|
|
87
106
|
const messagesCount = useHMSStore(storeMessageSelector) || 0;
|
88
107
|
const scrollToBottom = useCallback(
|
@@ -99,10 +118,34 @@ export const Chat = () => {
|
|
99
118
|
);
|
100
119
|
|
101
120
|
return (
|
102
|
-
<Flex
|
103
|
-
|
104
|
-
|
121
|
+
<Flex
|
122
|
+
direction="column"
|
123
|
+
css={{
|
124
|
+
size: '100%',
|
125
|
+
gap: '$4',
|
126
|
+
marginTop: hideControls && elements?.chat?.is_overlay ? '$17' : '0',
|
127
|
+
transition: 'margin 0.3s ease-in-out',
|
128
|
+
}}
|
129
|
+
>
|
130
|
+
{isMobile && elements?.chat?.is_overlay ? null : (
|
131
|
+
<>
|
132
|
+
<ChatParticipantHeader selectorOpen={isSelectorOpen} onToggle={() => setSelectorOpen(value => !value)} />
|
133
|
+
{elements?.chat?.allow_pinning_messages ? <PinnedMessage clearPinnedMessage={setPinnedMessage} /> : null}
|
134
|
+
</>
|
135
|
+
)}
|
136
|
+
|
137
|
+
<ChatBody
|
138
|
+
role={chatOptions.role}
|
139
|
+
peerId={chatOptions.peerId}
|
140
|
+
ref={listRef}
|
141
|
+
scrollToBottom={scrollToBottom}
|
142
|
+
screenType={screenType}
|
143
|
+
/>
|
144
|
+
<ChatFooter
|
145
|
+
role={chatOptions.role}
|
146
|
+
onSend={() => scrollToBottom(1)}
|
105
147
|
selection={chatOptions.selection}
|
148
|
+
screenType={screenType}
|
106
149
|
onSelect={({ role, peerId, selection }) => {
|
107
150
|
setChatOptions({
|
108
151
|
role,
|
@@ -112,17 +155,9 @@ export const Chat = () => {
|
|
112
155
|
setPeerSelector(peerId);
|
113
156
|
setRoleSelector(role);
|
114
157
|
}}
|
115
|
-
role={chatOptions.role}
|
116
158
|
peerId={chatOptions.peerId}
|
117
|
-
|
118
|
-
|
119
|
-
}}
|
120
|
-
/>
|
121
|
-
<PinnedMessage clearPinnedMessage={setPinnedMessage} />
|
122
|
-
|
123
|
-
<ChatBody role={chatOptions.role} peerId={chatOptions.peerId} ref={listRef} scrollToBottom={scrollToBottom} />
|
124
|
-
<ChatFooter role={chatOptions.role} peerId={chatOptions.peerId} onSend={() => scrollToBottom(1)}>
|
125
|
-
{!isSelectorOpen && (
|
159
|
+
>
|
160
|
+
{!isSelectorOpen && !isScrolledToBottom && (
|
126
161
|
<NewMessageIndicator role={chatOptions.role} peerId={chatOptions.peerId} scrollToBottom={scrollToBottom} />
|
127
162
|
)}
|
128
163
|
</ChatFooter>
|
@@ -146,13 +181,26 @@ const NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
146
181
|
}}
|
147
182
|
>
|
148
183
|
<Button
|
184
|
+
variant="standard"
|
149
185
|
onClick={() => {
|
150
186
|
scrollToBottom(unreadCount);
|
151
187
|
}}
|
152
|
-
|
188
|
+
icon
|
189
|
+
css={{
|
190
|
+
p: '$4',
|
191
|
+
pl: '$8',
|
192
|
+
pr: '$6',
|
193
|
+
'& > svg': { ml: '$4' },
|
194
|
+
borderRadius: '$round',
|
195
|
+
position: 'relative',
|
196
|
+
bottom: '$16',
|
197
|
+
fontSize: '$xs',
|
198
|
+
fontWeight: '$semiBold',
|
199
|
+
c: '$on_secondary_high',
|
200
|
+
}}
|
153
201
|
>
|
154
|
-
New
|
155
|
-
<ChevronDownIcon
|
202
|
+
New {unreadCount === 1 ? 'message' : 'messages'}
|
203
|
+
<ChevronDownIcon />
|
156
204
|
</Button>
|
157
205
|
</Flex>
|
158
206
|
);
|