@100mslive/roomkit-react 0.1.7-alpha.0 → 0.1.8-alpha.0
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-F5BDZVT2.js → HLSView-IQRPLYNH.js} +8 -6
- package/dist/{HLSView-F5BDZVT2.js.map → HLSView-IQRPLYNH.js.map} +2 -2
- package/dist/Prebuilt/components/Chip.d.ts +12 -0
- package/dist/Prebuilt/components/PrebuiltDialogPortal.d.ts +4 -0
- package/dist/Prebuilt/components/RoleChangeRequest/RequestPrompt.d.ts +9 -0
- package/dist/VideoTile/StyledVideoTile.d.ts +445 -3
- package/dist/{VirtualBackground-THDRYDRA.js → VirtualBackground-GP4ATXD3.js} +3 -3
- package/dist/{chunk-JSH7SKEH.js → chunk-2H5NIZB7.js} +2 -2
- package/dist/{chunk-CDYRVICT.js → chunk-GLYGPYNS.js} +574 -1196
- package/dist/chunk-GLYGPYNS.js.map +7 -0
- package/dist/{chunk-U3G743OY.js → chunk-Z3O2WGWV.js} +2 -2
- package/dist/{chunk-U3G743OY.js.map → chunk-Z3O2WGWV.js.map} +1 -1
- package/dist/{conference-6IVZHILI.js → conference-JD35TNH4.js} +1545 -840
- package/dist/conference-JD35TNH4.js.map +7 -0
- package/dist/index.cjs.js +5975 -5849
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +4 -2
- package/dist/meta.cjs.json +1633 -1399
- package/dist/meta.esbuild.json +1689 -1454
- 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/Input/Input.tsx +1 -1
- package/src/Prebuilt/App.tsx +1 -0
- package/src/Prebuilt/components/Chat/ChatBody.jsx +125 -106
- package/src/Prebuilt/components/{Chip.jsx → Chip.tsx} +13 -2
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +24 -13
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +43 -3
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +41 -46
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +23 -35
- 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/PermissionErrorModal.jsx +3 -2
- package/src/Prebuilt/components/PrebuiltDialogPortal.tsx +6 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +9 -6
- package/src/Prebuilt/components/RaiseHand.jsx +4 -11
- package/src/Prebuilt/components/RoleChangeModal.jsx +3 -2
- package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +67 -0
- package/src/Prebuilt/components/{RoleChangeRequestModal.tsx → RoleChangeRequest/RoleChangeRequestModal.tsx} +18 -50
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +3 -2
- package/src/Prebuilt/components/Settings/StartRecording.jsx +3 -2
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -2
- package/src/Prebuilt/components/VideoTile.jsx +34 -75
- package/src/Prebuilt/components/conference.jsx +1 -1
- package/src/Prebuilt/components/hooks/useMetadata.jsx +2 -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 +4 -2
- package/src/Prebuilt/layouts/SidePane.tsx +0 -1
- package/src/Prebuilt/primitives/DialogContent.jsx +5 -4
- package/src/VideoTile/StyledVideoTile.tsx +10 -14
- package/dist/chunk-CDYRVICT.js.map +0 -7
- package/dist/conference-6IVZHILI.js.map +0 -7
- /package/dist/Prebuilt/components/{RoleChangeRequestModal.d.ts → RoleChangeRequest/RoleChangeRequestModal.d.ts} +0 -0
- /package/dist/{VirtualBackground-THDRYDRA.js.map → VirtualBackground-GP4ATXD3.js.map} +0 -0
- /package/dist/{chunk-JSH7SKEH.js.map → chunk-2H5NIZB7.js.map} +0 -0
@@ -1,14 +1,16 @@
|
|
1
1
|
import {
|
2
2
|
ActionTile
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-2H5NIZB7.js";
|
4
4
|
import {
|
5
5
|
APP_DATA,
|
6
6
|
Accordion,
|
7
|
+
AudioLevel,
|
7
8
|
AudioVideoToggle,
|
9
|
+
Avatar,
|
8
10
|
Button,
|
9
11
|
CHAT_SELECTOR,
|
10
|
-
ChangeNameModal,
|
11
12
|
Checkbox,
|
13
|
+
Chip_default,
|
12
14
|
ConnectionIndicator,
|
13
15
|
Dialog,
|
14
16
|
DialogCol,
|
@@ -27,8 +29,10 @@ import {
|
|
27
29
|
Label,
|
28
30
|
PictureInPicture,
|
29
31
|
Popover,
|
32
|
+
PrebuiltDialogPortal,
|
30
33
|
PreviewControls,
|
31
34
|
PreviewTile,
|
35
|
+
REMOTE_STOP_SCREENSHARE_TYPE,
|
32
36
|
ROLE_CHANGE_DECLINED,
|
33
37
|
RTMP_RECORD_DEFAULT_RESOLUTION,
|
34
38
|
RTMP_RECORD_RESOLUTION_MAX,
|
@@ -38,22 +42,22 @@ import {
|
|
38
42
|
SIDE_PANE_OPTIONS,
|
39
43
|
SettingsModal_default,
|
40
44
|
Sheet,
|
45
|
+
Slider,
|
41
46
|
StopRecordingInSheet,
|
47
|
+
StyledMenuTile,
|
42
48
|
StyledPagination,
|
43
49
|
StyledVideoTile,
|
44
50
|
Switch,
|
45
51
|
Tabs,
|
46
52
|
ThemeTypes,
|
47
|
-
|
53
|
+
TileConnection_default,
|
48
54
|
ToastManager,
|
49
55
|
UI_SETTINGS,
|
50
56
|
UserPreferencesKeys,
|
51
57
|
Video,
|
52
58
|
VideoTileStats,
|
53
|
-
VideoTile_default,
|
54
59
|
getFormattedCount,
|
55
60
|
getMetadata,
|
56
|
-
getVideoTileLabel,
|
57
61
|
isAndroid,
|
58
62
|
isChrome,
|
59
63
|
isIOS,
|
@@ -61,7 +65,6 @@ import {
|
|
61
65
|
isMacOS,
|
62
66
|
isScreenshareSupported,
|
63
67
|
useAuthToken,
|
64
|
-
useDropdownList,
|
65
68
|
useDropdownSelection,
|
66
69
|
useFilteredRoles,
|
67
70
|
useHMSPrebuiltContext,
|
@@ -83,7 +86,7 @@ import {
|
|
83
86
|
useUrlToEmbed,
|
84
87
|
useUserPreferences,
|
85
88
|
useWaitingViewerRole
|
86
|
-
} from "./chunk-
|
89
|
+
} from "./chunk-GLYGPYNS.js";
|
87
90
|
import {
|
88
91
|
Box,
|
89
92
|
Flex,
|
@@ -102,10 +105,10 @@ import {
|
|
102
105
|
slideLeftAndFade,
|
103
106
|
styled,
|
104
107
|
textEllipsis
|
105
|
-
} from "./chunk-
|
108
|
+
} from "./chunk-Z3O2WGWV.js";
|
106
109
|
|
107
110
|
// src/Prebuilt/components/conference.jsx
|
108
|
-
import
|
111
|
+
import React68, { useEffect as useEffect27, useRef as useRef16, useState as useState39 } from "react";
|
109
112
|
import { useNavigate, useParams } from "react-router-dom";
|
110
113
|
import { usePrevious } from "react-use";
|
111
114
|
import {
|
@@ -113,13 +116,13 @@ import {
|
|
113
116
|
selectAppData as selectAppData4,
|
114
117
|
selectIsConnectedToRoom as selectIsConnectedToRoom7,
|
115
118
|
selectRoomState,
|
116
|
-
useHMSActions as
|
117
|
-
useHMSStore as
|
119
|
+
useHMSActions as useHMSActions25,
|
120
|
+
useHMSStore as useHMSStore39
|
118
121
|
} from "@100mslive/react-sdk";
|
119
122
|
|
120
123
|
// src/Prebuilt/components/Footer/Footer.tsx
|
121
|
-
import
|
122
|
-
import { useMedia as
|
124
|
+
import React38, { Suspense, useEffect as useEffect8 } from "react";
|
125
|
+
import { useMedia as useMedia6 } from "react-use";
|
123
126
|
import { Chat_ChatState } from "@100mslive/types-prebuilt/elements/chat";
|
124
127
|
import { useAVToggle as useAVToggle2 } from "@100mslive/react-sdk";
|
125
128
|
|
@@ -159,6 +162,26 @@ var EmojiContainer = styled("span", {
|
|
159
162
|
}
|
160
163
|
});
|
161
164
|
|
165
|
+
// src/Prebuilt/components/hooks/useDropdownList.jsx
|
166
|
+
import { useEffect } from "react";
|
167
|
+
var useDropdownList = ({ name, open }) => {
|
168
|
+
const [dropdownList = [], setDropdownList] = useSetAppDataByKey(APP_DATA.dropdownList);
|
169
|
+
useEffect(() => {
|
170
|
+
if (open) {
|
171
|
+
if (!dropdownList.includes(name)) {
|
172
|
+
setDropdownList([...dropdownList, name]);
|
173
|
+
}
|
174
|
+
} else {
|
175
|
+
const index = dropdownList.indexOf(name);
|
176
|
+
if (index >= 0) {
|
177
|
+
const newDropdownList = [...dropdownList];
|
178
|
+
newDropdownList.splice(index, 1);
|
179
|
+
setDropdownList(newDropdownList);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}, [open, name]);
|
183
|
+
};
|
184
|
+
|
162
185
|
// src/Prebuilt/components/EmojiReaction.jsx
|
163
186
|
init({ data });
|
164
187
|
var EmojiReaction = () => {
|
@@ -345,11 +368,12 @@ var DesktopLeaveRoom = ({
|
|
345
368
|
const permissions = useHMSStore2(selectPermissions);
|
346
369
|
const { isStreamingOn } = useRecordingStreaming();
|
347
370
|
const showStream = screenType !== "hls_live_streaming" && isStreamingOn;
|
371
|
+
const showLeaveOptions = (permissions == null ? void 0 : permissions.hlsStreaming) && isStreamingOn || (permissions == null ? void 0 : permissions.endRoom);
|
348
372
|
useDropdownList({ open: open || showEndStreamAlert || showLeaveRoomAlert, name: "LeaveRoom" });
|
349
373
|
if (!permissions || !isConnected) {
|
350
374
|
return null;
|
351
375
|
}
|
352
|
-
return /* @__PURE__ */ React6.createElement(Fragment2, null,
|
376
|
+
return /* @__PURE__ */ React6.createElement(Fragment2, null, showLeaveOptions ? /* @__PURE__ */ React6.createElement(Flex, null, /* @__PURE__ */ React6.createElement(
|
353
377
|
LeaveIconButton,
|
354
378
|
{
|
355
379
|
key: "LeaveRoom",
|
@@ -358,9 +382,7 @@ var DesktopLeaveRoom = ({
|
|
358
382
|
borderTopRightRadius: 0,
|
359
383
|
borderBottomRightRadius: 0
|
360
384
|
},
|
361
|
-
onClick: () =>
|
362
|
-
leaveRoom({ endstream: false });
|
363
|
-
}
|
385
|
+
onClick: () => setShowLeaveRoomAlert(true)
|
364
386
|
},
|
365
387
|
/* @__PURE__ */ React6.createElement(Tooltip, { title: "Leave Room" }, /* @__PURE__ */ React6.createElement(Box, null, /* @__PURE__ */ React6.createElement(ExitIcon, { style: { transform: "rotate(180deg)" } })))
|
366
388
|
), /* @__PURE__ */ React6.createElement(Dropdown.Root, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React6.createElement(
|
@@ -379,7 +401,7 @@ var DesktopLeaveRoom = ({
|
|
379
401
|
{
|
380
402
|
css: {
|
381
403
|
bg: "$surface_dim",
|
382
|
-
color: "$
|
404
|
+
color: "$on_surface_medium",
|
383
405
|
"&:hover": { bg: "$surface_default", color: "$on_surface_high" }
|
384
406
|
},
|
385
407
|
onClick: () => leaveRoom({ endstream: false }),
|
@@ -397,7 +419,7 @@ var DesktopLeaveRoom = ({
|
|
397
419
|
css: { p: 0 }
|
398
420
|
}
|
399
421
|
)
|
400
|
-
),
|
422
|
+
), /* @__PURE__ */ React6.createElement(
|
401
423
|
Dropdown.Item,
|
402
424
|
{
|
403
425
|
css: {
|
@@ -422,21 +444,17 @@ var DesktopLeaveRoom = ({
|
|
422
444
|
css: { p: 0 }
|
423
445
|
}
|
424
446
|
)
|
425
|
-
)
|
447
|
+
)))) : /* @__PURE__ */ React6.createElement(
|
426
448
|
LeaveIconButton,
|
427
449
|
{
|
428
450
|
onClick: () => {
|
429
|
-
|
430
|
-
setShowLeaveRoomAlert(true);
|
431
|
-
} else {
|
432
|
-
leaveRoom({ endstream: false });
|
433
|
-
}
|
451
|
+
setShowLeaveRoomAlert(true);
|
434
452
|
},
|
435
453
|
key: "LeaveRoom",
|
436
454
|
"data-testid": "leave_room_btn"
|
437
455
|
},
|
438
456
|
/* @__PURE__ */ React6.createElement(Tooltip, { title: "Leave Room" }, /* @__PURE__ */ React6.createElement(Box, null, /* @__PURE__ */ React6.createElement(ExitIcon, { style: { transform: "rotate(180deg)" } })))
|
439
|
-
), /* @__PURE__ */ React6.createElement(Dialog.Root, { open: showEndStreamAlert, modal: false }, /* @__PURE__ */ React6.createElement(
|
457
|
+
), /* @__PURE__ */ React6.createElement(Dialog.Root, { open: showEndStreamAlert, modal: false }, /* @__PURE__ */ React6.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React6.createElement(Dialog.Overlay, null), /* @__PURE__ */ React6.createElement(Dialog.Content, { css: { w: "min(420px, 90%)", p: "$8", bg: "$surface_dim" } }, /* @__PURE__ */ React6.createElement(
|
440
458
|
EndSessionContent,
|
441
459
|
{
|
442
460
|
setShowEndStreamAlert,
|
@@ -444,7 +462,7 @@ var DesktopLeaveRoom = ({
|
|
444
462
|
isStreamingOn,
|
445
463
|
isModal: true
|
446
464
|
}
|
447
|
-
)))),
|
465
|
+
)))), /* @__PURE__ */ React6.createElement(Dialog.Root, { open: showLeaveRoomAlert, modal: false }, /* @__PURE__ */ React6.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React6.createElement(Dialog.Overlay, null), /* @__PURE__ */ React6.createElement(Dialog.Content, { css: { w: "min(420px, 90%)", p: "$8", bg: "$surface_dim" } }, /* @__PURE__ */ React6.createElement(LeaveSessionContent, { setShowLeaveRoomAlert, leaveRoom, isModal: true })))));
|
448
466
|
};
|
449
467
|
|
450
468
|
// src/Prebuilt/components/Leave/MwebLeaveRoom.tsx
|
@@ -463,11 +481,12 @@ var MwebLeaveRoom = ({
|
|
463
481
|
const permissions = useHMSStore3(selectPermissions2);
|
464
482
|
const { isStreamingOn } = useRecordingStreaming2();
|
465
483
|
const showStream = screenType !== "hls_live_streaming" && isStreamingOn;
|
484
|
+
const showLeaveOptions = (permissions == null ? void 0 : permissions.hlsStreaming) && isStreamingOn || (permissions == null ? void 0 : permissions.endRoom);
|
466
485
|
useDropdownList({ open, name: "LeaveRoom" });
|
467
486
|
if (!permissions || !isConnected) {
|
468
487
|
return null;
|
469
488
|
}
|
470
|
-
return /* @__PURE__ */ React7.createElement(Fragment3, null,
|
489
|
+
return /* @__PURE__ */ React7.createElement(Fragment3, null, showLeaveOptions ? /* @__PURE__ */ React7.createElement(Sheet.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React7.createElement(Sheet.Trigger, { asChild: true }, /* @__PURE__ */ React7.createElement(
|
471
490
|
LeaveIconButton,
|
472
491
|
{
|
473
492
|
key: "LeaveRoom",
|
@@ -489,7 +508,7 @@ var MwebLeaveRoom = ({
|
|
489
508
|
onClick: () => leaveRoom({ endstream: false }),
|
490
509
|
css: { pt: 0, mt: "$10", color: "$on_surface_low", "&:hover": { color: "$on_surface_high" } }
|
491
510
|
}
|
492
|
-
),
|
511
|
+
), /* @__PURE__ */ React7.createElement(
|
493
512
|
LeaveCard,
|
494
513
|
{
|
495
514
|
title: showStream ? "End Stream" : "End Session",
|
@@ -503,28 +522,14 @@ var MwebLeaveRoom = ({
|
|
503
522
|
setShowEndStreamAlert(true);
|
504
523
|
}
|
505
524
|
}
|
506
|
-
) : null)) : /* @__PURE__ */ React7.createElement(
|
507
|
-
LeaveIconButton,
|
508
|
-
{
|
509
|
-
key: "LeaveRoom",
|
510
|
-
"data-testid": "leave_room_btn",
|
511
|
-
onClick: () => {
|
512
|
-
if (screenType === "hls_live_streaming") {
|
513
|
-
setShowLeaveRoomAlert(true);
|
514
|
-
} else {
|
515
|
-
leaveRoom({ endstream: false });
|
516
|
-
}
|
517
|
-
}
|
518
|
-
},
|
519
|
-
/* @__PURE__ */ React7.createElement(Tooltip, { title: "Leave Room" }, /* @__PURE__ */ React7.createElement(Box, null, /* @__PURE__ */ React7.createElement(ExitIcon2, { style: { transform: "rotate(180deg)" } })))
|
520
|
-
), /* @__PURE__ */ React7.createElement(Sheet.Root, { open: showEndStreamAlert, onOpenChange: setShowEndStreamAlert }, /* @__PURE__ */ React7.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$10", pb: "$12" } }, /* @__PURE__ */ React7.createElement(
|
525
|
+
))) : /* @__PURE__ */ React7.createElement(LeaveIconButton, { key: "LeaveRoom", "data-testid": "leave_room_btn", onClick: () => setShowLeaveRoomAlert(true) }, /* @__PURE__ */ React7.createElement(Tooltip, { title: "Leave Room" }, /* @__PURE__ */ React7.createElement(Box, null, /* @__PURE__ */ React7.createElement(ExitIcon2, { style: { transform: "rotate(180deg)" } })))), /* @__PURE__ */ React7.createElement(Sheet.Root, { open: showEndStreamAlert, onOpenChange: setShowEndStreamAlert }, /* @__PURE__ */ React7.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$10", pb: "$12" } }, /* @__PURE__ */ React7.createElement(
|
521
526
|
EndSessionContent,
|
522
527
|
{
|
523
528
|
setShowEndStreamAlert,
|
524
529
|
leaveRoom: isStreamingOn ? leaveRoom : endRoom,
|
525
530
|
isStreamingOn
|
526
531
|
}
|
527
|
-
))),
|
532
|
+
))), /* @__PURE__ */ React7.createElement(Sheet.Root, { open: showLeaveRoomAlert, onOpenChange: setShowLeaveRoomAlert }, /* @__PURE__ */ React7.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$10", pb: "$12" } }, /* @__PURE__ */ React7.createElement(LeaveSessionContent, { setShowLeaveRoomAlert, leaveRoom }))));
|
528
533
|
};
|
529
534
|
|
530
535
|
// src/Prebuilt/components/Leave/LeaveRoom.tsx
|
@@ -571,8 +576,8 @@ var LeaveRoom = ({ screenType }) => {
|
|
571
576
|
};
|
572
577
|
|
573
578
|
// src/Prebuilt/components/MoreSettings/MoreSettings.tsx
|
574
|
-
import
|
575
|
-
import { useMedia as
|
579
|
+
import React25 from "react";
|
580
|
+
import { useMedia as useMedia4 } from "react-use";
|
576
581
|
|
577
582
|
// src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx
|
578
583
|
import React21, { Fragment as Fragment4, useState as useState13 } from "react";
|
@@ -584,7 +589,7 @@ import { BrbIcon, CheckIcon as CheckIcon3, DragHandleIcon, InfoIcon as InfoIcon2
|
|
584
589
|
import React10 from "react";
|
585
590
|
|
586
591
|
// src/Prebuilt/components/PIP/PIPComponent.jsx
|
587
|
-
import React9, { useCallback, useEffect, useState as useState4 } from "react";
|
592
|
+
import React9, { useCallback, useEffect as useEffect2, useState as useState4 } from "react";
|
588
593
|
import { selectPeers, selectTracksMap, useHMSActions as useHMSActions2, useHMSStore as useHMSStore5, useHMSVanillaStore } from "@100mslive/react-sdk";
|
589
594
|
import { PipIcon } from "@100mslive/react-icons";
|
590
595
|
|
@@ -664,7 +669,7 @@ var ActivatedPIP = () => {
|
|
664
669
|
const tracksMap = useHMSStore5(selectTracksMap);
|
665
670
|
const storePeers = useHMSStore5(selectPeers);
|
666
671
|
const pinnedTrack = usePinnedTrack();
|
667
|
-
|
672
|
+
useEffect2(() => {
|
668
673
|
function updatePIP() {
|
669
674
|
if (!PictureInPicture.isOn()) {
|
670
675
|
return;
|
@@ -725,7 +730,7 @@ var RoleChangeModal = ({ peerId, onOpenChange }) => {
|
|
725
730
|
return null;
|
726
731
|
}
|
727
732
|
const peerNameMaxWidth = 200;
|
728
|
-
return /* @__PURE__ */ React11.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React11.createElement(
|
733
|
+
return /* @__PURE__ */ React11.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React11.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React11.createElement(Dialog.Overlay, null), /* @__PURE__ */ React11.createElement(Dialog.Content, { css: { width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React11.createElement(Dialog.Title, { css: { p: 0 }, asChild: true }, /* @__PURE__ */ React11.createElement(Text, { as: "h6", variant: "h6" }, "Change Role")), /* @__PURE__ */ React11.createElement(Dialog.Description, { asChild: true }, /* @__PURE__ */ React11.createElement(
|
729
734
|
Text,
|
730
735
|
{
|
731
736
|
variant: "body2",
|
@@ -891,7 +896,7 @@ var ResolutionInput = ({ onResolutionChange, disabled, tooltipText, css, testId
|
|
891
896
|
};
|
892
897
|
|
893
898
|
// src/Prebuilt/components/Streaming/RTMPStreaming.jsx
|
894
|
-
import React14, { useEffect as
|
899
|
+
import React14, { useEffect as useEffect3, useRef as useRef2, useState as useState7 } from "react";
|
895
900
|
import { useHMSActions as useHMSActions4, useRecordingStreaming as useRecordingStreaming3 } from "@100mslive/react-sdk";
|
896
901
|
import { AddCircleIcon, EndStreamIcon, GoLiveIcon, PencilIcon, SettingsIcon, TrashIcon } from "@100mslive/react-icons";
|
897
902
|
|
@@ -1104,7 +1109,7 @@ var EndRTMP = () => {
|
|
1104
1109
|
const [inProgress, setInProgress] = useState7(false);
|
1105
1110
|
const [error, setError] = useState7("");
|
1106
1111
|
const { isRTMPRunning } = useRecordingStreaming3();
|
1107
|
-
|
1112
|
+
useEffect3(() => {
|
1108
1113
|
if (inProgress && !isRTMPRunning) {
|
1109
1114
|
setInProgress(false);
|
1110
1115
|
}
|
@@ -1258,7 +1263,7 @@ var StartRecording = ({ open, onOpenChange }) => {
|
|
1258
1263
|
return null;
|
1259
1264
|
}
|
1260
1265
|
if (isBrowserRecordingOn) {
|
1261
|
-
return /* @__PURE__ */ React15.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React15.createElement(
|
1266
|
+
return /* @__PURE__ */ React15.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React15.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React15.createElement(
|
1262
1267
|
Dialog.Content,
|
1263
1268
|
{
|
1264
1269
|
css: {
|
@@ -1337,7 +1342,7 @@ var StartRecording = ({ open, onOpenChange }) => {
|
|
1337
1342
|
var StartRecording_default = StartRecording;
|
1338
1343
|
|
1339
1344
|
// src/Prebuilt/components/StatsForNerds.jsx
|
1340
|
-
import React16, { useEffect as
|
1345
|
+
import React16, { useEffect as useEffect4, useMemo, useRef as useRef3, useState as useState9 } from "react";
|
1341
1346
|
import {
|
1342
1347
|
selectHMSStats,
|
1343
1348
|
selectLocalPeerID as selectLocalPeerID2,
|
@@ -1358,12 +1363,12 @@ var StatsForNerds = ({ onOpenChange }) => {
|
|
1358
1363
|
const [open, setOpen] = useState9(false);
|
1359
1364
|
const ref = useRef3();
|
1360
1365
|
const selectionBg = useDropdownSelection();
|
1361
|
-
|
1366
|
+
useEffect4(() => {
|
1362
1367
|
if (selectedStat.id !== "local-peer" && !tracksWithLabels.find((track) => track.id === selectedStat.id)) {
|
1363
1368
|
setSelectedStat("local-peer");
|
1364
1369
|
}
|
1365
1370
|
}, [tracksWithLabels, selectedStat]);
|
1366
|
-
return /* @__PURE__ */ React16.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React16.createElement(
|
1371
|
+
return /* @__PURE__ */ React16.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React16.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React16.createElement(Dialog.Overlay, null), /* @__PURE__ */ React16.createElement(
|
1367
1372
|
Dialog.Content,
|
1368
1373
|
{
|
1369
1374
|
css: {
|
@@ -1622,7 +1627,7 @@ import React18 from "react";
|
|
1622
1627
|
import { ExpandIcon } from "@100mslive/react-icons";
|
1623
1628
|
|
1624
1629
|
// src/Prebuilt/components/hooks/useFullscreen.js
|
1625
|
-
import { useCallback as useCallback4, useEffect as
|
1630
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useState as useState11 } from "react";
|
1626
1631
|
import screenfull from "screenfull";
|
1627
1632
|
var useFullscreen = () => {
|
1628
1633
|
const [isFullScreenEnabled, setIsFullScreenEnabled] = useState11(screenfull.isFullscreen);
|
@@ -1641,7 +1646,7 @@ var useFullscreen = () => {
|
|
1641
1646
|
ToastManager.addToast({ title: err.message });
|
1642
1647
|
}
|
1643
1648
|
}), [isFullScreenEnabled]);
|
1644
|
-
|
1649
|
+
useEffect5(() => {
|
1645
1650
|
const onChange = () => {
|
1646
1651
|
setIsFullScreenEnabled(screenfull.isFullscreen);
|
1647
1652
|
};
|
@@ -1875,20 +1880,20 @@ var DesktopOptions = ({
|
|
1875
1880
|
};
|
1876
1881
|
|
1877
1882
|
// src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx
|
1878
|
-
import
|
1883
|
+
import React24, { useRef as useRef5, useState as useState15 } from "react";
|
1879
1884
|
import { useClickAway } from "react-use";
|
1880
1885
|
import {
|
1881
1886
|
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
1882
1887
|
selectPeerCount,
|
1883
1888
|
selectPermissions as selectPermissions6,
|
1884
1889
|
useAVToggle,
|
1885
|
-
useHMSActions as
|
1886
|
-
useHMSStore as
|
1890
|
+
useHMSActions as useHMSActions10,
|
1891
|
+
useHMSStore as useHMSStore12,
|
1887
1892
|
useRecordingStreaming as useRecordingStreaming5
|
1888
1893
|
} from "@100mslive/react-sdk";
|
1889
1894
|
import {
|
1890
1895
|
BrbIcon as BrbIcon2,
|
1891
|
-
CrossIcon as
|
1896
|
+
CrossIcon as CrossIcon5,
|
1892
1897
|
DragHandleIcon as DragHandleIcon2,
|
1893
1898
|
EmojiIcon as EmojiIcon2,
|
1894
1899
|
HandIcon,
|
@@ -1897,6 +1902,161 @@ import {
|
|
1897
1902
|
RecordIcon as RecordIcon2,
|
1898
1903
|
SettingsIcon as SettingsIcon3
|
1899
1904
|
} from "@100mslive/react-icons";
|
1905
|
+
|
1906
|
+
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
1907
|
+
import React23, { useState as useState14 } from "react";
|
1908
|
+
import { useMedia as useMedia3 } from "react-use";
|
1909
|
+
import { selectLocalPeerName, useHMSActions as useHMSActions9, useHMSStore as useHMSStore11 } from "@100mslive/react-sdk";
|
1910
|
+
|
1911
|
+
// src/Prebuilt/components/MoreSettings/ChangeNameContent.jsx
|
1912
|
+
import React22 from "react";
|
1913
|
+
import { ChevronLeftIcon as ChevronLeftIcon2, CrossIcon as CrossIcon4 } from "@100mslive/react-icons";
|
1914
|
+
var ChangeNameContent = ({
|
1915
|
+
changeName,
|
1916
|
+
setCurrentName,
|
1917
|
+
currentName,
|
1918
|
+
localPeerName,
|
1919
|
+
isMobile,
|
1920
|
+
onExit,
|
1921
|
+
onBackClick
|
1922
|
+
}) => {
|
1923
|
+
return /* @__PURE__ */ React22.createElement(
|
1924
|
+
"form",
|
1925
|
+
{
|
1926
|
+
onSubmit: (e) => __async(void 0, null, function* () {
|
1927
|
+
e.preventDefault();
|
1928
|
+
yield changeName();
|
1929
|
+
})
|
1930
|
+
},
|
1931
|
+
/* @__PURE__ */ React22.createElement(
|
1932
|
+
Text,
|
1933
|
+
{
|
1934
|
+
variant: isMobile ? "md" : "lg",
|
1935
|
+
css: {
|
1936
|
+
color: "$on_surface_high",
|
1937
|
+
fontWeight: "$semiBold",
|
1938
|
+
display: "flex",
|
1939
|
+
pb: "$4",
|
1940
|
+
"@md": { px: "$8", borderBottom: "1px solid $border_default" }
|
1941
|
+
}
|
1942
|
+
},
|
1943
|
+
isMobile ? /* @__PURE__ */ React22.createElement(ChevronLeftIcon2, { onClick: onBackClick, style: { marginRight: "0.5rem" } }) : null,
|
1944
|
+
"Change Name",
|
1945
|
+
/* @__PURE__ */ React22.createElement(
|
1946
|
+
Box,
|
1947
|
+
{
|
1948
|
+
css: { color: "inherit", ml: "auto", "&:hover": { color: "$on_surface_medium", cursor: "pointer" } },
|
1949
|
+
onClick: onExit
|
1950
|
+
},
|
1951
|
+
/* @__PURE__ */ React22.createElement(CrossIcon4, null)
|
1952
|
+
)
|
1953
|
+
),
|
1954
|
+
/* @__PURE__ */ React22.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."),
|
1955
|
+
/* @__PURE__ */ React22.createElement(Flex, { justify: "center", align: "center", css: { my: "$8", w: "100%", "@md": { px: "$8" } } }, /* @__PURE__ */ React22.createElement(
|
1956
|
+
Input,
|
1957
|
+
{
|
1958
|
+
css: { width: "100%", bg: "$surface_default" },
|
1959
|
+
value: currentName,
|
1960
|
+
type: isMobile ? "search" : "text",
|
1961
|
+
onChange: (e) => {
|
1962
|
+
setCurrentName(e.target.value);
|
1963
|
+
},
|
1964
|
+
autoComplete: "name",
|
1965
|
+
required: true,
|
1966
|
+
"data-testid": "change_name_field",
|
1967
|
+
onKeyDown: (e) => __async(void 0, null, function* () {
|
1968
|
+
if (e.key === "Enter" && currentName.trim().length > 0 && currentName !== localPeerName) {
|
1969
|
+
e.preventDefault();
|
1970
|
+
if (isMobile) {
|
1971
|
+
return;
|
1972
|
+
}
|
1973
|
+
changeName();
|
1974
|
+
}
|
1975
|
+
})
|
1976
|
+
}
|
1977
|
+
)),
|
1978
|
+
/* @__PURE__ */ React22.createElement(
|
1979
|
+
Flex,
|
1980
|
+
{
|
1981
|
+
justify: "between",
|
1982
|
+
align: "center",
|
1983
|
+
css: {
|
1984
|
+
width: "100%",
|
1985
|
+
gap: "$md",
|
1986
|
+
mt: "$10",
|
1987
|
+
"@md": { px: "$4" }
|
1988
|
+
}
|
1989
|
+
},
|
1990
|
+
isMobile ? null : /* @__PURE__ */ React22.createElement(
|
1991
|
+
Button,
|
1992
|
+
{
|
1993
|
+
variant: "standard",
|
1994
|
+
css: { w: "100%" },
|
1995
|
+
outlined: true,
|
1996
|
+
type: "submit",
|
1997
|
+
disabled: !localPeerName,
|
1998
|
+
onClick: onExit
|
1999
|
+
},
|
2000
|
+
"Cancel"
|
2001
|
+
),
|
2002
|
+
/* @__PURE__ */ React22.createElement(
|
2003
|
+
Button,
|
2004
|
+
{
|
2005
|
+
variant: "primary",
|
2006
|
+
css: { width: "100%" },
|
2007
|
+
type: "submit",
|
2008
|
+
disabled: !currentName.trim() || currentName.trim() === localPeerName,
|
2009
|
+
"data-testid": "popup_change_btn"
|
2010
|
+
},
|
2011
|
+
"Change"
|
2012
|
+
)
|
2013
|
+
)
|
2014
|
+
);
|
2015
|
+
};
|
2016
|
+
|
2017
|
+
// src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx
|
2018
|
+
var ChangeNameModal = ({ onOpenChange, openParentSheet = null }) => {
|
2019
|
+
const [previewPreference, setPreviewPreference] = useUserPreferences(UserPreferencesKeys.PREVIEW);
|
2020
|
+
const hmsActions = useHMSActions9();
|
2021
|
+
const localPeerName = useHMSStore11(selectLocalPeerName);
|
2022
|
+
const [currentName, setCurrentName] = useState14(localPeerName);
|
2023
|
+
const isMobile = useMedia3(config.media.md);
|
2024
|
+
const changeName = () => __async(void 0, null, function* () {
|
2025
|
+
const name = currentName.trim();
|
2026
|
+
if (!name || name === localPeerName) {
|
2027
|
+
return;
|
2028
|
+
}
|
2029
|
+
try {
|
2030
|
+
yield hmsActions.changeName(name);
|
2031
|
+
setPreviewPreference(__spreadProps(__spreadValues({}, previewPreference || {}), {
|
2032
|
+
name
|
2033
|
+
}));
|
2034
|
+
} catch (error) {
|
2035
|
+
console.error("failed to update name", error);
|
2036
|
+
ToastManager.addToast({ title: error.message });
|
2037
|
+
} finally {
|
2038
|
+
onOpenChange(false);
|
2039
|
+
}
|
2040
|
+
});
|
2041
|
+
const props = {
|
2042
|
+
changeName,
|
2043
|
+
setCurrentName,
|
2044
|
+
currentName,
|
2045
|
+
localPeerName,
|
2046
|
+
isMobile,
|
2047
|
+
onExit: () => onOpenChange(false),
|
2048
|
+
onBackClick: () => {
|
2049
|
+
onOpenChange(false);
|
2050
|
+
openParentSheet();
|
2051
|
+
}
|
2052
|
+
};
|
2053
|
+
if (isMobile) {
|
2054
|
+
return /* @__PURE__ */ React23.createElement(Sheet.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React23.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$8 0" } }, /* @__PURE__ */ React23.createElement(ChangeNameContent, __spreadValues({}, props))));
|
2055
|
+
}
|
2056
|
+
return /* @__PURE__ */ React23.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React23.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React23.createElement(Dialog.Overlay, null), /* @__PURE__ */ React23.createElement(Dialog.Content, { css: { bg: "$surface_dim", width: "min(400px,80%)", p: "$10" } }, /* @__PURE__ */ React23.createElement(ChangeNameContent, __spreadValues({}, props)))));
|
2057
|
+
};
|
2058
|
+
|
2059
|
+
// src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx
|
1900
2060
|
var MODALS2 = {
|
1901
2061
|
CHANGE_NAME: "changeName",
|
1902
2062
|
SELF_ROLE_CHANGE: "selfRoleChange",
|
@@ -1912,18 +2072,18 @@ var MwebOptions = ({
|
|
1912
2072
|
elements,
|
1913
2073
|
screenType
|
1914
2074
|
}) => {
|
1915
|
-
const hmsActions =
|
1916
|
-
const permissions =
|
1917
|
-
const isConnected =
|
2075
|
+
const hmsActions = useHMSActions10();
|
2076
|
+
const permissions = useHMSStore12(selectPermissions6);
|
2077
|
+
const isConnected = useHMSStore12(selectIsConnectedToRoom5);
|
1918
2078
|
const { isBrowserRecordingOn, isStreamingOn, isHLSRunning } = useRecordingStreaming5();
|
1919
|
-
const [openModals, setOpenModals] =
|
1920
|
-
const [openOptionsSheet, setOpenOptionsSheet] =
|
1921
|
-
const [openSettingsSheet, setOpenSettingsSheet] =
|
1922
|
-
const [showEmojiCard, setShowEmojiCard] =
|
1923
|
-
const [showRecordingOn, setShowRecordingOn] =
|
1924
|
-
const [isRecordingLoading, setIsRecordingLoading] =
|
2079
|
+
const [openModals, setOpenModals] = useState15(/* @__PURE__ */ new Set());
|
2080
|
+
const [openOptionsSheet, setOpenOptionsSheet] = useState15(false);
|
2081
|
+
const [openSettingsSheet, setOpenSettingsSheet] = useState15(false);
|
2082
|
+
const [showEmojiCard, setShowEmojiCard] = useState15(false);
|
2083
|
+
const [showRecordingOn, setShowRecordingOn] = useState15(false);
|
2084
|
+
const [isRecordingLoading, setIsRecordingLoading] = useState15(false);
|
1925
2085
|
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
1926
|
-
const peerCount =
|
2086
|
+
const peerCount = useHMSStore12(selectPeerCount);
|
1927
2087
|
const emojiCardRef = useRef5(null);
|
1928
2088
|
const { isBRBOn, toggleBRB, isHandRaised, toggleHandRaise } = useMyMetadata();
|
1929
2089
|
const { toggleAudio, toggleVideo } = useAVToggle();
|
@@ -1941,7 +2101,7 @@ var MwebOptions = ({
|
|
1941
2101
|
});
|
1942
2102
|
};
|
1943
2103
|
useClickAway(emojiCardRef, () => setShowEmojiCard(false));
|
1944
|
-
return /* @__PURE__ */
|
2104
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(Sheet.Root, { open: openOptionsSheet, onOpenChange: setOpenOptionsSheet }, /* @__PURE__ */ React24.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React24.createElement(Sheet.Trigger, { asChild: true, "data-testid": "more_settings_btn" }, /* @__PURE__ */ React24.createElement(IconButton_default, null, /* @__PURE__ */ React24.createElement(DragHandleIcon2, null)))), /* @__PURE__ */ React24.createElement(Sheet.Content, { css: { bg: "$surface_dim", pb: "$14" } }, /* @__PURE__ */ React24.createElement(
|
1945
2105
|
Sheet.Title,
|
1946
2106
|
{
|
1947
2107
|
css: {
|
@@ -1959,8 +2119,8 @@ var MwebOptions = ({
|
|
1959
2119
|
}
|
1960
2120
|
},
|
1961
2121
|
"Options",
|
1962
|
-
/* @__PURE__ */
|
1963
|
-
), /* @__PURE__ */
|
2122
|
+
/* @__PURE__ */ React24.createElement(Sheet.Close, null, /* @__PURE__ */ React24.createElement(Box, { css: { color: "$on_surface_high" } }, /* @__PURE__ */ React24.createElement(CrossIcon5, null)))
|
2123
|
+
), /* @__PURE__ */ React24.createElement(
|
1964
2124
|
Box,
|
1965
2125
|
{
|
1966
2126
|
css: {
|
@@ -1972,7 +2132,7 @@ var MwebOptions = ({
|
|
1972
2132
|
px: "$9"
|
1973
2133
|
}
|
1974
2134
|
},
|
1975
|
-
(elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */
|
2135
|
+
(elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */ React24.createElement(
|
1976
2136
|
ActionTile.Root,
|
1977
2137
|
{
|
1978
2138
|
onClick: () => {
|
@@ -1980,11 +2140,11 @@ var MwebOptions = ({
|
|
1980
2140
|
setOpenOptionsSheet(false);
|
1981
2141
|
}
|
1982
2142
|
},
|
1983
|
-
/* @__PURE__ */
|
1984
|
-
/* @__PURE__ */
|
1985
|
-
/* @__PURE__ */
|
2143
|
+
/* @__PURE__ */ React24.createElement(ActionTile.Count, null, getFormattedCount(peerCount)),
|
2144
|
+
/* @__PURE__ */ React24.createElement(PeopleIcon, null),
|
2145
|
+
/* @__PURE__ */ React24.createElement(ActionTile.Title, null, "Participants")
|
1986
2146
|
),
|
1987
|
-
!noAVPermissions ? /* @__PURE__ */
|
2147
|
+
!noAVPermissions ? /* @__PURE__ */ React24.createElement(
|
1988
2148
|
ActionTile.Root,
|
1989
2149
|
{
|
1990
2150
|
active: isHandRaised,
|
@@ -1993,10 +2153,10 @@ var MwebOptions = ({
|
|
1993
2153
|
setOpenOptionsSheet(false);
|
1994
2154
|
}
|
1995
2155
|
},
|
1996
|
-
isHandRaised ? /* @__PURE__ */
|
1997
|
-
/* @__PURE__ */
|
2156
|
+
isHandRaised ? /* @__PURE__ */ React24.createElement(HandRaiseSlashedIcon, null) : /* @__PURE__ */ React24.createElement(HandIcon, null),
|
2157
|
+
/* @__PURE__ */ React24.createElement(ActionTile.Title, null, isHandRaised ? "Lower" : "Raise", " Hand")
|
1998
2158
|
) : null,
|
1999
|
-
(elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */
|
2159
|
+
(elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */ React24.createElement(
|
2000
2160
|
ActionTile.Root,
|
2001
2161
|
{
|
2002
2162
|
onClick: () => {
|
@@ -2004,10 +2164,10 @@ var MwebOptions = ({
|
|
2004
2164
|
setOpenOptionsSheet(false);
|
2005
2165
|
}
|
2006
2166
|
},
|
2007
|
-
/* @__PURE__ */
|
2008
|
-
/* @__PURE__ */
|
2167
|
+
/* @__PURE__ */ React24.createElement(EmojiIcon2, null),
|
2168
|
+
/* @__PURE__ */ React24.createElement(ActionTile.Title, null, "Emoji Reactions")
|
2009
2169
|
),
|
2010
|
-
(elements == null ? void 0 : elements.brb) && /* @__PURE__ */
|
2170
|
+
(elements == null ? void 0 : elements.brb) && /* @__PURE__ */ React24.createElement(
|
2011
2171
|
ActionTile.Root,
|
2012
2172
|
{
|
2013
2173
|
active: isBRBOn,
|
@@ -2016,10 +2176,10 @@ var MwebOptions = ({
|
|
2016
2176
|
setOpenOptionsSheet(false);
|
2017
2177
|
}
|
2018
2178
|
},
|
2019
|
-
/* @__PURE__ */
|
2020
|
-
/* @__PURE__ */
|
2179
|
+
/* @__PURE__ */ React24.createElement(BrbIcon2, null),
|
2180
|
+
/* @__PURE__ */ React24.createElement(ActionTile.Title, null, "Be Right Back")
|
2021
2181
|
),
|
2022
|
-
/* @__PURE__ */
|
2182
|
+
/* @__PURE__ */ React24.createElement(
|
2023
2183
|
ActionTile.Root,
|
2024
2184
|
{
|
2025
2185
|
onClick: () => {
|
@@ -2027,10 +2187,10 @@ var MwebOptions = ({
|
|
2027
2187
|
setOpenOptionsSheet(false);
|
2028
2188
|
}
|
2029
2189
|
},
|
2030
|
-
/* @__PURE__ */
|
2031
|
-
/* @__PURE__ */
|
2190
|
+
/* @__PURE__ */ React24.createElement(SettingsIcon3, null),
|
2191
|
+
/* @__PURE__ */ React24.createElement(ActionTile.Title, null, "Settings")
|
2032
2192
|
),
|
2033
|
-
isConnected && (permissions == null ? void 0 : permissions.browserRecording) ? /* @__PURE__ */
|
2193
|
+
isConnected && (permissions == null ? void 0 : permissions.browserRecording) ? /* @__PURE__ */ React24.createElement(
|
2034
2194
|
ActionTile.Root,
|
2035
2195
|
{
|
2036
2196
|
disabled: isHLSRunning,
|
@@ -2070,16 +2230,16 @@ var MwebOptions = ({
|
|
2070
2230
|
}
|
2071
2231
|
})
|
2072
2232
|
},
|
2073
|
-
isRecordingLoading ? /* @__PURE__ */
|
2074
|
-
/* @__PURE__ */
|
2233
|
+
isRecordingLoading ? /* @__PURE__ */ React24.createElement(Loading, null) : /* @__PURE__ */ React24.createElement(RecordIcon2, null),
|
2234
|
+
/* @__PURE__ */ React24.createElement(ActionTile.Title, null, isBrowserRecordingOn ? "Recording On" : isRecordingLoading ? "Starting Recording" : "Start Recording")
|
2075
2235
|
) : null
|
2076
|
-
))), /* @__PURE__ */
|
2236
|
+
))), /* @__PURE__ */ React24.createElement(SettingsModal_default, { open: openSettingsSheet, onOpenChange: setOpenSettingsSheet, screenType }), openModals.has(MODALS2.MUTE_ALL) && /* @__PURE__ */ React24.createElement(MuteAllModal, { onOpenChange: (value) => updateState(MODALS2.MUTE_ALL, value), isMobile: true }), openModals.has(MODALS2.CHANGE_NAME) && /* @__PURE__ */ React24.createElement(
|
2077
2237
|
ChangeNameModal,
|
2078
2238
|
{
|
2079
2239
|
onOpenChange: (value) => updateState(MODALS2.CHANGE_NAME, value),
|
2080
2240
|
openParentSheet: () => setOpenOptionsSheet(true)
|
2081
2241
|
}
|
2082
|
-
), showEmojiCard && /* @__PURE__ */
|
2242
|
+
), showEmojiCard && /* @__PURE__ */ React24.createElement(
|
2083
2243
|
Box,
|
2084
2244
|
{
|
2085
2245
|
ref: emojiCardRef,
|
@@ -2098,8 +2258,8 @@ var MwebOptions = ({
|
|
2098
2258
|
mx: "$4"
|
2099
2259
|
}
|
2100
2260
|
},
|
2101
|
-
/* @__PURE__ */
|
2102
|
-
), showRecordingOn && /* @__PURE__ */
|
2261
|
+
/* @__PURE__ */ React24.createElement(EmojiReaction, null)
|
2262
|
+
), showRecordingOn && /* @__PURE__ */ React24.createElement(
|
2103
2263
|
StopRecordingInSheet,
|
2104
2264
|
{
|
2105
2265
|
onClose: () => setShowRecordingOn(false),
|
@@ -2124,37 +2284,27 @@ var MoreSettings = ({
|
|
2124
2284
|
elements,
|
2125
2285
|
screenType
|
2126
2286
|
}) => {
|
2127
|
-
const isMobile =
|
2128
|
-
return isMobile ? /* @__PURE__ */
|
2287
|
+
const isMobile = useMedia4(config.media.md);
|
2288
|
+
return isMobile ? /* @__PURE__ */ React25.createElement(MwebOptions, { elements, screenType }) : /* @__PURE__ */ React25.createElement(DesktopOptions, { elements, screenType });
|
2129
2289
|
};
|
2130
2290
|
|
2131
2291
|
// src/Prebuilt/components/RaiseHand.jsx
|
2132
|
-
import
|
2133
|
-
import { selectHasPeerHandRaised, selectLocalPeerID as selectLocalPeerID4, useHMSActions as useHMSActions10, useHMSStore as useHMSStore12 } from "@100mslive/react-sdk";
|
2292
|
+
import React26 from "react";
|
2134
2293
|
import { HandIcon as HandIcon2 } from "@100mslive/react-icons";
|
2135
2294
|
var RaiseHand = () => {
|
2136
|
-
const
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
IconButton_default,
|
2141
|
-
{
|
2142
|
-
active: !isHandRaised,
|
2143
|
-
onClick: () => {
|
2144
|
-
isHandRaised ? actions.lowerLocalPeerHand() : actions.raiseLocalPeerHand();
|
2145
|
-
}
|
2146
|
-
},
|
2147
|
-
/* @__PURE__ */ React24.createElement(HandIcon2, null)
|
2148
|
-
));
|
2295
|
+
const { isHandRaised, toggleHandRaise } = useMyMetadata();
|
2296
|
+
return /* @__PURE__ */ React26.createElement(Tooltip, { title: isHandRaised ? "Lower hand" : "Raise hand" }, /* @__PURE__ */ React26.createElement(IconButton_default, { active: !isHandRaised, onClick: () => __async(void 0, null, function* () {
|
2297
|
+
return yield toggleHandRaise();
|
2298
|
+
}) }, /* @__PURE__ */ React26.createElement(HandIcon2, null)));
|
2149
2299
|
};
|
2150
2300
|
|
2151
2301
|
// src/Prebuilt/components/ScreenShareToggle.jsx
|
2152
|
-
import
|
2302
|
+
import React33, { Fragment as Fragment6 } from "react";
|
2153
2303
|
import { selectIsAllowedToPublish, useHMSStore as useHMSStore13, useScreenShare as useScreenShare2 } from "@100mslive/react-sdk";
|
2154
2304
|
import { ShareScreenIcon } from "@100mslive/react-icons";
|
2155
2305
|
|
2156
2306
|
// src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx
|
2157
|
-
import
|
2307
|
+
import React32, { Fragment as Fragment5, useState as useState17 } from "react";
|
2158
2308
|
import { useScreenShare } from "@100mslive/react-sdk";
|
2159
2309
|
import { StarIcon, VerticalMenuIcon as VerticalMenuIcon2 } from "@100mslive/react-icons";
|
2160
2310
|
|
@@ -2190,12 +2340,12 @@ var ShareMenuIcon = styled(ScreenShareButton, {
|
|
2190
2340
|
});
|
2191
2341
|
|
2192
2342
|
// src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx
|
2193
|
-
import
|
2343
|
+
import React31, { useState as useState16 } from "react";
|
2194
2344
|
|
2195
2345
|
// src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx
|
2196
|
-
import
|
2346
|
+
import React27 from "react";
|
2197
2347
|
var PDFHeader = () => {
|
2198
|
-
return /* @__PURE__ */
|
2348
|
+
return /* @__PURE__ */ React27.createElement(
|
2199
2349
|
DialogCol,
|
2200
2350
|
{
|
2201
2351
|
align: "start",
|
@@ -2204,8 +2354,8 @@ var PDFHeader = () => {
|
|
2204
2354
|
mb: "$6"
|
2205
2355
|
}
|
2206
2356
|
},
|
2207
|
-
/* @__PURE__ */
|
2208
|
-
/* @__PURE__ */
|
2357
|
+
/* @__PURE__ */ React27.createElement(Dialog.Title, { asChild: true }, /* @__PURE__ */ React27.createElement(Text, { as: "h6", variant: "h6" }, "Share PDF")),
|
2358
|
+
/* @__PURE__ */ React27.createElement(Dialog.Description, { asChild: true }, /* @__PURE__ */ React27.createElement(
|
2209
2359
|
Text,
|
2210
2360
|
{
|
2211
2361
|
variant: "sm",
|
@@ -2219,10 +2369,10 @@ var PDFHeader = () => {
|
|
2219
2369
|
};
|
2220
2370
|
|
2221
2371
|
// src/Prebuilt/components/pdfAnnotator/submitPdf.jsx
|
2222
|
-
import
|
2372
|
+
import React28 from "react";
|
2223
2373
|
var SubmitPDF = ({ pdfFile, onOpenChange }) => {
|
2224
2374
|
const [, setPDFConfig] = useSetAppDataByKey(APP_DATA.pdfConfig);
|
2225
|
-
return /* @__PURE__ */
|
2375
|
+
return /* @__PURE__ */ React28.createElement(
|
2226
2376
|
Flex,
|
2227
2377
|
{
|
2228
2378
|
direction: "row",
|
@@ -2232,7 +2382,7 @@ var SubmitPDF = ({ pdfFile, onOpenChange }) => {
|
|
2232
2382
|
gap: "$8"
|
2233
2383
|
}
|
2234
2384
|
},
|
2235
|
-
/* @__PURE__ */
|
2385
|
+
/* @__PURE__ */ React28.createElement(
|
2236
2386
|
Button,
|
2237
2387
|
{
|
2238
2388
|
variant: "standard",
|
@@ -2245,7 +2395,7 @@ var SubmitPDF = ({ pdfFile, onOpenChange }) => {
|
|
2245
2395
|
},
|
2246
2396
|
"Cancel"
|
2247
2397
|
),
|
2248
|
-
/* @__PURE__ */
|
2398
|
+
/* @__PURE__ */ React28.createElement(
|
2249
2399
|
Button,
|
2250
2400
|
{
|
2251
2401
|
variant: "primary",
|
@@ -2268,14 +2418,14 @@ var SubmitPDF = ({ pdfFile, onOpenChange }) => {
|
|
2268
2418
|
};
|
2269
2419
|
|
2270
2420
|
// src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx
|
2271
|
-
import
|
2421
|
+
import React30 from "react";
|
2272
2422
|
import { TrashIcon as TrashIcon2 } from "@100mslive/react-icons";
|
2273
2423
|
|
2274
2424
|
// src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx
|
2275
|
-
import
|
2425
|
+
import React29 from "react";
|
2276
2426
|
import { InfoIcon as InfoIcon3 } from "@100mslive/react-icons";
|
2277
2427
|
var PDFInfo = () => {
|
2278
|
-
return /* @__PURE__ */
|
2428
|
+
return /* @__PURE__ */ React29.createElement(
|
2279
2429
|
DialogRow,
|
2280
2430
|
{
|
2281
2431
|
css: {
|
@@ -2288,7 +2438,7 @@ var PDFInfo = () => {
|
|
2288
2438
|
minHeight: "$11"
|
2289
2439
|
}
|
2290
2440
|
},
|
2291
|
-
/* @__PURE__ */
|
2441
|
+
/* @__PURE__ */ React29.createElement(
|
2292
2442
|
InfoIcon3,
|
2293
2443
|
{
|
2294
2444
|
width: "64px",
|
@@ -2298,14 +2448,14 @@ var PDFInfo = () => {
|
|
2298
2448
|
}
|
2299
2449
|
}
|
2300
2450
|
),
|
2301
|
-
/* @__PURE__ */
|
2451
|
+
/* @__PURE__ */ React29.createElement(Text, { variant: "caption" }, "On the next screen, ensure you select \u201CThis Tab\u201D and click on share. Only the PDF viewer will be seen by other participants")
|
2302
2452
|
);
|
2303
2453
|
};
|
2304
2454
|
|
2305
2455
|
// src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx
|
2306
2456
|
var UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
2307
2457
|
const [fileName, ext] = pdfFile.name.split(".");
|
2308
|
-
return /* @__PURE__ */
|
2458
|
+
return /* @__PURE__ */ React30.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React30.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React30.createElement(Dialog.Overlay, null), /* @__PURE__ */ React30.createElement(
|
2309
2459
|
Dialog.Content,
|
2310
2460
|
{
|
2311
2461
|
css: {
|
@@ -2315,7 +2465,7 @@ var UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
|
2315
2465
|
bg: "$surface_dim"
|
2316
2466
|
}
|
2317
2467
|
},
|
2318
|
-
/* @__PURE__ */
|
2468
|
+
/* @__PURE__ */ React30.createElement(Flex, { direction: "column" }, /* @__PURE__ */ React30.createElement(PDFHeader, null), /* @__PURE__ */ React30.createElement(
|
2319
2469
|
DialogRow,
|
2320
2470
|
{
|
2321
2471
|
css: {
|
@@ -2337,7 +2487,7 @@ var UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
|
2337
2487
|
mt: "$6"
|
2338
2488
|
}
|
2339
2489
|
},
|
2340
|
-
/* @__PURE__ */
|
2490
|
+
/* @__PURE__ */ React30.createElement(Flex, { direction: "row", css: { flexGrow: "1", maxWidth: "88%" } }, /* @__PURE__ */ React30.createElement(
|
2341
2491
|
Text,
|
2342
2492
|
{
|
2343
2493
|
css: {
|
@@ -2347,8 +2497,8 @@ var UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
|
2347
2497
|
}
|
2348
2498
|
},
|
2349
2499
|
fileName
|
2350
|
-
), /* @__PURE__ */
|
2351
|
-
/* @__PURE__ */
|
2500
|
+
), /* @__PURE__ */ React30.createElement(Text, { css: { whiteSpace: "nowrap" } }, ".", ext)),
|
2501
|
+
/* @__PURE__ */ React30.createElement(
|
2352
2502
|
TrashIcon2,
|
2353
2503
|
{
|
2354
2504
|
onClick: () => setPDFFile(null),
|
@@ -2357,14 +2507,14 @@ var UploadedFile = ({ pdfFile, setPDFFile, onOpenChange }) => {
|
|
2357
2507
|
}
|
2358
2508
|
}
|
2359
2509
|
)
|
2360
|
-
), /* @__PURE__ */
|
2510
|
+
), /* @__PURE__ */ React30.createElement(PDFInfo, null), /* @__PURE__ */ React30.createElement(SubmitPDF, { pdfFile, onOpenChange }))
|
2361
2511
|
)));
|
2362
2512
|
};
|
2363
2513
|
|
2364
2514
|
// src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx
|
2365
2515
|
function PDFFileOptions({ onOpenChange }) {
|
2366
|
-
const [pdfFile, setPDFFile] =
|
2367
|
-
return !pdfFile ? /* @__PURE__ */
|
2516
|
+
const [pdfFile, setPDFFile] = useState16(null);
|
2517
|
+
return !pdfFile ? /* @__PURE__ */ React31.createElement(Dialog.Root, { defaultOpen: true, onOpenChange }, /* @__PURE__ */ React31.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React31.createElement(Dialog.Overlay, null), /* @__PURE__ */ React31.createElement(
|
2368
2518
|
Dialog.Content,
|
2369
2519
|
{
|
2370
2520
|
css: {
|
@@ -2374,7 +2524,7 @@ function PDFFileOptions({ onOpenChange }) {
|
|
2374
2524
|
bg: "$surface_dim"
|
2375
2525
|
}
|
2376
2526
|
},
|
2377
|
-
/* @__PURE__ */
|
2527
|
+
/* @__PURE__ */ React31.createElement(Flex, { direction: "column" }, /* @__PURE__ */ React31.createElement(PDFHeader, null), /* @__PURE__ */ React31.createElement(
|
2378
2528
|
DialogInputFile,
|
2379
2529
|
{
|
2380
2530
|
onChange: (target) => {
|
@@ -2384,8 +2534,8 @@ function PDFFileOptions({ onOpenChange }) {
|
|
2384
2534
|
type: "file",
|
2385
2535
|
accept: ".pdf"
|
2386
2536
|
}
|
2387
|
-
), /* @__PURE__ */
|
2388
|
-
))) : /* @__PURE__ */
|
2537
|
+
), /* @__PURE__ */ React31.createElement(SubmitPDF, { pdfFile, onOpenChange }))
|
2538
|
+
))) : /* @__PURE__ */ React31.createElement(UploadedFile, { pdfFile, setPDFFile, onOpenChange });
|
2389
2539
|
}
|
2390
2540
|
|
2391
2541
|
// src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx
|
@@ -2395,7 +2545,7 @@ var MODALS3 = {
|
|
2395
2545
|
PDF_SHARE: "pdfShare"
|
2396
2546
|
};
|
2397
2547
|
function ShareScreenOptions() {
|
2398
|
-
const [openModals, setOpenModals] =
|
2548
|
+
const [openModals, setOpenModals] = useState17(/* @__PURE__ */ new Set());
|
2399
2549
|
const { amIScreenSharing } = useScreenShare();
|
2400
2550
|
const updateState = (modalName, value) => {
|
2401
2551
|
setOpenModals((modals) => {
|
@@ -2409,15 +2559,15 @@ function ShareScreenOptions() {
|
|
2409
2559
|
});
|
2410
2560
|
};
|
2411
2561
|
const { toggleScreenShare } = useScreenShare();
|
2412
|
-
return /* @__PURE__ */
|
2562
|
+
return /* @__PURE__ */ React32.createElement(Fragment5, null, /* @__PURE__ */ React32.createElement(
|
2413
2563
|
Dropdown.Root,
|
2414
2564
|
{
|
2415
2565
|
open: openModals.has(MODALS3.SHARE),
|
2416
2566
|
onOpenChange: (value) => updateState(MODALS3.SHARE, value),
|
2417
2567
|
modal: false
|
2418
2568
|
},
|
2419
|
-
/* @__PURE__ */
|
2420
|
-
/* @__PURE__ */
|
2569
|
+
/* @__PURE__ */ React32.createElement(Dropdown.Trigger, { asChild: true, "data-testid": "sharing_btn", disabled: amIScreenSharing }, /* @__PURE__ */ React32.createElement(ShareMenuIcon, { disabled: amIScreenSharing }, /* @__PURE__ */ React32.createElement(Tooltip, { title: "Share" }, /* @__PURE__ */ React32.createElement(Box, null, /* @__PURE__ */ React32.createElement(VerticalMenuIcon2, null))))),
|
2570
|
+
/* @__PURE__ */ React32.createElement(
|
2421
2571
|
Dropdown.Content,
|
2422
2572
|
{
|
2423
2573
|
sideOffset: 5,
|
@@ -2428,7 +2578,7 @@ function ShareScreenOptions() {
|
|
2428
2578
|
bg: "$surface_dim"
|
2429
2579
|
}
|
2430
2580
|
},
|
2431
|
-
/* @__PURE__ */
|
2581
|
+
/* @__PURE__ */ React32.createElement(
|
2432
2582
|
Dropdown.Item,
|
2433
2583
|
{
|
2434
2584
|
css: {
|
@@ -2443,10 +2593,10 @@ function ShareScreenOptions() {
|
|
2443
2593
|
}
|
2444
2594
|
}
|
2445
2595
|
},
|
2446
|
-
/* @__PURE__ */
|
2447
|
-
/* @__PURE__ */
|
2596
|
+
/* @__PURE__ */ React32.createElement(Text, { variant: "h6" }, "Start Sharing"),
|
2597
|
+
/* @__PURE__ */ React32.createElement(Text, { variant: "sm" }, "Choose what you want to share")
|
2448
2598
|
),
|
2449
|
-
/* @__PURE__ */
|
2599
|
+
/* @__PURE__ */ React32.createElement(
|
2450
2600
|
Dropdown.Item,
|
2451
2601
|
{
|
2452
2602
|
css: {
|
@@ -2454,14 +2604,15 @@ function ShareScreenOptions() {
|
|
2454
2604
|
alignItems: "flex-start",
|
2455
2605
|
gap: "$8",
|
2456
2606
|
px: "$10",
|
2457
|
-
|
2607
|
+
pt: "$6",
|
2608
|
+
pb: "$10",
|
2458
2609
|
"&:hover": {
|
2459
2610
|
bg: "$transparent",
|
2460
2611
|
cursor: "default"
|
2461
2612
|
}
|
2462
2613
|
}
|
2463
2614
|
},
|
2464
|
-
/* @__PURE__ */
|
2615
|
+
/* @__PURE__ */ React32.createElement(
|
2465
2616
|
Flex,
|
2466
2617
|
{
|
2467
2618
|
direction: "column",
|
@@ -2470,7 +2621,7 @@ function ShareScreenOptions() {
|
|
2470
2621
|
gap: "$6"
|
2471
2622
|
}
|
2472
2623
|
},
|
2473
|
-
/* @__PURE__ */
|
2624
|
+
/* @__PURE__ */ React32.createElement(
|
2474
2625
|
IconButton,
|
2475
2626
|
{
|
2476
2627
|
as: "div",
|
@@ -2485,7 +2636,7 @@ function ShareScreenOptions() {
|
|
2485
2636
|
pb: "0"
|
2486
2637
|
}
|
2487
2638
|
},
|
2488
|
-
/* @__PURE__ */
|
2639
|
+
/* @__PURE__ */ React32.createElement(
|
2489
2640
|
"img",
|
2490
2641
|
{
|
2491
2642
|
src: screen_share_default,
|
@@ -2500,7 +2651,7 @@ function ShareScreenOptions() {
|
|
2500
2651
|
}
|
2501
2652
|
)
|
2502
2653
|
),
|
2503
|
-
/* @__PURE__ */
|
2654
|
+
/* @__PURE__ */ React32.createElement(Flex, { direction: "column", align: "center" }, /* @__PURE__ */ React32.createElement(Text, { variant: "body2" }, "Share Screen"), /* @__PURE__ */ React32.createElement(
|
2504
2655
|
Text,
|
2505
2656
|
{
|
2506
2657
|
variant: "caption",
|
@@ -2512,7 +2663,7 @@ function ShareScreenOptions() {
|
|
2512
2663
|
"Share your tab, window or your entire screen"
|
2513
2664
|
))
|
2514
2665
|
),
|
2515
|
-
/* @__PURE__ */
|
2666
|
+
/* @__PURE__ */ React32.createElement(
|
2516
2667
|
Flex,
|
2517
2668
|
{
|
2518
2669
|
direction: "column",
|
@@ -2521,7 +2672,7 @@ function ShareScreenOptions() {
|
|
2521
2672
|
gap: "$6"
|
2522
2673
|
}
|
2523
2674
|
},
|
2524
|
-
/* @__PURE__ */
|
2675
|
+
/* @__PURE__ */ React32.createElement(
|
2525
2676
|
IconButton,
|
2526
2677
|
{
|
2527
2678
|
onClick: () => {
|
@@ -2538,7 +2689,7 @@ function ShareScreenOptions() {
|
|
2538
2689
|
pb: "0"
|
2539
2690
|
}
|
2540
2691
|
},
|
2541
|
-
/* @__PURE__ */
|
2692
|
+
/* @__PURE__ */ React32.createElement(
|
2542
2693
|
"img",
|
2543
2694
|
{
|
2544
2695
|
src: pdf_share_default,
|
@@ -2552,14 +2703,14 @@ function ShareScreenOptions() {
|
|
2552
2703
|
}
|
2553
2704
|
}
|
2554
2705
|
),
|
2555
|
-
/* @__PURE__ */
|
2706
|
+
/* @__PURE__ */ React32.createElement(
|
2556
2707
|
Flex,
|
2557
2708
|
{
|
2558
2709
|
direction: "row",
|
2559
2710
|
align: "center",
|
2560
2711
|
css: {
|
2561
2712
|
position: "absolute",
|
2562
|
-
top: "
|
2713
|
+
top: "35%",
|
2563
2714
|
left: "54%",
|
2564
2715
|
padding: "$2 $4",
|
2565
2716
|
r: "$2",
|
@@ -2568,8 +2719,8 @@ function ShareScreenOptions() {
|
|
2568
2719
|
gap: "$2"
|
2569
2720
|
}
|
2570
2721
|
},
|
2571
|
-
/* @__PURE__ */
|
2572
|
-
/* @__PURE__ */
|
2722
|
+
/* @__PURE__ */ React32.createElement(StarIcon, { height: 14, width: 14 }),
|
2723
|
+
/* @__PURE__ */ React32.createElement(
|
2573
2724
|
Text,
|
2574
2725
|
{
|
2575
2726
|
variant: "xs",
|
@@ -2583,7 +2734,7 @@ function ShareScreenOptions() {
|
|
2583
2734
|
)
|
2584
2735
|
)
|
2585
2736
|
),
|
2586
|
-
/* @__PURE__ */
|
2737
|
+
/* @__PURE__ */ React32.createElement(Flex, { direction: "column", align: "center" }, /* @__PURE__ */ React32.createElement(Text, { variant: "body2" }, "Share PDF"), /* @__PURE__ */ React32.createElement(
|
2587
2738
|
Text,
|
2588
2739
|
{
|
2589
2740
|
variant: "caption",
|
@@ -2595,39 +2746,9 @@ function ShareScreenOptions() {
|
|
2595
2746
|
"Annotate, draw shapes, and more over PDFs"
|
2596
2747
|
))
|
2597
2748
|
)
|
2598
|
-
),
|
2599
|
-
/* @__PURE__ */ React30.createElement(
|
2600
|
-
Dropdown.Item,
|
2601
|
-
{
|
2602
|
-
css: {
|
2603
|
-
px: "$10",
|
2604
|
-
pb: "$10",
|
2605
|
-
pt: "$6",
|
2606
|
-
"&:hover": {
|
2607
|
-
bg: "$transparent",
|
2608
|
-
cursor: "default"
|
2609
|
-
}
|
2610
|
-
}
|
2611
|
-
},
|
2612
|
-
/* @__PURE__ */ React30.createElement(
|
2613
|
-
Button,
|
2614
|
-
{
|
2615
|
-
variant: "standard",
|
2616
|
-
outlined: true,
|
2617
|
-
type: "submit",
|
2618
|
-
onClick: () => {
|
2619
|
-
updateState(MODALS3.SHARE, false);
|
2620
|
-
},
|
2621
|
-
"data-testid": "share_btn",
|
2622
|
-
css: {
|
2623
|
-
w: "100%"
|
2624
|
-
}
|
2625
|
-
},
|
2626
|
-
"Cancel"
|
2627
|
-
)
|
2628
2749
|
)
|
2629
2750
|
)
|
2630
|
-
), openModals.has(MODALS3.PDF_SHARE) && /* @__PURE__ */
|
2751
|
+
), openModals.has(MODALS3.PDF_SHARE) && /* @__PURE__ */ React32.createElement(PDFFileOptions, { onOpenChange: (value) => updateState(MODALS3.PDF_SHARE, value) }));
|
2631
2752
|
}
|
2632
2753
|
|
2633
2754
|
// src/Prebuilt/components/ScreenShareToggle.jsx
|
@@ -2639,7 +2760,7 @@ var ScreenshareToggle = ({ css = {} }) => {
|
|
2639
2760
|
if (!isAllowedToPublish.screen || !isScreenshareSupported()) {
|
2640
2761
|
return null;
|
2641
2762
|
}
|
2642
|
-
return /* @__PURE__ */
|
2763
|
+
return /* @__PURE__ */ React33.createElement(Fragment6, null, /* @__PURE__ */ React33.createElement(Flex, { direction: "row", css: { "@md": { display: "none" } } }, /* @__PURE__ */ React33.createElement(
|
2643
2764
|
ScreenShareButton,
|
2644
2765
|
{
|
2645
2766
|
variant: "standard",
|
@@ -2651,33 +2772,33 @@ var ScreenshareToggle = ({ css = {} }) => {
|
|
2651
2772
|
toggleScreenShare();
|
2652
2773
|
}
|
2653
2774
|
},
|
2654
|
-
/* @__PURE__ */
|
2655
|
-
), /* @__PURE__ */
|
2775
|
+
/* @__PURE__ */ React33.createElement(Tooltip, { title: `${!isVideoScreenshare ? "Start" : "Stop"} screen sharing` }, /* @__PURE__ */ React33.createElement(Box, null, /* @__PURE__ */ React33.createElement(ShareScreenIcon, null)))
|
2776
|
+
), /* @__PURE__ */ React33.createElement(ShareScreenOptions, null)));
|
2656
2777
|
};
|
2657
2778
|
|
2658
2779
|
// src/Prebuilt/components/Footer/ChatToggle.tsx
|
2659
|
-
import
|
2780
|
+
import React34 from "react";
|
2660
2781
|
import { selectUnreadHMSMessagesCount, useHMSStore as useHMSStore14 } from "@100mslive/react-sdk";
|
2661
2782
|
import { ChatIcon, ChatUnreadIcon } from "@100mslive/react-icons";
|
2662
2783
|
var ChatToggle = () => {
|
2663
2784
|
const countUnreadMessages = useHMSStore14(selectUnreadHMSMessagesCount);
|
2664
2785
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
2665
2786
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
2666
|
-
return /* @__PURE__ */
|
2787
|
+
return /* @__PURE__ */ React34.createElement(Tooltip, { key: "chat", title: `${isChatOpen ? "Close" : "Open"} chat` }, /* @__PURE__ */ React34.createElement(IconButton_default, { onClick: toggleChat, active: !isChatOpen, "data-testid": "chat_btn" }, countUnreadMessages === 0 ? /* @__PURE__ */ React34.createElement(ChatIcon, null) : /* @__PURE__ */ React34.createElement(ChatUnreadIcon, { "data-testid": "chat_unread_btn" })));
|
2667
2788
|
};
|
2668
2789
|
|
2669
2790
|
// src/Prebuilt/components/Footer/ParticipantList.jsx
|
2670
|
-
import
|
2671
|
-
import { useDebounce, useMedia as
|
2791
|
+
import React37, { Fragment as Fragment7, useCallback as useCallback7, useEffect as useEffect7, useState as useState20 } from "react";
|
2792
|
+
import { useDebounce, useMedia as useMedia5 } from "react-use";
|
2672
2793
|
import {
|
2673
2794
|
selectHandRaisedPeers,
|
2674
|
-
selectHasPeerHandRaised
|
2795
|
+
selectHasPeerHandRaised,
|
2675
2796
|
selectIsPeerAudioEnabled,
|
2676
|
-
selectLocalPeerID as
|
2797
|
+
selectLocalPeerID as selectLocalPeerID4,
|
2677
2798
|
selectPeerCount as selectPeerCount2,
|
2678
2799
|
selectPeerMetadata,
|
2679
2800
|
selectPermissions as selectPermissions8,
|
2680
|
-
useHMSActions as
|
2801
|
+
useHMSActions as useHMSActions13,
|
2681
2802
|
useHMSStore as useHMSStore16
|
2682
2803
|
} from "@100mslive/react-sdk";
|
2683
2804
|
import {
|
@@ -2691,12 +2812,14 @@ import {
|
|
2691
2812
|
} from "@100mslive/react-icons";
|
2692
2813
|
|
2693
2814
|
// src/Prebuilt/components/Footer/RoleAccordion.tsx
|
2694
|
-
import
|
2815
|
+
import React36, { useCallback as useCallback6, useEffect as useEffect6, useRef as useRef6, useState as useState19 } from "react";
|
2695
2816
|
import { useMeasure } from "react-use";
|
2696
2817
|
import { FixedSizeList } from "react-window";
|
2818
|
+
import { useHMSActions as useHMSActions12 } from "@100mslive/react-sdk";
|
2819
|
+
import { AddCircleIcon as AddCircleIcon2 } from "@100mslive/react-icons";
|
2697
2820
|
|
2698
2821
|
// src/Prebuilt/components/Footer/RoleOptions.tsx
|
2699
|
-
import
|
2822
|
+
import React35, { useState as useState18 } from "react";
|
2700
2823
|
import { selectPermissions as selectPermissions7, useHMSActions as useHMSActions11, useHMSStore as useHMSStore15, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
2701
2824
|
import {
|
2702
2825
|
MicOffIcon as MicOffIcon2,
|
@@ -2710,7 +2833,7 @@ import {
|
|
2710
2833
|
var dropdownItemCSS = { backgroundColor: "$surface_default", gap: "$4", p: "$8" };
|
2711
2834
|
var optionTextCSS = { fontWeight: "$semiBold", color: "$on_surface_high", textTransform: "none" };
|
2712
2835
|
var RoleOptions = ({ roleName, peerList }) => {
|
2713
|
-
const [openOptions, setOpenOptions] =
|
2836
|
+
const [openOptions, setOpenOptions] = useState18(false);
|
2714
2837
|
const permissions = useHMSStore15(selectPermissions7);
|
2715
2838
|
const hmsActions = useHMSActions11();
|
2716
2839
|
const { elements } = useRoomLayoutConferencingScreen();
|
@@ -2756,7 +2879,7 @@ var RoleOptions = ({ roleName, peerList }) => {
|
|
2756
2879
|
console.error(e);
|
2757
2880
|
}
|
2758
2881
|
});
|
2759
|
-
return /* @__PURE__ */
|
2882
|
+
return /* @__PURE__ */ React35.createElement(Dropdown.Root, { open: openOptions, onOpenChange: setOpenOptions }, /* @__PURE__ */ React35.createElement(
|
2760
2883
|
Dropdown.Trigger,
|
2761
2884
|
{
|
2762
2885
|
onClick: (e) => e.stopPropagation(),
|
@@ -2775,40 +2898,40 @@ var RoleOptions = ({ roleName, peerList }) => {
|
|
2775
2898
|
}
|
2776
2899
|
}
|
2777
2900
|
},
|
2778
|
-
/* @__PURE__ */
|
2779
|
-
), /* @__PURE__ */
|
2901
|
+
/* @__PURE__ */ React35.createElement(Flex, null, /* @__PURE__ */ React35.createElement(VerticalMenuIcon3, null))
|
2902
|
+
), /* @__PURE__ */ React35.createElement(
|
2780
2903
|
Dropdown.Content,
|
2781
2904
|
{
|
2782
2905
|
onClick: (e) => e.stopPropagation(),
|
2783
2906
|
css: { w: "max-content", maxWidth: "$64", bg: "$surface_default", py: 0 },
|
2784
2907
|
align: "end"
|
2785
2908
|
},
|
2786
|
-
canRemoveRoleFromStage && /* @__PURE__ */
|
2909
|
+
canRemoveRoleFromStage && /* @__PURE__ */ React35.createElement(
|
2787
2910
|
Dropdown.Item,
|
2788
2911
|
{
|
2789
2912
|
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderBottom: "1px solid $border_bright" }),
|
2790
2913
|
onClick: removeAllFromStage
|
2791
2914
|
},
|
2792
|
-
/* @__PURE__ */
|
2793
|
-
/* @__PURE__ */
|
2915
|
+
/* @__PURE__ */ React35.createElement(PersonRectangleIcon, null),
|
2916
|
+
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: optionTextCSS }, "Remove all from Stage")
|
2794
2917
|
),
|
2795
|
-
canMuteRole && /* @__PURE__ */
|
2918
|
+
canMuteRole && /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: dropdownItemCSS, onClick: () => setTrackEnabled("audio", !allPeersHaveAudioOn) }, allPeersHaveAudioOn ? /* @__PURE__ */ React35.createElement(MicOffIcon2, null) : /* @__PURE__ */ React35.createElement(MicOnIcon, null), /* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: optionTextCSS }, allPeersHaveAudioOn ? "Mute" : "Unmute", " Audio")), /* @__PURE__ */ React35.createElement(
|
2796
2919
|
Dropdown.Item,
|
2797
2920
|
{
|
2798
2921
|
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderTop: "1px solid $border_bright" }),
|
2799
2922
|
onClick: () => setTrackEnabled("video", !allPeersHaveVideoOn)
|
2800
2923
|
},
|
2801
|
-
allPeersHaveVideoOn ? /* @__PURE__ */
|
2802
|
-
/* @__PURE__ */
|
2924
|
+
allPeersHaveVideoOn ? /* @__PURE__ */ React35.createElement(VideoOffIcon, null) : /* @__PURE__ */ React35.createElement(VideoOnIcon, null),
|
2925
|
+
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: optionTextCSS }, allPeersHaveVideoOn ? "Mute" : "Unmute", " Video")
|
2803
2926
|
)),
|
2804
|
-
canRemoveRoleFromRoom && /* @__PURE__ */
|
2927
|
+
canRemoveRoleFromRoom && /* @__PURE__ */ React35.createElement(
|
2805
2928
|
Dropdown.Item,
|
2806
2929
|
{
|
2807
2930
|
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderTop: "1px solid $border_bright", color: "$alert_error_default" }),
|
2808
2931
|
onClick: removePeersFromRoom
|
2809
2932
|
},
|
2810
|
-
/* @__PURE__ */
|
2811
|
-
/* @__PURE__ */
|
2933
|
+
/* @__PURE__ */ React35.createElement(RemoveUserIcon, null),
|
2934
|
+
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: __spreadProps(__spreadValues({}, optionTextCSS), { color: "inherit" }) }, "Remove all from Room")
|
2812
2935
|
)
|
2813
2936
|
));
|
2814
2937
|
};
|
@@ -2818,8 +2941,8 @@ var ROW_HEIGHT = 50;
|
|
2818
2941
|
function itemKey(index, data3) {
|
2819
2942
|
return data3.peerList[index].id;
|
2820
2943
|
}
|
2821
|
-
var VirtualizedParticipantItem =
|
2822
|
-
return /* @__PURE__ */
|
2944
|
+
var VirtualizedParticipantItem = React36.memo(({ index, data: data3 }) => {
|
2945
|
+
return /* @__PURE__ */ React36.createElement(Participant, { key: data3.peerList[index].id, peer: data3.peerList[index], isConnected: data3.isConnected });
|
2823
2946
|
});
|
2824
2947
|
var RoleAccordion = ({
|
2825
2948
|
peerList = [],
|
@@ -2829,12 +2952,29 @@ var RoleAccordion = ({
|
|
2829
2952
|
isHandRaisedAccordion = false
|
2830
2953
|
}) => {
|
2831
2954
|
const [ref, { width }] = useMeasure();
|
2955
|
+
const actions = useHMSActions12();
|
2832
2956
|
const showAcordion = (filter == null ? void 0 : filter.search) ? peerList.some((peer) => peer.name.toLowerCase().includes(filter.search)) : true;
|
2833
|
-
|
2957
|
+
const [hasNext, setHasNext] = useState19(false);
|
2958
|
+
const iteratorRef = useRef6(null);
|
2959
|
+
const loadNext = useCallback6(() => {
|
2960
|
+
if (!roleName || roleName === "Hand Raised") {
|
2961
|
+
return;
|
2962
|
+
}
|
2963
|
+
if (!iteratorRef.current) {
|
2964
|
+
iteratorRef.current = actions.getPeerListIterator({ role: roleName });
|
2965
|
+
}
|
2966
|
+
iteratorRef.current.next().catch(console.error).finally(() => {
|
2967
|
+
setHasNext(iteratorRef.current ? iteratorRef.current.hasNext() : false);
|
2968
|
+
});
|
2969
|
+
}, [actions, roleName]);
|
2970
|
+
useEffect6(() => {
|
2971
|
+
loadNext();
|
2972
|
+
}, [loadNext]);
|
2973
|
+
if (!showAcordion || isHandRaisedAccordion && (filter == null ? void 0 : filter.search) || peerList.length === 0 && (filter == null ? void 0 : filter.search)) {
|
2834
2974
|
return null;
|
2835
2975
|
}
|
2836
2976
|
const height = ROW_HEIGHT * peerList.length;
|
2837
|
-
return /* @__PURE__ */
|
2977
|
+
return /* @__PURE__ */ React36.createElement(Flex, { direction: "column", css: { "&:hover .role_actions": { visibility: "visible" } }, ref }, /* @__PURE__ */ React36.createElement(
|
2838
2978
|
Accordion.Root,
|
2839
2979
|
{
|
2840
2980
|
type: "single",
|
@@ -2842,7 +2982,7 @@ var RoleAccordion = ({
|
|
2842
2982
|
defaultValue: roleName,
|
2843
2983
|
css: { borderRadius: "$1", border: "1px solid $border_bright" }
|
2844
2984
|
},
|
2845
|
-
/* @__PURE__ */
|
2985
|
+
/* @__PURE__ */ React36.createElement(Accordion.Item, { value: roleName }, /* @__PURE__ */ React36.createElement(
|
2846
2986
|
Accordion.Header,
|
2847
2987
|
{
|
2848
2988
|
iconStyles: { c: "$on_surface_high" },
|
@@ -2854,7 +2994,7 @@ var RoleAccordion = ({
|
|
2854
2994
|
c: "$on_surface_medium"
|
2855
2995
|
}
|
2856
2996
|
},
|
2857
|
-
/* @__PURE__ */
|
2997
|
+
/* @__PURE__ */ React36.createElement(Flex, { justify: "between", css: { flexGrow: 1, pr: "$6" } }, /* @__PURE__ */ React36.createElement(
|
2858
2998
|
Text,
|
2859
2999
|
{
|
2860
3000
|
variant: "sm",
|
@@ -2863,8 +3003,8 @@ var RoleAccordion = ({
|
|
2863
3003
|
roleName,
|
2864
3004
|
" ",
|
2865
3005
|
`(${getFormattedCount(peerList.length)})`
|
2866
|
-
), /* @__PURE__ */
|
2867
|
-
), /* @__PURE__ */
|
3006
|
+
), /* @__PURE__ */ React36.createElement(RoleOptions, { roleName, peerList }))
|
3007
|
+
), /* @__PURE__ */ React36.createElement(Accordion.Content, null, /* @__PURE__ */ React36.createElement(Box, { css: { borderTop: "1px solid $border_default" } }), /* @__PURE__ */ React36.createElement(
|
2868
3008
|
FixedSizeList,
|
2869
3009
|
{
|
2870
3010
|
itemSize: ROW_HEIGHT,
|
@@ -2875,13 +3015,28 @@ var RoleAccordion = ({
|
|
2875
3015
|
height
|
2876
3016
|
},
|
2877
3017
|
VirtualizedParticipantItem
|
2878
|
-
)
|
3018
|
+
), hasNext ? /* @__PURE__ */ React36.createElement(
|
3019
|
+
Chip_default,
|
3020
|
+
{
|
3021
|
+
icon: /* @__PURE__ */ React36.createElement(AddCircleIcon2, null),
|
3022
|
+
content: "Load More",
|
3023
|
+
onClick: loadNext,
|
3024
|
+
backgroundColor: "$secondary_default",
|
3025
|
+
css: {
|
3026
|
+
w: "max-content",
|
3027
|
+
borderRadius: "$size$9",
|
3028
|
+
m: "$2 auto",
|
3029
|
+
p: "$4",
|
3030
|
+
cursor: "pointer"
|
3031
|
+
}
|
3032
|
+
}
|
3033
|
+
) : null))
|
2879
3034
|
));
|
2880
3035
|
};
|
2881
3036
|
|
2882
3037
|
// src/Prebuilt/components/Footer/ParticipantList.jsx
|
2883
3038
|
var ParticipantList = () => {
|
2884
|
-
const [filter, setFilter] =
|
3039
|
+
const [filter, setFilter] = useState20();
|
2885
3040
|
const { participants, isConnected, peerCount } = useParticipants(filter);
|
2886
3041
|
const peersOrderedByRoles = {};
|
2887
3042
|
const handRaisedPeers = useHMSStore16(selectHandRaisedPeers);
|
@@ -2891,7 +3046,7 @@ var ParticipantList = () => {
|
|
2891
3046
|
}
|
2892
3047
|
peersOrderedByRoles[participant.roleName].push(participant);
|
2893
3048
|
});
|
2894
|
-
const onSearch =
|
3049
|
+
const onSearch = useCallback7((value) => {
|
2895
3050
|
setFilter((filterValue) => {
|
2896
3051
|
if (!filterValue) {
|
2897
3052
|
filterValue = {};
|
@@ -2903,7 +3058,7 @@ var ParticipantList = () => {
|
|
2903
3058
|
if (peerCount === 0) {
|
2904
3059
|
return null;
|
2905
3060
|
}
|
2906
|
-
return /* @__PURE__ */
|
3061
|
+
return /* @__PURE__ */ React37.createElement(Fragment7, null, /* @__PURE__ */ React37.createElement(Flex, { direction: "column", css: { size: "100%", gap: "$4" } }, !(filter == null ? void 0 : filter.search) && participants.length === 0 ? null : /* @__PURE__ */ React37.createElement(ParticipantSearch, { onSearch, inSidePane: true }), participants.length === 0 ? /* @__PURE__ */ React37.createElement(Flex, { align: "center", justify: "center", css: { w: "100%", p: "$8 0" } }, /* @__PURE__ */ React37.createElement(Text, { variant: "sm" }, !filter ? "No participants" : "No matching participants")) : null, /* @__PURE__ */ React37.createElement(
|
2907
3062
|
VirtualizedParticipants,
|
2908
3063
|
{
|
2909
3064
|
peersOrderedByRoles,
|
@@ -2917,7 +3072,7 @@ var ParticipantCount = () => {
|
|
2917
3072
|
const peerCount = useHMSStore16(selectPeerCount2);
|
2918
3073
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
2919
3074
|
const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
2920
|
-
|
3075
|
+
useEffect7(() => {
|
2921
3076
|
if (isParticipantsOpen && peerCount === 0) {
|
2922
3077
|
toggleSidepane();
|
2923
3078
|
}
|
@@ -2925,7 +3080,7 @@ var ParticipantCount = () => {
|
|
2925
3080
|
if (peerCount === 0) {
|
2926
3081
|
return null;
|
2927
3082
|
}
|
2928
|
-
return /* @__PURE__ */
|
3083
|
+
return /* @__PURE__ */ React37.createElement(
|
2929
3084
|
IconButton_default,
|
2930
3085
|
{
|
2931
3086
|
css: {
|
@@ -2941,12 +3096,12 @@ var ParticipantCount = () => {
|
|
2941
3096
|
active: !isParticipantsOpen,
|
2942
3097
|
"data-testid": "participant_list"
|
2943
3098
|
},
|
2944
|
-
/* @__PURE__ */
|
2945
|
-
/* @__PURE__ */
|
3099
|
+
/* @__PURE__ */ React37.createElement(PeopleIcon2, null),
|
3100
|
+
/* @__PURE__ */ React37.createElement(Text, { variant: "sm", css: { mx: "$4", c: "inherit" } }, getFormattedCount(peerCount))
|
2946
3101
|
);
|
2947
3102
|
};
|
2948
3103
|
var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter, handRaisedList = [] }) => {
|
2949
|
-
return /* @__PURE__ */
|
3104
|
+
return /* @__PURE__ */ React37.createElement(
|
2950
3105
|
Flex,
|
2951
3106
|
{
|
2952
3107
|
direction: "column",
|
@@ -2959,7 +3114,7 @@ var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter,
|
|
2959
3114
|
flex: "1 1 0"
|
2960
3115
|
}
|
2961
3116
|
},
|
2962
|
-
/* @__PURE__ */
|
3117
|
+
handRaisedList.length > 0 ? /* @__PURE__ */ React37.createElement(
|
2963
3118
|
RoleAccordion,
|
2964
3119
|
{
|
2965
3120
|
peerList: handRaisedList,
|
@@ -2968,8 +3123,8 @@ var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter,
|
|
2968
3123
|
isConnected,
|
2969
3124
|
isHandRaisedAccordion: true
|
2970
3125
|
}
|
2971
|
-
),
|
2972
|
-
Object.keys(peersOrderedByRoles).map((role) => /* @__PURE__ */
|
3126
|
+
) : null,
|
3127
|
+
Object.keys(peersOrderedByRoles).map((role) => /* @__PURE__ */ React37.createElement(
|
2973
3128
|
RoleAccordion,
|
2974
3129
|
{
|
2975
3130
|
key: role,
|
@@ -2982,8 +3137,8 @@ var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter,
|
|
2982
3137
|
);
|
2983
3138
|
};
|
2984
3139
|
var Participant = ({ peer, isConnected }) => {
|
2985
|
-
const localPeerId = useHMSStore16(
|
2986
|
-
return /* @__PURE__ */
|
3140
|
+
const localPeerId = useHMSStore16(selectLocalPeerID4);
|
3141
|
+
return /* @__PURE__ */ React37.createElement(
|
2987
3142
|
Flex,
|
2988
3143
|
{
|
2989
3144
|
key: peer.id,
|
@@ -2998,17 +3153,20 @@ var Participant = ({ peer, isConnected }) => {
|
|
2998
3153
|
justify: "between",
|
2999
3154
|
"data-testid": "participant_" + peer.name
|
3000
3155
|
},
|
3001
|
-
/* @__PURE__ */
|
3002
|
-
isConnected ? /* @__PURE__ */
|
3156
|
+
/* @__PURE__ */ React37.createElement(Text, { variant: "sm", css: __spreadProps(__spreadValues({}, textEllipsis(150)), { fontWeight: "$semiBold", color: "$on_surface_high" }) }, peer.name, " ", localPeerId === peer.id ? "(You)" : ""),
|
3157
|
+
isConnected ? /* @__PURE__ */ React37.createElement(ParticipantActions, { peerId: peer.id, isLocal: peer.id === localPeerId, role: peer.roleName }) : null
|
3003
3158
|
);
|
3004
3159
|
};
|
3005
|
-
var ParticipantActions =
|
3006
|
-
var _a;
|
3007
|
-
const isHandRaised = useHMSStore16(
|
3160
|
+
var ParticipantActions = React37.memo(({ peerId, role, isLocal }) => {
|
3161
|
+
var _a, _b;
|
3162
|
+
const isHandRaised = useHMSStore16(selectHasPeerHandRaised(peerId));
|
3008
3163
|
const canChangeRole = (_a = useHMSStore16(selectPermissions8)) == null ? void 0 : _a.changeRole;
|
3009
|
-
const
|
3164
|
+
const canRemoveOthers = (_b = useHMSStore16(selectPermissions8)) == null ? void 0 : _b.removeOthers;
|
3165
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
3166
|
+
const { on_stage_exp } = elements || {};
|
3167
|
+
const shouldShowMoreActions = on_stage_exp && canChangeRole || canRemoveOthers;
|
3010
3168
|
const isAudioMuted = !useHMSStore16(selectIsPeerAudioEnabled(peerId));
|
3011
|
-
return /* @__PURE__ */
|
3169
|
+
return /* @__PURE__ */ React37.createElement(
|
3012
3170
|
Flex,
|
3013
3171
|
{
|
3014
3172
|
align: "center",
|
@@ -3017,33 +3175,40 @@ var ParticipantActions = React35.memo(({ peerId, role, isLocal }) => {
|
|
3017
3175
|
gap: "$8"
|
3018
3176
|
}
|
3019
3177
|
},
|
3020
|
-
/* @__PURE__ */
|
3021
|
-
isHandRaised && /* @__PURE__ */
|
3178
|
+
/* @__PURE__ */ React37.createElement(ConnectionIndicator, { peerId }),
|
3179
|
+
isHandRaised && /* @__PURE__ */ React37.createElement(
|
3022
3180
|
Flex,
|
3023
3181
|
{
|
3024
3182
|
align: "center",
|
3025
3183
|
justify: "center",
|
3026
3184
|
css: { p: "$1", c: "$on_surface_high", bg: "$surface_bright", borderRadius: "$round" }
|
3027
3185
|
},
|
3028
|
-
/* @__PURE__ */
|
3186
|
+
/* @__PURE__ */ React37.createElement(HandIcon3, { height: 19, width: 19 })
|
3029
3187
|
),
|
3030
|
-
isAudioMuted ? /* @__PURE__ */
|
3188
|
+
isAudioMuted ? /* @__PURE__ */ React37.createElement(
|
3031
3189
|
Flex,
|
3032
3190
|
{
|
3033
3191
|
align: "center",
|
3034
3192
|
justify: "center",
|
3035
3193
|
css: { p: "$2", c: "$on_surface_high", bg: "$surface_bright", borderRadius: "$round" }
|
3036
3194
|
},
|
3037
|
-
/* @__PURE__ */
|
3195
|
+
/* @__PURE__ */ React37.createElement(MicOffIcon3, { height: 19, width: 19 })
|
3038
3196
|
) : null,
|
3039
|
-
shouldShowMoreActions && !isLocal ? /* @__PURE__ */
|
3197
|
+
shouldShowMoreActions && !isLocal ? /* @__PURE__ */ React37.createElement(
|
3198
|
+
ParticipantMoreActions,
|
3199
|
+
{
|
3200
|
+
peerId,
|
3201
|
+
role,
|
3202
|
+
elements,
|
3203
|
+
canChangeRole,
|
3204
|
+
canRemoveOthers
|
3205
|
+
}
|
3206
|
+
) : null
|
3040
3207
|
);
|
3041
3208
|
});
|
3042
|
-
var ParticipantMoreActions = ({ peerId, role }) => {
|
3209
|
+
var ParticipantMoreActions = ({ peerId, role, elements, canChangeRole, canRemoveOthers }) => {
|
3043
3210
|
var _a;
|
3044
|
-
const hmsActions =
|
3045
|
-
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } = useHMSStore16(selectPermissions8);
|
3046
|
-
const { elements } = useRoomLayoutConferencingScreen();
|
3211
|
+
const hmsActions = useHMSActions13();
|
3047
3212
|
const {
|
3048
3213
|
bring_to_stage_label,
|
3049
3214
|
remove_from_stage_label,
|
@@ -3053,9 +3218,9 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3053
3218
|
const isInStage = role === on_stage_role;
|
3054
3219
|
const shouldShowStageRoleChange = canChangeRole && (isInStage && remove_from_stage_label || (off_stage_roles == null ? void 0 : off_stage_roles.includes(role)) && bring_to_stage_label);
|
3055
3220
|
const prevRole = (_a = useHMSStore16(selectPeerMetadata(peerId))) == null ? void 0 : _a.prevRole;
|
3056
|
-
const localPeerId = useHMSStore16(
|
3221
|
+
const localPeerId = useHMSStore16(selectLocalPeerID4);
|
3057
3222
|
const isLocal = localPeerId === peerId;
|
3058
|
-
const [open, setOpen] =
|
3223
|
+
const [open, setOpen] = useState20(false);
|
3059
3224
|
const handleStageAction = () => __async(void 0, null, function* () {
|
3060
3225
|
if (isInStage) {
|
3061
3226
|
prevRole && hmsActions.changeRoleOfPeer(peerId, prevRole, true);
|
@@ -3064,7 +3229,7 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3064
3229
|
}
|
3065
3230
|
setOpen(false);
|
3066
3231
|
});
|
3067
|
-
return /* @__PURE__ */
|
3232
|
+
return /* @__PURE__ */ React37.createElement(Dropdown.Root, { open, onOpenChange: (value) => setOpen(value), modal: false }, /* @__PURE__ */ React37.createElement(
|
3068
3233
|
Dropdown.Trigger,
|
3069
3234
|
{
|
3070
3235
|
asChild: true,
|
@@ -3084,8 +3249,8 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3084
3249
|
},
|
3085
3250
|
tabIndex: 0
|
3086
3251
|
},
|
3087
|
-
/* @__PURE__ */
|
3088
|
-
), /* @__PURE__ */
|
3252
|
+
/* @__PURE__ */ React37.createElement(Box, { css: { my: "auto" } }, /* @__PURE__ */ React37.createElement(VerticalMenuIcon4, null))
|
3253
|
+
), /* @__PURE__ */ React37.createElement(Dropdown.Portal, null, /* @__PURE__ */ React37.createElement(Dropdown.Content, { align: "end", sideOffset: 8, css: { w: "$64", bg: "$surface_default" } }, shouldShowStageRoleChange ? /* @__PURE__ */ React37.createElement(Dropdown.Item, { css: { bg: "$surface_default" }, onClick: () => handleStageAction() }, /* @__PURE__ */ React37.createElement(ChangeRoleIcon2, null), /* @__PURE__ */ React37.createElement(Text, { variant: "sm", css: { ml: "$4", fontWeight: "$semiBold", c: "$on_surface_high" } }, isInStage ? remove_from_stage_label : bring_to_stage_label)) : null, !isLocal && canRemoveOthers && /* @__PURE__ */ React37.createElement(
|
3089
3254
|
Dropdown.Item,
|
3090
3255
|
{
|
3091
3256
|
css: { color: "$alert_error_default", bg: "$surface_default" },
|
@@ -3097,13 +3262,13 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3097
3262
|
}
|
3098
3263
|
})
|
3099
3264
|
},
|
3100
|
-
/* @__PURE__ */
|
3101
|
-
/* @__PURE__ */
|
3265
|
+
/* @__PURE__ */ React37.createElement(PeopleRemoveIcon, null),
|
3266
|
+
/* @__PURE__ */ React37.createElement(Text, { variant: "sm", css: { ml: "$4", color: "inherit", fontWeight: "$semiBold" } }, "Remove Participant")
|
3102
3267
|
))));
|
3103
3268
|
};
|
3104
3269
|
var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
3105
|
-
const [value, setValue] =
|
3106
|
-
const isMobile =
|
3270
|
+
const [value, setValue] = React37.useState("");
|
3271
|
+
const isMobile = useMedia5(config.media.md);
|
3107
3272
|
useDebounce(
|
3108
3273
|
() => {
|
3109
3274
|
onSearch(value);
|
@@ -3111,7 +3276,7 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3111
3276
|
300,
|
3112
3277
|
[value, onSearch]
|
3113
3278
|
);
|
3114
|
-
return /* @__PURE__ */
|
3279
|
+
return /* @__PURE__ */ React37.createElement(
|
3115
3280
|
Flex,
|
3116
3281
|
{
|
3117
3282
|
align: "center",
|
@@ -3123,13 +3288,13 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3123
3288
|
mt: inSidePane ? "$4" : ""
|
3124
3289
|
}
|
3125
3290
|
},
|
3126
|
-
/* @__PURE__ */
|
3127
|
-
/* @__PURE__ */
|
3291
|
+
/* @__PURE__ */ React37.createElement(SearchIcon, { style: { position: "absolute", left: isMobile ? "1.25rem" : "0.5rem" } }),
|
3292
|
+
/* @__PURE__ */ React37.createElement(
|
3128
3293
|
Input,
|
3129
3294
|
{
|
3130
3295
|
type: "text",
|
3131
3296
|
placeholder: placeholder || "Search for participants",
|
3132
|
-
css: { w: "100%", p: "$6", pl: "$
|
3297
|
+
css: { w: "100%", p: "$6", pl: "$16", mr: "$4", bg: inSidePane ? "$surface_default" : "$surface_dim" },
|
3133
3298
|
value,
|
3134
3299
|
onKeyDown: (event) => {
|
3135
3300
|
event.stopPropagation();
|
@@ -3145,25 +3310,25 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3145
3310
|
};
|
3146
3311
|
|
3147
3312
|
// src/Prebuilt/components/Footer/Footer.tsx
|
3148
|
-
var VirtualBackground =
|
3313
|
+
var VirtualBackground = React38.lazy(() => import("./VirtualBackground-GP4ATXD3.js"));
|
3149
3314
|
var Footer2 = ({
|
3150
3315
|
screenType,
|
3151
3316
|
elements
|
3152
3317
|
}) => {
|
3153
3318
|
var _a, _b;
|
3154
|
-
const isMobile =
|
3319
|
+
const isMobile = useMedia6(config.media.md);
|
3155
3320
|
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay);
|
3156
3321
|
const openByDefault = ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.initial_state) === Chat_ChatState.CHAT_STATE_OPEN;
|
3157
3322
|
const { toggleAudio, toggleVideo } = useAVToggle2();
|
3158
3323
|
const noAVPermissions = !(toggleAudio || toggleVideo);
|
3159
3324
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3160
3325
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3161
|
-
|
3326
|
+
useEffect8(() => {
|
3162
3327
|
if (!isChatOpen && openByDefault) {
|
3163
3328
|
toggleChat();
|
3164
3329
|
}
|
3165
3330
|
}, [toggleChat, openByDefault]);
|
3166
|
-
return /* @__PURE__ */
|
3331
|
+
return /* @__PURE__ */ React38.createElement(
|
3167
3332
|
Footer.Root,
|
3168
3333
|
{
|
3169
3334
|
css: {
|
@@ -3177,7 +3342,7 @@ var Footer2 = ({
|
|
3177
3342
|
}
|
3178
3343
|
}
|
3179
3344
|
},
|
3180
|
-
/* @__PURE__ */
|
3345
|
+
/* @__PURE__ */ React38.createElement(
|
3181
3346
|
Footer.Left,
|
3182
3347
|
{
|
3183
3348
|
css: {
|
@@ -3188,11 +3353,11 @@ var Footer2 = ({
|
|
3188
3353
|
}
|
3189
3354
|
}
|
3190
3355
|
},
|
3191
|
-
isMobile ? /* @__PURE__ */
|
3192
|
-
/* @__PURE__ */
|
3193
|
-
isMobile ? null : /* @__PURE__ */
|
3356
|
+
isMobile ? /* @__PURE__ */ React38.createElement(LeaveRoom, { screenType }) : null,
|
3357
|
+
/* @__PURE__ */ React38.createElement(AudioVideoToggle, null),
|
3358
|
+
isMobile ? null : /* @__PURE__ */ React38.createElement(Suspense, { fallback: /* @__PURE__ */ React38.createElement(React38.Fragment, null) }, /* @__PURE__ */ React38.createElement(VirtualBackground, null))
|
3194
3359
|
),
|
3195
|
-
/* @__PURE__ */
|
3360
|
+
/* @__PURE__ */ React38.createElement(
|
3196
3361
|
Footer.Center,
|
3197
3362
|
{
|
3198
3363
|
css: {
|
@@ -3202,21 +3367,21 @@ var Footer2 = ({
|
|
3202
3367
|
}
|
3203
3368
|
}
|
3204
3369
|
},
|
3205
|
-
isMobile ? /* @__PURE__ */
|
3370
|
+
isMobile ? /* @__PURE__ */ React38.createElement(React38.Fragment, null, noAVPermissions ? /* @__PURE__ */ React38.createElement(RaiseHand, null) : null, (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React38.createElement(ChatToggle, null), /* @__PURE__ */ React38.createElement(MoreSettings, { elements, screenType })) : /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(ScreenshareToggle, null), /* @__PURE__ */ React38.createElement(RaiseHand, null), (elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */ React38.createElement(EmojiReaction, null), /* @__PURE__ */ React38.createElement(LeaveRoom, { screenType }))
|
3206
3371
|
),
|
3207
|
-
/* @__PURE__ */
|
3372
|
+
/* @__PURE__ */ React38.createElement(Footer.Right, null, !isMobile && (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React38.createElement(ChatToggle, null), (elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */ React38.createElement(ParticipantCount, null), /* @__PURE__ */ React38.createElement(MoreSettings, { elements, screenType }))
|
3208
3373
|
);
|
3209
3374
|
};
|
3210
3375
|
|
3211
3376
|
// src/Prebuilt/components/Notifications/HLSFailureModal.jsx
|
3212
|
-
import
|
3213
|
-
import { selectHLSState as selectHLSState2, useHMSActions as
|
3377
|
+
import React39, { useCallback as useCallback8, useState as useState21 } from "react";
|
3378
|
+
import { selectHLSState as selectHLSState2, useHMSActions as useHMSActions14, useHMSStore as useHMSStore17 } from "@100mslive/react-sdk";
|
3214
3379
|
function HLSFailureModal() {
|
3215
3380
|
const { hlsError } = useHMSStore17(selectHLSState2).error || false;
|
3216
|
-
const [openModal, setOpenModal] =
|
3217
|
-
const hmsActions =
|
3381
|
+
const [openModal, setOpenModal] = useState21(!!hlsError);
|
3382
|
+
const hmsActions = useHMSActions14();
|
3218
3383
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
3219
|
-
const startHLS =
|
3384
|
+
const startHLS = useCallback8(() => __async(this, null, function* () {
|
3220
3385
|
try {
|
3221
3386
|
if (isHLSStarted) {
|
3222
3387
|
return;
|
@@ -3231,7 +3396,7 @@ function HLSFailureModal() {
|
|
3231
3396
|
setHLSStarted(false);
|
3232
3397
|
}
|
3233
3398
|
}), [hmsActions, isHLSStarted, setHLSStarted]);
|
3234
|
-
return hlsError ? /* @__PURE__ */
|
3399
|
+
return hlsError ? /* @__PURE__ */ React39.createElement(
|
3235
3400
|
Dialog.Root,
|
3236
3401
|
{
|
3237
3402
|
open: openModal,
|
@@ -3241,7 +3406,7 @@ function HLSFailureModal() {
|
|
3241
3406
|
}
|
3242
3407
|
}
|
3243
3408
|
},
|
3244
|
-
/* @__PURE__ */
|
3409
|
+
/* @__PURE__ */ React39.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React39.createElement(Dialog.Overlay, null), /* @__PURE__ */ React39.createElement(Dialog.Content, { css: { w: "min(360px, 90%)" } }, /* @__PURE__ */ React39.createElement(
|
3245
3410
|
Dialog.Title,
|
3246
3411
|
{
|
3247
3412
|
css: {
|
@@ -3252,36 +3417,631 @@ function HLSFailureModal() {
|
|
3252
3417
|
mt: "$4"
|
3253
3418
|
}
|
3254
3419
|
},
|
3255
|
-
/* @__PURE__ */
|
3256
|
-
), /* @__PURE__ */
|
3420
|
+
/* @__PURE__ */ React39.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, "Failed to Go Live")
|
3421
|
+
), /* @__PURE__ */ React39.createElement(Text, { variant: "sm", css: { mb: "$10", color: "$on_surface_medium" } }, "Something went wrong and your live broadcast failed. Please try again."), /* @__PURE__ */ React39.createElement(Flex, { align: "center", justify: "between", css: { w: "100%", gap: "$8" } }, /* @__PURE__ */ React39.createElement(Button, { outlined: true, variant: "standard", css: { w: "100%" }, onClick: () => setOpenModal(false) }, "Dismiss"), /* @__PURE__ */ React39.createElement(Button, { css: { w: "100%" }, onClick: startHLS }, "Go Live"))))
|
3257
3422
|
) : null;
|
3258
3423
|
}
|
3259
3424
|
|
3425
|
+
// src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx
|
3426
|
+
import React41, { useEffect as useEffect9 } from "react";
|
3427
|
+
import {
|
3428
|
+
selectLocalPeerName as selectLocalPeerName2,
|
3429
|
+
selectLocalPeerRoleName,
|
3430
|
+
selectRoleChangeRequest,
|
3431
|
+
useCustomEvent as useCustomEvent2,
|
3432
|
+
useHMSActions as useHMSActions15,
|
3433
|
+
useHMSStore as useHMSStore18
|
3434
|
+
} from "@100mslive/react-sdk";
|
3435
|
+
|
3436
|
+
// src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx
|
3437
|
+
import React40 from "react";
|
3438
|
+
import { useMedia as useMedia7 } from "react-use";
|
3439
|
+
var RequestPrompt = ({
|
3440
|
+
open = true,
|
3441
|
+
onOpenChange,
|
3442
|
+
title,
|
3443
|
+
body,
|
3444
|
+
actionText = "Accept",
|
3445
|
+
onAction
|
3446
|
+
}) => {
|
3447
|
+
const isMobile = useMedia7(config.media.md);
|
3448
|
+
if (isMobile) {
|
3449
|
+
return /* @__PURE__ */ React40.createElement(Sheet.Root, { open, onOpenChange }, /* @__PURE__ */ React40.createElement(Sheet.Content, { css: { py: "$8" } }, /* @__PURE__ */ React40.createElement(Text, { css: { fontWeight: "$semiBold", c: "$on_surface_high", "@md": { px: "$8" } } }, title), body, /* @__PURE__ */ React40.createElement(RequestActions, { actionText, onAction })));
|
3450
|
+
}
|
3451
|
+
return /* @__PURE__ */ React40.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React40.createElement(PrebuiltDialogPortal, null, /* @__PURE__ */ React40.createElement(Dialog.Overlay, null), /* @__PURE__ */ React40.createElement(Dialog.Content, { css: { p: "$10" } }, /* @__PURE__ */ React40.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md", justifyContent: "center" } }, /* @__PURE__ */ React40.createElement(Text, { variant: "h6" }, title)), /* @__PURE__ */ React40.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React40.createElement(RequestActions, { actionText, onAction }))));
|
3452
|
+
};
|
3453
|
+
var RequestActions = ({ onAction, actionText }) => /* @__PURE__ */ React40.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md", "@md": { mt: "$8", px: "$8" } } }, /* @__PURE__ */ React40.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React40.createElement(Dialog.Close, { css: { width: "100%" } }, /* @__PURE__ */ React40.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%" } }, "Decline"))), /* @__PURE__ */ React40.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React40.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction }, actionText)));
|
3454
|
+
|
3455
|
+
// src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx
|
3456
|
+
var RoleChangeRequestModal = () => {
|
3457
|
+
const hmsActions = useHMSActions15();
|
3458
|
+
const { updateMetaData } = useMyMetadata();
|
3459
|
+
const currentRole = useHMSStore18(selectLocalPeerRoleName);
|
3460
|
+
const roleChangeRequest = useHMSStore18(selectRoleChangeRequest);
|
3461
|
+
const name = useHMSStore18(selectLocalPeerName2);
|
3462
|
+
const { sendEvent } = useCustomEvent2({ type: ROLE_CHANGE_DECLINED });
|
3463
|
+
useEffect9(() => {
|
3464
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
3465
|
+
return;
|
3466
|
+
}
|
3467
|
+
(() => __async(void 0, null, function* () {
|
3468
|
+
yield hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
3469
|
+
}))();
|
3470
|
+
}, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
|
3471
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
3472
|
+
return null;
|
3473
|
+
}
|
3474
|
+
const body = /* @__PURE__ */ React41.createElement(React41.Fragment, null, /* @__PURE__ */ React41.createElement(
|
3475
|
+
Text,
|
3476
|
+
{
|
3477
|
+
variant: "xs",
|
3478
|
+
css: {
|
3479
|
+
c: "$on_surface_medium",
|
3480
|
+
textAlign: "center",
|
3481
|
+
"@md": { textAlign: "left", borderBottom: "1px solid $border_bright", pb: "$4", px: "$8" }
|
3482
|
+
}
|
3483
|
+
},
|
3484
|
+
"Setup your audio and video before joining"
|
3485
|
+
), /* @__PURE__ */ React41.createElement(
|
3486
|
+
Flex,
|
3487
|
+
{
|
3488
|
+
align: "center",
|
3489
|
+
justify: "center",
|
3490
|
+
css: {
|
3491
|
+
"@sm": { width: "100%" },
|
3492
|
+
flexDirection: "column",
|
3493
|
+
mt: "$6",
|
3494
|
+
"@md": { px: "$8" }
|
3495
|
+
}
|
3496
|
+
},
|
3497
|
+
/* @__PURE__ */ React41.createElement(PreviewTile, { name: name || "" }),
|
3498
|
+
/* @__PURE__ */ React41.createElement(PreviewControls, { hideSettings: true })
|
3499
|
+
));
|
3500
|
+
return /* @__PURE__ */ React41.createElement(
|
3501
|
+
RequestPrompt,
|
3502
|
+
{
|
3503
|
+
title: "You're invited to join the stage",
|
3504
|
+
onOpenChange: (value) => __async(void 0, null, function* () {
|
3505
|
+
var _a;
|
3506
|
+
if (!value) {
|
3507
|
+
hmsActions.rejectChangeRole(roleChangeRequest);
|
3508
|
+
sendEvent(__spreadProps(__spreadValues({}, roleChangeRequest), { peerName: name }), { peerId: (_a = roleChangeRequest.requestedBy) == null ? void 0 : _a.id });
|
3509
|
+
yield hmsActions.cancelMidCallPreview();
|
3510
|
+
yield hmsActions.lowerLocalPeerHand();
|
3511
|
+
}
|
3512
|
+
}),
|
3513
|
+
body,
|
3514
|
+
onAction: () => __async(void 0, null, function* () {
|
3515
|
+
yield hmsActions.acceptChangeRole(roleChangeRequest);
|
3516
|
+
yield updateMetaData({ prevRole: currentRole });
|
3517
|
+
yield hmsActions.lowerLocalPeerHand();
|
3518
|
+
}),
|
3519
|
+
actionText: "Accept"
|
3520
|
+
}
|
3521
|
+
);
|
3522
|
+
};
|
3523
|
+
|
3260
3524
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
3261
|
-
import
|
3262
|
-
import { selectIsConnectedToRoom as selectIsConnectedToRoom6, selectLocalPeerRoleName as
|
3525
|
+
import React67, { Suspense as Suspense2, useEffect as useEffect26 } from "react";
|
3526
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom6, selectLocalPeerRoleName as selectLocalPeerRoleName3, useHMSActions as useHMSActions24, useHMSStore as useHMSStore38 } from "@100mslive/react-sdk";
|
3263
3527
|
|
3264
3528
|
// src/Prebuilt/components/VideoLayouts/GridLayout.tsx
|
3265
|
-
import
|
3266
|
-
import { selectPeers as selectPeers2, selectPeerScreenSharing, useHMSStore as
|
3529
|
+
import React56, { useEffect as useEffect17, useMemo as useMemo7, useState as useState30 } from "react";
|
3530
|
+
import { selectPeers as selectPeers2, selectPeerScreenSharing, useHMSStore as useHMSStore27, useHMSVanillaStore as useHMSVanillaStore4 } from "@100mslive/react-sdk";
|
3267
3531
|
|
3268
3532
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3269
|
-
import
|
3270
|
-
import { useMedia as
|
3271
|
-
import { selectLocalPeer as selectLocalPeer2, useHMSStore as
|
3533
|
+
import React49, { useEffect as useEffect13, useMemo as useMemo4, useState as useState25 } from "react";
|
3534
|
+
import { useMedia as useMedia13 } from "react-use";
|
3535
|
+
import { selectLocalPeer as selectLocalPeer2, useHMSStore as useHMSStore23 } from "@100mslive/react-sdk";
|
3272
3536
|
|
3273
3537
|
// src/Prebuilt/components/InsetTile.tsx
|
3274
|
-
import
|
3538
|
+
import React46, { useEffect as useEffect10, useRef as useRef8 } from "react";
|
3275
3539
|
import Draggable from "react-draggable";
|
3276
|
-
import { useMedia as
|
3277
|
-
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer, selectVideoTrackByID, useHMSStore as
|
3540
|
+
import { useMedia as useMedia11 } from "react-use";
|
3541
|
+
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer, selectVideoTrackByID as selectVideoTrackByID2, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
3278
3542
|
import { ExpandIcon as ExpandIcon2 } from "@100mslive/react-icons";
|
3279
3543
|
|
3280
|
-
// src/Prebuilt/components/
|
3281
|
-
import
|
3282
|
-
|
3283
|
-
|
3284
|
-
|
3544
|
+
// src/Prebuilt/components/VideoTile.jsx
|
3545
|
+
import React44, { Fragment as Fragment9, useCallback as useCallback9, useMemo as useMemo2, useRef as useRef7, useState as useState23 } from "react";
|
3546
|
+
import { useMedia as useMedia10 } from "react-use";
|
3547
|
+
import {
|
3548
|
+
selectAudioTrackByPeerID,
|
3549
|
+
selectHasPeerHandRaised as selectHasPeerHandRaised2,
|
3550
|
+
selectIsPeerAudioEnabled as selectIsPeerAudioEnabled2,
|
3551
|
+
selectLocalPeerID as selectLocalPeerID6,
|
3552
|
+
selectPeerMetadata as selectPeerMetadata2,
|
3553
|
+
selectPeerNameByID,
|
3554
|
+
selectSessionStore as selectSessionStore2,
|
3555
|
+
selectVideoTrackByID,
|
3556
|
+
selectVideoTrackByPeerID as selectVideoTrackByPeerID2,
|
3557
|
+
useHMSStore as useHMSStore21
|
3558
|
+
} from "@100mslive/react-sdk";
|
3559
|
+
import { BrbTileIcon, HandIcon as HandIcon4, MicOffIcon as MicOffIcon5 } from "@100mslive/react-icons";
|
3560
|
+
|
3561
|
+
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
3562
|
+
import React43, { useState as useState22 } from "react";
|
3563
|
+
import { useMedia as useMedia9 } from "react-use";
|
3564
|
+
import {
|
3565
|
+
selectLocalPeerID as selectLocalPeerID5,
|
3566
|
+
selectPeerByID as selectPeerByID2,
|
3567
|
+
selectPermissions as selectPermissions10,
|
3568
|
+
selectTrackByID as selectTrackByID2,
|
3569
|
+
selectVideoTrackByPeerID,
|
3570
|
+
useHMSStore as useHMSStore20,
|
3571
|
+
useRemoteAVToggle as useRemoteAVToggle2
|
3572
|
+
} from "@100mslive/react-sdk";
|
3573
|
+
import { CrossIcon as CrossIcon6, VerticalMenuIcon as VerticalMenuIcon5 } from "@100mslive/react-icons";
|
3574
|
+
|
3575
|
+
// src/Prebuilt/components/TileMenu/TileMenuContent.jsx
|
3576
|
+
import React42, { Fragment as Fragment8 } from "react";
|
3577
|
+
import { useMedia as useMedia8 } from "react-use";
|
3578
|
+
import {
|
3579
|
+
selectPermissions as selectPermissions9,
|
3580
|
+
selectSessionStore,
|
3581
|
+
selectTrackByID,
|
3582
|
+
useCustomEvent as useCustomEvent3,
|
3583
|
+
useHMSActions as useHMSActions16,
|
3584
|
+
useHMSStore as useHMSStore19,
|
3585
|
+
useRemoteAVToggle
|
3586
|
+
} from "@100mslive/react-sdk";
|
3587
|
+
import {
|
3588
|
+
MicOffIcon as MicOffIcon4,
|
3589
|
+
MicOnIcon as MicOnIcon2,
|
3590
|
+
PencilIcon as PencilIcon2,
|
3591
|
+
PinIcon,
|
3592
|
+
RemoveUserIcon as RemoveUserIcon2,
|
3593
|
+
ShareScreenIcon as ShareScreenIcon2,
|
3594
|
+
ShrinkIcon,
|
3595
|
+
SpeakerIcon,
|
3596
|
+
StarIcon as StarIcon2,
|
3597
|
+
VideoOffIcon as VideoOffIcon2,
|
3598
|
+
VideoOnIcon as VideoOnIcon2
|
3599
|
+
} from "@100mslive/react-icons";
|
3600
|
+
var isSameTile = ({ trackId, videoTrackID, audioTrackID }) => trackId && (videoTrackID && videoTrackID === trackId || audioTrackID && audioTrackID === trackId);
|
3601
|
+
var spacingCSS = { "@md": { my: "$8", fontWeight: "$semiBold", fontSize: "sm" } };
|
3602
|
+
var SpotlightActions = ({
|
3603
|
+
peerId,
|
3604
|
+
onSpotLightClick = () => {
|
3605
|
+
return;
|
3606
|
+
}
|
3607
|
+
}) => {
|
3608
|
+
const hmsActions = useHMSActions16();
|
3609
|
+
const spotlightPeerId = useHMSStore19(selectSessionStore(SESSION_STORE_KEY.SPOTLIGHT));
|
3610
|
+
const isTileSpotlighted = spotlightPeerId === peerId;
|
3611
|
+
const setSpotlightPeerId = (peer) => hmsActions.sessionStore.set(SESSION_STORE_KEY.SPOTLIGHT, peer).catch((err) => ToastManager.addToast({ title: err.description }));
|
3612
|
+
return /* @__PURE__ */ React42.createElement(
|
3613
|
+
StyledMenuTile.ItemButton,
|
3614
|
+
{
|
3615
|
+
css: spacingCSS,
|
3616
|
+
onClick: () => {
|
3617
|
+
if (isTileSpotlighted) {
|
3618
|
+
setSpotlightPeerId();
|
3619
|
+
} else {
|
3620
|
+
setSpotlightPeerId(peerId);
|
3621
|
+
}
|
3622
|
+
onSpotLightClick();
|
3623
|
+
}
|
3624
|
+
},
|
3625
|
+
/* @__PURE__ */ React42.createElement(StarIcon2, { height: 20, width: 20 }),
|
3626
|
+
/* @__PURE__ */ React42.createElement("span", null, isTileSpotlighted ? "Remove from Spotlight" : "Spotlight Tile for everyone")
|
3627
|
+
);
|
3628
|
+
};
|
3629
|
+
var PinActions = ({ audioTrackID, videoTrackID }) => {
|
3630
|
+
const [pinnedTrackId, setPinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
3631
|
+
const isTilePinned = isSameTile({
|
3632
|
+
trackId: pinnedTrackId,
|
3633
|
+
videoTrackID,
|
3634
|
+
audioTrackID
|
3635
|
+
});
|
3636
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(
|
3637
|
+
StyledMenuTile.ItemButton,
|
3638
|
+
{
|
3639
|
+
css: spacingCSS,
|
3640
|
+
onClick: () => isTilePinned ? setPinnedTrackId() : setPinnedTrackId(videoTrackID || audioTrackID)
|
3641
|
+
},
|
3642
|
+
/* @__PURE__ */ React42.createElement(PinIcon, { height: 20, width: 20 }),
|
3643
|
+
/* @__PURE__ */ React42.createElement("span", null, isTilePinned ? "Unpin" : "Pin", " Tile for myself")
|
3644
|
+
));
|
3645
|
+
};
|
3646
|
+
var MinimiseInset = () => {
|
3647
|
+
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
3648
|
+
return /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(StyledMenuTile.ItemButton, { css: spacingCSS, onClick: () => setMinimised(!minimised) }, /* @__PURE__ */ React42.createElement(ShrinkIcon, { height: 20, width: 20 }), /* @__PURE__ */ React42.createElement("span", null, minimised ? "Show" : "Minimise", " your video")));
|
3649
|
+
};
|
3650
|
+
var SimulcastLayers = ({ trackId }) => {
|
3651
|
+
var _a;
|
3652
|
+
const track = useHMSStore19(selectTrackByID(trackId));
|
3653
|
+
const actions = useHMSActions16();
|
3654
|
+
const bg = useDropdownSelection();
|
3655
|
+
if (!((_a = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _a.length) || track.degraded || !track.enabled) {
|
3656
|
+
return null;
|
3657
|
+
}
|
3658
|
+
const currentLayer = track.layerDefinitions.find((layer) => layer.layer === track.layer);
|
3659
|
+
return /* @__PURE__ */ React42.createElement(Fragment8, null, /* @__PURE__ */ React42.createElement(StyledMenuTile.ItemButton, { css: { color: "$on_surface_medium", cursor: "default" } }, "Select maximum resolution"), track.layerDefinitions.map((layer) => {
|
3660
|
+
return /* @__PURE__ */ React42.createElement(
|
3661
|
+
StyledMenuTile.ItemButton,
|
3662
|
+
{
|
3663
|
+
key: layer.layer,
|
3664
|
+
onClick: () => __async(void 0, null, function* () {
|
3665
|
+
yield actions.setPreferredLayer(trackId, layer.layer);
|
3666
|
+
}),
|
3667
|
+
css: {
|
3668
|
+
justifyContent: "space-between",
|
3669
|
+
bg: track.preferredLayer === layer.layer ? bg : void 0,
|
3670
|
+
"&:hover": {
|
3671
|
+
bg: track.preferredLayer === layer.layer ? bg : void 0
|
3672
|
+
}
|
3673
|
+
}
|
3674
|
+
},
|
3675
|
+
/* @__PURE__ */ React42.createElement(
|
3676
|
+
Text,
|
3677
|
+
{
|
3678
|
+
as: "span",
|
3679
|
+
css: {
|
3680
|
+
textTransform: "capitalize",
|
3681
|
+
mr: "$2",
|
3682
|
+
fontWeight: track.preferredLayer === layer.layer ? "$semiBold" : "$regular",
|
3683
|
+
color: track.preferredLayer === layer.layer ? "$on_primary_high" : "$on_surface_high"
|
3684
|
+
}
|
3685
|
+
},
|
3686
|
+
layer.layer
|
3687
|
+
),
|
3688
|
+
/* @__PURE__ */ React42.createElement(
|
3689
|
+
Text,
|
3690
|
+
{
|
3691
|
+
as: "span",
|
3692
|
+
variant: "xs",
|
3693
|
+
css: {
|
3694
|
+
color: track.preferredLayer === layer.layer ? "$on_primary_high" : "$on_surface_high"
|
3695
|
+
}
|
3696
|
+
},
|
3697
|
+
layer.resolution.width,
|
3698
|
+
"x",
|
3699
|
+
layer.resolution.height
|
3700
|
+
)
|
3701
|
+
);
|
3702
|
+
}), /* @__PURE__ */ React42.createElement(StyledMenuTile.ItemButton, null, /* @__PURE__ */ React42.createElement(Text, { as: "span", variant: "xs", css: { color: "$on_surface_medium" } }, "Currently streaming:", /* @__PURE__ */ React42.createElement(
|
3703
|
+
Text,
|
3704
|
+
{
|
3705
|
+
as: "span",
|
3706
|
+
variant: "xs",
|
3707
|
+
css: {
|
3708
|
+
fontWeight: "$semiBold",
|
3709
|
+
textTransform: "capitalize",
|
3710
|
+
color: "$on_surface_medium",
|
3711
|
+
ml: "$2"
|
3712
|
+
}
|
3713
|
+
},
|
3714
|
+
currentLayer ? /* @__PURE__ */ React42.createElement(React42.Fragment, null, track.layer, " (", currentLayer.resolution.width, "x", currentLayer.resolution.height, ")") : "-"
|
3715
|
+
))));
|
3716
|
+
};
|
3717
|
+
var TileMenuContent = (props) => {
|
3718
|
+
const actions = useHMSActions16();
|
3719
|
+
const { removeOthers } = useHMSStore19(selectPermissions9);
|
3720
|
+
const {
|
3721
|
+
videoTrackID,
|
3722
|
+
audioTrackID,
|
3723
|
+
isLocal,
|
3724
|
+
isScreenshare,
|
3725
|
+
showSpotlight,
|
3726
|
+
showPinAction,
|
3727
|
+
peerID,
|
3728
|
+
canMinimise,
|
3729
|
+
closeSheetOnClick = () => {
|
3730
|
+
return;
|
3731
|
+
},
|
3732
|
+
openNameChangeModal = () => {
|
3733
|
+
return;
|
3734
|
+
}
|
3735
|
+
} = props;
|
3736
|
+
const { isAudioEnabled, isVideoEnabled, setVolume, toggleAudio, toggleVideo, volume } = useRemoteAVToggle(
|
3737
|
+
audioTrackID,
|
3738
|
+
videoTrackID
|
3739
|
+
);
|
3740
|
+
const { sendEvent } = useCustomEvent3({
|
3741
|
+
type: REMOTE_STOP_SCREENSHARE_TYPE
|
3742
|
+
});
|
3743
|
+
const isMobile = useMedia8(config.media.md);
|
3744
|
+
return isLocal ? (showPinAction || canMinimise) && /* @__PURE__ */ React42.createElement(React42.Fragment, null, showPinAction && /* @__PURE__ */ React42.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React42.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() }), canMinimise && /* @__PURE__ */ React42.createElement(MinimiseInset, null), /* @__PURE__ */ React42.createElement(
|
3745
|
+
StyledMenuTile.ItemButton,
|
3746
|
+
{
|
3747
|
+
onClick: () => {
|
3748
|
+
openNameChangeModal();
|
3749
|
+
closeSheetOnClick();
|
3750
|
+
}
|
3751
|
+
},
|
3752
|
+
/* @__PURE__ */ React42.createElement(PencilIcon2, { height: 20, width: 20 }),
|
3753
|
+
/* @__PURE__ */ React42.createElement(Text, { variant: "sm", css: { "@md": { fontWeight: "$semiBold" }, c: "$on_surface_high" } }, "Change Name")
|
3754
|
+
)) : /* @__PURE__ */ React42.createElement(React42.Fragment, null, toggleVideo ? /* @__PURE__ */ React42.createElement(
|
3755
|
+
StyledMenuTile.ItemButton,
|
3756
|
+
{
|
3757
|
+
css: spacingCSS,
|
3758
|
+
onClick: () => {
|
3759
|
+
toggleVideo();
|
3760
|
+
closeSheetOnClick();
|
3761
|
+
},
|
3762
|
+
"data-testid": isVideoEnabled ? "mute_video_participant_btn" : "unmute_video_participant_btn"
|
3763
|
+
},
|
3764
|
+
isVideoEnabled ? /* @__PURE__ */ React42.createElement(VideoOnIcon2, { height: 20, width: 20 }) : /* @__PURE__ */ React42.createElement(VideoOffIcon2, { height: 20, width: 20 }),
|
3765
|
+
/* @__PURE__ */ React42.createElement("span", null, isVideoEnabled ? "Mute" : "Request Unmute")
|
3766
|
+
) : null, toggleAudio ? /* @__PURE__ */ React42.createElement(
|
3767
|
+
StyledMenuTile.ItemButton,
|
3768
|
+
{
|
3769
|
+
css: spacingCSS,
|
3770
|
+
onClick: () => {
|
3771
|
+
toggleAudio();
|
3772
|
+
closeSheetOnClick();
|
3773
|
+
},
|
3774
|
+
"data-testid": isVideoEnabled ? "mute_audio_participant_btn" : "unmute_audio_participant_btn"
|
3775
|
+
},
|
3776
|
+
isAudioEnabled ? /* @__PURE__ */ React42.createElement(MicOnIcon2, { height: 20, width: 20 }) : /* @__PURE__ */ React42.createElement(MicOffIcon4, { height: 20, width: 20 }),
|
3777
|
+
/* @__PURE__ */ React42.createElement("span", null, isAudioEnabled ? "Mute" : "Request Unmute")
|
3778
|
+
) : null, audioTrackID ? /* @__PURE__ */ React42.createElement(StyledMenuTile.VolumeItem, { "data-testid": "participant_volume_slider", css: __spreadProps(__spreadValues({}, spacingCSS), { mb: "$0" }) }, /* @__PURE__ */ React42.createElement(Flex, { align: "center", gap: 1 }, /* @__PURE__ */ React42.createElement(SpeakerIcon, { height: 20, width: 20 }), /* @__PURE__ */ React42.createElement(Box, { as: "span", css: { ml: "$4" } }, "Volume (", volume, ")")), /* @__PURE__ */ React42.createElement(Slider, { css: { my: "0.5rem" }, step: 5, value: [volume], onValueChange: (e) => setVolume(e[0]) })) : null, showPinAction && /* @__PURE__ */ React42.createElement(React42.Fragment, null, /* @__PURE__ */ React42.createElement(PinActions, { audioTrackID, videoTrackID }), showSpotlight && /* @__PURE__ */ React42.createElement(SpotlightActions, { peerId: peerID, onSpotLightClick: () => closeSheetOnClick() })), isMobile ? null : /* @__PURE__ */ React42.createElement(SimulcastLayers, { trackId: videoTrackID }), removeOthers ? /* @__PURE__ */ React42.createElement(
|
3779
|
+
StyledMenuTile.RemoveItem,
|
3780
|
+
{
|
3781
|
+
css: __spreadProps(__spreadValues({}, spacingCSS), { borderTop: "none" }),
|
3782
|
+
onClick: () => __async(void 0, null, function* () {
|
3783
|
+
try {
|
3784
|
+
yield actions.removePeer(peerID, "");
|
3785
|
+
} catch (error) {
|
3786
|
+
}
|
3787
|
+
closeSheetOnClick();
|
3788
|
+
}),
|
3789
|
+
"data-testid": "remove_participant_btn"
|
3790
|
+
},
|
3791
|
+
/* @__PURE__ */ React42.createElement(RemoveUserIcon2, { height: 20, width: 20 }),
|
3792
|
+
/* @__PURE__ */ React42.createElement("span", null, "Remove Participant")
|
3793
|
+
) : null, removeOthers && isScreenshare ? /* @__PURE__ */ React42.createElement(
|
3794
|
+
StyledMenuTile.RemoveItem,
|
3795
|
+
{
|
3796
|
+
onClick: () => {
|
3797
|
+
sendEvent({});
|
3798
|
+
closeSheetOnClick();
|
3799
|
+
},
|
3800
|
+
css: spacingCSS
|
3801
|
+
},
|
3802
|
+
/* @__PURE__ */ React42.createElement(ShareScreenIcon2, { height: 20, width: 20 }),
|
3803
|
+
/* @__PURE__ */ React42.createElement("span", null, "Stop Screenshare")
|
3804
|
+
) : null);
|
3805
|
+
};
|
3806
|
+
|
3807
|
+
// src/Prebuilt/components/TileMenu/TileMenu.jsx
|
3808
|
+
var TileMenu = ({
|
3809
|
+
audioTrackID,
|
3810
|
+
videoTrackID,
|
3811
|
+
peerID,
|
3812
|
+
isScreenshare = false,
|
3813
|
+
canMinimise,
|
3814
|
+
enableSpotlightingPeer = true
|
3815
|
+
}) => {
|
3816
|
+
var _a, _b;
|
3817
|
+
const [open, setOpen] = useState22(false);
|
3818
|
+
const { theme } = useTheme();
|
3819
|
+
const localPeerID = useHMSStore20(selectLocalPeerID5);
|
3820
|
+
const isLocal = localPeerID === peerID;
|
3821
|
+
const { removeOthers } = useHMSStore20(selectPermissions10);
|
3822
|
+
const { setVolume, toggleAudio, toggleVideo } = useRemoteAVToggle2(audioTrackID, videoTrackID);
|
3823
|
+
const showSpotlight = enableSpotlightingPeer;
|
3824
|
+
const isPrimaryVideoTrack = ((_a = useHMSStore20(selectVideoTrackByPeerID(peerID))) == null ? void 0 : _a.id) === videoTrackID;
|
3825
|
+
const showPinAction = audioTrackID || videoTrackID && isPrimaryVideoTrack;
|
3826
|
+
const track = useHMSStore20(selectTrackByID2(videoTrackID));
|
3827
|
+
const hideSimulcastLayers = !((_b = track == null ? void 0 : track.layerDefinitions) == null ? void 0 : _b.length) || track.degraded || !track.enabled;
|
3828
|
+
const isMobile = useMedia9(config.media.md);
|
3829
|
+
const peer = useHMSStore20(selectPeerByID2(peerID));
|
3830
|
+
const [showNameChangeModal, setShowNameChangeModal] = useState22(false);
|
3831
|
+
useDropdownList({ open, name: "TileMenu" });
|
3832
|
+
if (!(removeOthers || toggleAudio || toggleVideo || setVolume || showPinAction) && hideSimulcastLayers) {
|
3833
|
+
return null;
|
3834
|
+
}
|
3835
|
+
const openNameChangeModal = () => setShowNameChangeModal(true);
|
3836
|
+
const props = {
|
3837
|
+
isLocal,
|
3838
|
+
isScreenshare,
|
3839
|
+
audioTrackID,
|
3840
|
+
videoTrackID,
|
3841
|
+
peerID,
|
3842
|
+
isPrimaryVideoTrack,
|
3843
|
+
showSpotlight,
|
3844
|
+
showPinAction,
|
3845
|
+
canMinimise,
|
3846
|
+
openNameChangeModal
|
3847
|
+
};
|
3848
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(StyledMenuTile.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React43.createElement(
|
3849
|
+
StyledMenuTile.Trigger,
|
3850
|
+
{
|
3851
|
+
"data-testid": "participant_menu_btn",
|
3852
|
+
css: { bg: `${theme.colors.background_dim.value}A3`, p: "$2", w: "unset", h: "unset" },
|
3853
|
+
onClick: (e) => e.stopPropagation(),
|
3854
|
+
className: isMobile ? "__cancel-drag-event" : ""
|
3855
|
+
},
|
3856
|
+
/* @__PURE__ */ React43.createElement(VerticalMenuIcon5, { width: 20, height: 20 })
|
3857
|
+
), isMobile ? /* @__PURE__ */ React43.createElement(Sheet.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React43.createElement(Sheet.Content, { css: { bg: "$surface_dim", pt: "$8" } }, /* @__PURE__ */ React43.createElement(
|
3858
|
+
Flex,
|
3859
|
+
{
|
3860
|
+
css: {
|
3861
|
+
color: "$on_surface_high",
|
3862
|
+
display: "flex",
|
3863
|
+
w: "100%",
|
3864
|
+
justifyContent: "space-between",
|
3865
|
+
alignItems: "center",
|
3866
|
+
px: "$10",
|
3867
|
+
pb: "$8",
|
3868
|
+
borderBottom: "1px solid $border_default"
|
3869
|
+
}
|
3870
|
+
},
|
3871
|
+
/* @__PURE__ */ React43.createElement(Box, null, /* @__PURE__ */ React43.createElement(Text, { css: { color: "$on_surface_high", fontWeight: "$semiBold" } }, peer.name, isLocal ? ` (You)` : null), (peer == null ? void 0 : peer.roleName) ? /* @__PURE__ */ React43.createElement(Text, { variant: "xs", css: { color: "$on_surface_low", mt: "$2" } }, peer.roleName) : null),
|
3872
|
+
/* @__PURE__ */ React43.createElement(Sheet.Close, { css: { color: "inherit" } }, /* @__PURE__ */ React43.createElement(CrossIcon6, null))
|
3873
|
+
), /* @__PURE__ */ React43.createElement(Box, { css: { px: "$8", pb: "$8", maxHeight: "80vh", overflowY: "auto" } }, /* @__PURE__ */ React43.createElement(TileMenuContent, __spreadProps(__spreadValues({}, props), { closeSheetOnClick: () => setOpen(false) }))))) : /* @__PURE__ */ React43.createElement(StyledMenuTile.Content, { side: "top", align: "end", css: { maxHeight: "$80", overflowY: "auto" } }, /* @__PURE__ */ React43.createElement(TileMenuContent, __spreadValues({}, props)))), showNameChangeModal && /* @__PURE__ */ React43.createElement(ChangeNameModal, { onOpenChange: setShowNameChangeModal }));
|
3874
|
+
};
|
3875
|
+
var TileMenu_default = TileMenu;
|
3876
|
+
|
3877
|
+
// src/Prebuilt/components/peerTileUtils.jsx
|
3878
|
+
var PEER_NAME_PLACEHOLDER = "peerName";
|
3879
|
+
var labelMap = /* @__PURE__ */ new Map([
|
3880
|
+
[[true, "screen"].toString(), "Your Screen"],
|
3881
|
+
[[true, "regular"].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
3882
|
+
[[false, "screen"].toString(), `${PEER_NAME_PLACEHOLDER}'s Screen`],
|
3883
|
+
[[false, "regular"].toString(), PEER_NAME_PLACEHOLDER],
|
3884
|
+
[[true, void 0].toString(), `You (${PEER_NAME_PLACEHOLDER})`],
|
3885
|
+
[[false, void 0].toString(), `${PEER_NAME_PLACEHOLDER}`]
|
3886
|
+
]);
|
3887
|
+
var getVideoTileLabel = ({ peerName, isLocal, track }) => {
|
3888
|
+
const isPeerPresent = peerName !== void 0;
|
3889
|
+
if (!isPeerPresent || !track) {
|
3890
|
+
return isPeerPresent ? labelMap.get([isLocal, void 0].toString()).replace(PEER_NAME_PLACEHOLDER, peerName) : "";
|
3891
|
+
}
|
3892
|
+
const isLocallyMuted = track.volume === 0;
|
3893
|
+
let label = labelMap.get([isLocal, track.source].toString());
|
3894
|
+
if (label) {
|
3895
|
+
label = label.replace(PEER_NAME_PLACEHOLDER, peerName);
|
3896
|
+
} else {
|
3897
|
+
label = `${peerName} ${track.source}`;
|
3898
|
+
}
|
3899
|
+
return `${label}${isLocallyMuted ? " (Muted for you)" : ""}`;
|
3900
|
+
};
|
3901
|
+
|
3902
|
+
// src/Prebuilt/components/VideoTile.jsx
|
3903
|
+
var Tile = ({
|
3904
|
+
peerId,
|
3905
|
+
trackId,
|
3906
|
+
width,
|
3907
|
+
height,
|
3908
|
+
objectFit = "cover",
|
3909
|
+
canMinimise = false,
|
3910
|
+
isDragabble = false,
|
3911
|
+
rootCSS = {},
|
3912
|
+
containerCSS = {},
|
3913
|
+
enableSpotlightingPeer = true,
|
3914
|
+
hideParticipantNameOnTile = false,
|
3915
|
+
roundedVideoTile = true,
|
3916
|
+
hideAudioMuteOnTile = false,
|
3917
|
+
hideMetadataOnTile = false
|
3918
|
+
}) => {
|
3919
|
+
var _a, _b;
|
3920
|
+
const trackSelector = trackId ? selectVideoTrackByID(trackId) : selectVideoTrackByPeerID2(peerId);
|
3921
|
+
const track = useHMSStore21(trackSelector);
|
3922
|
+
const isMobile = useMedia10(config.media.md);
|
3923
|
+
const peerName = useHMSStore21(selectPeerNameByID(peerId));
|
3924
|
+
const audioTrack = useHMSStore21(selectAudioTrackByPeerID(peerId));
|
3925
|
+
const localPeerID = useHMSStore21(selectLocalPeerID6);
|
3926
|
+
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
3927
|
+
const mirrorLocalVideo = useUISettings(UI_SETTINGS.mirrorLocalVideo);
|
3928
|
+
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
3929
|
+
const isAudioMuted = !useHMSStore21(selectIsPeerAudioEnabled2(peerId));
|
3930
|
+
const isVideoMuted = !(track == null ? void 0 : track.enabled);
|
3931
|
+
const [isMouseHovered, setIsMouseHovered] = useState23(false);
|
3932
|
+
const isVideoDegraded = track == null ? void 0 : track.degraded;
|
3933
|
+
const isLocal = localPeerID === peerId;
|
3934
|
+
const [pinnedTrackId] = useSetAppDataByKey(APP_DATA.pinnedTrackId);
|
3935
|
+
const pinned = isSameTile({
|
3936
|
+
trackId: pinnedTrackId,
|
3937
|
+
videoTrackID: track == null ? void 0 : track.id,
|
3938
|
+
audioTrackID: audioTrack == null ? void 0 : audioTrack.id
|
3939
|
+
});
|
3940
|
+
const spotlighted = useHMSStore21(selectSessionStore2(SESSION_STORE_KEY.SPOTLIGHT)) === peerId;
|
3941
|
+
const label = getVideoTileLabel({
|
3942
|
+
peerName,
|
3943
|
+
track,
|
3944
|
+
isLocal
|
3945
|
+
});
|
3946
|
+
const onHoverHandler = useCallback9((event) => {
|
3947
|
+
setIsMouseHovered(event.type === "mouseenter");
|
3948
|
+
}, []);
|
3949
|
+
const ref = useRef7(null);
|
3950
|
+
const calculatedHeight = ((_a = ref.current) == null ? void 0 : _a.clientHeight) || "";
|
3951
|
+
const calculatedWidth = ((_b = ref.current) == null ? void 0 : _b.clientWidth) || "";
|
3952
|
+
const isTileBigEnoughToShowStats = calculatedHeight >= 180 && calculatedWidth >= 180;
|
3953
|
+
const [avatarSize, attribBoxSize] = useMemo2(() => {
|
3954
|
+
if (!calculatedWidth || !calculatedHeight) {
|
3955
|
+
return [void 0, void 0];
|
3956
|
+
}
|
3957
|
+
let avatarSize2 = "large";
|
3958
|
+
if (calculatedWidth <= 150 || calculatedHeight <= 150) {
|
3959
|
+
avatarSize2 = "small";
|
3960
|
+
} else if (calculatedWidth <= 300 || calculatedHeight <= 300) {
|
3961
|
+
avatarSize2 = "medium";
|
3962
|
+
}
|
3963
|
+
let attribBoxSize2 = "medium";
|
3964
|
+
if (calculatedWidth <= 180 || calculatedHeight <= 180) {
|
3965
|
+
attribBoxSize2 = "small";
|
3966
|
+
}
|
3967
|
+
return [avatarSize2, attribBoxSize2];
|
3968
|
+
}, [calculatedWidth, calculatedHeight]);
|
3969
|
+
return /* @__PURE__ */ React44.createElement(
|
3970
|
+
StyledVideoTile.Root,
|
3971
|
+
{
|
3972
|
+
ref,
|
3973
|
+
css: __spreadValues({
|
3974
|
+
width,
|
3975
|
+
height
|
3976
|
+
}, rootCSS),
|
3977
|
+
"data-testid": `participant_tile_${peerName}`
|
3978
|
+
},
|
3979
|
+
peerName !== void 0 ? /* @__PURE__ */ React44.createElement(
|
3980
|
+
StyledVideoTile.Container,
|
3981
|
+
{
|
3982
|
+
onMouseEnter: onHoverHandler,
|
3983
|
+
onMouseLeave: onHoverHandler,
|
3984
|
+
noRadius: !roundedVideoTile,
|
3985
|
+
css: containerCSS
|
3986
|
+
},
|
3987
|
+
showStatsOnTiles && isTileBigEnoughToShowStats ? /* @__PURE__ */ React44.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
3988
|
+
/* @__PURE__ */ React44.createElement(
|
3989
|
+
Video,
|
3990
|
+
{
|
3991
|
+
trackId: track == null ? void 0 : track.id,
|
3992
|
+
attach: isLocal ? void 0 : !isAudioOnly,
|
3993
|
+
mirror: mirrorLocalVideo && peerId === localPeerID && (track == null ? void 0 : track.source) === "regular" && (track == null ? void 0 : track.facingMode) !== "environment",
|
3994
|
+
noRadius: !roundedVideoTile,
|
3995
|
+
"data-testid": "participant_video_tile",
|
3996
|
+
css: {
|
3997
|
+
objectFit,
|
3998
|
+
filter: isVideoDegraded ? "blur($space$2)" : void 0,
|
3999
|
+
bg: "transparent"
|
4000
|
+
}
|
4001
|
+
}
|
4002
|
+
),
|
4003
|
+
isVideoMuted || !isLocal && isAudioOnly ? /* @__PURE__ */ React44.createElement(StyledVideoTile.AvatarContainer, null, /* @__PURE__ */ React44.createElement(Avatar, { name: peerName || "", "data-testid": "participant_avatar_icon", size: avatarSize })) : null,
|
4004
|
+
!hideAudioMuteOnTile ? isAudioMuted ? /* @__PURE__ */ React44.createElement(StyledVideoTile.AudioIndicator, { "data-testid": "participant_audio_mute_icon", size: attribBoxSize }, /* @__PURE__ */ React44.createElement(MicOffIcon5, null)) : /* @__PURE__ */ React44.createElement(StyledVideoTile.AudioIndicator, { size: attribBoxSize }, /* @__PURE__ */ React44.createElement(AudioLevel, { trackId: audioTrack == null ? void 0 : audioTrack.id, size: attribBoxSize })) : null,
|
4005
|
+
isMouseHovered || isDragabble && isMobile ? /* @__PURE__ */ React44.createElement(
|
4006
|
+
TileMenu_default,
|
4007
|
+
{
|
4008
|
+
peerID: peerId,
|
4009
|
+
audioTrackID: audioTrack == null ? void 0 : audioTrack.id,
|
4010
|
+
videoTrackID: track == null ? void 0 : track.id,
|
4011
|
+
canMinimise,
|
4012
|
+
enableSpotlightingPeer
|
4013
|
+
}
|
4014
|
+
) : null,
|
4015
|
+
!hideMetadataOnTile && /* @__PURE__ */ React44.createElement(PeerMetadata, { peerId, size: attribBoxSize }),
|
4016
|
+
/* @__PURE__ */ React44.createElement(
|
4017
|
+
TileConnection_default,
|
4018
|
+
{
|
4019
|
+
hideLabel: hideParticipantNameOnTile,
|
4020
|
+
name: label,
|
4021
|
+
isTile: true,
|
4022
|
+
peerId,
|
4023
|
+
width,
|
4024
|
+
pinned,
|
4025
|
+
spotlighted
|
4026
|
+
}
|
4027
|
+
)
|
4028
|
+
) : null
|
4029
|
+
);
|
4030
|
+
};
|
4031
|
+
var PeerMetadata = ({ peerId, size }) => {
|
4032
|
+
const metaData = useHMSStore21(selectPeerMetadata2(peerId));
|
4033
|
+
const isBRB = (metaData == null ? void 0 : metaData.isBRBOn) || false;
|
4034
|
+
const isHandRaised = useHMSStore21(selectHasPeerHandRaised2(peerId));
|
4035
|
+
return /* @__PURE__ */ React44.createElement(Fragment9, null, isHandRaised ? /* @__PURE__ */ React44.createElement(StyledVideoTile.AttributeBox, { size, "data-testid": "raiseHand_icon_onTile" }, /* @__PURE__ */ React44.createElement(HandIcon4, { width: 24, height: 24 })) : null, isBRB ? /* @__PURE__ */ React44.createElement(StyledVideoTile.AttributeBox, { size, "data-testid": "brb_icon_onTile" }, /* @__PURE__ */ React44.createElement(BrbTileIcon, { width: 22, height: 22 })) : null);
|
4036
|
+
};
|
4037
|
+
var VideoTile = React44.memo(Tile);
|
4038
|
+
var VideoTile_default = VideoTile;
|
4039
|
+
|
4040
|
+
// src/Prebuilt/components/hooks/useVideoTileLayout.ts
|
4041
|
+
import React45, { useContext } from "react";
|
4042
|
+
var VideoTileContext = React45.createContext({
|
4043
|
+
enableSpotlightingPeer: true,
|
4044
|
+
hideParticipantNameOnTile: false,
|
3285
4045
|
roundedVideoTile: true,
|
3286
4046
|
hideAudioMuteOnTile: false,
|
3287
4047
|
hideAudioLevelOnTile: false,
|
@@ -3295,14 +4055,14 @@ var useVideoTileContext = () => {
|
|
3295
4055
|
|
3296
4056
|
// src/Prebuilt/components/InsetTile.tsx
|
3297
4057
|
var MinimisedTile = ({ setMinimised }) => {
|
3298
|
-
return /* @__PURE__ */
|
4058
|
+
return /* @__PURE__ */ React46.createElement(Flex, { align: "center", css: { gap: "$6", r: "$1", bg: "$surface_default", p: "$4", color: "$on_surface_high" } }, /* @__PURE__ */ React46.createElement(AudioVideoToggle, { hideOptions: true }), /* @__PURE__ */ React46.createElement(Text, null, "You"), /* @__PURE__ */ React46.createElement(
|
3299
4059
|
IconButton_default,
|
3300
4060
|
{
|
3301
4061
|
className: "__cancel-drag-event",
|
3302
4062
|
onClick: () => setMinimised(false),
|
3303
4063
|
css: { bg: "transparent", border: "transparent" }
|
3304
4064
|
},
|
3305
|
-
/* @__PURE__ */
|
4065
|
+
/* @__PURE__ */ React46.createElement(ExpandIcon2, null)
|
3306
4066
|
));
|
3307
4067
|
};
|
3308
4068
|
var insetHeightPx = 180;
|
@@ -3310,12 +4070,12 @@ var insetMaxWidthPx = 240;
|
|
3310
4070
|
var defaultMobileAspectRatio = 9 / 16;
|
3311
4071
|
var desktopAspectRatio = 1 / defaultMobileAspectRatio;
|
3312
4072
|
var InsetTile = () => {
|
3313
|
-
const isMobile =
|
3314
|
-
const isLandscape =
|
3315
|
-
const localPeer =
|
4073
|
+
const isMobile = useMedia11(config.media.md);
|
4074
|
+
const isLandscape = useMedia11(config.media.ls);
|
4075
|
+
const localPeer = useHMSStore22(selectLocalPeer);
|
3316
4076
|
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
3317
|
-
const videoTrack =
|
3318
|
-
const isAllowedToPublish =
|
4077
|
+
const videoTrack = useHMSStore22(selectVideoTrackByID2(localPeer == null ? void 0 : localPeer.videoTrack));
|
4078
|
+
const isAllowedToPublish = useHMSStore22(selectIsAllowedToPublish2);
|
3319
4079
|
const videoTileProps = useVideoTileContext();
|
3320
4080
|
let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;
|
3321
4081
|
if ((videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) && !isMobile) {
|
@@ -3327,8 +4087,8 @@ var InsetTile = () => {
|
|
3327
4087
|
width = 240;
|
3328
4088
|
height = width / aspectRatio;
|
3329
4089
|
}
|
3330
|
-
const nodeRef =
|
3331
|
-
|
4090
|
+
const nodeRef = useRef8(null);
|
4091
|
+
useEffect10(() => {
|
3332
4092
|
const node = nodeRef.current;
|
3333
4093
|
if (!node || !window.ResizeObserver) {
|
3334
4094
|
return;
|
@@ -3349,7 +4109,7 @@ var InsetTile = () => {
|
|
3349
4109
|
if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {
|
3350
4110
|
return null;
|
3351
4111
|
}
|
3352
|
-
return /* @__PURE__ */
|
4112
|
+
return /* @__PURE__ */ React46.createElement(Draggable, { bounds: "parent", nodeRef, cancel: ".__cancel-drag-event" }, /* @__PURE__ */ React46.createElement(
|
3353
4113
|
Box,
|
3354
4114
|
{
|
3355
4115
|
ref: nodeRef,
|
@@ -3365,7 +4125,7 @@ var InsetTile = () => {
|
|
3365
4125
|
h: height
|
3366
4126
|
} : {})
|
3367
4127
|
},
|
3368
|
-
minimised ? /* @__PURE__ */
|
4128
|
+
minimised ? /* @__PURE__ */ React46.createElement(MinimisedTile, { setMinimised }) : /* @__PURE__ */ React46.createElement(
|
3369
4129
|
VideoTile_default,
|
3370
4130
|
__spreadProps(__spreadValues({
|
3371
4131
|
peerId: localPeer == null ? void 0 : localPeer.id,
|
@@ -3387,8 +4147,8 @@ var InsetTile = () => {
|
|
3387
4147
|
};
|
3388
4148
|
|
3389
4149
|
// src/Prebuilt/components/Pagination.tsx
|
3390
|
-
import
|
3391
|
-
import { ChevronLeftIcon as
|
4150
|
+
import React47, { useEffect as useEffect11 } from "react";
|
4151
|
+
import { ChevronLeftIcon as ChevronLeftIcon3, ChevronRightIcon as ChevronRightIcon2 } from "@100mslive/react-icons";
|
3392
4152
|
var Pagination = ({
|
3393
4153
|
page,
|
3394
4154
|
onPageChange,
|
@@ -3404,7 +4164,7 @@ var Pagination = ({
|
|
3404
4164
|
e.stopPropagation();
|
3405
4165
|
onPageChange(Math.max(page - 1, 0));
|
3406
4166
|
};
|
3407
|
-
|
4167
|
+
useEffect11(() => {
|
3408
4168
|
if (page >= numPages) {
|
3409
4169
|
onPageChange(Math.max(0, numPages - 1));
|
3410
4170
|
}
|
@@ -3412,7 +4172,7 @@ var Pagination = ({
|
|
3412
4172
|
if (numPages <= 1) {
|
3413
4173
|
return null;
|
3414
4174
|
}
|
3415
|
-
return /* @__PURE__ */
|
4175
|
+
return /* @__PURE__ */ React47.createElement(StyledPagination.Root, { css: { flexShrink: 0 } }, /* @__PURE__ */ React47.createElement(StyledPagination.Chevron, { disabled: disableLeft, onClick: prevPage }, /* @__PURE__ */ React47.createElement(ChevronLeftIcon3, { width: 16, height: 16, style: { cursor: disableLeft ? "not-allowed" : "pointer" } })), numPages <= 5 ? /* @__PURE__ */ React47.createElement(StyledPagination.Dots, null, [...Array(numPages)].map((_, i) => /* @__PURE__ */ React47.createElement(
|
3416
4176
|
StyledPagination.Dot,
|
3417
4177
|
{
|
3418
4178
|
key: i,
|
@@ -3422,15 +4182,15 @@ var Pagination = ({
|
|
3422
4182
|
onPageChange(i);
|
3423
4183
|
}
|
3424
4184
|
}
|
3425
|
-
))) : null, /* @__PURE__ */
|
4185
|
+
))) : null, /* @__PURE__ */ React47.createElement(StyledPagination.Chevron, { disabled: disableRight, onClick: nextPage }, /* @__PURE__ */ React47.createElement(ChevronRightIcon2, { width: 16, height: 16, style: { cursor: disableRight ? "not-allowed" : "pointer" } })));
|
3426
4186
|
};
|
3427
4187
|
|
3428
4188
|
// src/Prebuilt/components/VideoLayouts/Grid.tsx
|
3429
|
-
import
|
3430
|
-
var Grid =
|
4189
|
+
import React48 from "react";
|
4190
|
+
var Grid = React48.forwardRef(
|
3431
4191
|
({ tiles, edgeToEdge }, ref) => {
|
3432
4192
|
const videoTileProps = useVideoTileContext();
|
3433
|
-
return /* @__PURE__ */
|
4193
|
+
return /* @__PURE__ */ React48.createElement(
|
3434
4194
|
Box,
|
3435
4195
|
{
|
3436
4196
|
ref,
|
@@ -3448,7 +4208,7 @@ var Grid = React41.forwardRef(
|
|
3448
4208
|
},
|
3449
4209
|
tiles == null ? void 0 : tiles.map((tile) => {
|
3450
4210
|
var _a, _b, _c, _d;
|
3451
|
-
return /* @__PURE__ */
|
4211
|
+
return /* @__PURE__ */ React48.createElement(
|
3452
4212
|
VideoTile_default,
|
3453
4213
|
__spreadValues({
|
3454
4214
|
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
@@ -3466,8 +4226,8 @@ var Grid = React41.forwardRef(
|
|
3466
4226
|
);
|
3467
4227
|
|
3468
4228
|
// src/Prebuilt/components/hooks/useTileLayout.tsx
|
3469
|
-
import { useEffect as
|
3470
|
-
import { useMeasure as useMeasure2, useMedia as
|
4229
|
+
import { useEffect as useEffect12, useMemo as useMemo3, useState as useState24 } from "react";
|
4230
|
+
import { useMeasure as useMeasure2, useMedia as useMedia12 } from "react-use";
|
3471
4231
|
import {
|
3472
4232
|
getPeersWithTiles,
|
3473
4233
|
selectTracksMap as selectTracksMap3,
|
@@ -3477,12 +4237,12 @@ var aspectRatioConfig = { default: [1 / 1, 4 / 3, 16 / 9], mobile: [1 / 1, 3 / 4
|
|
3477
4237
|
var usePagesWithTiles = ({ peers, maxTileCount }) => {
|
3478
4238
|
const vanillaStore = useHMSVanillaStore3();
|
3479
4239
|
const tracksMap = vanillaStore.getState(selectTracksMap3);
|
3480
|
-
const peersWithTiles =
|
4240
|
+
const peersWithTiles = useMemo3(
|
3481
4241
|
() => getPeersWithTiles(peers, tracksMap, () => false),
|
3482
4242
|
[peers, tracksMap]
|
3483
4243
|
);
|
3484
4244
|
const noOfPages = Math.ceil(peersWithTiles.length / maxTileCount);
|
3485
|
-
const pagesList =
|
4245
|
+
const pagesList = useMemo3(() => {
|
3486
4246
|
let sliceStart = 0;
|
3487
4247
|
let remaining = peersWithTiles.length;
|
3488
4248
|
const list = [];
|
@@ -3503,9 +4263,9 @@ var useTileLayout = ({
|
|
3503
4263
|
}) => {
|
3504
4264
|
const vanillaStore = useHMSVanillaStore3();
|
3505
4265
|
const [ref, { width, height }] = useMeasure2();
|
3506
|
-
const isMobile =
|
3507
|
-
const [pagesWithTiles, setPagesWithTiles] =
|
3508
|
-
|
4266
|
+
const isMobile = useMedia12(config.media.lg);
|
4267
|
+
const [pagesWithTiles, setPagesWithTiles] = useState24([]);
|
4268
|
+
useEffect12(() => {
|
3509
4269
|
if (width === 0 || height === 0) {
|
3510
4270
|
return;
|
3511
4271
|
}
|
@@ -3572,15 +4332,15 @@ var useTileLayout = ({
|
|
3572
4332
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3573
4333
|
function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize, edgeToEdge }) {
|
3574
4334
|
var _a;
|
3575
|
-
const localPeer =
|
3576
|
-
const isMobile =
|
4335
|
+
const localPeer = useHMSStore23(selectLocalPeer2);
|
4336
|
+
const isMobile = useMedia13(config.media.md);
|
3577
4337
|
let maxTileCount = useUISettings(UI_SETTINGS.maxTileCount);
|
3578
4338
|
maxTileCount = isMobile ? Math.min(maxTileCount, 6) : maxTileCount;
|
3579
4339
|
let pageList = usePagesWithTiles({
|
3580
4340
|
peers,
|
3581
4341
|
maxTileCount
|
3582
4342
|
});
|
3583
|
-
const inputPeers =
|
4343
|
+
const inputPeers = useMemo4(
|
3584
4344
|
() => pageList.length === 0 ? localPeer ? [localPeer] : [] : peers,
|
3585
4345
|
[pageList.length, peers, localPeer]
|
3586
4346
|
);
|
@@ -3593,14 +4353,14 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3593
4353
|
maxTileCount,
|
3594
4354
|
edgeToEdge
|
3595
4355
|
});
|
3596
|
-
const [page, setPage] =
|
4356
|
+
const [page, setPage] = useState25(0);
|
3597
4357
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3598
|
-
|
4358
|
+
useEffect13(() => {
|
3599
4359
|
if (pageSize > 0) {
|
3600
4360
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3601
4361
|
}
|
3602
4362
|
}, [pageSize, onPageSize]);
|
3603
|
-
return /* @__PURE__ */
|
4363
|
+
return /* @__PURE__ */ React49.createElement(Flex, { direction: "column", css: { flex: "1 1 0", h: "100%", position: "relative", minWidth: 0 } }, /* @__PURE__ */ React49.createElement(Grid, { tiles: pagesWithTiles[page], ref, edgeToEdge }), !edgeToEdge && /* @__PURE__ */ React49.createElement(
|
3604
4364
|
Pagination,
|
3605
4365
|
{
|
3606
4366
|
page,
|
@@ -3610,20 +4370,20 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3610
4370
|
},
|
3611
4371
|
numPages: pagesWithTiles.length
|
3612
4372
|
}
|
3613
|
-
), isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== (localPeer == null ? void 0 : localPeer.id) && /* @__PURE__ */
|
4373
|
+
), isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== (localPeer == null ? void 0 : localPeer.id) && /* @__PURE__ */ React49.createElement(InsetTile, null));
|
3614
4374
|
}
|
3615
4375
|
|
3616
4376
|
// src/Prebuilt/components/VideoLayouts/RoleProminence.tsx
|
3617
|
-
import
|
3618
|
-
import { selectLocalPeer as selectLocalPeer3, useHMSStore as
|
4377
|
+
import React52, { useEffect as useEffect15, useState as useState27 } from "react";
|
4378
|
+
import { selectLocalPeer as selectLocalPeer3, useHMSStore as useHMSStore24 } from "@100mslive/react-sdk";
|
3619
4379
|
|
3620
4380
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3621
|
-
import
|
3622
|
-
import { useMedia as
|
4381
|
+
import React51, { useEffect as useEffect14, useState as useState26 } from "react";
|
4382
|
+
import { useMedia as useMedia14 } from "react-use";
|
3623
4383
|
|
3624
4384
|
// src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx
|
3625
|
-
import
|
3626
|
-
var Root = ({ children, edgeToEdge }) => /* @__PURE__ */
|
4385
|
+
import React50 from "react";
|
4386
|
+
var Root = ({ children, edgeToEdge }) => /* @__PURE__ */ React50.createElement(
|
3627
4387
|
Flex,
|
3628
4388
|
{
|
3629
4389
|
direction: "column",
|
@@ -3632,7 +4392,7 @@ var Root = ({ children, edgeToEdge }) => /* @__PURE__ */ React43.createElement(
|
|
3632
4392
|
children
|
3633
4393
|
);
|
3634
4394
|
var ProminentSection = ({ children, css = {} }) => {
|
3635
|
-
return /* @__PURE__ */
|
4395
|
+
return /* @__PURE__ */ React50.createElement(Flex, { direction: "column", css: __spreadValues({ flex: "1 1 0", gap: "$2", minHeight: 0 }, css) }, children);
|
3636
4396
|
};
|
3637
4397
|
var SecondarySection = ({
|
3638
4398
|
tiles,
|
@@ -3643,12 +4403,12 @@ var SecondarySection = ({
|
|
3643
4403
|
if (!(tiles == null ? void 0 : tiles.length)) {
|
3644
4404
|
return null;
|
3645
4405
|
}
|
3646
|
-
return /* @__PURE__ */
|
4406
|
+
return /* @__PURE__ */ React50.createElement(
|
3647
4407
|
Box,
|
3648
4408
|
{
|
3649
4409
|
css: {
|
3650
4410
|
display: "grid",
|
3651
|
-
gridTemplateRows:
|
4411
|
+
gridTemplateRows: React50.Children.count(children) > 0 ? "136px auto" : "154px",
|
3652
4412
|
gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))`,
|
3653
4413
|
margin: "0 auto",
|
3654
4414
|
gap: "$2 $4",
|
@@ -3658,7 +4418,7 @@ var SecondarySection = ({
|
|
3658
4418
|
},
|
3659
4419
|
tiles.map((tile) => {
|
3660
4420
|
var _a, _b, _c, _d;
|
3661
|
-
return /* @__PURE__ */
|
4421
|
+
return /* @__PURE__ */ React50.createElement(
|
3662
4422
|
VideoTile_default,
|
3663
4423
|
__spreadValues({
|
3664
4424
|
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
@@ -3675,7 +4435,7 @@ var SecondarySection = ({
|
|
3675
4435
|
}, tileLayoutProps)
|
3676
4436
|
);
|
3677
4437
|
}),
|
3678
|
-
/* @__PURE__ */
|
4438
|
+
/* @__PURE__ */ React50.createElement(Box, { css: { gridColumn: `1/span ${tiles.length}` } }, children)
|
3679
4439
|
);
|
3680
4440
|
};
|
3681
4441
|
var ProminenceLayout = {
|
@@ -3687,17 +4447,17 @@ var ProminenceLayout = {
|
|
3687
4447
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3688
4448
|
var SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
3689
4449
|
var _a;
|
3690
|
-
const isMobile =
|
4450
|
+
const isMobile = useMedia14(config.media.md);
|
3691
4451
|
const maxTileCount = isMobile ? 2 : 4;
|
3692
4452
|
const pagesWithTiles = usePagesWithTiles({ peers, maxTileCount });
|
3693
|
-
const [page, setPage] =
|
4453
|
+
const [page, setPage] = useState26(0);
|
3694
4454
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3695
|
-
|
4455
|
+
useEffect14(() => {
|
3696
4456
|
if (pageSize > 0) {
|
3697
4457
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3698
4458
|
}
|
3699
4459
|
}, [pageSize, onPageSize]);
|
3700
|
-
return /* @__PURE__ */
|
4460
|
+
return /* @__PURE__ */ React51.createElement(ProminenceLayout.SecondarySection, { tiles: pagesWithTiles[page], edgeToEdge }, !edgeToEdge && /* @__PURE__ */ React51.createElement(
|
3701
4461
|
Pagination,
|
3702
4462
|
{
|
3703
4463
|
page,
|
@@ -3711,10 +4471,10 @@ var SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
|
3711
4471
|
};
|
3712
4472
|
|
3713
4473
|
// src/Prebuilt/components/hooks/useRoleProminencePeers.tsx
|
3714
|
-
import { useMemo as
|
4474
|
+
import { useMemo as useMemo5 } from "react";
|
3715
4475
|
var useRoleProminencePeers = (prominentRoles, peers, isInsetEnabled) => {
|
3716
4476
|
const pinnedTrack = usePinnedTrack();
|
3717
|
-
const [prominentPeers, secondaryPeers] =
|
4477
|
+
const [prominentPeers, secondaryPeers] = useMemo5(() => {
|
3718
4478
|
return peers.reduce(
|
3719
4479
|
(acc, peer) => {
|
3720
4480
|
if (pinnedTrack) {
|
@@ -3755,7 +4515,7 @@ function RoleProminence({
|
|
3755
4515
|
}) {
|
3756
4516
|
var _a;
|
3757
4517
|
const { prominentPeers, secondaryPeers } = useRoleProminencePeers(prominentRoles, peers, isInsetEnabled);
|
3758
|
-
const localPeer =
|
4518
|
+
const localPeer = useHMSStore24(selectLocalPeer3);
|
3759
4519
|
const maxTileCount = 4;
|
3760
4520
|
const pageList = usePagesWithTiles({
|
3761
4521
|
peers: prominentPeers,
|
@@ -3765,14 +4525,14 @@ function RoleProminence({
|
|
3765
4525
|
pageList,
|
3766
4526
|
maxTileCount
|
3767
4527
|
});
|
3768
|
-
const [page, setPage] =
|
4528
|
+
const [page, setPage] = useState27(0);
|
3769
4529
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3770
|
-
|
4530
|
+
useEffect15(() => {
|
3771
4531
|
if (pageSize > 0) {
|
3772
4532
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3773
4533
|
}
|
3774
4534
|
}, [pageSize, onPageSize]);
|
3775
|
-
return /* @__PURE__ */
|
4535
|
+
return /* @__PURE__ */ React52.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React52.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React52.createElement(Grid, { ref, tiles: pagesWithTiles[page] })), !edgeToEdge && /* @__PURE__ */ React52.createElement(
|
3776
4536
|
Pagination,
|
3777
4537
|
{
|
3778
4538
|
page,
|
@@ -3782,34 +4542,34 @@ function RoleProminence({
|
|
3782
4542
|
},
|
3783
4543
|
numPages: pagesWithTiles.length
|
3784
4544
|
}
|
3785
|
-
), /* @__PURE__ */
|
4545
|
+
), /* @__PURE__ */ React52.createElement(SecondaryTiles, { peers: secondaryPeers, isInsetEnabled, edgeToEdge }), isInsetEnabled && localPeer && !prominentPeers.includes(localPeer) && /* @__PURE__ */ React52.createElement(InsetTile, null));
|
3786
4546
|
}
|
3787
4547
|
|
3788
4548
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
3789
|
-
import
|
3790
|
-
import { useMedia as
|
3791
|
-
import { selectPeersScreenSharing, useHMSStore as
|
4549
|
+
import React55, { useEffect as useEffect16, useMemo as useMemo6, useState as useState29 } from "react";
|
4550
|
+
import { useMedia as useMedia15 } from "react-use";
|
4551
|
+
import { selectPeersScreenSharing, useHMSStore as useHMSStore26 } from "@100mslive/react-sdk";
|
3792
4552
|
|
3793
4553
|
// src/Prebuilt/components/ScreenshareTile.jsx
|
3794
|
-
import
|
4554
|
+
import React54, { useRef as useRef9, useState as useState28 } from "react";
|
3795
4555
|
import { useFullscreen as useFullscreen2 } from "react-use";
|
3796
4556
|
import screenfull2 from "screenfull";
|
3797
4557
|
import {
|
3798
|
-
selectLocalPeerID as
|
3799
|
-
selectPeerByID as
|
4558
|
+
selectLocalPeerID as selectLocalPeerID7,
|
4559
|
+
selectPeerByID as selectPeerByID3,
|
3800
4560
|
selectScreenShareAudioByPeerID,
|
3801
4561
|
selectScreenShareByPeerID,
|
3802
|
-
useHMSStore as
|
4562
|
+
useHMSStore as useHMSStore25
|
3803
4563
|
} from "@100mslive/react-sdk";
|
3804
|
-
import { ExpandIcon as ExpandIcon3, ShrinkIcon } from "@100mslive/react-icons";
|
4564
|
+
import { ExpandIcon as ExpandIcon3, ShrinkIcon as ShrinkIcon2 } from "@100mslive/react-icons";
|
3805
4565
|
|
3806
4566
|
// src/Prebuilt/components/ScreenshareDisplay.jsx
|
3807
|
-
import
|
3808
|
-
import { useHMSActions as
|
3809
|
-
import { CrossIcon as
|
4567
|
+
import React53 from "react";
|
4568
|
+
import { useHMSActions as useHMSActions17 } from "@100mslive/react-sdk";
|
4569
|
+
import { CrossIcon as CrossIcon7, ShareScreenIcon as ShareScreenIcon3 } from "@100mslive/react-icons";
|
3810
4570
|
var ScreenshareDisplay = () => {
|
3811
|
-
const hmsActions =
|
3812
|
-
return /* @__PURE__ */
|
4571
|
+
const hmsActions = useHMSActions17();
|
4572
|
+
return /* @__PURE__ */ React53.createElement(
|
3813
4573
|
Flex,
|
3814
4574
|
{
|
3815
4575
|
direction: "column",
|
@@ -3821,9 +4581,9 @@ var ScreenshareDisplay = () => {
|
|
3821
4581
|
color: "$on_surface_high"
|
3822
4582
|
}
|
3823
4583
|
},
|
3824
|
-
/* @__PURE__ */
|
3825
|
-
/* @__PURE__ */
|
3826
|
-
/* @__PURE__ */
|
4584
|
+
/* @__PURE__ */ React53.createElement(ShareScreenIcon3, { width: 48, height: 48 }),
|
4585
|
+
/* @__PURE__ */ React53.createElement(Text, { variant: "h5", css: { m: "$8 0" } }, "You are sharing your screen"),
|
4586
|
+
/* @__PURE__ */ React53.createElement(
|
3827
4587
|
Button,
|
3828
4588
|
{
|
3829
4589
|
variant: "danger",
|
@@ -3833,7 +4593,7 @@ var ScreenshareDisplay = () => {
|
|
3833
4593
|
}),
|
3834
4594
|
"data-testid": "stop_screen_share_btn"
|
3835
4595
|
},
|
3836
|
-
/* @__PURE__ */
|
4596
|
+
/* @__PURE__ */ React53.createElement(CrossIcon7, { width: 18, height: 18 }),
|
3837
4597
|
"\xA0 Stop screen share"
|
3838
4598
|
)
|
3839
4599
|
);
|
@@ -3848,22 +4608,22 @@ var labelStyles = {
|
|
3848
4608
|
transform: "none",
|
3849
4609
|
flexShrink: 0
|
3850
4610
|
};
|
3851
|
-
var
|
3852
|
-
const isLocal =
|
3853
|
-
const track =
|
3854
|
-
const peer =
|
4611
|
+
var Tile2 = ({ peerId, width = "100%", height = "100%" }) => {
|
4612
|
+
const isLocal = useHMSStore25(selectLocalPeerID7) === peerId;
|
4613
|
+
const track = useHMSStore25(selectScreenShareByPeerID(peerId));
|
4614
|
+
const peer = useHMSStore25(selectPeerByID3(peerId));
|
3855
4615
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
3856
|
-
const [isMouseHovered, setIsMouseHovered] =
|
4616
|
+
const [isMouseHovered, setIsMouseHovered] = useState28(false);
|
3857
4617
|
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
3858
|
-
const fullscreenRef =
|
3859
|
-
const [fullscreen, setFullscreen] =
|
4618
|
+
const fullscreenRef = useRef9(null);
|
4619
|
+
const [fullscreen, setFullscreen] = useState28(false);
|
3860
4620
|
const isFullscreen = useFullscreen2(fullscreenRef, fullscreen, {
|
3861
4621
|
onClose: () => setFullscreen(false)
|
3862
4622
|
});
|
3863
4623
|
const isFullScreenSupported = screenfull2.isEnabled;
|
3864
|
-
const audioTrack =
|
4624
|
+
const audioTrack = useHMSStore25(selectScreenShareAudioByPeerID(peer == null ? void 0 : peer.id));
|
3865
4625
|
if (isLocal && !["browser", "window", "application"].includes(track == null ? void 0 : track.displaySurface)) {
|
3866
|
-
return /* @__PURE__ */
|
4626
|
+
return /* @__PURE__ */ React54.createElement(ScreenshareDisplay, null);
|
3867
4627
|
}
|
3868
4628
|
if (!peer) {
|
3869
4629
|
return null;
|
@@ -3873,7 +4633,7 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3873
4633
|
isLocal: false,
|
3874
4634
|
track
|
3875
4635
|
});
|
3876
|
-
return /* @__PURE__ */
|
4636
|
+
return /* @__PURE__ */ React54.createElement(StyledVideoTile.Root, { css: { width, height, p: 0, minHeight: 0 }, "data-testid": "screenshare_tile" }, /* @__PURE__ */ React54.createElement(
|
3877
4637
|
StyledVideoTile.Container,
|
3878
4638
|
{
|
3879
4639
|
transparentBg: true,
|
@@ -3884,9 +4644,9 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3884
4644
|
setIsMouseHovered(false);
|
3885
4645
|
}
|
3886
4646
|
},
|
3887
|
-
showStatsOnTiles ? /* @__PURE__ */
|
3888
|
-
isFullScreenSupported && isMouseHovered ? /* @__PURE__ */
|
3889
|
-
track ? /* @__PURE__ */
|
4647
|
+
showStatsOnTiles ? /* @__PURE__ */ React54.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
4648
|
+
isFullScreenSupported && isMouseHovered ? /* @__PURE__ */ React54.createElement(StyledVideoTile.FullScreenButton, { onClick: () => setFullscreen(!fullscreen) }, isFullscreen ? /* @__PURE__ */ React54.createElement(ShrinkIcon2, null) : /* @__PURE__ */ React54.createElement(ExpandIcon3, null)) : null,
|
4649
|
+
track ? /* @__PURE__ */ React54.createElement(
|
3890
4650
|
Video,
|
3891
4651
|
{
|
3892
4652
|
screenShare: true,
|
@@ -3896,8 +4656,8 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3896
4656
|
css: { minHeight: 0 }
|
3897
4657
|
}
|
3898
4658
|
) : null,
|
3899
|
-
/* @__PURE__ */
|
3900
|
-
isMouseHovered && !peer.isLocal ? /* @__PURE__ */
|
4659
|
+
/* @__PURE__ */ React54.createElement(StyledVideoTile.Info, { css: labelStyles }, label),
|
4660
|
+
isMouseHovered && !peer.isLocal ? /* @__PURE__ */ React54.createElement(
|
3901
4661
|
TileMenu_default,
|
3902
4662
|
{
|
3903
4663
|
isScreenshare: true,
|
@@ -3909,28 +4669,28 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3909
4669
|
) : null
|
3910
4670
|
));
|
3911
4671
|
};
|
3912
|
-
var ScreenshareTile =
|
4672
|
+
var ScreenshareTile = React54.memo(Tile2);
|
3913
4673
|
var ScreenshareTile_default = ScreenshareTile;
|
3914
4674
|
|
3915
4675
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
3916
4676
|
var ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
3917
4677
|
var _a;
|
3918
|
-
const peersSharing =
|
4678
|
+
const peersSharing = useHMSStore26(selectPeersScreenSharing);
|
3919
4679
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
3920
|
-
const [page, setPage] =
|
4680
|
+
const [page, setPage] = useState29(0);
|
3921
4681
|
const activeSharePeer = peersSharing[page];
|
3922
|
-
const isMobile =
|
3923
|
-
const secondaryPeers =
|
4682
|
+
const isMobile = useMedia15(config.media.md);
|
4683
|
+
const secondaryPeers = useMemo6(
|
3924
4684
|
() => isMobile ? activeSharePeer ? [activeSharePeer, ...peers.filter((p) => p.id !== (activeSharePeer == null ? void 0 : activeSharePeer.id))] : peers : peers.filter((p) => p.id !== (activeSharePeer == null ? void 0 : activeSharePeer.id)),
|
3925
4685
|
[activeSharePeer, peers, isMobile]
|
3926
4686
|
);
|
3927
|
-
|
4687
|
+
useEffect16(() => {
|
3928
4688
|
setActiveScreenSharePeer(isMobile ? "" : activeSharePeer == null ? void 0 : activeSharePeer.id);
|
3929
4689
|
return () => {
|
3930
4690
|
setActiveScreenSharePeer("");
|
3931
4691
|
};
|
3932
4692
|
}, [activeSharePeer == null ? void 0 : activeSharePeer.id, isMobile, setActiveScreenSharePeer]);
|
3933
|
-
return /* @__PURE__ */
|
4693
|
+
return /* @__PURE__ */ React55.createElement(ProminenceLayout.Root, { edgeToEdge }, /* @__PURE__ */ React55.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React55.createElement(ScreenshareTile_default, { peerId: (_a = peersSharing[page]) == null ? void 0 : _a.id }), !edgeToEdge && /* @__PURE__ */ React55.createElement(Pagination, { page, onPageChange: setPage, numPages: peersSharing.length })), /* @__PURE__ */ React55.createElement(
|
3934
4694
|
SecondaryTiles,
|
3935
4695
|
{
|
3936
4696
|
peers: secondaryPeers,
|
@@ -4035,23 +4795,23 @@ var GridLayout = ({
|
|
4035
4795
|
edge_to_edge = false,
|
4036
4796
|
hide_metadata_on_tile = false
|
4037
4797
|
}) => {
|
4038
|
-
const peerSharing =
|
4798
|
+
const peerSharing = useHMSStore27(selectPeerScreenSharing);
|
4039
4799
|
const pinnedTrack = usePinnedTrack();
|
4040
|
-
const peers =
|
4800
|
+
const peers = useHMSStore27(selectPeers2);
|
4041
4801
|
const isRoleProminence = prominentRoles.length && peers.some(
|
4042
4802
|
(peer) => peer.roleName && prominentRoles.includes(peer.roleName) && (peer.videoTrack || peer.audioTrack)
|
4043
4803
|
) || pinnedTrack;
|
4044
|
-
const updatedPeers =
|
4804
|
+
const updatedPeers = useMemo7(() => {
|
4045
4805
|
if (isInsetEnabled && !isRoleProminence && !peerSharing) {
|
4046
4806
|
return peers.filter((peer) => !peer.isLocal);
|
4047
4807
|
}
|
4048
4808
|
return peers;
|
4049
4809
|
}, [isInsetEnabled, isRoleProminence, peerSharing, peers]);
|
4050
4810
|
const vanillaStore = useHMSVanillaStore4();
|
4051
|
-
const [sortedPeers, setSortedPeers] =
|
4052
|
-
const peersSorter =
|
4053
|
-
const [pageSize, setPageSize] =
|
4054
|
-
const [mainPage, setMainPage] =
|
4811
|
+
const [sortedPeers, setSortedPeers] = useState30(updatedPeers);
|
4812
|
+
const peersSorter = useMemo7(() => new PeersSorter_default(vanillaStore), [vanillaStore]);
|
4813
|
+
const [pageSize, setPageSize] = useState30(0);
|
4814
|
+
const [mainPage, setMainPage] = useState30(0);
|
4055
4815
|
const tileLayout = {
|
4056
4816
|
enableSpotlightingPeer: enable_spotlighting_peer,
|
4057
4817
|
hideParticipantNameOnTile: hide_participant_name_on_tile,
|
@@ -4060,7 +4820,7 @@ var GridLayout = ({
|
|
4060
4820
|
hideMetadataOnTile: hide_metadata_on_tile,
|
4061
4821
|
objectFit: video_object_fit
|
4062
4822
|
};
|
4063
|
-
|
4823
|
+
useEffect17(() => {
|
4064
4824
|
if (mainPage !== 0) {
|
4065
4825
|
return;
|
4066
4826
|
}
|
@@ -4071,7 +4831,7 @@ var GridLayout = ({
|
|
4071
4831
|
peersSorter.onUpdate(setSortedPeers);
|
4072
4832
|
}, [mainPage, peersSorter, updatedPeers, pageSize]);
|
4073
4833
|
if (peerSharing) {
|
4074
|
-
return /* @__PURE__ */
|
4834
|
+
return /* @__PURE__ */ React56.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React56.createElement(
|
4075
4835
|
ScreenshareLayout,
|
4076
4836
|
{
|
4077
4837
|
peers: sortedPeers,
|
@@ -4081,7 +4841,7 @@ var GridLayout = ({
|
|
4081
4841
|
}
|
4082
4842
|
));
|
4083
4843
|
} else if (isRoleProminence) {
|
4084
|
-
return /* @__PURE__ */
|
4844
|
+
return /* @__PURE__ */ React56.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React56.createElement(
|
4085
4845
|
RoleProminence,
|
4086
4846
|
{
|
4087
4847
|
peers: sortedPeers,
|
@@ -4093,7 +4853,7 @@ var GridLayout = ({
|
|
4093
4853
|
}
|
4094
4854
|
));
|
4095
4855
|
}
|
4096
|
-
return /* @__PURE__ */
|
4856
|
+
return /* @__PURE__ */ React56.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React56.createElement(
|
4097
4857
|
EqualProminence,
|
4098
4858
|
{
|
4099
4859
|
peers: sortedPeers,
|
@@ -4106,46 +4866,46 @@ var GridLayout = ({
|
|
4106
4866
|
};
|
4107
4867
|
|
4108
4868
|
// src/Prebuilt/layouts/EmbedView.jsx
|
4109
|
-
import
|
4869
|
+
import React57, { useCallback as useCallback10, useEffect as useEffect18, useMemo as useMemo8, useRef as useRef10, useState as useState31 } from "react";
|
4110
4870
|
import {
|
4111
4871
|
selectPeers as selectPeers3,
|
4112
4872
|
selectPeerScreenSharing as selectPeerScreenSharing2,
|
4113
4873
|
throwErrorHandler,
|
4114
|
-
useHMSStore as
|
4874
|
+
useHMSStore as useHMSStore28,
|
4115
4875
|
useScreenShare as useScreenShare3
|
4116
4876
|
} from "@100mslive/react-sdk";
|
4117
4877
|
var EmbedView = () => {
|
4118
|
-
return /* @__PURE__ */
|
4878
|
+
return /* @__PURE__ */ React57.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React57.createElement(EmbedComponent, null));
|
4119
4879
|
};
|
4120
4880
|
var EmbebScreenShareView = ({ children }) => {
|
4121
|
-
const peers =
|
4122
|
-
const peerPresenting =
|
4881
|
+
const peers = useHMSStore28(selectPeers3);
|
4882
|
+
const peerPresenting = useHMSStore28(selectPeerScreenSharing2);
|
4123
4883
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
4124
|
-
const smallTilePeers =
|
4884
|
+
const smallTilePeers = useMemo8(() => {
|
4125
4885
|
const smallTilePeers2 = peers.filter((peer) => peer.id !== (peerPresenting == null ? void 0 : peerPresenting.id));
|
4126
4886
|
return smallTilePeers2;
|
4127
4887
|
}, [peers, peerPresenting]);
|
4128
|
-
|
4888
|
+
useEffect18(() => {
|
4129
4889
|
setActiveScreenSharePeer(peerPresenting == null ? void 0 : peerPresenting.id);
|
4130
4890
|
return () => {
|
4131
4891
|
setActiveScreenSharePeer("");
|
4132
4892
|
};
|
4133
4893
|
}, [peerPresenting == null ? void 0 : peerPresenting.id, setActiveScreenSharePeer]);
|
4134
|
-
return /* @__PURE__ */
|
4894
|
+
return /* @__PURE__ */ React57.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React57.createElement(ProminenceLayout.ProminentSection, null, children), /* @__PURE__ */ React57.createElement(SecondaryTiles, { peers: smallTilePeers }));
|
4135
4895
|
};
|
4136
4896
|
var EmbedComponent = () => {
|
4137
4897
|
const { amIScreenSharing, toggleScreenShare } = useScreenShare3(throwErrorHandler);
|
4138
4898
|
const [embedConfig, setEmbedConfig] = useSetAppDataByKey(APP_DATA.embedConfig);
|
4139
|
-
const [wasScreenShared, setWasScreenShared] =
|
4140
|
-
const screenShareAttemptInProgress =
|
4899
|
+
const [wasScreenShared, setWasScreenShared] = useState31(false);
|
4900
|
+
const screenShareAttemptInProgress = useRef10(false);
|
4141
4901
|
const src = embedConfig.url;
|
4142
|
-
const iframeRef =
|
4143
|
-
const resetEmbedConfig =
|
4902
|
+
const iframeRef = useRef10();
|
4903
|
+
const resetEmbedConfig = useCallback10(() => {
|
4144
4904
|
if (src) {
|
4145
4905
|
setEmbedConfig({ url: "" });
|
4146
4906
|
}
|
4147
4907
|
}, [src, setEmbedConfig]);
|
4148
|
-
|
4908
|
+
useEffect18(() => {
|
4149
4909
|
if (embedConfig.shareScreen && !amIScreenSharing && !wasScreenShared && !screenShareAttemptInProgress.current) {
|
4150
4910
|
screenShareAttemptInProgress.current = true;
|
4151
4911
|
toggleScreenShare({
|
@@ -4158,7 +4918,7 @@ var EmbedComponent = () => {
|
|
4158
4918
|
});
|
4159
4919
|
}
|
4160
4920
|
}, []);
|
4161
|
-
|
4921
|
+
useEffect18(() => {
|
4162
4922
|
if (wasScreenShared && !amIScreenSharing) {
|
4163
4923
|
resetEmbedConfig();
|
4164
4924
|
}
|
@@ -4169,7 +4929,7 @@ var EmbedComponent = () => {
|
|
4169
4929
|
}
|
4170
4930
|
};
|
4171
4931
|
}, [wasScreenShared, amIScreenSharing, resetEmbedConfig, toggleScreenShare]);
|
4172
|
-
return /* @__PURE__ */
|
4932
|
+
return /* @__PURE__ */ React57.createElement(Box, { ref: iframeRef, css: { size: "100%" } }, /* @__PURE__ */ React57.createElement(
|
4173
4933
|
"iframe",
|
4174
4934
|
{
|
4175
4935
|
src,
|
@@ -4182,28 +4942,28 @@ var EmbedComponent = () => {
|
|
4182
4942
|
};
|
4183
4943
|
|
4184
4944
|
// src/Prebuilt/layouts/PDFView.jsx
|
4185
|
-
import
|
4945
|
+
import React58, { useCallback as useCallback11, useEffect as useEffect19, useRef as useRef11, useState as useState32 } from "react";
|
4186
4946
|
import { throwErrorHandler as throwErrorHandler2, useScreenShare as useScreenShare4 } from "@100mslive/react-sdk";
|
4187
4947
|
var PDFView = () => {
|
4188
|
-
return /* @__PURE__ */
|
4948
|
+
return /* @__PURE__ */ React58.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React58.createElement(PDFEmbedComponent, null));
|
4189
4949
|
};
|
4190
4950
|
var PDFEmbedComponent = () => {
|
4191
|
-
const ref =
|
4951
|
+
const ref = useRef11();
|
4192
4952
|
const themeType = useTheme().themeType;
|
4193
|
-
const [isPDFLoaded, setIsPDFLoaded] =
|
4953
|
+
const [isPDFLoaded, setIsPDFLoaded] = useState32(false);
|
4194
4954
|
let pdfJSURL = define_process_env_default.REACT_APP_PDFJS_IFRAME_URL;
|
4195
4955
|
const { amIScreenSharing, toggleScreenShare } = useScreenShare4(throwErrorHandler2);
|
4196
4956
|
const [pdfConfig, setPDFConfig] = useSetAppDataByKey(APP_DATA.pdfConfig);
|
4197
4957
|
if (pdfConfig.url && !pdfConfig.file) {
|
4198
4958
|
pdfJSURL = pdfJSURL + "?file=" + encodeURIComponent(pdfConfig.url);
|
4199
4959
|
}
|
4200
|
-
const [wasScreenShared, setWasScreenShared] =
|
4201
|
-
const screenShareAttemptInProgress =
|
4202
|
-
const iframeRef =
|
4203
|
-
const resetEmbedConfig =
|
4960
|
+
const [wasScreenShared, setWasScreenShared] = useState32(false);
|
4961
|
+
const screenShareAttemptInProgress = useRef11(false);
|
4962
|
+
const iframeRef = useRef11();
|
4963
|
+
const resetEmbedConfig = useCallback11(() => {
|
4204
4964
|
setPDFConfig({ state: false });
|
4205
4965
|
}, [setPDFConfig]);
|
4206
|
-
|
4966
|
+
useEffect19(() => {
|
4207
4967
|
if (isPDFLoaded && ref.current) {
|
4208
4968
|
ref.current.contentWindow.postMessage(
|
4209
4969
|
{
|
@@ -4213,7 +4973,7 @@ var PDFEmbedComponent = () => {
|
|
4213
4973
|
);
|
4214
4974
|
}
|
4215
4975
|
}, [isPDFLoaded, themeType]);
|
4216
|
-
|
4976
|
+
useEffect19(() => {
|
4217
4977
|
if (!amIScreenSharing && !wasScreenShared && !screenShareAttemptInProgress.current) {
|
4218
4978
|
screenShareAttemptInProgress.current = true;
|
4219
4979
|
toggleScreenShare({
|
@@ -4227,7 +4987,7 @@ var PDFEmbedComponent = () => {
|
|
4227
4987
|
});
|
4228
4988
|
}
|
4229
4989
|
}, []);
|
4230
|
-
|
4990
|
+
useEffect19(() => {
|
4231
4991
|
if (wasScreenShared && !amIScreenSharing) {
|
4232
4992
|
resetEmbedConfig();
|
4233
4993
|
}
|
@@ -4238,7 +4998,7 @@ var PDFEmbedComponent = () => {
|
|
4238
4998
|
}
|
4239
4999
|
};
|
4240
5000
|
}, [wasScreenShared, amIScreenSharing, resetEmbedConfig, toggleScreenShare]);
|
4241
|
-
return /* @__PURE__ */
|
5001
|
+
return /* @__PURE__ */ React58.createElement(Box, { ref: iframeRef, css: { size: "100%" } }, /* @__PURE__ */ React58.createElement(
|
4242
5002
|
"iframe",
|
4243
5003
|
{
|
4244
5004
|
src: pdfJSURL,
|
@@ -4271,72 +5031,72 @@ var PDFEmbedComponent = () => {
|
|
4271
5031
|
};
|
4272
5032
|
|
4273
5033
|
// src/Prebuilt/layouts/SidePane.tsx
|
4274
|
-
import
|
4275
|
-
import { useMedia as
|
4276
|
-
import { selectAppData as selectAppData3, selectVideoTrackByPeerID, useHMSStore as
|
5034
|
+
import React65 from "react";
|
5035
|
+
import { useMedia as useMedia20 } from "react-use";
|
5036
|
+
import { selectAppData as selectAppData3, selectVideoTrackByPeerID as selectVideoTrackByPeerID3, useHMSStore as useHMSStore37 } from "@100mslive/react-sdk";
|
4277
5037
|
|
4278
5038
|
// src/Prebuilt/components/SidePaneTabs.tsx
|
4279
|
-
import
|
4280
|
-
import { useMedia as
|
4281
|
-
import { selectPeerCount as selectPeerCount3, useHMSStore as
|
4282
|
-
import { CrossIcon as
|
5039
|
+
import React62, { useEffect as useEffect24, useState as useState36 } from "react";
|
5040
|
+
import { useMedia as useMedia19 } from "react-use";
|
5041
|
+
import { selectPeerCount as selectPeerCount3, useHMSStore as useHMSStore34 } from "@100mslive/react-sdk";
|
5042
|
+
import { CrossIcon as CrossIcon9 } from "@100mslive/react-icons";
|
4283
5043
|
|
4284
5044
|
// src/Prebuilt/components/Chat/Chat.jsx
|
4285
|
-
import
|
4286
|
-
import { useMedia as
|
5045
|
+
import React61, { useCallback as useCallback16, useEffect as useEffect23, useRef as useRef15, useState as useState35 } from "react";
|
5046
|
+
import { useMedia as useMedia18 } from "react-use";
|
4287
5047
|
import {
|
4288
5048
|
HMSNotificationTypes,
|
4289
5049
|
selectHMSMessagesCount,
|
4290
|
-
selectPeerNameByID as
|
4291
|
-
selectPermissions as
|
4292
|
-
selectSessionStore,
|
4293
|
-
useHMSActions as
|
5050
|
+
selectPeerNameByID as selectPeerNameByID4,
|
5051
|
+
selectPermissions as selectPermissions12,
|
5052
|
+
selectSessionStore as selectSessionStore3,
|
5053
|
+
useHMSActions as useHMSActions22,
|
4294
5054
|
useHMSNotifications,
|
4295
|
-
useHMSStore as
|
5055
|
+
useHMSStore as useHMSStore33
|
4296
5056
|
} from "@100mslive/react-sdk";
|
4297
|
-
import { ChevronDownIcon as ChevronDownIcon2, CrossIcon as
|
5057
|
+
import { ChevronDownIcon as ChevronDownIcon2, CrossIcon as CrossIcon8, PinIcon as PinIcon3 } from "@100mslive/react-icons";
|
4298
5058
|
|
4299
5059
|
// src/Prebuilt/components/Chat/ChatBody.jsx
|
4300
|
-
import
|
5060
|
+
import React59, { Fragment as Fragment10, useCallback as useCallback13, useEffect as useEffect20, useLayoutEffect, useMemo as useMemo9, useRef as useRef12, useState as useState33 } from "react";
|
4301
5061
|
import { useInView } from "react-intersection-observer";
|
4302
|
-
import { useMedia as
|
5062
|
+
import { useMedia as useMedia16 } from "react-use";
|
4303
5063
|
import AutoSizer from "react-virtualized-auto-sizer";
|
4304
5064
|
import { VariableSizeList } from "react-window";
|
4305
5065
|
import {
|
4306
5066
|
selectHMSMessages,
|
4307
|
-
selectLocalPeerID as
|
4308
|
-
selectLocalPeerRoleName,
|
5067
|
+
selectLocalPeerID as selectLocalPeerID8,
|
5068
|
+
selectLocalPeerRoleName as selectLocalPeerRoleName2,
|
4309
5069
|
selectMessagesByPeerID,
|
4310
5070
|
selectMessagesByRole,
|
4311
|
-
selectPeerNameByID as
|
4312
|
-
selectPermissions as
|
4313
|
-
useHMSActions as
|
4314
|
-
useHMSStore as
|
5071
|
+
selectPeerNameByID as selectPeerNameByID3,
|
5072
|
+
selectPermissions as selectPermissions11,
|
5073
|
+
useHMSActions as useHMSActions19,
|
5074
|
+
useHMSStore as useHMSStore31
|
4315
5075
|
} from "@100mslive/react-sdk";
|
4316
|
-
import { PinIcon, VerticalMenuIcon as
|
5076
|
+
import { PinIcon as PinIcon2, VerticalMenuIcon as VerticalMenuIcon6 } from "@100mslive/react-icons";
|
4317
5077
|
|
4318
5078
|
// src/Prebuilt/images/empty-chat.svg
|
4319
5079
|
var empty_chat_default = 'data:image/svg+xml,<svg width="184" height="133" viewBox="0 0 184 133" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path fill-rule="evenodd" clip-rule="evenodd" d="M144.885 91.3998C145.318 91.023 145.861 90.7947 146.433 90.7483L146.446 90.7473L169.355 89.1614C169.702 89.1376 170.049 89.2101 170.358 89.3712C170.662 89.5305 170.918 89.7702 171.096 90.0642C171.098 90.0672 171.1 90.0703 171.102 90.0734L171.104 90.0766C171.281 90.3744 171.373 90.7154 171.369 91.062C171.365 91.4097 171.265 91.7496 171.08 92.044L158.85 111.504C158.539 111.986 158.081 112.356 157.544 112.56C157.007 112.764 156.419 112.791 155.866 112.636C155.313 112.482 154.823 112.155 154.469 111.703C154.115 111.25 153.915 110.697 153.898 110.123C153.898 110.109 153.898 110.094 153.898 110.08L153.996 100.307L145.347 95.7858C145.334 95.779 145.321 95.7721 145.308 95.7649C144.811 95.4785 144.417 95.0404 144.186 94.5146C143.955 93.9888 143.898 93.4029 144.024 92.8425C144.15 92.2821 144.451 91.7765 144.885 91.3998ZM167.441 91.0088L146.603 92.8952C146.49 92.9053 146.383 92.9508 146.298 93.0251C146.211 93.1005 146.151 93.2016 146.125 93.3137C146.1 93.4257 146.112 93.5429 146.158 93.6481C146.202 93.7484 146.276 93.8327 146.369 93.89L155.26 98.296L167.441 91.0088ZM156.32 100.171L168.547 92.8564L157.039 110.339C156.976 110.434 156.886 110.506 156.78 110.547C156.673 110.587 156.555 110.593 156.444 110.562C156.334 110.531 156.236 110.466 156.165 110.375C156.097 110.289 156.058 110.184 156.052 110.075L156.32 100.171Z" fill="%23444954"/>%0A<path d="M83.3248 35.4156C71.7182 47.1017 51.2098 75.5175 62.0292 95.6918C75.5536 120.91 140.453 79.2983 115.364 67.6657C90.2756 56.0331 65.8818 122.018 101.568 120.391C116.398 118.62 131.221 114.699 145.703 105.512" stroke="%23293042" stroke-width="2.25" stroke-dasharray="6 6"/>%0A<rect x="0.00256348" y="0.5" width="173.524" height="58.3398" rx="29.1699" fill="%23272A31"/>%0A<g opacity="0.4">%0A<rect x="24.7526" y="20.9312" width="111" height="4.5" rx="2.25" fill="%23444954"/>%0A</g>%0A<g opacity="0.4">%0A<rect x="38.2526" y="34.4312" width="110.25" height="4.5" rx="2.25" fill="%23444954"/>%0A</g>%0A<path d="M40.3918 71.5547L28.4246 55.0999L52.3589 55.0999L40.3918 71.5547Z" fill="%23272A31"/>%0A</svg>%0A';
|
4320
5080
|
|
4321
5081
|
// src/Prebuilt/components/hooks/useSetPinnedMessage.js
|
4322
|
-
import { useCallback as
|
5082
|
+
import { useCallback as useCallback12 } from "react";
|
4323
5083
|
import {
|
4324
|
-
selectPeerNameByID,
|
5084
|
+
selectPeerNameByID as selectPeerNameByID2,
|
4325
5085
|
selectSessionMetadata,
|
4326
|
-
useHMSActions as
|
4327
|
-
useHMSStore as
|
5086
|
+
useHMSActions as useHMSActions18,
|
5087
|
+
useHMSStore as useHMSStore29,
|
4328
5088
|
useHMSVanillaStore as useHMSVanillaStore5
|
4329
5089
|
} from "@100mslive/react-sdk";
|
4330
5090
|
var useSetPinnedMessage = () => {
|
4331
|
-
const hmsActions =
|
5091
|
+
const hmsActions = useHMSActions18();
|
4332
5092
|
const vanillaStore = useHMSVanillaStore5();
|
4333
|
-
const pinnedMessage =
|
4334
|
-
const setPinnedMessage =
|
5093
|
+
const pinnedMessage = useHMSStore29(selectSessionMetadata);
|
5094
|
+
const setPinnedMessage = useCallback12(
|
4335
5095
|
/**
|
4336
5096
|
* @param {import("@100mslive/react-sdk").HMSMessage | undefined} message
|
4337
5097
|
*/
|
4338
5098
|
(message) => __async(void 0, null, function* () {
|
4339
|
-
const peerName = vanillaStore.getState(
|
5099
|
+
const peerName = vanillaStore.getState(selectPeerNameByID2(message == null ? void 0 : message.sender)) || (message == null ? void 0 : message.senderName);
|
4340
5100
|
const newPinnedMessage = message ? peerName ? `${peerName}: ${message.message}` : message.message : null;
|
4341
5101
|
if (newPinnedMessage !== pinnedMessage) {
|
4342
5102
|
yield hmsActions.sessionStore.set(SESSION_STORE_KEY.PINNED_MESSAGE, newPinnedMessage).catch((err) => ToastManager.addToast({ title: err.description }));
|
@@ -4347,6 +5107,19 @@ var useSetPinnedMessage = () => {
|
|
4347
5107
|
return { setPinnedMessage };
|
4348
5108
|
};
|
4349
5109
|
|
5110
|
+
// src/Prebuilt/components/Chat/useUnreadCount.js
|
5111
|
+
import {
|
5112
|
+
selectMessagesUnreadCountByPeerID,
|
5113
|
+
selectMessagesUnreadCountByRole,
|
5114
|
+
selectUnreadHMSMessagesCount as selectUnreadHMSMessagesCount2,
|
5115
|
+
useHMSStore as useHMSStore30
|
5116
|
+
} from "@100mslive/react-sdk";
|
5117
|
+
var useUnreadCount = ({ role, peerId }) => {
|
5118
|
+
const unreadCountSelector = role ? selectMessagesUnreadCountByRole(role) : peerId ? selectMessagesUnreadCountByPeerID(peerId) : selectUnreadHMSMessagesCount2;
|
5119
|
+
const unreadCount = useHMSStore30(unreadCountSelector);
|
5120
|
+
return unreadCount;
|
5121
|
+
};
|
5122
|
+
|
4350
5123
|
// src/Prebuilt/components/Chat/ChatBody.jsx
|
4351
5124
|
var formatTime = (date) => {
|
4352
5125
|
if (!(date instanceof Date)) {
|
@@ -4364,7 +5137,7 @@ var formatTime = (date) => {
|
|
4364
5137
|
return `${hours}:${mins} ${suffix}`;
|
4365
5138
|
};
|
4366
5139
|
var MessageTypeContainer = ({ left, right }) => {
|
4367
|
-
return /* @__PURE__ */
|
5140
|
+
return /* @__PURE__ */ React59.createElement(
|
4368
5141
|
Flex,
|
4369
5142
|
{
|
4370
5143
|
align: "center",
|
@@ -4376,16 +5149,16 @@ var MessageTypeContainer = ({ left, right }) => {
|
|
4376
5149
|
r: "$0"
|
4377
5150
|
}
|
4378
5151
|
},
|
4379
|
-
left && /* @__PURE__ */
|
4380
|
-
left && right && /* @__PURE__ */
|
4381
|
-
right && /* @__PURE__ */
|
5152
|
+
left && /* @__PURE__ */ React59.createElement(SenderName, { variant: "tiny", as: "span", css: { color: "$on_surface_medium" } }, left),
|
5153
|
+
left && right && /* @__PURE__ */ React59.createElement(Box, { css: { borderLeft: "1px solid $border_bright", mx: "$4", h: "$8" } }),
|
5154
|
+
right && /* @__PURE__ */ React59.createElement(SenderName, { as: "span", variant: "tiny", css: { textTransform: "uppercase" } }, right)
|
4382
5155
|
);
|
4383
5156
|
};
|
4384
5157
|
var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
4385
|
-
const peerName =
|
4386
|
-
const localPeerRoleName =
|
5158
|
+
const peerName = useHMSStore31(selectPeerNameByID3(receiver));
|
5159
|
+
const localPeerRoleName = useHMSStore31(selectLocalPeerRoleName2);
|
4387
5160
|
if (receiver) {
|
4388
|
-
return /* @__PURE__ */
|
5161
|
+
return /* @__PURE__ */ React59.createElement(
|
4389
5162
|
MessageTypeContainer,
|
4390
5163
|
{
|
4391
5164
|
left: hasCurrentUserSent ? `${peerName ? `TO ${peerName}` : ""}` : "TO YOU",
|
@@ -4394,7 +5167,7 @@ var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
|
4394
5167
|
);
|
4395
5168
|
}
|
4396
5169
|
if (roles && roles.length) {
|
4397
|
-
return /* @__PURE__ */
|
5170
|
+
return /* @__PURE__ */ React59.createElement(MessageTypeContainer, { left: "TO", right: hasCurrentUserSent ? roles.join(",") : localPeerRoleName });
|
4398
5171
|
}
|
4399
5172
|
return null;
|
4400
5173
|
};
|
@@ -4408,10 +5181,10 @@ var Link = styled("a", {
|
|
4408
5181
|
});
|
4409
5182
|
var AnnotisedMessage = ({ message }) => {
|
4410
5183
|
if (!message) {
|
4411
|
-
return /* @__PURE__ */
|
5184
|
+
return /* @__PURE__ */ React59.createElement(Fragment10, null);
|
4412
5185
|
}
|
4413
|
-
return /* @__PURE__ */
|
4414
|
-
(part) => URL_REGEX.test(part) ? /* @__PURE__ */
|
5186
|
+
return /* @__PURE__ */ React59.createElement(Fragment10, null, message.trim().split(/(\s)/).map(
|
5187
|
+
(part) => URL_REGEX.test(part) ? /* @__PURE__ */ React59.createElement(Link, { href: part, key: part, target: "_blank", rel: "noopener noreferrer" }, part) : part
|
4415
5188
|
));
|
4416
5189
|
};
|
4417
5190
|
var getMessageType = ({ roles, receiver }) => {
|
@@ -4421,18 +5194,18 @@ var getMessageType = ({ roles, receiver }) => {
|
|
4421
5194
|
return receiver ? "private" : "";
|
4422
5195
|
};
|
4423
5196
|
var ChatActions = ({ onPin, showPinAction }) => {
|
4424
|
-
const [open, setOpen] =
|
5197
|
+
const [open, setOpen] = useState33(false);
|
4425
5198
|
if (!showPinAction) {
|
4426
5199
|
return null;
|
4427
5200
|
}
|
4428
|
-
return /* @__PURE__ */
|
5201
|
+
return /* @__PURE__ */ React59.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React59.createElement(Dropdown.Trigger, { className: "chat_actions", css: { opacity: open ? 1 : 0, "@md": { opacity: 1 } }, asChild: true }, /* @__PURE__ */ React59.createElement(IconButton, null, /* @__PURE__ */ React59.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React59.createElement(VerticalMenuIcon6, null)))), /* @__PURE__ */ React59.createElement(Dropdown.Portal, null, /* @__PURE__ */ React59.createElement(
|
4429
5202
|
Dropdown.Content,
|
4430
5203
|
{
|
4431
5204
|
sideOffset: 5,
|
4432
5205
|
align: "end",
|
4433
5206
|
css: { width: "$48", backgroundColor: "$surface_bright", py: "$0", border: "1px solid $border_bright" }
|
4434
5207
|
},
|
4435
|
-
/* @__PURE__ */
|
5208
|
+
/* @__PURE__ */ React59.createElement(Dropdown.Item, { "data-testid": "pin_message_btn", onClick: onPin }, /* @__PURE__ */ React59.createElement(PinIcon2, null), /* @__PURE__ */ React59.createElement(Text, { variant: "sm", css: { ml: "$4" } }, "Pin Message"))
|
4436
5209
|
)));
|
4437
5210
|
};
|
4438
5211
|
var SenderName = styled(Text, {
|
@@ -4444,120 +5217,127 @@ var SenderName = styled(Text, {
|
|
4444
5217
|
color: "$on_surface_high",
|
4445
5218
|
fontWeight: "$semiBold"
|
4446
5219
|
});
|
4447
|
-
var ChatMessage =
|
4448
|
-
|
4449
|
-
|
4450
|
-
|
4451
|
-
|
4452
|
-
|
4453
|
-
|
4454
|
-
|
4455
|
-
|
4456
|
-
|
4457
|
-
|
4458
|
-
|
4459
|
-
|
4460
|
-
|
4461
|
-
|
4462
|
-
|
4463
|
-
|
4464
|
-
|
4465
|
-
|
4466
|
-
|
4467
|
-
|
4468
|
-
|
4469
|
-
|
4470
|
-
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
4476
|
-
|
4477
|
-
|
4478
|
-
|
4479
|
-
|
4480
|
-
/* @__PURE__ */ React52.createElement(
|
4481
|
-
Flex,
|
5220
|
+
var ChatMessage = React59.memo(
|
5221
|
+
({ index, style = {}, message, setRowHeight, isLast = false, unreadCount = 0, scrollToBottom, onPin }) => {
|
5222
|
+
var _a, _b;
|
5223
|
+
const { ref, inView } = useInView({ threshold: 0.5, triggerOnce: true });
|
5224
|
+
const rowRef = useRef12(null);
|
5225
|
+
useEffect20(() => {
|
5226
|
+
if (rowRef.current) {
|
5227
|
+
setRowHeight(index, rowRef.current.clientHeight);
|
5228
|
+
}
|
5229
|
+
}, [index, setRowHeight]);
|
5230
|
+
const isMobile = useMedia16(config.media.md);
|
5231
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
5232
|
+
const isOverlay = ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isMobile;
|
5233
|
+
const hmsActions = useHMSActions19();
|
5234
|
+
const localPeerId = useHMSStore31(selectLocalPeerID8);
|
5235
|
+
const permissions = useHMSStore31(selectPermissions11);
|
5236
|
+
const messageType = getMessageType({
|
5237
|
+
roles: message.recipientRoles,
|
5238
|
+
receiver: message.recipientPeer
|
5239
|
+
});
|
5240
|
+
const showPinAction = permissions.removeOthers && !messageType && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.allow_pinning_messages);
|
5241
|
+
useEffect20(() => {
|
5242
|
+
if (message.id && !message.read && inView) {
|
5243
|
+
hmsActions.setMessageRead(true, message.id);
|
5244
|
+
}
|
5245
|
+
}, [message.read, hmsActions, inView, message.id]);
|
5246
|
+
useEffect20(() => {
|
5247
|
+
if (isLast && inView && unreadCount >= 1) {
|
5248
|
+
scrollToBottom(1);
|
5249
|
+
}
|
5250
|
+
}, [inView, isLast, scrollToBottom, unreadCount]);
|
5251
|
+
return /* @__PURE__ */ React59.createElement(
|
5252
|
+
Box,
|
4482
5253
|
{
|
4483
|
-
ref
|
4484
|
-
|
4485
|
-
css: {
|
4486
|
-
|
4487
|
-
// Theme independent color, token should not be used for transparent chat
|
4488
|
-
bg: messageType ? isOverlay ? "rgba(0, 0, 0, 0.64)" : "$surface_default" : void 0,
|
4489
|
-
r: messageType ? "$1" : void 0,
|
4490
|
-
px: messageType ? "$4" : "$2",
|
4491
|
-
py: messageType ? "$4" : 0,
|
4492
|
-
userSelect: "none"
|
4493
|
-
},
|
4494
|
-
key: message.time,
|
4495
|
-
"data-testid": "chat_msg"
|
5254
|
+
ref,
|
5255
|
+
as: "div",
|
5256
|
+
css: { mb: "$10", pr: "$10", mt: "$8", "&:hover .chat_actions": { opacity: 1 } },
|
5257
|
+
style
|
4496
5258
|
},
|
4497
|
-
/* @__PURE__ */
|
4498
|
-
|
5259
|
+
/* @__PURE__ */ React59.createElement(
|
5260
|
+
Flex,
|
4499
5261
|
{
|
5262
|
+
ref: rowRef,
|
5263
|
+
align: "center",
|
4500
5264
|
css: {
|
4501
|
-
|
4502
|
-
|
4503
|
-
|
4504
|
-
|
4505
|
-
|
4506
|
-
|
5265
|
+
flexWrap: "wrap",
|
5266
|
+
// Theme independent color, token should not be used for transparent chat
|
5267
|
+
bg: messageType ? isOverlay ? "rgba(0, 0, 0, 0.64)" : "$surface_default" : void 0,
|
5268
|
+
r: messageType ? "$1" : void 0,
|
5269
|
+
px: messageType ? "$4" : "$2",
|
5270
|
+
py: messageType ? "$4" : 0,
|
5271
|
+
userSelect: "none"
|
4507
5272
|
},
|
4508
|
-
|
5273
|
+
key: message.time,
|
5274
|
+
"data-testid": "chat_msg"
|
4509
5275
|
},
|
4510
|
-
/* @__PURE__ */
|
5276
|
+
/* @__PURE__ */ React59.createElement(
|
4511
5277
|
Text,
|
4512
5278
|
{
|
4513
|
-
as: "span",
|
4514
|
-
variant: "xs",
|
4515
5279
|
css: {
|
4516
|
-
|
4517
|
-
|
4518
|
-
|
4519
|
-
|
5280
|
+
color: isOverlay ? "#FFF" : "$on_surface_high",
|
5281
|
+
fontWeight: "$semiBold",
|
5282
|
+
display: "inline-flex",
|
5283
|
+
alignItems: "center",
|
5284
|
+
justifyContent: "space-between",
|
5285
|
+
width: "100%"
|
5286
|
+
},
|
5287
|
+
as: "div"
|
4520
5288
|
},
|
4521
|
-
|
4522
|
-
|
4523
|
-
|
4524
|
-
|
4525
|
-
|
4526
|
-
|
4527
|
-
|
4528
|
-
|
4529
|
-
|
5289
|
+
/* @__PURE__ */ React59.createElement(Flex, { align: "baseline" }, message.senderName === "You" || !message.senderName ? /* @__PURE__ */ React59.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName || "Anonymous") : /* @__PURE__ */ React59.createElement(Tooltip, { title: message.senderName, side: "top", align: "start" }, /* @__PURE__ */ React59.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName)), !isOverlay ? /* @__PURE__ */ React59.createElement(
|
5290
|
+
Text,
|
5291
|
+
{
|
5292
|
+
as: "span",
|
5293
|
+
variant: "xs",
|
5294
|
+
css: {
|
5295
|
+
ml: "$4",
|
5296
|
+
color: "$on_surface_medium",
|
5297
|
+
flexShrink: 0
|
5298
|
+
}
|
5299
|
+
},
|
5300
|
+
formatTime(message.time)
|
5301
|
+
) : null),
|
5302
|
+
/* @__PURE__ */ React59.createElement(
|
5303
|
+
MessageType,
|
5304
|
+
{
|
5305
|
+
hasCurrentUserSent: message.sender === localPeerId,
|
5306
|
+
receiver: message.recipientPeer,
|
5307
|
+
roles: message.recipientRoles
|
5308
|
+
}
|
5309
|
+
),
|
5310
|
+
!isOverlay ? /* @__PURE__ */ React59.createElement(ChatActions, { onPin, showPinAction }) : null
|
4530
5311
|
),
|
4531
|
-
|
4532
|
-
|
4533
|
-
|
4534
|
-
|
4535
|
-
|
4536
|
-
|
4537
|
-
|
4538
|
-
|
4539
|
-
|
4540
|
-
|
4541
|
-
|
4542
|
-
|
4543
|
-
|
5312
|
+
/* @__PURE__ */ React59.createElement(
|
5313
|
+
Text,
|
5314
|
+
{
|
5315
|
+
variant: "sm",
|
5316
|
+
css: {
|
5317
|
+
w: "100%",
|
5318
|
+
mt: "$2",
|
5319
|
+
wordBreak: "break-word",
|
5320
|
+
whiteSpace: "pre-wrap",
|
5321
|
+
userSelect: "all",
|
5322
|
+
color: isOverlay ? "#FFF" : "$on_surface_high"
|
5323
|
+
},
|
5324
|
+
onClick: (e) => e.stopPropagation()
|
4544
5325
|
},
|
4545
|
-
|
4546
|
-
|
4547
|
-
/* @__PURE__ */ React52.createElement(AnnotisedMessage, { message: message.message })
|
5326
|
+
/* @__PURE__ */ React59.createElement(AnnotisedMessage, { message: message.message })
|
5327
|
+
)
|
4548
5328
|
)
|
4549
|
-
)
|
4550
|
-
|
4551
|
-
|
4552
|
-
var ChatList =
|
4553
|
-
({ width, height, setRowHeight, getRowHeight, messages, scrollToBottom }, listRef) => {
|
5329
|
+
);
|
5330
|
+
}
|
5331
|
+
);
|
5332
|
+
var ChatList = React59.forwardRef(
|
5333
|
+
({ width, height, setRowHeight, getRowHeight, messages, unreadCount = 0, scrollToBottom }, listRef) => {
|
4554
5334
|
const { setPinnedMessage } = useSetPinnedMessage();
|
4555
5335
|
useLayoutEffect(() => {
|
4556
5336
|
if (listRef.current && listRef.current.scrollToItem) {
|
4557
5337
|
scrollToBottom(1);
|
4558
5338
|
}
|
4559
5339
|
}, [listRef]);
|
4560
|
-
return /* @__PURE__ */
|
5340
|
+
return /* @__PURE__ */ React59.createElement(
|
4561
5341
|
VariableSizeList,
|
4562
5342
|
{
|
4563
5343
|
ref: listRef,
|
@@ -4569,7 +5349,7 @@ var ChatList = React52.forwardRef(
|
|
4569
5349
|
overflowX: "hidden"
|
4570
5350
|
}
|
4571
5351
|
},
|
4572
|
-
({ index, style }) => /* @__PURE__ */
|
5352
|
+
({ index, style }) => /* @__PURE__ */ React59.createElement(
|
4573
5353
|
ChatMessage,
|
4574
5354
|
{
|
4575
5355
|
style,
|
@@ -4577,25 +5357,28 @@ var ChatList = React52.forwardRef(
|
|
4577
5357
|
key: messages[index].id,
|
4578
5358
|
message: messages[index],
|
4579
5359
|
setRowHeight,
|
5360
|
+
unreadCount,
|
5361
|
+
isLast: index >= messages.length - 2,
|
5362
|
+
scrollToBottom,
|
4580
5363
|
onPin: () => setPinnedMessage(messages[index])
|
4581
5364
|
}
|
4582
5365
|
)
|
4583
5366
|
);
|
4584
5367
|
}
|
4585
5368
|
);
|
4586
|
-
var VirtualizedChatMessages =
|
4587
|
-
const rowHeights =
|
5369
|
+
var VirtualizedChatMessages = React59.forwardRef(({ messages, unreadCount = 0, scrollToBottom }, listRef) => {
|
5370
|
+
const rowHeights = useRef12({});
|
4588
5371
|
function getRowHeight(index) {
|
4589
5372
|
return rowHeights.current[index] + 16 || 72;
|
4590
5373
|
}
|
4591
|
-
const setRowHeight =
|
5374
|
+
const setRowHeight = useCallback13(
|
4592
5375
|
(index, size) => {
|
4593
5376
|
listRef.current.resetAfterIndex(0);
|
4594
5377
|
rowHeights.current = __spreadProps(__spreadValues({}, rowHeights.current), { [index]: size });
|
4595
5378
|
},
|
4596
5379
|
[listRef]
|
4597
5380
|
);
|
4598
|
-
return /* @__PURE__ */
|
5381
|
+
return /* @__PURE__ */ React59.createElement(
|
4599
5382
|
Box,
|
4600
5383
|
{
|
4601
5384
|
css: {
|
@@ -4604,14 +5387,14 @@ var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom },
|
|
4604
5387
|
},
|
4605
5388
|
as: "div"
|
4606
5389
|
},
|
4607
|
-
/* @__PURE__ */
|
5390
|
+
/* @__PURE__ */ React59.createElement(
|
4608
5391
|
AutoSizer,
|
4609
5392
|
{
|
4610
5393
|
style: {
|
4611
5394
|
width: "90%"
|
4612
5395
|
}
|
4613
5396
|
},
|
4614
|
-
({ height, width }) => /* @__PURE__ */
|
5397
|
+
({ height, width }) => /* @__PURE__ */ React59.createElement(
|
4615
5398
|
ChatList,
|
4616
5399
|
{
|
4617
5400
|
width,
|
@@ -4620,21 +5403,23 @@ var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom },
|
|
4620
5403
|
setRowHeight,
|
4621
5404
|
getRowHeight,
|
4622
5405
|
scrollToBottom,
|
4623
|
-
ref: listRef
|
5406
|
+
ref: listRef,
|
5407
|
+
unreadCount
|
4624
5408
|
}
|
4625
5409
|
)
|
4626
5410
|
)
|
4627
5411
|
);
|
4628
5412
|
});
|
4629
|
-
var ChatBody =
|
5413
|
+
var ChatBody = React59.forwardRef(({ role, peerId, scrollToBottom }, listRef) => {
|
4630
5414
|
var _a;
|
4631
5415
|
const storeMessageSelector = role ? selectMessagesByRole(role) : peerId ? selectMessagesByPeerID(peerId) : selectHMSMessages;
|
4632
|
-
let messages =
|
4633
|
-
messages =
|
4634
|
-
const isMobile =
|
5416
|
+
let messages = useHMSStore31(storeMessageSelector);
|
5417
|
+
messages = useMemo9(() => (messages == null ? void 0 : messages.filter((message) => message.type === "chat")) || [], [messages]);
|
5418
|
+
const isMobile = useMedia16(config.media.md);
|
4635
5419
|
const { elements } = useRoomLayoutConferencingScreen();
|
5420
|
+
const unreadCount = useUnreadCount({ role, peerId });
|
4636
5421
|
if (messages.length === 0 && !(isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay))) {
|
4637
|
-
return /* @__PURE__ */
|
5422
|
+
return /* @__PURE__ */ React59.createElement(
|
4638
5423
|
Flex,
|
4639
5424
|
{
|
4640
5425
|
css: {
|
@@ -4646,7 +5431,7 @@ var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4646
5431
|
align: "center",
|
4647
5432
|
justify: "center"
|
4648
5433
|
},
|
4649
|
-
/* @__PURE__ */
|
5434
|
+
/* @__PURE__ */ React59.createElement(Box, null, /* @__PURE__ */ React59.createElement("img", { src: empty_chat_default, alt: "Empty Chat", height: 132, width: 185, style: { margin: "0 auto" } }), /* @__PURE__ */ React59.createElement(Text, { variant: "h5", css: { mt: "$8", c: "$on_surface_high" } }, "Start a conversation"), /* @__PURE__ */ React59.createElement(
|
4650
5435
|
Text,
|
4651
5436
|
{
|
4652
5437
|
variant: "sm",
|
@@ -4656,27 +5441,35 @@ var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4656
5441
|
))
|
4657
5442
|
);
|
4658
5443
|
}
|
4659
|
-
return /* @__PURE__ */
|
5444
|
+
return /* @__PURE__ */ React59.createElement(Fragment10, null, /* @__PURE__ */ React59.createElement(
|
5445
|
+
VirtualizedChatMessages,
|
5446
|
+
{
|
5447
|
+
messages,
|
5448
|
+
scrollToBottom,
|
5449
|
+
unreadCount,
|
5450
|
+
ref: listRef
|
5451
|
+
}
|
5452
|
+
));
|
4660
5453
|
});
|
4661
5454
|
|
4662
5455
|
// src/Prebuilt/components/Chat/ChatFooter.tsx
|
4663
|
-
import
|
4664
|
-
import { useMedia as
|
5456
|
+
import React60, { useCallback as useCallback15, useEffect as useEffect22, useRef as useRef14, useState as useState34 } from "react";
|
5457
|
+
import { useMedia as useMedia17 } from "react-use";
|
4665
5458
|
import data2 from "@emoji-mart/data";
|
4666
5459
|
import Picker from "@emoji-mart/react";
|
4667
|
-
import { useHMSActions as
|
5460
|
+
import { useHMSActions as useHMSActions21 } from "@100mslive/react-sdk";
|
4668
5461
|
import { EmojiIcon as EmojiIcon3, SendIcon } from "@100mslive/react-icons";
|
4669
5462
|
|
4670
5463
|
// src/Prebuilt/components/AppData/useChatState.js
|
4671
|
-
import { useCallback as
|
4672
|
-
import { selectAppData as selectAppData2, useHMSActions as
|
5464
|
+
import { useCallback as useCallback14 } from "react";
|
5465
|
+
import { selectAppData as selectAppData2, useHMSActions as useHMSActions20, useHMSStore as useHMSStore32 } from "@100mslive/react-sdk";
|
4673
5466
|
var useChatDraftMessage = () => {
|
4674
|
-
const hmsActions =
|
4675
|
-
let chatDraftMessage =
|
5467
|
+
const hmsActions = useHMSActions20();
|
5468
|
+
let chatDraftMessage = useHMSStore32(selectAppData2(APP_DATA.chatDraft));
|
4676
5469
|
if (chatDraftMessage === void 0 || chatDraftMessage === null) {
|
4677
5470
|
chatDraftMessage = "";
|
4678
5471
|
}
|
4679
|
-
const setDraftMessage =
|
5472
|
+
const setDraftMessage = useCallback14(
|
4680
5473
|
(message) => {
|
4681
5474
|
hmsActions.setAppData(APP_DATA.chatDraft, message, true);
|
4682
5475
|
},
|
@@ -4686,10 +5479,10 @@ var useChatDraftMessage = () => {
|
|
4686
5479
|
};
|
4687
5480
|
|
4688
5481
|
// src/Prebuilt/components/Chat/useEmojiPickerStyles.js
|
4689
|
-
import { useEffect as
|
5482
|
+
import { useEffect as useEffect21, useRef as useRef13 } from "react";
|
4690
5483
|
var useEmojiPickerStyles = (showing) => {
|
4691
|
-
const ref =
|
4692
|
-
|
5484
|
+
const ref = useRef13(null);
|
5485
|
+
useEffect21(() => {
|
4693
5486
|
if (showing) {
|
4694
5487
|
setTimeout(() => {
|
4695
5488
|
var _a, _b;
|
@@ -4737,9 +5530,9 @@ var TextArea = styled("textarea", {
|
|
4737
5530
|
}
|
4738
5531
|
});
|
4739
5532
|
function EmojiPicker({ onSelect }) {
|
4740
|
-
const [showEmoji, setShowEmoji] =
|
5533
|
+
const [showEmoji, setShowEmoji] = useState34(false);
|
4741
5534
|
const ref = useEmojiPickerStyles(showEmoji);
|
4742
|
-
return /* @__PURE__ */
|
5535
|
+
return /* @__PURE__ */ React60.createElement(Popover.Root, { open: showEmoji, onOpenChange: setShowEmoji }, /* @__PURE__ */ React60.createElement(Popover.Trigger, { asChild: true, css: { appearance: "none" } }, /* @__PURE__ */ React60.createElement(IconButton, { as: "div" }, /* @__PURE__ */ React60.createElement(EmojiIcon3, null))), /* @__PURE__ */ React60.createElement(Popover.Portal, null, /* @__PURE__ */ React60.createElement(
|
4743
5536
|
Popover.Content,
|
4744
5537
|
{
|
4745
5538
|
alignOffset: -40,
|
@@ -4749,7 +5542,7 @@ function EmojiPicker({ onSelect }) {
|
|
4749
5542
|
p: 0
|
4750
5543
|
}
|
4751
5544
|
},
|
4752
|
-
/* @__PURE__ */
|
5545
|
+
/* @__PURE__ */ React60.createElement(
|
4753
5546
|
Box,
|
4754
5547
|
{
|
4755
5548
|
css: {
|
@@ -4758,7 +5551,7 @@ function EmojiPicker({ onSelect }) {
|
|
4758
5551
|
},
|
4759
5552
|
ref
|
4760
5553
|
},
|
4761
|
-
/* @__PURE__ */
|
5554
|
+
/* @__PURE__ */ React60.createElement(Picker, { onEmojiSelect: onSelect, data: data2, previewPosition: "none", skinPosition: "search" })
|
4762
5555
|
)
|
4763
5556
|
)));
|
4764
5557
|
}
|
@@ -4769,13 +5562,13 @@ var ChatFooter = ({
|
|
4769
5562
|
children
|
4770
5563
|
}) => {
|
4771
5564
|
var _a;
|
4772
|
-
const hmsActions =
|
4773
|
-
const inputRef =
|
5565
|
+
const hmsActions = useHMSActions21();
|
5566
|
+
const inputRef = useRef14(null);
|
4774
5567
|
const [draftMessage, setDraftMessage] = useChatDraftMessage();
|
4775
|
-
const isMobile =
|
5568
|
+
const isMobile = useMedia17(config.media.md);
|
4776
5569
|
const { elements } = useRoomLayoutConferencingScreen();
|
4777
5570
|
const isOverlayChat = (_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay;
|
4778
|
-
const sendMessage =
|
5571
|
+
const sendMessage = useCallback15(() => __async(void 0, null, function* () {
|
4779
5572
|
var _a2;
|
4780
5573
|
const message = (_a2 = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a2.value;
|
4781
5574
|
if (!message || !message.trim().length) {
|
@@ -4798,19 +5591,19 @@ var ChatFooter = ({
|
|
4798
5591
|
ToastManager.addToast({ title: err.message });
|
4799
5592
|
}
|
4800
5593
|
}), [role, peerId, hmsActions, onSend]);
|
4801
|
-
|
5594
|
+
useEffect22(() => {
|
4802
5595
|
const messageElement = inputRef.current;
|
4803
5596
|
if (messageElement) {
|
4804
5597
|
messageElement.value = draftMessage;
|
4805
5598
|
}
|
4806
5599
|
}, [draftMessage]);
|
4807
|
-
|
5600
|
+
useEffect22(() => {
|
4808
5601
|
const messageElement = inputRef.current;
|
4809
5602
|
return () => {
|
4810
5603
|
setDraftMessage((messageElement == null ? void 0 : messageElement.value) || "");
|
4811
5604
|
};
|
4812
5605
|
}, [setDraftMessage]);
|
4813
|
-
return /* @__PURE__ */
|
5606
|
+
return /* @__PURE__ */ React60.createElement(React60.Fragment, null, /* @__PURE__ */ React60.createElement(Flex, { align: "center", css: { gap: "$4", w: "100%" } }, /* @__PURE__ */ React60.createElement(
|
4814
5607
|
Flex,
|
4815
5608
|
{
|
4816
5609
|
align: "center",
|
@@ -4831,7 +5624,7 @@ var ChatFooter = ({
|
|
4831
5624
|
}
|
4832
5625
|
},
|
4833
5626
|
children,
|
4834
|
-
/* @__PURE__ */
|
5627
|
+
/* @__PURE__ */ React60.createElement(
|
4835
5628
|
TextArea,
|
4836
5629
|
{
|
4837
5630
|
css: {
|
@@ -4859,7 +5652,7 @@ var ChatFooter = ({
|
|
4859
5652
|
onCopy: (e) => e.stopPropagation()
|
4860
5653
|
}
|
4861
5654
|
),
|
4862
|
-
!isMobile ? /* @__PURE__ */
|
5655
|
+
!isMobile ? /* @__PURE__ */ React60.createElement(
|
4863
5656
|
EmojiPicker,
|
4864
5657
|
{
|
4865
5658
|
onSelect: (emoji) => {
|
@@ -4869,7 +5662,7 @@ var ChatFooter = ({
|
|
4869
5662
|
}
|
4870
5663
|
}
|
4871
5664
|
) : null,
|
4872
|
-
/* @__PURE__ */
|
5665
|
+
/* @__PURE__ */ React60.createElement(
|
4873
5666
|
IconButton,
|
4874
5667
|
{
|
4875
5668
|
className: "send-msg",
|
@@ -4882,31 +5675,18 @@ var ChatFooter = ({
|
|
4882
5675
|
},
|
4883
5676
|
"data-testid": "send_msg_btn"
|
4884
5677
|
},
|
4885
|
-
/* @__PURE__ */
|
5678
|
+
/* @__PURE__ */ React60.createElement(SendIcon, null)
|
4886
5679
|
)
|
4887
5680
|
)));
|
4888
5681
|
};
|
4889
5682
|
|
4890
|
-
// src/Prebuilt/components/Chat/useUnreadCount.js
|
4891
|
-
import {
|
4892
|
-
selectMessagesUnreadCountByPeerID,
|
4893
|
-
selectMessagesUnreadCountByRole,
|
4894
|
-
selectUnreadHMSMessagesCount as selectUnreadHMSMessagesCount2,
|
4895
|
-
useHMSStore as useHMSStore28
|
4896
|
-
} from "@100mslive/react-sdk";
|
4897
|
-
var useUnreadCount = ({ role, peerId }) => {
|
4898
|
-
const unreadCountSelector = role ? selectMessagesUnreadCountByRole(role) : peerId ? selectMessagesUnreadCountByPeerID(peerId) : selectUnreadHMSMessagesCount2;
|
4899
|
-
const unreadCount = useHMSStore28(unreadCountSelector);
|
4900
|
-
return unreadCount;
|
4901
|
-
};
|
4902
|
-
|
4903
5683
|
// src/Prebuilt/components/Chat/Chat.jsx
|
4904
5684
|
var PINNED_MESSAGE_LENGTH = 80;
|
4905
5685
|
var PinnedMessage = ({ clearPinnedMessage }) => {
|
4906
|
-
const permissions =
|
4907
|
-
const pinnedMessage =
|
5686
|
+
const permissions = useHMSStore33(selectPermissions12);
|
5687
|
+
const pinnedMessage = useHMSStore33(selectSessionStore3(SESSION_STORE_KEY.PINNED_MESSAGE));
|
4908
5688
|
const formattedPinnedMessage = (pinnedMessage == null ? void 0 : pinnedMessage.length) && pinnedMessage.length > PINNED_MESSAGE_LENGTH ? `${pinnedMessage.slice(0, PINNED_MESSAGE_LENGTH)}...` : pinnedMessage;
|
4909
|
-
return pinnedMessage ? /* @__PURE__ */
|
5689
|
+
return pinnedMessage ? /* @__PURE__ */ React61.createElement(
|
4910
5690
|
Flex,
|
4911
5691
|
{
|
4912
5692
|
title: pinnedMessage,
|
@@ -4914,8 +5694,8 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
4914
5694
|
align: "center",
|
4915
5695
|
justify: "between"
|
4916
5696
|
},
|
4917
|
-
/* @__PURE__ */
|
4918
|
-
/* @__PURE__ */
|
5697
|
+
/* @__PURE__ */ React61.createElement(PinIcon3, null),
|
5698
|
+
/* @__PURE__ */ React61.createElement(
|
4919
5699
|
Box,
|
4920
5700
|
{
|
4921
5701
|
css: {
|
@@ -4925,15 +5705,15 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
4925
5705
|
overflowY: "auto"
|
4926
5706
|
}
|
4927
5707
|
},
|
4928
|
-
/* @__PURE__ */
|
5708
|
+
/* @__PURE__ */ React61.createElement(Text, { variant: "sm" }, /* @__PURE__ */ React61.createElement(AnnotisedMessage, { message: formattedPinnedMessage }))
|
4929
5709
|
),
|
4930
|
-
permissions.removeOthers && /* @__PURE__ */
|
5710
|
+
permissions.removeOthers && /* @__PURE__ */ React61.createElement(
|
4931
5711
|
Flex,
|
4932
5712
|
{
|
4933
5713
|
onClick: () => clearPinnedMessage(),
|
4934
5714
|
css: { cursor: "pointer", color: "$on_surface_medium", "&:hover": { color: "$on_surface_high" } }
|
4935
5715
|
},
|
4936
|
-
/* @__PURE__ */
|
5716
|
+
/* @__PURE__ */ React61.createElement(CrossIcon8, null)
|
4937
5717
|
)
|
4938
5718
|
) : null;
|
4939
5719
|
};
|
@@ -4942,17 +5722,17 @@ var Chat = ({ screenType }) => {
|
|
4942
5722
|
const notification = useHMSNotifications(HMSNotificationTypes.PEER_LEFT);
|
4943
5723
|
const [peerSelector, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER_ID);
|
4944
5724
|
const [roleSelector, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
4945
|
-
const peerName =
|
4946
|
-
const [chatOptions, setChatOptions] =
|
5725
|
+
const peerName = useHMSStore33(selectPeerNameByID4(peerSelector));
|
5726
|
+
const [chatOptions, setChatOptions] = useState35({
|
4947
5727
|
role: roleSelector || "",
|
4948
5728
|
peerId: peerSelector && peerName ? peerSelector : "",
|
4949
5729
|
selection: roleSelector ? roleSelector : peerSelector && peerName ? peerName : "Everyone"
|
4950
5730
|
});
|
4951
|
-
const [isSelectorOpen] =
|
4952
|
-
const listRef =
|
4953
|
-
const hmsActions =
|
5731
|
+
const [isSelectorOpen] = useState35(false);
|
5732
|
+
const listRef = useRef15(null);
|
5733
|
+
const hmsActions = useHMSActions22();
|
4954
5734
|
const { setPinnedMessage } = useSetPinnedMessage();
|
4955
|
-
|
5735
|
+
useEffect23(() => {
|
4956
5736
|
if (notification && notification.data && peerSelector === notification.data.id) {
|
4957
5737
|
setPeerSelector("");
|
4958
5738
|
setChatOptions({
|
@@ -4964,14 +5744,14 @@ var Chat = ({ screenType }) => {
|
|
4964
5744
|
}, [notification, peerSelector, setPeerSelector]);
|
4965
5745
|
const storeMessageSelector = selectHMSMessagesCount;
|
4966
5746
|
const { elements } = useRoomLayoutConferencingScreen();
|
4967
|
-
const isMobile =
|
5747
|
+
const isMobile = useMedia18(config.media.md);
|
4968
5748
|
let isScrolledToBottom = false;
|
4969
5749
|
if (listRef.current) {
|
4970
5750
|
const currentRef = listRef.current._outerRef;
|
4971
5751
|
isScrolledToBottom = currentRef.scrollHeight - currentRef.clientHeight - currentRef.scrollTop < 10;
|
4972
5752
|
}
|
4973
|
-
const messagesCount =
|
4974
|
-
const scrollToBottom =
|
5753
|
+
const messagesCount = useHMSStore33(storeMessageSelector) || 0;
|
5754
|
+
const scrollToBottom = useCallback16(
|
4975
5755
|
(unreadCount = 0) => {
|
4976
5756
|
var _a2;
|
4977
5757
|
if (listRef.current && listRef.current.scrollToItem && unreadCount > 0) {
|
@@ -4985,7 +5765,7 @@ var Chat = ({ screenType }) => {
|
|
4985
5765
|
},
|
4986
5766
|
[hmsActions, messagesCount]
|
4987
5767
|
);
|
4988
|
-
return /* @__PURE__ */
|
5768
|
+
return /* @__PURE__ */ React61.createElement(
|
4989
5769
|
Flex,
|
4990
5770
|
{
|
4991
5771
|
direction: "column",
|
@@ -4994,8 +5774,8 @@ var Chat = ({ screenType }) => {
|
|
4994
5774
|
gap: "$4"
|
4995
5775
|
}
|
4996
5776
|
},
|
4997
|
-
isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) ? null : /* @__PURE__ */
|
4998
|
-
/* @__PURE__ */
|
5777
|
+
isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) ? null : /* @__PURE__ */ React61.createElement(React61.Fragment, null, ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.allow_pinning_messages) ? /* @__PURE__ */ React61.createElement(PinnedMessage, { clearPinnedMessage: setPinnedMessage }) : null),
|
5778
|
+
/* @__PURE__ */ React61.createElement(
|
4999
5779
|
ChatBody,
|
5000
5780
|
{
|
5001
5781
|
role: chatOptions.role,
|
@@ -5005,7 +5785,7 @@ var Chat = ({ screenType }) => {
|
|
5005
5785
|
screenType
|
5006
5786
|
}
|
5007
5787
|
),
|
5008
|
-
/* @__PURE__ */
|
5788
|
+
/* @__PURE__ */ React61.createElement(
|
5009
5789
|
ChatFooter,
|
5010
5790
|
{
|
5011
5791
|
role: chatOptions.role,
|
@@ -5023,7 +5803,7 @@ var Chat = ({ screenType }) => {
|
|
5023
5803
|
},
|
5024
5804
|
peerId: chatOptions.peerId
|
5025
5805
|
},
|
5026
|
-
!isSelectorOpen && !isScrolledToBottom && /* @__PURE__ */
|
5806
|
+
!isSelectorOpen && !isScrolledToBottom && /* @__PURE__ */ React61.createElement(NewMessageIndicator, { role: chatOptions.role, peerId: chatOptions.peerId, scrollToBottom })
|
5027
5807
|
)
|
5028
5808
|
);
|
5029
5809
|
};
|
@@ -5032,7 +5812,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5032
5812
|
if (!unreadCount) {
|
5033
5813
|
return null;
|
5034
5814
|
}
|
5035
|
-
return /* @__PURE__ */
|
5815
|
+
return /* @__PURE__ */ React61.createElement(
|
5036
5816
|
Flex,
|
5037
5817
|
{
|
5038
5818
|
justify: "center",
|
@@ -5043,7 +5823,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5043
5823
|
position: "absolute"
|
5044
5824
|
}
|
5045
5825
|
},
|
5046
|
-
/* @__PURE__ */
|
5826
|
+
/* @__PURE__ */ React61.createElement(
|
5047
5827
|
Button,
|
5048
5828
|
{
|
5049
5829
|
variant: "standard",
|
@@ -5066,7 +5846,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5066
5846
|
},
|
5067
5847
|
"New ",
|
5068
5848
|
unreadCount === 1 ? "message" : "messages",
|
5069
|
-
/* @__PURE__ */
|
5849
|
+
/* @__PURE__ */ React61.createElement(ChevronDownIcon2, null)
|
5070
5850
|
)
|
5071
5851
|
);
|
5072
5852
|
};
|
@@ -5081,23 +5861,23 @@ var tabTriggerCSS = {
|
|
5081
5861
|
justifyContent: "center"
|
5082
5862
|
};
|
5083
5863
|
var ParticipantCount2 = ({ count }) => {
|
5084
|
-
return count < 1e3 ? /* @__PURE__ */
|
5864
|
+
return count < 1e3 ? /* @__PURE__ */ React62.createElement("span", null, "(", count, ")") : /* @__PURE__ */ React62.createElement(Tooltip, { title: count }, /* @__PURE__ */ React62.createElement("span", null, "(", getFormattedCount(count), ")"));
|
5085
5865
|
};
|
5086
|
-
var SidePaneTabs =
|
5866
|
+
var SidePaneTabs = React62.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType, hideControls }) => {
|
5087
5867
|
var _a;
|
5088
5868
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
5089
5869
|
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
5090
5870
|
const resetSidePane = useSidepaneReset();
|
5091
|
-
const [activeTab, setActiveTab] =
|
5092
|
-
const peerCount =
|
5871
|
+
const [activeTab, setActiveTab] = useState36(active);
|
5872
|
+
const peerCount = useHMSStore34(selectPeerCount3);
|
5093
5873
|
const { elements } = useRoomLayoutConferencingScreen();
|
5094
5874
|
const showChat = !!(elements == null ? void 0 : elements.chat);
|
5095
5875
|
const showParticipants = !!(elements == null ? void 0 : elements.participant_list);
|
5096
5876
|
const hideTabs = !(showChat && showParticipants);
|
5097
|
-
const isMobile =
|
5877
|
+
const isMobile = useMedia19(config.media.md);
|
5098
5878
|
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isMobile;
|
5099
5879
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
5100
|
-
|
5880
|
+
useEffect24(() => {
|
5101
5881
|
if (activeTab === SIDE_PANE_OPTIONS.CHAT && !showChat && showParticipants) {
|
5102
5882
|
setActiveTab(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
5103
5883
|
} else if (activeTab === SIDE_PANE_OPTIONS.PARTICIPANTS && showChat && !showParticipants) {
|
@@ -5106,10 +5886,10 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5106
5886
|
resetSidePane();
|
5107
5887
|
}
|
5108
5888
|
}, [showChat, activeTab, showParticipants, resetSidePane]);
|
5109
|
-
|
5889
|
+
useEffect24(() => {
|
5110
5890
|
setActiveTab(active);
|
5111
5891
|
}, [active]);
|
5112
|
-
return /* @__PURE__ */
|
5892
|
+
return /* @__PURE__ */ React62.createElement(
|
5113
5893
|
Flex,
|
5114
5894
|
{
|
5115
5895
|
direction: "column",
|
@@ -5120,7 +5900,7 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5120
5900
|
transition: "margin 0.3s ease-in-out"
|
5121
5901
|
}
|
5122
5902
|
},
|
5123
|
-
isOverlayChat && isChatOpen && showChat ? /* @__PURE__ */
|
5903
|
+
isOverlayChat && isChatOpen && showChat ? /* @__PURE__ */ React62.createElement(Chat, { screenType }) : /* @__PURE__ */ React62.createElement(React62.Fragment, null, hideTabs ? /* @__PURE__ */ React62.createElement(React62.Fragment, null, /* @__PURE__ */ React62.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", p: "$4", c: "$on_surface_high", pr: "$12" } }, showChat ? "Chat" : /* @__PURE__ */ React62.createElement("span", null, "Participants ", /* @__PURE__ */ React62.createElement(ParticipantCount2, { count: peerCount }))), showChat ? /* @__PURE__ */ React62.createElement(Chat, { screenType }) : /* @__PURE__ */ React62.createElement(ParticipantList, null)) : /* @__PURE__ */ React62.createElement(
|
5124
5904
|
Tabs.Root,
|
5125
5905
|
{
|
5126
5906
|
value: activeTab,
|
@@ -5130,7 +5910,7 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5130
5910
|
size: "100%"
|
5131
5911
|
}
|
5132
5912
|
},
|
5133
|
-
/* @__PURE__ */
|
5913
|
+
/* @__PURE__ */ React62.createElement(Tabs.List, { css: { w: "calc(100% - $12)", p: "$2", borderRadius: "$2", bg: "$surface_default" } }, /* @__PURE__ */ React62.createElement(
|
5134
5914
|
Tabs.Trigger,
|
5135
5915
|
{
|
5136
5916
|
value: SIDE_PANE_OPTIONS.CHAT,
|
@@ -5140,7 +5920,7 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5140
5920
|
})
|
5141
5921
|
},
|
5142
5922
|
"Chat"
|
5143
|
-
), /* @__PURE__ */
|
5923
|
+
), /* @__PURE__ */ React62.createElement(
|
5144
5924
|
Tabs.Trigger,
|
5145
5925
|
{
|
5146
5926
|
value: SIDE_PANE_OPTIONS.PARTICIPANTS,
|
@@ -5150,12 +5930,12 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5150
5930
|
})
|
5151
5931
|
},
|
5152
5932
|
"Participants ",
|
5153
|
-
/* @__PURE__ */
|
5933
|
+
/* @__PURE__ */ React62.createElement(ParticipantCount2, { count: peerCount })
|
5154
5934
|
)),
|
5155
|
-
/* @__PURE__ */
|
5156
|
-
/* @__PURE__ */
|
5935
|
+
/* @__PURE__ */ React62.createElement(Tabs.Content, { value: SIDE_PANE_OPTIONS.PARTICIPANTS, css: { p: 0 } }, /* @__PURE__ */ React62.createElement(ParticipantList, null)),
|
5936
|
+
/* @__PURE__ */ React62.createElement(Tabs.Content, { value: SIDE_PANE_OPTIONS.CHAT, css: { p: 0 } }, /* @__PURE__ */ React62.createElement(Chat, { screenType }))
|
5157
5937
|
)),
|
5158
|
-
isOverlayChat && isChatOpen ? null : /* @__PURE__ */
|
5938
|
+
isOverlayChat && isChatOpen ? null : /* @__PURE__ */ React62.createElement(
|
5159
5939
|
IconButton,
|
5160
5940
|
{
|
5161
5941
|
css: { position: "absolute", right: "$10", top: "$11", "@md": { top: "$8", right: "$8" } },
|
@@ -5169,22 +5949,22 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5169
5949
|
},
|
5170
5950
|
"data-testid": "close_chat"
|
5171
5951
|
},
|
5172
|
-
/* @__PURE__ */
|
5952
|
+
/* @__PURE__ */ React62.createElement(CrossIcon9, null)
|
5173
5953
|
)
|
5174
5954
|
);
|
5175
5955
|
});
|
5176
5956
|
|
5177
5957
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
5178
|
-
import
|
5179
|
-
import { selectPermissions as
|
5180
|
-
import { ColoredHandIcon, CrossIcon as
|
5958
|
+
import React64, { Fragment as Fragment12, useState as useState38 } from "react";
|
5959
|
+
import { selectPermissions as selectPermissions13, useHMSStore as useHMSStore36, useRecordingStreaming as useRecordingStreaming7 } from "@100mslive/react-sdk";
|
5960
|
+
import { ColoredHandIcon, CrossIcon as CrossIcon10, GoLiveIcon as GoLiveIcon3 } from "@100mslive/react-icons";
|
5181
5961
|
|
5182
5962
|
// src/Prebuilt/images/rtmp.png
|
5183
5963
|
var rtmp_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABlCAYAAAC7vkbxAAAVDUlEQVR4Ae1dDXgU9Zl//7OfiWz4SCKEgCR+kIVQWb76aKUSxHp6aiGtvZ6e1XC94l3VKsVeH73rCU/vWu85rHJie9JrDWix3nFH/KhaEY1CvZ58uFQDCVQIKEkgAUO+92Pm3/ed2Zmd2cwmu5uZzQL+nmfJzOwwX7//+/l/31mAz5BTYHCWwe+/ogwc4SrgUCYBTGOMl9Gy+j0H6GQMOjlnzQLAUYmzYNgj1jcHg51wFuCsIMQ/a34V59JS4HwZrpZBBkCigoyxeuaS1jUGg82Qo8hZQsoCgXF5EaFGAn4nPs0AWAgiR2BsXWPD3lrIMeQkIRWz5t0HXFqNT25c4nc8fxJEShZKou8SEMdeFuJOX56UP7EXQMhT9pD6HX1tLtZ/wu0480dwdB+SHB1BQehrMztVM0rNmlwiJqcIIdUkSeJjeFEGiZAKLmmPlFxdHCq/BbhrDGQCIsfV9k7I9clvPYPIYajOXLw6F1RZzhBSUTn3MbQR9+u3iUUBGJi+HKKFlmoscH/8GngOPg2DiOFsZdOBvY/DKGLUCSFb4YmwraieqtRtEqql/sCDlhORCFNiGHu8qWHvShgljCoh/kCgjIfZW6DznMIXfw2loiZj1ZQuiAwvkuJCclSQ0Q+7+eLRcJVHjZBEMogAkorIpIUwGvAc3gLehie09dEiZVQISSSDVFTvlevkv6MJ56kg5O/6B2CRHnl9NEgRYBQghdFm5BgZBLJZdC2quiRvzx0RHoMswgFZxvSZcx/GG/1LWqYb7134s5wgQwX3TgBxfKVs8AlESlHR5DOnOlp/D1lAVgmhOAMDvlp1vX/ew3jzMyHXIA8Qlw+c7e8pGxhcUVw66fmOtjbbVZcTsgguiU+ryyGML+ww4BUTBemGmS6YUcLYZcUM8twCj4ic9YY59IQA2ro4b+nk8PqBKOw5JiZV2aGLbwFH1yHV+xrHI4yufTHYjKwRQqoKKSmjZRqBAxU1YCUmFjD+o6Ue/ueVzsSHzBJ8F3lFlEBCQoY8Zn/lveBs26kYeYyT/JVza+xOs2TFqJNXxYDXqOtkOK1EZYlD2nbvBWBCxohANm4ASdHWOX8YbEZWCJHCwp0Q86rCU6+31IhPHc/gub/2smKfPS48XW+0SMsYlJGUgI3ICiF66SDbYSX+tdojFfuYrfGU/po5TQfYCNsJiY2oMloW0c+3UjrmTxPExdOdtt8DxSdaKodsyaxAFdgE22+Gc1iqLoen3gBW4q4verKWaQij16WCS8IysAn2e1mM0/y3DJxYAiux4KLhx9OOP4p8/dsRaGgReW84PgCjIk9rMIan3ACeptrYGqdBdj/YAFslRAkElVk/UlfcaV0GN88FHF3dIa//0ElJunNjP7xzKMpO9XJhIMJB/UQlSAukanlc3ZbRtAHYAFsJYVzS3BOrpQPJGHaff3o5xPoj1nlf+kDWG7FHbdlKiMRhkbosFlwGVsIpDO9Z7f1Y4mAhxLGXxld4ZtUvw8Feo864JtaGm8kSwlFu6f3pBxXVhIENsFll6QrYnNmZAbQT+nsQmJIGshq2EsJ1cx7nAvT3wc9KlfUZ0sZnhOQYsjofkgm23pXHryh3ZOS6Hvlhcru1cG2f9FGHlHMD8ryUEAwK+ZFTUk6W0Z6XhBzpkDhGKOcfIXjHzfJJzAudRw3HO3lGZOjvA8PSZrAB9rq9DLSigFwipaFVhEwg9Ldqy+j2ngEbYK+ESLBPO1F/7hBy7DTPKKVCFfQqGLAg2AB7CRHiF00VHLmCwx2ZpbgcXTpCHJIthNjq9nKGFx1T187WnRAq/xqki2f/P8LrDw5OEhaO4exbV7mHtAVrt0UkszR74wkxMxuiI4RHwBZCbPc0KirnfEpzIjQF2n3t85bltC4tFmDHqvwh9yn/QQ/OfYAlIJXre+PrygqDYFPD+3PABtjv9nJWT3+otsnVtgPOVrhaddfO2dtgE2wnhAmSVoTlOvYanK1wH9miLTtZvBzWatieOhlwQtATQfcX1RaV+9PH7s6odCD0tcrqKNELlPImyZUmUn6JLB2a247qqqEhaIv9INhOCPVW+GfOXcdBqfrzND0N0S9YW7mYKlhUUZtydy4ODL0bm/IxOKsDG5GV5OKAW3rcE2H3jYaUEAnOjvfBfXiLfN6RAgfW6oqZc2owVK+z4yUEtnhZVJHhHfAaqzKEcI0qJTSd23P1L2AkGM7L6uruhrk1teD4aIvWEZUIj+CDIlcF+ByTwe0YAx7m074L8W7oibZCV7QFOiJNSc/DGasVXNIaq4gZMSHyw486A/TqC855FeZ4yswa/hNB5f76QuZ0MRQhm57ZDOt/ugG6uroN24mAcu9iKPXOhcnu+eBzToZU0RLaDcdDe+BIf70pQVYRkzEh2vtHqG43BQLM0Iu2JFPVZUbI8ZYWePCh1fDerj2G7aWe+bCgYAUUuisMUpApusUW2NX1FJK0R5YgHdB5YWtG0uueNiEKEeLD+r5yPQoKfFA6eTL4fMYbP368RX5gepAX07PoF7JHky4SCTGTCpWIyfjXDhAxjb0vwR96NkNI0kkjg3rm4sszkZaUCVEa/IWHE9+2QAT4Kyrg2iVVsAQ/REYy0MNqbGqCHz/yKBxoVMRebvpESUmXFD0hP3pkLRLynPYdqaIl41fbRkQiVIkhcnRoZm6+OF1SUiLErMGfiLjjG7fBHbffJi+nAzK41V+9VZYaQiakECG/WSHCPfeuMqgo/wU3w1XjHtBUE92gpdVyCVCPT2V7jb0vws7OR/XS0ulkfHE6ccuwhEyfMW8ZRttP6+3EPXfflRERehAZdyxfoZGidCvdk3KFfPnYXpi4+36UtIPatoVIxOVjbrOdhGQgUrrRptS1r9DblrRIGZKQ6ZXz7mS6rtnS0snw5L8/Cn5/BViBRFII5H2FKpYPm4SkBn9X2055mbynhWMfgAqUjlxAD6qwVzpW6b2xlElJ2hZdGQgEuAha8mkGkvDrzRtlUqwCSdi111RBI45y1eA7P90PrpY3MfE1ht6HZfr/6IUxnqMvauu3XLgRpnq/ALkCNw6QS/P/DD4e+D/ok07RJq8E7Pri0kkvDNdabUoI2QwpzF7FRVlNXbtkMaxHyRiJikoGOmb1sptlWVVtgZIZ3ilH1tQCQPkkFe6PX4W8hvXa+jXj18BFOUSGCifzyKR81P+6alPGgcQCp9rbNg71/0xVFqYGjkDMgJNkbHx6gy1kJMJMhRHI6Icuvb1PGjMlPy/4iJbo+3zBXTAfP7kMUl/Pn7g1buiHeSfXIEKUV1/w1bRM6mkTkmGlmkoFW+telGOKRGL0uDhvMVxf+CicDaAonwy9CnSHy5O5wwZCZPc2wt5XPaof/8saRZ2MEpIRQ3HGsuINcg4qHZRfCTCnGmzBjp8DtCcpG6CHvKNzrRxAxjbU44yj6VshjNleJfCTyahe9uXMyZAdc06Z0djlMP0XKUejdA0knXfUrDBsX4BqSs5DpeHbzvgSwJLvYo7Tpik57wXJv6PLpGtu6ntJUV2xTt7GD4P1iftqhCjBX7yf/J5vr0h68MiePeDahyn0jw4DP3ECnGIUoK8fpO4uzLWHkAsu74mcyDUORIH87BwCSBeMAQfaI+7ygFhcCGxaGQgzZoKjapHiyCfg8wvmy5/3du2W14kIf/7NyrEhNQSWAVz9d/H1IM5o9H8KI4bTiw/61tT29Tp8coxEET2Bc0aZ7/pBx9SWIkKVeovqyEwEJhMh8p37wPnkk3KlWOJkipnLxhL+Crp1/WANz5oF7JXfgGvqRTAUFsSMeKpk0AO7ssa4bT/6jx3NMGLkjUudEBqjRIiW90oiJdoz0b+hoHrZTaYHFZ/ZBM7162MSYC1cH34IkXsHdxo3Nh0cJB2pYt5fDCZjNEEBLJGiwqzfXSaE1JWavSXJIBUxGEjC1hdtrRvyvPUGSD3GyaSNm36lLc/W3cxwmP91gKu+CTmHyw33wO9MbK+WCZFEhzYpYU6GbBGAH05/DjodCJQ6P3nSsE2fOCzPq4JUMW0BpI3xUwDm3qJ8DOYMx+LspYotGjcFRgSSktJ4Fhon94wvjZYJEUSuI2Se6YFITbGWVhgOoZtuBn7RVMgUXDdnQupKdXmL3BVpu7nporAcE5TfUj56VUAK+ot/qzgGJX4YMfQDK1FtCbETzlY3lJaWmB6Eh0LATw/vmji/cTvwd3bCwN3fBikTH7MrXlR+4ECjtjzZMw/OFRgknfFF+u+E2EZNjyWbYJI6O9GLSq2M3zHtIsh7Aj2xxgYQv3QdzTdDynNhn8ZJ16fWS7M02ZQNkKQXqPP5HAJ6OyITou8nT5omQQmBIfpceGIMgauOy/zgeP23EHp2M0QuvhhSAR8Ia8uNOkIKHCVwLqHQFZ/CuCASf/5p6JTkozzidkF/vhciXgz2BAbRaBREUZQ/4XAYhGuvgUj1jRByOiDqGwNDSguPl6vTdK/ZDZwL8OkGmAiCZsNTL5QTmNyBYxaRkQfmFBxyRB6ROAjoAEgS7osRfOjxn4D7qQ3gONmOSTU3REQ8gAP3F81jGZYfL1xQCxbSKdc5W1Cguyccg5rKkgnh1C8XU1vk1ZiqLUx3SChQDhjccOFGKYCwompo7DtcLhDf2g7SfSvB98EHkA5Y4QT5L827a6d2ZIeQ5vcAfvlXyrJOUGUX+JnlyvJAD1gCjzBGf3wjITjwj6rmgWbuzAhxFBQo6uZMFwwF3twM0euuA8e2N5C8DCJ6r1f+051Q5JYNRNFM0rt9zXDGpCMvrwAsh2LUda1njQcOmu7ImQBswgQYDs7vfx+c27ap6cS0wX023KUNKJgI8OV/jq9blUxS4hAW75c70GROCD1gqcKCqGgISKQbyhVvzFdgrLPNJRRMAvjKvymkEH6/CeATixoUZEKohwNiLczbt781qCZWAQNhXgb5iDQgzp4NjvGKOi3QVT4aqgJHGZReueXROBnv/hLTO7+CtBGS4sYIfaB4+zj9E/t9DJljMqZ6d9OAVfdD5JJLlJFsNcYWgPiEcapZtWXd0RawFCzJZ5h9ii5BMn4CMKYIZB1Vj7Hv7uchI+hrggWn1KwuO+PnZxsxBV9Fy+uf3ACbagdHxo7xE0Da8Ttgv94M4W3bwdVzBqKftABrawEhFFbyXUOk5tXgUcR4hE0oAl5YiHmvKcD8M8Dxzb+BvMpKw/6UNVBzWXQDBRa5v8seQfUYNW7bgw92X6yyyIvCecMPUBpKjft4cFbQlUfJWIBtawGa3oSMcSoSNw2CFH8rhEbIgEuq80TYYzSfTvMP9DHL/LpKUFZXrgTPSuV3s9zqF+gnciID4wseHsAP5r5ESZ4zZU4XCBiDMJcb6KV7TqI/BSnz+6drcyEt4T2WEZJvUqvvioU/+ei3VCNhhdPM/29kAOAVNOZHd8GIoG9p0BfQaZE6qS3GmdZrRlKSFsgLo+DQ5QSBpmnHF4KzqBicEwpll5mhO8twCleg/VJUeTOQELMbsAu+YsU+JCNjAD3+//37kZNBxdmaXWTGfndD6oRaz1TjTiNz06bNMJqYMSPu1VGjjJ3wXQjwVVRD45IIYd9pgC0PAJywYFxQWZCGhBZrAyEkJVzgy9X19T99ChN89o/MZFj/5FPaMhn2UzZKyeduVNxZM3TjnNmWVQCnj4IlaOx9WVtmglSn/25QcvHgB1SToXSaksd193dWDWq0yQaIjDe2v2XYdthmKTFD1wlFMjotegSkro7HJaQ5scjBNLkYckvLPWFGGcgyubyzZgV6XRuGbMaxEkQGSWciqGLjct9tKbWlnT6GN+c2/45shNM7ePvJQ8YcVghDhe1oVbtPgGXY1x03A+iT1id+n9S6+v2BMi7Em3TkstIskKJ0Q23WXSBfg+7yIrUIQ+0BGQlu+xnGFLrpGSJh+2MA+18H2/Fs201aDMIkXt7YaCwpTTofQjvif1gMsbfCkaRUf+VW2Fr3EtgBUouyJCaQ0bg/uJoxvkbdto/qmixMpZAUvPLD7JBBRXIaGQzqE8kgDPmzeR0dbZ3FhZNewP9NE/HjQphi3/5mPT68VvSAphvSG5mC7NTP/7MWHvrH1XD4SLO2XSVDvo6Tbc1FF5ZU4WJZGN1FKvWfMoIp3c/dhPHGeMVY//d3AVr3g+0gp+R3Z+Ltbk7Gq9vb2wblkIf9HUOVFAzlxuNTkme2yPOikUzEFGBKPpPqeJWIVd97EHbsfBdniGNTt+h2M4Hf0NgQrNXvXzxx0lF0EWtomaJc6r2gkppMQIRE8XT/8z28jiy96O7dM2vlPncC2o7axv3vP2W2X1pJKX9loCZWk1qm364W1y25ZhFMwWWzljc5R3agSS7teWN7vRaBJ1xOHZOklWaiTKiYOXcr3o5cNkNFD0uL0wxeY7gR7+Cd/7DWWA8FckZ2dq5VVmjAiXxOsntMv08djT2qsNWYAlk61AsD9Ma/u6c7SQY5dhGoTzEJtsasGlyP2G+vH1HPOxs9rqvGPgDpwulRJqOyAXJz/8vQsMNXNh0Ipt6wkypkYhxQheJHL5VJ/3UMlBGQ2EbmkOqGI8Jw3lmBKi4xLUCxwuuyC0TGC4aOXFbXtH/vkB0qluTRNXIkIYD6fzbNz3OdWqP399IrYzFXFmRM2ofLwXRIGHS+mYHVOBC0H3mkPkN/jnTgqhhMBsheazJVpcLO2mlb4a+cU4vJZa1iP5ckJVMyCFn/+W6r0NHeVld8YUk5Lsrq8tjAu/L20a5wpHzbyx33xskgzSDxK1Mhg3DWEkIgUoqKJ2NEAVfQOr2dhz6l3nkZu8QjAXlTr55apZ9ybk6HDMJZTQjhVHvra8XFk6iKr4rWSV0cGaiXCSl2Z6HakSlzNdtOPwQNvVv036SsphIOd27ALEaiikdqgUun6yodJHkLEIKvC/XB6ubmYCekiXOGEIIWIzEw/ICwSkypZ54lPSY0wfSHnudwOsA4PUD2gkt8+cEDwTrIEOcUISqSZRQIZPSpP6PINT3l92lRHqolvBvaMWXT1PvS4LIk2aXn6wb64PFMpMJ4qHMYQxGjoij22j8zyemINslkJK0LixEBEtSmayuS4ZwmRIX8c9siqxku3ZMqKNWD2egX+nuhdqQSMejYcJ5BJkcSqqiVjFMMMxxBStFHM6Z53sb57+BAL9RZTYLxdOc5ysoC47xeJMVpVGsODp2iCJ1WqaJU8SdC2O29RZg76wAAAABJRU5ErkJggg==";
|
5184
5964
|
|
5185
5965
|
// src/Prebuilt/components/Streaming/HLSStreaming.jsx
|
5186
|
-
import
|
5187
|
-
import { selectRoomID, useHMSActions as
|
5966
|
+
import React63, { Fragment as Fragment11, useCallback as useCallback17, useEffect as useEffect25, useState as useState37 } from "react";
|
5967
|
+
import { selectRoomID, useHMSActions as useHMSActions23, useHMSStore as useHMSStore35, useRecordingStreaming as useRecordingStreaming6 } from "@100mslive/react-sdk";
|
5188
5968
|
import {
|
5189
5969
|
EndStreamIcon as EndStreamIcon2,
|
5190
5970
|
EyeOpenIcon,
|
@@ -5203,7 +5983,7 @@ var getCardData = (roleName, roomId) => {
|
|
5203
5983
|
data3 = {
|
5204
5984
|
title: formattedRoleName,
|
5205
5985
|
content: "Broadcasters can livestream audio or video, manage stream appearance and control the room via HLS.",
|
5206
|
-
icon: /* @__PURE__ */
|
5986
|
+
icon: /* @__PURE__ */ React63.createElement(SupportIcon, null)
|
5207
5987
|
};
|
5208
5988
|
break;
|
5209
5989
|
}
|
@@ -5211,7 +5991,7 @@ var getCardData = (roleName, roomId) => {
|
|
5211
5991
|
data3 = {
|
5212
5992
|
title: "HLS Viewer",
|
5213
5993
|
content: "Viewers can view and send chat messages, but need to be made broadcasters to participate with audio or video.",
|
5214
|
-
icon: /* @__PURE__ */
|
5994
|
+
icon: /* @__PURE__ */ React63.createElement(EyeOpenIcon, null)
|
5215
5995
|
};
|
5216
5996
|
break;
|
5217
5997
|
}
|
@@ -5219,7 +5999,7 @@ var getCardData = (roleName, roomId) => {
|
|
5219
5999
|
data3 = {
|
5220
6000
|
title: formattedRoleName,
|
5221
6001
|
content: `${formattedRoleName} is customised with specific permissions, which will determine how it interacts with this room.`,
|
5222
|
-
icon: /* @__PURE__ */
|
6002
|
+
icon: /* @__PURE__ */ React63.createElement(WrenchIcon, null),
|
5223
6003
|
order: 1
|
5224
6004
|
};
|
5225
6005
|
}
|
@@ -5227,8 +6007,8 @@ var getCardData = (roleName, roomId) => {
|
|
5227
6007
|
return data3;
|
5228
6008
|
};
|
5229
6009
|
var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
5230
|
-
const [copied, setCopied] =
|
5231
|
-
return isHLSRunning ? /* @__PURE__ */
|
6010
|
+
const [copied, setCopied] = useState37(false);
|
6011
|
+
return isHLSRunning ? /* @__PURE__ */ React63.createElement(
|
5232
6012
|
Box,
|
5233
6013
|
{
|
5234
6014
|
key: title,
|
@@ -5239,9 +6019,9 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5239
6019
|
borderRadius: "$2"
|
5240
6020
|
}
|
5241
6021
|
},
|
5242
|
-
/* @__PURE__ */
|
5243
|
-
/* @__PURE__ */
|
5244
|
-
/* @__PURE__ */
|
6022
|
+
/* @__PURE__ */ React63.createElement(Flex, { align: "center", gap: "2", css: { color: "$primary_bright" } }, icon, /* @__PURE__ */ React63.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, title)),
|
6023
|
+
/* @__PURE__ */ React63.createElement(Text, { variant: "sm", css: { color: "$on_surface_medium", mt: "$6" } }, content),
|
6024
|
+
/* @__PURE__ */ React63.createElement(
|
5245
6025
|
Button,
|
5246
6026
|
{
|
5247
6027
|
variant: "standard",
|
@@ -5253,24 +6033,24 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5253
6033
|
css: { w: "100%", r: "$1", mt: "$10", fontWeight: "$semiBold" },
|
5254
6034
|
icon: true
|
5255
6035
|
},
|
5256
|
-
copied ? /* @__PURE__ */
|
6036
|
+
copied ? /* @__PURE__ */ React63.createElement(React63.Fragment, null, "Link copied!") : /* @__PURE__ */ React63.createElement(React63.Fragment, null, /* @__PURE__ */ React63.createElement(LinkIcon, { style: { color: "inherit" } }), "Copy Invite Link")
|
5257
6037
|
)
|
5258
6038
|
) : null;
|
5259
6039
|
};
|
5260
6040
|
var HLSStreaming = ({ onBack }) => {
|
5261
6041
|
const roleNames = useFilteredRoles();
|
5262
|
-
const roomId =
|
6042
|
+
const roomId = useHMSStore35(selectRoomID);
|
5263
6043
|
const cards = roleNames.map((roleName) => getCardData(roleName, roomId));
|
5264
6044
|
const { isHLSRunning } = useRecordingStreaming6();
|
5265
|
-
const [showLinks, setShowLinks] =
|
5266
|
-
return !showLinks ? /* @__PURE__ */
|
6045
|
+
const [showLinks, setShowLinks] = useState37(false);
|
6046
|
+
return !showLinks ? /* @__PURE__ */ React63.createElement(Container, { rounded: true }, /* @__PURE__ */ React63.createElement(ContentHeader, { title: "Start Streaming", content: "HLS", onBack }), /* @__PURE__ */ React63.createElement(ContentBody, { title: "HLS Streaming", Icon: GoLiveIcon2, removeVerticalPadding: true }, "Stream directly from the browser using any device with multiple hosts and real-time messaging, all within this platform."), isHLSRunning ? /* @__PURE__ */ React63.createElement(EndHLS, { setShowLinks }) : /* @__PURE__ */ React63.createElement(StartHLS, null)) : /* @__PURE__ */ React63.createElement(Container, { rounded: true }, /* @__PURE__ */ React63.createElement(ContentHeader, { title: "Invite People", content: "Start the conversation", onBack: () => setShowLinks(false) }), /* @__PURE__ */ React63.createElement(Flex, { direction: "column", css: { gap: "$10", p: "$0 $10", overflowY: "auto", mb: "$10" } }, cards.map((card) => /* @__PURE__ */ React63.createElement(Card, __spreadProps(__spreadValues({ key: card.title }, card), { isHLSRunning })))));
|
5267
6047
|
};
|
5268
6048
|
var StartHLS = () => {
|
5269
|
-
const [record, setRecord] =
|
5270
|
-
const [error, setError] =
|
5271
|
-
const hmsActions =
|
6049
|
+
const [record, setRecord] = useState37(false);
|
6050
|
+
const [error, setError] = useState37(false);
|
6051
|
+
const hmsActions = useHMSActions23();
|
5272
6052
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
5273
|
-
const startHLS =
|
6053
|
+
const startHLS = useCallback17(
|
5274
6054
|
(variants) => __async(void 0, null, function* () {
|
5275
6055
|
try {
|
5276
6056
|
if (isHLSStarted) {
|
@@ -5289,7 +6069,7 @@ var StartHLS = () => {
|
|
5289
6069
|
}),
|
5290
6070
|
[hmsActions, record, isHLSStarted, setHLSStarted]
|
5291
6071
|
);
|
5292
|
-
return /* @__PURE__ */
|
6072
|
+
return /* @__PURE__ */ React63.createElement(Fragment11, null, /* @__PURE__ */ React63.createElement(RecordStream, { record, setRecord, testId: "hls-recording" }), /* @__PURE__ */ React63.createElement(Box, { css: { p: "$4 $10" } }, /* @__PURE__ */ React63.createElement(ErrorText, { error }), /* @__PURE__ */ React63.createElement(
|
5293
6073
|
Button,
|
5294
6074
|
{
|
5295
6075
|
"data-testid": "start_hls",
|
@@ -5298,21 +6078,21 @@ var StartHLS = () => {
|
|
5298
6078
|
onClick: () => startHLS(),
|
5299
6079
|
disabled: isHLSStarted
|
5300
6080
|
},
|
5301
|
-
isHLSStarted ? /* @__PURE__ */
|
6081
|
+
isHLSStarted ? /* @__PURE__ */ React63.createElement(Loading, { size: 24, color: "currentColor" }) : /* @__PURE__ */ React63.createElement(GoLiveIcon2, null),
|
5302
6082
|
isHLSStarted ? "Starting stream..." : "Go Live"
|
5303
|
-
)), /* @__PURE__ */
|
6083
|
+
)), /* @__PURE__ */ React63.createElement(Flex, { align: "center", css: { p: "$4 $10" } }, /* @__PURE__ */ React63.createElement(Text, null, /* @__PURE__ */ React63.createElement(InfoIcon4, { width: 16, height: 16 })), /* @__PURE__ */ React63.createElement(Text, { variant: "tiny", color: "$on_surface_medium", css: { mx: "$8" } }, "You cannot start recording once the stream starts, you will have to stop the stream to enable recording.")));
|
5304
6084
|
};
|
5305
6085
|
var EndHLS = ({ setShowLinks }) => {
|
5306
|
-
const hmsActions =
|
5307
|
-
const [inProgress, setInProgress] =
|
5308
|
-
const [error, setError] =
|
6086
|
+
const hmsActions = useHMSActions23();
|
6087
|
+
const [inProgress, setInProgress] = useState37(false);
|
6088
|
+
const [error, setError] = useState37("");
|
5309
6089
|
const { isHLSRunning } = useRecordingStreaming6();
|
5310
|
-
|
6090
|
+
useEffect25(() => {
|
5311
6091
|
if (inProgress && !isHLSRunning) {
|
5312
6092
|
setInProgress(false);
|
5313
6093
|
}
|
5314
6094
|
}, [inProgress, isHLSRunning]);
|
5315
|
-
return /* @__PURE__ */
|
6095
|
+
return /* @__PURE__ */ React63.createElement(Box, { css: { p: "$4 $10" } }, /* @__PURE__ */ React63.createElement(ErrorText, { error }), /* @__PURE__ */ React63.createElement(
|
5316
6096
|
Button,
|
5317
6097
|
{
|
5318
6098
|
"data-testid": "stop_hls",
|
@@ -5331,23 +6111,23 @@ var EndHLS = ({ setShowLinks }) => {
|
|
5331
6111
|
}
|
5332
6112
|
})
|
5333
6113
|
},
|
5334
|
-
/* @__PURE__ */
|
6114
|
+
/* @__PURE__ */ React63.createElement(EndStreamIcon2, null),
|
5335
6115
|
"End Stream"
|
5336
|
-
), /* @__PURE__ */
|
6116
|
+
), /* @__PURE__ */ React63.createElement(Button, { icon: true, css: { w: "100%", r: "$0", mt: "$8" }, onClick: () => setShowLinks(true) }, /* @__PURE__ */ React63.createElement(PeopleIcon3, null), " Invite People"));
|
5337
6117
|
};
|
5338
6118
|
|
5339
6119
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
5340
6120
|
var StreamingLanding = () => {
|
5341
6121
|
const toggleStreaming = useSidepaneToggle(SIDE_PANE_OPTIONS.STREAMING);
|
5342
6122
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming7();
|
5343
|
-
const permissions =
|
5344
|
-
const [showHLS, setShowHLS] =
|
5345
|
-
const [showRTMP, setShowRTMP] =
|
6123
|
+
const permissions = useHMSStore36(selectPermissions13);
|
6124
|
+
const [showHLS, setShowHLS] = useState38(isHLSRunning);
|
6125
|
+
const [showRTMP, setShowRTMP] = useState38(isRTMPRunning);
|
5346
6126
|
if (!(permissions == null ? void 0 : permissions.hlsStreaming) && !(permissions == null ? void 0 : permissions.rtmpStreaming)) {
|
5347
6127
|
toggleStreaming();
|
5348
6128
|
return null;
|
5349
6129
|
}
|
5350
|
-
return /* @__PURE__ */
|
6130
|
+
return /* @__PURE__ */ React64.createElement(Fragment12, null, /* @__PURE__ */ React64.createElement(Flex, { css: { w: "100%", py: "$8" } }, /* @__PURE__ */ React64.createElement(
|
5351
6131
|
Box,
|
5352
6132
|
{
|
5353
6133
|
css: {
|
@@ -5357,8 +6137,8 @@ var StreamingLanding = () => {
|
|
5357
6137
|
r: "$round"
|
5358
6138
|
}
|
5359
6139
|
},
|
5360
|
-
/* @__PURE__ */
|
5361
|
-
), /* @__PURE__ */
|
6140
|
+
/* @__PURE__ */ React64.createElement(ColoredHandIcon, { width: 40, height: 40 })
|
6141
|
+
), /* @__PURE__ */ React64.createElement(Box, { css: { flex: "1 1 0", mx: "$8" } }, /* @__PURE__ */ React64.createElement(Text, { variant: "sm" }, "Welcome !"), /* @__PURE__ */ React64.createElement(Text, { variant: "h6" }, "Let\u2019s get you started")), /* @__PURE__ */ React64.createElement(IconButton_default, { onClick: toggleStreaming, css: { alignSelf: "flex-start" }, "data-testid": "close_streaming" }, /* @__PURE__ */ React64.createElement(CrossIcon10, null))), /* @__PURE__ */ React64.createElement(Text, { variant: "tiny", color: "$on_surface_medium" }, "Start Streaming"), (permissions == null ? void 0 : permissions.hlsStreaming) && /* @__PURE__ */ React64.createElement(
|
5362
6142
|
StreamCard,
|
5363
6143
|
{
|
5364
6144
|
testId: "hls_stream",
|
@@ -5368,7 +6148,7 @@ var StreamingLanding = () => {
|
|
5368
6148
|
onClick: () => setShowHLS(true),
|
5369
6149
|
Icon: GoLiveIcon3
|
5370
6150
|
}
|
5371
|
-
), (permissions == null ? void 0 : permissions.rtmpStreaming) && /* @__PURE__ */
|
6151
|
+
), (permissions == null ? void 0 : permissions.rtmpStreaming) && /* @__PURE__ */ React64.createElement(
|
5372
6152
|
StreamCard,
|
5373
6153
|
{
|
5374
6154
|
testId: "rtmp_stream",
|
@@ -5380,7 +6160,7 @@ var StreamingLanding = () => {
|
|
5380
6160
|
},
|
5381
6161
|
imgSrc: rtmp_default
|
5382
6162
|
}
|
5383
|
-
), showHLS && /* @__PURE__ */
|
6163
|
+
), showHLS && /* @__PURE__ */ React64.createElement(HLSStreaming, { onBack: () => setShowHLS(false) }), showRTMP && /* @__PURE__ */ React64.createElement(RTMPStreaming, { onBack: () => setShowRTMP(false) }));
|
5384
6164
|
};
|
5385
6165
|
|
5386
6166
|
// src/Prebuilt/layouts/SidePane.tsx
|
@@ -5390,16 +6170,16 @@ var SidePane = ({
|
|
5390
6170
|
hideControls = false
|
5391
6171
|
}) => {
|
5392
6172
|
var _a, _b;
|
5393
|
-
const isMobile =
|
5394
|
-
const sidepane =
|
5395
|
-
const activeScreensharePeerId =
|
5396
|
-
const trackId = (_a =
|
6173
|
+
const isMobile = useMedia20(config.media.md);
|
6174
|
+
const sidepane = useHMSStore37(selectAppData3(APP_DATA.sidePane));
|
6175
|
+
const activeScreensharePeerId = useHMSStore37(selectAppData3(APP_DATA.activeScreensharePeerId));
|
6176
|
+
const trackId = (_a = useHMSStore37(selectVideoTrackByPeerID3(activeScreensharePeerId))) == null ? void 0 : _a.id;
|
5397
6177
|
const { elements } = useRoomLayoutConferencingScreen();
|
5398
6178
|
let ViewComponent;
|
5399
6179
|
if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS || sidepane === SIDE_PANE_OPTIONS.CHAT) {
|
5400
|
-
ViewComponent = /* @__PURE__ */
|
6180
|
+
ViewComponent = /* @__PURE__ */ React65.createElement(SidePaneTabs, { screenType, hideControls, active: sidepane });
|
5401
6181
|
} else if (sidepane === SIDE_PANE_OPTIONS.STREAMING) {
|
5402
|
-
ViewComponent = /* @__PURE__ */
|
6182
|
+
ViewComponent = /* @__PURE__ */ React65.createElement(StreamingLanding, null);
|
5403
6183
|
}
|
5404
6184
|
if (!ViewComponent && !trackId) {
|
5405
6185
|
return null;
|
@@ -5412,7 +6192,7 @@ var SidePane = ({
|
|
5412
6192
|
objectFit: tileProps == null ? void 0 : tileProps.video_object_fit
|
5413
6193
|
};
|
5414
6194
|
const mwebStreamingChat = isMobile && sidepane === SIDE_PANE_OPTIONS.CHAT && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.is_overlay);
|
5415
|
-
return /* @__PURE__ */
|
6195
|
+
return /* @__PURE__ */ React65.createElement(
|
5416
6196
|
Flex,
|
5417
6197
|
{
|
5418
6198
|
direction: "column",
|
@@ -5425,17 +6205,16 @@ var SidePane = ({
|
|
5425
6205
|
"@md": { position: mwebStreamingChat ? "absolute" : "", zIndex: 12 }
|
5426
6206
|
}
|
5427
6207
|
},
|
5428
|
-
trackId && /* @__PURE__ */
|
6208
|
+
trackId && /* @__PURE__ */ React65.createElement(
|
5429
6209
|
VideoTile_default,
|
5430
6210
|
__spreadValues({
|
5431
6211
|
peerId: activeScreensharePeerId,
|
5432
6212
|
trackId,
|
5433
|
-
width: "100%",
|
5434
6213
|
height: 225,
|
5435
6214
|
rootCSS: { p: 0, alignSelf: "start", flexShrink: 0 }
|
5436
6215
|
}, tileLayout)
|
5437
6216
|
),
|
5438
|
-
!!ViewComponent && /* @__PURE__ */
|
6217
|
+
!!ViewComponent && /* @__PURE__ */ React65.createElement(
|
5439
6218
|
Box,
|
5440
6219
|
{
|
5441
6220
|
css: {
|
@@ -5471,10 +6250,10 @@ var SidePane = ({
|
|
5471
6250
|
var SidePane_default = SidePane;
|
5472
6251
|
|
5473
6252
|
// src/Prebuilt/layouts/WaitingView.jsx
|
5474
|
-
import
|
6253
|
+
import React66 from "react";
|
5475
6254
|
import { ColoredTimeIcon } from "@100mslive/react-icons";
|
5476
|
-
var WaitingView =
|
5477
|
-
return /* @__PURE__ */
|
6255
|
+
var WaitingView = React66.memo(() => {
|
6256
|
+
return /* @__PURE__ */ React66.createElement(
|
5478
6257
|
Box,
|
5479
6258
|
{
|
5480
6259
|
css: {
|
@@ -5488,7 +6267,7 @@ var WaitingView = React59.memo(() => {
|
|
5488
6267
|
},
|
5489
6268
|
"data-testid": "waiting_view"
|
5490
6269
|
},
|
5491
|
-
/* @__PURE__ */
|
6270
|
+
/* @__PURE__ */ React66.createElement(
|
5492
6271
|
Flex,
|
5493
6272
|
{
|
5494
6273
|
align: "center",
|
@@ -5502,8 +6281,8 @@ var WaitingView = React59.memo(() => {
|
|
5502
6281
|
gap: "$8"
|
5503
6282
|
}
|
5504
6283
|
},
|
5505
|
-
/* @__PURE__ */
|
5506
|
-
/* @__PURE__ */
|
6284
|
+
/* @__PURE__ */ React66.createElement(ColoredTimeIcon, { width: "80px", height: "80px" }),
|
6285
|
+
/* @__PURE__ */ React66.createElement(
|
5507
6286
|
Flex,
|
5508
6287
|
{
|
5509
6288
|
direction: "column",
|
@@ -5513,28 +6292,28 @@ var WaitingView = React59.memo(() => {
|
|
5513
6292
|
gap: "$4"
|
5514
6293
|
}
|
5515
6294
|
},
|
5516
|
-
/* @__PURE__ */
|
5517
|
-
/* @__PURE__ */
|
6295
|
+
/* @__PURE__ */ React66.createElement(Text, { color: "white", variant: "h6", css: { "@md": { fontSize: "$md" } } }, "Please wait"),
|
6296
|
+
/* @__PURE__ */ React66.createElement(Text, { color: "$on_surface_medium", css: { mt: "$4", "@md": { fontSize: "$sm" } } }, "Sit back and relax till others let you join.")
|
5518
6297
|
)
|
5519
6298
|
)
|
5520
6299
|
);
|
5521
6300
|
});
|
5522
6301
|
|
5523
6302
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
5524
|
-
var HLSView =
|
6303
|
+
var HLSView = React67.lazy(() => import("./HLSView-IQRPLYNH.js"));
|
5525
6304
|
var VideoStreamingSection = ({
|
5526
6305
|
screenType,
|
5527
6306
|
elements,
|
5528
6307
|
hideControls = false
|
5529
6308
|
}) => {
|
5530
6309
|
var _a, _b;
|
5531
|
-
const localPeerRole =
|
5532
|
-
const isConnected =
|
5533
|
-
const hmsActions =
|
6310
|
+
const localPeerRole = useHMSStore38(selectLocalPeerRoleName3);
|
6311
|
+
const isConnected = useHMSStore38(selectIsConnectedToRoom6);
|
6312
|
+
const hmsActions = useHMSActions24();
|
5534
6313
|
const waitingViewerRole = useWaitingViewerRole();
|
5535
6314
|
const urlToIframe = useUrlToEmbed();
|
5536
6315
|
const pdfAnnotatorActive = usePDFAnnotator();
|
5537
|
-
|
6316
|
+
useEffect26(() => {
|
5538
6317
|
if (!isConnected) {
|
5539
6318
|
return;
|
5540
6319
|
}
|
@@ -5545,17 +6324,17 @@ var VideoStreamingSection = ({
|
|
5545
6324
|
}
|
5546
6325
|
let ViewComponent;
|
5547
6326
|
if (screenType === "hls_live_streaming") {
|
5548
|
-
ViewComponent = /* @__PURE__ */
|
6327
|
+
ViewComponent = /* @__PURE__ */ React67.createElement(HLSView, null);
|
5549
6328
|
} else if (localPeerRole === waitingViewerRole) {
|
5550
|
-
ViewComponent = /* @__PURE__ */
|
6329
|
+
ViewComponent = /* @__PURE__ */ React67.createElement(WaitingView, null);
|
5551
6330
|
} else if (pdfAnnotatorActive) {
|
5552
|
-
ViewComponent = /* @__PURE__ */
|
6331
|
+
ViewComponent = /* @__PURE__ */ React67.createElement(PDFView, null);
|
5553
6332
|
} else if (urlToIframe) {
|
5554
|
-
ViewComponent = /* @__PURE__ */
|
6333
|
+
ViewComponent = /* @__PURE__ */ React67.createElement(EmbedView, null);
|
5555
6334
|
} else {
|
5556
|
-
ViewComponent = /* @__PURE__ */
|
6335
|
+
ViewComponent = /* @__PURE__ */ React67.createElement(GridLayout, __spreadValues({}, (_a = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _a.grid));
|
5557
6336
|
}
|
5558
|
-
return /* @__PURE__ */
|
6337
|
+
return /* @__PURE__ */ React67.createElement(Suspense2, { fallback: /* @__PURE__ */ React67.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React67.createElement(
|
5559
6338
|
Flex,
|
5560
6339
|
{
|
5561
6340
|
css: {
|
@@ -5565,7 +6344,7 @@ var VideoStreamingSection = ({
|
|
5565
6344
|
}
|
5566
6345
|
},
|
5567
6346
|
ViewComponent,
|
5568
|
-
/* @__PURE__ */
|
6347
|
+
/* @__PURE__ */ React67.createElement(
|
5569
6348
|
SidePane_default,
|
5570
6349
|
{
|
5571
6350
|
screenType,
|
@@ -5576,80 +6355,6 @@ var VideoStreamingSection = ({
|
|
5576
6355
|
));
|
5577
6356
|
};
|
5578
6357
|
|
5579
|
-
// src/Prebuilt/components/RoleChangeRequestModal.tsx
|
5580
|
-
import React61, { useEffect as useEffect24 } from "react";
|
5581
|
-
import {
|
5582
|
-
selectLocalPeerName,
|
5583
|
-
selectLocalPeerRoleName as selectLocalPeerRoleName3,
|
5584
|
-
selectRoleChangeRequest,
|
5585
|
-
useCustomEvent as useCustomEvent2,
|
5586
|
-
useHMSActions as useHMSActions22,
|
5587
|
-
useHMSStore as useHMSStore35
|
5588
|
-
} from "@100mslive/react-sdk";
|
5589
|
-
var RoleChangeRequestModal = () => {
|
5590
|
-
const hmsActions = useHMSActions22();
|
5591
|
-
const { updateMetaData } = useMyMetadata();
|
5592
|
-
const currentRole = useHMSStore35(selectLocalPeerRoleName3);
|
5593
|
-
const roleChangeRequest = useHMSStore35(selectRoleChangeRequest);
|
5594
|
-
const name = useHMSStore35(selectLocalPeerName);
|
5595
|
-
const { sendEvent } = useCustomEvent2({ type: ROLE_CHANGE_DECLINED });
|
5596
|
-
useEffect24(() => {
|
5597
|
-
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5598
|
-
return;
|
5599
|
-
}
|
5600
|
-
(() => __async(void 0, null, function* () {
|
5601
|
-
yield hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
5602
|
-
}))();
|
5603
|
-
}, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
|
5604
|
-
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5605
|
-
return null;
|
5606
|
-
}
|
5607
|
-
const body = /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(Text, { css: { fontWeight: 400, c: "$on_surface_medium", textAlign: "center" } }, "Setup your audio and video before joining"), /* @__PURE__ */ React61.createElement(
|
5608
|
-
Flex,
|
5609
|
-
{
|
5610
|
-
align: "center",
|
5611
|
-
justify: "center",
|
5612
|
-
css: {
|
5613
|
-
"@sm": { width: "100%" },
|
5614
|
-
flexDirection: "column",
|
5615
|
-
mt: "$6"
|
5616
|
-
}
|
5617
|
-
},
|
5618
|
-
/* @__PURE__ */ React61.createElement(PreviewTile, { name: name || "" }),
|
5619
|
-
/* @__PURE__ */ React61.createElement(PreviewControls, { hideSettings: true })
|
5620
|
-
));
|
5621
|
-
return /* @__PURE__ */ React61.createElement(
|
5622
|
-
RequestDialog,
|
5623
|
-
{
|
5624
|
-
title: `You're invited to join the ${roleChangeRequest.role.name} role`,
|
5625
|
-
onOpenChange: (value) => __async(void 0, null, function* () {
|
5626
|
-
var _a;
|
5627
|
-
if (!value) {
|
5628
|
-
yield hmsActions.rejectChangeRole(roleChangeRequest);
|
5629
|
-
sendEvent(__spreadProps(__spreadValues({}, roleChangeRequest), { peerName: name }), { peerId: (_a = roleChangeRequest.requestedBy) == null ? void 0 : _a.id });
|
5630
|
-
yield hmsActions.cancelMidCallPreview();
|
5631
|
-
yield hmsActions.lowerLocalPeerHand();
|
5632
|
-
}
|
5633
|
-
}),
|
5634
|
-
body,
|
5635
|
-
onAction: () => __async(void 0, null, function* () {
|
5636
|
-
yield hmsActions.acceptChangeRole(roleChangeRequest);
|
5637
|
-
yield updateMetaData({ prevRole: currentRole });
|
5638
|
-
yield hmsActions.lowerLocalPeerHand();
|
5639
|
-
}),
|
5640
|
-
actionText: "Accept"
|
5641
|
-
}
|
5642
|
-
);
|
5643
|
-
};
|
5644
|
-
var RequestDialog = ({
|
5645
|
-
open = true,
|
5646
|
-
onOpenChange,
|
5647
|
-
title,
|
5648
|
-
body,
|
5649
|
-
actionText = "Accept",
|
5650
|
-
onAction
|
5651
|
-
}) => /* @__PURE__ */ React61.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React61.createElement(Dialog.Portal, null, /* @__PURE__ */ React61.createElement(Dialog.Overlay, null), /* @__PURE__ */ React61.createElement(Dialog.Content, { css: { p: "$10" } }, /* @__PURE__ */ React61.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md", justifyContent: "center" } }, /* @__PURE__ */ React61.createElement(Text, { variant: "h6" }, title)), /* @__PURE__ */ React61.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React61.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md" } }, /* @__PURE__ */ React61.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React61.createElement(Dialog.Close, { css: { width: "100%" } }, /* @__PURE__ */ React61.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%" } }, "Cancel"))), /* @__PURE__ */ React61.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React61.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction }, actionText))))));
|
5652
|
-
|
5653
6358
|
// src/Prebuilt/components/conference.jsx
|
5654
6359
|
var Conference = () => {
|
5655
6360
|
var _a, _b, _c, _d, _e;
|
@@ -5658,17 +6363,17 @@ var Conference = () => {
|
|
5658
6363
|
const { userName, endpoints } = useHMSPrebuiltContext();
|
5659
6364
|
const screenProps = useRoomLayoutConferencingScreen();
|
5660
6365
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
5661
|
-
const roomState =
|
6366
|
+
const roomState = useHMSStore39(selectRoomState);
|
5662
6367
|
const prevState = usePrevious(roomState);
|
5663
|
-
const isConnectedToRoom =
|
5664
|
-
const hmsActions =
|
5665
|
-
const [hideControls, setHideControls] =
|
5666
|
-
const dropdownList =
|
6368
|
+
const isConnectedToRoom = useHMSStore39(selectIsConnectedToRoom7);
|
6369
|
+
const hmsActions = useHMSActions25();
|
6370
|
+
const [hideControls, setHideControls] = useState39(false);
|
6371
|
+
const dropdownList = useHMSStore39(selectAppData4(APP_DATA.dropdownList));
|
5667
6372
|
const authTokenInAppData = useAuthToken();
|
5668
|
-
const headerRef =
|
5669
|
-
const footerRef =
|
6373
|
+
const headerRef = useRef16();
|
6374
|
+
const footerRef = useRef16();
|
5670
6375
|
const isMobileDevice = isAndroid || isIOS || isIPadOS;
|
5671
|
-
const dropdownListRef =
|
6376
|
+
const dropdownListRef = useRef16();
|
5672
6377
|
const [isHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
5673
6378
|
const toggleControls = () => {
|
5674
6379
|
var _a2;
|
@@ -5676,8 +6381,8 @@ var Conference = () => {
|
|
5676
6381
|
setHideControls((value) => !value);
|
5677
6382
|
}
|
5678
6383
|
};
|
5679
|
-
const autoRoomJoined =
|
5680
|
-
|
6384
|
+
const autoRoomJoined = useRef16(isPreviewScreenEnabled);
|
6385
|
+
useEffect27(() => {
|
5681
6386
|
let timeout = null;
|
5682
6387
|
dropdownListRef.current = dropdownList || [];
|
5683
6388
|
if (dropdownListRef.current.length === 0) {
|
@@ -5692,7 +6397,7 @@ var Conference = () => {
|
|
5692
6397
|
clearTimeout(timeout);
|
5693
6398
|
};
|
5694
6399
|
}, [dropdownList, hideControls, isMobileDevice]);
|
5695
|
-
|
6400
|
+
useEffect27(() => {
|
5696
6401
|
if (!roomId) {
|
5697
6402
|
navigate(`/`);
|
5698
6403
|
return;
|
@@ -5707,7 +6412,7 @@ var Conference = () => {
|
|
5707
6412
|
navigate(`/preview/${roomId || ""}`);
|
5708
6413
|
}
|
5709
6414
|
}, [isConnectedToRoom, prevState, roomState, navigate, role, roomId, isPreviewScreenEnabled]);
|
5710
|
-
|
6415
|
+
useEffect27(() => {
|
5711
6416
|
if (authTokenInAppData && !isConnectedToRoom && !isPreviewScreenEnabled && roomState !== HMSRoomState.Connecting && !autoRoomJoined.current) {
|
5712
6417
|
hmsActions.join({
|
5713
6418
|
userName,
|
@@ -5722,15 +6427,15 @@ var Conference = () => {
|
|
5722
6427
|
autoRoomJoined.current = true;
|
5723
6428
|
}
|
5724
6429
|
}, [authTokenInAppData, endpoints == null ? void 0 : endpoints.init, hmsActions, isConnectedToRoom, isPreviewScreenEnabled, roomState, userName]);
|
5725
|
-
|
6430
|
+
useEffect27(() => {
|
5726
6431
|
return () => {
|
5727
6432
|
PictureInPicture.stop().catch((error) => console.error("stopping pip", error));
|
5728
6433
|
};
|
5729
6434
|
}, []);
|
5730
6435
|
if (!isConnectedToRoom) {
|
5731
|
-
return /* @__PURE__ */
|
6436
|
+
return /* @__PURE__ */ React68.createElement(FullPageProgress_default, { text: "Joining..." });
|
5732
6437
|
}
|
5733
|
-
return /* @__PURE__ */
|
6438
|
+
return /* @__PURE__ */ React68.createElement(React68.Fragment, null, isHLSStarted ? /* @__PURE__ */ React68.createElement(Box, { css: { position: "fixed", zIndex: 100, w: "100%", h: "100%", left: 0, top: 0 } }, /* @__PURE__ */ React68.createElement(FullPageProgress_default, { text: "Starting live stream...", css: { opacity: 0.8, bg: "$background_dim" } })) : null, /* @__PURE__ */ React68.createElement(Flex, { css: { size: "100%", overflow: "hidden" }, direction: "column" }, !screenProps.hideSections.includes("header") && /* @__PURE__ */ React68.createElement(
|
5734
6439
|
Box,
|
5735
6440
|
{
|
5736
6441
|
ref: headerRef,
|
@@ -5744,8 +6449,8 @@ var Conference = () => {
|
|
5744
6449
|
},
|
5745
6450
|
"data-testid": "header"
|
5746
6451
|
},
|
5747
|
-
/* @__PURE__ */
|
5748
|
-
), /* @__PURE__ */
|
6452
|
+
/* @__PURE__ */ React68.createElement(Header, { elements: screenProps.elements, screenType: screenProps.screenType })
|
6453
|
+
), /* @__PURE__ */ React68.createElement(
|
5749
6454
|
Box,
|
5750
6455
|
{
|
5751
6456
|
css: {
|
@@ -5763,7 +6468,7 @@ var Conference = () => {
|
|
5763
6468
|
"data-testid": "conferencing",
|
5764
6469
|
onClick: toggleControls
|
5765
6470
|
},
|
5766
|
-
/* @__PURE__ */
|
6471
|
+
/* @__PURE__ */ React68.createElement(
|
5767
6472
|
VideoStreamingSection,
|
5768
6473
|
{
|
5769
6474
|
screenType: screenProps.screenType,
|
@@ -5771,7 +6476,7 @@ var Conference = () => {
|
|
5771
6476
|
hideControls
|
5772
6477
|
}
|
5773
6478
|
)
|
5774
|
-
), !screenProps.hideSections.includes("footer") && /* @__PURE__ */
|
6479
|
+
), !screenProps.hideSections.includes("footer") && /* @__PURE__ */ React68.createElement(
|
5775
6480
|
Box,
|
5776
6481
|
{
|
5777
6482
|
ref: footerRef,
|
@@ -5788,11 +6493,11 @@ var Conference = () => {
|
|
5788
6493
|
},
|
5789
6494
|
"data-testid": "footer"
|
5790
6495
|
},
|
5791
|
-
/* @__PURE__ */
|
5792
|
-
), /* @__PURE__ */
|
6496
|
+
/* @__PURE__ */ React68.createElement(Footer2, { elements: screenProps.elements, screenType: screenProps.screenType })
|
6497
|
+
), /* @__PURE__ */ React68.createElement(RoleChangeRequestModal, null), /* @__PURE__ */ React68.createElement(HLSFailureModal, null), /* @__PURE__ */ React68.createElement(ActivatedPIP, null)));
|
5793
6498
|
};
|
5794
6499
|
var conference_default = Conference;
|
5795
6500
|
export {
|
5796
6501
|
conference_default as default
|
5797
6502
|
};
|
5798
|
-
//# sourceMappingURL=conference-
|
6503
|
+
//# sourceMappingURL=conference-JD35TNH4.js.map
|