@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
package/dist/chunk-IVTWKQI3.js
DELETED
@@ -1,827 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
Avatar,
|
3
|
-
Button,
|
4
|
-
Dialog,
|
5
|
-
Input,
|
6
|
-
Sheet,
|
7
|
-
Slider,
|
8
|
-
StyledMenuTile,
|
9
|
-
StyledPagination,
|
10
|
-
StyledVideoList,
|
11
|
-
StyledVideoTile,
|
12
|
-
TileConnection_default,
|
13
|
-
ToastManager,
|
14
|
-
UserPreferencesKeys,
|
15
|
-
Video,
|
16
|
-
VideoTileStats,
|
17
|
-
useBorderAudioLevel,
|
18
|
-
useDropdownList,
|
19
|
-
useDropdownSelection,
|
20
|
-
useIsHeadless,
|
21
|
-
useSetAppDataByKey,
|
22
|
-
useShowStreamingUI,
|
23
|
-
useTheme,
|
24
|
-
useUISettings,
|
25
|
-
useUserPreferences
|
26
|
-
} from "./chunk-OSM4QEQG.js";
|
27
|
-
import {
|
28
|
-
APP_DATA,
|
29
|
-
Box,
|
30
|
-
FEATURE_LIST,
|
31
|
-
Flex,
|
32
|
-
REMOTE_STOP_SCREENSHARE_TYPE,
|
33
|
-
SESSION_STORE_KEY,
|
34
|
-
Text,
|
35
|
-
UI_SETTINGS,
|
36
|
-
__async,
|
37
|
-
__spreadProps,
|
38
|
-
__spreadValues,
|
39
|
-
config,
|
40
|
-
init_define_process_env,
|
41
|
-
useIsFeatureEnabled
|
42
|
-
} from "./chunk-RVCZPPTL.js";
|
43
|
-
|
44
|
-
// src/Prebuilt/components/VideoTile.jsx
|
45
|
-
init_define_process_env();
|
46
|
-
import React5, { Fragment as Fragment2, useCallback, useMemo, useState as useState3 } from "react";
|
47
|
-
import { useMedia as useMedia3 } from "react-use";
|
48
|
-
import {
|
49
|
-
selectAudioTrackByPeerID,
|
50
|
-
selectIsPeerAudioEnabled,
|
51
|
-
selectLocalPeerID as selectLocalPeerID2,
|
52
|
-
selectPeerMetadata,
|
53
|
-
selectPeerNameByID,
|
54
|
-
selectVideoTrackByID,
|
55
|
-
selectVideoTrackByPeerID as selectVideoTrackByPeerID2,
|
56
|
-
useHMSStore as useHMSStore5
|
57
|
-
} from "@100mslive/react-sdk";
|
58
|
-
import { BrbTileIcon, HandIcon, MicOffIcon as MicOffIcon2 } from "@100mslive/react-icons";
|
59
|
-
|
60
|
-
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
61
|
-
init_define_process_env();
|
62
|
-
import React4, { useState as useState2 } from "react";
|
63
|
-
import { useMedia as useMedia2 } from "react-use";
|
64
|
-
import {
|
65
|
-
selectLocalPeerID,
|
66
|
-
selectPeerByID,
|
67
|
-
selectPermissions as selectPermissions2,
|
68
|
-
selectTemplateAppData,
|
69
|
-
selectTrackByID as selectTrackByID2,
|
70
|
-
selectVideoTrackByPeerID,
|
71
|
-
useHMSStore as useHMSStore3,
|
72
|
-
useRemoteAVToggle as useRemoteAVToggle2
|
73
|
-
} from "@100mslive/react-sdk";
|
74
|
-
import { CrossIcon as CrossIcon2, VerticalMenuIcon } from "@100mslive/react-icons";
|
75
|
-
|
76
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
77
|
-
init_define_process_env();
|
78
|
-
import React2, { useState } from "react";
|
79
|
-
import { useMedia } from "react-use";
|
80
|
-
import { selectLocalPeerName, useHMSActions, useHMSStore } from "@100mslive/react-sdk";
|
81
|
-
|
82
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx
|
83
|
-
init_define_process_env();
|
84
|
-
import React from "react";
|
85
|
-
import { ChevronLeftIcon, CrossIcon } from "@100mslive/react-icons";
|
86
|
-
var ChangeNameContent = ({
|
87
|
-
changeName,
|
88
|
-
setCurrentName,
|
89
|
-
currentName,
|
90
|
-
localPeerName,
|
91
|
-
isMobile,
|
92
|
-
onExit,
|
93
|
-
onBackClick
|
94
|
-
}) => {
|
95
|
-
return /* @__PURE__ */ React.createElement(
|
96
|
-
"form",
|
97
|
-
{
|
98
|
-
onSubmit: (e) => __async(void 0, null, function* () {
|
99
|
-
e.preventDefault();
|
100
|
-
yield changeName();
|
101
|
-
})
|
102
|
-
},
|
103
|
-
/* @__PURE__ */ React.createElement(
|
104
|
-
Text,
|
105
|
-
{
|
106
|
-
variant: isMobile ? "md" : "lg",
|
107
|
-
css: {
|
108
|
-
color: "$on_surface_high",
|
109
|
-
fontWeight: "$semiBold",
|
110
|
-
display: "flex",
|
111
|
-
borderBottom: isMobile ? "1px solid $border_default" : "",
|
112
|
-
pb: "$6",
|
113
|
-
mb: "$8",
|
114
|
-
px: isMobile ? "$8" : ""
|
115
|
-
}
|
116
|
-
},
|
117
|
-
isMobile ? /* @__PURE__ */ React.createElement(ChevronLeftIcon, { onClick: onBackClick, style: { marginRight: "0.5rem" } }) : null,
|
118
|
-
"Change Name",
|
119
|
-
/* @__PURE__ */ React.createElement(Box, { css: { color: "inherit", ml: "auto" }, onClick: onExit }, /* @__PURE__ */ React.createElement(CrossIcon, null))
|
120
|
-
),
|
121
|
-
/* @__PURE__ */ React.createElement(Flex, { justify: "center", align: "center", css: { my: "$8", w: "100%", px: isMobile ? "$8" : "" } }, /* @__PURE__ */ React.createElement(
|
122
|
-
Input,
|
123
|
-
{
|
124
|
-
css: { width: "100%", bg: "$surface_default" },
|
125
|
-
value: currentName,
|
126
|
-
onChange: (e) => {
|
127
|
-
setCurrentName(e.target.value);
|
128
|
-
},
|
129
|
-
autoComplete: "name",
|
130
|
-
required: true,
|
131
|
-
"data-testid": "change_name_field",
|
132
|
-
onKeyDown: (e) => __async(void 0, null, function* () {
|
133
|
-
if (e.key === "Enter" && currentName.trim().length > 0 && currentName !== localPeerName) {
|
134
|
-
e.preventDefault();
|
135
|
-
changeName();
|
136
|
-
}
|
137
|
-
})
|
138
|
-
}
|
139
|
-
)),
|
140
|
-
/* @__PURE__ */ React.createElement(
|
141
|
-
Flex,
|
142
|
-
{
|
143
|
-
justify: "between",
|
144
|
-
align: "center",
|
145
|
-
css: {
|
146
|
-
width: "100%",
|
147
|
-
gap: "$md",
|
148
|
-
mt: "$10",
|
149
|
-
px: isMobile ? "$4" : ""
|
150
|
-
}
|
151
|
-
},
|
152
|
-
isMobile ? null : /* @__PURE__ */ React.createElement(
|
153
|
-
Button,
|
154
|
-
{
|
155
|
-
variant: "standard",
|
156
|
-
css: { w: "100%" },
|
157
|
-
outlined: true,
|
158
|
-
type: "submit",
|
159
|
-
disabled: !localPeerName,
|
160
|
-
onClick: onExit
|
161
|
-
},
|
162
|
-
"Cancel"
|
163
|
-
),
|
164
|
-
/* @__PURE__ */ React.createElement(
|
165
|
-
Button,
|
166
|
-
{
|
167
|
-
variant: "primary",
|
168
|
-
css: { width: "100%" },
|
169
|
-
type: "submit",
|
170
|
-
disabled: !currentName.trim() || currentName.trim() === localPeerName,
|
171
|
-
"data-testid": "popup_change_btn"
|
172
|
-
},
|
173
|
-
"Change"
|
174
|
-
)
|
175
|
-
)
|
176
|
-
);
|
177
|
-
};
|
178
|
-
|
179
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
180
|
-
var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
181
|
-
const [previewPreference, setPreviewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW);
|
182
|
-
const hmsActions = useHMSActions();
|
183
|
-
const localPeerName = useHMSStore(selectLocalPeerName);
|
184
|
-
const [currentName, setCurrentName] = useState(localPeerName);
|
185
|
-
const isMobile = useMedia(config.media.md);
|
186
|
-
const changeName = () => __async(void 0, null, function* () {
|
187
|
-
const name = currentName.trim();
|
188
|
-
if (!name || name === localPeerName) {
|
189
|
-
return;
|
190
|
-
}
|
191
|
-
try {
|
192
|
-
yield hmsActions.changeName(name);
|
193
|
-
setPreviewPreference(__spreadProps(__spreadValues({}, previewPreference || {}), {
|
194
|
-
name
|
195
|
-
}));
|
196
|
-
} catch (error) {
|
197
|
-
console.error("failed to update name", error);
|
198
|
-
ToastManager.addToast({ title: error.message });
|
199
|
-
} finally {
|
200
|
-
onOpenChange(false);
|
201
|
-
}
|
202
|
-
});
|
203
|
-
const props = {
|
204
|
-
changeName,
|
205
|
-
setCurrentName,
|
206
|
-
currentName,
|
207
|
-
localPeerName,
|
208
|
-
isMobile,
|
209
|
-
onExit: () => onOpenChange(false),
|
210
|
-
onBackClick: () => {
|
211
|
-
onOpenChange(false);
|
212
|
-
openParentSheet();
|
213
|
-
}
|
214
|
-
};
|
215
|
-
if (isMobile) {
|
216
|
-
return /* @__PURE__ */ React2.createElement(Sheet.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React2.createElement(Sheet.Content, { css: { bg: "$surface_dim", py: "$8", px: 0 } }, /* @__PURE__ */ React2.createElement(ChangeNameContent, __spreadValues({}, props))));
|
217
|
-
}
|
218
|
-
return /* @__PURE__ */ React2.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React2.createElement(Dialog.Portal, null, /* @__PURE__ */ React2.createElement(Dialog.Overlay, null), /* @__PURE__ */ React2.createElement(Dialog.Content, { css: { bg: "$surface_dim", width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React2.createElement(ChangeNameContent, __spreadValues({}, props)))));
|
219
|
-
};
|
220
|
-
|
221
|
-
// src/Prebuilt/components/TileMenu/TileMenuContent.jsx
|
222
|
-
init_define_process_env();
|
223
|
-
import React3, { Fragment } from "react";
|
224
|
-
import {
|
225
|
-
selectPermissions,
|
226
|
-
selectSessionStore,
|
227
|
-
selectTrackByID,
|
228
|
-
useCustomEvent,
|
229
|
-
useHMSActions as useHMSActions2,
|
230
|
-
useHMSStore as useHMSStore2,
|
231
|
-
useRemoteAVToggle
|
232
|
-
} from "@100mslive/react-sdk";
|
233
|
-
import {
|
234
|
-
MicOffIcon,
|
235
|
-
MicOnIcon,
|
236
|
-
PencilIcon,
|
237
|
-
PinIcon,
|
238
|
-
RemoveUserIcon,
|
239
|
-
ShareScreenIcon,
|
240
|
-
ShrinkIcon,
|
241
|
-
SpeakerIcon,
|
242
|
-
StarIcon,
|
243
|
-
VideoOffIcon,
|
244
|
-
VideoOnIcon
|
245
|
-
} from "@100mslive/react-icons";
|
246
|
-
var isSameTile = ({ trackId, videoTrackID, audioTrackID }) => trackId && (videoTrackID && videoTrackID === trackId || audioTrackID && audioTrackID === trackId);
|
247
|
-
var spacingCSS = { "@md": { my: "$8", fontWeight: "$semiBold", fontSize: "sm" } };
|
248
|
-
var SpotlightActions = ({
|
249
|
-
peerId,
|
250
|
-
onSpotLightClick = () => {
|
251
|
-
return;
|
252
|
-
}
|
253
|
-
}) => {
|
254
|
-
const hmsActions = useHMSActions2();
|
255
|
-
const spotlightPeerId = useHMSStore2(selectSessionStore(SESSION_STORE_KEY.SPOTLIGHT));
|
256
|
-
const isTileSpotlighted = spotlightPeerId === peerId;
|
257
|
-
const setSpotlightPeerId = (peer) => hmsActions.sessionStore.set(SESSION_STORE_KEY.SPOTLIGHT, peer).catch((err) => ToastManager.addToast({ title: err.description }));
|
258
|
-
return /* @__PURE__ */ React3.createElement(
|
259
|
-
StyledMenuTile.ItemButton,
|
260
|
-
{
|
261
|
-
css: spacingCSS,
|
262
|
-
onClick: () => {
|
263
|
-
if (isTileSpotlighted) {
|
264
|
-
setSpotlightPeerId();
|
265
|
-
} else {
|
266
|
-
setSpotlightPeerId(peerId);
|
267
|
-
}
|
268
|
-
onSpotLightClick();
|
269
|
-
}
|
270
|
-
},
|
271
|
-
/* @__PURE__ */ React3.createElement(StarIcon, null),
|
272
|
-
/* @__PURE__ */ React3.createElement("span", null, isTileSpotlighted ? "Remove from Spotlight" : "Spotlight Tile for everyone")
|
273
|
-
);
|
274
|
-
};
|
275
|
-
var PinActions = ({ audioTrackID, videoTrackID }) => {
|
276
|
-
const [pinnedTrackId, setPinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
277
|
-
const isTilePinned = isSameTile({
|
278
|
-
trackId: pinnedTrackId,
|
279
|
-
videoTrackID,
|
280
|
-
audioTrackID
|
281
|
-
});
|
282
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
283
|
-
StyledMenuTile.ItemButton,
|
284
|
-
{
|
285
|
-
css: spacingCSS,
|
286
|
-
onClick: () => isTilePinned ? setPinnedTrackId() : setPinnedTrackId(videoTrackID || audioTrackID)
|
287
|
-
},
|
288
|
-
/* @__PURE__ */ React3.createElement(PinIcon, null),
|
289
|
-
/* @__PURE__ */ React3.createElement("span", null, isTilePinned ? "Unpin" : "Pin", " Tile for myself")
|
290
|
-
));
|
291
|
-
};
|
292
|
-
var MinimiseInset = () => {
|
293
|
-
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
294
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(StyledMenuTile.ItemButton, { css: spacingCSS, onClick: () => setMinimised(!minimised) }, /* @__PURE__ */ React3.createElement(ShrinkIcon, null), /* @__PURE__ */ React3.createElement("span", null, minimised ? "Show" : "Minimise", " your video")));
|
295
|
-
};
|
296
|
-
var SimulcastLayers = ({ trackId }) => {
|
297
|
-
var _a;
|
298
|
-
const track = useHMSStore2(selectTrackByID(trackId));
|
299
|
-
const actions = useHMSActions2();
|
300
|
-
const bg = useDropdownSelection();
|
301
|
-
if (!((_a = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _a.length) || track.degraded || !track.enabled) {
|
302
|
-
return null;
|
303
|
-
}
|
304
|
-
const currentLayer = track.layerDefinitions.find((layer) => layer.layer === track.layer);
|
305
|
-
return /* @__PURE__ */ React3.createElement(Fragment, null, /* @__PURE__ */ React3.createElement(StyledMenuTile.ItemButton, { css: { color: "$on_surface_medium", cursor: "default" } }, "Select maximum resolution"), track.layerDefinitions.map((layer) => {
|
306
|
-
return /* @__PURE__ */ React3.createElement(
|
307
|
-
StyledMenuTile.ItemButton,
|
308
|
-
{
|
309
|
-
key: layer.layer,
|
310
|
-
onClick: () => __async(void 0, null, function* () {
|
311
|
-
yield actions.setPreferredLayer(trackId, layer.layer);
|
312
|
-
}),
|
313
|
-
css: {
|
314
|
-
justifyContent: "space-between",
|
315
|
-
bg: track.preferredLayer === layer.layer ? bg : void 0,
|
316
|
-
"&:hover": {
|
317
|
-
bg: track.preferredLayer === layer.layer ? bg : void 0
|
318
|
-
}
|
319
|
-
}
|
320
|
-
},
|
321
|
-
/* @__PURE__ */ React3.createElement(
|
322
|
-
Text,
|
323
|
-
{
|
324
|
-
as: "span",
|
325
|
-
css: {
|
326
|
-
textTransform: "capitalize",
|
327
|
-
mr: "$2",
|
328
|
-
fontWeight: track.preferredLayer === layer.layer ? "$semiBold" : "$regular"
|
329
|
-
}
|
330
|
-
},
|
331
|
-
layer.layer
|
332
|
-
),
|
333
|
-
/* @__PURE__ */ React3.createElement(Text, { as: "span", variant: "xs", css: { color: "$on_surface_medium" } }, layer.resolution.width, "x", layer.resolution.height)
|
334
|
-
);
|
335
|
-
}), /* @__PURE__ */ React3.createElement(StyledMenuTile.ItemButton, null, /* @__PURE__ */ React3.createElement(Text, { as: "span", variant: "xs", css: { color: "$on_surface_medium" } }, "Currently streaming:", /* @__PURE__ */ React3.createElement(
|
336
|
-
Text,
|
337
|
-
{
|
338
|
-
as: "span",
|
339
|
-
variant: "xs",
|
340
|
-
css: {
|
341
|
-
fontWeight: "$semiBold",
|
342
|
-
textTransform: "capitalize",
|
343
|
-
color: "$on_surface_medium",
|
344
|
-
ml: "$2"
|
345
|
-
}
|
346
|
-
},
|
347
|
-
currentLayer ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, track.layer, " (", currentLayer.resolution.width, "x", currentLayer.resolution.height, ")") : "-"
|
348
|
-
))));
|
349
|
-
};
|
350
|
-
var TileMenuContent = (props) => {
|
351
|
-
const actions = useHMSActions2();
|
352
|
-
const { removeOthers } = useHMSStore2(selectPermissions);
|
353
|
-
const {
|
354
|
-
videoTrackID,
|
355
|
-
audioTrackID,
|
356
|
-
isLocal,
|
357
|
-
isScreenshare,
|
358
|
-
showSpotlight,
|
359
|
-
showPinAction,
|
360
|
-
peerID,
|
361
|
-
canMinimise,
|
362
|
-
closeSheetOnClick = () => {
|
363
|
-
return;
|
364
|
-
},
|
365
|
-
openNameChangeModal = () => {
|
366
|
-
return;
|
367
|
-
}
|
368
|
-
} = props;
|
369
|
-
const { isAudioEnabled, isVideoEnabled, setVolume, toggleAudio, toggleVideo, volume } = useRemoteAVToggle(
|
370
|
-
audioTrackID,
|
371
|
-
videoTrackID
|
372
|
-
);
|
373
|
-
const { sendEvent } = useCustomEvent({
|
374
|
-
type: REMOTE_STOP_SCREENSHARE_TYPE
|
375
|
-
});
|
376
|
-
const isChangeNameEnabled = useIsFeatureEnabled(FEATURE_LIST.CHANGE_NAME);
|
377
|
-
return isLocal ? (showPinAction || canMinimise) && /* @__PURE__ */ React3.createElement(React3.Fragment, null, showPinAction && /* @__PURE__ */ React3.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React3.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() }), canMinimise && /* @__PURE__ */ React3.createElement(MinimiseInset, null), isChangeNameEnabled ? /* @__PURE__ */ React3.createElement(
|
378
|
-
StyledMenuTile.ItemButton,
|
379
|
-
{
|
380
|
-
onClick: () => {
|
381
|
-
openNameChangeModal();
|
382
|
-
closeSheetOnClick();
|
383
|
-
}
|
384
|
-
},
|
385
|
-
/* @__PURE__ */ React3.createElement(PencilIcon, null),
|
386
|
-
/* @__PURE__ */ React3.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold" } }, "Change Name")
|
387
|
-
) : null) : /* @__PURE__ */ React3.createElement(React3.Fragment, null, toggleVideo ? /* @__PURE__ */ React3.createElement(
|
388
|
-
StyledMenuTile.ItemButton,
|
389
|
-
{
|
390
|
-
css: spacingCSS,
|
391
|
-
onClick: () => {
|
392
|
-
toggleVideo();
|
393
|
-
closeSheetOnClick();
|
394
|
-
},
|
395
|
-
"data-testid": isVideoEnabled ? "mute_video_participant_btn" : "unmute_video_participant_btn"
|
396
|
-
},
|
397
|
-
isVideoEnabled ? /* @__PURE__ */ React3.createElement(VideoOnIcon, null) : /* @__PURE__ */ React3.createElement(VideoOffIcon, null),
|
398
|
-
/* @__PURE__ */ React3.createElement("span", null, isVideoEnabled ? "Mute" : "Request Unmute")
|
399
|
-
) : null, toggleAudio ? /* @__PURE__ */ React3.createElement(
|
400
|
-
StyledMenuTile.ItemButton,
|
401
|
-
{
|
402
|
-
css: spacingCSS,
|
403
|
-
onClick: () => {
|
404
|
-
toggleAudio();
|
405
|
-
closeSheetOnClick();
|
406
|
-
},
|
407
|
-
"data-testid": isVideoEnabled ? "mute_audio_participant_btn" : "unmute_audio_participant_btn"
|
408
|
-
},
|
409
|
-
isAudioEnabled ? /* @__PURE__ */ React3.createElement(MicOnIcon, null) : /* @__PURE__ */ React3.createElement(MicOffIcon, null),
|
410
|
-
/* @__PURE__ */ React3.createElement("span", null, isAudioEnabled ? "Mute" : "Request Unmute")
|
411
|
-
) : null, audioTrackID ? /* @__PURE__ */ React3.createElement(StyledMenuTile.VolumeItem, { "data-testid": "participant_volume_slider", css: __spreadProps(__spreadValues({}, spacingCSS), { mb: "$0" }) }, /* @__PURE__ */ React3.createElement(Flex, { align: "center", gap: 1 }, /* @__PURE__ */ React3.createElement(SpeakerIcon, null), /* @__PURE__ */ React3.createElement(Box, { as: "span", css: { ml: "$4" } }, "Volume (", volume, ")")), /* @__PURE__ */ React3.createElement(Slider, { css: { my: "0.5rem" }, step: 5, value: [volume], onValueChange: (e) => setVolume(e[0]) })) : null, showPinAction && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React3.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() })), /* @__PURE__ */ React3.createElement(SimulcastLayers, { trackId: videoTrackID }), removeOthers ? /* @__PURE__ */ React3.createElement(
|
412
|
-
StyledMenuTile.RemoveItem,
|
413
|
-
{
|
414
|
-
css: __spreadProps(__spreadValues({}, spacingCSS), { borderTop: "none" }),
|
415
|
-
onClick: () => __async(void 0, null, function* () {
|
416
|
-
try {
|
417
|
-
yield actions.removePeer(peerID, "");
|
418
|
-
} catch (error) {
|
419
|
-
}
|
420
|
-
closeSheetOnClick();
|
421
|
-
}),
|
422
|
-
"data-testid": "remove_participant_btn"
|
423
|
-
},
|
424
|
-
/* @__PURE__ */ React3.createElement(RemoveUserIcon, null),
|
425
|
-
/* @__PURE__ */ React3.createElement("span", null, "Remove Participant")
|
426
|
-
) : null, removeOthers && isScreenshare ? /* @__PURE__ */ React3.createElement(
|
427
|
-
StyledMenuTile.RemoveItem,
|
428
|
-
{
|
429
|
-
onClick: () => {
|
430
|
-
sendEvent({});
|
431
|
-
closeSheetOnClick();
|
432
|
-
},
|
433
|
-
css: spacingCSS
|
434
|
-
},
|
435
|
-
/* @__PURE__ */ React3.createElement(ShareScreenIcon, null),
|
436
|
-
/* @__PURE__ */ React3.createElement("span", null, "Stop Screenshare")
|
437
|
-
) : null);
|
438
|
-
};
|
439
|
-
|
440
|
-
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
441
|
-
var TileMenu = ({ audioTrackID, videoTrackID, peerID, isScreenshare = false, canMinimise }) => {
|
442
|
-
var _a, _b;
|
443
|
-
const [open, setOpen] = useState2(false);
|
444
|
-
const { theme } = useTheme();
|
445
|
-
const localPeerID = useHMSStore3(selectLocalPeerID);
|
446
|
-
const isLocal = localPeerID === peerID;
|
447
|
-
const { removeOthers, changeRole } = useHMSStore3(selectPermissions2);
|
448
|
-
const { setVolume, toggleAudio, toggleVideo } = useRemoteAVToggle2(audioTrackID, videoTrackID);
|
449
|
-
const showSpotlight = changeRole;
|
450
|
-
const isPrimaryVideoTrack = ((_a = useHMSStore3(selectVideoTrackByPeerID(peerID))) == null ? void 0 : _a.id) === videoTrackID;
|
451
|
-
const uiMode = useHMSStore3(selectTemplateAppData).uiMode;
|
452
|
-
const isInset = uiMode === "inset";
|
453
|
-
const isPinEnabled = useIsFeatureEnabled(FEATURE_LIST.PIN_TILE);
|
454
|
-
const showPinAction = isPinEnabled && (audioTrackID || videoTrackID && isPrimaryVideoTrack) && !isInset;
|
455
|
-
const track = useHMSStore3(selectTrackByID2(videoTrackID));
|
456
|
-
const hideSimulcastLayers = !((_b = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _b.length) || track.degraded || !track.enabled;
|
457
|
-
const isMobile = useMedia2(config.media.md);
|
458
|
-
const peer = useHMSStore3(selectPeerByID(peerID));
|
459
|
-
const [showNameChangeModal, setShowNameChangeModal] = useState2(false);
|
460
|
-
useDropdownList({ open, name: "TileMenu" });
|
461
|
-
if (!(removeOthers || toggleAudio || toggleVideo || setVolume || showPinAction) && hideSimulcastLayers) {
|
462
|
-
return null;
|
463
|
-
}
|
464
|
-
if (isInset && isLocal) {
|
465
|
-
return null;
|
466
|
-
}
|
467
|
-
const openNameChangeModal = () => setShowNameChangeModal(true);
|
468
|
-
const props = {
|
469
|
-
isLocal,
|
470
|
-
isScreenshare,
|
471
|
-
audioTrackID,
|
472
|
-
videoTrackID,
|
473
|
-
peerID,
|
474
|
-
isPrimaryVideoTrack,
|
475
|
-
showSpotlight,
|
476
|
-
showPinAction,
|
477
|
-
canMinimise,
|
478
|
-
openNameChangeModal
|
479
|
-
};
|
480
|
-
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(StyledMenuTile.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React4.createElement(
|
481
|
-
StyledMenuTile.Trigger,
|
482
|
-
{
|
483
|
-
"data-testid": "participant_menu_btn",
|
484
|
-
css: { bg: `${theme.colors.background_dim.value}A3` },
|
485
|
-
onClick: (e) => e.stopPropagation(),
|
486
|
-
className: isMobile ? "__cancel-drag-event" : ""
|
487
|
-
},
|
488
|
-
/* @__PURE__ */ React4.createElement(VerticalMenuIcon, { width: 20, height: 20 })
|
489
|
-
), isMobile ? /* @__PURE__ */ React4.createElement(Sheet.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React4.createElement(Sheet.Content, { css: { bg: "$surface_dim", pt: "$8" } }, /* @__PURE__ */ React4.createElement(
|
490
|
-
Flex,
|
491
|
-
{
|
492
|
-
css: {
|
493
|
-
color: "$on_surface_high",
|
494
|
-
display: "flex",
|
495
|
-
w: "100%",
|
496
|
-
justifyContent: "space-between",
|
497
|
-
alignItems: "center",
|
498
|
-
px: "$10",
|
499
|
-
pb: "$8",
|
500
|
-
borderBottom: "1px solid $border_default"
|
501
|
-
}
|
502
|
-
},
|
503
|
-
/* @__PURE__ */ React4.createElement(Box, null, /* @__PURE__ */ React4.createElement(Text, { css: { color: "$on_surface_high", fontWeight: "$semiBold" } }, peer.name, isLocal ? ` (You)` : null), (peer == null ? void 0 : peer.roleName) ? /* @__PURE__ */ React4.createElement(Text, { variant: "xs", css: { color: "$on_surface_low", mt: "$2" } }, peer.roleName) : null),
|
504
|
-
/* @__PURE__ */ React4.createElement(Sheet.Close, { css: { color: "inherit" } }, /* @__PURE__ */ React4.createElement(CrossIcon2, null))
|
505
|
-
), /* @__PURE__ */ React4.createElement(Box, { css: { px: "$8", pb: "$10" } }, /* @__PURE__ */ React4.createElement(TileMenuContent, __spreadProps(__spreadValues({}, props), { closeSheetOnClick: () => setOpen(false) }))))) : /* @__PURE__ */ React4.createElement(StyledMenuTile.Content, { side: "top", align: "end" }, /* @__PURE__ */ React4.createElement(TileMenuContent, __spreadValues({}, props)))), showNameChangeModal && /* @__PURE__ */ React4.createElement(ChangeNameModal, { onOpenChange: setShowNameChangeModal }));
|
506
|
-
};
|
507
|
-
var TileMenu_default = TileMenu;
|
508
|
-
|
509
|
-
// src/Prebuilt/components/peerTileUtils.jsx
|
510
|
-
init_define_process_env();
|
511
|
-
var PEER_NAME_PLACEHOLDER = "peerName";
|
512
|
-
var labelMap = /* @__PURE__ */ new Map([
|
513
|
-
[[true, "screen"].toString(), "Your Screen"],
|
514
|
-
[[true, "regular"].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
515
|
-
[[false, "screen"].toString(), `${PEER_NAME_PLACEHOLDER}'s Screen`],
|
516
|
-
[[false, "regular"].toString(), PEER_NAME_PLACEHOLDER],
|
517
|
-
[[true, void 0].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
518
|
-
[[false, void 0].toString(), `${PEER_NAME_PLACEHOLDER}`]
|
519
|
-
]);
|
520
|
-
var getVideoTileLabel = ({ peerName, isLocal, track }) => {
|
521
|
-
const isPeerPresent = peerName !== void 0;
|
522
|
-
if (!isPeerPresent || !track) {
|
523
|
-
return isPeerPresent ? labelMap.get([isLocal, void 0].toString()).replace(PEER_NAME_PLACEHOLDER, peerName) : "";
|
524
|
-
}
|
525
|
-
const isLocallyMuted = track.volume === 0;
|
526
|
-
let label = labelMap.get([isLocal, track.source].toString());
|
527
|
-
if (label) {
|
528
|
-
label = label.replace(PEER_NAME_PLACEHOLDER, peerName);
|
529
|
-
} else {
|
530
|
-
label = `${peerName} ${track.source}`;
|
531
|
-
}
|
532
|
-
label = `${label}${track.degraded ? "(Degraded)" : ""}`;
|
533
|
-
return `${label}${isLocallyMuted ? " (Muted for you)" : ""}`;
|
534
|
-
};
|
535
|
-
|
536
|
-
// src/Prebuilt/components/AppData/useAppConfig.js
|
537
|
-
init_define_process_env();
|
538
|
-
import { selectAppDataByPath, useHMSStore as useHMSStore4 } from "@100mslive/react-sdk";
|
539
|
-
var useAppConfig = (...path) => {
|
540
|
-
const appConfig = useHMSStore4(selectAppDataByPath(APP_DATA.appConfig, ...path));
|
541
|
-
return appConfig;
|
542
|
-
};
|
543
|
-
|
544
|
-
// src/Prebuilt/components/VideoTile.jsx
|
545
|
-
var Tile = ({
|
546
|
-
peerId,
|
547
|
-
trackId,
|
548
|
-
width,
|
549
|
-
height,
|
550
|
-
objectFit = "cover",
|
551
|
-
canMinimise = false,
|
552
|
-
isDragabble = false,
|
553
|
-
rootCSS = {},
|
554
|
-
containerCSS = {}
|
555
|
-
}) => {
|
556
|
-
const trackSelector = trackId ? selectVideoTrackByID(trackId) : selectVideoTrackByPeerID2(peerId);
|
557
|
-
const track = useHMSStore5(trackSelector);
|
558
|
-
const peerName = useHMSStore5(selectPeerNameByID(peerId));
|
559
|
-
const audioTrack = useHMSStore5(selectAudioTrackByPeerID(peerId));
|
560
|
-
const localPeerID = useHMSStore5(selectLocalPeerID2);
|
561
|
-
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
562
|
-
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
563
|
-
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
564
|
-
const isHeadless = useIsHeadless();
|
565
|
-
const isAudioMuted = !useHMSStore5(selectIsPeerAudioEnabled(peerId));
|
566
|
-
const isVideoMuted = !(track == null ? void 0 : track.enabled);
|
567
|
-
const [isMouseHovered, setIsMouseHovered] = useState3(false);
|
568
|
-
const borderAudioRef = useBorderAudioLevel(audioTrack == null ? void 0 : audioTrack.id);
|
569
|
-
const isVideoDegraded = track == null ? void 0 : track.degraded;
|
570
|
-
const isLocal = localPeerID === peerId;
|
571
|
-
const isMobile = useMedia3(config.media.md);
|
572
|
-
const showStreamingUI = useShowStreamingUI();
|
573
|
-
const label = getVideoTileLabel({
|
574
|
-
peerName,
|
575
|
-
track,
|
576
|
-
isLocal
|
577
|
-
});
|
578
|
-
const onHoverHandler = useCallback((event) => {
|
579
|
-
setIsMouseHovered(event.type === "mouseenter");
|
580
|
-
}, []);
|
581
|
-
const headlessConfig = useAppConfig("headlessConfig");
|
582
|
-
const hideLabel = isHeadless && (headlessConfig == null ? void 0 : headlessConfig.hideTileName);
|
583
|
-
const isTileBigEnoughToShowStats = height >= 180 && width >= 180;
|
584
|
-
const avatarSize = useMemo(() => {
|
585
|
-
if (!width || !height) {
|
586
|
-
return void 0;
|
587
|
-
}
|
588
|
-
if (width <= 150 || height <= 150) {
|
589
|
-
return "small";
|
590
|
-
} else if (width <= 300 || height <= 300) {
|
591
|
-
return "medium";
|
592
|
-
}
|
593
|
-
return "large";
|
594
|
-
}, [width, height]);
|
595
|
-
return /* @__PURE__ */ React5.createElement(
|
596
|
-
StyledVideoTile.Root,
|
597
|
-
{
|
598
|
-
css: __spreadValues({
|
599
|
-
width,
|
600
|
-
height,
|
601
|
-
padding: getPadding({
|
602
|
-
isHeadless,
|
603
|
-
tileOffset: headlessConfig == null ? void 0 : headlessConfig.tileOffset,
|
604
|
-
hideAudioLevel: headlessConfig == null ? void 0 : headlessConfig.hideAudioLevel
|
605
|
-
})
|
606
|
-
}, rootCSS),
|
607
|
-
"data-testid": `participant_tile_${peerName}`
|
608
|
-
},
|
609
|
-
peerName !== void 0 ? /* @__PURE__ */ React5.createElement(
|
610
|
-
StyledVideoTile.Container,
|
611
|
-
{
|
612
|
-
onMouseEnter: onHoverHandler,
|
613
|
-
onMouseLeave: onHoverHandler,
|
614
|
-
ref: isHeadless && (headlessConfig == null ? void 0 : headlessConfig.hideAudioLevel) ? void 0 : borderAudioRef,
|
615
|
-
noRadius: isHeadless && Number(headlessConfig == null ? void 0 : headlessConfig.tileOffset) === 0,
|
616
|
-
css: containerCSS
|
617
|
-
},
|
618
|
-
showStatsOnTiles && isTileBigEnoughToShowStats ? /* @__PURE__ */ React5.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
619
|
-
track ? /* @__PURE__ */ React5.createElement(
|
620
|
-
Video,
|
621
|
-
{
|
622
|
-
trackId: track == null ? void 0 : track.id,
|
623
|
-
attach: isLocal ? void 0 : !isAudioOnly,
|
624
|
-
mirror: mirrorLocalVideo && peerId === localPeerID && (track == null ? void 0 : track.source) === "regular" && (track == null ? void 0 : track.facingMode) !== "environment",
|
625
|
-
degraded: isVideoDegraded,
|
626
|
-
noRadius: isHeadless && Number(headlessConfig == null ? void 0 : headlessConfig.tileOffset) === 0,
|
627
|
-
"data-testid": "participant_video_tile",
|
628
|
-
css: {
|
629
|
-
objectFit
|
630
|
-
}
|
631
|
-
}
|
632
|
-
) : null,
|
633
|
-
isVideoMuted || isVideoDegraded || !isLocal && isAudioOnly ? /* @__PURE__ */ React5.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React5.createElement(Avatar, { name: peerName || "", "data-testid": "participant_avatar_icon", size: avatarSize })) : null,
|
634
|
-
showAudioMuted({
|
635
|
-
hideTileAudioMute: headlessConfig == null ? void 0 : headlessConfig.hideTileAudioMute,
|
636
|
-
isHeadless,
|
637
|
-
isAudioMuted
|
638
|
-
}) ? /* @__PURE__ */ React5.createElement(
|
639
|
-
StyledVideoTile.AudioIndicator,
|
640
|
-
{
|
641
|
-
"data-testid": "participant_audio_mute_icon",
|
642
|
-
size: width && height && (width < 180 || height < 180) ? "small" : "medium"
|
643
|
-
},
|
644
|
-
/* @__PURE__ */ React5.createElement(MicOffIcon2, null)
|
645
|
-
) : null,
|
646
|
-
(isMouseHovered || isDragabble) && !isHeadless ? /* @__PURE__ */ React5.createElement(
|
647
|
-
TileMenu_default,
|
648
|
-
{
|
649
|
-
peerID: peerId,
|
650
|
-
audioTrackID: audioTrack == null ? void 0 : audioTrack.id,
|
651
|
-
videoTrackID: track == null ? void 0 : track.id,
|
652
|
-
canMinimise
|
653
|
-
}
|
654
|
-
) : null,
|
655
|
-
/* @__PURE__ */ React5.createElement(PeerMetadata, { peerId }),
|
656
|
-
showStreamingUI && isMobile ? null : /* @__PURE__ */ React5.createElement(TileConnection_default, { hideLabel, name: label, isTile: true, peerId, width })
|
657
|
-
) : null
|
658
|
-
);
|
659
|
-
};
|
660
|
-
var metaStyles = { top: "$4", left: "$4" };
|
661
|
-
var PeerMetadata = ({ peerId }) => {
|
662
|
-
const metaData = useHMSStore5(selectPeerMetadata(peerId));
|
663
|
-
const isHandRaised = (metaData == null ? void 0 : metaData.isHandRaised) || false;
|
664
|
-
const isBRB = (metaData == null ? void 0 : metaData.isBRBOn) || false;
|
665
|
-
return /* @__PURE__ */ React5.createElement(Fragment2, null, isHandRaised ? /* @__PURE__ */ React5.createElement(StyledVideoTile.AttributeBox, { css: metaStyles, "data-testid": "raiseHand_icon_onTile" }, /* @__PURE__ */ React5.createElement(HandIcon, { width: 24, height: 24 })) : null, isBRB ? /* @__PURE__ */ React5.createElement(StyledVideoTile.AttributeBox, { css: metaStyles, "data-testid": "brb_icon_onTile" }, /* @__PURE__ */ React5.createElement(BrbTileIcon, { width: 24, height: 24 })) : null);
|
666
|
-
};
|
667
|
-
var VideoTile = React5.memo(Tile);
|
668
|
-
var showAudioMuted = ({ hideTileAudioMute, isHeadless, isAudioMuted }) => {
|
669
|
-
if (!isHeadless) {
|
670
|
-
return isAudioMuted;
|
671
|
-
}
|
672
|
-
return isAudioMuted && !hideTileAudioMute;
|
673
|
-
};
|
674
|
-
var getPadding = ({ isHeadless, tileOffset, hideAudioLevel }) => {
|
675
|
-
if (!isHeadless || isNaN(Number(tileOffset))) {
|
676
|
-
return void 0;
|
677
|
-
}
|
678
|
-
return Number(tileOffset) === 0 ? hideAudioLevel ? 0 : 3 : void 0;
|
679
|
-
};
|
680
|
-
var VideoTile_default = VideoTile;
|
681
|
-
|
682
|
-
// src/Prebuilt/components/VideoList.jsx
|
683
|
-
init_define_process_env();
|
684
|
-
import React8, { Fragment as Fragment3, useEffect, useState as useState5 } from "react";
|
685
|
-
import { useVideoList } from "@100mslive/react-sdk";
|
686
|
-
|
687
|
-
// src/Prebuilt/components/Pagination.jsx
|
688
|
-
init_define_process_env();
|
689
|
-
import React6 from "react";
|
690
|
-
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon } from "@100mslive/react-icons";
|
691
|
-
var Pagination = ({ page, onPageChange, numPages }) => {
|
692
|
-
const disableLeft = page === 0;
|
693
|
-
const disableRight = page === numPages - 1;
|
694
|
-
const nextPage = () => {
|
695
|
-
onPageChange(Math.min(page + 1, numPages - 1));
|
696
|
-
};
|
697
|
-
const prevPage = () => {
|
698
|
-
onPageChange(Math.max(page - 1, 0));
|
699
|
-
};
|
700
|
-
return /* @__PURE__ */ React6.createElement(StyledPagination.Root, null, /* @__PURE__ */ React6.createElement(StyledPagination.Chevron, { disabled: disableLeft, onClick: prevPage }, /* @__PURE__ */ React6.createElement(ChevronLeftIcon2, { width: 16, height: 16, style: { cursor: disableLeft ? "not-allowed" : "pointer" } })), /* @__PURE__ */ React6.createElement(StyledPagination.Dots, null, [...Array(numPages)].map((_, i) => /* @__PURE__ */ React6.createElement(StyledPagination.Dot, { key: i, active: page === i, onClick: () => onPageChange(i) }))), /* @__PURE__ */ React6.createElement(StyledPagination.Chevron, { disabled: disableRight, onClick: nextPage }, /* @__PURE__ */ React6.createElement(ChevronRightIcon, { width: 16, height: 16, style: { cursor: disableRight ? "not-allowed" : "pointer" } })));
|
701
|
-
};
|
702
|
-
|
703
|
-
// src/Prebuilt/components/ScreenshareTile.jsx
|
704
|
-
init_define_process_env();
|
705
|
-
import React7, { useRef, useState as useState4 } from "react";
|
706
|
-
import { useFullscreen } from "react-use";
|
707
|
-
import screenfull from "screenfull";
|
708
|
-
import {
|
709
|
-
selectLocalPeerID as selectLocalPeerID3,
|
710
|
-
selectPeerByID as selectPeerByID2,
|
711
|
-
selectScreenShareAudioByPeerID,
|
712
|
-
selectScreenShareByPeerID,
|
713
|
-
useHMSStore as useHMSStore6
|
714
|
-
} from "@100mslive/react-sdk";
|
715
|
-
import { ExpandIcon, ShrinkIcon as ShrinkIcon2 } from "@100mslive/react-icons";
|
716
|
-
var labelStyles = {
|
717
|
-
position: "unset",
|
718
|
-
width: "100%",
|
719
|
-
textAlign: "center",
|
720
|
-
transform: "none",
|
721
|
-
mt: "$2",
|
722
|
-
flexShrink: 0
|
723
|
-
};
|
724
|
-
var Tile2 = ({ peerId, width = "100%", height = "100%" }) => {
|
725
|
-
const isLocal = useHMSStore6(selectLocalPeerID3) === peerId;
|
726
|
-
const track = useHMSStore6(selectScreenShareByPeerID(peerId));
|
727
|
-
const peer = useHMSStore6(selectPeerByID2(peerId));
|
728
|
-
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
729
|
-
const isHeadless = useIsHeadless();
|
730
|
-
const [isMouseHovered, setIsMouseHovered] = useState4(false);
|
731
|
-
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
732
|
-
const label = getVideoTileLabel({
|
733
|
-
peerName: peer.name,
|
734
|
-
isLocal: false,
|
735
|
-
track
|
736
|
-
});
|
737
|
-
const fullscreenRef = useRef(null);
|
738
|
-
const [fullscreen, setFullscreen] = useState4(false);
|
739
|
-
const isFullscreen = useFullscreen(fullscreenRef, fullscreen, {
|
740
|
-
onClose: () => setFullscreen(false)
|
741
|
-
});
|
742
|
-
const isFullScreenSupported = screenfull.isEnabled;
|
743
|
-
const audioTrack = useHMSStore6(selectScreenShareAudioByPeerID(peer == null ? void 0 : peer.id));
|
744
|
-
return /* @__PURE__ */ React7.createElement(StyledVideoTile.Root, { css: { width, height, p: 0 }, "data-testid": "screenshare_tile" }, peer ? /* @__PURE__ */ React7.createElement(
|
745
|
-
StyledVideoTile.Container,
|
746
|
-
{
|
747
|
-
transparentBg: true,
|
748
|
-
ref: fullscreenRef,
|
749
|
-
css: { flexDirection: "column" },
|
750
|
-
onMouseEnter: () => setIsMouseHovered(true),
|
751
|
-
onMouseLeave: () => {
|
752
|
-
setIsMouseHovered(false);
|
753
|
-
}
|
754
|
-
},
|
755
|
-
showStatsOnTiles ? /* @__PURE__ */ React7.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
756
|
-
isFullScreenSupported && !isHeadless ? /* @__PURE__ */ React7.createElement(StyledVideoTile.FullScreenButton, { onClick: () => setFullscreen(!fullscreen) }, isFullscreen ? /* @__PURE__ */ React7.createElement(ShrinkIcon2, null) : /* @__PURE__ */ React7.createElement(ExpandIcon, null)) : null,
|
757
|
-
track ? /* @__PURE__ */ React7.createElement(
|
758
|
-
Video,
|
759
|
-
{
|
760
|
-
screenShare: true,
|
761
|
-
mirror: peer.isLocal && (track == null ? void 0 : track.source) === "regular",
|
762
|
-
attach: !isAudioOnly,
|
763
|
-
trackId: track.id
|
764
|
-
}
|
765
|
-
) : null,
|
766
|
-
/* @__PURE__ */ React7.createElement(StyledVideoTile.Info, { css: labelStyles }, label),
|
767
|
-
isMouseHovered && !isHeadless && !(peer == null ? void 0 : peer.isLocal) ? /* @__PURE__ */ React7.createElement(TileMenu_default, { isScreenshare: true, peerID: peer == null ? void 0 : peer.id, audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id }) : null
|
768
|
-
) : null);
|
769
|
-
};
|
770
|
-
var ScreenshareTile = React7.memo(Tile2);
|
771
|
-
var ScreenshareTile_default = ScreenshareTile;
|
772
|
-
|
773
|
-
// src/Prebuilt/components/VideoList.jsx
|
774
|
-
var List = ({ maxTileCount, peers, maxColCount, maxRowCount, includeScreenShareForPeer }) => {
|
775
|
-
var _a;
|
776
|
-
const { aspectRatio } = useTheme();
|
777
|
-
const tileOffset = useAppConfig("headlessConfig", "tileOffset");
|
778
|
-
const isHeadless = useIsHeadless();
|
779
|
-
const { ref, pagesWithTiles } = useVideoList({
|
780
|
-
peers,
|
781
|
-
maxTileCount,
|
782
|
-
maxColCount,
|
783
|
-
maxRowCount,
|
784
|
-
includeScreenShareForPeer,
|
785
|
-
aspectRatio,
|
786
|
-
offsetY: getOffset({ isHeadless, tileOffset })
|
787
|
-
});
|
788
|
-
const [page, setPage] = useState5(0);
|
789
|
-
useEffect(() => {
|
790
|
-
if (page >= pagesWithTiles.length) {
|
791
|
-
setPage(0);
|
792
|
-
}
|
793
|
-
}, [pagesWithTiles.length, page]);
|
794
|
-
return /* @__PURE__ */ React8.createElement(StyledVideoList.Root, { ref }, /* @__PURE__ */ React8.createElement(StyledVideoList.Container, { css: { flexWrap: "wrap", placeContent: "center" } }, pagesWithTiles && pagesWithTiles.length > 0 ? (_a = pagesWithTiles[page]) == null ? void 0 : _a.map((tile) => {
|
795
|
-
var _a2, _b, _c, _d;
|
796
|
-
if (tile.width === 0 || tile.height === 0) {
|
797
|
-
return null;
|
798
|
-
}
|
799
|
-
return /* @__PURE__ */ React8.createElement(Fragment3, { key: ((_a2 = tile.track) == null ? void 0 : _a2.id) || tile.peer.id }, ((_b = tile.track) == null ? void 0 : _b.source) === "screen" ? /* @__PURE__ */ React8.createElement(ScreenshareTile_default, { width: tile.width, height: tile.height, peerId: tile.peer.id }) : /* @__PURE__ */ React8.createElement(
|
800
|
-
VideoTile_default,
|
801
|
-
{
|
802
|
-
width: tile.width,
|
803
|
-
height: tile.height,
|
804
|
-
peerId: (_c = tile.peer) == null ? void 0 : _c.id,
|
805
|
-
trackId: (_d = tile.track) == null ? void 0 : _d.id
|
806
|
-
}
|
807
|
-
));
|
808
|
-
}) : null), !isHeadless && pagesWithTiles.length > 1 ? /* @__PURE__ */ React8.createElement(Pagination, { page, onPageChange: setPage, numPages: pagesWithTiles.length }) : null);
|
809
|
-
};
|
810
|
-
var VideoList = React8.memo(List);
|
811
|
-
var getOffset = ({ tileOffset, isHeadless }) => {
|
812
|
-
if (!isHeadless || isNaN(Number(tileOffset))) {
|
813
|
-
return 32;
|
814
|
-
}
|
815
|
-
return Number(tileOffset);
|
816
|
-
};
|
817
|
-
var VideoList_default = VideoList;
|
818
|
-
|
819
|
-
export {
|
820
|
-
ChangeNameModal,
|
821
|
-
useAppConfig,
|
822
|
-
VideoTile_default,
|
823
|
-
Pagination,
|
824
|
-
ScreenshareTile_default,
|
825
|
-
VideoList_default
|
826
|
-
};
|
827
|
-
//# sourceMappingURL=chunk-IVTWKQI3.js.map
|