@100mslive/roomkit-react 0.1.4-alpha.0 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-T267ZHOS.js → HLSView-CTAJQUU4.js} +7 -11
- package/dist/{HLSView-T267ZHOS.js.map → HLSView-CTAJQUU4.js.map} +1 -1
- package/dist/PinnedTrackView-CQKONH4O.js +102 -0
- package/dist/PinnedTrackView-CQKONH4O.js.map +7 -0
- package/dist/Popover/index.d.ts +1 -0
- package/dist/Prebuilt/App.d.ts +25 -0
- package/dist/Prebuilt/index.d.ts +1 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +1 -1
- package/dist/Sheet/Sheet.d.ts +3093 -0
- package/dist/Sheet/index.d.ts +1 -0
- package/dist/Theme/ThemeProvider.d.ts +4 -286
- package/dist/Theme/stitches.config.d.ts +1 -1
- package/dist/{VirtualBackground-BCKXNDTD.js → VirtualBackground-GGGBJYVY.js} +31 -7
- package/dist/VirtualBackground-GGGBJYVY.js.map +7 -0
- package/dist/chunk-I2FJWE74.js +827 -0
- package/dist/chunk-I2FJWE74.js.map +7 -0
- package/dist/{chunk-NLZVUXR3.js → chunk-L2SX7GBO.js} +3020 -2189
- package/dist/chunk-L2SX7GBO.js.map +7 -0
- package/dist/chunk-NOKIGB6Y.js +1100 -0
- package/dist/chunk-NOKIGB6Y.js.map +7 -0
- package/dist/chunk-TJNDX446.js +67 -0
- package/dist/chunk-TJNDX446.js.map +7 -0
- package/dist/{chunk-3HMUOAD6.js → conference-OEO7VOJD.js} +3136 -653
- package/dist/conference-OEO7VOJD.js.map +7 -0
- package/dist/index.cjs.js +15733 -15498
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +4 -8
- package/dist/meta.cjs.json +3248 -3039
- package/dist/meta.esbuild.json +3398 -3386
- package/dist/utils/animations.d.ts +16 -0
- package/package.json +8 -11
- package/src/Button/Button.tsx +4 -4
- package/src/Dropdown/Dropdown.tsx +2 -2
- package/src/IconButton/IconButton.tsx +4 -2
- package/src/Pagination/StyledPagination.tsx +1 -0
- package/src/Popover/index.tsx +2 -1
- package/src/Prebuilt/{App.jsx → App.tsx} +95 -48
- package/src/Prebuilt/Prebuilt.stories.tsx +22 -8
- package/src/Prebuilt/common/constants.js +1 -2
- package/src/Prebuilt/common/hooks.js +8 -0
- package/src/Prebuilt/common/utils.js +15 -0
- package/src/Prebuilt/components/AppData/AppData.jsx +1 -2
- package/src/Prebuilt/components/AppData/useUISettings.js +0 -5
- package/src/Prebuilt/components/AudioVideoToggle.jsx +69 -26
- package/src/Prebuilt/components/AuthToken.jsx +3 -2
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +1 -1
- package/src/Prebuilt/components/Connection/TileConnection.jsx +0 -1
- package/src/Prebuilt/components/EmojiReaction.jsx +23 -73
- package/src/Prebuilt/components/EndSessionContent.jsx +57 -0
- package/src/Prebuilt/components/EqualProminence.jsx +180 -0
- package/src/Prebuilt/components/ErrorBoundary.jsx +4 -10
- package/src/Prebuilt/components/Footer/EmojiCard.jsx +34 -0
- package/src/Prebuilt/components/Footer/Footer.jsx +73 -0
- package/src/Prebuilt/components/{Header → Footer}/ParticipantList.jsx +5 -5
- package/src/Prebuilt/components/Header/ConferencingHeader.jsx +27 -7
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +16 -14
- package/src/Prebuilt/components/Header/StreamActions.jsx +101 -36
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +1 -1
- package/src/Prebuilt/components/Header/common.jsx +164 -0
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +1 -2
- package/src/Prebuilt/components/LeaveCard.jsx +19 -0
- package/src/Prebuilt/components/LeaveRoom.jsx +35 -143
- package/src/Prebuilt/components/LeaveSessionContent.jsx +45 -0
- package/src/Prebuilt/components/MoreSettings/ActionTile.jsx +55 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx +96 -0
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +31 -54
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +48 -73
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +5 -221
- package/src/Prebuilt/components/MoreSettings/MuteAllContent.jsx +61 -0
- package/src/Prebuilt/components/MoreSettings/MuteAllModal.jsx +32 -49
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopLeaveRoom.jsx +129 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.jsx +219 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebLeaveRoom.jsx +100 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.jsx +259 -0
- package/src/Prebuilt/components/Notifications/Notifications.jsx +0 -2
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +0 -4
- package/src/Prebuilt/components/PIP/PIPComponent.jsx +30 -26
- package/src/Prebuilt/components/PIP/PIPManager.js +13 -0
- package/src/Prebuilt/components/PIP/index.jsx +2 -7
- package/src/Prebuilt/components/Pagination.jsx +4 -4
- package/src/Prebuilt/components/Preview/PreviewContainer.jsx +5 -13
- package/src/Prebuilt/components/Preview/PreviewForm.jsx +9 -5
- package/src/Prebuilt/components/Preview/PreviewJoin.jsx +20 -27
- package/src/Prebuilt/components/RaiseHand.jsx +27 -0
- package/src/Prebuilt/components/ScreenShare.jsx +1 -1
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +2 -2
- package/src/Prebuilt/components/ScreenshareTile.jsx +2 -2
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +2 -1
- package/src/Prebuilt/components/Settings/LayoutSettings.jsx +1 -24
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +152 -17
- package/src/Prebuilt/components/ShareMenuIcon.jsx +1 -0
- package/src/Prebuilt/components/TileMenu/TileMenu.jsx +133 -0
- package/src/Prebuilt/components/TileMenu/TileMenuContent.jsx +313 -0
- package/src/Prebuilt/components/VideoList.jsx +5 -33
- package/src/Prebuilt/components/VideoTile.jsx +30 -8
- package/src/Prebuilt/components/conference.jsx +14 -1
- package/src/Prebuilt/components/init/Init.jsx +0 -27
- package/src/Prebuilt/components/init/initUtils.js +0 -23
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +2 -1
- package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +1 -1
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +19 -8
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +1 -0
- package/src/Prebuilt/images/pdf-share.png +0 -0
- package/src/Prebuilt/images/screen-share.png +0 -0
- package/src/Prebuilt/index.ts +1 -0
- package/src/Prebuilt/layouts/EmbedView.jsx +0 -1
- package/src/Prebuilt/layouts/InsetView.jsx +65 -24
- package/src/Prebuilt/layouts/PDFView.jsx +0 -1
- package/src/Prebuilt/layouts/SidePane.jsx +8 -7
- package/src/Prebuilt/layouts/WhiteboardView.jsx +2 -4
- package/src/Prebuilt/layouts/mainView.jsx +22 -31
- package/src/Prebuilt/layouts/screenShareView.jsx +0 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +25 -1
- package/src/Prebuilt/plugins/whiteboard/index.js +1 -1
- package/src/Prebuilt/primitives/DialogContent.jsx +1 -1
- package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +1 -1
- package/src/Sheet/Sheet.mdx +19 -0
- package/src/Sheet/Sheet.stories.tsx +103 -0
- package/src/Sheet/Sheet.tsx +118 -0
- package/src/Sheet/index.ts +1 -0
- package/src/Theme/ThemeProvider.tsx +10 -13
- package/src/Theme/base.config.ts +1 -1
- package/src/Theme/stitches.config.ts +1 -1
- package/src/TileMenu/StyledMenuTile.tsx +2 -2
- package/src/TileMenu/TileMenu.tsx +2 -0
- package/src/VideoTile/StyledVideoTile.tsx +5 -0
- package/src/utils/animations.ts +18 -0
- package/dist/ActiveSpeakerView-AGL73O6U.css +0 -11
- package/dist/ActiveSpeakerView-AGL73O6U.css.map +0 -7
- package/dist/ActiveSpeakerView-UPFD5RXA.js +0 -39
- package/dist/ActiveSpeakerView-UPFD5RXA.js.map +0 -7
- package/dist/HLSView-64OG755F.css +0 -11
- package/dist/HLSView-64OG755F.css.map +0 -7
- package/dist/PinnedTrackView-O4FHHHOV.js +0 -70
- package/dist/PinnedTrackView-O4FHHHOV.js.map +0 -7
- package/dist/PinnedTrackView-YWAZ2342.css +0 -11
- package/dist/PinnedTrackView-YWAZ2342.css.map +0 -7
- package/dist/VirtualBackground-BCKXNDTD.js.map +0 -7
- package/dist/chunk-3HMUOAD6.js.map +0 -7
- package/dist/chunk-6GXDYWD5.js +0 -243
- package/dist/chunk-6GXDYWD5.js.map +0 -7
- package/dist/chunk-NLZVUXR3.js.map +0 -7
- package/dist/chunk-ORPC2GYB.js +0 -58
- package/dist/chunk-ORPC2GYB.js.map +0 -7
- package/dist/chunk-YE4RPJYG.js +0 -811
- package/dist/chunk-YE4RPJYG.js.map +0 -7
- package/dist/conference-7KHWJZLG.css +0 -11
- package/dist/conference-7KHWJZLG.css.map +0 -7
- package/dist/conference-ETISNCLN.js +0 -3697
- package/dist/conference-ETISNCLN.js.map +0 -7
- package/dist/index.cjs.css +0 -11
- package/dist/index.cjs.css.map +0 -7
- package/dist/index.css +0 -11
- package/dist/index.css.map +0 -7
- package/dist/transcription-JJQ4UAIK.js +0 -356
- package/dist/transcription-JJQ4UAIK.js.map +0 -7
- package/src/Prebuilt/common/useSortedPeers.js +0 -28
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +0 -96
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.stories.tsx +0 -46
- package/src/Prebuilt/components/Footer/ConferencingFooter.jsx +0 -101
- package/src/Prebuilt/components/Footer/StreamingFooter.jsx +0 -71
- package/src/Prebuilt/components/Footer.jsx +0 -8
- package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +0 -67
- package/src/Prebuilt/components/TileMenu.jsx +0 -268
- package/src/Prebuilt/index.d.ts +0 -20
- package/src/Prebuilt/index.js +0 -2
@@ -0,0 +1,827 @@
|
|
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-L2SX7GBO.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-NOKIGB6Y.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-I2FJWE74.js.map
|