@100mslive/roomkit-react 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/AudioLevel/AudioLevel.d.ts +5 -8
- package/dist/AudioLevel/index.d.ts +2 -1
- package/dist/AudioLevel/useBorderAudioLevel.d.ts +8 -0
- package/dist/{HLSView-3S74KF3A.js → HLSView-DDGPZHA2.js} +5 -4
- package/dist/{HLSView-3S74KF3A.js.map → HLSView-DDGPZHA2.js.map} +2 -2
- package/dist/Prebuilt/App.d.ts +1 -0
- package/dist/Prebuilt/AppContext.d.ts +1 -0
- package/dist/Prebuilt/components/Chip.d.ts +12 -0
- package/dist/Prebuilt/components/Footer/PaginatedParticipants.d.ts +5 -0
- package/dist/Prebuilt/components/Footer/RoleAccordion.d.ts +10 -3
- package/dist/Prebuilt/components/Notifications/HeadlessEndRoomListener.d.ts +2 -0
- package/dist/Prebuilt/components/PrebuiltDialogPortal.d.ts +4 -0
- package/dist/Prebuilt/components/PrebuiltTileElements.d.ts +2198 -0
- package/dist/{VirtualBackground-3TI5NA4V.js → VirtualBackground-UVZJVOA2.js} +3 -3
- package/dist/{chunk-5DQ3WTED.js → chunk-6SQTFOK6.js} +2 -2
- package/dist/{chunk-5DQ3WTED.js.map → chunk-6SQTFOK6.js.map} +1 -1
- package/dist/{chunk-36X4ZCLC.js → chunk-HUMNPIYI.js} +2 -2
- package/dist/{chunk-Z7P5WITU.js → chunk-PRM33R4R.js} +591 -1186
- package/dist/chunk-PRM33R4R.js.map +7 -0
- package/dist/{conference-JNABIZBG.js → conference-N7S47TDK.js} +1505 -717
- package/dist/conference-N7S47TDK.js.map +7 -0
- package/dist/index.cjs.js +3083 -2825
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +4 -2
- package/dist/meta.cjs.json +1107 -740
- package/dist/meta.esbuild.json +1160 -791
- package/package.json +6 -6
- package/src/AudioLevel/AudioLevel.tsx +79 -30
- package/src/AudioLevel/audio-level.png +0 -0
- package/src/AudioLevel/index.ts +2 -1
- package/src/AudioLevel/useBorderAudioLevel.tsx +34 -0
- package/src/Prebuilt/App.tsx +6 -0
- package/src/Prebuilt/AppContext.tsx +2 -0
- package/src/Prebuilt/common/constants.js +1 -1
- package/src/Prebuilt/common/utils.js +0 -7
- package/src/Prebuilt/components/AppData/AppData.jsx +1 -1
- package/src/Prebuilt/components/AppData/useUISettings.js +1 -1
- package/src/Prebuilt/components/{Chip.jsx → Chip.tsx} +18 -3
- package/src/Prebuilt/components/Footer/PaginatedParticipants.tsx +94 -0
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +67 -26
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +91 -49
- package/src/Prebuilt/components/Footer/RoleOptions.tsx +1 -1
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +7 -4
- package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +3 -2
- package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +3 -2
- package/src/Prebuilt/components/MwebLandscapePrompt.jsx +58 -0
- package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +3 -2
- package/src/Prebuilt/components/Notifications/HeadlessEndRoomListener.tsx +23 -0
- package/src/Prebuilt/components/Notifications/Notifications.jsx +1 -1
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +3 -2
- package/src/Prebuilt/components/PrebuiltDialogPortal.tsx +6 -0
- package/src/Prebuilt/components/PrebuiltTileElements.tsx +5 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +11 -7
- package/src/Prebuilt/components/RoleChangeModal.jsx +3 -2
- package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +3 -2
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -2
- package/src/Prebuilt/components/Settings/StartRecording.jsx +3 -2
- package/src/Prebuilt/components/SidePaneTabs.tsx +31 -5
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -2
- package/src/Prebuilt/components/VideoTile.jsx +21 -83
- package/src/Prebuilt/components/conference.jsx +4 -3
- package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +1 -1
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +3 -2
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +4 -29
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +3 -2
- package/src/Prebuilt/layouts/HLSView.jsx +1 -0
- package/src/Prebuilt/layouts/SidePane.tsx +1 -0
- package/src/Prebuilt/primitives/DialogContent.jsx +5 -4
- package/dist/chunk-Z7P5WITU.js.map +0 -7
- package/dist/conference-JNABIZBG.js.map +0 -7
- /package/dist/{VirtualBackground-3TI5NA4V.js.map → VirtualBackground-UVZJVOA2.js.map} +0 -0
- /package/dist/{chunk-36X4ZCLC.js.map → chunk-HUMNPIYI.js.map} +0 -0
@@ -35,7 +35,7 @@ import {
|
|
35
35
|
textEllipsis,
|
36
36
|
theme,
|
37
37
|
toastAnimation
|
38
|
-
} from "./chunk-
|
38
|
+
} from "./chunk-6SQTFOK6.js";
|
39
39
|
|
40
40
|
// src/Button/Button.tsx
|
41
41
|
import React2 from "react";
|
@@ -1221,7 +1221,7 @@ var StyledMenuTile = {
|
|
1221
1221
|
RemoveItem: RemoveMenuItem
|
1222
1222
|
};
|
1223
1223
|
|
1224
|
-
// src/AudioLevel/
|
1224
|
+
// src/AudioLevel/useBorderAudioLevel.tsx
|
1225
1225
|
import { useCallback as useCallback2, useRef as useRef2 } from "react";
|
1226
1226
|
import { useAudioLevelStyles } from "@100mslive/react-sdk";
|
1227
1227
|
function useBorderAudioLevel(audioTrackId) {
|
@@ -1249,6 +1249,83 @@ var sigmoid = (z) => {
|
|
1249
1249
|
return 1 / (1 + Math.exp(-z));
|
1250
1250
|
};
|
1251
1251
|
|
1252
|
+
// src/AudioLevel/AudioLevel.tsx
|
1253
|
+
import React10, { useEffect as useEffect3, useRef as useRef3 } from "react";
|
1254
|
+
import { selectTrackAudioByID, useHMSVanillaStore } from "@100mslive/react-sdk";
|
1255
|
+
|
1256
|
+
// src/AudioLevel/audio-level.png
|
1257
|
+
var audio_level_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAABABAMAAAAHc7SNAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAtUExURQAAAP///////////////////////////////////////////////////////6FIq5sAAAAOdFJOUwA/QJqbnJ2euLnc3d7+2IFKrQAAAa9JREFUaN7dmcFRxDAMRXNgW4AbV24ZSkgrlAAFUAqlpITtgT0QnB22BnY3iWXHSlYz5H/NoJNO8bP8JTlyVW1k923/MveYdnc623PuUe3jsux37tEDcN24eFR7HJb9TD2qvQ/LfqUexR7a41Xx7bDsMfWo2j+NlnpU7TsBiOKdAOqoeCcAUTwFYFK8pn0GgFLttWVxAEq1pwJo1Z4KoFV7KoBW7YEAT0uK729pfxuAZcX/3Fr2TwAx05cVDwWIu11RPBQg7lZ0XlR7JIDsdkXxCIDp5GXf2v0GBxBP3pTfAIB48qb83h7AWtlhANbKDgOwVnYYgLWywwCsn/u/AO5HMIqwcwOovdNwLESNG8BQioNfKa52YwBsakC04/MF9C1Rw4HdjhU1SCyKqOCvZCGLhXgMgKgGiUWRI9hr+aSG+bU8sP4LyliIxwW4xOI1j8pKZlB/Tjt794ANpKzdAzOgaOzdAzKiCVpmkACWM4MEIFVCyQzfQWXnPao9eA+rG+dxfXB8L1jNB4pN+bCfd4re59Gqoz9alflQ+zzb7ZROwTWlUziEIO8UZCs7hc1+AbiVW6XSE8knAAAAAElFTkSuQmCC";
|
1258
|
+
|
1259
|
+
// src/AudioLevel/AudioLevel.tsx
|
1260
|
+
var positionValues = new Array(101).fill(0).reduce((acc, _, index) => {
|
1261
|
+
acc[index] = Math.round(index / 100 * 4) / 4;
|
1262
|
+
return acc;
|
1263
|
+
}, {});
|
1264
|
+
var barAnimation = keyframes({
|
1265
|
+
from: {
|
1266
|
+
maskSize: "4em .8em",
|
1267
|
+
"-webkit-mask-position-y": ".1em",
|
1268
|
+
maskPosition: "initial .1em"
|
1269
|
+
},
|
1270
|
+
"50%": {
|
1271
|
+
maskSize: "4em 1em",
|
1272
|
+
"-webkit-mask-position-y": 0,
|
1273
|
+
maskPosition: "initial 0"
|
1274
|
+
},
|
1275
|
+
to: {
|
1276
|
+
maskSize: "4em .8em",
|
1277
|
+
"-webkit-mask-position-y": ".1em",
|
1278
|
+
maskPosition: "initial 0.1em"
|
1279
|
+
}
|
1280
|
+
});
|
1281
|
+
var AudioBar = () => {
|
1282
|
+
return /* @__PURE__ */ React10.createElement(
|
1283
|
+
Box,
|
1284
|
+
{
|
1285
|
+
css: {
|
1286
|
+
width: ".25em",
|
1287
|
+
height: "1em",
|
1288
|
+
maskImage: `url(${audio_level_default})`,
|
1289
|
+
"-webkit-mask-repeat": "no-repeat",
|
1290
|
+
backgroundColor: "$on_primary_high",
|
1291
|
+
maskSize: "4em 1em"
|
1292
|
+
}
|
1293
|
+
}
|
1294
|
+
);
|
1295
|
+
};
|
1296
|
+
var AudioLevel = ({ trackId, size }) => {
|
1297
|
+
const ref = useRef3(null);
|
1298
|
+
const vanillaStore = useHMSVanillaStore();
|
1299
|
+
useEffect3(() => {
|
1300
|
+
const unsubscribe = vanillaStore.subscribe((audioLevel) => {
|
1301
|
+
if (ref.current) {
|
1302
|
+
let index = 0;
|
1303
|
+
for (const child of ref.current.children) {
|
1304
|
+
const positionX = `-${positionValues[audioLevel] * (index === 1 ? 2.5 : 1.25)}em`;
|
1305
|
+
child.style["-webkit-mask-position-x"] = positionX;
|
1306
|
+
child.style["mask-position"] = `${positionX} 0`;
|
1307
|
+
child.style["animation"] = positionValues[audioLevel] > 0 ? `${barAnimation} 0.6s steps(3,jump-none) 0s infinite` : "none";
|
1308
|
+
index++;
|
1309
|
+
}
|
1310
|
+
}
|
1311
|
+
}, selectTrackAudioByID(trackId));
|
1312
|
+
return unsubscribe;
|
1313
|
+
}, [vanillaStore, trackId]);
|
1314
|
+
return /* @__PURE__ */ React10.createElement(
|
1315
|
+
Flex,
|
1316
|
+
{
|
1317
|
+
ref,
|
1318
|
+
css: {
|
1319
|
+
fontSize: size === "small" ? "0.75rem" : "1rem",
|
1320
|
+
gap: size === "small" ? "$1" : "$2"
|
1321
|
+
}
|
1322
|
+
},
|
1323
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null),
|
1324
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null),
|
1325
|
+
/* @__PURE__ */ React10.createElement(AudioBar, null)
|
1326
|
+
);
|
1327
|
+
};
|
1328
|
+
|
1252
1329
|
// src/Popover/index.tsx
|
1253
1330
|
import { Arrow as Arrow2, Close as Close2, Content as Content4, Popover as Root12, Portal as Portal3, Trigger as Trigger4 } from "@radix-ui/react-popover";
|
1254
1331
|
var StyledContent2 = styled(Content4, __spreadValues({
|
@@ -1270,7 +1347,7 @@ var Popover2 = {
|
|
1270
1347
|
};
|
1271
1348
|
|
1272
1349
|
// src/Stats/Stats.tsx
|
1273
|
-
import
|
1350
|
+
import React11, { Fragment } from "react";
|
1274
1351
|
import {
|
1275
1352
|
selectConnectionQualityByPeerID,
|
1276
1353
|
selectHMSStats,
|
@@ -1350,7 +1427,7 @@ function VideoTileStats({ videoTrackID, audioTrackID, peerID, isLocal = false })
|
|
1350
1427
|
if (!(audioTrackStats || videoTrackStats)) {
|
1351
1428
|
return null;
|
1352
1429
|
}
|
1353
|
-
return /* @__PURE__ */
|
1430
|
+
return /* @__PURE__ */ React11.createElement(Stats.Root, null, /* @__PURE__ */ React11.createElement("table", null, /* @__PURE__ */ React11.createElement("tbody", null, isLocal ? /* @__PURE__ */ React11.createElement(Fragment, null, /* @__PURE__ */ React11.createElement(
|
1354
1431
|
StatsRow,
|
1355
1432
|
{
|
1356
1433
|
show: isNotNullishAndNot0(availableOutgoingBitrate),
|
@@ -1364,71 +1441,71 @@ function VideoTileStats({ videoTrackID, audioTrackID, peerID, isLocal = false })
|
|
1364
1441
|
return null;
|
1365
1442
|
}
|
1366
1443
|
const layer = stat.rid ? simulcastMapping[stat.rid] : "";
|
1367
|
-
return /* @__PURE__ */
|
1444
|
+
return /* @__PURE__ */ React11.createElement(Fragment, null, layer && /* @__PURE__ */ React11.createElement(StatsRow, { label: layer.toUpperCase(), value: "" }), /* @__PURE__ */ React11.createElement(
|
1368
1445
|
StatsRow,
|
1369
1446
|
{
|
1370
1447
|
show: isNotNullishAndNot0(stat.frameWidth),
|
1371
1448
|
label: "Width",
|
1372
1449
|
value: (_a8 = stat.frameWidth) == null ? void 0 : _a8.toString()
|
1373
1450
|
}
|
1374
|
-
), /* @__PURE__ */
|
1451
|
+
), /* @__PURE__ */ React11.createElement(
|
1375
1452
|
StatsRow,
|
1376
1453
|
{
|
1377
1454
|
show: isNotNullishAndNot0(stat.frameHeight),
|
1378
1455
|
label: "Height",
|
1379
1456
|
value: (_b8 = stat.frameHeight) == null ? void 0 : _b8.toString()
|
1380
1457
|
}
|
1381
|
-
), /* @__PURE__ */
|
1458
|
+
), /* @__PURE__ */ React11.createElement(
|
1382
1459
|
StatsRow,
|
1383
1460
|
{
|
1384
1461
|
show: isNotNullishAndNot0(stat.framesPerSecond),
|
1385
1462
|
label: "FPS",
|
1386
1463
|
value: `${stat.framesPerSecond} ${isNotNullishAndNot0(stat.framesDropped) ? `(${stat.framesDropped} dropped)` : ""}`
|
1387
1464
|
}
|
1388
|
-
), /* @__PURE__ */
|
1465
|
+
), /* @__PURE__ */ React11.createElement(
|
1389
1466
|
StatsRow,
|
1390
1467
|
{
|
1391
1468
|
show: isNotNullish(stat.bitrate),
|
1392
1469
|
label: "Bitrate(V)",
|
1393
1470
|
value: formatBytes(stat.bitrate, "b/s")
|
1394
1471
|
}
|
1395
|
-
), /* @__PURE__ */
|
1396
|
-
})) : /* @__PURE__ */
|
1472
|
+
), /* @__PURE__ */ React11.createElement(Stats.Gap, null));
|
1473
|
+
})) : /* @__PURE__ */ React11.createElement(Fragment, null, /* @__PURE__ */ React11.createElement(
|
1397
1474
|
StatsRow,
|
1398
1475
|
{
|
1399
1476
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.frameWidth),
|
1400
1477
|
label: "Width",
|
1401
1478
|
value: (_b7 = videoTrackStats == null ? void 0 : videoTrackStats.frameWidth) == null ? void 0 : _b7.toString()
|
1402
1479
|
}
|
1403
|
-
), /* @__PURE__ */
|
1480
|
+
), /* @__PURE__ */ React11.createElement(
|
1404
1481
|
StatsRow,
|
1405
1482
|
{
|
1406
1483
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.frameHeight),
|
1407
1484
|
label: "Height",
|
1408
1485
|
value: (_c = videoTrackStats == null ? void 0 : videoTrackStats.frameHeight) == null ? void 0 : _c.toString()
|
1409
1486
|
}
|
1410
|
-
), /* @__PURE__ */
|
1487
|
+
), /* @__PURE__ */ React11.createElement(
|
1411
1488
|
StatsRow,
|
1412
1489
|
{
|
1413
1490
|
show: isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.framesPerSecond),
|
1414
1491
|
label: "FPS",
|
1415
1492
|
value: `${videoTrackStats == null ? void 0 : videoTrackStats.framesPerSecond} ${isNotNullishAndNot0(videoTrackStats == null ? void 0 : videoTrackStats.framesDropped) ? `(${videoTrackStats == null ? void 0 : videoTrackStats.framesDropped} dropped)` : ""}`
|
1416
1493
|
}
|
1417
|
-
), /* @__PURE__ */
|
1494
|
+
), /* @__PURE__ */ React11.createElement(
|
1418
1495
|
StatsRow,
|
1419
1496
|
{
|
1420
1497
|
show: isNotNullish(videoTrackStats == null ? void 0 : videoTrackStats.bitrate),
|
1421
1498
|
label: "Bitrate(V)",
|
1422
1499
|
value: formatBytes(videoTrackStats == null ? void 0 : videoTrackStats.bitrate, "b/s")
|
1423
1500
|
}
|
1424
|
-
)), /* @__PURE__ */
|
1501
|
+
)), /* @__PURE__ */ React11.createElement(
|
1425
1502
|
StatsRow,
|
1426
1503
|
{
|
1427
1504
|
show: isNotNullish(audioTrackStats == null ? void 0 : audioTrackStats.bitrate),
|
1428
1505
|
label: "Bitrate(A)",
|
1429
1506
|
value: formatBytes(audioTrackStats == null ? void 0 : audioTrackStats.bitrate, "b/s")
|
1430
1507
|
}
|
1431
|
-
), /* @__PURE__ */
|
1508
|
+
), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(downlinkScore), label: "Downlink", value: downlinkScore }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(videoTrackStats == null ? void 0 : videoTrackStats.codec), label: "Codec(V)", value: videoTrackStats == null ? void 0 : videoTrackStats.codec }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(audioTrackStats == null ? void 0 : audioTrackStats.codec), label: "Codec(A)", value: audioTrackStats == null ? void 0 : audioTrackStats.codec }), /* @__PURE__ */ React11.createElement(PacketLostAndJitter, { audioTrackStats, videoTrackStats }))));
|
1432
1509
|
}
|
1433
1510
|
var PacketLostAndJitter = ({
|
1434
1511
|
audioTrackStats,
|
@@ -1438,14 +1515,14 @@ var PacketLostAndJitter = ({
|
|
1438
1515
|
const isLocalPeer = (audioTrackStats == null ? void 0 : audioTrackStats.type.includes("outbound")) || (videoTrackStats == null ? void 0 : videoTrackStats.type.includes("outbound"));
|
1439
1516
|
const audioStats = isLocalPeer ? audioTrackStats == null ? void 0 : audioTrackStats.remote : audioTrackStats;
|
1440
1517
|
const videoStats = isLocalPeer ? videoTrackStats == null ? void 0 : videoTrackStats.remote : videoTrackStats;
|
1441
|
-
return /* @__PURE__ */
|
1518
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(TrackPacketsLostRow, { label: "Packet Loss(V)", stats: videoStats }), /* @__PURE__ */ React11.createElement(TrackPacketsLostRow, { label: "Packet Loss(A)", stats: audioStats }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(videoStats == null ? void 0 : videoStats.jitter), label: "Jitter(V)", value: (_a7 = videoStats == null ? void 0 : videoStats.jitter) == null ? void 0 : _a7.toFixed(4) }), /* @__PURE__ */ React11.createElement(StatsRow, { show: isNotNullish(audioStats == null ? void 0 : audioStats.jitter), label: "Jitter(A)", value: (_b7 = audioStats == null ? void 0 : audioStats.jitter) == null ? void 0 : _b7.toFixed(4) }));
|
1442
1519
|
};
|
1443
1520
|
var TrackPacketsLostRow = ({
|
1444
1521
|
stats,
|
1445
1522
|
label
|
1446
1523
|
}) => {
|
1447
1524
|
const packetsLostRate = `${(stats == null ? void 0 : stats.packetsLostRate) ? stats.packetsLostRate.toFixed(2) : 0}/s`;
|
1448
|
-
return /* @__PURE__ */
|
1525
|
+
return /* @__PURE__ */ React11.createElement(
|
1449
1526
|
StatsRow,
|
1450
1527
|
{
|
1451
1528
|
show: isNotNullishAndNot0(stats == null ? void 0 : stats.packetsLost),
|
@@ -1460,10 +1537,10 @@ var RawStatsRow = ({
|
|
1460
1537
|
tooltip = "",
|
1461
1538
|
show = true
|
1462
1539
|
}) => {
|
1463
|
-
const statsLabel = /* @__PURE__ */
|
1464
|
-
return /* @__PURE__ */
|
1540
|
+
const statsLabel = /* @__PURE__ */ React11.createElement(Stats.Label, { css: { fontWeight: !value ? "$semiBold" : "$regular" } }, label);
|
1541
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, show ? /* @__PURE__ */ React11.createElement(Stats.Row, null, tooltip ? /* @__PURE__ */ React11.createElement(Tooltip, { side: "top", title: tooltip }, statsLabel) : statsLabel, value === "" ? /* @__PURE__ */ React11.createElement(Stats.Value, null) : /* @__PURE__ */ React11.createElement(Stats.Value, null, value)) : null);
|
1465
1542
|
};
|
1466
|
-
var StatsRow =
|
1543
|
+
var StatsRow = React11.memo(RawStatsRow);
|
1467
1544
|
function isNotNullishAndNot0(value) {
|
1468
1545
|
return isNotNullish(value) && value !== 0;
|
1469
1546
|
}
|
@@ -1542,7 +1619,7 @@ var RadioGroup = {
|
|
1542
1619
|
};
|
1543
1620
|
|
1544
1621
|
// src/Toast/Toast.tsx
|
1545
|
-
import
|
1622
|
+
import React12 from "react";
|
1546
1623
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
1547
1624
|
import { CrossIcon as CrossIcon2 } from "@100mslive/react-icons";
|
1548
1625
|
var getToastVariant = (base) => {
|
@@ -1633,7 +1710,7 @@ var ToastViewport = styled(ToastPrimitives.Viewport, {
|
|
1633
1710
|
zIndex: 1e3
|
1634
1711
|
});
|
1635
1712
|
var DefaultClose = ({ css: css2 }) => {
|
1636
|
-
return /* @__PURE__ */
|
1713
|
+
return /* @__PURE__ */ React12.createElement(ToastClose, { css: css2, asChild: true }, /* @__PURE__ */ React12.createElement(IconButton, null, /* @__PURE__ */ React12.createElement(CrossIcon2, null)));
|
1637
1714
|
};
|
1638
1715
|
var HMSToast = (_a7) => {
|
1639
1716
|
var _b7 = _a7, {
|
@@ -1651,7 +1728,7 @@ var HMSToast = (_a7) => {
|
|
1651
1728
|
"action",
|
1652
1729
|
"inlineAction"
|
1653
1730
|
]);
|
1654
|
-
return /* @__PURE__ */
|
1731
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(ToastRoot, __spreadValues({}, props), /* @__PURE__ */ React12.createElement(ToastTitle, null, /* @__PURE__ */ React12.createElement(Flex, { align: "center", css: { gap: "$4", flex: "1 1 0", minWidth: 0 } }, icon ? /* @__PURE__ */ React12.createElement(Box, { css: { w: "$10", h: "$10", alignSelf: "start", mt: "$2" } }, icon) : null, /* @__PURE__ */ React12.createElement(Text, { variant: "sub1", css: { c: "inherit", wordBreak: "break-word" } }, title)), isClosable ? /* @__PURE__ */ React12.createElement(DefaultClose, null) : null, !isClosable && inlineAction && action ? /* @__PURE__ */ React12.createElement(ToastAction, { altText: `${title}Action` }, action) : null), description ? /* @__PURE__ */ React12.createElement(ToastDescription, null, /* @__PURE__ */ React12.createElement(Text, { variant: "body1", css: { fontWeight: "$regular", c: "$on_surface_medium" } }, description)) : null, !inlineAction && action ? /* @__PURE__ */ React12.createElement(ToastAction, { altText: `${title}Action`, css: { mt: "$10" } }, action) : null));
|
1655
1732
|
};
|
1656
1733
|
var Toast = {
|
1657
1734
|
Provider: ToastPrimitives.Provider,
|
@@ -1665,7 +1742,7 @@ var Toast = {
|
|
1665
1742
|
};
|
1666
1743
|
|
1667
1744
|
// src/Accordion/Accordion.tsx
|
1668
|
-
import
|
1745
|
+
import React13 from "react";
|
1669
1746
|
import * as BaseAccordion from "@radix-ui/react-accordion";
|
1670
1747
|
import { ChevronUpIcon } from "@100mslive/react-icons";
|
1671
1748
|
var StyledAccordion = styled(BaseAccordion.Root, {});
|
@@ -1717,14 +1794,14 @@ var StyledChevron = styled(ChevronUpIcon, {
|
|
1717
1794
|
});
|
1718
1795
|
var AccordionRoot = StyledAccordion;
|
1719
1796
|
var AccordionItem = StyledItem;
|
1720
|
-
var AccordionHeader =
|
1797
|
+
var AccordionHeader = React13.forwardRef((_a7, forwardedRef) => {
|
1721
1798
|
var _b7 = _a7, { children, iconStyles, css: css2 } = _b7, props = __objRest(_b7, ["children", "iconStyles", "css"]);
|
1722
|
-
return /* @__PURE__ */
|
1799
|
+
return /* @__PURE__ */ React13.createElement(StyledHeader, { css: css2 }, /* @__PURE__ */ React13.createElement(StyledTrigger3, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), children, /* @__PURE__ */ React13.createElement(StyledChevron, { "aria-hidden": true, css: iconStyles })));
|
1723
1800
|
});
|
1724
|
-
var AccordionContent =
|
1801
|
+
var AccordionContent = React13.forwardRef(
|
1725
1802
|
(_a7, forwardedRef) => {
|
1726
1803
|
var _b7 = _a7, { children, contentStyles } = _b7, props = __objRest(_b7, ["children", "contentStyles"]);
|
1727
|
-
return /* @__PURE__ */
|
1804
|
+
return /* @__PURE__ */ React13.createElement(StyledContent3, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), /* @__PURE__ */ React13.createElement(Box, { css: contentStyles }, children));
|
1728
1805
|
}
|
1729
1806
|
);
|
1730
1807
|
|
@@ -1918,14 +1995,14 @@ var Tabs = {
|
|
1918
1995
|
};
|
1919
1996
|
|
1920
1997
|
// src/QRCode/QRCode.tsx
|
1921
|
-
import
|
1998
|
+
import React14 from "react";
|
1922
1999
|
import { QRCodeSVG } from "qrcode.react";
|
1923
2000
|
var QRCode = (props) => {
|
1924
|
-
return /* @__PURE__ */
|
2001
|
+
return /* @__PURE__ */ React14.createElement(QRCodeSVG, __spreadValues({ style: { width: "100%", height: "100%" } }, props));
|
1925
2002
|
};
|
1926
2003
|
|
1927
2004
|
// src/Link/Link.tsx
|
1928
|
-
import
|
2005
|
+
import React15 from "react";
|
1929
2006
|
import * as icons from "@100mslive/react-icons";
|
1930
2007
|
var LinkComponent = styled("a", {
|
1931
2008
|
textDecoration: "none",
|
@@ -1951,9 +2028,9 @@ var LinkComponent = styled("a", {
|
|
1951
2028
|
});
|
1952
2029
|
var Link = (_a7) => {
|
1953
2030
|
var _b7 = _a7, { iconSide = "left", icon, color = "primary", children } = _b7, rest = __objRest(_b7, ["iconSide", "icon", "color", "children"]);
|
1954
|
-
const Icon2 = icon ? icons[icon] :
|
1955
|
-
const renderedIcon = icon ? /* @__PURE__ */
|
1956
|
-
return /* @__PURE__ */
|
2031
|
+
const Icon2 = icon ? icons[icon] : React15.Fragment;
|
2032
|
+
const renderedIcon = icon ? /* @__PURE__ */ React15.createElement(Flex, { as: "span" }, /* @__PURE__ */ React15.createElement(Icon2, { height: 13.33, width: 13.33 }), " ") : null;
|
2033
|
+
return /* @__PURE__ */ React15.createElement(LinkComponent, __spreadProps(__spreadValues({}, rest), { color }), iconSide === "left" && renderedIcon, /* @__PURE__ */ React15.createElement(Text, { as: "span", variant: "body2", css: { color: "inherit" } }, children), iconSide === "right" && renderedIcon);
|
1957
2034
|
};
|
1958
2035
|
|
1959
2036
|
// src/Collapsible/Collapsible.tsx
|
@@ -1987,18 +2064,18 @@ var Collapsible = {
|
|
1987
2064
|
};
|
1988
2065
|
|
1989
2066
|
// src/Prebuilt/App.tsx
|
1990
|
-
import
|
2067
|
+
import React59, { Suspense as Suspense2, useEffect as useEffect29, useRef as useRef10 } from "react";
|
1991
2068
|
import { BrowserRouter, MemoryRouter, Navigate, Route, Routes, useParams as useParams5 } from "react-router-dom";
|
1992
2069
|
import {
|
1993
2070
|
HMSReactiveStore,
|
1994
2071
|
HMSRoomProvider,
|
1995
2072
|
selectIsConnectedToRoom as selectIsConnectedToRoom6,
|
1996
|
-
useHMSActions as
|
1997
|
-
useHMSStore as
|
2073
|
+
useHMSActions as useHMSActions18,
|
2074
|
+
useHMSStore as useHMSStore26
|
1998
2075
|
} from "@100mslive/react-sdk";
|
1999
2076
|
|
2000
2077
|
// src/Prebuilt/components/AppData/AppData.jsx
|
2001
|
-
import
|
2078
|
+
import React16, { useEffect as useEffect4 } from "react";
|
2002
2079
|
import {
|
2003
2080
|
HMSRoomState,
|
2004
2081
|
selectAvailableRoleNames,
|
@@ -2084,7 +2161,7 @@ var useUserPreferences = (key, defaultPreference) => {
|
|
2084
2161
|
|
2085
2162
|
// src/Prebuilt/components/AppData/useSidepane.js
|
2086
2163
|
import { useCallback as useCallback3 } from "react";
|
2087
|
-
import { selectAppData, useHMSActions, useHMSStore as useHMSStore2, useHMSVanillaStore } from "@100mslive/react-sdk";
|
2164
|
+
import { selectAppData, useHMSActions, useHMSStore as useHMSStore2, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
2088
2165
|
|
2089
2166
|
// src/Prebuilt/common/constants.js
|
2090
2167
|
import { parsedUserAgent } from "@100mslive/react-sdk";
|
@@ -2126,7 +2203,7 @@ var APP_DATA = {
|
|
2126
2203
|
pdfConfig: "pdfConfig",
|
2127
2204
|
minimiseInset: "minimiseInset",
|
2128
2205
|
activeScreensharePeerId: "activeScreensharePeerId",
|
2129
|
-
|
2206
|
+
disableNotifications: "disableNotifications"
|
2130
2207
|
};
|
2131
2208
|
var UI_SETTINGS = {
|
2132
2209
|
isAudioOnly: "isAudioOnly",
|
@@ -2182,7 +2259,7 @@ var useSidepaneState = () => {
|
|
2182
2259
|
};
|
2183
2260
|
var useSidepaneToggle = (sidepaneType) => {
|
2184
2261
|
const hmsActions = useHMSActions();
|
2185
|
-
const vanillaStore =
|
2262
|
+
const vanillaStore = useHMSVanillaStore2();
|
2186
2263
|
const toggleSidepane = useCallback3(() => {
|
2187
2264
|
const isOpen = vanillaStore.getState(selectAppData(APP_DATA.sidePane)) === sidepaneType;
|
2188
2265
|
hmsActions.setAppData(APP_DATA.sidePane, !isOpen ? sidepaneType : "");
|
@@ -2208,7 +2285,7 @@ import {
|
|
2208
2285
|
selectVideoTrackByPeerID,
|
2209
2286
|
useHMSActions as useHMSActions2,
|
2210
2287
|
useHMSStore as useHMSStore3,
|
2211
|
-
useHMSVanillaStore as
|
2288
|
+
useHMSVanillaStore as useHMSVanillaStore3
|
2212
2289
|
} from "@100mslive/react-sdk";
|
2213
2290
|
var useUISettings = (uiSettingKey) => {
|
2214
2291
|
const uiSettings = useHMSStore3(selectAppDataByPath(APP_DATA.uiSettings, uiSettingKey));
|
@@ -2252,7 +2329,7 @@ var useSubscribedNotifications = (notificationKey) => {
|
|
2252
2329
|
return notificationPreference;
|
2253
2330
|
};
|
2254
2331
|
var useIsNotificationDisabled = () => {
|
2255
|
-
const notificationPreference = useHMSStore3(selectAppDataByPath(APP_DATA.
|
2332
|
+
const notificationPreference = useHMSStore3(selectAppDataByPath(APP_DATA.disableNotifications));
|
2256
2333
|
return notificationPreference;
|
2257
2334
|
};
|
2258
2335
|
var useSetSubscribedNotifications = (notificationKey) => {
|
@@ -2288,7 +2365,7 @@ var useSetAppDataByKey = (appDataKey) => {
|
|
2288
2365
|
};
|
2289
2366
|
var useSetAppData = ({ key1, key2 }) => {
|
2290
2367
|
const actions = useHMSActions2();
|
2291
|
-
const store =
|
2368
|
+
const store = useHMSVanillaStore3();
|
2292
2369
|
const [, setPreferences] = useUserPreferences(UserPreferencesKeys.UI_SETTINGS);
|
2293
2370
|
const setValue = useCallback4(
|
2294
2371
|
(value) => {
|
@@ -2351,9 +2428,9 @@ var initialAppData = {
|
|
2351
2428
|
[APP_DATA.authToken]: "",
|
2352
2429
|
[APP_DATA.minimiseInset]: false,
|
2353
2430
|
[APP_DATA.activeScreensharePeerId]: "",
|
2354
|
-
[APP_DATA.
|
2431
|
+
[APP_DATA.disableNotifications]: false
|
2355
2432
|
};
|
2356
|
-
var AppData =
|
2433
|
+
var AppData = React16.memo(({ appDetails, tokenEndpoint }) => {
|
2357
2434
|
const hmsActions = useHMSActions3();
|
2358
2435
|
const isConnected = useHMSStore4(selectIsConnectedToRoom);
|
2359
2436
|
const sidePane = useSidepaneState();
|
@@ -2363,27 +2440,27 @@ var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
2363
2440
|
const rolesMap = useHMSStore4(selectRolesMap);
|
2364
2441
|
const localPeerRole = useHMSStore4(selectLocalPeerRoleName);
|
2365
2442
|
const appData = useHMSStore4(selectFullAppData);
|
2366
|
-
|
2443
|
+
useEffect4(() => {
|
2367
2444
|
if (!isConnected && sidePane && sidePane !== SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
2368
2445
|
resetSidePane();
|
2369
2446
|
}
|
2370
2447
|
}, [isConnected, sidePane, resetSidePane]);
|
2371
|
-
|
2448
|
+
useEffect4(() => {
|
2372
2449
|
hmsActions.initAppData(__spreadValues(__spreadValues({}, initialAppData), appData));
|
2373
2450
|
hmsActions.setFrameworkInfo({
|
2374
2451
|
type: "react-web",
|
2375
2452
|
isPrebuilt: true,
|
2376
|
-
version:
|
2453
|
+
version: React16.version
|
2377
2454
|
});
|
2378
2455
|
}, [hmsActions]);
|
2379
|
-
|
2456
|
+
useEffect4(() => {
|
2380
2457
|
const uiSettings = preferences || {};
|
2381
2458
|
const updatedSettings = __spreadProps(__spreadValues({}, uiSettings), {
|
2382
2459
|
[UI_SETTINGS.uiViewMode]: uiSettings.uiViewMode || UI_MODE_GRID
|
2383
2460
|
});
|
2384
2461
|
hmsActions.setAppData(APP_DATA.uiSettings, updatedSettings, true);
|
2385
2462
|
}, [preferences, hmsActions]);
|
2386
|
-
|
2463
|
+
useEffect4(() => {
|
2387
2464
|
const appData2 = {
|
2388
2465
|
[APP_DATA.tokenEndpoint]: tokenEndpoint,
|
2389
2466
|
[APP_DATA.appConfig]: getAppDetails(appDetails)
|
@@ -2392,19 +2469,19 @@ var AppData = React15.memo(({ appDetails, tokenEndpoint }) => {
|
|
2392
2469
|
hmsActions.setAppData([key], appData2[key]);
|
2393
2470
|
}
|
2394
2471
|
}, [appDetails, tokenEndpoint, hmsActions]);
|
2395
|
-
|
2472
|
+
useEffect4(() => {
|
2396
2473
|
if (!preferences.subscribedNotifications) {
|
2397
2474
|
return;
|
2398
2475
|
}
|
2399
2476
|
hmsActions.setAppData(APP_DATA.subscribedNotifications, preferences.subscribedNotifications, true);
|
2400
2477
|
}, [preferences.subscribedNotifications, hmsActions]);
|
2401
|
-
|
2478
|
+
useEffect4(() => {
|
2402
2479
|
if (localPeerRole) {
|
2403
2480
|
const config2 = normalizeAppPolicyConfig(roleNames, rolesMap);
|
2404
2481
|
hmsActions.setAppData(APP_DATA.appLayout, config2[localPeerRole]);
|
2405
2482
|
}
|
2406
2483
|
}, [roleNames, rolesMap, localPeerRole, hmsActions]);
|
2407
|
-
return /* @__PURE__ */
|
2484
|
+
return /* @__PURE__ */ React16.createElement(ResetStreamingStart, null);
|
2408
2485
|
});
|
2409
2486
|
var ResetStreamingStart = () => {
|
2410
2487
|
const { isHLSRunning, isRTMPRunning, isBrowserRecordingOn } = useRecordingStreaming();
|
@@ -2416,19 +2493,19 @@ var ResetStreamingStart = () => {
|
|
2416
2493
|
const [rtmpStarted, setRTMPStarted] = useSetAppDataByKey(APP_DATA.rtmpStarted);
|
2417
2494
|
const toggleStreaming = useSidepaneToggle(SIDE_PANE_OPTIONS.STREAMING);
|
2418
2495
|
const isStreamingOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.STREAMING);
|
2419
|
-
|
2496
|
+
useEffect4(() => {
|
2420
2497
|
if (isBrowserRecordingOn && recordingStarted) {
|
2421
2498
|
setRecordingStarted(false);
|
2422
2499
|
}
|
2423
2500
|
}, [isBrowserRecordingOn, recordingStarted, setRecordingStarted]);
|
2424
|
-
|
2501
|
+
useEffect4(() => {
|
2425
2502
|
if (roomState === HMSRoomState.Disconnected) {
|
2426
2503
|
setHLSStarted(false);
|
2427
2504
|
setRecordingStarted(false);
|
2428
2505
|
setRTMPStarted(false);
|
2429
2506
|
}
|
2430
2507
|
}, [roomState, setHLSStarted, setRTMPStarted, setRecordingStarted]);
|
2431
|
-
|
2508
|
+
useEffect4(() => {
|
2432
2509
|
if (isHLSRunning || hlsError) {
|
2433
2510
|
if (hlsStarted) {
|
2434
2511
|
setHLSStarted(false);
|
@@ -2438,7 +2515,7 @@ var ResetStreamingStart = () => {
|
|
2438
2515
|
}
|
2439
2516
|
}
|
2440
2517
|
}, [isHLSRunning, hlsStarted, setHLSStarted, hlsError, isStreamingOpen, toggleStreaming]);
|
2441
|
-
|
2518
|
+
useEffect4(() => {
|
2442
2519
|
if (isRTMPRunning || rtmpError || isBrowserRecordingOn) {
|
2443
2520
|
if (rtmpStarted) {
|
2444
2521
|
setRTMPStarted(false);
|
@@ -2452,17 +2529,18 @@ var ResetStreamingStart = () => {
|
|
2452
2529
|
};
|
2453
2530
|
|
2454
2531
|
// src/Prebuilt/components/AuthToken.jsx
|
2455
|
-
import
|
2532
|
+
import React20, { useEffect as useEffect5, useState as useState4 } from "react";
|
2456
2533
|
import { useHMSActions as useHMSActions4 } from "@100mslive/react-sdk";
|
2457
2534
|
|
2458
2535
|
// src/Prebuilt/AppContext.tsx
|
2459
|
-
import
|
2460
|
-
var HMSPrebuiltContext =
|
2536
|
+
import React17, { useContext } from "react";
|
2537
|
+
var HMSPrebuiltContext = React17.createContext({
|
2461
2538
|
roomCode: "",
|
2462
2539
|
userName: "",
|
2463
2540
|
userId: "",
|
2464
2541
|
endpoints: {},
|
2465
|
-
onLeave: void 0
|
2542
|
+
onLeave: void 0,
|
2543
|
+
onJoin: void 0
|
2466
2544
|
});
|
2467
2545
|
HMSPrebuiltContext.displayName = "HMSPrebuiltContext";
|
2468
2546
|
var useHMSPrebuiltContext = () => {
|
@@ -2474,15 +2552,21 @@ var useHMSPrebuiltContext = () => {
|
|
2474
2552
|
};
|
2475
2553
|
|
2476
2554
|
// src/Prebuilt/primitives/DialogContent.jsx
|
2477
|
-
import
|
2555
|
+
import React19, { useRef as useRef4 } from "react";
|
2478
2556
|
import { CheckIcon, CloudUploadIcon, CrossIcon as CrossIcon3 } from "@100mslive/react-icons";
|
2557
|
+
|
2558
|
+
// src/Prebuilt/components/PrebuiltDialogPortal.tsx
|
2559
|
+
import React18 from "react";
|
2560
|
+
var PrebuiltDialogPortal = ({ children }) => /* @__PURE__ */ React18.createElement(Dialog.Portal, { container: document.getElementById("prebuilt-container") }, children);
|
2561
|
+
|
2562
|
+
// src/Prebuilt/primitives/DialogContent.jsx
|
2479
2563
|
var DialogContent = (_a7) => {
|
2480
2564
|
var _b7 = _a7, { Icon: Icon2, title, closeable = true, children, css: css2, iconCSS = {} } = _b7, props = __objRest(_b7, ["Icon", "title", "closeable", "children", "css", "iconCSS"]);
|
2481
|
-
return /* @__PURE__ */
|
2565
|
+
return /* @__PURE__ */ React19.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React19.createElement(Dialog.Overlay, null), /* @__PURE__ */ React19.createElement(Dialog.Content, __spreadValues({ css: __spreadValues({ width: "min(600px, 100%)" }, css2) }, props), /* @__PURE__ */ React19.createElement(Dialog.Title, null, /* @__PURE__ */ React19.createElement(Flex, { justify: "between" }, /* @__PURE__ */ React19.createElement(Flex, { align: "center", css: { mb: "$1" } }, Icon2 ? /* @__PURE__ */ React19.createElement(Box, { css: __spreadValues({ mr: "$2", color: "$on_primary_high" }, iconCSS) }, /* @__PURE__ */ React19.createElement(Icon2, null)) : null, /* @__PURE__ */ React19.createElement(Text, { variant: "h6", inline: true }, title)), closeable && /* @__PURE__ */ React19.createElement(Dialog.DefaultClose, { "data-testid": "dialoge_cross_icon" }))), /* @__PURE__ */ React19.createElement(HorizontalDivider, { css: { mt: "0.8rem" } }), /* @__PURE__ */ React19.createElement(Box, null, children)));
|
2482
2566
|
};
|
2483
2567
|
var ErrorDialog = (_a7) => {
|
2484
2568
|
var _b7 = _a7, { open = true, onOpenChange, title, children } = _b7, props = __objRest(_b7, ["open", "onOpenChange", "title", "children"]);
|
2485
|
-
return /* @__PURE__ */
|
2569
|
+
return /* @__PURE__ */ React19.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React19.createElement(
|
2486
2570
|
DialogContent,
|
2487
2571
|
__spreadValues({
|
2488
2572
|
Icon: CrossIcon3,
|
@@ -2493,10 +2577,10 @@ var ErrorDialog = (_a7) => {
|
|
2493
2577
|
closeable: false,
|
2494
2578
|
iconCSS: { color: "$alert_error_default" }
|
2495
2579
|
}, props),
|
2496
|
-
/* @__PURE__ */
|
2580
|
+
/* @__PURE__ */ React19.createElement(Box, { css: { mt: "$lg" } }, children)
|
2497
2581
|
));
|
2498
2582
|
};
|
2499
|
-
var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Accept", onAction, Icon: Icon2 }) => /* @__PURE__ */
|
2583
|
+
var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Accept", onAction, Icon: Icon2 }) => /* @__PURE__ */ React19.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React19.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React19.createElement(Dialog.Overlay, null), /* @__PURE__ */ React19.createElement(Dialog.Content, { css: { width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React19.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md" } }, Icon2 ? Icon2 : null, /* @__PURE__ */ React19.createElement(Text, { variant: "h6" }, title)), typeof body === "string" ? /* @__PURE__ */ React19.createElement(
|
2500
2584
|
Text,
|
2501
2585
|
{
|
2502
2586
|
variant: "md",
|
@@ -2508,7 +2592,7 @@ var RequestDialog = ({ open = true, onOpenChange, title, body, actionText = "Acc
|
|
2508
2592
|
}
|
2509
2593
|
},
|
2510
2594
|
body
|
2511
|
-
) : /* @__PURE__ */
|
2595
|
+
) : /* @__PURE__ */ React19.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React19.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md" } }, /* @__PURE__ */ React19.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React19.createElement(Dialog.Close, { css: { width: "100%" } }, /* @__PURE__ */ React19.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%" } }, "Cancel"))), /* @__PURE__ */ React19.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React19.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction }, actionText))))));
|
2512
2596
|
var DialogRow = ({ children, breakSm = false, css: css2, justify = "between" }) => {
|
2513
2597
|
let finalCSS = {
|
2514
2598
|
margin: "$10 0",
|
@@ -2523,7 +2607,7 @@ var DialogRow = ({ children, breakSm = false, css: css2, justify = "between" })
|
|
2523
2607
|
if (css2) {
|
2524
2608
|
finalCSS = Object.assign(finalCSS, css2);
|
2525
2609
|
}
|
2526
|
-
return /* @__PURE__ */
|
2610
|
+
return /* @__PURE__ */ React19.createElement(Flex, { align: "center", justify, css: finalCSS }, children);
|
2527
2611
|
};
|
2528
2612
|
var DialogCol = (_a7) => {
|
2529
2613
|
var _b7 = _a7, { children, breakSm = false, css: css2, align = "center", justify = "between" } = _b7, props = __objRest(_b7, ["children", "breakSm", "css", "align", "justify"]);
|
@@ -2539,20 +2623,20 @@ var DialogCol = (_a7) => {
|
|
2539
2623
|
if (css2) {
|
2540
2624
|
finalCSS = Object.assign(finalCSS, css2);
|
2541
2625
|
}
|
2542
|
-
return /* @__PURE__ */
|
2626
|
+
return /* @__PURE__ */ React19.createElement(Flex, __spreadValues({ direction: "column", align, justify, css: finalCSS }, props), children);
|
2543
2627
|
};
|
2544
2628
|
var DialogSelect = (_a7) => {
|
2545
2629
|
var _b7 = _a7, { title, options, keyField, labelField, selected, onChange } = _b7, props = __objRest(_b7, ["title", "options", "keyField", "labelField", "selected", "onChange"]);
|
2546
|
-
return /* @__PURE__ */
|
2630
|
+
return /* @__PURE__ */ React19.createElement(DialogRow, { breakSm: true }, /* @__PURE__ */ React19.createElement(Label3, null, title), /* @__PURE__ */ React19.createElement(Select.Root, __spreadValues({ "data-testid": `dialog_select_${title}`, css: { width: "70%", "@sm": { width: "100%" } } }, props), /* @__PURE__ */ React19.createElement(Select.DefaultDownIcon, null), /* @__PURE__ */ React19.createElement(Select.Select, { onChange: (e) => onChange(e.target.value), value: selected, css: { width: "100%" } }, options.map((option) => {
|
2547
2631
|
const id = keyField ? option[keyField] : option;
|
2548
2632
|
const label = labelField ? option[labelField] : option;
|
2549
|
-
return /* @__PURE__ */
|
2633
|
+
return /* @__PURE__ */ React19.createElement("option", { value: id, key: id }, label);
|
2550
2634
|
}))));
|
2551
2635
|
};
|
2552
2636
|
var DialogInputFile = (_a7) => {
|
2553
2637
|
var _b7 = _a7, { value, onChange, placeholder, disabled, type } = _b7, props = __objRest(_b7, ["value", "onChange", "placeholder", "disabled", "type"]);
|
2554
|
-
const inputRef =
|
2555
|
-
return /* @__PURE__ */
|
2638
|
+
const inputRef = useRef4();
|
2639
|
+
return /* @__PURE__ */ React19.createElement(
|
2556
2640
|
DialogCol,
|
2557
2641
|
{
|
2558
2642
|
breakSm: true,
|
@@ -2573,7 +2657,7 @@ var DialogInputFile = (_a7) => {
|
|
2573
2657
|
},
|
2574
2658
|
gap: "8"
|
2575
2659
|
},
|
2576
|
-
/* @__PURE__ */
|
2660
|
+
/* @__PURE__ */ React19.createElement(
|
2577
2661
|
IconButton,
|
2578
2662
|
{
|
2579
2663
|
variant: "standard",
|
@@ -2587,7 +2671,7 @@ var DialogInputFile = (_a7) => {
|
|
2587
2671
|
}
|
2588
2672
|
}
|
2589
2673
|
},
|
2590
|
-
/* @__PURE__ */
|
2674
|
+
/* @__PURE__ */ React19.createElement(
|
2591
2675
|
CloudUploadIcon,
|
2592
2676
|
{
|
2593
2677
|
style: {
|
@@ -2597,7 +2681,7 @@ var DialogInputFile = (_a7) => {
|
|
2597
2681
|
}
|
2598
2682
|
)
|
2599
2683
|
),
|
2600
|
-
/* @__PURE__ */
|
2684
|
+
/* @__PURE__ */ React19.createElement(Flex, { direction: "row" }, /* @__PURE__ */ React19.createElement(
|
2601
2685
|
Input,
|
2602
2686
|
__spreadValues({
|
2603
2687
|
ref: inputRef,
|
@@ -2609,7 +2693,7 @@ var DialogInputFile = (_a7) => {
|
|
2609
2693
|
type,
|
2610
2694
|
hidden: true
|
2611
2695
|
}, props)
|
2612
|
-
), /* @__PURE__ */
|
2696
|
+
), /* @__PURE__ */ React19.createElement(
|
2613
2697
|
IconButton,
|
2614
2698
|
{
|
2615
2699
|
variant: "standard",
|
@@ -2623,20 +2707,20 @@ var DialogInputFile = (_a7) => {
|
|
2623
2707
|
}
|
2624
2708
|
}
|
2625
2709
|
},
|
2626
|
-
/* @__PURE__ */
|
2710
|
+
/* @__PURE__ */ React19.createElement(Text, { variant: "md" }, placeholder)
|
2627
2711
|
))
|
2628
2712
|
);
|
2629
2713
|
};
|
2630
2714
|
|
2631
2715
|
// src/Prebuilt/components/AuthToken.jsx
|
2632
|
-
var AuthToken =
|
2716
|
+
var AuthToken = React20.memo(({ authTokenByRoomCodeEndpoint, defaultAuthToken }) => {
|
2633
2717
|
const hmsActions = useHMSActions4();
|
2634
2718
|
const tokenEndpoint = useTokenEndpoint();
|
2635
2719
|
const { roomCode, userId } = useHMSPrebuiltContext();
|
2636
2720
|
const [error, setError] = useState4({ title: "", body: "" });
|
2637
2721
|
let authToken = defaultAuthToken;
|
2638
2722
|
const [, setAuthTokenInAppData] = useSetAppDataByKey(APP_DATA.authToken);
|
2639
|
-
|
2723
|
+
useEffect5(() => {
|
2640
2724
|
if (authToken) {
|
2641
2725
|
setAuthTokenInAppData(authToken);
|
2642
2726
|
return;
|
@@ -2647,7 +2731,7 @@ var AuthToken = React18.memo(({ authTokenByRoomCodeEndpoint, defaultAuthToken })
|
|
2647
2731
|
hmsActions.getAuthTokenByRoomCode({ roomCode, userId }, { endpoint: authTokenByRoomCodeEndpoint }).then((token) => setAuthTokenInAppData(token)).catch((error2) => setError(convertError(error2)));
|
2648
2732
|
}, [hmsActions, tokenEndpoint, authToken, authTokenByRoomCodeEndpoint, setAuthTokenInAppData, roomCode, userId]);
|
2649
2733
|
if (error.title) {
|
2650
|
-
return /* @__PURE__ */
|
2734
|
+
return /* @__PURE__ */ React20.createElement(ErrorDialog, { title: error.title }, error.body);
|
2651
2735
|
}
|
2652
2736
|
return null;
|
2653
2737
|
});
|
@@ -2691,11 +2775,11 @@ var convertError = (error) => {
|
|
2691
2775
|
var Link2 = styled("a", {
|
2692
2776
|
color: "#2f80e1"
|
2693
2777
|
});
|
2694
|
-
var ErrorWithSupportLink = (errorMessage) => /* @__PURE__ */
|
2778
|
+
var ErrorWithSupportLink = (errorMessage) => /* @__PURE__ */ React20.createElement("div", null, errorMessage, " If you think this is a mistake on our side, please create", " ", /* @__PURE__ */ React20.createElement(Link2, { target: "_blank", href: "https://github.com/100mslive/100ms-web/issues", rel: "noreferrer" }, "an issue"), " ", "or reach out over", " ", /* @__PURE__ */ React20.createElement(Link2, { target: "_blank", href: "https://discord.com/invite/kGdmszyzq2", rel: "noreferrer" }, "Discord"), ".");
|
2695
2779
|
var AuthToken_default = AuthToken;
|
2696
2780
|
|
2697
2781
|
// src/Prebuilt/components/ErrorBoundary.jsx
|
2698
|
-
import
|
2782
|
+
import React21, { Component } from "react";
|
2699
2783
|
import { CopyIcon as CopyIcon2 } from "@100mslive/react-icons";
|
2700
2784
|
var ErrorBoundary = class extends Component {
|
2701
2785
|
constructor(props) {
|
@@ -2711,7 +2795,7 @@ var ErrorBoundary = class extends Component {
|
|
2711
2795
|
}
|
2712
2796
|
render() {
|
2713
2797
|
if (this.state.errorInfo) {
|
2714
|
-
return /* @__PURE__ */
|
2798
|
+
return /* @__PURE__ */ React21.createElement(
|
2715
2799
|
Flex,
|
2716
2800
|
{
|
2717
2801
|
align: "center",
|
@@ -2724,7 +2808,7 @@ var ErrorBoundary = class extends Component {
|
|
2724
2808
|
backgroundColor: "$background_default"
|
2725
2809
|
}
|
2726
2810
|
},
|
2727
|
-
/* @__PURE__ */
|
2811
|
+
/* @__PURE__ */ React21.createElement(Box, { css: { position: "relative", overflow: "hidden", r: "$3", height: "100%", width: "100%" } }, /* @__PURE__ */ React21.createElement(
|
2728
2812
|
Flex,
|
2729
2813
|
{
|
2730
2814
|
direction: "column",
|
@@ -2735,8 +2819,8 @@ var ErrorBoundary = class extends Component {
|
|
2735
2819
|
left: 0
|
2736
2820
|
}
|
2737
2821
|
},
|
2738
|
-
/* @__PURE__ */
|
2739
|
-
/* @__PURE__ */
|
2822
|
+
/* @__PURE__ */ React21.createElement("div", { style: { margin: "1.5rem", width: "100%" } }, /* @__PURE__ */ React21.createElement(Text, null, "Something went wrong"), /* @__PURE__ */ React21.createElement(Text, null, "Message: $", this.state.error), /* @__PURE__ */ React21.createElement("br", null), ErrorWithSupportLink(`Please reload to see if it works.`)),
|
2823
|
+
/* @__PURE__ */ React21.createElement(Flex, null, /* @__PURE__ */ React21.createElement(Tooltip, { title: "Reload page" }, /* @__PURE__ */ React21.createElement(
|
2740
2824
|
Button,
|
2741
2825
|
{
|
2742
2826
|
onClick: () => {
|
@@ -2746,7 +2830,7 @@ var ErrorBoundary = class extends Component {
|
|
2746
2830
|
"data-testid": "join_again_btn"
|
2747
2831
|
},
|
2748
2832
|
"Reload"
|
2749
|
-
)), /* @__PURE__ */
|
2833
|
+
)), /* @__PURE__ */ React21.createElement(Tooltip, { title: "Copy error details to clipboard" }, /* @__PURE__ */ React21.createElement(
|
2750
2834
|
Button,
|
2751
2835
|
{
|
2752
2836
|
onClick: () => {
|
@@ -2762,11 +2846,11 @@ var ErrorBoundary = class extends Component {
|
|
2762
2846
|
css: { mx: "$8" },
|
2763
2847
|
"data-testid": "join_again_btn"
|
2764
2848
|
},
|
2765
|
-
/* @__PURE__ */
|
2849
|
+
/* @__PURE__ */ React21.createElement(CopyIcon2, null),
|
2766
2850
|
" ",
|
2767
2851
|
this.state.isErrorCopied ? "Copied" : "Copy Details"
|
2768
2852
|
))),
|
2769
|
-
/* @__PURE__ */
|
2853
|
+
/* @__PURE__ */ React21.createElement("details", { style: { whiteSpace: "pre-wrap", margin: "1.5rem" } }, /* @__PURE__ */ React21.createElement(Text, null, this.state.error && this.state.error.toString()), /* @__PURE__ */ React21.createElement("br", null), /* @__PURE__ */ React21.createElement(Text, null, JSON.stringify(this.state.errorInfo)))
|
2770
2854
|
))
|
2771
2855
|
);
|
2772
2856
|
}
|
@@ -2775,15 +2859,15 @@ var ErrorBoundary = class extends Component {
|
|
2775
2859
|
};
|
2776
2860
|
|
2777
2861
|
// src/Prebuilt/components/FullPageProgress.jsx
|
2778
|
-
import
|
2779
|
-
var FullPageProgress = ({ loaderColor = "$primary_default", text = "", css: css2 = {} }) => /* @__PURE__ */
|
2862
|
+
import React22 from "react";
|
2863
|
+
var FullPageProgress = ({ loaderColor = "$primary_default", text = "", css: css2 = {} }) => /* @__PURE__ */ React22.createElement(Flex, { direction: "column", justify: "center", align: "center", css: __spreadValues({ size: "100%", color: loaderColor }, css2) }, /* @__PURE__ */ React22.createElement(Loading, { color: "currentColor", size: 100 }), text ? /* @__PURE__ */ React22.createElement(Text, { css: { mt: "$10", color: "$on_surface_high" } }, text) : null);
|
2780
2864
|
var FullPageProgress_default = FullPageProgress;
|
2781
2865
|
|
2782
2866
|
// src/Prebuilt/components/init/Init.jsx
|
2783
|
-
import
|
2867
|
+
import React23, { useEffect as useEffect7 } from "react";
|
2784
2868
|
|
2785
2869
|
// src/Prebuilt/services/FeatureFlags.jsx
|
2786
|
-
import { useEffect as
|
2870
|
+
import { useEffect as useEffect6 } from "react";
|
2787
2871
|
import { selectRoomID, useHMSStore as useHMSStore5 } from "@100mslive/react-sdk";
|
2788
2872
|
var FeatureFlags = class {
|
2789
2873
|
static init(roomId) {
|
@@ -2810,7 +2894,7 @@ __publicField(FeatureFlags, "enableStatsForNerds", define_process_env_default.RE
|
|
2810
2894
|
__publicField(FeatureFlags, "enableWhiteboard", define_process_env_default.REACT_APP_ENABLE_WHITEBOARD && define_process_env_default.REACT_APP_PUSHER_APP_KEY && define_process_env_default.REACT_APP_PUSHER_AUTHENDPOINT);
|
2811
2895
|
function FeatureFlagsInit() {
|
2812
2896
|
const roomId = useHMSStore5(selectRoomID);
|
2813
|
-
|
2897
|
+
useEffect6(() => {
|
2814
2898
|
if (roomId) {
|
2815
2899
|
FeatureFlags.init(roomId);
|
2816
2900
|
}
|
@@ -2821,10 +2905,10 @@ function FeatureFlagsInit() {
|
|
2821
2905
|
// src/Prebuilt/components/init/Init.jsx
|
2822
2906
|
var Init = () => {
|
2823
2907
|
const { toggleTheme } = useTheme();
|
2824
|
-
|
2908
|
+
useEffect7(() => {
|
2825
2909
|
window.toggleUiTheme = toggleTheme;
|
2826
2910
|
}, [toggleTheme]);
|
2827
|
-
|
2911
|
+
useEffect7(() => {
|
2828
2912
|
function resetHeight() {
|
2829
2913
|
var _a7;
|
2830
2914
|
document.body.style.height = `${((_a7 = window.visualViewport) == null ? void 0 : _a7.height) || window.innerHeight}px`;
|
@@ -2835,17 +2919,17 @@ var Init = () => {
|
|
2835
2919
|
window.removeEventListener("resize", resetHeight);
|
2836
2920
|
};
|
2837
2921
|
}, []);
|
2838
|
-
return /* @__PURE__ */
|
2922
|
+
return /* @__PURE__ */ React23.createElement(FeatureFlagsInit, null);
|
2839
2923
|
};
|
2840
2924
|
|
2841
2925
|
// src/Prebuilt/components/Input/KeyboardInputManager.js
|
2842
|
-
import { useEffect as
|
2926
|
+
import { useEffect as useEffect8 } from "react";
|
2843
2927
|
import {
|
2844
2928
|
selectAppData as selectAppData3,
|
2845
2929
|
selectIsLocalAudioEnabled,
|
2846
2930
|
selectIsLocalVideoEnabled,
|
2847
2931
|
useHMSActions as useHMSActions5,
|
2848
|
-
useHMSVanillaStore as
|
2932
|
+
useHMSVanillaStore as useHMSVanillaStore4
|
2849
2933
|
} from "@100mslive/react-sdk";
|
2850
2934
|
var isEvenListenersAttached = false;
|
2851
2935
|
var _actions, _store, _toggleAudio, _toggleVideo, _hideSidepane, _toggleStatsForNerds, _toggleHlsStats, _keyDownHandler, _bind, _unbind;
|
@@ -2932,9 +3016,9 @@ _keyDownHandler = new WeakMap();
|
|
2932
3016
|
_bind = new WeakMap();
|
2933
3017
|
_unbind = new WeakMap();
|
2934
3018
|
var KeyboardHandler = () => {
|
2935
|
-
const store =
|
3019
|
+
const store = useHMSVanillaStore4();
|
2936
3020
|
const actions = useHMSActions5();
|
2937
|
-
|
3021
|
+
useEffect8(() => {
|
2938
3022
|
const keyboardManager = new KeyboardInputManager(store, actions);
|
2939
3023
|
keyboardManager.bindAllShortcuts();
|
2940
3024
|
return keyboardManager.unbindAllShortcuts;
|
@@ -2943,7 +3027,7 @@ var KeyboardHandler = () => {
|
|
2943
3027
|
};
|
2944
3028
|
|
2945
3029
|
// src/Prebuilt/components/Notifications/Notifications.jsx
|
2946
|
-
import
|
3030
|
+
import React32, { useCallback as useCallback8, useEffect as useEffect17 } from "react";
|
2947
3031
|
import { useNavigate as useNavigate2, useParams as useParams2 } from "react-router-dom";
|
2948
3032
|
import {
|
2949
3033
|
HMSNotificationTypes as HMSNotificationTypes7,
|
@@ -2953,15 +3037,15 @@ import {
|
|
2953
3037
|
useCustomEvent,
|
2954
3038
|
useHMSNotifications as useHMSNotifications7,
|
2955
3039
|
useHMSStore as useHMSStore7,
|
2956
|
-
useHMSVanillaStore as
|
3040
|
+
useHMSVanillaStore as useHMSVanillaStore5
|
2957
3041
|
} from "@100mslive/react-sdk";
|
2958
3042
|
|
2959
3043
|
// src/Prebuilt/provider/roomLayoutProvider/index.tsx
|
2960
|
-
import
|
3044
|
+
import React24 from "react";
|
2961
3045
|
import merge from "lodash.merge";
|
2962
3046
|
|
2963
3047
|
// src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts
|
2964
|
-
import { useCallback as useCallback5, useEffect as
|
3048
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef5, useState as useState5 } from "react";
|
2965
3049
|
|
2966
3050
|
// src/Prebuilt/provider/roomLayoutProvider/constants/index.ts
|
2967
3051
|
import { JoinForm_JoinBtnType } from "@100mslive/types-prebuilt/elements/join_form";
|
@@ -3030,8 +3114,8 @@ var useFetchRoomLayout = ({
|
|
3030
3114
|
authToken = ""
|
3031
3115
|
}) => {
|
3032
3116
|
const [layout, setLayout] = useState5(void 0);
|
3033
|
-
const layoutResp =
|
3034
|
-
const isFetchInProgress =
|
3117
|
+
const layoutResp = useRef5();
|
3118
|
+
const isFetchInProgress = useRef5(false);
|
3035
3119
|
const updateRoomLayoutForRole = useCallback5((role) => {
|
3036
3120
|
var _a7;
|
3037
3121
|
if (!layoutResp.current) {
|
@@ -3042,7 +3126,7 @@ var useFetchRoomLayout = ({
|
|
3042
3126
|
setLayout(layout2);
|
3043
3127
|
}
|
3044
3128
|
}, []);
|
3045
|
-
|
3129
|
+
useEffect9(() => {
|
3046
3130
|
(() => __async(void 0, null, function* () {
|
3047
3131
|
var _a7, _b7;
|
3048
3132
|
if (isFetchInProgress.current || !authToken) {
|
@@ -3078,7 +3162,7 @@ var useFetchRoomLayout = ({
|
|
3078
3162
|
};
|
3079
3163
|
|
3080
3164
|
// src/Prebuilt/provider/roomLayoutProvider/index.tsx
|
3081
|
-
var RoomLayoutContext =
|
3165
|
+
var RoomLayoutContext = React24.createContext(void 0);
|
3082
3166
|
var RoomLayoutProvider = ({
|
3083
3167
|
children,
|
3084
3168
|
roomLayoutEndpoint,
|
@@ -3087,19 +3171,19 @@ var RoomLayoutProvider = ({
|
|
3087
3171
|
const authToken = useAuthToken();
|
3088
3172
|
const { layout, updateRoomLayoutForRole } = useFetchRoomLayout({ authToken, endpoint: roomLayoutEndpoint });
|
3089
3173
|
const mergedLayout = authToken && layout ? merge(layout, overrideLayout) : layout;
|
3090
|
-
return /* @__PURE__ */
|
3174
|
+
return /* @__PURE__ */ React24.createElement(RoomLayoutContext.Provider, { value: { layout: mergedLayout, updateRoomLayoutForRole } }, children);
|
3091
3175
|
};
|
3092
3176
|
var useRoomLayout = () => {
|
3093
3177
|
var _a7;
|
3094
|
-
return (_a7 =
|
3178
|
+
return (_a7 = React24.useContext(RoomLayoutContext)) == null ? void 0 : _a7.layout;
|
3095
3179
|
};
|
3096
3180
|
var useUpdateRoomLayout = () => {
|
3097
3181
|
var _a7;
|
3098
|
-
return (_a7 =
|
3182
|
+
return (_a7 = React24.useContext(RoomLayoutContext)) == null ? void 0 : _a7.updateRoomLayoutForRole;
|
3099
3183
|
};
|
3100
3184
|
|
3101
3185
|
// src/Prebuilt/components/Toast/ToastConfig.jsx
|
3102
|
-
import
|
3186
|
+
import React25, { useCallback as useCallback6 } from "react";
|
3103
3187
|
import { selectPeerByID, useHMSActions as useHMSActions6, useHMSStore as useHMSStore6 } from "@100mslive/react-sdk";
|
3104
3188
|
import {
|
3105
3189
|
ChatUnreadIcon,
|
@@ -3109,15 +3193,15 @@ import {
|
|
3109
3193
|
PeopleRemoveIcon,
|
3110
3194
|
PoorConnectivityIcon
|
3111
3195
|
} from "@100mslive/react-icons";
|
3112
|
-
var ChatAction =
|
3196
|
+
var ChatAction = React25.forwardRef((_, ref) => {
|
3113
3197
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3114
3198
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3115
3199
|
if (isChatOpen) {
|
3116
3200
|
return null;
|
3117
3201
|
}
|
3118
|
-
return /* @__PURE__ */
|
3202
|
+
return /* @__PURE__ */ React25.createElement(Button, { outlined: true, as: "div", variant: "standard", css: { w: "max-content" }, onClick: toggleChat, ref }, "Open Chat");
|
3119
3203
|
});
|
3120
|
-
var HandRaiseAction =
|
3204
|
+
var HandRaiseAction = React25.forwardRef(({ id = "", isSingleHandRaise = true }, ref) => {
|
3121
3205
|
var _a7, _b7, _c;
|
3122
3206
|
const hmsActions = useHMSActions6();
|
3123
3207
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
@@ -3139,7 +3223,7 @@ var HandRaiseAction = React23.forwardRef(({ id = "", isSingleHandRaise = true },
|
|
3139
3223
|
if (isSingleHandRaise && (!peer || !off_stage_roles.includes(peer.roleName))) {
|
3140
3224
|
return null;
|
3141
3225
|
}
|
3142
|
-
return /* @__PURE__ */
|
3226
|
+
return /* @__PURE__ */ React25.createElement(Button, { outlined: true, as: "div", variant: "standard", css: { w: "max-content" }, onClick: onClickHandler, ref }, isSingleHandRaise ? bring_to_stage_label : "View");
|
3143
3227
|
});
|
3144
3228
|
var ToastConfig = {
|
3145
3229
|
PEER_LIST: {
|
@@ -3148,18 +3232,18 @@ var ToastConfig = {
|
|
3148
3232
|
if (notification.data.length === 1) {
|
3149
3233
|
return {
|
3150
3234
|
title: `${(_a7 = notification.data[0]) == null ? void 0 : _a7.name} joined`,
|
3151
|
-
icon: /* @__PURE__ */
|
3235
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3152
3236
|
};
|
3153
3237
|
}
|
3154
3238
|
return {
|
3155
3239
|
title: `${(_b7 = notification.data[notification.data.length - 1]) == null ? void 0 : _b7.name} and ${notification.data.length - 1} others joined`,
|
3156
|
-
icon: /* @__PURE__ */
|
3240
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3157
3241
|
};
|
3158
3242
|
},
|
3159
3243
|
multiple: (notifications) => {
|
3160
3244
|
return {
|
3161
3245
|
title: `${notifications[0].data.name} and ${notifications.length - 1} others joined`,
|
3162
|
-
icon: /* @__PURE__ */
|
3246
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3163
3247
|
};
|
3164
3248
|
}
|
3165
3249
|
},
|
@@ -3168,13 +3252,13 @@ var ToastConfig = {
|
|
3168
3252
|
var _a7;
|
3169
3253
|
return {
|
3170
3254
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} joined`,
|
3171
|
-
icon: /* @__PURE__ */
|
3255
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3172
3256
|
};
|
3173
3257
|
},
|
3174
3258
|
multiple: function(notifications) {
|
3175
3259
|
return {
|
3176
3260
|
title: `${notifications[notifications.length - 1].data.name} and ${notifications.length - 1} others joined`,
|
3177
|
-
icon: /* @__PURE__ */
|
3261
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleAddIcon, null)
|
3178
3262
|
};
|
3179
3263
|
}
|
3180
3264
|
},
|
@@ -3183,13 +3267,13 @@ var ToastConfig = {
|
|
3183
3267
|
var _a7;
|
3184
3268
|
return {
|
3185
3269
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} left`,
|
3186
|
-
icon: /* @__PURE__ */
|
3270
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleRemoveIcon, null)
|
3187
3271
|
};
|
3188
3272
|
},
|
3189
3273
|
multiple: function(notifications) {
|
3190
3274
|
return {
|
3191
3275
|
title: `${notifications[notifications.length - 1].data.name} and ${notifications.length - 1} others left`,
|
3192
|
-
icon: /* @__PURE__ */
|
3276
|
+
icon: /* @__PURE__ */ React25.createElement(PeopleRemoveIcon, null)
|
3193
3277
|
};
|
3194
3278
|
}
|
3195
3279
|
},
|
@@ -3198,8 +3282,8 @@ var ToastConfig = {
|
|
3198
3282
|
var _a7, _b7;
|
3199
3283
|
return {
|
3200
3284
|
title: `${(_a7 = notification.data) == null ? void 0 : _a7.name} raised hand`,
|
3201
|
-
icon: /* @__PURE__ */
|
3202
|
-
action: /* @__PURE__ */
|
3285
|
+
icon: /* @__PURE__ */ React25.createElement(HandIcon, null),
|
3286
|
+
action: /* @__PURE__ */ React25.createElement(HandRaiseAction, { id: (_b7 = notification.data) == null ? void 0 : _b7.id })
|
3203
3287
|
};
|
3204
3288
|
},
|
3205
3289
|
multiple: (notifications) => {
|
@@ -3210,8 +3294,8 @@ var ToastConfig = {
|
|
3210
3294
|
})).size;
|
3211
3295
|
return {
|
3212
3296
|
title: `${(_a7 = notifications[notifications.length - 1].data) == null ? void 0 : _a7.name} ${count > 1 ? `${count} and others` : ""} raised hand`,
|
3213
|
-
icon: /* @__PURE__ */
|
3214
|
-
action: /* @__PURE__ */
|
3297
|
+
icon: /* @__PURE__ */ React25.createElement(HandIcon, null),
|
3298
|
+
action: /* @__PURE__ */ React25.createElement(HandRaiseAction, { isSingleHandRaise: false })
|
3215
3299
|
};
|
3216
3300
|
}
|
3217
3301
|
},
|
@@ -3220,15 +3304,15 @@ var ToastConfig = {
|
|
3220
3304
|
var _a7;
|
3221
3305
|
return {
|
3222
3306
|
title: `New message from ${(_a7 = notification.data) == null ? void 0 : _a7.senderName}`,
|
3223
|
-
icon: /* @__PURE__ */
|
3224
|
-
action: /* @__PURE__ */
|
3307
|
+
icon: /* @__PURE__ */ React25.createElement(ChatUnreadIcon, null),
|
3308
|
+
action: /* @__PURE__ */ React25.createElement(ChatAction, null)
|
3225
3309
|
};
|
3226
3310
|
},
|
3227
3311
|
multiple: (notifications) => {
|
3228
3312
|
return {
|
3229
3313
|
title: `${notifications.length} new messages`,
|
3230
|
-
icon: /* @__PURE__ */
|
3231
|
-
action: /* @__PURE__ */
|
3314
|
+
icon: /* @__PURE__ */ React25.createElement(ChatUnreadIcon, null),
|
3315
|
+
action: /* @__PURE__ */ React25.createElement(ChatAction, null)
|
3232
3316
|
};
|
3233
3317
|
}
|
3234
3318
|
},
|
@@ -3236,7 +3320,7 @@ var ToastConfig = {
|
|
3236
3320
|
single: () => {
|
3237
3321
|
return {
|
3238
3322
|
title: `You are now connected`,
|
3239
|
-
icon: /* @__PURE__ */
|
3323
|
+
icon: /* @__PURE__ */ React25.createElement(ConnectivityIcon, null),
|
3240
3324
|
variant: "success",
|
3241
3325
|
duration: 3e3
|
3242
3326
|
};
|
@@ -3248,7 +3332,7 @@ var ToastConfig = {
|
|
3248
3332
|
title: `You are offline for now. while we try to reconnect, please check
|
3249
3333
|
your internet connection. ${message}.
|
3250
3334
|
`,
|
3251
|
-
icon: /* @__PURE__ */
|
3335
|
+
icon: /* @__PURE__ */ React25.createElement(PoorConnectivityIcon, null),
|
3252
3336
|
variant: "warning",
|
3253
3337
|
duration: 3e4
|
3254
3338
|
};
|
@@ -3353,11 +3437,11 @@ var ToastBatcher = {
|
|
3353
3437
|
ToastManager.addListener(ToastBatcher.syncUItoast.bind(ToastBatcher));
|
3354
3438
|
|
3355
3439
|
// src/Prebuilt/components/Notifications/AutoplayBlockedModal.jsx
|
3356
|
-
import
|
3440
|
+
import React26 from "react";
|
3357
3441
|
import { useAutoplayError } from "@100mslive/react-sdk";
|
3358
3442
|
function AutoplayBlockedModal() {
|
3359
3443
|
const { error, resetError, unblockAudio } = useAutoplayError();
|
3360
|
-
return /* @__PURE__ */
|
3444
|
+
return /* @__PURE__ */ React26.createElement(
|
3361
3445
|
Dialog.Root,
|
3362
3446
|
{
|
3363
3447
|
open: !!error,
|
@@ -3368,7 +3452,7 @@ function AutoplayBlockedModal() {
|
|
3368
3452
|
resetError();
|
3369
3453
|
}
|
3370
3454
|
},
|
3371
|
-
/* @__PURE__ */
|
3455
|
+
/* @__PURE__ */ React26.createElement(DialogContent, { title: "Permission Error", closeable: false }, /* @__PURE__ */ React26.createElement(DialogRow, null, /* @__PURE__ */ React26.createElement(Text, { variant: "md" }, "The browser wants us to get a confirmation for playing the Audio. Please allow audio to proceed.")), /* @__PURE__ */ React26.createElement(DialogRow, { justify: "end" }, /* @__PURE__ */ React26.createElement(
|
3372
3456
|
Button,
|
3373
3457
|
{
|
3374
3458
|
variant: "primary",
|
@@ -3383,11 +3467,11 @@ function AutoplayBlockedModal() {
|
|
3383
3467
|
}
|
3384
3468
|
|
3385
3469
|
// src/Prebuilt/components/Notifications/InitErrorModal.jsx
|
3386
|
-
import
|
3470
|
+
import React27, { useEffect as useEffect10, useState as useState6 } from "react";
|
3387
3471
|
var InitErrorModal = ({ notification }) => {
|
3388
3472
|
const [showModal, setShowModal] = useState6(false);
|
3389
3473
|
const [info, setInfo] = useState6({ title: "Init Error", description: "" });
|
3390
|
-
|
3474
|
+
useEffect10(() => {
|
3391
3475
|
const data = notification == null ? void 0 : notification.data;
|
3392
3476
|
if (!data || data.action !== "INIT") {
|
3393
3477
|
return;
|
@@ -3407,11 +3491,11 @@ var InitErrorModal = ({ notification }) => {
|
|
3407
3491
|
setInfo({ title, description });
|
3408
3492
|
setShowModal(true);
|
3409
3493
|
}, [notification]);
|
3410
|
-
return /* @__PURE__ */
|
3494
|
+
return /* @__PURE__ */ React27.createElement(ErrorDialog, { open: showModal, onOpenChange: setShowModal, title: info.title }, /* @__PURE__ */ React27.createElement(Text, { variant: "sm", css: { wordBreak: "break-word" } }, info.description, " ", /* @__PURE__ */ React27.createElement("br", null), "Current URL - ", window.location.href));
|
3411
3495
|
};
|
3412
3496
|
|
3413
3497
|
// src/Prebuilt/components/Notifications/PeerNotifications.jsx
|
3414
|
-
import { useEffect as
|
3498
|
+
import { useEffect as useEffect11 } from "react";
|
3415
3499
|
import { HMSNotificationTypes, useHMSNotifications } from "@100mslive/react-sdk";
|
3416
3500
|
var notificationTypes = [
|
3417
3501
|
HMSNotificationTypes.PEER_LIST,
|
@@ -3422,7 +3506,7 @@ var PeerNotifications = () => {
|
|
3422
3506
|
const notification = useHMSNotifications(notificationTypes);
|
3423
3507
|
const isPeerJoinSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_JOINED);
|
3424
3508
|
const isPeerLeftSubscribed = useSubscribedNotifications(SUBSCRIBED_NOTIFICATIONS.PEER_LEFT);
|
3425
|
-
|
3509
|
+
useEffect11(() => {
|
3426
3510
|
if (!(notification == null ? void 0 : notification.data)) {
|
3427
3511
|
return;
|
3428
3512
|
}
|
@@ -3452,7 +3536,7 @@ var PeerNotifications = () => {
|
|
3452
3536
|
};
|
3453
3537
|
|
3454
3538
|
// src/Prebuilt/components/Notifications/PermissionErrorModal.jsx
|
3455
|
-
import
|
3539
|
+
import React28, { useEffect as useEffect12, useState as useState7 } from "react";
|
3456
3540
|
import { useMedia } from "react-use";
|
3457
3541
|
import { HMSNotificationTypes as HMSNotificationTypes2, useHMSNotifications as useHMSNotifications2 } from "@100mslive/react-sdk";
|
3458
3542
|
|
@@ -3468,7 +3552,7 @@ function PermissionErrorModal() {
|
|
3468
3552
|
const [deviceType, setDeviceType] = useState7("");
|
3469
3553
|
const [isSystemError, setIsSystemError] = useState7(false);
|
3470
3554
|
const isMobile = useMedia(config.media.md);
|
3471
|
-
|
3555
|
+
useEffect12(() => {
|
3472
3556
|
var _a7, _b7, _c, _d, _e;
|
3473
3557
|
if (!notification || ((_a7 = notification.data) == null ? void 0 : _a7.code) !== 3001 && ((_b7 = notification.data) == null ? void 0 : _b7.code) !== 3011 || ((_c = notification.data) == null ? void 0 : _c.code) === 3001 && ((_d = notification.data) == null ? void 0 : _d.message.includes("screen"))) {
|
3474
3558
|
return;
|
@@ -3489,15 +3573,15 @@ function PermissionErrorModal() {
|
|
3489
3573
|
}
|
3490
3574
|
setIsSystemError(notification.data.code === 3011);
|
3491
3575
|
}, [notification]);
|
3492
|
-
return deviceType ? /* @__PURE__ */
|
3576
|
+
return deviceType ? /* @__PURE__ */ React28.createElement(Dialog.Root, { open: !!deviceType }, /* @__PURE__ */ React28.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React28.createElement(Dialog.Overlay, null), /* @__PURE__ */ React28.createElement(Dialog.Content, { css: { w: "min(380px, 90%)", p: "$8" } }, /* @__PURE__ */ React28.createElement(
|
3493
3577
|
Dialog.Title,
|
3494
3578
|
{
|
3495
3579
|
css: {
|
3496
3580
|
borderBottom: "1px solid $border_default"
|
3497
3581
|
}
|
3498
3582
|
},
|
3499
|
-
isMobile && isIOS ? /* @__PURE__ */
|
3500
|
-
isMobile && isAndroid ? /* @__PURE__ */
|
3583
|
+
isMobile && isIOS ? /* @__PURE__ */ React28.createElement("img", { style: { maxWidth: "100%", maxHeight: "100%" }, src: ios_perm_0_default, alt: "iOS Permission flow" }) : null,
|
3584
|
+
isMobile && isAndroid ? /* @__PURE__ */ React28.createElement(
|
3501
3585
|
"img",
|
3502
3586
|
{
|
3503
3587
|
src: android_perm_1_default,
|
@@ -3505,12 +3589,12 @@ function PermissionErrorModal() {
|
|
3505
3589
|
alt: "Android Permission flow "
|
3506
3590
|
}
|
3507
3591
|
) : null,
|
3508
|
-
/* @__PURE__ */
|
3509
|
-
), /* @__PURE__ */
|
3592
|
+
/* @__PURE__ */ React28.createElement(Text, { variant: "h6" }, "We can't access your ", deviceType)
|
3593
|
+
), /* @__PURE__ */ React28.createElement(Text, { variant: "sm", css: { pt: "$4", pb: "$10", color: "$on_surface_medium" } }, isMobile && isIOS ? 'Enable permissions by reloading this page and clicking "Allow" on the pop-up, or change settings from the address bar.' : null, isMobile && isAndroid ? `To allow other users to see and hear you, click the blocked camera icon in your browser's address bar.` : null, !isMobile ? `Access to ${deviceType} is required. ` : null, isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from sytem settings` : null, !isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from address bar or browser settings.` : null), isMobile && isIOS ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Button, { onClick: () => window.location.reload(), css: { w: "100%", mb: "$6" } }, "Reload"), /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null, isMobile && isAndroid ? /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Button, { onClick: () => setDeviceType(""), css: { w: "100%", mb: "$6" } }, "I've allowed access"), /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null, !isMobile ? /* @__PURE__ */ React28.createElement(Flex, { justify: "end", css: { w: "100%" } }, /* @__PURE__ */ React28.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType("") }, "Dismiss")) : null))) : null;
|
3510
3594
|
}
|
3511
3595
|
|
3512
3596
|
// src/Prebuilt/components/Notifications/ReconnectNotifications.jsx
|
3513
|
-
import
|
3597
|
+
import React29, { useEffect as useEffect13, useState as useState8 } from "react";
|
3514
3598
|
import { HMSNotificationTypes as HMSNotificationTypes3, useHMSNotifications as useHMSNotifications3 } from "@100mslive/react-sdk";
|
3515
3599
|
var notificationTypes2 = [
|
3516
3600
|
HMSNotificationTypes3.RECONNECTED,
|
@@ -3521,7 +3605,7 @@ var notificationId = null;
|
|
3521
3605
|
var ReconnectNotifications = () => {
|
3522
3606
|
const notification = useHMSNotifications3(notificationTypes2);
|
3523
3607
|
const [open, setOpen] = useState8(false);
|
3524
|
-
|
3608
|
+
useEffect13(() => {
|
3525
3609
|
var _a7;
|
3526
3610
|
if ((notification == null ? void 0 : notification.type) === HMSNotificationTypes3.ERROR && ((_a7 = notification == null ? void 0 : notification.data) == null ? void 0 : _a7.isTerminal)) {
|
3527
3611
|
setOpen(false);
|
@@ -3537,7 +3621,7 @@ var ReconnectNotifications = () => {
|
|
3537
3621
|
}, [notification]);
|
3538
3622
|
if (!open)
|
3539
3623
|
return null;
|
3540
|
-
return /* @__PURE__ */
|
3624
|
+
return /* @__PURE__ */ React29.createElement(Dialog.Root, { open, modal: true }, /* @__PURE__ */ React29.createElement(Dialog.Portal, { container: document.getElementById("conferencing") }, /* @__PURE__ */ React29.createElement(Dialog.Overlay, null), /* @__PURE__ */ React29.createElement(
|
3541
3625
|
Dialog.Content,
|
3542
3626
|
{
|
3543
3627
|
css: {
|
@@ -3551,12 +3635,12 @@ var ReconnectNotifications = () => {
|
|
3551
3635
|
animation: "none !important"
|
3552
3636
|
}
|
3553
3637
|
},
|
3554
|
-
/* @__PURE__ */
|
3638
|
+
/* @__PURE__ */ React29.createElement(Flex, { align: "center" }, /* @__PURE__ */ React29.createElement("div", { style: { display: "inline", margin: "0.25rem" } }, /* @__PURE__ */ React29.createElement(Loading, { size: 16 })), /* @__PURE__ */ React29.createElement(Text, { css: { fontSize: "$space$8", color: "$on_surface_high" } }, "You lost your network connection. Trying to reconnect."))
|
3555
3639
|
)));
|
3556
3640
|
};
|
3557
3641
|
|
3558
3642
|
// src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx
|
3559
|
-
import
|
3643
|
+
import React30, { useEffect as useEffect14, useState as useState9 } from "react";
|
3560
3644
|
import { HMSNotificationTypes as HMSNotificationTypes4, useHMSActions as useHMSActions7, useHMSNotifications as useHMSNotifications4 } from "@100mslive/react-sdk";
|
3561
3645
|
import { MicOnIcon } from "@100mslive/react-icons";
|
3562
3646
|
var TrackBulkUnmuteModal = () => {
|
@@ -3567,7 +3651,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3567
3651
|
HMSNotificationTypes4.ROOM_ENDED,
|
3568
3652
|
HMSNotificationTypes4.REMOVED_FROM_ROOM
|
3569
3653
|
]);
|
3570
|
-
|
3654
|
+
useEffect14(() => {
|
3571
3655
|
switch (notification == null ? void 0 : notification.type) {
|
3572
3656
|
case HMSNotificationTypes4.REMOVED_FROM_ROOM:
|
3573
3657
|
case HMSNotificationTypes4.ROOM_ENDED:
|
@@ -3586,7 +3670,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3586
3670
|
return null;
|
3587
3671
|
}
|
3588
3672
|
const { requestedBy: peer, tracks, enabled } = muteNotification;
|
3589
|
-
return /* @__PURE__ */
|
3673
|
+
return /* @__PURE__ */ React30.createElement(
|
3590
3674
|
RequestDialog,
|
3591
3675
|
{
|
3592
3676
|
title: "Track Unmute Request",
|
@@ -3604,7 +3688,7 @@ var TrackBulkUnmuteModal = () => {
|
|
3604
3688
|
};
|
3605
3689
|
|
3606
3690
|
// src/Prebuilt/components/Notifications/TrackNotifications.jsx
|
3607
|
-
import { useEffect as
|
3691
|
+
import { useEffect as useEffect15 } from "react";
|
3608
3692
|
import { HMSNotificationTypes as HMSNotificationTypes5, useHMSNotifications as useHMSNotifications5 } from "@100mslive/react-sdk";
|
3609
3693
|
var notificationTypes3 = [
|
3610
3694
|
HMSNotificationTypes5.TRACK_ADDED,
|
@@ -3614,7 +3698,7 @@ var notificationTypes3 = [
|
|
3614
3698
|
];
|
3615
3699
|
var TrackNotifications = () => {
|
3616
3700
|
const notification = useHMSNotifications5(notificationTypes3);
|
3617
|
-
|
3701
|
+
useEffect15(() => {
|
3618
3702
|
if (notification) {
|
3619
3703
|
console.debug(`[${notification.type}]`, notification);
|
3620
3704
|
}
|
@@ -3623,7 +3707,7 @@ var TrackNotifications = () => {
|
|
3623
3707
|
};
|
3624
3708
|
|
3625
3709
|
// src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx
|
3626
|
-
import
|
3710
|
+
import React31, { useEffect as useEffect16, useState as useState10 } from "react";
|
3627
3711
|
import { HMSNotificationTypes as HMSNotificationTypes6, useHMSActions as useHMSActions8, useHMSNotifications as useHMSNotifications6 } from "@100mslive/react-sdk";
|
3628
3712
|
import { MicOnIcon as MicOnIcon2 } from "@100mslive/react-icons";
|
3629
3713
|
var TrackUnmuteModal = () => {
|
@@ -3634,7 +3718,7 @@ var TrackUnmuteModal = () => {
|
|
3634
3718
|
HMSNotificationTypes6.REMOVED_FROM_ROOM
|
3635
3719
|
]);
|
3636
3720
|
const [muteNotification, setMuteNotification] = useState10(null);
|
3637
|
-
|
3721
|
+
useEffect16(() => {
|
3638
3722
|
switch (notification == null ? void 0 : notification.type) {
|
3639
3723
|
case HMSNotificationTypes6.REMOVED_FROM_ROOM:
|
3640
3724
|
case HMSNotificationTypes6.ROOM_ENDED:
|
@@ -3653,7 +3737,7 @@ var TrackUnmuteModal = () => {
|
|
3653
3737
|
return null;
|
3654
3738
|
}
|
3655
3739
|
const { requestedBy: peer, track, enabled } = muteNotification;
|
3656
|
-
return /* @__PURE__ */
|
3740
|
+
return /* @__PURE__ */ React31.createElement(
|
3657
3741
|
RequestDialog,
|
3658
3742
|
{
|
3659
3743
|
title: "Track Unmute Request",
|
@@ -4162,12 +4246,6 @@ var formatTime = (timeInSeconds) => {
|
|
4162
4246
|
const hour = hours !== 0 ? `${hours < 10 ? "0" : ""}${hours}:` : "";
|
4163
4247
|
return `${hour}${minutes < 10 ? "0" : ""}${minutes}:${seconds < 10 ? "0" : ""}${seconds}`;
|
4164
4248
|
};
|
4165
|
-
var getAttributeBoxSize = (width, height) => {
|
4166
|
-
if (!width || !height) {
|
4167
|
-
return "";
|
4168
|
-
}
|
4169
|
-
return width < 180 || height < 180 ? "small" : "medium";
|
4170
|
-
};
|
4171
4249
|
|
4172
4250
|
// src/Prebuilt/components/Notifications/Notifications.jsx
|
4173
4251
|
function Notifications() {
|
@@ -4179,7 +4257,7 @@ function Notifications() {
|
|
4179
4257
|
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
4180
4258
|
const isNotificationDisabled = useIsNotificationDisabled();
|
4181
4259
|
const { redirectToLeave } = useRedirectToLeave();
|
4182
|
-
const vanillaStore =
|
4260
|
+
const vanillaStore = useHMSVanillaStore5();
|
4183
4261
|
const handleRoleChangeDenied = useCallback8((request) => {
|
4184
4262
|
ToastManager.addToast({
|
4185
4263
|
title: `${request.peerName} denied your request to join the ${request.role.name} role`,
|
@@ -4187,7 +4265,7 @@ function Notifications() {
|
|
4187
4265
|
});
|
4188
4266
|
}, []);
|
4189
4267
|
useCustomEvent({ type: ROLE_CHANGE_DECLINED, onEvent: handleRoleChangeDenied });
|
4190
|
-
|
4268
|
+
useEffect17(() => {
|
4191
4269
|
var _a7, _b7, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
4192
4270
|
if (!notification || isNotificationDisabled) {
|
4193
4271
|
return;
|
@@ -4228,7 +4306,7 @@ function Notifications() {
|
|
4228
4306
|
const toastId = ToastManager.addToast({
|
4229
4307
|
title: ((_f = notification.data) == null ? void 0 : _f.message) || "We couldn\u2019t reconnect you. When you\u2019re back online, try joining the room.",
|
4230
4308
|
inlineAction: true,
|
4231
|
-
action: /* @__PURE__ */
|
4309
|
+
action: /* @__PURE__ */ React32.createElement(
|
4232
4310
|
Button,
|
4233
4311
|
{
|
4234
4312
|
onClick: () => {
|
@@ -4294,35 +4372,53 @@ function Notifications() {
|
|
4294
4372
|
if (isNotificationDisabled) {
|
4295
4373
|
return null;
|
4296
4374
|
}
|
4297
|
-
return /* @__PURE__ */
|
4375
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(TrackUnmuteModal, null), /* @__PURE__ */ React32.createElement(TrackBulkUnmuteModal, null), /* @__PURE__ */ React32.createElement(TrackNotifications, null), roomState === HMSRoomState2.Connected ? /* @__PURE__ */ React32.createElement(PeerNotifications, null) : null, /* @__PURE__ */ React32.createElement(ReconnectNotifications, null), /* @__PURE__ */ React32.createElement(AutoplayBlockedModal, null), /* @__PURE__ */ React32.createElement(PermissionErrorModal, null), /* @__PURE__ */ React32.createElement(InitErrorModal, { notification }));
|
4376
|
+
}
|
4377
|
+
|
4378
|
+
// src/Prebuilt/components/Notifications/HeadlessEndRoomListener.tsx
|
4379
|
+
import React33, { useEffect as useEffect18 } from "react";
|
4380
|
+
import { HMSNotificationTypes as HMSNotificationTypes8, useHMSNotifications as useHMSNotifications8 } from "@100mslive/react-sdk";
|
4381
|
+
function HeadlessEndRoomListener() {
|
4382
|
+
const notification = useHMSNotifications8();
|
4383
|
+
const isNotificationDisabled = useIsNotificationDisabled();
|
4384
|
+
const { redirectToLeave } = useRedirectToLeave();
|
4385
|
+
useEffect18(() => {
|
4386
|
+
if (!notification || !isNotificationDisabled) {
|
4387
|
+
return;
|
4388
|
+
}
|
4389
|
+
if ([HMSNotificationTypes8.ROOM_ENDED, HMSNotificationTypes8.REMOVED_FROM_ROOM].includes(notification.type)) {
|
4390
|
+
redirectToLeave(1e3);
|
4391
|
+
}
|
4392
|
+
}, [notification]);
|
4393
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null);
|
4298
4394
|
}
|
4299
4395
|
|
4300
4396
|
// src/Prebuilt/components/PostLeave.jsx
|
4301
|
-
import
|
4397
|
+
import React40 from "react";
|
4302
4398
|
import { useNavigate as useNavigate3, useParams as useParams3 } from "react-router-dom";
|
4303
4399
|
import { ExitIcon } from "@100mslive/react-icons";
|
4304
4400
|
|
4305
4401
|
// src/Prebuilt/components/Header/Header.tsx
|
4306
|
-
import
|
4402
|
+
import React39 from "react";
|
4307
4403
|
import { useMedia as useMedia3 } from "react-use";
|
4308
4404
|
import { HMSRoomState as HMSRoomState4, selectRoomState as selectRoomState4, useHMSStore as useHMSStore16 } from "@100mslive/react-sdk";
|
4309
4405
|
|
4310
4406
|
// src/Prebuilt/components/Header/HeaderComponents.jsx
|
4311
|
-
import
|
4407
|
+
import React34, { useEffect as useEffect19, useState as useState11 } from "react";
|
4312
4408
|
import { selectDominantSpeaker, useHMSStore as useHMSStore8 } from "@100mslive/react-sdk";
|
4313
4409
|
import { VolumeOneIcon } from "@100mslive/react-icons";
|
4314
4410
|
var SpeakerTag = () => {
|
4315
4411
|
const dominantSpeaker = useHMSStore8(selectDominantSpeaker);
|
4316
|
-
return dominantSpeaker && dominantSpeaker.name && /* @__PURE__ */
|
4412
|
+
return dominantSpeaker && dominantSpeaker.name && /* @__PURE__ */ React34.createElement(
|
4317
4413
|
Flex,
|
4318
4414
|
{
|
4319
4415
|
align: "center",
|
4320
4416
|
justify: "center",
|
4321
4417
|
css: { flex: "1 1 0", color: "$on_primary_high", "@md": { display: "none" } }
|
4322
4418
|
},
|
4323
|
-
/* @__PURE__ */
|
4324
|
-
/* @__PURE__ */
|
4325
|
-
/* @__PURE__ */
|
4419
|
+
/* @__PURE__ */ React34.createElement(VerticalDivider, { css: { ml: "$8" } }),
|
4420
|
+
/* @__PURE__ */ React34.createElement(VolumeOneIcon, null),
|
4421
|
+
/* @__PURE__ */ React34.createElement(Text, { variant: "md", css: __spreadProps(__spreadValues({}, textEllipsis(200)), { ml: "$2" }), title: dominantSpeaker.name }, dominantSpeaker.name)
|
4326
4422
|
);
|
4327
4423
|
};
|
4328
4424
|
var LogoImg = styled("img", {
|
@@ -4338,12 +4434,12 @@ var Logo = () => {
|
|
4338
4434
|
const roomLayout = useRoomLayout();
|
4339
4435
|
const logo = (_a7 = roomLayout == null ? void 0 : roomLayout.logo) == null ? void 0 : _a7.url;
|
4340
4436
|
const [hideImage, setHideImage] = useState11(false);
|
4341
|
-
|
4437
|
+
useEffect19(() => {
|
4342
4438
|
if (hideImage) {
|
4343
4439
|
setHideImage(false);
|
4344
4440
|
}
|
4345
4441
|
}, [logo]);
|
4346
|
-
return logo && !hideImage ? /* @__PURE__ */
|
4442
|
+
return logo && !hideImage ? /* @__PURE__ */ React34.createElement(
|
4347
4443
|
LogoImg,
|
4348
4444
|
{
|
4349
4445
|
src: logo,
|
@@ -4357,7 +4453,7 @@ var Logo = () => {
|
|
4357
4453
|
};
|
4358
4454
|
|
4359
4455
|
// src/Prebuilt/components/Header/StreamActions.tsx
|
4360
|
-
import
|
4456
|
+
import React37, { useCallback as useCallback13, useEffect as useEffect21, useRef as useRef6, useState as useState13 } from "react";
|
4361
4457
|
import { useMedia as useMedia2 } from "react-use";
|
4362
4458
|
import {
|
4363
4459
|
HMSRoomState as HMSRoomState3,
|
@@ -4372,7 +4468,7 @@ import {
|
|
4372
4468
|
import { AlertTriangleIcon, CrossIcon as CrossIcon4, RecordIcon } from "@100mslive/react-icons";
|
4373
4469
|
|
4374
4470
|
// src/Sheet/Sheet.tsx
|
4375
|
-
import
|
4471
|
+
import React35 from "react";
|
4376
4472
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
4377
4473
|
var SheetRoot = styled(DialogPrimitive2.Root, {
|
4378
4474
|
minHeight: "240px",
|
@@ -4446,10 +4542,10 @@ var StyledContent6 = styled(DialogPrimitive2.Content, {
|
|
4446
4542
|
side: "bottom"
|
4447
4543
|
}
|
4448
4544
|
});
|
4449
|
-
var SheetContent =
|
4545
|
+
var SheetContent = React35.forwardRef(
|
4450
4546
|
(_a7, forwardedRef) => {
|
4451
4547
|
var _b7 = _a7, { children } = _b7, props = __objRest(_b7, ["children"]);
|
4452
|
-
return /* @__PURE__ */
|
4548
|
+
return /* @__PURE__ */ React35.createElement(Dialog.Portal, null, /* @__PURE__ */ React35.createElement(StyledOverlay, null), /* @__PURE__ */ React35.createElement(StyledContent6, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }), children));
|
4453
4549
|
}
|
4454
4550
|
);
|
4455
4551
|
var SheetClose = Dialog.Close;
|
@@ -4469,7 +4565,7 @@ var Sheet = {
|
|
4469
4565
|
};
|
4470
4566
|
|
4471
4567
|
// src/Prebuilt/components/Header/AdditionalRoomState.jsx
|
4472
|
-
import
|
4568
|
+
import React36, { useState as useState12 } from "react";
|
4473
4569
|
import { selectLocalPeerID as selectLocalPeerID3, selectPeerSharingVideoPlaylist, useHMSStore as useHMSStore13, useScreenShare } from "@100mslive/react-sdk";
|
4474
4570
|
import {
|
4475
4571
|
AudioPlayerIcon,
|
@@ -4482,7 +4578,7 @@ import {
|
|
4482
4578
|
} from "@100mslive/react-icons";
|
4483
4579
|
|
4484
4580
|
// src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js
|
4485
|
-
import { useCallback as useCallback10, useEffect as
|
4581
|
+
import { useCallback as useCallback10, useEffect as useEffect20, useMemo as useMemo2 } from "react";
|
4486
4582
|
import { selectLocalPeerID as selectLocalPeerID2, selectPeerByCondition, useHMSStore as useHMSStore10 } from "@100mslive/react-sdk";
|
4487
4583
|
|
4488
4584
|
// src/Prebuilt/components/hooks/useMetadata.jsx
|
@@ -4493,12 +4589,12 @@ import {
|
|
4493
4589
|
selectPeerMetadata,
|
4494
4590
|
useHMSActions as useHMSActions9,
|
4495
4591
|
useHMSStore as useHMSStore9,
|
4496
|
-
useHMSVanillaStore as
|
4592
|
+
useHMSVanillaStore as useHMSVanillaStore6
|
4497
4593
|
} from "@100mslive/react-sdk";
|
4498
4594
|
var useMyMetadata = () => {
|
4499
4595
|
const hmsActions = useHMSActions9();
|
4500
4596
|
const localPeerId = useHMSStore9(selectLocalPeerID);
|
4501
|
-
const vanillaStore =
|
4597
|
+
const vanillaStore = useHMSVanillaStore6();
|
4502
4598
|
const metaData = useHMSStore9(selectPeerMetadata(localPeerId));
|
4503
4599
|
const isHandRaised = useHMSStore9(selectHasPeerHandRaised2(localPeerId));
|
4504
4600
|
const update = (updatedFields) => __async(void 0, null, function* () {
|
@@ -4564,7 +4660,7 @@ var useWhiteboardMetadata = () => {
|
|
4564
4660
|
console.error("failed to toggle whiteboard to ", !whiteboardOwner, error);
|
4565
4661
|
}
|
4566
4662
|
}), [whiteboardOwner, updateMetaData, amIWhiteboardOwner]);
|
4567
|
-
|
4663
|
+
useEffect20(() => {
|
4568
4664
|
window.toggleWhiteboard = toggleWhiteboard;
|
4569
4665
|
}, [toggleWhiteboard]);
|
4570
4666
|
return {
|
@@ -4678,7 +4774,7 @@ var AdditionalRoomState = () => {
|
|
4678
4774
|
if (isPlaylistInactive && isAudioshareInactive && !shouldShowScreenShareState && !shouldShowVideoState && !whiteboardOwner) {
|
4679
4775
|
return null;
|
4680
4776
|
}
|
4681
|
-
return /* @__PURE__ */
|
4777
|
+
return /* @__PURE__ */ React36.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React36.createElement(Dropdown.Trigger, { asChild: true }, /* @__PURE__ */ React36.createElement(
|
4682
4778
|
Flex,
|
4683
4779
|
{
|
4684
4780
|
align: "center",
|
@@ -4691,13 +4787,13 @@ var AdditionalRoomState = () => {
|
|
4691
4787
|
},
|
4692
4788
|
"data-testid": "record_status_dropdown"
|
4693
4789
|
},
|
4694
|
-
!isAudioshareInactive && /* @__PURE__ */
|
4695
|
-
shouldShowScreenShareState && /* @__PURE__ */
|
4696
|
-
shouldShowVideoState && /* @__PURE__ */
|
4697
|
-
!isPlaylistInactive && /* @__PURE__ */
|
4698
|
-
whiteboardOwner && /* @__PURE__ */
|
4699
|
-
/* @__PURE__ */
|
4700
|
-
)), /* @__PURE__ */
|
4790
|
+
!isAudioshareInactive && /* @__PURE__ */ React36.createElement(Tooltip, { title: "Screenshare Audio" }, /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React36.createElement(MusicIcon, { width: 24, height: 24 }))),
|
4791
|
+
shouldShowScreenShareState && /* @__PURE__ */ React36.createElement(Tooltip, { title: "Screenshare" }, /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React36.createElement(ShareScreenIcon, { width: 24, height: 24 }))),
|
4792
|
+
shouldShowVideoState && /* @__PURE__ */ React36.createElement(Tooltip, { title: "video playlist" }, /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React36.createElement(VideoPlayerIcon, { width: 24, height: 24 }))),
|
4793
|
+
!isPlaylistInactive && /* @__PURE__ */ React36.createElement(Tooltip, { title: "Playlist Music" }, /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React36.createElement(AudioPlayerIcon, { width: 24, height: 24 }))),
|
4794
|
+
whiteboardOwner && /* @__PURE__ */ React36.createElement(Tooltip, { title: "Whiteboard" }, /* @__PURE__ */ React36.createElement(Flex, { align: "center", css: { color: "$on_primary_high", mx: "$2" } }, /* @__PURE__ */ React36.createElement(PencilDrawIcon, { width: 24, height: 24 }))),
|
4795
|
+
/* @__PURE__ */ React36.createElement(Box, { css: { "@lg": { display: "none" }, color: "$on_surface_low" } }, open ? /* @__PURE__ */ React36.createElement(ChevronUpIcon2, null) : /* @__PURE__ */ React36.createElement(ChevronDownIcon2, null))
|
4796
|
+
)), /* @__PURE__ */ React36.createElement(Dropdown.Content, { sideOffset: 5, align: "end", css: { w: "$60" } }, !isPlaylistInactive && /* @__PURE__ */ React36.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React36.createElement(AudioPlayerIcon, { width: 24, height: 24 }), /* @__PURE__ */ React36.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Playlist is playing"), playlist.peer.isLocal ? /* @__PURE__ */ React36.createElement(
|
4701
4797
|
Text,
|
4702
4798
|
{
|
4703
4799
|
variant: "sm",
|
@@ -4708,7 +4804,7 @@ var AdditionalRoomState = () => {
|
|
4708
4804
|
}
|
4709
4805
|
},
|
4710
4806
|
playlist.selection.playing ? "Pause" : "Play"
|
4711
|
-
) : /* @__PURE__ */
|
4807
|
+
) : /* @__PURE__ */ React36.createElement(
|
4712
4808
|
Text,
|
4713
4809
|
{
|
4714
4810
|
variant: "sm",
|
@@ -4719,7 +4815,7 @@ var AdditionalRoomState = () => {
|
|
4719
4815
|
}
|
4720
4816
|
},
|
4721
4817
|
playlist.track.volume === 0 ? "Unmute" : "Mute"
|
4722
|
-
)), !isAudioshareInactive && /* @__PURE__ */
|
4818
|
+
)), !isAudioshareInactive && /* @__PURE__ */ React36.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React36.createElement(MusicIcon, { width: 24, height: 24 }), /* @__PURE__ */ React36.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Music is playing"), /* @__PURE__ */ React36.createElement(
|
4723
4819
|
Text,
|
4724
4820
|
{
|
4725
4821
|
variant: "sm",
|
@@ -4730,7 +4826,7 @@ var AdditionalRoomState = () => {
|
|
4730
4826
|
}
|
4731
4827
|
},
|
4732
4828
|
screenshareAudio.muted ? "Unmute" : "Mute"
|
4733
|
-
)), shouldShowScreenShareState && /* @__PURE__ */
|
4829
|
+
)), shouldShowScreenShareState && /* @__PURE__ */ React36.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React36.createElement(ShareScreenIcon, { width: 24, height: 24 }), /* @__PURE__ */ React36.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, `Shared by: ${screenSharingPeerId === localPeerID ? "You" : screenSharingPeerName}`)), shouldShowVideoState && /* @__PURE__ */ React36.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React36.createElement(VideoPlayerIcon, { width: 24, height: 24 }), /* @__PURE__ */ React36.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, `Shared by: ${peerSharingPlaylist.id === localPeerID ? "You" : peerSharingPlaylist.name}`)), whiteboardOwner && /* @__PURE__ */ React36.createElement(Dropdown.Item, { css: { color: "$on_primary_high" } }, /* @__PURE__ */ React36.createElement(PencilDrawIcon, { width: 24, height: 24 }), /* @__PURE__ */ React36.createElement(Text, { variant: "sm", css: { ml: "$2", flex: "1 1 0" } }, "Whiteboard Owner - ", whiteboardOwner.name, amIWhiteboardOwner && "(You)"), amIWhiteboardOwner && /* @__PURE__ */ React36.createElement(
|
4734
4830
|
Text,
|
4735
4831
|
{
|
4736
4832
|
variant: "sm",
|
@@ -4750,7 +4846,7 @@ var LiveStatus = () => {
|
|
4750
4846
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming2();
|
4751
4847
|
const hlsState = useHMSStore14(selectHLSState2);
|
4752
4848
|
const isMobile = useMedia2(config.media.md);
|
4753
|
-
const intervalRef =
|
4849
|
+
const intervalRef = useRef6(null);
|
4754
4850
|
const [liveTime, setLiveTime] = useState13(0);
|
4755
4851
|
const startTimer = useCallback13(() => {
|
4756
4852
|
intervalRef.current = setInterval(() => {
|
@@ -4760,7 +4856,7 @@ var LiveStatus = () => {
|
|
4760
4856
|
}
|
4761
4857
|
}, 1e3);
|
4762
4858
|
}, [hlsState == null ? void 0 : hlsState.running, hlsState == null ? void 0 : hlsState.variants]);
|
4763
|
-
|
4859
|
+
useEffect21(() => {
|
4764
4860
|
if (hlsState == null ? void 0 : hlsState.running) {
|
4765
4861
|
startTimer();
|
4766
4862
|
}
|
@@ -4776,7 +4872,7 @@ var LiveStatus = () => {
|
|
4776
4872
|
if (!isHLSRunning && !isRTMPRunning) {
|
4777
4873
|
return null;
|
4778
4874
|
}
|
4779
|
-
return /* @__PURE__ */
|
4875
|
+
return /* @__PURE__ */ React37.createElement(
|
4780
4876
|
Flex,
|
4781
4877
|
{
|
4782
4878
|
align: "center",
|
@@ -4787,8 +4883,8 @@ var LiveStatus = () => {
|
|
4787
4883
|
borderRadius: "$1"
|
4788
4884
|
}
|
4789
4885
|
},
|
4790
|
-
/* @__PURE__ */
|
4791
|
-
/* @__PURE__ */
|
4886
|
+
/* @__PURE__ */ React37.createElement(Box, { css: { w: "$4", h: "$4", r: "$round", bg: "$alert_error_default", mr: "$2" } }),
|
4887
|
+
/* @__PURE__ */ React37.createElement(Flex, { align: "center", gap: "2" }, /* @__PURE__ */ React37.createElement(Text, { variant: !isMobile ? "button" : "body2" }, "LIVE"), /* @__PURE__ */ React37.createElement(Text, { variant: "caption" }, ((_a7 = hlsState == null ? void 0 : hlsState.variants) == null ? void 0 : _a7.length) > 0 ? formatTime(liveTime) : ""))
|
4792
4888
|
);
|
4793
4889
|
};
|
4794
4890
|
var RecordingStatus = () => {
|
@@ -4803,7 +4899,7 @@ var RecordingStatus = () => {
|
|
4803
4899
|
if (!(isMobile && isRecordingOn))
|
4804
4900
|
return null;
|
4805
4901
|
}
|
4806
|
-
return /* @__PURE__ */
|
4902
|
+
return /* @__PURE__ */ React37.createElement(
|
4807
4903
|
Tooltip,
|
4808
4904
|
{
|
4809
4905
|
boxCss: { zIndex: 1 },
|
@@ -4813,7 +4909,7 @@ var RecordingStatus = () => {
|
|
4813
4909
|
isHLSRecordingOn
|
4814
4910
|
})
|
4815
4911
|
},
|
4816
|
-
/* @__PURE__ */
|
4912
|
+
/* @__PURE__ */ React37.createElement(
|
4817
4913
|
Flex,
|
4818
4914
|
{
|
4819
4915
|
css: {
|
@@ -4821,7 +4917,7 @@ var RecordingStatus = () => {
|
|
4821
4917
|
alignItems: "center"
|
4822
4918
|
}
|
4823
4919
|
},
|
4824
|
-
/* @__PURE__ */
|
4920
|
+
/* @__PURE__ */ React37.createElement(RecordIcon, { width: 24, height: 24 })
|
4825
4921
|
)
|
4826
4922
|
);
|
4827
4923
|
};
|
@@ -4835,7 +4931,7 @@ var StartRecording = () => {
|
|
4835
4931
|
return null;
|
4836
4932
|
}
|
4837
4933
|
if (isBrowserRecordingOn) {
|
4838
|
-
return /* @__PURE__ */
|
4934
|
+
return /* @__PURE__ */ React37.createElement(Popover2.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React37.createElement(Popover2.Trigger, { asChild: true }, /* @__PURE__ */ React37.createElement(Button, { variant: "danger", "data-testid": "stop_recording", icon: true, outlined: true, onClick: () => setOpen(true) }, /* @__PURE__ */ React37.createElement(RecordIcon, null), /* @__PURE__ */ React37.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, "Stop Recording"))), /* @__PURE__ */ React37.createElement(Popover2.Portal, null, /* @__PURE__ */ React37.createElement(Popover2.Content, { align: "end", sideOffset: 8, css: { w: "$64" } }, /* @__PURE__ */ React37.createElement(Text, { variant: "body1", css: { color: "$on_surface_medium" } }, "Are you sure you want to end the recording?"), /* @__PURE__ */ React37.createElement(
|
4839
4935
|
Button,
|
4840
4936
|
{
|
4841
4937
|
"data-testid": "stop_recording_confirm",
|
@@ -4858,7 +4954,7 @@ var StartRecording = () => {
|
|
4858
4954
|
"Stop"
|
4859
4955
|
))));
|
4860
4956
|
}
|
4861
|
-
return /* @__PURE__ */
|
4957
|
+
return /* @__PURE__ */ React37.createElement(
|
4862
4958
|
Button,
|
4863
4959
|
{
|
4864
4960
|
"data-testid": "start_recording",
|
@@ -4888,21 +4984,21 @@ var StartRecording = () => {
|
|
4888
4984
|
}
|
4889
4985
|
})
|
4890
4986
|
},
|
4891
|
-
recordingStarted ? /* @__PURE__ */
|
4892
|
-
/* @__PURE__ */
|
4987
|
+
recordingStarted ? /* @__PURE__ */ React37.createElement(Loading, { size: 24, color: "currentColor" }) : /* @__PURE__ */ React37.createElement(RecordIcon, null),
|
4988
|
+
/* @__PURE__ */ React37.createElement(Text, { as: "span", css: { "@md": { display: "none" }, color: "currentColor" } }, recordingStarted ? "Starting" : "Start", " Recording")
|
4893
4989
|
);
|
4894
4990
|
};
|
4895
4991
|
var StreamActions = () => {
|
4896
4992
|
const isConnected = useHMSStore14(selectIsConnectedToRoom2);
|
4897
4993
|
const isMobile = useMedia2(config.media.md);
|
4898
4994
|
const roomState = useHMSStore14(selectRoomState3);
|
4899
|
-
return /* @__PURE__ */
|
4995
|
+
return /* @__PURE__ */ React37.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React37.createElement(AdditionalRoomState, null), !isMobile && /* @__PURE__ */ React37.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React37.createElement(RecordingStatus, null), roomState !== HMSRoomState3.Preview ? /* @__PURE__ */ React37.createElement(LiveStatus, null) : null), isConnected && !isMobile ? /* @__PURE__ */ React37.createElement(StartRecording, null) : null);
|
4900
4996
|
};
|
4901
4997
|
var StopRecordingInSheet = ({
|
4902
4998
|
onStopRecording,
|
4903
4999
|
onClose
|
4904
5000
|
}) => {
|
4905
|
-
return /* @__PURE__ */
|
5001
|
+
return /* @__PURE__ */ React37.createElement(Sheet.Root, { open: true }, /* @__PURE__ */ React37.createElement(Sheet.Content, null, /* @__PURE__ */ React37.createElement(Sheet.Title, { css: { p: "$10" } }, /* @__PURE__ */ React37.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%", c: "$alert_error_default" } }, /* @__PURE__ */ React37.createElement(Flex, { justify: "start", align: "center", gap: "3" }, /* @__PURE__ */ React37.createElement(AlertTriangleIcon, null), /* @__PURE__ */ React37.createElement(Text, { variant: "h5", css: { c: "$alert_error_default" } }, "Stop Recording")), /* @__PURE__ */ React37.createElement(Sheet.Close, { css: { color: "white" }, onClick: onClose }, /* @__PURE__ */ React37.createElement(CrossIcon4, null)))), /* @__PURE__ */ React37.createElement(HorizontalDivider, null), /* @__PURE__ */ React37.createElement(Box, { as: "div", css: { p: "$10", overflowY: "scroll", maxHeight: "70vh" } }, /* @__PURE__ */ React37.createElement(Text, { variant: "caption", css: { c: "$on_surface_medium", pb: "$8" } }, "Are you sure you want to stop recording? You can\u2019t undo this action."), /* @__PURE__ */ React37.createElement(
|
4906
5002
|
Button,
|
4907
5003
|
{
|
4908
5004
|
variant: "danger",
|
@@ -4916,7 +5012,7 @@ var StopRecordingInSheet = ({
|
|
4916
5012
|
};
|
4917
5013
|
|
4918
5014
|
// src/Prebuilt/components/Header/common.jsx
|
4919
|
-
import
|
5015
|
+
import React38 from "react";
|
4920
5016
|
import {
|
4921
5017
|
DeviceType,
|
4922
5018
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled2,
|
@@ -4937,7 +5033,7 @@ var CamaraFlipActions = () => {
|
|
4937
5033
|
if (!videoInput || !(videoInput == null ? void 0 : videoInput.length) || !(localVideoTrack == null ? void 0 : localVideoTrack.facingMode)) {
|
4938
5034
|
return null;
|
4939
5035
|
}
|
4940
|
-
return /* @__PURE__ */
|
5036
|
+
return /* @__PURE__ */ React38.createElement(Box, null, /* @__PURE__ */ React38.createElement(
|
4941
5037
|
IconButton_default,
|
4942
5038
|
{
|
4943
5039
|
disabled: !isVideoOn,
|
@@ -4952,7 +5048,7 @@ var CamaraFlipActions = () => {
|
|
4952
5048
|
}
|
4953
5049
|
})
|
4954
5050
|
},
|
4955
|
-
/* @__PURE__ */
|
5051
|
+
/* @__PURE__ */ React38.createElement(CameraFlipIcon, null)
|
4956
5052
|
));
|
4957
5053
|
};
|
4958
5054
|
var AudioOutputActions = () => {
|
@@ -4964,7 +5060,7 @@ var AudioOutputActions = () => {
|
|
4964
5060
|
if (!shouldShowAudioOutput || !(audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) > 0) {
|
4965
5061
|
return null;
|
4966
5062
|
}
|
4967
|
-
return /* @__PURE__ */
|
5063
|
+
return /* @__PURE__ */ React38.createElement(
|
4968
5064
|
AudioOutputSelectionSheet,
|
4969
5065
|
{
|
4970
5066
|
outputDevices: audioOutput,
|
@@ -4983,11 +5079,11 @@ var AudioOutputActions = () => {
|
|
4983
5079
|
}
|
4984
5080
|
})
|
4985
5081
|
},
|
4986
|
-
/* @__PURE__ */
|
5082
|
+
/* @__PURE__ */ React38.createElement(Box, null, /* @__PURE__ */ React38.createElement(IconButton_default, null, /* @__PURE__ */ React38.createElement(SpeakerIcon, null)))
|
4987
5083
|
);
|
4988
5084
|
};
|
4989
5085
|
var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, children }) => {
|
4990
|
-
return /* @__PURE__ */
|
5086
|
+
return /* @__PURE__ */ React38.createElement(Sheet.Root, null, /* @__PURE__ */ React38.createElement(Sheet.Trigger, { asChild: true }, children), /* @__PURE__ */ React38.createElement(Sheet.Content, null, /* @__PURE__ */ React38.createElement(Sheet.Title, { css: { py: "$10", px: "$8", alignItems: "center" } }, /* @__PURE__ */ React38.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%" } }, /* @__PURE__ */ React38.createElement(Text, { variant: "h6", css: { display: "flex" } }, "Audio Output"), /* @__PURE__ */ React38.createElement(Sheet.Close, null, /* @__PURE__ */ React38.createElement(IconButton_default, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React38.createElement(CrossIcon5, null))))), /* @__PURE__ */ React38.createElement(HorizontalDivider, null), /* @__PURE__ */ React38.createElement(
|
4991
5087
|
Flex,
|
4992
5088
|
{
|
4993
5089
|
direction: "column",
|
@@ -4998,7 +5094,7 @@ var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, chil
|
|
4998
5094
|
}
|
4999
5095
|
},
|
5000
5096
|
outputDevices.map((audioDevice) => {
|
5001
|
-
return /* @__PURE__ */
|
5097
|
+
return /* @__PURE__ */ React38.createElement(
|
5002
5098
|
SelectWithLabel,
|
5003
5099
|
{
|
5004
5100
|
key: audioDevice.deviceId,
|
@@ -5011,8 +5107,8 @@ var AudioOutputSelectionSheet = ({ outputDevices, outputSelected, onChange, chil
|
|
5011
5107
|
})
|
5012
5108
|
)));
|
5013
5109
|
};
|
5014
|
-
var SelectWithLabel = ({ label, icon = /* @__PURE__ */
|
5015
|
-
return /* @__PURE__ */
|
5110
|
+
var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React38.createElement(React38.Fragment, null), checked, id, onChange }) => {
|
5111
|
+
return /* @__PURE__ */ React38.createElement(
|
5016
5112
|
Flex,
|
5017
5113
|
{
|
5018
5114
|
align: "center",
|
@@ -5024,7 +5120,7 @@ var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React35.createElement(Rea
|
|
5024
5120
|
},
|
5025
5121
|
onClick: onChange
|
5026
5122
|
},
|
5027
|
-
/* @__PURE__ */
|
5123
|
+
/* @__PURE__ */ React38.createElement(
|
5028
5124
|
Label3,
|
5029
5125
|
{
|
5030
5126
|
htmlFor: id,
|
@@ -5042,7 +5138,7 @@ var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React35.createElement(Rea
|
|
5042
5138
|
icon,
|
5043
5139
|
label
|
5044
5140
|
),
|
5045
|
-
checked && /* @__PURE__ */
|
5141
|
+
checked && /* @__PURE__ */ React38.createElement(CheckIcon2, { width: 24, height: 24 })
|
5046
5142
|
);
|
5047
5143
|
};
|
5048
5144
|
|
@@ -5051,9 +5147,9 @@ var Header2 = () => {
|
|
5051
5147
|
const roomState = useHMSStore16(selectRoomState4);
|
5052
5148
|
const isMobile = useMedia3(config.media.md);
|
5053
5149
|
if (roomState !== HMSRoomState4.Connected) {
|
5054
|
-
return /* @__PURE__ */
|
5150
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null);
|
5055
5151
|
}
|
5056
|
-
return /* @__PURE__ */
|
5152
|
+
return /* @__PURE__ */ React39.createElement(Flex, { justify: "between", align: "center", css: { position: "relative", height: "100%" } }, /* @__PURE__ */ React39.createElement(Flex, { align: "center", gap: "2", css: { position: "absolute", left: "$10" } }, /* @__PURE__ */ React39.createElement(Logo, null), /* @__PURE__ */ React39.createElement(SpeakerTag, null), isMobile && /* @__PURE__ */ React39.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React39.createElement(LiveStatus, null), /* @__PURE__ */ React39.createElement(RecordingStatus, null))), /* @__PURE__ */ React39.createElement(
|
5057
5153
|
Flex,
|
5058
5154
|
{
|
5059
5155
|
align: "center",
|
@@ -5063,8 +5159,8 @@ var Header2 = () => {
|
|
5063
5159
|
gap: "$4"
|
5064
5160
|
}
|
5065
5161
|
},
|
5066
|
-
/* @__PURE__ */
|
5067
|
-
isMobile ? /* @__PURE__ */
|
5162
|
+
/* @__PURE__ */ React39.createElement(StreamActions, null),
|
5163
|
+
isMobile ? /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(CamaraFlipActions, null), /* @__PURE__ */ React39.createElement(AudioOutputActions, null)) : null
|
5068
5164
|
));
|
5069
5165
|
};
|
5070
5166
|
|
@@ -5075,7 +5171,7 @@ var PostLeave = () => {
|
|
5075
5171
|
const { roomCode } = useHMSPrebuiltContext();
|
5076
5172
|
const { roomId, role } = useParams3();
|
5077
5173
|
const [previewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW, defaultPreviewPreference);
|
5078
|
-
return /* @__PURE__ */
|
5174
|
+
return /* @__PURE__ */ React40.createElement(Flex, { direction: "column", css: { size: "100%" } }, /* @__PURE__ */ React40.createElement(Box, { css: { h: "$18", "@md": { h: "$17" } }, "data-testid": "header" }, /* @__PURE__ */ React40.createElement(Header2, null)), /* @__PURE__ */ React40.createElement(
|
5079
5175
|
Flex,
|
5080
5176
|
{
|
5081
5177
|
justify: "center",
|
@@ -5083,9 +5179,9 @@ var PostLeave = () => {
|
|
5083
5179
|
align: "center",
|
5084
5180
|
css: { bg: "$background_dim", flex: "1 1 0", position: "relative" }
|
5085
5181
|
},
|
5086
|
-
/* @__PURE__ */
|
5087
|
-
/* @__PURE__ */
|
5088
|
-
/* @__PURE__ */
|
5182
|
+
/* @__PURE__ */ React40.createElement(Text, { variant: "h2", css: { fontWeight: "$semiBold" } }, "\u{1F44B}"),
|
5183
|
+
/* @__PURE__ */ React40.createElement(Text, { variant: "h4", css: { color: "$on_surface_high", fontWeight: "$semiBold", mt: "$12" } }, "You left the room"),
|
5184
|
+
/* @__PURE__ */ React40.createElement(
|
5089
5185
|
Text,
|
5090
5186
|
{
|
5091
5187
|
variant: "body1",
|
@@ -5097,10 +5193,10 @@ var PostLeave = () => {
|
|
5097
5193
|
}
|
5098
5194
|
},
|
5099
5195
|
"Have a nice day",
|
5100
|
-
previewPreference.name && /* @__PURE__ */
|
5196
|
+
previewPreference.name && /* @__PURE__ */ React40.createElement(Box, { as: "span", css: __spreadValues({}, textEllipsis(100)) }, ", ", previewPreference.name),
|
5101
5197
|
"!"
|
5102
5198
|
),
|
5103
|
-
/* @__PURE__ */
|
5199
|
+
/* @__PURE__ */ React40.createElement(Flex, { css: { mt: "$14", gap: "$10", alignItems: "center" } }, /* @__PURE__ */ React40.createElement(Text, { variant: "body1", css: { color: "$on_surface_medium", fontWeight: "$regular" } }, "Left by mistake?"), /* @__PURE__ */ React40.createElement(
|
5104
5200
|
Button,
|
5105
5201
|
{
|
5106
5202
|
onClick: () => {
|
@@ -5112,37 +5208,37 @@ var PostLeave = () => {
|
|
5112
5208
|
},
|
5113
5209
|
"data-testid": "join_again_btn"
|
5114
5210
|
},
|
5115
|
-
/* @__PURE__ */
|
5116
|
-
/* @__PURE__ */
|
5211
|
+
/* @__PURE__ */ React40.createElement(ExitIcon, null),
|
5212
|
+
/* @__PURE__ */ React40.createElement(Text, { css: { ml: "$3", fontWeight: "$semiBold", color: "inherit" } }, "Rejoin")
|
5117
5213
|
))
|
5118
5214
|
));
|
5119
5215
|
};
|
5120
5216
|
var PostLeave_default = PostLeave;
|
5121
5217
|
|
5122
5218
|
// src/Prebuilt/components/Preview/PreviewContainer.tsx
|
5123
|
-
import
|
5219
|
+
import React54 from "react";
|
5124
5220
|
import { useNavigate as useNavigate4, useParams as useParams4 } from "react-router-dom";
|
5125
5221
|
import { useSearchParam } from "react-use";
|
5126
5222
|
|
5127
5223
|
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
5128
|
-
import
|
5129
|
-
import { useMedia as
|
5224
|
+
import React53, { Fragment as Fragment4, Suspense, useCallback as useCallback16, useEffect as useEffect24, useState as useState16 } from "react";
|
5225
|
+
import { useMedia as useMedia6 } from "react-use";
|
5130
5226
|
import {
|
5131
5227
|
HMSRoomState as HMSRoomState6,
|
5132
5228
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled5,
|
5133
5229
|
selectLocalPeer,
|
5134
5230
|
selectRoomState as selectRoomState6,
|
5135
|
-
selectVideoTrackByID as
|
5231
|
+
selectVideoTrackByID as selectVideoTrackByID4,
|
5136
5232
|
useAVToggle as useAVToggle2,
|
5137
|
-
useHMSStore as
|
5233
|
+
useHMSStore as useHMSStore21,
|
5138
5234
|
useParticipants,
|
5139
5235
|
usePreviewJoin,
|
5140
5236
|
useRecordingStreaming as useRecordingStreaming4
|
5141
5237
|
} from "@100mslive/react-sdk";
|
5142
|
-
import { MicOffIcon as
|
5238
|
+
import { MicOffIcon as MicOffIcon2, SettingsIcon as SettingsIcon2 } from "@100mslive/react-icons";
|
5143
5239
|
|
5144
5240
|
// src/Prebuilt/components/AudioVideoToggle.jsx
|
5145
|
-
import
|
5241
|
+
import React42, { Fragment as Fragment2 } from "react";
|
5146
5242
|
import {
|
5147
5243
|
DeviceType as DeviceType2,
|
5148
5244
|
HMSRoomState as HMSRoomState5,
|
@@ -5157,7 +5253,7 @@ import {
|
|
5157
5253
|
import { CameraFlipIcon as CameraFlipIcon2, MicOffIcon, MicOnIcon as MicOnIcon3, VideoOffIcon, VideoOnIcon } from "@100mslive/react-icons";
|
5158
5254
|
|
5159
5255
|
// src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx
|
5160
|
-
import
|
5256
|
+
import React41 from "react";
|
5161
5257
|
import { VerticalMenuIcon } from "@100mslive/react-icons";
|
5162
5258
|
var IconSection = styled(IconButton_default, {
|
5163
5259
|
w: "unset",
|
@@ -5209,7 +5305,7 @@ var IconButtonWithOptions = ({
|
|
5209
5305
|
}) => {
|
5210
5306
|
const bgCss = { backgroundColor: disabled ? "$surface_brighter" : active ? "$transparent" : "$secondary_dim" };
|
5211
5307
|
const iconCss = { color: disabled ? "$on_surface_low" : active ? "$on_surface_high" : "$on_primary_high" };
|
5212
|
-
return /* @__PURE__ */
|
5308
|
+
return /* @__PURE__ */ React41.createElement(Flex, null, /* @__PURE__ */ React41.createElement(IconSection, { css: bgCss, onClick }, /* @__PURE__ */ React41.createElement(Tooltip, { disabled: !tooltipMessage, title: tooltipMessage }, /* @__PURE__ */ React41.createElement(Flex, { align: "center", justify: "center", css: iconCss }, icon))), /* @__PURE__ */ React41.createElement(Dropdown.Root, null, /* @__PURE__ */ React41.createElement(
|
5213
5309
|
Dropdown.Trigger,
|
5214
5310
|
{
|
5215
5311
|
asChild: true,
|
@@ -5220,8 +5316,8 @@ var IconButtonWithOptions = ({
|
|
5220
5316
|
}
|
5221
5317
|
}
|
5222
5318
|
},
|
5223
|
-
/* @__PURE__ */
|
5224
|
-
), /* @__PURE__ */
|
5319
|
+
/* @__PURE__ */ React41.createElement(OptionsSection, { css: bgCss }, /* @__PURE__ */ React41.createElement(Tooltip, { title: "View Options" }, /* @__PURE__ */ React41.createElement(Box, { css: iconCss }, /* @__PURE__ */ React41.createElement(VerticalMenuIcon, null))))
|
5320
|
+
), /* @__PURE__ */ React41.createElement(
|
5225
5321
|
Dropdown.Content,
|
5226
5322
|
{
|
5227
5323
|
sideOffset: 5,
|
@@ -5233,7 +5329,7 @@ var IconButtonWithOptions = ({
|
|
5233
5329
|
border: "none"
|
5234
5330
|
}
|
5235
5331
|
},
|
5236
|
-
options.map((option, index) => /* @__PURE__ */
|
5332
|
+
options.map((option, index) => /* @__PURE__ */ React41.createElement(
|
5237
5333
|
Dropdown.Item,
|
5238
5334
|
{
|
5239
5335
|
key: option.title,
|
@@ -5260,7 +5356,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5260
5356
|
const { videoInput, audioInput } = allDevices;
|
5261
5357
|
const formattedVideoInputList = videoInput == null ? void 0 : videoInput.map((videoInput2) => ({
|
5262
5358
|
active: selectedDeviceIDs.videoInput === videoInput2.deviceId,
|
5263
|
-
content: /* @__PURE__ */
|
5359
|
+
content: /* @__PURE__ */ React42.createElement(
|
5264
5360
|
Text,
|
5265
5361
|
{
|
5266
5362
|
variant: "sm",
|
@@ -5276,7 +5372,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5276
5372
|
}));
|
5277
5373
|
const formattedAudioInputList = audioInput == null ? void 0 : audioInput.map((audioInput2) => ({
|
5278
5374
|
active: selectedDeviceIDs.audioInput === audioInput2.deviceId,
|
5279
|
-
content: /* @__PURE__ */
|
5375
|
+
content: /* @__PURE__ */ React42.createElement(
|
5280
5376
|
Text,
|
5281
5377
|
{
|
5282
5378
|
variant: "sm",
|
@@ -5297,7 +5393,7 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5297
5393
|
const roomState = useHMSStore17(selectRoomState5);
|
5298
5394
|
const hasAudioDevices = (audioInput == null ? void 0 : audioInput.length) > 0;
|
5299
5395
|
const hasVideoDevices = (videoInput == null ? void 0 : videoInput.length) > 0;
|
5300
|
-
return /* @__PURE__ */
|
5396
|
+
return /* @__PURE__ */ React42.createElement(Fragment2, null, toggleAudio ? hideOptions || !hasAudioDevices ? /* @__PURE__ */ React42.createElement(Tooltip, { title: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)` }, /* @__PURE__ */ React42.createElement(
|
5301
5397
|
IconButton_default,
|
5302
5398
|
{
|
5303
5399
|
active: isLocalAudioEnabled,
|
@@ -5307,20 +5403,20 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5307
5403
|
"data-testid": "audio_btn",
|
5308
5404
|
className: "__cancel-drag-event"
|
5309
5405
|
},
|
5310
|
-
!isLocalAudioEnabled ? /* @__PURE__ */
|
5311
|
-
)) : /* @__PURE__ */
|
5406
|
+
!isLocalAudioEnabled ? /* @__PURE__ */ React42.createElement(MicOffIcon, { "data-testid": "audio_off_btn" }) : /* @__PURE__ */ React42.createElement(MicOnIcon3, { "data-testid": "audio_on_btn" })
|
5407
|
+
)) : /* @__PURE__ */ React42.createElement(
|
5312
5408
|
IconButtonWithOptions,
|
5313
5409
|
{
|
5314
5410
|
options: formattedAudioInputList,
|
5315
5411
|
disabled: !toggleAudio,
|
5316
5412
|
onDisabledClick: toggleAudio,
|
5317
5413
|
tooltipMessage: `Turn ${isLocalAudioEnabled ? "off" : "on"} audio (${isMacOS ? "\u2318" : "ctrl"} + d)`,
|
5318
|
-
icon: !isLocalAudioEnabled ? /* @__PURE__ */
|
5414
|
+
icon: !isLocalAudioEnabled ? /* @__PURE__ */ React42.createElement(MicOffIcon, { "data-testid": "audio_off_btn" }) : /* @__PURE__ */ React42.createElement(MicOnIcon3, { "data-testid": "audio_on_btn" }),
|
5319
5415
|
active: isLocalAudioEnabled,
|
5320
5416
|
onClick: toggleAudio,
|
5321
5417
|
key: "toggleAudio"
|
5322
5418
|
}
|
5323
|
-
) : null, toggleVideo ? hideOptions || !hasVideoDevices ? /* @__PURE__ */
|
5419
|
+
) : null, toggleVideo ? hideOptions || !hasVideoDevices ? /* @__PURE__ */ React42.createElement(Tooltip, { title: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)` }, /* @__PURE__ */ React42.createElement(
|
5324
5420
|
IconButton_default,
|
5325
5421
|
{
|
5326
5422
|
key: "toggleVideo",
|
@@ -5330,20 +5426,20 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5330
5426
|
"data-testid": "video_btn",
|
5331
5427
|
className: "__cancel-drag-event"
|
5332
5428
|
},
|
5333
|
-
!isLocalVideoEnabled ? /* @__PURE__ */
|
5334
|
-
)) : /* @__PURE__ */
|
5429
|
+
!isLocalVideoEnabled ? /* @__PURE__ */ React42.createElement(VideoOffIcon, { "data-testid": "video_off_btn" }) : /* @__PURE__ */ React42.createElement(VideoOnIcon, { "data-testid": "video_on_btn" })
|
5430
|
+
)) : /* @__PURE__ */ React42.createElement(
|
5335
5431
|
IconButtonWithOptions,
|
5336
5432
|
{
|
5337
5433
|
disabled: !toggleVideo,
|
5338
5434
|
onDisabledClick: toggleVideo,
|
5339
5435
|
options: formattedVideoInputList,
|
5340
5436
|
tooltipMessage: `Turn ${isLocalVideoEnabled ? "off" : "on"} video (${isMacOS ? "\u2318" : "ctrl"} + e)`,
|
5341
|
-
icon: !isLocalVideoEnabled ? /* @__PURE__ */
|
5437
|
+
icon: !isLocalVideoEnabled ? /* @__PURE__ */ React42.createElement(VideoOffIcon, { "data-testid": "video_off_btn" }) : /* @__PURE__ */ React42.createElement(VideoOnIcon, { "data-testid": "video_on_btn" }),
|
5342
5438
|
key: "toggleVideo",
|
5343
5439
|
active: isLocalVideoEnabled,
|
5344
5440
|
onClick: toggleVideo
|
5345
5441
|
}
|
5346
|
-
) : null, (localVideoTrack == null ? void 0 : localVideoTrack.facingMode) && roomState === HMSRoomState5.Preview ? /* @__PURE__ */
|
5442
|
+
) : null, (localVideoTrack == null ? void 0 : localVideoTrack.facingMode) && roomState === HMSRoomState5.Preview ? /* @__PURE__ */ React42.createElement(Tooltip, { title: "Switch Camera", key: "switchCamera" }, /* @__PURE__ */ React42.createElement(
|
5347
5443
|
IconButton_default,
|
5348
5444
|
{
|
5349
5445
|
onClick: () => __async(void 0, null, function* () {
|
@@ -5357,32 +5453,43 @@ var AudioVideoToggle = ({ hideOptions = false }) => {
|
|
5357
5453
|
}
|
5358
5454
|
})
|
5359
5455
|
},
|
5360
|
-
/* @__PURE__ */
|
5456
|
+
/* @__PURE__ */ React42.createElement(CameraFlipIcon2, null)
|
5361
5457
|
)) : null);
|
5362
5458
|
};
|
5363
5459
|
|
5364
|
-
// src/Prebuilt/components/Chip.
|
5365
|
-
import
|
5460
|
+
// src/Prebuilt/components/Chip.tsx
|
5461
|
+
import React43 from "react";
|
5366
5462
|
var Chip = ({
|
5367
|
-
icon = /* @__PURE__ */
|
5463
|
+
icon = /* @__PURE__ */ React43.createElement(React43.Fragment, null),
|
5368
5464
|
content = "",
|
5369
5465
|
backgroundColor = "$surface_default",
|
5370
5466
|
textColor = "$on_surface_high",
|
5371
|
-
hideIfNoContent = false
|
5467
|
+
hideIfNoContent = false,
|
5468
|
+
onClick,
|
5469
|
+
css: css2 = {}
|
5372
5470
|
}) => {
|
5373
5471
|
if (hideIfNoContent && !content) {
|
5374
|
-
return;
|
5472
|
+
return null;
|
5375
5473
|
}
|
5376
|
-
return /* @__PURE__ */
|
5474
|
+
return /* @__PURE__ */ React43.createElement(
|
5475
|
+
Flex,
|
5476
|
+
{
|
5477
|
+
align: "center",
|
5478
|
+
css: __spreadValues({ backgroundColor, p: "$4 $6", gap: "$2", borderRadius: "$4" }, css2),
|
5479
|
+
onClick: () => onClick == null ? void 0 : onClick()
|
5480
|
+
},
|
5481
|
+
icon,
|
5482
|
+
/* @__PURE__ */ React43.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", color: textColor } }, content)
|
5483
|
+
);
|
5377
5484
|
};
|
5378
5485
|
var Chip_default = Chip;
|
5379
5486
|
|
5380
5487
|
// src/Prebuilt/components/Connection/TileConnection.tsx
|
5381
|
-
import
|
5488
|
+
import React45 from "react";
|
5382
5489
|
import { PinIcon, SpotlightIcon } from "@100mslive/react-icons";
|
5383
5490
|
|
5384
5491
|
// src/Prebuilt/components/Connection/ConnectionIndicator.tsx
|
5385
|
-
import
|
5492
|
+
import React44 from "react";
|
5386
5493
|
import { selectConnectionQualityByPeerID as selectConnectionQualityByPeerID2, useHMSStore as useHMSStore18 } from "@100mslive/react-sdk";
|
5387
5494
|
import { PoorConnectivityIcon as PoorConnectivityIcon2 } from "@100mslive/react-icons";
|
5388
5495
|
|
@@ -5444,10 +5551,10 @@ var ConnectionIndicator = ({
|
|
5444
5551
|
return null;
|
5445
5552
|
}
|
5446
5553
|
if (downlinkQuality === 0) {
|
5447
|
-
return /* @__PURE__ */
|
5554
|
+
return /* @__PURE__ */ React44.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React44.createElement(Wrapper, { isTile, css: { color: "#ED4C5A" }, "data-testid": "tile_network" }, /* @__PURE__ */ React44.createElement(PoorConnectivityIcon2, null)));
|
5448
5555
|
}
|
5449
5556
|
const size = isTile ? 12 : 16;
|
5450
|
-
return /* @__PURE__ */
|
5557
|
+
return /* @__PURE__ */ React44.createElement(Tooltip, { title: getTooltipText(downlinkQuality) }, /* @__PURE__ */ React44.createElement(Wrapper, { isTile, "data-testid": "tile_network", css: { backgroundColor: hideBg ? "" : "$surface_bright" } }, /* @__PURE__ */ React44.createElement(
|
5451
5558
|
"svg",
|
5452
5559
|
{
|
5453
5560
|
width: size,
|
@@ -5462,7 +5569,7 @@ var ConnectionIndicator = ({
|
|
5462
5569
|
strokeMiterlimit: 2
|
5463
5570
|
}
|
5464
5571
|
},
|
5465
|
-
/* @__PURE__ */
|
5572
|
+
/* @__PURE__ */ React44.createElement(
|
5466
5573
|
"path",
|
5467
5574
|
{
|
5468
5575
|
d: "M6.875 0c2.549.035 4.679.902 6.445 2.648.366.362.45.796.216 1.096-.239.306-.714.34-1.142.072a2.28 2.28 0 0 1-.341-.271C9.24.862 4.924.775 1.992 3.346c-.284.249-.594.419-.983.393-.272-.019-.49-.135-.613-.388-.125-.261-.05-.498.114-.713.073-.092.156-.177.245-.254C2.516.804 4.591.039 6.875 0Z",
|
@@ -5470,7 +5577,7 @@ var ConnectionIndicator = ({
|
|
5470
5577
|
transform: "translate(-.333)"
|
5471
5578
|
}
|
5472
5579
|
),
|
5473
|
-
/* @__PURE__ */
|
5580
|
+
/* @__PURE__ */ React44.createElement(
|
5474
5581
|
"path",
|
5475
5582
|
{
|
5476
5583
|
d: "M7.056 2.964c1.756.035 3.208.7 4.499 1.763.162.134.277.315.354.512.098.251.114.503-.075.72-.193.222-.452.259-.725.198-.293-.066-.518-.247-.738-.443a4.859 4.859 0 0 0-6.198-.26c-.166.127-.318.271-.475.409-.242.211-.513.343-.843.317-.43-.034-.679-.397-.561-.81.062-.211.181-.4.345-.546 1.265-1.162 2.733-1.836 4.417-1.86Z",
|
@@ -5478,14 +5585,14 @@ var ConnectionIndicator = ({
|
|
5478
5585
|
transform: "translate(-.333)"
|
5479
5586
|
}
|
5480
5587
|
),
|
5481
|
-
/* @__PURE__ */
|
5588
|
+
/* @__PURE__ */ React44.createElement(
|
5482
5589
|
"path",
|
5483
5590
|
{
|
5484
5591
|
d: "M7.384,6.052C8.293,6.068 9.157,6.449 9.783,7.108C10.005,7.339 10.157,7.6 10.07,7.942C9.959,8.377 9.435,8.581 9.071,8.243C7.935,7.191 6.356,7.183 5.152,8.183C4.816,8.462 4.6,8.485 4.332,8.27C4.063,8.055 3.998,7.691 4.177,7.358C4.273,7.179 4.414,7.038 4.57,6.911C5.26,6.349 6.149,6.05 7.384,6.052L7.384,6.052Z",
|
5485
5592
|
fill: getColor(2, downlinkQuality, defaultColor, theme2)
|
5486
5593
|
}
|
5487
5594
|
),
|
5488
|
-
/* @__PURE__ */
|
5595
|
+
/* @__PURE__ */ React44.createElement(
|
5489
5596
|
"path",
|
5490
5597
|
{
|
5491
5598
|
d: "M8.214,9.941C8.214,10.234 8.097,10.515 7.888,10.721C7.68,10.928 7.398,11.042 7.104,11.039C6.471,11.036 5.982,10.541 5.993,9.912C6.004,9.259 6.499,8.766 7.133,8.779C7.744,8.791 8.22,9.301 8.214,9.941Z",
|
@@ -5504,7 +5611,7 @@ var TileConnection = ({
|
|
5504
5611
|
spotlighted,
|
5505
5612
|
pinned
|
5506
5613
|
}) => {
|
5507
|
-
return /* @__PURE__ */
|
5614
|
+
return /* @__PURE__ */ React45.createElement(Wrapper2, null, !hideLabel ? /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement(Flex, { align: "center" }, pinned && /* @__PURE__ */ React45.createElement(IconWrapper, null, /* @__PURE__ */ React45.createElement(PinIcon, { width: "15", height: "15" })), spotlighted && /* @__PURE__ */ React45.createElement(IconWrapper, null, /* @__PURE__ */ React45.createElement(SpotlightIcon, { width: "15", height: "15" })), /* @__PURE__ */ React45.createElement(
|
5508
5615
|
Text,
|
5509
5616
|
{
|
5510
5617
|
css: __spreadValues({
|
@@ -5514,7 +5621,7 @@ var TileConnection = ({
|
|
5514
5621
|
variant: "xs"
|
5515
5622
|
},
|
5516
5623
|
name
|
5517
|
-
)), /* @__PURE__ */
|
5624
|
+
)), /* @__PURE__ */ React45.createElement(ConnectionIndicator, { isTile: true, peerId, hideBg: true })) : null);
|
5518
5625
|
};
|
5519
5626
|
var IconWrapper = styled("div", { c: "$on_surface_high", ml: "$3", mt: "$1" });
|
5520
5627
|
var Wrapper2 = styled("div", {
|
@@ -5533,8 +5640,12 @@ var Wrapper2 = styled("div", {
|
|
5533
5640
|
});
|
5534
5641
|
var TileConnection_default = TileConnection;
|
5535
5642
|
|
5643
|
+
// src/Prebuilt/components/PrebuiltTileElements.tsx
|
5644
|
+
var PrebuiltAudioIndicator = styled(StyledVideoTile.AudioIndicator, { height: "$12", width: "$12" });
|
5645
|
+
var PrebuiltAttributeBox = styled(StyledVideoTile.AttributeBox, { height: "$12", width: "$12" });
|
5646
|
+
|
5536
5647
|
// src/Prebuilt/components/Settings/SettingsModal.jsx
|
5537
|
-
import
|
5648
|
+
import React51, { useCallback as useCallback15, useEffect as useEffect23, useState as useState15 } from "react";
|
5538
5649
|
import { useMedia as useMedia4 } from "react-use";
|
5539
5650
|
import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons";
|
5540
5651
|
|
@@ -5542,7 +5653,7 @@ import { ChevronLeftIcon, CrossIcon as CrossIcon6 } from "@100mslive/react-icons
|
|
5542
5653
|
import { GridFourIcon, NotificationsIcon, SettingsIcon } from "@100mslive/react-icons";
|
5543
5654
|
|
5544
5655
|
// src/Prebuilt/components/Settings/DeviceSettings.jsx
|
5545
|
-
import
|
5656
|
+
import React47, { Fragment as Fragment3, useEffect as useEffect22, useRef as useRef7, useState as useState14 } from "react";
|
5546
5657
|
import {
|
5547
5658
|
DeviceType as DeviceType3,
|
5548
5659
|
selectIsLocalVideoEnabled as selectIsLocalVideoEnabled3,
|
@@ -5554,10 +5665,10 @@ import {
|
|
5554
5665
|
import { MicOnIcon as MicOnIcon4, SpeakerIcon as SpeakerIcon2, VideoOnIcon as VideoOnIcon2 } from "@100mslive/react-icons";
|
5555
5666
|
|
5556
5667
|
// src/Prebuilt/primitives/DropdownTrigger.jsx
|
5557
|
-
import
|
5668
|
+
import React46 from "react";
|
5558
5669
|
import { ChevronDownIcon as ChevronDownIcon3, ChevronUpIcon as ChevronUpIcon3 } from "@100mslive/react-icons";
|
5559
|
-
var DialogDropdownTrigger =
|
5560
|
-
return /* @__PURE__ */
|
5670
|
+
var DialogDropdownTrigger = React46.forwardRef(({ title, css: css2, open, icon, titleCSS = {} }, ref) => {
|
5671
|
+
return /* @__PURE__ */ React46.createElement(
|
5561
5672
|
Dropdown.Trigger,
|
5562
5673
|
{
|
5563
5674
|
asChild: true,
|
@@ -5571,7 +5682,7 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5571
5682
|
}, css2),
|
5572
5683
|
ref
|
5573
5684
|
},
|
5574
|
-
/* @__PURE__ */
|
5685
|
+
/* @__PURE__ */ React46.createElement(
|
5575
5686
|
Flex,
|
5576
5687
|
{
|
5577
5688
|
css: {
|
@@ -5582,7 +5693,7 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5582
5693
|
}
|
5583
5694
|
},
|
5584
5695
|
icon,
|
5585
|
-
/* @__PURE__ */
|
5696
|
+
/* @__PURE__ */ React46.createElement(
|
5586
5697
|
Text,
|
5587
5698
|
{
|
5588
5699
|
css: __spreadValues(__spreadProps(__spreadValues({
|
@@ -5594,14 +5705,14 @@ var DialogDropdownTrigger = React43.forwardRef(({ title, css: css2, open, icon,
|
|
5594
5705
|
},
|
5595
5706
|
title
|
5596
5707
|
),
|
5597
|
-
open ? /* @__PURE__ */
|
5708
|
+
open ? /* @__PURE__ */ React46.createElement(ChevronUpIcon3, null) : /* @__PURE__ */ React46.createElement(ChevronDownIcon3, null)
|
5598
5709
|
)
|
5599
5710
|
);
|
5600
5711
|
});
|
5601
5712
|
|
5602
5713
|
// src/Prebuilt/components/hooks/useDropdownSelection.jsx
|
5603
5714
|
var useDropdownSelection = () => {
|
5604
|
-
return "$
|
5715
|
+
return "$surface_bright";
|
5605
5716
|
};
|
5606
5717
|
|
5607
5718
|
// src/Prebuilt/components/Settings/DeviceSettings.jsx
|
@@ -5619,7 +5730,7 @@ var Settings = ({ setHide }) => {
|
|
5619
5730
|
if (!(videoInput == null ? void 0 : videoInput.length) && !(audioInput == null ? void 0 : audioInput.length) && !(audioOutputFiltered == null ? void 0 : audioOutputFiltered.length)) {
|
5620
5731
|
setHide(true);
|
5621
5732
|
}
|
5622
|
-
return /* @__PURE__ */
|
5733
|
+
return /* @__PURE__ */ React47.createElement(Box, { className: settingOverflow() }, (videoInput == null ? void 0 : videoInput.length) ? /* @__PURE__ */ React47.createElement(Fragment3, null, isVideoOn && /* @__PURE__ */ React47.createElement(
|
5623
5734
|
StyledVideoTile.Container,
|
5624
5735
|
{
|
5625
5736
|
css: {
|
@@ -5630,24 +5741,24 @@ var Settings = ({ setHide }) => {
|
|
5630
5741
|
m: "$10 auto"
|
5631
5742
|
}
|
5632
5743
|
},
|
5633
|
-
/* @__PURE__ */
|
5634
|
-
), /* @__PURE__ */
|
5744
|
+
/* @__PURE__ */ React47.createElement(Video, { trackId: videoTrackId, mirror: (track == null ? void 0 : track.facingMode) !== "environment" && mirrorLocalVideo })
|
5745
|
+
), /* @__PURE__ */ React47.createElement(
|
5635
5746
|
DeviceSelector,
|
5636
5747
|
{
|
5637
5748
|
title: "Video",
|
5638
5749
|
devices: videoInput,
|
5639
|
-
icon: /* @__PURE__ */
|
5750
|
+
icon: /* @__PURE__ */ React47.createElement(VideoOnIcon2, null),
|
5640
5751
|
selection: selectedDeviceIDs.videoInput,
|
5641
5752
|
onChange: (deviceId) => updateDevice({
|
5642
5753
|
deviceId,
|
5643
5754
|
deviceType: DeviceType3.videoInput
|
5644
5755
|
})
|
5645
5756
|
}
|
5646
|
-
)) : null, (audioInput == null ? void 0 : audioInput.length) ? /* @__PURE__ */
|
5757
|
+
)) : null, (audioInput == null ? void 0 : audioInput.length) ? /* @__PURE__ */ React47.createElement(
|
5647
5758
|
DeviceSelector,
|
5648
5759
|
{
|
5649
5760
|
title: shouldShowAudioOutput ? "Microphone" : "Audio",
|
5650
|
-
icon: /* @__PURE__ */
|
5761
|
+
icon: /* @__PURE__ */ React47.createElement(MicOnIcon4, null),
|
5651
5762
|
devices: audioInput,
|
5652
5763
|
selection: selectedDeviceIDs.audioInput,
|
5653
5764
|
onChange: (deviceId) => updateDevice({
|
@@ -5655,11 +5766,11 @@ var Settings = ({ setHide }) => {
|
|
5655
5766
|
deviceType: DeviceType3.audioInput
|
5656
5767
|
})
|
5657
5768
|
}
|
5658
|
-
) : null, (audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) && shouldShowAudioOutput ? /* @__PURE__ */
|
5769
|
+
) : null, (audioOutputFiltered == null ? void 0 : audioOutputFiltered.length) && shouldShowAudioOutput ? /* @__PURE__ */ React47.createElement(
|
5659
5770
|
DeviceSelector,
|
5660
5771
|
{
|
5661
5772
|
title: "Speaker",
|
5662
|
-
icon: /* @__PURE__ */
|
5773
|
+
icon: /* @__PURE__ */ React47.createElement(SpeakerIcon2, null),
|
5663
5774
|
devices: audioOutput,
|
5664
5775
|
selection: selectedDeviceIDs.audioOutput,
|
5665
5776
|
onChange: (deviceId) => updateDevice({
|
@@ -5667,15 +5778,15 @@ var Settings = ({ setHide }) => {
|
|
5667
5778
|
deviceType: DeviceType3.audioOutput
|
5668
5779
|
})
|
5669
5780
|
},
|
5670
|
-
/* @__PURE__ */
|
5781
|
+
/* @__PURE__ */ React47.createElement(TestAudio, { id: selectedDeviceIDs.audioOutput })
|
5671
5782
|
) : null);
|
5672
5783
|
};
|
5673
5784
|
var DeviceSelector = ({ title, devices, selection, onChange, icon, children = null }) => {
|
5674
5785
|
var _a7, _b7;
|
5675
5786
|
const [open, setOpen] = useState14(false);
|
5676
5787
|
const selectionBg = useDropdownSelection();
|
5677
|
-
const ref =
|
5678
|
-
return /* @__PURE__ */
|
5788
|
+
const ref = useRef7(null);
|
5789
|
+
return /* @__PURE__ */ React47.createElement(Box, { css: { mb: "$10" } }, /* @__PURE__ */ React47.createElement(Text, { css: { mb: "$4" } }, title), /* @__PURE__ */ React47.createElement(
|
5679
5790
|
Flex,
|
5680
5791
|
{
|
5681
5792
|
align: "center",
|
@@ -5687,7 +5798,7 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5687
5798
|
}
|
5688
5799
|
}
|
5689
5800
|
},
|
5690
|
-
/* @__PURE__ */
|
5801
|
+
/* @__PURE__ */ React47.createElement(
|
5691
5802
|
Box,
|
5692
5803
|
{
|
5693
5804
|
css: {
|
@@ -5701,7 +5812,7 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5701
5812
|
}
|
5702
5813
|
}
|
5703
5814
|
},
|
5704
|
-
/* @__PURE__ */
|
5815
|
+
/* @__PURE__ */ React47.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React47.createElement(
|
5705
5816
|
DialogDropdownTrigger,
|
5706
5817
|
{
|
5707
5818
|
ref,
|
@@ -5709,8 +5820,8 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5709
5820
|
title: ((_a7 = devices.find(({ deviceId }) => deviceId === selection)) == null ? void 0 : _a7.label) || "Select device from list",
|
5710
5821
|
open
|
5711
5822
|
}
|
5712
|
-
), /* @__PURE__ */
|
5713
|
-
return /* @__PURE__ */
|
5823
|
+
), /* @__PURE__ */ React47.createElement(Dropdown.Portal, null, /* @__PURE__ */ React47.createElement(Dropdown.Content, { align: "start", sideOffset: 8, css: { w: (_b7 = ref.current) == null ? void 0 : _b7.clientWidth, zIndex: 1001 } }, devices.map((device) => {
|
5824
|
+
return /* @__PURE__ */ React47.createElement(
|
5714
5825
|
Dropdown.Item,
|
5715
5826
|
{
|
5716
5827
|
key: device.label,
|
@@ -5729,9 +5840,9 @@ var DeviceSelector = ({ title, devices, selection, onChange, icon, children = nu
|
|
5729
5840
|
};
|
5730
5841
|
var TEST_AUDIO_URL = "https://100ms.live/test-audio.wav";
|
5731
5842
|
var TestAudio = ({ id }) => {
|
5732
|
-
const audioRef =
|
5843
|
+
const audioRef = useRef7(null);
|
5733
5844
|
const [playing, setPlaying] = useState14(false);
|
5734
|
-
|
5845
|
+
useEffect22(() => {
|
5735
5846
|
if (audioRef.current && id) {
|
5736
5847
|
try {
|
5737
5848
|
if (typeof audioRef.current.setSinkId !== "undefined") {
|
@@ -5742,7 +5853,7 @@ var TestAudio = ({ id }) => {
|
|
5742
5853
|
}
|
5743
5854
|
}
|
5744
5855
|
}, [id]);
|
5745
|
-
return /* @__PURE__ */
|
5856
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(
|
5746
5857
|
Button,
|
5747
5858
|
{
|
5748
5859
|
variant: "standard",
|
@@ -5759,22 +5870,22 @@ var TestAudio = ({ id }) => {
|
|
5759
5870
|
},
|
5760
5871
|
disabled: playing
|
5761
5872
|
},
|
5762
|
-
/* @__PURE__ */
|
5873
|
+
/* @__PURE__ */ React47.createElement(SpeakerIcon2, null),
|
5763
5874
|
"\xA0Test",
|
5764
5875
|
" ",
|
5765
|
-
/* @__PURE__ */
|
5766
|
-
), /* @__PURE__ */
|
5876
|
+
/* @__PURE__ */ React47.createElement(Text, { as: "span", css: { display: "none", "@md": { display: "inline" } } }, "\xA0 speaker")
|
5877
|
+
), /* @__PURE__ */ React47.createElement("audio", { ref: audioRef, src: TEST_AUDIO_URL, onEnded: () => setPlaying(false), onPlay: () => setPlaying(true) }));
|
5767
5878
|
};
|
5768
5879
|
var DeviceSettings_default = Settings;
|
5769
5880
|
|
5770
5881
|
// src/Prebuilt/components/Settings/LayoutSettings.jsx
|
5771
|
-
import
|
5882
|
+
import React49, { useCallback as useCallback14 } from "react";
|
5772
5883
|
import { selectIsLocalScreenShared, selectIsLocalVideoEnabled as selectIsLocalVideoEnabled4, useHMSActions as useHMSActions15, useHMSStore as useHMSStore20 } from "@100mslive/react-sdk";
|
5773
5884
|
|
5774
5885
|
// src/Prebuilt/components/Settings/SwitchWithLabel.jsx
|
5775
|
-
import
|
5886
|
+
import React48 from "react";
|
5776
5887
|
var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) => {
|
5777
|
-
return /* @__PURE__ */
|
5888
|
+
return /* @__PURE__ */ React48.createElement(
|
5778
5889
|
Flex,
|
5779
5890
|
{
|
5780
5891
|
align: "center",
|
@@ -5786,7 +5897,7 @@ var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) =>
|
|
5786
5897
|
display: hide ? "none" : "flex"
|
5787
5898
|
}
|
5788
5899
|
},
|
5789
|
-
/* @__PURE__ */
|
5900
|
+
/* @__PURE__ */ React48.createElement(
|
5790
5901
|
Label3,
|
5791
5902
|
{
|
5792
5903
|
htmlFor: id,
|
@@ -5804,7 +5915,7 @@ var SwitchWithLabel = ({ label, icon, id, onChange, checked, hide = false }) =>
|
|
5804
5915
|
icon,
|
5805
5916
|
label
|
5806
5917
|
),
|
5807
|
-
/* @__PURE__ */
|
5918
|
+
/* @__PURE__ */ React48.createElement(Switch, { id, checked, onCheckedChange: onChange })
|
5808
5919
|
);
|
5809
5920
|
};
|
5810
5921
|
var SwitchWithLabel_default = SwitchWithLabel;
|
@@ -5825,7 +5936,7 @@ var LayoutSettings = () => {
|
|
5825
5936
|
}),
|
5826
5937
|
[hmsActions, isLocalVideoEnabled, isLocalScreenShared, setUISettings]
|
5827
5938
|
);
|
5828
|
-
return /* @__PURE__ */
|
5939
|
+
return /* @__PURE__ */ React49.createElement(Box, { className: settingOverflow() }, /* @__PURE__ */ React49.createElement(SwitchWithLabel_default, { label: "Audio Only Mode", id: "audioOnlyMode", checked: isAudioOnly, onChange: toggleIsAudioOnly }), /* @__PURE__ */ React49.createElement(
|
5829
5940
|
SwitchWithLabel_default,
|
5830
5941
|
{
|
5831
5942
|
label: "Mirror Local Video",
|
@@ -5837,7 +5948,7 @@ var LayoutSettings = () => {
|
|
5837
5948
|
});
|
5838
5949
|
}
|
5839
5950
|
}
|
5840
|
-
), /* @__PURE__ */
|
5951
|
+
), /* @__PURE__ */ React49.createElement(Flex, { align: "center", css: { w: "100%", my: "$2", py: "$8", "@md": { display: "none" } } }, /* @__PURE__ */ React49.createElement(Text, { variant: "md", css: { fontWeight: "$semiBold" } }, "Tiles In View(", maxTileCount, ")"), /* @__PURE__ */ React49.createElement(Flex, { justify: "end", css: { flex: "1 1 0" } }, /* @__PURE__ */ React49.createElement(
|
5841
5952
|
Slider,
|
5842
5953
|
{
|
5843
5954
|
step: 1,
|
@@ -5853,11 +5964,11 @@ var LayoutSettings = () => {
|
|
5853
5964
|
};
|
5854
5965
|
|
5855
5966
|
// src/Prebuilt/components/Settings/NotificationSettings.jsx
|
5856
|
-
import
|
5967
|
+
import React50 from "react";
|
5857
5968
|
import { AlertOctagonIcon, HandIcon as HandIcon2, PeopleAddIcon as PeopleAddIcon2, PeopleRemoveIcon as PeopleRemoveIcon2 } from "@100mslive/react-icons";
|
5858
5969
|
var NotificationItem = ({ type, label, icon, checked }) => {
|
5859
5970
|
const [, setSubscribedNotifications] = useSetSubscribedNotifications(type);
|
5860
|
-
return /* @__PURE__ */
|
5971
|
+
return /* @__PURE__ */ React50.createElement(
|
5861
5972
|
SwitchWithLabel_default,
|
5862
5973
|
{
|
5863
5974
|
label,
|
@@ -5872,36 +5983,36 @@ var NotificationItem = ({ type, label, icon, checked }) => {
|
|
5872
5983
|
};
|
5873
5984
|
var NotificationSettings = () => {
|
5874
5985
|
const subscribedNotifications = useSubscribedNotifications();
|
5875
|
-
return /* @__PURE__ */
|
5986
|
+
return /* @__PURE__ */ React50.createElement(Box, { className: settingOverflow() }, /* @__PURE__ */ React50.createElement(
|
5876
5987
|
NotificationItem,
|
5877
5988
|
{
|
5878
5989
|
label: "Peer Joined",
|
5879
5990
|
type: SUBSCRIBED_NOTIFICATIONS.PEER_JOINED,
|
5880
|
-
icon: /* @__PURE__ */
|
5991
|
+
icon: /* @__PURE__ */ React50.createElement(PeopleAddIcon2, null),
|
5881
5992
|
checked: subscribedNotifications.PEER_JOINED
|
5882
5993
|
}
|
5883
|
-
), /* @__PURE__ */
|
5994
|
+
), /* @__PURE__ */ React50.createElement(
|
5884
5995
|
NotificationItem,
|
5885
5996
|
{
|
5886
5997
|
label: "Peer Leave",
|
5887
5998
|
type: SUBSCRIBED_NOTIFICATIONS.PEER_LEFT,
|
5888
|
-
icon: /* @__PURE__ */
|
5999
|
+
icon: /* @__PURE__ */ React50.createElement(PeopleRemoveIcon2, null),
|
5889
6000
|
checked: subscribedNotifications.PEER_LEFT
|
5890
6001
|
}
|
5891
|
-
), /* @__PURE__ */
|
6002
|
+
), /* @__PURE__ */ React50.createElement(
|
5892
6003
|
NotificationItem,
|
5893
6004
|
{
|
5894
6005
|
label: "Hand Raised",
|
5895
6006
|
type: SUBSCRIBED_NOTIFICATIONS.METADATA_UPDATED,
|
5896
|
-
icon: /* @__PURE__ */
|
6007
|
+
icon: /* @__PURE__ */ React50.createElement(HandIcon2, null),
|
5897
6008
|
checked: subscribedNotifications.METADATA_UPDATED
|
5898
6009
|
}
|
5899
|
-
), /* @__PURE__ */
|
6010
|
+
), /* @__PURE__ */ React50.createElement(
|
5900
6011
|
NotificationItem,
|
5901
6012
|
{
|
5902
6013
|
label: "Error",
|
5903
6014
|
type: SUBSCRIBED_NOTIFICATIONS.ERROR,
|
5904
|
-
icon: /* @__PURE__ */
|
6015
|
+
icon: /* @__PURE__ */ React50.createElement(AlertOctagonIcon, null),
|
5905
6016
|
checked: subscribedNotifications.ERROR
|
5906
6017
|
}
|
5907
6018
|
));
|
@@ -5943,7 +6054,7 @@ var settingsList = [
|
|
5943
6054
|
];
|
5944
6055
|
|
5945
6056
|
// src/Prebuilt/components/Settings/SettingsModal.jsx
|
5946
|
-
var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ */
|
6057
|
+
var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ */ React51.createElement(React51.Fragment, null) }) => {
|
5947
6058
|
const mediaQueryLg = config.media.md;
|
5948
6059
|
const isMobile = useMedia4(mediaQueryLg);
|
5949
6060
|
const [showSetting, setShowSetting] = useState15(
|
@@ -5953,7 +6064,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5953
6064
|
(key) => (hide) => setShowSetting((prev) => __spreadProps(__spreadValues({}, prev), { [key]: !hide })),
|
5954
6065
|
[setShowSetting]
|
5955
6066
|
);
|
5956
|
-
|
6067
|
+
useEffect23(() => {
|
5957
6068
|
if (screenType === "hls_live_streaming") {
|
5958
6069
|
hideSettingByTabName("layout")(true);
|
5959
6070
|
}
|
@@ -5965,7 +6076,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5965
6076
|
const resetSelection = useCallback15(() => {
|
5966
6077
|
setSelection("");
|
5967
6078
|
}, []);
|
5968
|
-
|
6079
|
+
useEffect23(() => {
|
5969
6080
|
var _a7;
|
5970
6081
|
if (isMobile) {
|
5971
6082
|
setSelection("");
|
@@ -5974,7 +6085,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5974
6085
|
setSelection(firstNotHiddenTabName);
|
5975
6086
|
}
|
5976
6087
|
}, [isMobile, showSetting]);
|
5977
|
-
return isMobile ? /* @__PURE__ */
|
6088
|
+
return isMobile ? /* @__PURE__ */ React51.createElement(
|
5978
6089
|
MobileSettingModal,
|
5979
6090
|
{
|
5980
6091
|
open,
|
@@ -5986,7 +6097,7 @@ var SettingsModal = ({ open, onOpenChange, screenType, children = /* @__PURE__ *
|
|
5986
6097
|
resetSelection,
|
5987
6098
|
children
|
5988
6099
|
}
|
5989
|
-
) : /* @__PURE__ */
|
6100
|
+
) : /* @__PURE__ */ React51.createElement(
|
5990
6101
|
DesktopSettingModal,
|
5991
6102
|
{
|
5992
6103
|
open,
|
@@ -6008,9 +6119,9 @@ var MobileSettingModal = ({
|
|
6008
6119
|
showSetting,
|
6009
6120
|
hideSettingByTabName,
|
6010
6121
|
resetSelection,
|
6011
|
-
children = /* @__PURE__ */
|
6122
|
+
children = /* @__PURE__ */ React51.createElement(React51.Fragment, null)
|
6012
6123
|
}) => {
|
6013
|
-
return /* @__PURE__ */
|
6124
|
+
return /* @__PURE__ */ React51.createElement(Sheet.Root, { open, onOpenChange }, /* @__PURE__ */ React51.createElement(Sheet.Trigger, { asChild: true }, children), /* @__PURE__ */ React51.createElement(
|
6014
6125
|
Sheet.Content,
|
6015
6126
|
{
|
6016
6127
|
css: {
|
@@ -6018,9 +6129,9 @@ var MobileSettingModal = ({
|
|
6018
6129
|
overflowY: "auto"
|
6019
6130
|
}
|
6020
6131
|
},
|
6021
|
-
/* @__PURE__ */
|
6022
|
-
/* @__PURE__ */
|
6023
|
-
!selection ? /* @__PURE__ */
|
6132
|
+
/* @__PURE__ */ React51.createElement(Sheet.Title, { css: { py: "$10", px: "$8", alignItems: "center" } }, /* @__PURE__ */ React51.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%" } }, !selection ? /* @__PURE__ */ React51.createElement(Text, { variant: "h6", css: { display: "flex" } }, "Settings") : /* @__PURE__ */ React51.createElement(Text, { variant: "h6", css: { display: "flex" } }, /* @__PURE__ */ React51.createElement(Box, { as: "span", css: { r: "$round", mr: "$2" }, onClick: resetSelection }, /* @__PURE__ */ React51.createElement(ChevronLeftIcon, null)), (selection == null ? void 0 : selection.charAt(0).toUpperCase()) + selection.slice(1)), /* @__PURE__ */ React51.createElement(Sheet.Close, null, /* @__PURE__ */ React51.createElement(IconButton, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React51.createElement(CrossIcon6, null))))),
|
6133
|
+
/* @__PURE__ */ React51.createElement(HorizontalDivider, null),
|
6134
|
+
!selection ? /* @__PURE__ */ React51.createElement(
|
6024
6135
|
Flex,
|
6025
6136
|
{
|
6026
6137
|
direction: "column",
|
@@ -6031,7 +6142,7 @@ var MobileSettingModal = ({
|
|
6031
6142
|
}
|
6032
6143
|
},
|
6033
6144
|
settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ icon: Icon2, tabName, title }) => {
|
6034
|
-
return /* @__PURE__ */
|
6145
|
+
return /* @__PURE__ */ React51.createElement(
|
6035
6146
|
Box,
|
6036
6147
|
{
|
6037
6148
|
key: tabName,
|
@@ -6061,18 +6172,18 @@ var MobileSettingModal = ({
|
|
6061
6172
|
borderBottom: "1px solid $border_default"
|
6062
6173
|
}
|
6063
6174
|
},
|
6064
|
-
/* @__PURE__ */
|
6175
|
+
/* @__PURE__ */ React51.createElement(Icon2, null),
|
6065
6176
|
title
|
6066
6177
|
);
|
6067
6178
|
})
|
6068
|
-
) : /* @__PURE__ */
|
6179
|
+
) : /* @__PURE__ */ React51.createElement(
|
6069
6180
|
Box,
|
6070
6181
|
{
|
6071
6182
|
direction: "column",
|
6072
6183
|
css: { overflowY: "scroll", px: "$8", py: "$10", maxHeight: "70vh", overflowX: "hidden" }
|
6073
6184
|
},
|
6074
6185
|
settingsList.filter(({ tabName }) => showSetting[tabName] && selection === tabName).map(({ content: Content10, title, tabName }) => {
|
6075
|
-
return /* @__PURE__ */
|
6186
|
+
return /* @__PURE__ */ React51.createElement(Content10, { key: title, setHide: hideSettingByTabName(tabName) });
|
6076
6187
|
})
|
6077
6188
|
)
|
6078
6189
|
));
|
@@ -6085,9 +6196,9 @@ var DesktopSettingModal = ({
|
|
6085
6196
|
showSetting,
|
6086
6197
|
hideSettingByTabName,
|
6087
6198
|
resetSelection,
|
6088
|
-
children = /* @__PURE__ */
|
6199
|
+
children = /* @__PURE__ */ React51.createElement(React51.Fragment, null)
|
6089
6200
|
}) => {
|
6090
|
-
return /* @__PURE__ */
|
6201
|
+
return /* @__PURE__ */ React51.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React51.createElement(Dialog.Trigger, { asChild: true }, children), /* @__PURE__ */ React51.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React51.createElement(Dialog.Overlay, null), /* @__PURE__ */ React51.createElement(
|
6091
6202
|
Dialog.Content,
|
6092
6203
|
{
|
6093
6204
|
css: {
|
@@ -6097,7 +6208,7 @@ var DesktopSettingModal = ({
|
|
6097
6208
|
r: "$4"
|
6098
6209
|
}
|
6099
6210
|
},
|
6100
|
-
/* @__PURE__ */
|
6211
|
+
/* @__PURE__ */ React51.createElement(
|
6101
6212
|
Tabs.Root,
|
6102
6213
|
{
|
6103
6214
|
value: selection,
|
@@ -6105,7 +6216,7 @@ var DesktopSettingModal = ({
|
|
6105
6216
|
onValueChange: setSelection,
|
6106
6217
|
css: { size: "100%", position: "relative" }
|
6107
6218
|
},
|
6108
|
-
/* @__PURE__ */
|
6219
|
+
/* @__PURE__ */ React51.createElement(
|
6109
6220
|
Tabs.List,
|
6110
6221
|
{
|
6111
6222
|
css: {
|
@@ -6117,12 +6228,12 @@ var DesktopSettingModal = ({
|
|
6117
6228
|
borderBottomLeftRadius: "$4"
|
6118
6229
|
}
|
6119
6230
|
},
|
6120
|
-
/* @__PURE__ */
|
6121
|
-
/* @__PURE__ */
|
6122
|
-
return /* @__PURE__ */
|
6231
|
+
/* @__PURE__ */ React51.createElement(Text, { variant: "h5" }, "Settings "),
|
6232
|
+
/* @__PURE__ */ React51.createElement(Flex, { direction: "column", css: { mx: 0, overflowY: "auto", pt: "$10" } }, settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ icon: Icon2, tabName, title }) => {
|
6233
|
+
return /* @__PURE__ */ React51.createElement(Tabs.Trigger, { key: tabName, value: tabName, css: { gap: "$8" } }, /* @__PURE__ */ React51.createElement(Icon2, null), title);
|
6123
6234
|
}))
|
6124
6235
|
),
|
6125
|
-
selection && /* @__PURE__ */
|
6236
|
+
selection && /* @__PURE__ */ React51.createElement(
|
6126
6237
|
Flex,
|
6127
6238
|
{
|
6128
6239
|
direction: "column",
|
@@ -6133,731 +6244,21 @@ var DesktopSettingModal = ({
|
|
6133
6244
|
}
|
6134
6245
|
},
|
6135
6246
|
settingsList.filter(({ tabName }) => showSetting[tabName]).map(({ content: Content10, title, tabName }) => {
|
6136
|
-
return /* @__PURE__ */
|
6247
|
+
return /* @__PURE__ */ React51.createElement(Tabs.Content, { key: tabName, value: tabName, className: settingContent() }, /* @__PURE__ */ React51.createElement(SettingsContentHeader, { onBack: resetSelection, isMobile: false }, title), /* @__PURE__ */ React51.createElement(Content10, { setHide: hideSettingByTabName(tabName) }));
|
6137
6248
|
})
|
6138
6249
|
)
|
6139
6250
|
),
|
6140
|
-
/* @__PURE__ */
|
6251
|
+
/* @__PURE__ */ React51.createElement(Dialog.Close, { css: { position: "absolute", right: "$10", top: "$10" } }, /* @__PURE__ */ React51.createElement(IconButton, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React51.createElement(CrossIcon6, null)))
|
6141
6252
|
)));
|
6142
6253
|
};
|
6143
6254
|
var SettingsContentHeader = ({ children, isMobile, onBack }) => {
|
6144
|
-
return /* @__PURE__ */
|
6255
|
+
return /* @__PURE__ */ React51.createElement(Text, { variant: "h6", css: { mb: "$12", display: "flex", alignItems: "center" } }, isMobile && /* @__PURE__ */ React51.createElement(Box, { as: "span", css: { bg: "$surface_bright", mr: "$4", r: "$round", p: "$2" }, onClick: onBack }, /* @__PURE__ */ React51.createElement(ChevronLeftIcon, null)), children);
|
6145
6256
|
};
|
6146
6257
|
var SettingsModal_default = SettingsModal;
|
6147
6258
|
|
6148
|
-
// src/Prebuilt/components/VideoTile.jsx
|
6149
|
-
import React53, { Fragment as Fragment5, useCallback as useCallback16, useEffect as useEffect23, useMemo as useMemo3, useRef as useRef7, useState as useState18 } from "react";
|
6150
|
-
import { useMedia as useMedia8 } from "react-use";
|
6151
|
-
import {
|
6152
|
-
selectAudioTrackByPeerID as selectAudioTrackByPeerID2,
|
6153
|
-
selectHasPeerHandRaised as selectHasPeerHandRaised3,
|
6154
|
-
selectIsPeerAudioEnabled,
|
6155
|
-
selectLocalPeerID as selectLocalPeerID5,
|
6156
|
-
selectPeerMetadata as selectPeerMetadata2,
|
6157
|
-
selectPeerNameByID,
|
6158
|
-
selectSessionStore as selectSessionStore3,
|
6159
|
-
selectTrackAudioByID,
|
6160
|
-
selectVideoTrackByID as selectVideoTrackByID4,
|
6161
|
-
selectVideoTrackByPeerID as selectVideoTrackByPeerID3,
|
6162
|
-
useHMSStore as useHMSStore24,
|
6163
|
-
useHMSVanillaStore as useHMSVanillaStore6
|
6164
|
-
} from "@100mslive/react-sdk";
|
6165
|
-
import { BrbTileIcon, HandIcon as HandIcon3, MicOffIcon as MicOffIcon3 } from "@100mslive/react-icons";
|
6166
|
-
|
6167
|
-
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
6168
|
-
import React52, { useState as useState17 } from "react";
|
6169
|
-
import { useMedia as useMedia7 } from "react-use";
|
6170
|
-
import {
|
6171
|
-
selectLocalPeerID as selectLocalPeerID4,
|
6172
|
-
selectPeerByID as selectPeerByID2,
|
6173
|
-
selectPermissions as selectPermissions3,
|
6174
|
-
selectTrackByID as selectTrackByID3,
|
6175
|
-
selectVideoTrackByPeerID as selectVideoTrackByPeerID2,
|
6176
|
-
useHMSStore as useHMSStore23,
|
6177
|
-
useRemoteAVToggle as useRemoteAVToggle2
|
6178
|
-
} from "@100mslive/react-sdk";
|
6179
|
-
import { CrossIcon as CrossIcon8, VerticalMenuIcon as VerticalMenuIcon2 } from "@100mslive/react-icons";
|
6180
|
-
|
6181
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
6182
|
-
import React50, { useState as useState16 } from "react";
|
6183
|
-
import { useMedia as useMedia5 } from "react-use";
|
6184
|
-
import { selectLocalPeerName, useHMSActions as useHMSActions16, useHMSStore as useHMSStore21 } from "@100mslive/react-sdk";
|
6185
|
-
|
6186
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx
|
6187
|
-
import React49 from "react";
|
6188
|
-
import { ChevronLeftIcon as ChevronLeftIcon2, CrossIcon as CrossIcon7 } from "@100mslive/react-icons";
|
6189
|
-
var ChangeNameContent = ({
|
6190
|
-
changeName,
|
6191
|
-
setCurrentName,
|
6192
|
-
currentName,
|
6193
|
-
localPeerName,
|
6194
|
-
isMobile,
|
6195
|
-
onExit,
|
6196
|
-
onBackClick
|
6197
|
-
}) => {
|
6198
|
-
return /* @__PURE__ */ React49.createElement(
|
6199
|
-
"form",
|
6200
|
-
{
|
6201
|
-
onSubmit: (e) => __async(void 0, null, function* () {
|
6202
|
-
e.preventDefault();
|
6203
|
-
yield changeName();
|
6204
|
-
})
|
6205
|
-
},
|
6206
|
-
/* @__PURE__ */ React49.createElement(
|
6207
|
-
Text,
|
6208
|
-
{
|
6209
|
-
variant: isMobile ? "md" : "lg",
|
6210
|
-
css: {
|
6211
|
-
color: "$on_surface_high",
|
6212
|
-
fontWeight: "$semiBold",
|
6213
|
-
display: "flex",
|
6214
|
-
pb: "$4",
|
6215
|
-
"@md": { px: "$8", borderBottom: "1px solid $border_default" }
|
6216
|
-
}
|
6217
|
-
},
|
6218
|
-
isMobile ? /* @__PURE__ */ React49.createElement(ChevronLeftIcon2, { onClick: onBackClick, style: { marginRight: "0.5rem" } }) : null,
|
6219
|
-
"Change Name",
|
6220
|
-
/* @__PURE__ */ React49.createElement(
|
6221
|
-
Box,
|
6222
|
-
{
|
6223
|
-
css: { color: "inherit", ml: "auto", "&:hover": { color: "$on_surface_medium", cursor: "pointer" } },
|
6224
|
-
onClick: onExit
|
6225
|
-
},
|
6226
|
-
/* @__PURE__ */ React49.createElement(CrossIcon7, null)
|
6227
|
-
)
|
6228
|
-
),
|
6229
|
-
/* @__PURE__ */ React49.createElement(Text, { variant: "sm", css: { color: "$on_surface_medium", pb: "$6", mb: "$8", "@md": { px: "$8", mt: "$4" } } }, "Your name will be visible to other participants in the session."),
|
6230
|
-
/* @__PURE__ */ React49.createElement(Flex, { justify: "center", align: "center", css: { my: "$8", w: "100%", "@md": { px: "$8" } } }, /* @__PURE__ */ React49.createElement(
|
6231
|
-
Input,
|
6232
|
-
{
|
6233
|
-
css: { width: "100%", bg: "$surface_default" },
|
6234
|
-
value: currentName,
|
6235
|
-
type: isMobile ? "search" : "text",
|
6236
|
-
onChange: (e) => {
|
6237
|
-
setCurrentName(e.target.value);
|
6238
|
-
},
|
6239
|
-
autoComplete: "name",
|
6240
|
-
required: true,
|
6241
|
-
"data-testid": "change_name_field",
|
6242
|
-
onKeyDown: (e) => __async(void 0, null, function* () {
|
6243
|
-
if (e.key === "Enter" && currentName.trim().length > 0 && currentName !== localPeerName) {
|
6244
|
-
e.preventDefault();
|
6245
|
-
if (isMobile) {
|
6246
|
-
return;
|
6247
|
-
}
|
6248
|
-
changeName();
|
6249
|
-
}
|
6250
|
-
})
|
6251
|
-
}
|
6252
|
-
)),
|
6253
|
-
/* @__PURE__ */ React49.createElement(
|
6254
|
-
Flex,
|
6255
|
-
{
|
6256
|
-
justify: "between",
|
6257
|
-
align: "center",
|
6258
|
-
css: {
|
6259
|
-
width: "100%",
|
6260
|
-
gap: "$md",
|
6261
|
-
mt: "$10",
|
6262
|
-
"@md": { px: "$4" }
|
6263
|
-
}
|
6264
|
-
},
|
6265
|
-
isMobile ? null : /* @__PURE__ */ React49.createElement(
|
6266
|
-
Button,
|
6267
|
-
{
|
6268
|
-
variant: "standard",
|
6269
|
-
css: { w: "100%" },
|
6270
|
-
outlined: true,
|
6271
|
-
type: "submit",
|
6272
|
-
disabled: !localPeerName,
|
6273
|
-
onClick: onExit
|
6274
|
-
},
|
6275
|
-
"Cancel"
|
6276
|
-
),
|
6277
|
-
/* @__PURE__ */ React49.createElement(
|
6278
|
-
Button,
|
6279
|
-
{
|
6280
|
-
variant: "primary",
|
6281
|
-
css: { width: "100%" },
|
6282
|
-
type: "submit",
|
6283
|
-
disabled: !currentName.trim() || currentName.trim() === localPeerName,
|
6284
|
-
"data-testid": "popup_change_btn"
|
6285
|
-
},
|
6286
|
-
"Change"
|
6287
|
-
)
|
6288
|
-
)
|
6289
|
-
);
|
6290
|
-
};
|
6291
|
-
|
6292
|
-
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
6293
|
-
var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
6294
|
-
const [previewPreference, setPreviewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW);
|
6295
|
-
const hmsActions = useHMSActions16();
|
6296
|
-
const localPeerName = useHMSStore21(selectLocalPeerName);
|
6297
|
-
const [currentName, setCurrentName] = useState16(localPeerName);
|
6298
|
-
const isMobile = useMedia5(config.media.md);
|
6299
|
-
const changeName = () => __async(void 0, null, function* () {
|
6300
|
-
const name = currentName.trim();
|
6301
|
-
if (!name || name === localPeerName) {
|
6302
|
-
return;
|
6303
|
-
}
|
6304
|
-
try {
|
6305
|
-
yield hmsActions.changeName(name);
|
6306
|
-
setPreviewPreference(__spreadProps(__spreadValues({}, previewPreference || {}), {
|
6307
|
-
name
|
6308
|
-
}));
|
6309
|
-
} catch (error) {
|
6310
|
-
console.error("failed to update name", error);
|
6311
|
-
ToastManager.addToast({ title: error.message });
|
6312
|
-
} finally {
|
6313
|
-
onOpenChange(false);
|
6314
|
-
}
|
6315
|
-
});
|
6316
|
-
const props = {
|
6317
|
-
changeName,
|
6318
|
-
setCurrentName,
|
6319
|
-
currentName,
|
6320
|
-
localPeerName,
|
6321
|
-
isMobile,
|
6322
|
-
onExit: () => onOpenChange(false),
|
6323
|
-
onBackClick: () => {
|
6324
|
-
onOpenChange(false);
|
6325
|
-
openParentSheet();
|
6326
|
-
}
|
6327
|
-
};
|
6328
|
-
if (isMobile) {
|
6329
|
-
return /* @__PURE__ */ React50.createElement(Sheet.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React50.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$8 0" } }, /* @__PURE__ */ React50.createElement(ChangeNameContent, __spreadValues({}, props))));
|
6330
|
-
}
|
6331
|
-
return /* @__PURE__ */ React50.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React50.createElement(Dialog.Portal, null, /* @__PURE__ */ React50.createElement(Dialog.Overlay, null), /* @__PURE__ */ React50.createElement(Dialog.Content, { css: { bg: "$surface_dim", width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React50.createElement(ChangeNameContent, __spreadValues({}, props)))));
|
6332
|
-
};
|
6333
|
-
|
6334
|
-
// src/Prebuilt/components/TileMenu/TileMenuContent.jsx
|
6335
|
-
import React51, { Fragment as Fragment4 } from "react";
|
6336
|
-
import { useMedia as useMedia6 } from "react-use";
|
6337
|
-
import {
|
6338
|
-
selectPermissions as selectPermissions2,
|
6339
|
-
selectSessionStore as selectSessionStore2,
|
6340
|
-
selectTrackByID as selectTrackByID2,
|
6341
|
-
useCustomEvent as useCustomEvent2,
|
6342
|
-
useHMSActions as useHMSActions17,
|
6343
|
-
useHMSStore as useHMSStore22,
|
6344
|
-
useRemoteAVToggle
|
6345
|
-
} from "@100mslive/react-sdk";
|
6346
|
-
import {
|
6347
|
-
MicOffIcon as MicOffIcon2,
|
6348
|
-
MicOnIcon as MicOnIcon5,
|
6349
|
-
PencilIcon,
|
6350
|
-
PinIcon as PinIcon2,
|
6351
|
-
RemoveUserIcon,
|
6352
|
-
ShareScreenIcon as ShareScreenIcon2,
|
6353
|
-
ShrinkIcon,
|
6354
|
-
SpeakerIcon as SpeakerIcon3,
|
6355
|
-
StarIcon,
|
6356
|
-
VideoOffIcon as VideoOffIcon2,
|
6357
|
-
VideoOnIcon as VideoOnIcon3
|
6358
|
-
} from "@100mslive/react-icons";
|
6359
|
-
var isSameTile = ({ trackId, videoTrackID, audioTrackID }) => trackId && (videoTrackID && videoTrackID === trackId || audioTrackID && audioTrackID === trackId);
|
6360
|
-
var spacingCSS = { "@md": { my: "$8", fontWeight: "$semiBold", fontSize: "sm" } };
|
6361
|
-
var SpotlightActions = ({
|
6362
|
-
peerId,
|
6363
|
-
onSpotLightClick = () => {
|
6364
|
-
return;
|
6365
|
-
}
|
6366
|
-
}) => {
|
6367
|
-
const hmsActions = useHMSActions17();
|
6368
|
-
const spotlightPeerId = useHMSStore22(selectSessionStore2(SESSION_STORE_KEY.SPOTLIGHT));
|
6369
|
-
const isTileSpotlighted = spotlightPeerId === peerId;
|
6370
|
-
const setSpotlightPeerId = (peer) => hmsActions.sessionStore.set(SESSION_STORE_KEY.SPOTLIGHT, peer).catch((err) => ToastManager.addToast({ title: err.description }));
|
6371
|
-
return /* @__PURE__ */ React51.createElement(
|
6372
|
-
StyledMenuTile.ItemButton,
|
6373
|
-
{
|
6374
|
-
css: spacingCSS,
|
6375
|
-
onClick: () => {
|
6376
|
-
if (isTileSpotlighted) {
|
6377
|
-
setSpotlightPeerId();
|
6378
|
-
} else {
|
6379
|
-
setSpotlightPeerId(peerId);
|
6380
|
-
}
|
6381
|
-
onSpotLightClick();
|
6382
|
-
}
|
6383
|
-
},
|
6384
|
-
/* @__PURE__ */ React51.createElement(StarIcon, { height: 20, width: 20 }),
|
6385
|
-
/* @__PURE__ */ React51.createElement("span", null, isTileSpotlighted ? "Remove from Spotlight" : "Spotlight Tile for everyone")
|
6386
|
-
);
|
6387
|
-
};
|
6388
|
-
var PinActions = ({ audioTrackID, videoTrackID }) => {
|
6389
|
-
const [pinnedTrackId, setPinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
6390
|
-
const isTilePinned = isSameTile({
|
6391
|
-
trackId: pinnedTrackId,
|
6392
|
-
videoTrackID,
|
6393
|
-
audioTrackID
|
6394
|
-
});
|
6395
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(
|
6396
|
-
StyledMenuTile.ItemButton,
|
6397
|
-
{
|
6398
|
-
css: spacingCSS,
|
6399
|
-
onClick: () => isTilePinned ? setPinnedTrackId() : setPinnedTrackId(videoTrackID || audioTrackID)
|
6400
|
-
},
|
6401
|
-
/* @__PURE__ */ React51.createElement(PinIcon2, { height: 20, width: 20 }),
|
6402
|
-
/* @__PURE__ */ React51.createElement("span", null, isTilePinned ? "Unpin" : "Pin", " Tile for myself")
|
6403
|
-
));
|
6404
|
-
};
|
6405
|
-
var MinimiseInset = () => {
|
6406
|
-
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
6407
|
-
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, { css: spacingCSS, onClick: () => setMinimised(!minimised) }, /* @__PURE__ */ React51.createElement(ShrinkIcon, { height: 20, width: 20 }), /* @__PURE__ */ React51.createElement("span", null, minimised ? "Show" : "Minimise", " your video")));
|
6408
|
-
};
|
6409
|
-
var SimulcastLayers = ({ trackId }) => {
|
6410
|
-
var _a7;
|
6411
|
-
const track = useHMSStore22(selectTrackByID2(trackId));
|
6412
|
-
const actions = useHMSActions17();
|
6413
|
-
const bg = useDropdownSelection();
|
6414
|
-
if (!((_a7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _a7.length) || track.degraded || !track.enabled) {
|
6415
|
-
return null;
|
6416
|
-
}
|
6417
|
-
const currentLayer = track.layerDefinitions.find((layer) => layer.layer === track.layer);
|
6418
|
-
return /* @__PURE__ */ React51.createElement(Fragment4, null, /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, { css: { color: "$on_surface_medium", cursor: "default" } }, "Select maximum resolution"), track.layerDefinitions.map((layer) => {
|
6419
|
-
return /* @__PURE__ */ React51.createElement(
|
6420
|
-
StyledMenuTile.ItemButton,
|
6421
|
-
{
|
6422
|
-
key: layer.layer,
|
6423
|
-
onClick: () => __async(void 0, null, function* () {
|
6424
|
-
yield actions.setPreferredLayer(trackId, layer.layer);
|
6425
|
-
}),
|
6426
|
-
css: {
|
6427
|
-
justifyContent: "space-between",
|
6428
|
-
bg: track.preferredLayer === layer.layer ? bg : void 0,
|
6429
|
-
"&:hover": {
|
6430
|
-
bg: track.preferredLayer === layer.layer ? bg : void 0
|
6431
|
-
}
|
6432
|
-
}
|
6433
|
-
},
|
6434
|
-
/* @__PURE__ */ React51.createElement(
|
6435
|
-
Text,
|
6436
|
-
{
|
6437
|
-
as: "span",
|
6438
|
-
css: {
|
6439
|
-
textTransform: "capitalize",
|
6440
|
-
mr: "$2",
|
6441
|
-
fontWeight: track.preferredLayer === layer.layer ? "$semiBold" : "$regular",
|
6442
|
-
color: track.preferredLayer === layer.layer ? "$on_primary_high" : "$on_surface_high"
|
6443
|
-
}
|
6444
|
-
},
|
6445
|
-
layer.layer
|
6446
|
-
),
|
6447
|
-
/* @__PURE__ */ React51.createElement(
|
6448
|
-
Text,
|
6449
|
-
{
|
6450
|
-
as: "span",
|
6451
|
-
variant: "xs",
|
6452
|
-
css: {
|
6453
|
-
color: track.preferredLayer === layer.layer ? "$on_primary_high" : "$on_surface_high"
|
6454
|
-
}
|
6455
|
-
},
|
6456
|
-
layer.resolution.width,
|
6457
|
-
"x",
|
6458
|
-
layer.resolution.height
|
6459
|
-
)
|
6460
|
-
);
|
6461
|
-
}), /* @__PURE__ */ React51.createElement(StyledMenuTile.ItemButton, null, /* @__PURE__ */ React51.createElement(Text, { as: "span", variant: "xs", css: { color: "$on_surface_medium" } }, "Currently streaming:", /* @__PURE__ */ React51.createElement(
|
6462
|
-
Text,
|
6463
|
-
{
|
6464
|
-
as: "span",
|
6465
|
-
variant: "xs",
|
6466
|
-
css: {
|
6467
|
-
fontWeight: "$semiBold",
|
6468
|
-
textTransform: "capitalize",
|
6469
|
-
color: "$on_surface_medium",
|
6470
|
-
ml: "$2"
|
6471
|
-
}
|
6472
|
-
},
|
6473
|
-
currentLayer ? /* @__PURE__ */ React51.createElement(React51.Fragment, null, track.layer, " (", currentLayer.resolution.width, "x", currentLayer.resolution.height, ")") : "-"
|
6474
|
-
))));
|
6475
|
-
};
|
6476
|
-
var TileMenuContent = (props) => {
|
6477
|
-
const actions = useHMSActions17();
|
6478
|
-
const { removeOthers } = useHMSStore22(selectPermissions2);
|
6479
|
-
const {
|
6480
|
-
videoTrackID,
|
6481
|
-
audioTrackID,
|
6482
|
-
isLocal,
|
6483
|
-
isScreenshare,
|
6484
|
-
showSpotlight,
|
6485
|
-
showPinAction,
|
6486
|
-
peerID,
|
6487
|
-
canMinimise,
|
6488
|
-
closeSheetOnClick = () => {
|
6489
|
-
return;
|
6490
|
-
},
|
6491
|
-
openNameChangeModal = () => {
|
6492
|
-
return;
|
6493
|
-
}
|
6494
|
-
} = props;
|
6495
|
-
const { isAudioEnabled, isVideoEnabled, setVolume, toggleAudio, toggleVideo, volume } = useRemoteAVToggle(
|
6496
|
-
audioTrackID,
|
6497
|
-
videoTrackID
|
6498
|
-
);
|
6499
|
-
const { sendEvent } = useCustomEvent2({
|
6500
|
-
type: REMOTE_STOP_SCREENSHARE_TYPE
|
6501
|
-
});
|
6502
|
-
const isMobile = useMedia6(config.media.md);
|
6503
|
-
return isLocal ? (showPinAction || canMinimise) && /* @__PURE__ */ React51.createElement(React51.Fragment, null, showPinAction && /* @__PURE__ */ React51.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React51.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() }), canMinimise && /* @__PURE__ */ React51.createElement(MinimiseInset, null), /* @__PURE__ */ React51.createElement(
|
6504
|
-
StyledMenuTile.ItemButton,
|
6505
|
-
{
|
6506
|
-
onClick: () => {
|
6507
|
-
openNameChangeModal();
|
6508
|
-
closeSheetOnClick();
|
6509
|
-
}
|
6510
|
-
},
|
6511
|
-
/* @__PURE__ */ React51.createElement(PencilIcon, { height: 20, width: 20 }),
|
6512
|
-
/* @__PURE__ */ React51.createElement(Text, { variant: "sm", css: { "@md": { fontWeight: "$semiBold" }, c: "$on_surface_high" } }, "Change Name")
|
6513
|
-
)) : /* @__PURE__ */ React51.createElement(React51.Fragment, null, toggleVideo ? /* @__PURE__ */ React51.createElement(
|
6514
|
-
StyledMenuTile.ItemButton,
|
6515
|
-
{
|
6516
|
-
css: spacingCSS,
|
6517
|
-
onClick: () => {
|
6518
|
-
toggleVideo();
|
6519
|
-
closeSheetOnClick();
|
6520
|
-
},
|
6521
|
-
"data-testid": isVideoEnabled ? "mute_video_participant_btn" : "unmute_video_participant_btn"
|
6522
|
-
},
|
6523
|
-
isVideoEnabled ? /* @__PURE__ */ React51.createElement(VideoOnIcon3, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(VideoOffIcon2, { height: 20, width: 20 }),
|
6524
|
-
/* @__PURE__ */ React51.createElement("span", null, isVideoEnabled ? "Mute" : "Request Unmute")
|
6525
|
-
) : null, toggleAudio ? /* @__PURE__ */ React51.createElement(
|
6526
|
-
StyledMenuTile.ItemButton,
|
6527
|
-
{
|
6528
|
-
css: spacingCSS,
|
6529
|
-
onClick: () => {
|
6530
|
-
toggleAudio();
|
6531
|
-
closeSheetOnClick();
|
6532
|
-
},
|
6533
|
-
"data-testid": isVideoEnabled ? "mute_audio_participant_btn" : "unmute_audio_participant_btn"
|
6534
|
-
},
|
6535
|
-
isAudioEnabled ? /* @__PURE__ */ React51.createElement(MicOnIcon5, { height: 20, width: 20 }) : /* @__PURE__ */ React51.createElement(MicOffIcon2, { height: 20, width: 20 }),
|
6536
|
-
/* @__PURE__ */ React51.createElement("span", null, isAudioEnabled ? "Mute" : "Request Unmute")
|
6537
|
-
) : null, audioTrackID ? /* @__PURE__ */ React51.createElement(StyledMenuTile.VolumeItem, { "data-testid": "participant_volume_slider", css: __spreadProps(__spreadValues({}, spacingCSS), { mb: "$0" }) }, /* @__PURE__ */ React51.createElement(Flex, { align: "center", gap: 1 }, /* @__PURE__ */ React51.createElement(SpeakerIcon3, { height: 20, width: 20 }), /* @__PURE__ */ React51.createElement(Box, { as: "span", css: { ml: "$4" } }, "Volume (", volume, ")")), /* @__PURE__ */ React51.createElement(Slider, { css: { my: "0.5rem" }, step: 5, value: [volume], onValueChange: (e) => setVolume(e[0]) })) : null, showPinAction && /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React51.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() })), isMobile ? null : /* @__PURE__ */ React51.createElement(SimulcastLayers, { trackId: videoTrackID }), removeOthers ? /* @__PURE__ */ React51.createElement(
|
6538
|
-
StyledMenuTile.RemoveItem,
|
6539
|
-
{
|
6540
|
-
css: __spreadProps(__spreadValues({}, spacingCSS), { borderTop: "none" }),
|
6541
|
-
onClick: () => __async(void 0, null, function* () {
|
6542
|
-
try {
|
6543
|
-
yield actions.removePeer(peerID, "");
|
6544
|
-
} catch (error) {
|
6545
|
-
}
|
6546
|
-
closeSheetOnClick();
|
6547
|
-
}),
|
6548
|
-
"data-testid": "remove_participant_btn"
|
6549
|
-
},
|
6550
|
-
/* @__PURE__ */ React51.createElement(RemoveUserIcon, { height: 20, width: 20 }),
|
6551
|
-
/* @__PURE__ */ React51.createElement("span", null, "Remove Participant")
|
6552
|
-
) : null, removeOthers && isScreenshare ? /* @__PURE__ */ React51.createElement(
|
6553
|
-
StyledMenuTile.RemoveItem,
|
6554
|
-
{
|
6555
|
-
onClick: () => {
|
6556
|
-
sendEvent({});
|
6557
|
-
closeSheetOnClick();
|
6558
|
-
},
|
6559
|
-
css: spacingCSS
|
6560
|
-
},
|
6561
|
-
/* @__PURE__ */ React51.createElement(ShareScreenIcon2, { height: 20, width: 20 }),
|
6562
|
-
/* @__PURE__ */ React51.createElement("span", null, "Stop Screenshare")
|
6563
|
-
) : null);
|
6564
|
-
};
|
6565
|
-
|
6566
|
-
// src/Prebuilt/components/hooks/useDropdownList.jsx
|
6567
|
-
import { useEffect as useEffect22 } from "react";
|
6568
|
-
var useDropdownList = ({ name, open }) => {
|
6569
|
-
const [dropdownList = [], setDropdownList] = useSetAppDataByKey(APP_DATA.dropdownList);
|
6570
|
-
useEffect22(() => {
|
6571
|
-
if (open) {
|
6572
|
-
if (!dropdownList.includes(name)) {
|
6573
|
-
setDropdownList([...dropdownList, name]);
|
6574
|
-
}
|
6575
|
-
} else {
|
6576
|
-
const index = dropdownList.indexOf(name);
|
6577
|
-
if (index >= 0) {
|
6578
|
-
const newDropdownList = [...dropdownList];
|
6579
|
-
newDropdownList.splice(index, 1);
|
6580
|
-
setDropdownList(newDropdownList);
|
6581
|
-
}
|
6582
|
-
}
|
6583
|
-
}, [open, name]);
|
6584
|
-
};
|
6585
|
-
|
6586
|
-
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
6587
|
-
var TileMenu = ({
|
6588
|
-
audioTrackID,
|
6589
|
-
videoTrackID,
|
6590
|
-
peerID,
|
6591
|
-
isScreenshare = false,
|
6592
|
-
canMinimise,
|
6593
|
-
enableSpotlightingPeer = true
|
6594
|
-
}) => {
|
6595
|
-
var _a7, _b7;
|
6596
|
-
const [open, setOpen] = useState17(false);
|
6597
|
-
const { theme: theme2 } = useTheme();
|
6598
|
-
const localPeerID = useHMSStore23(selectLocalPeerID4);
|
6599
|
-
const isLocal = localPeerID === peerID;
|
6600
|
-
const { removeOthers } = useHMSStore23(selectPermissions3);
|
6601
|
-
const { setVolume, toggleAudio, toggleVideo } = useRemoteAVToggle2(audioTrackID, videoTrackID);
|
6602
|
-
const showSpotlight = enableSpotlightingPeer;
|
6603
|
-
const isPrimaryVideoTrack = ((_a7 = useHMSStore23(selectVideoTrackByPeerID2(peerID))) == null ? void 0 : _a7.id) === videoTrackID;
|
6604
|
-
const showPinAction = audioTrackID || videoTrackID && isPrimaryVideoTrack;
|
6605
|
-
const track = useHMSStore23(selectTrackByID3(videoTrackID));
|
6606
|
-
const hideSimulcastLayers = !((_b7 = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _b7.length) || track.degraded || !track.enabled;
|
6607
|
-
const isMobile = useMedia7(config.media.md);
|
6608
|
-
const peer = useHMSStore23(selectPeerByID2(peerID));
|
6609
|
-
const [showNameChangeModal, setShowNameChangeModal] = useState17(false);
|
6610
|
-
useDropdownList({ open, name: "TileMenu" });
|
6611
|
-
if (!(removeOthers || toggleAudio || toggleVideo || setVolume || showPinAction) && hideSimulcastLayers) {
|
6612
|
-
return null;
|
6613
|
-
}
|
6614
|
-
const openNameChangeModal = () => setShowNameChangeModal(true);
|
6615
|
-
const props = {
|
6616
|
-
isLocal,
|
6617
|
-
isScreenshare,
|
6618
|
-
audioTrackID,
|
6619
|
-
videoTrackID,
|
6620
|
-
peerID,
|
6621
|
-
isPrimaryVideoTrack,
|
6622
|
-
showSpotlight,
|
6623
|
-
showPinAction,
|
6624
|
-
canMinimise,
|
6625
|
-
openNameChangeModal
|
6626
|
-
};
|
6627
|
-
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(StyledMenuTile.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(
|
6628
|
-
StyledMenuTile.Trigger,
|
6629
|
-
{
|
6630
|
-
"data-testid": "participant_menu_btn",
|
6631
|
-
css: { bg: `${theme2.colors.background_dim.value}A3`, p: "$2", w: "unset", h: "unset" },
|
6632
|
-
onClick: (e) => e.stopPropagation(),
|
6633
|
-
className: isMobile ? "__cancel-drag-event" : ""
|
6634
|
-
},
|
6635
|
-
/* @__PURE__ */ React52.createElement(VerticalMenuIcon2, { width: 20, height: 20 })
|
6636
|
-
), isMobile ? /* @__PURE__ */ React52.createElement(Sheet.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(Sheet.Content, { css: { bg: "$surface_dim", pt: "$8" } }, /* @__PURE__ */ React52.createElement(
|
6637
|
-
Flex,
|
6638
|
-
{
|
6639
|
-
css: {
|
6640
|
-
color: "$on_surface_high",
|
6641
|
-
display: "flex",
|
6642
|
-
w: "100%",
|
6643
|
-
justifyContent: "space-between",
|
6644
|
-
alignItems: "center",
|
6645
|
-
px: "$10",
|
6646
|
-
pb: "$8",
|
6647
|
-
borderBottom: "1px solid $border_default"
|
6648
|
-
}
|
6649
|
-
},
|
6650
|
-
/* @__PURE__ */ React52.createElement(Box, null, /* @__PURE__ */ React52.createElement(Text, { css: { color: "$on_surface_high", fontWeight: "$semiBold" } }, peer.name, isLocal ? ` (You)` : null), (peer == null ? void 0 : peer.roleName) ? /* @__PURE__ */ React52.createElement(Text, { variant: "xs", css: { color: "$on_surface_low", mt: "$2" } }, peer.roleName) : null),
|
6651
|
-
/* @__PURE__ */ React52.createElement(Sheet.Close, { css: { color: "inherit" } }, /* @__PURE__ */ React52.createElement(CrossIcon8, null))
|
6652
|
-
), /* @__PURE__ */ React52.createElement(Box, { css: { px: "$8", pb: "$8", maxHeight: "80vh", overflowY: "auto" } }, /* @__PURE__ */ React52.createElement(TileMenuContent, __spreadProps(__spreadValues({}, props), { closeSheetOnClick: () => setOpen(false) }))))) : /* @__PURE__ */ React52.createElement(StyledMenuTile.Content, { side: "top", align: "end", css: { maxHeight: "$80", overflowY: "auto" } }, /* @__PURE__ */ React52.createElement(TileMenuContent, __spreadValues({}, props)))), showNameChangeModal && /* @__PURE__ */ React52.createElement(ChangeNameModal, { onOpenChange: setShowNameChangeModal }));
|
6653
|
-
};
|
6654
|
-
var TileMenu_default = TileMenu;
|
6655
|
-
|
6656
|
-
// src/Prebuilt/components/peerTileUtils.jsx
|
6657
|
-
var PEER_NAME_PLACEHOLDER = "peerName";
|
6658
|
-
var labelMap = /* @__PURE__ */ new Map([
|
6659
|
-
[[true, "screen"].toString(), "Your Screen"],
|
6660
|
-
[[true, "regular"].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
6661
|
-
[[false, "screen"].toString(), `${PEER_NAME_PLACEHOLDER}'s Screen`],
|
6662
|
-
[[false, "regular"].toString(), PEER_NAME_PLACEHOLDER],
|
6663
|
-
[[true, void 0].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
6664
|
-
[[false, void 0].toString(), `${PEER_NAME_PLACEHOLDER}`]
|
6665
|
-
]);
|
6666
|
-
var getVideoTileLabel = ({ peerName, isLocal, track }) => {
|
6667
|
-
const isPeerPresent = peerName !== void 0;
|
6668
|
-
if (!isPeerPresent || !track) {
|
6669
|
-
return isPeerPresent ? labelMap.get([isLocal, void 0].toString()).replace(PEER_NAME_PLACEHOLDER, peerName) : "";
|
6670
|
-
}
|
6671
|
-
const isLocallyMuted = track.volume === 0;
|
6672
|
-
let label = labelMap.get([isLocal, track.source].toString());
|
6673
|
-
if (label) {
|
6674
|
-
label = label.replace(PEER_NAME_PLACEHOLDER, peerName);
|
6675
|
-
} else {
|
6676
|
-
label = `${peerName} ${track.source}`;
|
6677
|
-
}
|
6678
|
-
return `${label}${isLocallyMuted ? " (Muted for you)" : ""}`;
|
6679
|
-
};
|
6680
|
-
|
6681
|
-
// src/Prebuilt/components/VideoTile.jsx
|
6682
|
-
var Tile = ({
|
6683
|
-
peerId,
|
6684
|
-
trackId,
|
6685
|
-
width,
|
6686
|
-
height,
|
6687
|
-
objectFit = "cover",
|
6688
|
-
canMinimise = false,
|
6689
|
-
isDragabble = false,
|
6690
|
-
rootCSS = {},
|
6691
|
-
containerCSS = {},
|
6692
|
-
enableSpotlightingPeer = true,
|
6693
|
-
hideParticipantNameOnTile = false,
|
6694
|
-
roundedVideoTile = true,
|
6695
|
-
hideAudioMuteOnTile = false,
|
6696
|
-
hideMetadataOnTile = false
|
6697
|
-
}) => {
|
6698
|
-
var _a7, _b7;
|
6699
|
-
const trackSelector = trackId ? selectVideoTrackByID4(trackId) : selectVideoTrackByPeerID3(peerId);
|
6700
|
-
const track = useHMSStore24(trackSelector);
|
6701
|
-
const isMobile = useMedia8(config.media.md);
|
6702
|
-
const peerName = useHMSStore24(selectPeerNameByID(peerId));
|
6703
|
-
const audioTrack = useHMSStore24(selectAudioTrackByPeerID2(peerId));
|
6704
|
-
const localPeerID = useHMSStore24(selectLocalPeerID5);
|
6705
|
-
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
6706
|
-
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
6707
|
-
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
6708
|
-
const isAudioMuted = !useHMSStore24(selectIsPeerAudioEnabled(peerId));
|
6709
|
-
const isVideoMuted = !(track == null ? void 0 : track.enabled);
|
6710
|
-
const [isMouseHovered, setIsMouseHovered] = useState18(false);
|
6711
|
-
const isVideoDegraded = track == null ? void 0 : track.degraded;
|
6712
|
-
const isLocal = localPeerID === peerId;
|
6713
|
-
const [pinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
6714
|
-
const pinned = isSameTile({
|
6715
|
-
trackId: pinnedTrackId,
|
6716
|
-
videoTrackID: track == null ? void 0 : track.id,
|
6717
|
-
audioTrackID: audioTrack == null ? void 0 : audioTrack.id
|
6718
|
-
});
|
6719
|
-
const spotlighted = useHMSStore24(selectSessionStore3(SESSION_STORE_KEY.SPOTLIGHT)) === peerId;
|
6720
|
-
const label = getVideoTileLabel({
|
6721
|
-
peerName,
|
6722
|
-
track,
|
6723
|
-
isLocal
|
6724
|
-
});
|
6725
|
-
const onHoverHandler = useCallback16((event) => {
|
6726
|
-
setIsMouseHovered(event.type === "mouseenter");
|
6727
|
-
}, []);
|
6728
|
-
const ref = useRef7(null);
|
6729
|
-
const calculatedHeight = ((_a7 = ref.current) == null ? void 0 : _a7.clientHeight) || "";
|
6730
|
-
const calculatedWidth = ((_b7 = ref.current) == null ? void 0 : _b7.clientWidth) || "";
|
6731
|
-
const isTileBigEnoughToShowStats = calculatedHeight >= 180 && calculatedWidth >= 180;
|
6732
|
-
const avatarSize = useMemo3(() => {
|
6733
|
-
if (!calculatedWidth || !calculatedHeight) {
|
6734
|
-
return void 0;
|
6735
|
-
}
|
6736
|
-
if (calculatedWidth <= 150 || calculatedHeight <= 150) {
|
6737
|
-
return "small";
|
6738
|
-
} else if (calculatedWidth <= 300 || calculatedHeight <= 300) {
|
6739
|
-
return "medium";
|
6740
|
-
}
|
6741
|
-
return "large";
|
6742
|
-
}, [calculatedWidth, calculatedHeight]);
|
6743
|
-
return /* @__PURE__ */ React53.createElement(
|
6744
|
-
StyledVideoTile.Root,
|
6745
|
-
{
|
6746
|
-
ref,
|
6747
|
-
css: __spreadValues({
|
6748
|
-
width,
|
6749
|
-
height
|
6750
|
-
}, rootCSS),
|
6751
|
-
"data-testid": `participant_tile_${peerName}`
|
6752
|
-
},
|
6753
|
-
peerName !== void 0 ? /* @__PURE__ */ React53.createElement(
|
6754
|
-
StyledVideoTile.Container,
|
6755
|
-
{
|
6756
|
-
onMouseEnter: onHoverHandler,
|
6757
|
-
onMouseLeave: onHoverHandler,
|
6758
|
-
noRadius: !roundedVideoTile,
|
6759
|
-
css: containerCSS
|
6760
|
-
},
|
6761
|
-
showStatsOnTiles && isTileBigEnoughToShowStats ? /* @__PURE__ */ React53.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
6762
|
-
/* @__PURE__ */ React53.createElement(
|
6763
|
-
Video,
|
6764
|
-
{
|
6765
|
-
trackId: track == null ? void 0 : track.id,
|
6766
|
-
attach: isLocal ? void 0 : !isAudioOnly,
|
6767
|
-
mirror: mirrorLocalVideo && peerId === localPeerID && (track == null ? void 0 : track.source) === "regular" && (track == null ? void 0 : track.facingMode) !== "environment",
|
6768
|
-
noRadius: !roundedVideoTile,
|
6769
|
-
"data-testid": "participant_video_tile",
|
6770
|
-
css: {
|
6771
|
-
objectFit,
|
6772
|
-
filter: isVideoDegraded ? "blur($space$2)" : void 0,
|
6773
|
-
bg: "transparent"
|
6774
|
-
}
|
6775
|
-
}
|
6776
|
-
),
|
6777
|
-
isVideoMuted || !isLocal && isAudioOnly ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React53.createElement(Avatar, { name: peerName || "", "data-testid": "participant_avatar_icon", size: avatarSize })) : null,
|
6778
|
-
!hideAudioMuteOnTile ? isAudioMuted ? /* @__PURE__ */ React53.createElement(
|
6779
|
-
StyledVideoTile.AudioIndicator,
|
6780
|
-
{
|
6781
|
-
"data-testid": "participant_audio_mute_icon",
|
6782
|
-
size: getAttributeBoxSize(calculatedWidth, calculatedHeight)
|
6783
|
-
},
|
6784
|
-
/* @__PURE__ */ React53.createElement(MicOffIcon3, null)
|
6785
|
-
) : /* @__PURE__ */ React53.createElement(AudioLevel, { trackId: audioTrack == null ? void 0 : audioTrack.id }) : null,
|
6786
|
-
isMouseHovered || isDragabble && isMobile ? /* @__PURE__ */ React53.createElement(
|
6787
|
-
TileMenu_default,
|
6788
|
-
{
|
6789
|
-
peerID: peerId,
|
6790
|
-
audioTrackID: audioTrack == null ? void 0 : audioTrack.id,
|
6791
|
-
videoTrackID: track == null ? void 0 : track.id,
|
6792
|
-
canMinimise,
|
6793
|
-
enableSpotlightingPeer
|
6794
|
-
}
|
6795
|
-
) : null,
|
6796
|
-
!hideMetadataOnTile && /* @__PURE__ */ React53.createElement(PeerMetadata, { peerId, height: calculatedHeight, width: calculatedWidth }),
|
6797
|
-
/* @__PURE__ */ React53.createElement(
|
6798
|
-
TileConnection_default,
|
6799
|
-
{
|
6800
|
-
hideLabel: hideParticipantNameOnTile,
|
6801
|
-
name: label,
|
6802
|
-
isTile: true,
|
6803
|
-
peerId,
|
6804
|
-
width,
|
6805
|
-
pinned,
|
6806
|
-
spotlighted
|
6807
|
-
}
|
6808
|
-
)
|
6809
|
-
) : null
|
6810
|
-
);
|
6811
|
-
};
|
6812
|
-
var heightAnimation = (value) => keyframes({
|
6813
|
-
"50%": {
|
6814
|
-
transform: `scale3d(1,${value},1)`
|
6815
|
-
},
|
6816
|
-
"100%": {
|
6817
|
-
transform: `scale3d(1,1,1)`
|
6818
|
-
}
|
6819
|
-
});
|
6820
|
-
var AudioLevelIndicator = ({ trackId, value, delay }) => {
|
6821
|
-
const vanillaStore = useHMSVanillaStore6();
|
6822
|
-
const ref = useRef7();
|
6823
|
-
useEffect23(() => {
|
6824
|
-
const unsubscribe = vanillaStore.subscribe((audioLevel) => {
|
6825
|
-
if (ref.current) {
|
6826
|
-
ref.current.style["animation"] = `${heightAnimation(
|
6827
|
-
audioLevel ? value : 1
|
6828
|
-
)} 0.3s cubic-bezier(0.61, 1, 0.88, 1) infinite ${delay}s`;
|
6829
|
-
}
|
6830
|
-
}, selectTrackAudioByID(trackId));
|
6831
|
-
return unsubscribe;
|
6832
|
-
}, [vanillaStore, trackId, value, delay]);
|
6833
|
-
return /* @__PURE__ */ React53.createElement(
|
6834
|
-
Box,
|
6835
|
-
{
|
6836
|
-
ref,
|
6837
|
-
css: {
|
6838
|
-
w: 4,
|
6839
|
-
height: 6,
|
6840
|
-
r: 2,
|
6841
|
-
bg: "$on_primary_high"
|
6842
|
-
}
|
6843
|
-
}
|
6844
|
-
);
|
6845
|
-
};
|
6846
|
-
var AudioLevel = ({ trackId }) => {
|
6847
|
-
return /* @__PURE__ */ React53.createElement(StyledVideoTile.AudioIndicator, null, /* @__PURE__ */ React53.createElement(Flex, { align: "center", justify: "center", css: { gap: "$2" } }, [3, 2, 3].map((v, i) => /* @__PURE__ */ React53.createElement(AudioLevelIndicator, { trackId, value: v, delay: i * 0.15, key: i }))));
|
6848
|
-
};
|
6849
|
-
var PeerMetadata = ({ peerId, height, width }) => {
|
6850
|
-
const metaData = useHMSStore24(selectPeerMetadata2(peerId));
|
6851
|
-
const isBRB = (metaData == null ? void 0 : metaData.isBRBOn) || false;
|
6852
|
-
const isHandRaised = useHMSStore24(selectHasPeerHandRaised3(peerId));
|
6853
|
-
return /* @__PURE__ */ React53.createElement(Fragment5, null, isHandRaised ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { size: getAttributeBoxSize(width, height), "data-testid": "raiseHand_icon_onTile" }, /* @__PURE__ */ React53.createElement(HandIcon3, { width: 24, height: 24 })) : null, isBRB ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AttributeBox, { size: getAttributeBoxSize(width, height), "data-testid": "brb_icon_onTile" }, /* @__PURE__ */ React53.createElement(BrbTileIcon, { width: 22, height: 22 })) : null);
|
6854
|
-
};
|
6855
|
-
var VideoTile = React53.memo(Tile);
|
6856
|
-
var VideoTile_default = VideoTile;
|
6857
|
-
|
6858
6259
|
// src/Prebuilt/components/Preview/PreviewForm.tsx
|
6859
|
-
import
|
6860
|
-
import { useMedia as
|
6260
|
+
import React52 from "react";
|
6261
|
+
import { useMedia as useMedia5 } from "react-use";
|
6861
6262
|
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType2 } from "@100mslive/types-prebuilt/elements/join_form";
|
6862
6263
|
import { useRecordingStreaming as useRecordingStreaming3 } from "@100mslive/react-sdk";
|
6863
6264
|
import { RadioIcon } from "@100mslive/react-icons";
|
@@ -6873,18 +6274,18 @@ var PreviewForm = ({
|
|
6873
6274
|
const formSubmit = (e) => {
|
6874
6275
|
e.preventDefault();
|
6875
6276
|
};
|
6876
|
-
const isMobile =
|
6277
|
+
const isMobile = useMedia5(config.media.md);
|
6877
6278
|
const { isHLSRunning } = useRecordingStreaming3();
|
6878
6279
|
const layout = useRoomLayout();
|
6879
6280
|
const { join_form: joinForm = {} } = ((_c = (_b7 = (_a7 = layout == null ? void 0 : layout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
6880
6281
|
const showGoLive = (joinForm == null ? void 0 : joinForm.join_btn_type) === JoinForm_JoinBtnType2.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE && !isHLSRunning;
|
6881
|
-
return /* @__PURE__ */
|
6282
|
+
return /* @__PURE__ */ React52.createElement(
|
6882
6283
|
Form,
|
6883
6284
|
{
|
6884
6285
|
css: { flexDirection: cannotPublishVideo ? "column" : "row", "@md": { flexDirection: "row" } },
|
6885
6286
|
onSubmit: formSubmit
|
6886
6287
|
},
|
6887
|
-
/* @__PURE__ */
|
6288
|
+
/* @__PURE__ */ React52.createElement(Flex, { align: "center", css: { gap: "$8", w: "100%" } }, /* @__PURE__ */ React52.createElement(
|
6888
6289
|
Input,
|
6889
6290
|
{
|
6890
6291
|
required: true,
|
@@ -6905,8 +6306,8 @@ var PreviewForm = ({
|
|
6905
6306
|
}
|
6906
6307
|
}
|
6907
6308
|
}
|
6908
|
-
), cannotPublishAudio && cannotPublishVideo && !isMobile ? /* @__PURE__ */
|
6909
|
-
/* @__PURE__ */
|
6309
|
+
), cannotPublishAudio && cannotPublishVideo && !isMobile ? /* @__PURE__ */ React52.createElement(PreviewSettings, null) : null),
|
6310
|
+
/* @__PURE__ */ React52.createElement(Button, { type: "submit", icon: true, disabled: !name || !enableJoin, onClick: onJoin }, showGoLive ? /* @__PURE__ */ React52.createElement(RadioIcon, { height: 18, width: 18 }) : null, showGoLive ? joinForm.go_live_btn_label : joinForm.join_btn_label)
|
6910
6311
|
);
|
6911
6312
|
};
|
6912
6313
|
var Form = styled("form", {
|
@@ -6923,7 +6324,7 @@ var Form = styled("form", {
|
|
6923
6324
|
var PreviewForm_default = PreviewForm;
|
6924
6325
|
|
6925
6326
|
// src/Prebuilt/components/Preview/PreviewJoin.tsx
|
6926
|
-
var VirtualBackground =
|
6327
|
+
var VirtualBackground = React53.lazy(() => import("./VirtualBackground-UVZJVOA2.js"));
|
6927
6328
|
var getParticipantChipContent = (peerCount = 0) => {
|
6928
6329
|
if (peerCount === 0) {
|
6929
6330
|
return "You are the first to join";
|
@@ -6944,9 +6345,9 @@ var PreviewJoin = ({
|
|
6944
6345
|
);
|
6945
6346
|
const { isStreamingOn } = useRecordingStreaming4();
|
6946
6347
|
const authToken = useAuthToken();
|
6947
|
-
const [name, setName] =
|
6348
|
+
const [name, setName] = useState16(initialName || previewPreference.name);
|
6948
6349
|
const { toggleAudio, toggleVideo } = useAVToggle2();
|
6949
|
-
const [previewError, setPreviewError] =
|
6350
|
+
const [previewError, setPreviewError] = useState16(false);
|
6950
6351
|
const { endpoints } = useHMSPrebuiltContext();
|
6951
6352
|
const { peerCount } = useParticipants();
|
6952
6353
|
const { enableJoin, preview, join } = usePreviewJoin({
|
@@ -6966,8 +6367,8 @@ var PreviewJoin = ({
|
|
6966
6367
|
},
|
6967
6368
|
asRole
|
6968
6369
|
});
|
6969
|
-
const roomState =
|
6970
|
-
const savePreferenceAndJoin =
|
6370
|
+
const roomState = useHMSStore21(selectRoomState6);
|
6371
|
+
const savePreferenceAndJoin = useCallback16(() => {
|
6971
6372
|
setPreviewPreference({
|
6972
6373
|
name
|
6973
6374
|
});
|
@@ -6976,9 +6377,9 @@ var PreviewJoin = ({
|
|
6976
6377
|
}, [join, name, setPreviewPreference, onJoin]);
|
6977
6378
|
const roomLayout = useRoomLayout();
|
6978
6379
|
const { preview_header: previewHeader = {} } = ((_c = (_b7 = (_a7 = roomLayout == null ? void 0 : roomLayout.screens) == null ? void 0 : _a7.preview) == null ? void 0 : _b7.default) == null ? void 0 : _c.elements) || {};
|
6979
|
-
const localPeer =
|
6980
|
-
const videoTrack =
|
6981
|
-
const isMobile =
|
6380
|
+
const localPeer = useHMSStore21(selectLocalPeer);
|
6381
|
+
const videoTrack = useHMSStore21(selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack));
|
6382
|
+
const isMobile = useMedia6(config.media.md);
|
6982
6383
|
const aspectRatio = (videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
6983
6384
|
useEffect24(() => {
|
6984
6385
|
if (authToken) {
|
@@ -6994,29 +6395,29 @@ var PreviewJoin = ({
|
|
6994
6395
|
setName(initialName);
|
6995
6396
|
}
|
6996
6397
|
}, [initialName]);
|
6997
|
-
return roomState === HMSRoomState6.Preview ? /* @__PURE__ */
|
6398
|
+
return roomState === HMSRoomState6.Preview ? /* @__PURE__ */ React53.createElement(Container3, { css: { h: "100%", pt: "$10", "@md": { justifyContent: "space-between" } } }, toggleVideo ? null : /* @__PURE__ */ React53.createElement(Box, null), /* @__PURE__ */ React53.createElement(Flex, { direction: "column", justify: "center", css: { w: "100%", maxWidth: "640px" } }, /* @__PURE__ */ React53.createElement(Logo, null), /* @__PURE__ */ React53.createElement(
|
6998
6399
|
Text,
|
6999
6400
|
{
|
7000
6401
|
variant: "h4",
|
7001
6402
|
css: { wordBreak: "break-word", textAlign: "center", mt: "$14", mb: "$4", "@md": { mt: "$8", mb: "$2" } }
|
7002
6403
|
},
|
7003
6404
|
previewHeader.title
|
7004
|
-
), /* @__PURE__ */
|
6405
|
+
), /* @__PURE__ */ React53.createElement(
|
7005
6406
|
Text,
|
7006
6407
|
{
|
7007
6408
|
css: { c: "$on_surface_medium", my: "0", textAlign: "center", maxWidth: "100%", wordWrap: "break-word" },
|
7008
6409
|
variant: "sm"
|
7009
6410
|
},
|
7010
6411
|
previewHeader.sub_title
|
7011
|
-
), /* @__PURE__ */
|
6412
|
+
), /* @__PURE__ */ React53.createElement(Flex, { justify: "center", css: { mt: "$14", "@md": { mt: "$8", mb: "0" }, gap: "$4" } }, isStreamingOn ? /* @__PURE__ */ React53.createElement(
|
7012
6413
|
Chip_default,
|
7013
6414
|
{
|
7014
6415
|
content: "LIVE",
|
7015
6416
|
backgroundColor: "$alert_error_default",
|
7016
6417
|
textColor: "#FFF",
|
7017
|
-
icon: /* @__PURE__ */
|
6418
|
+
icon: /* @__PURE__ */ React53.createElement(Box, { css: { h: "$sm", w: "$sm", backgroundColor: "$on_primary_high", borderRadius: "$round" } })
|
7018
6419
|
}
|
7019
|
-
) : null, /* @__PURE__ */
|
6420
|
+
) : null, /* @__PURE__ */ React53.createElement(Chip_default, { content: getParticipantChipContent(peerCount), hideIfNoContent: true }))), toggleVideo ? /* @__PURE__ */ React53.createElement(
|
7020
6421
|
Flex,
|
7021
6422
|
{
|
7022
6423
|
align: "center",
|
@@ -7028,8 +6429,8 @@ var PreviewJoin = ({
|
|
7028
6429
|
flexDirection: "column"
|
7029
6430
|
}
|
7030
6431
|
},
|
7031
|
-
/* @__PURE__ */
|
7032
|
-
) : null, /* @__PURE__ */
|
6432
|
+
/* @__PURE__ */ React53.createElement(PreviewTile, { name, error: previewError })
|
6433
|
+
) : null, /* @__PURE__ */ React53.createElement(Box, { css: { w: "100%", maxWidth: `${Math.max(aspectRatio, 1) * 360}px` } }, /* @__PURE__ */ React53.createElement(PreviewControls, { hideSettings: !toggleVideo && !toggleAudio }), /* @__PURE__ */ React53.createElement(
|
7033
6434
|
PreviewForm_default,
|
7034
6435
|
{
|
7035
6436
|
name,
|
@@ -7039,7 +6440,7 @@ var PreviewJoin = ({
|
|
7039
6440
|
cannotPublishVideo: !toggleVideo,
|
7040
6441
|
cannotPublishAudio: !toggleAudio
|
7041
6442
|
}
|
7042
|
-
))) : /* @__PURE__ */
|
6443
|
+
))) : /* @__PURE__ */ React53.createElement(FullPageProgress_default, null);
|
7043
6444
|
};
|
7044
6445
|
var Container3 = styled("div", __spreadProps(__spreadValues({
|
7045
6446
|
width: "100%"
|
@@ -7048,17 +6449,17 @@ var Container3 = styled("div", __spreadProps(__spreadValues({
|
|
7048
6449
|
px: "$10"
|
7049
6450
|
}));
|
7050
6451
|
var PreviewTile = ({ name, error }) => {
|
7051
|
-
const localPeer =
|
6452
|
+
const localPeer = useHMSStore21(selectLocalPeer);
|
7052
6453
|
const { isLocalAudioEnabled, toggleAudio } = useAVToggle2();
|
7053
|
-
const isVideoOn =
|
6454
|
+
const isVideoOn = useHMSStore21(selectIsLocalVideoEnabled5);
|
7054
6455
|
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
7055
|
-
const trackSelector =
|
7056
|
-
const track =
|
6456
|
+
const trackSelector = selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack);
|
6457
|
+
const track = useHMSStore21(trackSelector);
|
7057
6458
|
const showMuteIcon = !isLocalAudioEnabled || !toggleAudio;
|
7058
|
-
const videoTrack =
|
7059
|
-
const isMobile =
|
6459
|
+
const videoTrack = useHMSStore21(selectVideoTrackByID4(localPeer == null ? void 0 : localPeer.videoTrack));
|
6460
|
+
const isMobile = useMedia6(config.media.md);
|
7060
6461
|
const aspectRatio = (videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) ? videoTrack.width / videoTrack.height : isMobile ? 9 / 16 : 16 / 9;
|
7061
|
-
return /* @__PURE__ */
|
6462
|
+
return /* @__PURE__ */ React53.createElement(
|
7062
6463
|
StyledVideoTile.Container,
|
7063
6464
|
{
|
7064
6465
|
css: {
|
@@ -7074,20 +6475,20 @@ var PreviewTile = ({ name, error }) => {
|
|
7074
6475
|
}
|
7075
6476
|
}
|
7076
6477
|
},
|
7077
|
-
localPeer ? /* @__PURE__ */
|
6478
|
+
localPeer ? /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(TileConnection_default, { name, peerId: localPeer.id, hideLabel: true }), /* @__PURE__ */ React53.createElement(
|
7078
6479
|
Video,
|
7079
6480
|
{
|
7080
6481
|
mirror: (track == null ? void 0 : track.facingMode) !== "environment" && mirrorLocalVideo,
|
7081
6482
|
trackId: localPeer.videoTrack,
|
7082
6483
|
"data-testid": "preview_tile"
|
7083
6484
|
}
|
7084
|
-
), !isVideoOn ? /* @__PURE__ */
|
7085
|
-
showMuteIcon ? /* @__PURE__ */
|
6485
|
+
), !isVideoOn ? /* @__PURE__ */ React53.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React53.createElement(Avatar, { name, "data-testid": "preview_avatar_tile", size: "medium" })) : null) : !error ? /* @__PURE__ */ React53.createElement(FullPageProgress_default, null) : null,
|
6486
|
+
showMuteIcon ? /* @__PURE__ */ React53.createElement(PrebuiltAudioIndicator, null, /* @__PURE__ */ React53.createElement(MicOffIcon2, { height: 16, width: 16 })) : /* @__PURE__ */ React53.createElement(PrebuiltAudioIndicator, null, /* @__PURE__ */ React53.createElement(AudioLevel, { trackId: localPeer == null ? void 0 : localPeer.audioTrack }))
|
7086
6487
|
);
|
7087
6488
|
};
|
7088
6489
|
var PreviewControls = ({ hideSettings }) => {
|
7089
|
-
const isMobile =
|
7090
|
-
return /* @__PURE__ */
|
6490
|
+
const isMobile = useMedia6(config.media.md);
|
6491
|
+
return /* @__PURE__ */ React53.createElement(
|
7091
6492
|
Flex,
|
7092
6493
|
{
|
7093
6494
|
justify: hideSettings && isMobile ? "center" : "between",
|
@@ -7096,13 +6497,13 @@ var PreviewControls = ({ hideSettings }) => {
|
|
7096
6497
|
mt: "$8"
|
7097
6498
|
}
|
7098
6499
|
},
|
7099
|
-
/* @__PURE__ */
|
7100
|
-
!hideSettings ? /* @__PURE__ */
|
6500
|
+
/* @__PURE__ */ React53.createElement(Flex, { css: { gap: "$4" } }, /* @__PURE__ */ React53.createElement(AudioVideoToggle, null), /* @__PURE__ */ React53.createElement(Suspense, { fallback: "" }, !isMobile ? /* @__PURE__ */ React53.createElement(VirtualBackground, null) : null)),
|
6501
|
+
!hideSettings ? /* @__PURE__ */ React53.createElement(PreviewSettings, null) : null
|
7101
6502
|
);
|
7102
6503
|
};
|
7103
|
-
var PreviewSettings =
|
7104
|
-
const [open, setOpen] =
|
7105
|
-
return /* @__PURE__ */
|
6504
|
+
var PreviewSettings = React53.memo(() => {
|
6505
|
+
const [open, setOpen] = useState16(false);
|
6506
|
+
return /* @__PURE__ */ React53.createElement(Fragment4, null, /* @__PURE__ */ React53.createElement(IconButton_default, { "data-testid": "preview_setting_btn", css: { flexShrink: 0 }, onClick: () => setOpen((value) => !value) }, /* @__PURE__ */ React53.createElement(SettingsIcon2, null)), open && /* @__PURE__ */ React53.createElement(SettingsModal_default, { open, onOpenChange: setOpen }));
|
7106
6507
|
});
|
7107
6508
|
var PreviewJoin_default = PreviewJoin;
|
7108
6509
|
|
@@ -7126,14 +6527,14 @@ var PreviewContainer = () => {
|
|
7126
6527
|
}
|
7127
6528
|
navigate(meetingURL);
|
7128
6529
|
};
|
7129
|
-
return /* @__PURE__ */
|
6530
|
+
return /* @__PURE__ */ React54.createElement(Flex, { direction: "column", css: { size: "100%" } }, /* @__PURE__ */ React54.createElement(
|
7130
6531
|
Flex,
|
7131
6532
|
{
|
7132
6533
|
css: { flex: "1 1 0", position: "relative", overflowY: "auto", color: "$primary_default" },
|
7133
6534
|
justify: "center",
|
7134
6535
|
align: "center"
|
7135
6536
|
},
|
7136
|
-
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */
|
6537
|
+
authToken && Object.keys(previewHeader).length > 0 ? /* @__PURE__ */ React54.createElement(
|
7137
6538
|
PreviewJoin_default,
|
7138
6539
|
{
|
7139
6540
|
initialName,
|
@@ -7141,20 +6542,20 @@ var PreviewContainer = () => {
|
|
7141
6542
|
asRole: previewAsRole != null ? previewAsRole : void 0,
|
7142
6543
|
onJoin
|
7143
6544
|
}
|
7144
|
-
) : /* @__PURE__ */
|
6545
|
+
) : /* @__PURE__ */ React54.createElement(FullPageProgress_default, null)
|
7145
6546
|
));
|
7146
6547
|
};
|
7147
6548
|
var PreviewContainer_default = PreviewContainer;
|
7148
6549
|
|
7149
6550
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
7150
|
-
import
|
7151
|
-
import { selectIsConnectedToRoom as selectIsConnectedToRoom3, useHMSStore as
|
6551
|
+
import React56, { useEffect as useEffect25, useState as useState17 } from "react";
|
6552
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom3, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
7152
6553
|
|
7153
6554
|
// src/Prebuilt/components/Toast/Toast.jsx
|
7154
|
-
import
|
6555
|
+
import React55 from "react";
|
7155
6556
|
var Toast2 = (_a7) => {
|
7156
6557
|
var _b7 = _a7, { title, description, close = true, open, duration, onOpenChange, icon } = _b7, props = __objRest(_b7, ["title", "description", "close", "open", "duration", "onOpenChange", "icon"]);
|
7157
|
-
return /* @__PURE__ */
|
6558
|
+
return /* @__PURE__ */ React55.createElement(
|
7158
6559
|
Toast.HMSToast,
|
7159
6560
|
__spreadValues({
|
7160
6561
|
title,
|
@@ -7170,17 +6571,17 @@ var Toast2 = (_a7) => {
|
|
7170
6571
|
|
7171
6572
|
// src/Prebuilt/components/Toast/ToastContainer.jsx
|
7172
6573
|
var ToastContainer = () => {
|
7173
|
-
const isConnected =
|
7174
|
-
const [toasts, setToast] =
|
6574
|
+
const isConnected = useHMSStore22(selectIsConnectedToRoom3);
|
6575
|
+
const [toasts, setToast] = useState17([]);
|
7175
6576
|
useEffect25(() => {
|
7176
6577
|
ToastManager.addListener(setToast);
|
7177
6578
|
return () => {
|
7178
6579
|
ToastManager.removeListener(setToast);
|
7179
6580
|
};
|
7180
6581
|
}, []);
|
7181
|
-
return /* @__PURE__ */
|
7182
|
-
return /* @__PURE__ */
|
7183
|
-
}), /* @__PURE__ */
|
6582
|
+
return /* @__PURE__ */ React56.createElement(Toast.Provider, { swipeDirection: "left", duration: 3e3 }, toasts.slice(0, MAX_TOASTS).map((toast) => {
|
6583
|
+
return /* @__PURE__ */ React56.createElement(Toast2, __spreadProps(__spreadValues({ key: toast.id }, toast), { onOpenChange: (value) => !value && ToastManager.removeToast(toast.id) }));
|
6584
|
+
}), /* @__PURE__ */ React56.createElement(
|
7184
6585
|
Toast.Viewport,
|
7185
6586
|
{
|
7186
6587
|
css: __spreadValues({
|
@@ -7191,13 +6592,13 @@ var ToastContainer = () => {
|
|
7191
6592
|
};
|
7192
6593
|
|
7193
6594
|
// src/Prebuilt/plugins/FlyingEmoji.jsx
|
7194
|
-
import
|
7195
|
-
import { useMedia as
|
6595
|
+
import React57, { useCallback as useCallback17, useEffect as useEffect26, useMemo as useMemo3, useState as useState18 } from "react";
|
6596
|
+
import { useMedia as useMedia7 } from "react-use";
|
7196
6597
|
import {
|
7197
|
-
selectLocalPeerID as
|
7198
|
-
selectPeerNameByID
|
7199
|
-
useCustomEvent as
|
7200
|
-
useHMSStore as
|
6598
|
+
selectLocalPeerID as selectLocalPeerID4,
|
6599
|
+
selectPeerNameByID,
|
6600
|
+
useCustomEvent as useCustomEvent2,
|
6601
|
+
useHMSStore as useHMSStore23,
|
7201
6602
|
useHMSVanillaStore as useHMSVanillaStore7
|
7202
6603
|
} from "@100mslive/react-sdk";
|
7203
6604
|
var emojiCount = 1;
|
@@ -7224,17 +6625,17 @@ var getStartingPoints = (isMobile) => {
|
|
7224
6625
|
return arr;
|
7225
6626
|
};
|
7226
6627
|
function FlyingEmoji() {
|
7227
|
-
const localPeerId =
|
6628
|
+
const localPeerId = useHMSStore23(selectLocalPeerID4);
|
7228
6629
|
const vanillaStore = useHMSVanillaStore7();
|
7229
|
-
const [emojis, setEmojis] =
|
7230
|
-
const isMobile =
|
7231
|
-
const startingPoints =
|
7232
|
-
const showFlyingEmoji =
|
6630
|
+
const [emojis, setEmojis] = useState18([]);
|
6631
|
+
const isMobile = useMedia7(config.media.md);
|
6632
|
+
const startingPoints = useMemo3(() => getStartingPoints(isMobile), [isMobile]);
|
6633
|
+
const showFlyingEmoji = useCallback17(
|
7233
6634
|
({ emojiId, senderId }) => {
|
7234
6635
|
if (!emojiId || !senderId || document.hidden) {
|
7235
6636
|
return;
|
7236
6637
|
}
|
7237
|
-
const senderPeerName = vanillaStore.getState(
|
6638
|
+
const senderPeerName = vanillaStore.getState(selectPeerNameByID(senderId));
|
7238
6639
|
const nameToShow = localPeerId === senderId ? "You" : senderPeerName;
|
7239
6640
|
const startingPoint = startingPoints[emojiCount % startingPoints.length];
|
7240
6641
|
const id = emojiCount++;
|
@@ -7253,14 +6654,14 @@ function FlyingEmoji() {
|
|
7253
6654
|
},
|
7254
6655
|
[localPeerId, vanillaStore, startingPoints]
|
7255
6656
|
);
|
7256
|
-
|
6657
|
+
useCustomEvent2({
|
7257
6658
|
type: EMOJI_REACTION_TYPE,
|
7258
6659
|
onEvent: showFlyingEmoji
|
7259
6660
|
});
|
7260
6661
|
useEffect26(() => {
|
7261
6662
|
window.showFlyingEmoji = showFlyingEmoji;
|
7262
6663
|
}, [showFlyingEmoji]);
|
7263
|
-
return /* @__PURE__ */
|
6664
|
+
return /* @__PURE__ */ React57.createElement(
|
7264
6665
|
Box,
|
7265
6666
|
{
|
7266
6667
|
css: {
|
@@ -7276,7 +6677,7 @@ function FlyingEmoji() {
|
|
7276
6677
|
}
|
7277
6678
|
},
|
7278
6679
|
emojis.map((emoji) => {
|
7279
|
-
return /* @__PURE__ */
|
6680
|
+
return /* @__PURE__ */ React57.createElement(
|
7280
6681
|
Flex,
|
7281
6682
|
{
|
7282
6683
|
key: emoji.id,
|
@@ -7292,8 +6693,8 @@ function FlyingEmoji() {
|
|
7292
6693
|
setEmojis(emojis.filter((item) => item.id !== emoji.id));
|
7293
6694
|
}
|
7294
6695
|
},
|
7295
|
-
/* @__PURE__ */
|
7296
|
-
/* @__PURE__ */
|
6696
|
+
/* @__PURE__ */ React57.createElement(Box, null, /* @__PURE__ */ React57.createElement("em-emoji", { id: emoji.emojiId, size: "48px", set: "apple" })),
|
6697
|
+
/* @__PURE__ */ React57.createElement(
|
7297
6698
|
Box,
|
7298
6699
|
{
|
7299
6700
|
css: {
|
@@ -7303,7 +6704,7 @@ function FlyingEmoji() {
|
|
7303
6704
|
borderRadius: "$1"
|
7304
6705
|
}
|
7305
6706
|
},
|
7306
|
-
/* @__PURE__ */
|
6707
|
+
/* @__PURE__ */ React57.createElement(
|
7307
6708
|
Text,
|
7308
6709
|
{
|
7309
6710
|
css: {
|
@@ -7321,45 +6722,45 @@ function FlyingEmoji() {
|
|
7321
6722
|
}
|
7322
6723
|
|
7323
6724
|
// src/Prebuilt/plugins/RemoteStopScreenshare.jsx
|
7324
|
-
import
|
7325
|
-
import { useCustomEvent as
|
6725
|
+
import React58, { useCallback as useCallback18 } from "react";
|
6726
|
+
import { useCustomEvent as useCustomEvent3, useHMSActions as useHMSActions16 } from "@100mslive/react-sdk";
|
7326
6727
|
function RemoteStopScreenshare() {
|
7327
|
-
const actions =
|
7328
|
-
const onRemoteStopScreenshare =
|
6728
|
+
const actions = useHMSActions16();
|
6729
|
+
const onRemoteStopScreenshare = useCallback18(() => __async(this, null, function* () {
|
7329
6730
|
yield actions.setScreenShareEnabled(false);
|
7330
6731
|
}), [actions]);
|
7331
|
-
|
6732
|
+
useCustomEvent3({
|
7332
6733
|
type: REMOTE_STOP_SCREENSHARE_TYPE,
|
7333
6734
|
onEvent: onRemoteStopScreenshare
|
7334
6735
|
});
|
7335
|
-
return /* @__PURE__ */
|
6736
|
+
return /* @__PURE__ */ React58.createElement(React58.Fragment, null);
|
7336
6737
|
}
|
7337
6738
|
|
7338
6739
|
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
7339
|
-
import { useCallback as
|
6740
|
+
import { useCallback as useCallback19, useEffect as useEffect28, useRef as useRef9 } from "react";
|
7340
6741
|
import {
|
7341
6742
|
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
7342
|
-
selectPermissions as
|
7343
|
-
useHMSActions as
|
7344
|
-
useHMSStore as
|
6743
|
+
selectPermissions as selectPermissions2,
|
6744
|
+
useHMSActions as useHMSActions17,
|
6745
|
+
useHMSStore as useHMSStore25,
|
7345
6746
|
useRecordingStreaming as useRecordingStreaming5
|
7346
6747
|
} from "@100mslive/react-sdk";
|
7347
6748
|
|
7348
6749
|
// src/Prebuilt/common/hooks.js
|
7349
|
-
import { useEffect as useEffect27, useRef as useRef8, useState as
|
6750
|
+
import { useEffect as useEffect27, useRef as useRef8, useState as useState19 } from "react";
|
7350
6751
|
import { JoinForm_JoinBtnType as JoinForm_JoinBtnType3 } from "@100mslive/types-prebuilt/elements/join_form";
|
7351
6752
|
import {
|
7352
6753
|
selectAvailableRoleNames as selectAvailableRoleNames2,
|
7353
6754
|
selectIsConnectedToRoom as selectIsConnectedToRoom4,
|
7354
6755
|
selectPeerCount,
|
7355
|
-
selectPeerMetadata as
|
6756
|
+
selectPeerMetadata as selectPeerMetadata2,
|
7356
6757
|
selectPeers,
|
7357
6758
|
selectRemotePeers,
|
7358
|
-
useHMSStore as
|
6759
|
+
useHMSStore as useHMSStore24,
|
7359
6760
|
useHMSVanillaStore as useHMSVanillaStore8
|
7360
6761
|
} from "@100mslive/react-sdk";
|
7361
6762
|
var useFilteredRoles = () => {
|
7362
|
-
const roles =
|
6763
|
+
const roles = useHMSStore24(selectAvailableRoleNames2);
|
7363
6764
|
return roles;
|
7364
6765
|
};
|
7365
6766
|
var useShowStreamingUI = () => {
|
@@ -7370,15 +6771,15 @@ var useShowStreamingUI = () => {
|
|
7370
6771
|
};
|
7371
6772
|
var useParticipants2 = (params) => {
|
7372
6773
|
var _a7;
|
7373
|
-
const isConnected =
|
7374
|
-
const peerCount =
|
7375
|
-
const availableRoles =
|
7376
|
-
let participantList =
|
6774
|
+
const isConnected = useHMSStore24(selectIsConnectedToRoom4);
|
6775
|
+
const peerCount = useHMSStore24(selectPeerCount);
|
6776
|
+
const availableRoles = useHMSStore24(selectAvailableRoleNames2);
|
6777
|
+
let participantList = useHMSStore24(isConnected ? selectPeers : selectRemotePeers);
|
7377
6778
|
const rolesWithParticipants = Array.from(new Set(participantList.map((peer) => peer.roleName)));
|
7378
6779
|
const vanillaStore = useHMSVanillaStore8();
|
7379
6780
|
if ((_a7 = params == null ? void 0 : params.metadata) == null ? void 0 : _a7.isHandRaised) {
|
7380
6781
|
participantList = participantList.filter((peer) => {
|
7381
|
-
return vanillaStore.getState(
|
6782
|
+
return vanillaStore.getState(selectPeerMetadata2(peer.id)).isHandRaised;
|
7382
6783
|
});
|
7383
6784
|
}
|
7384
6785
|
if ((params == null ? void 0 : params.role) && availableRoles.includes(params.role)) {
|
@@ -7394,13 +6795,13 @@ var useParticipants2 = (params) => {
|
|
7394
6795
|
// src/Prebuilt/components/hooks/useAutoStartStreaming.tsx
|
7395
6796
|
var useAutoStartStreaming = () => {
|
7396
6797
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
7397
|
-
const permissions =
|
6798
|
+
const permissions = useHMSStore25(selectPermissions2);
|
7398
6799
|
const showStreamingUI = useShowStreamingUI();
|
7399
|
-
const hmsActions =
|
7400
|
-
const isConnected =
|
6800
|
+
const hmsActions = useHMSActions17();
|
6801
|
+
const isConnected = useHMSStore25(selectIsConnectedToRoom5);
|
7401
6802
|
const { isHLSRunning } = useRecordingStreaming5();
|
7402
6803
|
const streamStartedRef = useRef9(false);
|
7403
|
-
const startHLS =
|
6804
|
+
const startHLS = useCallback19(() => __async(void 0, null, function* () {
|
7404
6805
|
var _a7;
|
7405
6806
|
try {
|
7406
6807
|
if (isHLSStarted || !showStreamingUI || isHLSRunning) {
|
@@ -7431,8 +6832,8 @@ var useAutoStartStreaming = () => {
|
|
7431
6832
|
};
|
7432
6833
|
|
7433
6834
|
// src/Prebuilt/App.tsx
|
7434
|
-
var Conference =
|
7435
|
-
var HMSPrebuilt =
|
6835
|
+
var Conference = React59.lazy(() => import("./conference-N7S47TDK.js"));
|
6836
|
+
var HMSPrebuilt = React59.forwardRef(
|
7436
6837
|
({
|
7437
6838
|
roomCode = "",
|
7438
6839
|
authToken = "",
|
@@ -7443,12 +6844,13 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7443
6844
|
themes,
|
7444
6845
|
options: { userName = "", userId = "", endpoints } = {},
|
7445
6846
|
screens,
|
7446
|
-
onLeave
|
6847
|
+
onLeave,
|
6848
|
+
onJoin
|
7447
6849
|
}, ref) => {
|
7448
6850
|
var _a7, _b7, _c, _d;
|
7449
6851
|
const metadata = "";
|
7450
6852
|
const reactiveStore = useRef10();
|
7451
|
-
const [hydrated, setHydrated] =
|
6853
|
+
const [hydrated, setHydrated] = React59.useState(false);
|
7452
6854
|
useEffect29(() => {
|
7453
6855
|
setHydrated(true);
|
7454
6856
|
const hms = new HMSReactiveStore();
|
@@ -7500,7 +6902,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7500
6902
|
return null;
|
7501
6903
|
}
|
7502
6904
|
globalStyles();
|
7503
|
-
return /* @__PURE__ */
|
6905
|
+
return /* @__PURE__ */ React59.createElement(ErrorBoundary, null, /* @__PURE__ */ React59.createElement(
|
7504
6906
|
HMSPrebuiltContext.Provider,
|
7505
6907
|
{
|
7506
6908
|
value: {
|
@@ -7508,6 +6910,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7508
6910
|
roomId,
|
7509
6911
|
role,
|
7510
6912
|
onLeave,
|
6913
|
+
onJoin,
|
7511
6914
|
userName,
|
7512
6915
|
userId,
|
7513
6916
|
endpoints: {
|
@@ -7518,7 +6921,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7518
6921
|
}
|
7519
6922
|
}
|
7520
6923
|
},
|
7521
|
-
/* @__PURE__ */
|
6924
|
+
/* @__PURE__ */ React59.createElement(
|
7522
6925
|
HMSRoomProvider,
|
7523
6926
|
{
|
7524
6927
|
isHMSStatsOn: FeatureFlags.enableStatsForNerds,
|
@@ -7527,7 +6930,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7527
6930
|
notifications: (_c = reactiveStore.current) == null ? void 0 : _c.hmsNotifications,
|
7528
6931
|
stats: (_d = reactiveStore.current) == null ? void 0 : _d.hmsStats
|
7529
6932
|
},
|
7530
|
-
/* @__PURE__ */
|
6933
|
+
/* @__PURE__ */ React59.createElement(RoomLayoutProvider, { roomLayoutEndpoint, overrideLayout }, /* @__PURE__ */ React59.createElement(RoomLayoutContext.Consumer, null, (data) => {
|
7531
6934
|
var _a8;
|
7532
6935
|
const layout = data == null ? void 0 : data.layout;
|
7533
6936
|
const theme2 = ((_a8 = layout == null ? void 0 : layout.themes) == null ? void 0 : _a8[0]) || {};
|
@@ -7536,7 +6939,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7536
6939
|
if (typography2 == null ? void 0 : typography2.font_family) {
|
7537
6940
|
fontFamily = [`${typography2 == null ? void 0 : typography2.font_family}`, ...fontFamily];
|
7538
6941
|
}
|
7539
|
-
return /* @__PURE__ */
|
6942
|
+
return /* @__PURE__ */ React59.createElement(
|
7540
6943
|
HMSThemeProvider,
|
7541
6944
|
{
|
7542
6945
|
themeType: `${theme2.name}-${Date.now()}`,
|
@@ -7549,11 +6952,12 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7549
6952
|
}
|
7550
6953
|
}
|
7551
6954
|
},
|
7552
|
-
/* @__PURE__ */
|
7553
|
-
/* @__PURE__ */
|
7554
|
-
/* @__PURE__ */
|
6955
|
+
/* @__PURE__ */ React59.createElement(AppData, { appDetails: metadata, tokenEndpoint: tokenByRoomIdRoleEndpoint }),
|
6956
|
+
/* @__PURE__ */ React59.createElement(Init, null),
|
6957
|
+
/* @__PURE__ */ React59.createElement(
|
7555
6958
|
Box,
|
7556
6959
|
{
|
6960
|
+
id: "prebuilt-container",
|
7557
6961
|
css: {
|
7558
6962
|
bg: "$background_dim",
|
7559
6963
|
size: "100%",
|
@@ -7561,7 +6965,7 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7561
6965
|
"-webkit-text-size-adjust": "100%"
|
7562
6966
|
}
|
7563
6967
|
},
|
7564
|
-
/* @__PURE__ */
|
6968
|
+
/* @__PURE__ */ React59.createElement(AppRoutes, { authTokenByRoomCodeEndpoint: tokenByRoomCodeEndpoint, defaultAuthToken: authToken })
|
7565
6969
|
)
|
7566
6970
|
);
|
7567
6971
|
}))
|
@@ -7572,41 +6976,41 @@ var HMSPrebuilt = React61.forwardRef(
|
|
7572
6976
|
HMSPrebuilt.displayName = "HMSPrebuilt";
|
7573
6977
|
var Redirector = ({ showPreview }) => {
|
7574
6978
|
const { roomId, role } = useParams5();
|
7575
|
-
return /* @__PURE__ */
|
6979
|
+
return /* @__PURE__ */ React59.createElement(Navigate, { to: `/${showPreview ? "preview" : "meeting"}/${roomId}/${role || ""}` });
|
7576
6980
|
};
|
7577
6981
|
var RouteList = () => {
|
7578
6982
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
7579
6983
|
const { isLeaveScreenEnabled } = useRoomLayoutLeaveScreen();
|
7580
6984
|
useAutoStartStreaming();
|
7581
|
-
return /* @__PURE__ */
|
6985
|
+
return /* @__PURE__ */ React59.createElement(Routes, null, isPreviewScreenEnabled ? /* @__PURE__ */ React59.createElement(Route, { path: "preview" }, /* @__PURE__ */ React59.createElement(
|
7582
6986
|
Route,
|
7583
6987
|
{
|
7584
6988
|
path: ":roomId/:role",
|
7585
|
-
element: /* @__PURE__ */
|
6989
|
+
element: /* @__PURE__ */ React59.createElement(Suspense2, { fallback: /* @__PURE__ */ React59.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React59.createElement(PreviewContainer_default, null))
|
7586
6990
|
}
|
7587
|
-
), /* @__PURE__ */
|
6991
|
+
), /* @__PURE__ */ React59.createElement(
|
7588
6992
|
Route,
|
7589
6993
|
{
|
7590
6994
|
path: ":roomId",
|
7591
|
-
element: /* @__PURE__ */
|
6995
|
+
element: /* @__PURE__ */ React59.createElement(Suspense2, { fallback: /* @__PURE__ */ React59.createElement(FullPageProgress_default, { text: "Loading preview..." }) }, /* @__PURE__ */ React59.createElement(PreviewContainer_default, null))
|
7592
6996
|
}
|
7593
|
-
)) : null, /* @__PURE__ */
|
6997
|
+
)) : null, /* @__PURE__ */ React59.createElement(Route, { path: "meeting" }, /* @__PURE__ */ React59.createElement(
|
7594
6998
|
Route,
|
7595
6999
|
{
|
7596
7000
|
path: ":roomId/:role",
|
7597
|
-
element: /* @__PURE__ */
|
7001
|
+
element: /* @__PURE__ */ React59.createElement(Suspense2, { fallback: /* @__PURE__ */ React59.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React59.createElement(Conference, null))
|
7598
7002
|
}
|
7599
|
-
), /* @__PURE__ */
|
7003
|
+
), /* @__PURE__ */ React59.createElement(
|
7600
7004
|
Route,
|
7601
7005
|
{
|
7602
7006
|
path: ":roomId",
|
7603
|
-
element: /* @__PURE__ */
|
7007
|
+
element: /* @__PURE__ */ React59.createElement(Suspense2, { fallback: /* @__PURE__ */ React59.createElement(FullPageProgress_default, { text: "Joining..." }) }, /* @__PURE__ */ React59.createElement(Conference, null))
|
7604
7008
|
}
|
7605
|
-
)), isLeaveScreenEnabled ? /* @__PURE__ */
|
7009
|
+
)), isLeaveScreenEnabled ? /* @__PURE__ */ React59.createElement(Route, { path: "leave" }, /* @__PURE__ */ React59.createElement(Route, { path: ":roomId/:role", element: /* @__PURE__ */ React59.createElement(PostLeave_default, null) }), /* @__PURE__ */ React59.createElement(Route, { path: ":roomId", element: /* @__PURE__ */ React59.createElement(PostLeave_default, null) })) : null, /* @__PURE__ */ React59.createElement(Route, { path: "/:roomId/:role", element: /* @__PURE__ */ React59.createElement(Redirector, { showPreview: isPreviewScreenEnabled }) }), /* @__PURE__ */ React59.createElement(Route, { path: "/:roomId/", element: /* @__PURE__ */ React59.createElement(Redirector, { showPreview: isPreviewScreenEnabled }) }));
|
7606
7010
|
};
|
7607
7011
|
var BackSwipe = () => {
|
7608
|
-
const isConnectedToRoom =
|
7609
|
-
const hmsActions =
|
7012
|
+
const isConnectedToRoom = useHMSStore26(selectIsConnectedToRoom6);
|
7013
|
+
const hmsActions = useHMSActions18();
|
7610
7014
|
useEffect29(() => {
|
7611
7015
|
const onRouteLeave = () => __async(void 0, null, function* () {
|
7612
7016
|
if (isConnectedToRoom) {
|
@@ -7622,7 +7026,7 @@ var BackSwipe = () => {
|
|
7622
7026
|
};
|
7623
7027
|
var Router = ({ children }) => {
|
7624
7028
|
const { roomId, role, roomCode } = useHMSPrebuiltContext();
|
7625
|
-
return [roomId, role, roomCode].every((value) => !value) ? /* @__PURE__ */
|
7029
|
+
return [roomId, role, roomCode].every((value) => !value) ? /* @__PURE__ */ React59.createElement(BrowserRouter, null, children) : /* @__PURE__ */ React59.createElement(MemoryRouter, { initialEntries: [`/${roomCode ? roomCode : `${roomId}/${role || ""}`}`], initialIndex: 0 }, children);
|
7626
7030
|
};
|
7627
7031
|
function AppRoutes({
|
7628
7032
|
authTokenByRoomCodeEndpoint,
|
@@ -7630,7 +7034,7 @@ function AppRoutes({
|
|
7630
7034
|
}) {
|
7631
7035
|
const roomLayout = useRoomLayout();
|
7632
7036
|
const isNotificationsDisabled = useIsNotificationDisabled();
|
7633
|
-
return /* @__PURE__ */
|
7037
|
+
return /* @__PURE__ */ React59.createElement(Router, null, /* @__PURE__ */ React59.createElement(React59.Fragment, null, /* @__PURE__ */ React59.createElement(ToastContainer, null), /* @__PURE__ */ React59.createElement(Notifications, null), /* @__PURE__ */ React59.createElement(BackSwipe, null), !isNotificationsDisabled && /* @__PURE__ */ React59.createElement(FlyingEmoji, null), /* @__PURE__ */ React59.createElement(RemoteStopScreenshare, null), /* @__PURE__ */ React59.createElement(HeadlessEndRoomListener, null), /* @__PURE__ */ React59.createElement(KeyboardHandler, null), /* @__PURE__ */ React59.createElement(AuthToken_default, { authTokenByRoomCodeEndpoint, defaultAuthToken }), roomLayout && /* @__PURE__ */ React59.createElement(Routes, null, /* @__PURE__ */ React59.createElement(Route, { path: "/*", element: /* @__PURE__ */ React59.createElement(RouteList, null) }))));
|
7634
7038
|
}
|
7635
7039
|
|
7636
7040
|
// src/Progress/index.tsx
|
@@ -7673,6 +7077,7 @@ export {
|
|
7673
7077
|
Video,
|
7674
7078
|
StyledMenuTile,
|
7675
7079
|
useBorderAudioLevel,
|
7080
|
+
AudioLevel,
|
7676
7081
|
Popover2 as Popover,
|
7677
7082
|
VideoTileStats,
|
7678
7083
|
Checkbox,
|
@@ -7697,6 +7102,7 @@ export {
|
|
7697
7102
|
APP_DATA,
|
7698
7103
|
UI_SETTINGS,
|
7699
7104
|
SIDE_PANE_OPTIONS,
|
7105
|
+
REMOTE_STOP_SCREENSHARE_TYPE,
|
7700
7106
|
isChrome,
|
7701
7107
|
isIOS,
|
7702
7108
|
isMacOS,
|
@@ -7717,6 +7123,7 @@ export {
|
|
7717
7123
|
useSetSubscribedChatSelector,
|
7718
7124
|
useSetAppDataByKey,
|
7719
7125
|
useHMSPrebuiltContext,
|
7126
|
+
PrebuiltDialogPortal,
|
7720
7127
|
DialogContent,
|
7721
7128
|
DialogRow,
|
7722
7129
|
DialogCol,
|
@@ -7737,14 +7144,12 @@ export {
|
|
7737
7144
|
Header2 as Header,
|
7738
7145
|
AudioVideoToggle,
|
7739
7146
|
ConnectionIndicator,
|
7147
|
+
TileConnection_default,
|
7148
|
+
PrebuiltAudioIndicator,
|
7149
|
+
PrebuiltAttributeBox,
|
7740
7150
|
DialogDropdownTrigger,
|
7741
7151
|
useDropdownSelection,
|
7742
7152
|
SettingsModal_default,
|
7743
|
-
ChangeNameModal,
|
7744
|
-
useDropdownList,
|
7745
|
-
TileMenu_default,
|
7746
|
-
getVideoTileLabel,
|
7747
|
-
VideoTile_default,
|
7748
7153
|
PreviewTile,
|
7749
7154
|
PreviewControls,
|
7750
7155
|
useFilteredRoles,
|
@@ -7752,4 +7157,4 @@ export {
|
|
7752
7157
|
HMSPrebuilt,
|
7753
7158
|
Progress
|
7754
7159
|
};
|
7755
|
-
//# sourceMappingURL=chunk-
|
7160
|
+
//# sourceMappingURL=chunk-PRM33R4R.js.map
|