@100mslive/roomkit-react 0.1.6-alpha.1 → 0.1.6-alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-HNVYG5VE.js → HLSView-HL455FYH.js} +3 -3
- package/dist/Prebuilt/components/Footer/ChatToggle.d.ts +1 -3
- package/dist/Prebuilt/components/Leave/DesktopLeaveRoom.d.ts +2 -1
- package/dist/Prebuilt/components/Leave/MwebLeaveRoom.d.ts +2 -1
- package/dist/Prebuilt/components/SidePaneTabs.d.ts +7 -0
- package/dist/{VirtualBackground-UM2FOUHQ.js → VirtualBackground-6EP3X7MO.js} +6 -6
- package/dist/VirtualBackground-6EP3X7MO.js.map +7 -0
- package/dist/{chunk-LYSAET4G.js → chunk-6JF3GAOH.js} +109 -127
- package/dist/chunk-6JF3GAOH.js.map +7 -0
- package/dist/{chunk-POE7H4IE.js → chunk-KAJJ56J4.js} +2 -2
- package/dist/{chunk-POE7H4IE.js.map → chunk-KAJJ56J4.js.map} +1 -1
- package/dist/{chunk-364HP22I.js → chunk-UXBTLGWY.js} +2 -2
- package/dist/{conference-UWLJHMB2.js → conference-MPZNWHV5.js} +472 -415
- package/dist/conference-MPZNWHV5.js.map +7 -0
- package/dist/index.cjs.js +714 -678
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +153 -153
- package/dist/meta.esbuild.json +185 -184
- package/package.json +6 -6
- package/src/Button/Button.tsx +6 -6
- package/src/Prebuilt/components/Chat/Chat.jsx +3 -9
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +1 -0
- package/src/Prebuilt/components/Footer/ChatToggle.tsx +2 -9
- package/src/Prebuilt/components/Footer/Footer.tsx +23 -7
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +4 -5
- package/src/Prebuilt/components/Footer/RoleAccordion.tsx +1 -1
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +10 -9
- package/src/Prebuilt/components/InsetTile.tsx +1 -0
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +7 -9
- package/src/Prebuilt/components/Leave/LeaveRoom.tsx +6 -2
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +7 -4
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +1 -1
- package/src/Prebuilt/components/Notifications/Notifications.jsx +4 -3
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +2 -3
- package/src/Prebuilt/components/RoleChangeRequestModal.tsx +4 -3
- package/src/Prebuilt/components/ScreenshareTile.jsx +15 -7
- package/src/Prebuilt/components/SidePaneTabs.tsx +141 -0
- package/src/Prebuilt/components/conference.jsx +9 -1
- package/src/Prebuilt/components/hooks/useMetadata.jsx +7 -25
- package/src/Prebuilt/layouts/SidePane.tsx +12 -10
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +3 -3
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +2 -2
- package/dist/VirtualBackground-UM2FOUHQ.js.map +0 -7
- package/dist/chunk-LYSAET4G.js.map +0 -7
- package/dist/conference-UWLJHMB2.js.map +0 -7
- package/src/Prebuilt/components/Chat/ChatParticipantHeader.jsx +0 -84
- /package/dist/{HLSView-HNVYG5VE.js.map → HLSView-HL455FYH.js.map} +0 -0
- /package/dist/{chunk-364HP22I.js.map → chunk-UXBTLGWY.js.map} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
ActionTile
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-UXBTLGWY.js";
|
4
4
|
import {
|
5
5
|
APP_DATA,
|
6
6
|
Accordion,
|
@@ -77,13 +77,14 @@ import {
|
|
77
77
|
useSetAppDataByKey,
|
78
78
|
useSetSubscribedChatSelector,
|
79
79
|
useSetUiSettings,
|
80
|
+
useSidepaneReset,
|
80
81
|
useSidepaneToggle,
|
81
82
|
useTheme,
|
82
83
|
useUISettings,
|
83
84
|
useUrlToEmbed,
|
84
85
|
useUserPreferences,
|
85
86
|
useWaitingViewerRole
|
86
|
-
} from "./chunk-
|
87
|
+
} from "./chunk-6JF3GAOH.js";
|
87
88
|
import {
|
88
89
|
Box,
|
89
90
|
Flex,
|
@@ -102,10 +103,10 @@ import {
|
|
102
103
|
slideLeftAndFade,
|
103
104
|
styled,
|
104
105
|
textEllipsis
|
105
|
-
} from "./chunk-
|
106
|
+
} from "./chunk-KAJJ56J4.js";
|
106
107
|
|
107
108
|
// src/Prebuilt/components/conference.jsx
|
108
|
-
import React62, { useEffect as
|
109
|
+
import React62, { useEffect as useEffect25, useRef as useRef14, useState as useState35 } from "react";
|
109
110
|
import { useNavigate, useParams } from "react-router-dom";
|
110
111
|
import { usePrevious } from "react-use";
|
111
112
|
import {
|
@@ -114,14 +115,13 @@ import {
|
|
114
115
|
selectIsConnectedToRoom as selectIsConnectedToRoom7,
|
115
116
|
selectRoomState,
|
116
117
|
useHMSActions as useHMSActions22,
|
117
|
-
useHMSStore as
|
118
|
+
useHMSStore as useHMSStore36
|
118
119
|
} from "@100mslive/react-sdk";
|
119
120
|
|
120
121
|
// src/Prebuilt/components/Footer/Footer.tsx
|
121
|
-
import
|
122
|
+
import React36, { Suspense, useEffect as useEffect6 } from "react";
|
122
123
|
import { useMedia as useMedia5 } from "react-use";
|
123
124
|
import { Chat_ChatState } from "@100mslive/types-prebuilt/elements/chat";
|
124
|
-
import { selectIsLocalVideoEnabled as selectIsLocalVideoEnabled2, useHMSStore as useHMSStore18 } from "@100mslive/react-sdk";
|
125
125
|
|
126
126
|
// src/Prebuilt/components/EmojiReaction.jsx
|
127
127
|
import React2, { Fragment, useState } from "react";
|
@@ -335,7 +335,8 @@ var LeaveSessionContent = ({
|
|
335
335
|
// src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx
|
336
336
|
var DesktopLeaveRoom = ({
|
337
337
|
leaveRoom,
|
338
|
-
screenType
|
338
|
+
screenType,
|
339
|
+
endRoom
|
339
340
|
}) => {
|
340
341
|
const [open, setOpen] = useState2(false);
|
341
342
|
const [showLeaveRoomAlert, setShowLeaveRoomAlert] = useState2(false);
|
@@ -343,12 +344,12 @@ var DesktopLeaveRoom = ({
|
|
343
344
|
const isConnected = useHMSStore2(selectIsConnectedToRoom2);
|
344
345
|
const permissions = useHMSStore2(selectPermissions);
|
345
346
|
const { isStreamingOn } = useRecordingStreaming();
|
346
|
-
const showStream =
|
347
|
+
const showStream = screenType !== "hls_live_streaming" && isStreamingOn;
|
347
348
|
useDropdownList({ open: open || showEndStreamAlert || showLeaveRoomAlert, name: "LeaveRoom" });
|
348
349
|
if (!permissions || !isConnected) {
|
349
350
|
return null;
|
350
351
|
}
|
351
|
-
return /* @__PURE__ */ React6.createElement(Fragment2, null, permissions.hlsStreaming ? /* @__PURE__ */ React6.createElement(Flex, null, /* @__PURE__ */ React6.createElement(
|
352
|
+
return /* @__PURE__ */ React6.createElement(Fragment2, null, screenType !== "hls_live_streaming" && ((permissions == null ? void 0 : permissions.hlsStreaming) || (permissions == null ? void 0 : permissions.endRoom)) ? /* @__PURE__ */ React6.createElement(Flex, null, /* @__PURE__ */ React6.createElement(
|
352
353
|
LeaveIconButton,
|
353
354
|
{
|
354
355
|
key: "LeaveRoom",
|
@@ -358,11 +359,7 @@ var DesktopLeaveRoom = ({
|
|
358
359
|
borderBottomRightRadius: 0
|
359
360
|
},
|
360
361
|
onClick: () => {
|
361
|
-
|
362
|
-
setShowLeaveRoomAlert(true);
|
363
|
-
} else {
|
364
|
-
leaveRoom({ endstream: false });
|
365
|
-
}
|
362
|
+
leaveRoom({ endstream: false });
|
366
363
|
}
|
367
364
|
},
|
368
365
|
/* @__PURE__ */ React6.createElement(Tooltip, { title: "Leave Room" }, /* @__PURE__ */ React6.createElement(Box, null, /* @__PURE__ */ React6.createElement(ExitIcon, { style: { transform: "rotate(180deg)" } })))
|
@@ -400,7 +397,7 @@ var DesktopLeaveRoom = ({
|
|
400
397
|
css: { p: 0 }
|
401
398
|
}
|
402
399
|
)
|
403
|
-
),
|
400
|
+
), (permissions == null ? void 0 : permissions.endRoom) || (permissions == null ? void 0 : permissions.hlsStreaming) ? /* @__PURE__ */ React6.createElement(
|
404
401
|
Dropdown.Item,
|
405
402
|
{
|
406
403
|
css: {
|
@@ -443,7 +440,7 @@ var DesktopLeaveRoom = ({
|
|
443
440
|
EndSessionContent,
|
444
441
|
{
|
445
442
|
setShowEndStreamAlert,
|
446
|
-
leaveRoom,
|
443
|
+
leaveRoom: isStreamingOn ? leaveRoom : endRoom,
|
447
444
|
isStreamingOn,
|
448
445
|
isModal: true
|
449
446
|
}
|
@@ -456,7 +453,8 @@ import { selectIsConnectedToRoom as selectIsConnectedToRoom3, selectPermissions
|
|
456
453
|
import { ExitIcon as ExitIcon2, StopIcon as StopIcon2 } from "@100mslive/react-icons";
|
457
454
|
var MwebLeaveRoom = ({
|
458
455
|
leaveRoom,
|
459
|
-
screenType
|
456
|
+
screenType,
|
457
|
+
endRoom
|
460
458
|
}) => {
|
461
459
|
const [open, setOpen] = useState3(false);
|
462
460
|
const [showLeaveRoomAlert, setShowLeaveRoomAlert] = useState3(false);
|
@@ -464,12 +462,12 @@ var MwebLeaveRoom = ({
|
|
464
462
|
const isConnected = useHMSStore3(selectIsConnectedToRoom3);
|
465
463
|
const permissions = useHMSStore3(selectPermissions2);
|
466
464
|
const { isStreamingOn } = useRecordingStreaming2();
|
467
|
-
const showStream =
|
465
|
+
const showStream = screenType !== "hls_live_streaming" && isStreamingOn;
|
468
466
|
useDropdownList({ open, name: "LeaveRoom" });
|
469
467
|
if (!permissions || !isConnected) {
|
470
468
|
return null;
|
471
469
|
}
|
472
|
-
return /* @__PURE__ */ React7.createElement(Fragment3, null,
|
470
|
+
return /* @__PURE__ */ React7.createElement(Fragment3, null, screenType !== "hls_live_streaming" ? /* @__PURE__ */ React7.createElement(Sheet.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React7.createElement(Sheet.Trigger, { asChild: true }, /* @__PURE__ */ React7.createElement(
|
473
471
|
LeaveIconButton,
|
474
472
|
{
|
475
473
|
key: "LeaveRoom",
|
@@ -491,7 +489,7 @@ var MwebLeaveRoom = ({
|
|
491
489
|
onClick: () => leaveRoom({ endstream: false }),
|
492
490
|
css: { pt: 0, mt: "$10", color: "$on_surface_low", "&:hover": { color: "$on_surface_high" } }
|
493
491
|
}
|
494
|
-
),
|
492
|
+
), (permissions == null ? void 0 : permissions.endRoom) || (permissions == null ? void 0 : permissions.hlsStreaming) ? /* @__PURE__ */ React7.createElement(
|
495
493
|
LeaveCard,
|
496
494
|
{
|
497
495
|
title: showStream ? "End Stream" : "End Session",
|
@@ -523,7 +521,7 @@ var MwebLeaveRoom = ({
|
|
523
521
|
EndSessionContent,
|
524
522
|
{
|
525
523
|
setShowEndStreamAlert,
|
526
|
-
leaveRoom,
|
524
|
+
leaveRoom: isStreamingOn ? leaveRoom : endRoom,
|
527
525
|
isStreamingOn
|
528
526
|
}
|
529
527
|
))), screenType === "hls_live_streaming" ? /* @__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 }))) : null);
|
@@ -555,6 +553,10 @@ var LeaveRoom = ({ screenType }) => {
|
|
555
553
|
ToastManager.addToast({ title: "Error in stopping the stream", type: "error" });
|
556
554
|
}
|
557
555
|
});
|
556
|
+
const endRoom = () => {
|
557
|
+
hmsActions.endRoom(false, "End Room");
|
558
|
+
redirectToLeave();
|
559
|
+
};
|
558
560
|
const leaveRoom = (_0) => __async(void 0, [_0], function* ({ endstream = false }) {
|
559
561
|
if (endstream || hlsState.running && peersWithStreamingRights.length === 1) {
|
560
562
|
yield stopStream();
|
@@ -565,7 +567,7 @@ var LeaveRoom = ({ screenType }) => {
|
|
565
567
|
if (!permissions || !isConnected) {
|
566
568
|
return null;
|
567
569
|
}
|
568
|
-
return isMobile ? /* @__PURE__ */ React8.createElement(MwebLeaveRoom, { leaveRoom, screenType }) : /* @__PURE__ */ React8.createElement(DesktopLeaveRoom, { leaveRoom, screenType });
|
570
|
+
return isMobile ? /* @__PURE__ */ React8.createElement(MwebLeaveRoom, { leaveRoom, screenType, endRoom }) : /* @__PURE__ */ React8.createElement(DesktopLeaveRoom, { leaveRoom, screenType, endRoom });
|
569
571
|
};
|
570
572
|
|
571
573
|
// src/Prebuilt/components/MoreSettings/MoreSettings.tsx
|
@@ -2068,7 +2070,7 @@ var MwebOptions = ({
|
|
2068
2070
|
isRecordingLoading ? /* @__PURE__ */ React22.createElement(Loading, null) : /* @__PURE__ */ React22.createElement(RecordIcon2, null),
|
2069
2071
|
/* @__PURE__ */ React22.createElement(ActionTile.Title, null, isBrowserRecordingOn ? "Recording On" : isRecordingLoading ? "Starting Recording" : "Start Recording")
|
2070
2072
|
) : null
|
2071
|
-
))), /* @__PURE__ */ React22.createElement(SettingsModal_default, { open: openSettingsSheet, onOpenChange: setOpenSettingsSheet }), openModals.has(MODALS2.MUTE_ALL) && /* @__PURE__ */ React22.createElement(MuteAllModal, { onOpenChange: (value) => updateState(MODALS2.MUTE_ALL, value), isMobile: true }), openModals.has(MODALS2.CHANGE_NAME) && /* @__PURE__ */ React22.createElement(
|
2073
|
+
))), /* @__PURE__ */ React22.createElement(SettingsModal_default, { open: openSettingsSheet, onOpenChange: setOpenSettingsSheet, screenType }), openModals.has(MODALS2.MUTE_ALL) && /* @__PURE__ */ React22.createElement(MuteAllModal, { onOpenChange: (value) => updateState(MODALS2.MUTE_ALL, value), isMobile: true }), openModals.has(MODALS2.CHANGE_NAME) && /* @__PURE__ */ React22.createElement(
|
2072
2074
|
ChangeNameModal,
|
2073
2075
|
{
|
2074
2076
|
onOpenChange: (value) => updateState(MODALS2.CHANGE_NAME, value),
|
@@ -2644,33 +2646,28 @@ var ScreenshareToggle = ({ css = {} }) => {
|
|
2644
2646
|
};
|
2645
2647
|
|
2646
2648
|
// src/Prebuilt/components/Footer/ChatToggle.tsx
|
2647
|
-
import React32
|
2649
|
+
import React32 from "react";
|
2648
2650
|
import { selectUnreadHMSMessagesCount, useHMSStore as useHMSStore14 } from "@100mslive/react-sdk";
|
2649
2651
|
import { ChatIcon, ChatUnreadIcon } from "@100mslive/react-icons";
|
2650
|
-
var ChatToggle = (
|
2652
|
+
var ChatToggle = () => {
|
2651
2653
|
const countUnreadMessages = useHMSStore14(selectUnreadHMSMessagesCount);
|
2652
2654
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
2653
2655
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
2654
|
-
useEffect5(() => {
|
2655
|
-
if (!isChatOpen && openByDefault) {
|
2656
|
-
toggleChat();
|
2657
|
-
}
|
2658
|
-
}, [toggleChat, openByDefault]);
|
2659
2656
|
return /* @__PURE__ */ React32.createElement(Tooltip, { key: "chat", title: `${isChatOpen ? "Close" : "Open"} chat` }, /* @__PURE__ */ React32.createElement(IconButton_default, { onClick: toggleChat, active: !isChatOpen, "data-testid": "chat_btn" }, countUnreadMessages === 0 ? /* @__PURE__ */ React32.createElement(ChatIcon, null) : /* @__PURE__ */ React32.createElement(ChatUnreadIcon, { "data-testid": "chat_unread_btn" })));
|
2660
2657
|
};
|
2661
2658
|
|
2662
2659
|
// src/Prebuilt/components/Footer/ParticipantList.jsx
|
2663
|
-
import
|
2660
|
+
import React35, { Fragment as Fragment7, useCallback as useCallback6, useEffect as useEffect5, useState as useState18 } from "react";
|
2664
2661
|
import { useDebounce, useMedia as useMedia4 } from "react-use";
|
2665
2662
|
import {
|
2666
2663
|
selectIsPeerAudioEnabled,
|
2667
2664
|
selectLocalPeerID as selectLocalPeerID4,
|
2668
|
-
selectPeerCount as
|
2665
|
+
selectPeerCount as selectPeerCount2,
|
2669
2666
|
selectPeerMetadata as selectPeerMetadata2,
|
2670
2667
|
selectPeersByCondition as selectPeersByCondition2,
|
2671
2668
|
selectPermissions as selectPermissions8,
|
2672
2669
|
useHMSActions as useHMSActions11,
|
2673
|
-
useHMSStore as
|
2670
|
+
useHMSStore as useHMSStore16
|
2674
2671
|
} from "@100mslive/react-sdk";
|
2675
2672
|
import {
|
2676
2673
|
ChangeRoleIcon as ChangeRoleIcon2,
|
@@ -2682,86 +2679,14 @@ import {
|
|
2682
2679
|
VerticalMenuIcon as VerticalMenuIcon4
|
2683
2680
|
} from "@100mslive/react-icons";
|
2684
2681
|
|
2685
|
-
// src/Prebuilt/components/Chat/ChatParticipantHeader.jsx
|
2686
|
-
import React33, { useState as useState17 } from "react";
|
2687
|
-
import { selectPeerCount as selectPeerCount2, useHMSStore as useHMSStore15 } from "@100mslive/react-sdk";
|
2688
|
-
import { CrossIcon as CrossIcon5 } from "@100mslive/react-icons";
|
2689
|
-
var tabTriggerCSS = {
|
2690
|
-
color: "$on_surface_high",
|
2691
|
-
p: "$4",
|
2692
|
-
fontWeight: "$semiBold",
|
2693
|
-
fontSize: "$sm",
|
2694
|
-
w: "100%",
|
2695
|
-
justifyContent: "center"
|
2696
|
-
};
|
2697
|
-
var ChatParticipantHeader = React33.memo(({ activeTabValue = SIDE_PANE_OPTIONS.CHAT }) => {
|
2698
|
-
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
2699
|
-
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
2700
|
-
const [activeTab, setActiveTab] = useState17(activeTabValue);
|
2701
|
-
const peerCount = useHMSStore15(selectPeerCount2);
|
2702
|
-
const { elements } = useRoomLayoutConferencingScreen();
|
2703
|
-
const showChat = !!(elements == null ? void 0 : elements.chat);
|
2704
|
-
const showParticipants = !!(elements == null ? void 0 : elements.participant_list);
|
2705
|
-
const hideTabs = !(showChat && showParticipants);
|
2706
|
-
return /* @__PURE__ */ React33.createElement(
|
2707
|
-
Flex,
|
2708
|
-
{
|
2709
|
-
align: "center",
|
2710
|
-
css: {
|
2711
|
-
color: "$on_primary_high",
|
2712
|
-
h: "$16"
|
2713
|
-
}
|
2714
|
-
},
|
2715
|
-
hideTabs ? /* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", c: "$on_surface_high" } }, showChat ? "Chat" : `Participants (${peerCount})`) : /* @__PURE__ */ React33.createElement(Flex, { css: { w: "100%", bg: "$surface_default", borderRadius: "$2" } }, /* @__PURE__ */ React33.createElement(Tabs.Root, { value: activeTab, onValueChange: setActiveTab, css: { w: "100%" } }, /* @__PURE__ */ React33.createElement(Tabs.List, { css: { w: "100%", p: "$2" } }, /* @__PURE__ */ React33.createElement(
|
2716
|
-
Tabs.Trigger,
|
2717
|
-
{
|
2718
|
-
value: SIDE_PANE_OPTIONS.CHAT,
|
2719
|
-
onClick: toggleChat,
|
2720
|
-
css: __spreadProps(__spreadValues({}, tabTriggerCSS), {
|
2721
|
-
color: activeTab !== SIDE_PANE_OPTIONS.CHAT ? "$on_surface_low" : "$on_surface_high"
|
2722
|
-
})
|
2723
|
-
},
|
2724
|
-
"Chat"
|
2725
|
-
), /* @__PURE__ */ React33.createElement(
|
2726
|
-
Tabs.Trigger,
|
2727
|
-
{
|
2728
|
-
value: SIDE_PANE_OPTIONS.PARTICIPANTS,
|
2729
|
-
onClick: toggleParticipants,
|
2730
|
-
css: __spreadProps(__spreadValues({}, tabTriggerCSS), {
|
2731
|
-
color: activeTab !== SIDE_PANE_OPTIONS.PARTICIPANTS ? "$on_surface_low" : "$on_surface_high"
|
2732
|
-
})
|
2733
|
-
},
|
2734
|
-
"Participants (",
|
2735
|
-
peerCount,
|
2736
|
-
")"
|
2737
|
-
)))),
|
2738
|
-
/* @__PURE__ */ React33.createElement(
|
2739
|
-
IconButton,
|
2740
|
-
{
|
2741
|
-
css: { ml: "auto" },
|
2742
|
-
onClick: (e) => {
|
2743
|
-
e.stopPropagation();
|
2744
|
-
if (activeTab === SIDE_PANE_OPTIONS.CHAT) {
|
2745
|
-
toggleChat();
|
2746
|
-
} else {
|
2747
|
-
toggleParticipants();
|
2748
|
-
}
|
2749
|
-
},
|
2750
|
-
"data-testid": "close_chat"
|
2751
|
-
},
|
2752
|
-
/* @__PURE__ */ React33.createElement(CrossIcon5, null)
|
2753
|
-
)
|
2754
|
-
);
|
2755
|
-
});
|
2756
|
-
|
2757
2682
|
// src/Prebuilt/components/Footer/RoleAccordion.tsx
|
2758
|
-
import
|
2683
|
+
import React34 from "react";
|
2759
2684
|
import { useMeasure } from "react-use";
|
2760
2685
|
import { FixedSizeList } from "react-window";
|
2761
2686
|
|
2762
2687
|
// src/Prebuilt/components/Footer/RoleOptions.tsx
|
2763
|
-
import
|
2764
|
-
import { selectPermissions as selectPermissions7, useHMSActions as useHMSActions10, useHMSStore as
|
2688
|
+
import React33, { useState as useState17 } from "react";
|
2689
|
+
import { selectPermissions as selectPermissions7, useHMSActions as useHMSActions10, useHMSStore as useHMSStore15, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
2765
2690
|
import {
|
2766
2691
|
MicOffIcon as MicOffIcon2,
|
2767
2692
|
MicOnIcon,
|
@@ -2774,8 +2699,8 @@ import {
|
|
2774
2699
|
var dropdownItemCSS = { backgroundColor: "$surface_default", gap: "$4", p: "$8" };
|
2775
2700
|
var optionTextCSS = { fontWeight: "$semiBold", color: "$on_surface_high", textTransform: "none" };
|
2776
2701
|
var RoleOptions = ({ roleName, peerList }) => {
|
2777
|
-
const [openOptions, setOpenOptions] =
|
2778
|
-
const permissions =
|
2702
|
+
const [openOptions, setOpenOptions] = useState17(false);
|
2703
|
+
const permissions = useHMSStore15(selectPermissions7);
|
2779
2704
|
const hmsActions = useHMSActions10();
|
2780
2705
|
const { elements } = useRoomLayoutConferencingScreen();
|
2781
2706
|
const { on_stage_role, off_stage_roles = [] } = (elements == null ? void 0 : elements.on_stage_exp) || {};
|
@@ -2820,7 +2745,7 @@ var RoleOptions = ({ roleName, peerList }) => {
|
|
2820
2745
|
console.error(e);
|
2821
2746
|
}
|
2822
2747
|
});
|
2823
|
-
return /* @__PURE__ */
|
2748
|
+
return /* @__PURE__ */ React33.createElement(Dropdown.Root, { open: openOptions, onOpenChange: setOpenOptions }, /* @__PURE__ */ React33.createElement(
|
2824
2749
|
Dropdown.Trigger,
|
2825
2750
|
{
|
2826
2751
|
onClick: (e) => e.stopPropagation(),
|
@@ -2839,40 +2764,40 @@ var RoleOptions = ({ roleName, peerList }) => {
|
|
2839
2764
|
}
|
2840
2765
|
}
|
2841
2766
|
},
|
2842
|
-
/* @__PURE__ */
|
2843
|
-
), /* @__PURE__ */
|
2767
|
+
/* @__PURE__ */ React33.createElement(Flex, null, /* @__PURE__ */ React33.createElement(VerticalMenuIcon3, null))
|
2768
|
+
), /* @__PURE__ */ React33.createElement(
|
2844
2769
|
Dropdown.Content,
|
2845
2770
|
{
|
2846
2771
|
onClick: (e) => e.stopPropagation(),
|
2847
2772
|
css: { w: "max-content", maxWidth: "$64", bg: "$surface_default", py: 0 },
|
2848
2773
|
align: "end"
|
2849
2774
|
},
|
2850
|
-
canRemoveRoleFromStage && /* @__PURE__ */
|
2775
|
+
canRemoveRoleFromStage && /* @__PURE__ */ React33.createElement(
|
2851
2776
|
Dropdown.Item,
|
2852
2777
|
{
|
2853
2778
|
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderBottom: "1px solid $border_bright" }),
|
2854
2779
|
onClick: removeAllFromStage
|
2855
2780
|
},
|
2856
|
-
/* @__PURE__ */
|
2857
|
-
/* @__PURE__ */
|
2781
|
+
/* @__PURE__ */ React33.createElement(PersonRectangleIcon, null),
|
2782
|
+
/* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: optionTextCSS }, "Remove all from Stage")
|
2858
2783
|
),
|
2859
|
-
canMuteRole && /* @__PURE__ */
|
2784
|
+
canMuteRole && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(Dropdown.Item, { css: dropdownItemCSS, onClick: () => setTrackEnabled("audio", !allPeersHaveAudioOn) }, allPeersHaveAudioOn ? /* @__PURE__ */ React33.createElement(MicOffIcon2, null) : /* @__PURE__ */ React33.createElement(MicOnIcon, null), /* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: optionTextCSS }, allPeersHaveAudioOn ? "Mute" : "Unmute", " Audio")), /* @__PURE__ */ React33.createElement(
|
2860
2785
|
Dropdown.Item,
|
2861
2786
|
{
|
2862
2787
|
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderTop: "1px solid $border_bright" }),
|
2863
2788
|
onClick: () => setTrackEnabled("video", !allPeersHaveVideoOn)
|
2864
2789
|
},
|
2865
|
-
allPeersHaveVideoOn ? /* @__PURE__ */
|
2866
|
-
/* @__PURE__ */
|
2790
|
+
allPeersHaveVideoOn ? /* @__PURE__ */ React33.createElement(VideoOffIcon, null) : /* @__PURE__ */ React33.createElement(VideoOnIcon, null),
|
2791
|
+
/* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: optionTextCSS }, allPeersHaveVideoOn ? "Mute" : "Unmute", " Video")
|
2867
2792
|
)),
|
2868
|
-
canRemoveRoleFromRoom && /* @__PURE__ */
|
2793
|
+
canRemoveRoleFromRoom && /* @__PURE__ */ React33.createElement(
|
2869
2794
|
Dropdown.Item,
|
2870
2795
|
{
|
2871
2796
|
css: __spreadProps(__spreadValues({}, dropdownItemCSS), { borderTop: "1px solid $border_bright", color: "$alert_error_default" }),
|
2872
2797
|
onClick: removePeersFromRoom
|
2873
2798
|
},
|
2874
|
-
/* @__PURE__ */
|
2875
|
-
/* @__PURE__ */
|
2799
|
+
/* @__PURE__ */ React33.createElement(RemoveUserIcon, null),
|
2800
|
+
/* @__PURE__ */ React33.createElement(Text, { variant: "sm", css: __spreadProps(__spreadValues({}, optionTextCSS), { color: "inherit" }) }, "Remove all from Room")
|
2876
2801
|
)
|
2877
2802
|
));
|
2878
2803
|
};
|
@@ -2882,8 +2807,8 @@ var ROW_HEIGHT = 50;
|
|
2882
2807
|
function itemKey(index, data3) {
|
2883
2808
|
return data3.peerList[index].id;
|
2884
2809
|
}
|
2885
|
-
var VirtualizedParticipantItem =
|
2886
|
-
return /* @__PURE__ */
|
2810
|
+
var VirtualizedParticipantItem = React34.memo(({ index, data: data3 }) => {
|
2811
|
+
return /* @__PURE__ */ React34.createElement(Participant, { key: data3.peerList[index].id, peer: data3.peerList[index], isConnected: data3.isConnected });
|
2887
2812
|
});
|
2888
2813
|
var RoleAccordion = ({
|
2889
2814
|
peerList = [],
|
@@ -2898,7 +2823,7 @@ var RoleAccordion = ({
|
|
2898
2823
|
return null;
|
2899
2824
|
}
|
2900
2825
|
const height = ROW_HEIGHT * peerList.length;
|
2901
|
-
return /* @__PURE__ */
|
2826
|
+
return /* @__PURE__ */ React34.createElement(Flex, { direction: "column", css: { "&:hover .role_actions": { visibility: "visible" } }, ref }, /* @__PURE__ */ React34.createElement(
|
2902
2827
|
Accordion.Root,
|
2903
2828
|
{
|
2904
2829
|
type: "single",
|
@@ -2906,7 +2831,7 @@ var RoleAccordion = ({
|
|
2906
2831
|
defaultValue: roleName,
|
2907
2832
|
css: { borderRadius: "$1", border: "1px solid $border_bright" }
|
2908
2833
|
},
|
2909
|
-
/* @__PURE__ */
|
2834
|
+
/* @__PURE__ */ React34.createElement(Accordion.Item, { value: roleName }, /* @__PURE__ */ React34.createElement(
|
2910
2835
|
Accordion.Header,
|
2911
2836
|
{
|
2912
2837
|
iconStyles: { c: "$on_surface_high" },
|
@@ -2918,7 +2843,7 @@ var RoleAccordion = ({
|
|
2918
2843
|
c: "$on_surface_medium"
|
2919
2844
|
}
|
2920
2845
|
},
|
2921
|
-
/* @__PURE__ */
|
2846
|
+
/* @__PURE__ */ React34.createElement(Flex, { justify: "between", css: { flexGrow: 1, pr: "$6" } }, /* @__PURE__ */ React34.createElement(
|
2922
2847
|
Text,
|
2923
2848
|
{
|
2924
2849
|
variant: "sm",
|
@@ -2927,8 +2852,8 @@ var RoleAccordion = ({
|
|
2927
2852
|
roleName,
|
2928
2853
|
" ",
|
2929
2854
|
`(${getFormattedCount(peerList.length)})`
|
2930
|
-
), /* @__PURE__ */
|
2931
|
-
), /* @__PURE__ */
|
2855
|
+
), /* @__PURE__ */ React34.createElement(RoleOptions, { roleName, peerList }))
|
2856
|
+
), /* @__PURE__ */ React34.createElement(Accordion.Content, null, /* @__PURE__ */ React34.createElement(Box, { css: { borderTop: "1px solid $border_default" } }), /* @__PURE__ */ React34.createElement(
|
2932
2857
|
FixedSizeList,
|
2933
2858
|
{
|
2934
2859
|
itemSize: ROW_HEIGHT,
|
@@ -2945,10 +2870,10 @@ var RoleAccordion = ({
|
|
2945
2870
|
|
2946
2871
|
// src/Prebuilt/components/Footer/ParticipantList.jsx
|
2947
2872
|
var ParticipantList = () => {
|
2948
|
-
const [filter, setFilter] =
|
2873
|
+
const [filter, setFilter] = useState18();
|
2949
2874
|
const { participants, isConnected, peerCount } = useParticipants(filter);
|
2950
2875
|
const peersOrderedByRoles = {};
|
2951
|
-
const handRaisedPeers =
|
2876
|
+
const handRaisedPeers = useHMSStore16(selectPeersByCondition2((peer) => {
|
2952
2877
|
var _a;
|
2953
2878
|
return (_a = JSON.parse(peer.metadata || "{}")) == null ? void 0 : _a.isHandRaised;
|
2954
2879
|
}));
|
@@ -2970,7 +2895,7 @@ var ParticipantList = () => {
|
|
2970
2895
|
if (peerCount === 0) {
|
2971
2896
|
return null;
|
2972
2897
|
}
|
2973
|
-
return /* @__PURE__ */
|
2898
|
+
return /* @__PURE__ */ React35.createElement(Fragment7, null, /* @__PURE__ */ React35.createElement(Flex, { direction: "column", css: { size: "100%", gap: "$4" } }, !(filter == null ? void 0 : filter.search) && participants.length === 0 ? null : /* @__PURE__ */ React35.createElement(ParticipantSearch, { onSearch, inSidePane: true }), participants.length === 0 ? /* @__PURE__ */ React35.createElement(Flex, { align: "center", justify: "center", css: { w: "100%", p: "$8 0" } }, /* @__PURE__ */ React35.createElement(Text, { variant: "sm" }, !filter ? "No participants" : "No matching participants")) : null, /* @__PURE__ */ React35.createElement(
|
2974
2899
|
VirtualizedParticipants,
|
2975
2900
|
{
|
2976
2901
|
peersOrderedByRoles,
|
@@ -2981,10 +2906,10 @@ var ParticipantList = () => {
|
|
2981
2906
|
)));
|
2982
2907
|
};
|
2983
2908
|
var ParticipantCount = () => {
|
2984
|
-
const peerCount =
|
2909
|
+
const peerCount = useHMSStore16(selectPeerCount2);
|
2985
2910
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
2986
2911
|
const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
2987
|
-
|
2912
|
+
useEffect5(() => {
|
2988
2913
|
if (isParticipantsOpen && peerCount === 0) {
|
2989
2914
|
toggleSidepane();
|
2990
2915
|
}
|
@@ -2992,7 +2917,7 @@ var ParticipantCount = () => {
|
|
2992
2917
|
if (peerCount === 0) {
|
2993
2918
|
return null;
|
2994
2919
|
}
|
2995
|
-
return /* @__PURE__ */
|
2920
|
+
return /* @__PURE__ */ React35.createElement(
|
2996
2921
|
IconButton_default,
|
2997
2922
|
{
|
2998
2923
|
css: {
|
@@ -3008,24 +2933,25 @@ var ParticipantCount = () => {
|
|
3008
2933
|
active: !isParticipantsOpen,
|
3009
2934
|
"data-testid": "participant_list"
|
3010
2935
|
},
|
3011
|
-
/* @__PURE__ */
|
3012
|
-
/* @__PURE__ */
|
2936
|
+
/* @__PURE__ */ React35.createElement(PeopleIcon2, null),
|
2937
|
+
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { mx: "$4", c: "inherit" } }, peerCount)
|
3013
2938
|
);
|
3014
2939
|
};
|
3015
2940
|
var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter, handRaisedList = [] }) => {
|
3016
|
-
return /* @__PURE__ */
|
2941
|
+
return /* @__PURE__ */ React35.createElement(
|
3017
2942
|
Flex,
|
3018
2943
|
{
|
3019
2944
|
direction: "column",
|
3020
2945
|
css: {
|
3021
2946
|
gap: "$8",
|
3022
|
-
maxHeight: "100%",
|
3023
2947
|
overflowY: "auto",
|
3024
2948
|
overflowX: "hidden",
|
3025
|
-
pr: "$
|
2949
|
+
pr: "$10",
|
2950
|
+
mr: "-$10",
|
2951
|
+
flex: "1 1 0"
|
3026
2952
|
}
|
3027
2953
|
},
|
3028
|
-
/* @__PURE__ */
|
2954
|
+
/* @__PURE__ */ React35.createElement(
|
3029
2955
|
RoleAccordion,
|
3030
2956
|
{
|
3031
2957
|
peerList: handRaisedList,
|
@@ -3035,7 +2961,7 @@ var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter,
|
|
3035
2961
|
isHandRaisedAccordion: true
|
3036
2962
|
}
|
3037
2963
|
),
|
3038
|
-
Object.keys(peersOrderedByRoles).map((role) => /* @__PURE__ */
|
2964
|
+
Object.keys(peersOrderedByRoles).map((role) => /* @__PURE__ */ React35.createElement(
|
3039
2965
|
RoleAccordion,
|
3040
2966
|
{
|
3041
2967
|
key: role,
|
@@ -3048,8 +2974,8 @@ var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter,
|
|
3048
2974
|
);
|
3049
2975
|
};
|
3050
2976
|
var Participant = ({ peer, isConnected }) => {
|
3051
|
-
const localPeerId =
|
3052
|
-
return /* @__PURE__ */
|
2977
|
+
const localPeerId = useHMSStore16(selectLocalPeerID4);
|
2978
|
+
return /* @__PURE__ */ React35.createElement(
|
3053
2979
|
Flex,
|
3054
2980
|
{
|
3055
2981
|
key: peer.id,
|
@@ -3064,17 +2990,17 @@ var Participant = ({ peer, isConnected }) => {
|
|
3064
2990
|
justify: "between",
|
3065
2991
|
"data-testid": "participant_" + peer.name
|
3066
2992
|
},
|
3067
|
-
/* @__PURE__ */
|
3068
|
-
isConnected ? /* @__PURE__ */
|
2993
|
+
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: __spreadProps(__spreadValues({}, textEllipsis(150)), { fontWeight: "$semiBold", color: "$on_surface_high" }) }, peer.name, " ", localPeerId === peer.id ? "(You)" : ""),
|
2994
|
+
isConnected ? /* @__PURE__ */ React35.createElement(ParticipantActions, { peerId: peer.id, isLocal: peer.id === localPeerId, role: peer.roleName }) : null
|
3069
2995
|
);
|
3070
2996
|
};
|
3071
|
-
var ParticipantActions =
|
2997
|
+
var ParticipantActions = React35.memo(({ peerId, role, isLocal }) => {
|
3072
2998
|
var _a, _b;
|
3073
|
-
const isHandRaised = (_a =
|
3074
|
-
const canChangeRole = (_b =
|
2999
|
+
const isHandRaised = (_a = useHMSStore16(selectPeerMetadata2(peerId))) == null ? void 0 : _a.isHandRaised;
|
3000
|
+
const canChangeRole = (_b = useHMSStore16(selectPermissions8)) == null ? void 0 : _b.changeRole;
|
3075
3001
|
const shouldShowMoreActions = canChangeRole;
|
3076
|
-
const isAudioMuted = !
|
3077
|
-
return /* @__PURE__ */
|
3002
|
+
const isAudioMuted = !useHMSStore16(selectIsPeerAudioEnabled(peerId));
|
3003
|
+
return /* @__PURE__ */ React35.createElement(
|
3078
3004
|
Flex,
|
3079
3005
|
{
|
3080
3006
|
align: "center",
|
@@ -3083,32 +3009,32 @@ var ParticipantActions = React36.memo(({ peerId, role, isLocal }) => {
|
|
3083
3009
|
gap: "$8"
|
3084
3010
|
}
|
3085
3011
|
},
|
3086
|
-
/* @__PURE__ */
|
3087
|
-
isHandRaised && /* @__PURE__ */
|
3012
|
+
/* @__PURE__ */ React35.createElement(ConnectionIndicator, { peerId }),
|
3013
|
+
isHandRaised && /* @__PURE__ */ React35.createElement(
|
3088
3014
|
Flex,
|
3089
3015
|
{
|
3090
3016
|
align: "center",
|
3091
3017
|
justify: "center",
|
3092
3018
|
css: { p: "$1", c: "$on_surface_high", bg: "$surface_bright", borderRadius: "$round" }
|
3093
3019
|
},
|
3094
|
-
/* @__PURE__ */
|
3020
|
+
/* @__PURE__ */ React35.createElement(HandIcon3, { height: 19, width: 19 })
|
3095
3021
|
),
|
3096
|
-
isAudioMuted ? /* @__PURE__ */
|
3022
|
+
isAudioMuted ? /* @__PURE__ */ React35.createElement(
|
3097
3023
|
Flex,
|
3098
3024
|
{
|
3099
3025
|
align: "center",
|
3100
3026
|
justify: "center",
|
3101
3027
|
css: { p: "$2", c: "$on_surface_high", bg: "$surface_bright", borderRadius: "$round" }
|
3102
3028
|
},
|
3103
|
-
/* @__PURE__ */
|
3029
|
+
/* @__PURE__ */ React35.createElement(MicOffIcon3, { height: 19, width: 19 })
|
3104
3030
|
) : null,
|
3105
|
-
shouldShowMoreActions && !isInternalRole(role) && !isLocal ? /* @__PURE__ */
|
3031
|
+
shouldShowMoreActions && !isInternalRole(role) && !isLocal ? /* @__PURE__ */ React35.createElement(ParticipantMoreActions, { peerId, role }) : null
|
3106
3032
|
);
|
3107
3033
|
});
|
3108
3034
|
var ParticipantMoreActions = ({ peerId, role }) => {
|
3109
3035
|
var _a;
|
3110
3036
|
const hmsActions = useHMSActions11();
|
3111
|
-
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } =
|
3037
|
+
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } = useHMSStore16(selectPermissions8);
|
3112
3038
|
const { elements } = useRoomLayoutConferencingScreen();
|
3113
3039
|
const {
|
3114
3040
|
bring_to_stage_label,
|
@@ -3118,10 +3044,10 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3118
3044
|
} = elements.on_stage_exp || {};
|
3119
3045
|
const isInStage = role === on_stage_role;
|
3120
3046
|
const shouldShowStageRoleChange = canChangeRole && (isInStage && remove_from_stage_label || (off_stage_roles == null ? void 0 : off_stage_roles.includes(role)) && bring_to_stage_label);
|
3121
|
-
const prevRole = (_a =
|
3122
|
-
const localPeerId =
|
3047
|
+
const prevRole = (_a = useHMSStore16(selectPeerMetadata2(peerId))) == null ? void 0 : _a.prevRole;
|
3048
|
+
const localPeerId = useHMSStore16(selectLocalPeerID4);
|
3123
3049
|
const isLocal = localPeerId === peerId;
|
3124
|
-
const [open, setOpen] =
|
3050
|
+
const [open, setOpen] = useState18(false);
|
3125
3051
|
const handleStageAction = () => __async(void 0, null, function* () {
|
3126
3052
|
if (isInStage) {
|
3127
3053
|
prevRole && hmsActions.changeRoleOfPeer(peerId, prevRole, true);
|
@@ -3130,7 +3056,7 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3130
3056
|
}
|
3131
3057
|
setOpen(false);
|
3132
3058
|
});
|
3133
|
-
return /* @__PURE__ */
|
3059
|
+
return /* @__PURE__ */ React35.createElement(Dropdown.Root, { open, onOpenChange: (value) => setOpen(value), modal: false }, /* @__PURE__ */ React35.createElement(
|
3134
3060
|
Dropdown.Trigger,
|
3135
3061
|
{
|
3136
3062
|
asChild: true,
|
@@ -3150,8 +3076,8 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3150
3076
|
},
|
3151
3077
|
tabIndex: 0
|
3152
3078
|
},
|
3153
|
-
/* @__PURE__ */
|
3154
|
-
), /* @__PURE__ */
|
3079
|
+
/* @__PURE__ */ React35.createElement(Box, { css: { my: "auto" } }, /* @__PURE__ */ React35.createElement(VerticalMenuIcon4, null))
|
3080
|
+
), /* @__PURE__ */ React35.createElement(Dropdown.Portal, null, /* @__PURE__ */ React35.createElement(Dropdown.Content, { align: "end", sideOffset: 8, css: { w: "$64", bg: "$surface_default" } }, shouldShowStageRoleChange ? /* @__PURE__ */ React35.createElement(Dropdown.Item, { css: { bg: "$surface_default" }, onClick: () => handleStageAction() }, /* @__PURE__ */ React35.createElement(ChangeRoleIcon2, null), /* @__PURE__ */ React35.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__ */ React35.createElement(
|
3155
3081
|
Dropdown.Item,
|
3156
3082
|
{
|
3157
3083
|
css: { color: "$alert_error_default", bg: "$surface_default" },
|
@@ -3163,12 +3089,12 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3163
3089
|
}
|
3164
3090
|
})
|
3165
3091
|
},
|
3166
|
-
/* @__PURE__ */
|
3167
|
-
/* @__PURE__ */
|
3092
|
+
/* @__PURE__ */ React35.createElement(PeopleRemoveIcon, null),
|
3093
|
+
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { ml: "$4", color: "inherit", fontWeight: "$semiBold" } }, "Remove Participant")
|
3168
3094
|
))));
|
3169
3095
|
};
|
3170
3096
|
var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
3171
|
-
const [value, setValue] =
|
3097
|
+
const [value, setValue] = React35.useState("");
|
3172
3098
|
const isMobile = useMedia4(config.media.md);
|
3173
3099
|
useDebounce(
|
3174
3100
|
() => {
|
@@ -3177,20 +3103,20 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3177
3103
|
300,
|
3178
3104
|
[value, onSearch]
|
3179
3105
|
);
|
3180
|
-
return /* @__PURE__ */
|
3106
|
+
return /* @__PURE__ */ React35.createElement(
|
3181
3107
|
Flex,
|
3182
3108
|
{
|
3183
3109
|
align: "center",
|
3184
3110
|
css: {
|
3185
|
-
p: isMobile ? "
|
3111
|
+
p: isMobile ? "0" : "$2 0",
|
3186
3112
|
mb: "$2",
|
3187
3113
|
position: "relative",
|
3188
3114
|
color: "$on_surface_medium",
|
3189
3115
|
mt: inSidePane ? "$4" : ""
|
3190
3116
|
}
|
3191
3117
|
},
|
3192
|
-
/* @__PURE__ */
|
3193
|
-
/* @__PURE__ */
|
3118
|
+
/* @__PURE__ */ React35.createElement(SearchIcon, { style: { position: "absolute", left: isMobile ? "1.25rem" : "0.5rem" } }),
|
3119
|
+
/* @__PURE__ */ React35.createElement(
|
3194
3120
|
Input,
|
3195
3121
|
{
|
3196
3122
|
type: "text",
|
@@ -3211,7 +3137,7 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3211
3137
|
};
|
3212
3138
|
|
3213
3139
|
// src/Prebuilt/components/Footer/Footer.tsx
|
3214
|
-
var VirtualBackground =
|
3140
|
+
var VirtualBackground = React36.lazy(() => import("./VirtualBackground-6EP3X7MO.js"));
|
3215
3141
|
var Footer2 = ({
|
3216
3142
|
screenType,
|
3217
3143
|
elements
|
@@ -3220,8 +3146,14 @@ var Footer2 = ({
|
|
3220
3146
|
const isMobile = useMedia5(config.media.md);
|
3221
3147
|
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay);
|
3222
3148
|
const openByDefault = ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.initial_state) === Chat_ChatState.CHAT_STATE_OPEN;
|
3223
|
-
const
|
3224
|
-
|
3149
|
+
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3150
|
+
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3151
|
+
useEffect6(() => {
|
3152
|
+
if (!isChatOpen && openByDefault) {
|
3153
|
+
toggleChat();
|
3154
|
+
}
|
3155
|
+
}, [toggleChat, openByDefault]);
|
3156
|
+
return /* @__PURE__ */ React36.createElement(
|
3225
3157
|
Footer.Root,
|
3226
3158
|
{
|
3227
3159
|
css: {
|
@@ -3231,11 +3163,11 @@ var Footer2 = ({
|
|
3231
3163
|
gap: "$10",
|
3232
3164
|
position: "relative",
|
3233
3165
|
// To prevent it from showing over the sidepane if chat type is not overlay
|
3234
|
-
zIndex: isOverlayChat ? 20 : 1
|
3166
|
+
zIndex: isOverlayChat && isChatOpen ? 20 : 1
|
3235
3167
|
}
|
3236
3168
|
}
|
3237
3169
|
},
|
3238
|
-
/* @__PURE__ */
|
3170
|
+
/* @__PURE__ */ React36.createElement(
|
3239
3171
|
Footer.Left,
|
3240
3172
|
{
|
3241
3173
|
css: {
|
@@ -3246,11 +3178,11 @@ var Footer2 = ({
|
|
3246
3178
|
}
|
3247
3179
|
}
|
3248
3180
|
},
|
3249
|
-
isMobile ? /* @__PURE__ */
|
3250
|
-
/* @__PURE__ */
|
3251
|
-
isMobile ? null : /* @__PURE__ */
|
3181
|
+
isMobile ? /* @__PURE__ */ React36.createElement(LeaveRoom, { screenType }) : null,
|
3182
|
+
/* @__PURE__ */ React36.createElement(AudioVideoToggle, null),
|
3183
|
+
isMobile ? null : /* @__PURE__ */ React36.createElement(Suspense, { fallback: /* @__PURE__ */ React36.createElement(React36.Fragment, null) }, /* @__PURE__ */ React36.createElement(VirtualBackground, null))
|
3252
3184
|
),
|
3253
|
-
/* @__PURE__ */
|
3185
|
+
/* @__PURE__ */ React36.createElement(
|
3254
3186
|
Footer.Center,
|
3255
3187
|
{
|
3256
3188
|
css: {
|
@@ -3260,18 +3192,18 @@ var Footer2 = ({
|
|
3260
3192
|
}
|
3261
3193
|
}
|
3262
3194
|
},
|
3263
|
-
isMobile ? /* @__PURE__ */
|
3195
|
+
isMobile ? /* @__PURE__ */ React36.createElement(React36.Fragment, null, screenType === "hls_live_streaming" ? /* @__PURE__ */ React36.createElement(RaiseHand, null) : null, (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React36.createElement(ChatToggle, null), /* @__PURE__ */ React36.createElement(MoreSettings, { elements, screenType })) : /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement(ScreenshareToggle, null), /* @__PURE__ */ React36.createElement(RaiseHand, null), (elements == null ? void 0 : elements.emoji_reactions) && /* @__PURE__ */ React36.createElement(EmojiReaction, null), /* @__PURE__ */ React36.createElement(LeaveRoom, { screenType }))
|
3264
3196
|
),
|
3265
|
-
/* @__PURE__ */
|
3197
|
+
/* @__PURE__ */ React36.createElement(Footer.Right, null, !isMobile && (elements == null ? void 0 : elements.chat) && /* @__PURE__ */ React36.createElement(ChatToggle, null), (elements == null ? void 0 : elements.participant_list) && /* @__PURE__ */ React36.createElement(ParticipantCount, null), /* @__PURE__ */ React36.createElement(MoreSettings, { elements, screenType }))
|
3266
3198
|
);
|
3267
3199
|
};
|
3268
3200
|
|
3269
3201
|
// src/Prebuilt/components/Notifications/HLSFailureModal.jsx
|
3270
|
-
import
|
3271
|
-
import { selectHLSState as selectHLSState2, useHMSActions as useHMSActions12, useHMSStore as
|
3202
|
+
import React37, { useCallback as useCallback7, useState as useState19 } from "react";
|
3203
|
+
import { selectHLSState as selectHLSState2, useHMSActions as useHMSActions12, useHMSStore as useHMSStore17 } from "@100mslive/react-sdk";
|
3272
3204
|
function HLSFailureModal() {
|
3273
|
-
const { hlsError } =
|
3274
|
-
const [openModal, setOpenModal] =
|
3205
|
+
const { hlsError } = useHMSStore17(selectHLSState2).error || false;
|
3206
|
+
const [openModal, setOpenModal] = useState19(!!hlsError);
|
3275
3207
|
const hmsActions = useHMSActions12();
|
3276
3208
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
3277
3209
|
const startHLS = useCallback7(() => __async(this, null, function* () {
|
@@ -3289,7 +3221,7 @@ function HLSFailureModal() {
|
|
3289
3221
|
setHLSStarted(false);
|
3290
3222
|
}
|
3291
3223
|
}), [hmsActions, isHLSStarted, setHLSStarted]);
|
3292
|
-
return hlsError ? /* @__PURE__ */
|
3224
|
+
return hlsError ? /* @__PURE__ */ React37.createElement(
|
3293
3225
|
Dialog.Root,
|
3294
3226
|
{
|
3295
3227
|
open: openModal,
|
@@ -3299,7 +3231,7 @@ function HLSFailureModal() {
|
|
3299
3231
|
}
|
3300
3232
|
}
|
3301
3233
|
},
|
3302
|
-
/* @__PURE__ */
|
3234
|
+
/* @__PURE__ */ React37.createElement(Dialog.Portal, null, /* @__PURE__ */ React37.createElement(Dialog.Overlay, null), /* @__PURE__ */ React37.createElement(Dialog.Content, { css: { w: "min(360px, 90%)" } }, /* @__PURE__ */ React37.createElement(
|
3303
3235
|
Dialog.Title,
|
3304
3236
|
{
|
3305
3237
|
css: {
|
@@ -3310,34 +3242,34 @@ function HLSFailureModal() {
|
|
3310
3242
|
mt: "$4"
|
3311
3243
|
}
|
3312
3244
|
},
|
3313
|
-
/* @__PURE__ */
|
3314
|
-
), /* @__PURE__ */
|
3245
|
+
/* @__PURE__ */ React37.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, "Failed to Go Live")
|
3246
|
+
), /* @__PURE__ */ React37.createElement(Text, { variant: "sm", css: { mb: "$10", color: "$on_surface_medium" } }, "Something went wrong and your live broadcast failed. Please try again."), /* @__PURE__ */ React37.createElement(Flex, { align: "center", justify: "between", css: { w: "100%", gap: "$8" } }, /* @__PURE__ */ React37.createElement(Button, { outlined: true, variant: "standard", css: { w: "100%" }, onClick: () => setOpenModal(false) }, "Dismiss"), /* @__PURE__ */ React37.createElement(Button, { css: { w: "100%" }, onClick: startHLS }, "Go Live"))))
|
3315
3247
|
) : null;
|
3316
3248
|
}
|
3317
3249
|
|
3318
3250
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
3319
|
-
import React60, { Suspense as Suspense2, useEffect as
|
3320
|
-
import { selectIsConnectedToRoom as selectIsConnectedToRoom6, selectLocalPeerRoleName as selectLocalPeerRoleName2, useHMSActions as useHMSActions20, useHMSStore as
|
3251
|
+
import React60, { Suspense as Suspense2, useEffect as useEffect23 } from "react";
|
3252
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom6, selectLocalPeerRoleName as selectLocalPeerRoleName2, useHMSActions as useHMSActions20, useHMSStore as useHMSStore34 } from "@100mslive/react-sdk";
|
3321
3253
|
|
3322
3254
|
// src/Prebuilt/components/VideoLayouts/GridLayout.tsx
|
3323
|
-
import
|
3324
|
-
import { selectPeers as selectPeers2, selectPeerScreenSharing, useHMSStore as
|
3255
|
+
import React49, { useEffect as useEffect14, useMemo as useMemo6, useState as useState26 } from "react";
|
3256
|
+
import { selectPeers as selectPeers2, selectPeerScreenSharing, useHMSStore as useHMSStore23, useHMSVanillaStore as useHMSVanillaStore4 } from "@100mslive/react-sdk";
|
3325
3257
|
|
3326
3258
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3327
|
-
import
|
3259
|
+
import React42, { useEffect as useEffect10, useMemo as useMemo3, useState as useState21 } from "react";
|
3328
3260
|
import { useMedia as useMedia8 } from "react-use";
|
3329
|
-
import { selectLocalPeer as selectLocalPeer3, useHMSStore as
|
3261
|
+
import { selectLocalPeer as selectLocalPeer3, useHMSStore as useHMSStore19 } from "@100mslive/react-sdk";
|
3330
3262
|
|
3331
3263
|
// src/Prebuilt/components/InsetTile.tsx
|
3332
|
-
import
|
3264
|
+
import React39, { useEffect as useEffect7, useRef as useRef6 } from "react";
|
3333
3265
|
import Draggable from "react-draggable";
|
3334
3266
|
import { useMedia as useMedia6 } from "react-use";
|
3335
|
-
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer as selectLocalPeer2, selectVideoTrackByID, useHMSStore as
|
3267
|
+
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer as selectLocalPeer2, selectVideoTrackByID, useHMSStore as useHMSStore18 } from "@100mslive/react-sdk";
|
3336
3268
|
import { ExpandIcon as ExpandIcon2 } from "@100mslive/react-icons";
|
3337
3269
|
|
3338
3270
|
// src/Prebuilt/components/hooks/useVideoTileLayout.ts
|
3339
|
-
import
|
3340
|
-
var VideoTileContext =
|
3271
|
+
import React38, { useContext } from "react";
|
3272
|
+
var VideoTileContext = React38.createContext({
|
3341
3273
|
enableSpotlightingPeer: true,
|
3342
3274
|
hideParticipantNameOnTile: false,
|
3343
3275
|
roundedVideoTile: true,
|
@@ -3353,14 +3285,14 @@ var useVideoTileContext = () => {
|
|
3353
3285
|
|
3354
3286
|
// src/Prebuilt/components/InsetTile.tsx
|
3355
3287
|
var MinimisedTile = ({ setMinimised }) => {
|
3356
|
-
return /* @__PURE__ */
|
3288
|
+
return /* @__PURE__ */ React39.createElement(Flex, { align: "center", css: { gap: "$6", r: "$1", bg: "$surface_default", p: "$4", color: "$on_surface_high" } }, /* @__PURE__ */ React39.createElement(AudioVideoToggle, { hideOptions: true }), /* @__PURE__ */ React39.createElement(Text, null, "You"), /* @__PURE__ */ React39.createElement(
|
3357
3289
|
IconButton_default,
|
3358
3290
|
{
|
3359
3291
|
className: "__cancel-drag-event",
|
3360
3292
|
onClick: () => setMinimised(false),
|
3361
3293
|
css: { bg: "transparent", border: "transparent" }
|
3362
3294
|
},
|
3363
|
-
/* @__PURE__ */
|
3295
|
+
/* @__PURE__ */ React39.createElement(ExpandIcon2, null)
|
3364
3296
|
));
|
3365
3297
|
};
|
3366
3298
|
var insetHeightPx = 180;
|
@@ -3370,10 +3302,10 @@ var desktopAspectRatio = 1 / defaultMobileAspectRatio;
|
|
3370
3302
|
var InsetTile = () => {
|
3371
3303
|
const isMobile = useMedia6(config.media.md);
|
3372
3304
|
const isLandscape = useMedia6(config.media.ls);
|
3373
|
-
const localPeer =
|
3305
|
+
const localPeer = useHMSStore18(selectLocalPeer2);
|
3374
3306
|
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
3375
|
-
const videoTrack =
|
3376
|
-
const isAllowedToPublish =
|
3307
|
+
const videoTrack = useHMSStore18(selectVideoTrackByID(localPeer == null ? void 0 : localPeer.videoTrack));
|
3308
|
+
const isAllowedToPublish = useHMSStore18(selectIsAllowedToPublish2);
|
3377
3309
|
const videoTileProps = useVideoTileContext();
|
3378
3310
|
let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;
|
3379
3311
|
if ((videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) && !isMobile) {
|
@@ -3407,7 +3339,7 @@ var InsetTile = () => {
|
|
3407
3339
|
if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {
|
3408
3340
|
return null;
|
3409
3341
|
}
|
3410
|
-
return /* @__PURE__ */
|
3342
|
+
return /* @__PURE__ */ React39.createElement(Draggable, { bounds: "parent", nodeRef, cancel: ".__cancel-drag-event" }, /* @__PURE__ */ React39.createElement(
|
3411
3343
|
Box,
|
3412
3344
|
{
|
3413
3345
|
ref: nodeRef,
|
@@ -3423,9 +3355,9 @@ var InsetTile = () => {
|
|
3423
3355
|
h: height
|
3424
3356
|
} : {})
|
3425
3357
|
},
|
3426
|
-
minimised ? /* @__PURE__ */
|
3358
|
+
minimised ? /* @__PURE__ */ React39.createElement(MinimisedTile, { setMinimised }) : /* @__PURE__ */ React39.createElement(
|
3427
3359
|
VideoTile_default,
|
3428
|
-
__spreadValues({
|
3360
|
+
__spreadProps(__spreadValues({
|
3429
3361
|
peerId: localPeer == null ? void 0 : localPeer.id,
|
3430
3362
|
trackid: localPeer == null ? void 0 : localPeer.videoTrack,
|
3431
3363
|
rootCSS: {
|
@@ -3437,13 +3369,15 @@ var InsetTile = () => {
|
|
3437
3369
|
containerCSS: { background: "$surface_default" },
|
3438
3370
|
canMinimise: true,
|
3439
3371
|
isDragabble: true
|
3440
|
-
}, videoTileProps)
|
3372
|
+
}, videoTileProps), {
|
3373
|
+
hideParticipantNameOnTile: true
|
3374
|
+
})
|
3441
3375
|
)
|
3442
3376
|
));
|
3443
3377
|
};
|
3444
3378
|
|
3445
3379
|
// src/Prebuilt/components/Pagination.tsx
|
3446
|
-
import
|
3380
|
+
import React40, { useEffect as useEffect8 } from "react";
|
3447
3381
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@100mslive/react-icons";
|
3448
3382
|
var Pagination = ({
|
3449
3383
|
page,
|
@@ -3468,7 +3402,7 @@ var Pagination = ({
|
|
3468
3402
|
if (numPages <= 1) {
|
3469
3403
|
return null;
|
3470
3404
|
}
|
3471
|
-
return /* @__PURE__ */
|
3405
|
+
return /* @__PURE__ */ React40.createElement(StyledPagination.Root, { css: { flexShrink: 0 } }, /* @__PURE__ */ React40.createElement(StyledPagination.Chevron, { disabled: disableLeft, onClick: prevPage }, /* @__PURE__ */ React40.createElement(ChevronLeftIcon2, { width: 16, height: 16, style: { cursor: disableLeft ? "not-allowed" : "pointer" } })), numPages <= 5 ? /* @__PURE__ */ React40.createElement(StyledPagination.Dots, null, [...Array(numPages)].map((_, i) => /* @__PURE__ */ React40.createElement(
|
3472
3406
|
StyledPagination.Dot,
|
3473
3407
|
{
|
3474
3408
|
key: i,
|
@@ -3478,15 +3412,15 @@ var Pagination = ({
|
|
3478
3412
|
onPageChange(i);
|
3479
3413
|
}
|
3480
3414
|
}
|
3481
|
-
))) : null, /* @__PURE__ */
|
3415
|
+
))) : null, /* @__PURE__ */ React40.createElement(StyledPagination.Chevron, { disabled: disableRight, onClick: nextPage }, /* @__PURE__ */ React40.createElement(ChevronRightIcon2, { width: 16, height: 16, style: { cursor: disableRight ? "not-allowed" : "pointer" } })));
|
3482
3416
|
};
|
3483
3417
|
|
3484
3418
|
// src/Prebuilt/components/VideoLayouts/Grid.tsx
|
3485
|
-
import
|
3486
|
-
var Grid =
|
3419
|
+
import React41 from "react";
|
3420
|
+
var Grid = React41.forwardRef(
|
3487
3421
|
({ tiles, edgeToEdge }, ref) => {
|
3488
3422
|
const videoTileProps = useVideoTileContext();
|
3489
|
-
return /* @__PURE__ */
|
3423
|
+
return /* @__PURE__ */ React41.createElement(
|
3490
3424
|
Box,
|
3491
3425
|
{
|
3492
3426
|
ref,
|
@@ -3504,7 +3438,7 @@ var Grid = React42.forwardRef(
|
|
3504
3438
|
},
|
3505
3439
|
tiles == null ? void 0 : tiles.map((tile) => {
|
3506
3440
|
var _a, _b, _c, _d;
|
3507
|
-
return /* @__PURE__ */
|
3441
|
+
return /* @__PURE__ */ React41.createElement(
|
3508
3442
|
VideoTile_default,
|
3509
3443
|
__spreadValues({
|
3510
3444
|
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
@@ -3522,7 +3456,7 @@ var Grid = React42.forwardRef(
|
|
3522
3456
|
);
|
3523
3457
|
|
3524
3458
|
// src/Prebuilt/components/hooks/useTileLayout.tsx
|
3525
|
-
import { useEffect as useEffect9, useMemo as useMemo2, useState as
|
3459
|
+
import { useEffect as useEffect9, useMemo as useMemo2, useState as useState20 } from "react";
|
3526
3460
|
import { useMeasure as useMeasure2, useMedia as useMedia7 } from "react-use";
|
3527
3461
|
import {
|
3528
3462
|
getPeersWithTiles,
|
@@ -3560,7 +3494,7 @@ var useTileLayout = ({
|
|
3560
3494
|
const vanillaStore = useHMSVanillaStore3();
|
3561
3495
|
const [ref, { width, height }] = useMeasure2();
|
3562
3496
|
const isMobile = useMedia7(config.media.lg);
|
3563
|
-
const [pagesWithTiles, setPagesWithTiles] =
|
3497
|
+
const [pagesWithTiles, setPagesWithTiles] = useState20([]);
|
3564
3498
|
useEffect9(() => {
|
3565
3499
|
if (width === 0 || height === 0) {
|
3566
3500
|
return;
|
@@ -3628,7 +3562,7 @@ var useTileLayout = ({
|
|
3628
3562
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3629
3563
|
function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize, edgeToEdge }) {
|
3630
3564
|
var _a;
|
3631
|
-
const localPeer =
|
3565
|
+
const localPeer = useHMSStore19(selectLocalPeer3);
|
3632
3566
|
const isMobile = useMedia8(config.media.md);
|
3633
3567
|
let maxTileCount = useUISettings(UI_SETTINGS.maxTileCount);
|
3634
3568
|
maxTileCount = isMobile ? Math.min(maxTileCount, 6) : maxTileCount;
|
@@ -3649,14 +3583,14 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3649
3583
|
maxTileCount,
|
3650
3584
|
edgeToEdge
|
3651
3585
|
});
|
3652
|
-
const [page, setPage] =
|
3586
|
+
const [page, setPage] = useState21(0);
|
3653
3587
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3654
3588
|
useEffect10(() => {
|
3655
3589
|
if (pageSize > 0) {
|
3656
3590
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3657
3591
|
}
|
3658
3592
|
}, [pageSize, onPageSize]);
|
3659
|
-
return /* @__PURE__ */
|
3593
|
+
return /* @__PURE__ */ React42.createElement(Flex, { direction: "column", css: { flex: "1 1 0", h: "100%", position: "relative", minWidth: 0 } }, /* @__PURE__ */ React42.createElement(Grid, { tiles: pagesWithTiles[page], ref, edgeToEdge }), !edgeToEdge && /* @__PURE__ */ React42.createElement(
|
3660
3594
|
Pagination,
|
3661
3595
|
{
|
3662
3596
|
page,
|
@@ -3666,20 +3600,20 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3666
3600
|
},
|
3667
3601
|
numPages: pagesWithTiles.length
|
3668
3602
|
}
|
3669
|
-
), isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== (localPeer == null ? void 0 : localPeer.id) && /* @__PURE__ */
|
3603
|
+
), isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== (localPeer == null ? void 0 : localPeer.id) && /* @__PURE__ */ React42.createElement(InsetTile, null));
|
3670
3604
|
}
|
3671
3605
|
|
3672
3606
|
// src/Prebuilt/components/VideoLayouts/RoleProminence.tsx
|
3673
|
-
import
|
3674
|
-
import { selectLocalPeer as selectLocalPeer4, useHMSStore as
|
3607
|
+
import React45, { useEffect as useEffect12, useState as useState23 } from "react";
|
3608
|
+
import { selectLocalPeer as selectLocalPeer4, useHMSStore as useHMSStore20 } from "@100mslive/react-sdk";
|
3675
3609
|
|
3676
3610
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3677
|
-
import
|
3611
|
+
import React44, { useEffect as useEffect11, useState as useState22 } from "react";
|
3678
3612
|
import { useMedia as useMedia9 } from "react-use";
|
3679
3613
|
|
3680
3614
|
// src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx
|
3681
|
-
import
|
3682
|
-
var Root = ({ children, edgeToEdge }) => /* @__PURE__ */
|
3615
|
+
import React43 from "react";
|
3616
|
+
var Root = ({ children, edgeToEdge }) => /* @__PURE__ */ React43.createElement(
|
3683
3617
|
Flex,
|
3684
3618
|
{
|
3685
3619
|
direction: "column",
|
@@ -3688,7 +3622,7 @@ var Root = ({ children, edgeToEdge }) => /* @__PURE__ */ React44.createElement(
|
|
3688
3622
|
children
|
3689
3623
|
);
|
3690
3624
|
var ProminentSection = ({ children, css = {} }) => {
|
3691
|
-
return /* @__PURE__ */
|
3625
|
+
return /* @__PURE__ */ React43.createElement(Flex, { direction: "column", css: __spreadValues({ flex: "1 1 0", gap: "$2", minHeight: 0 }, css) }, children);
|
3692
3626
|
};
|
3693
3627
|
var SecondarySection = ({
|
3694
3628
|
tiles,
|
@@ -3699,12 +3633,12 @@ var SecondarySection = ({
|
|
3699
3633
|
if (!(tiles == null ? void 0 : tiles.length)) {
|
3700
3634
|
return null;
|
3701
3635
|
}
|
3702
|
-
return /* @__PURE__ */
|
3636
|
+
return /* @__PURE__ */ React43.createElement(
|
3703
3637
|
Box,
|
3704
3638
|
{
|
3705
3639
|
css: {
|
3706
3640
|
display: "grid",
|
3707
|
-
gridTemplateRows:
|
3641
|
+
gridTemplateRows: React43.Children.count(children) > 0 ? "136px auto" : "154px",
|
3708
3642
|
gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))`,
|
3709
3643
|
margin: "0 auto",
|
3710
3644
|
gap: "$2 $4",
|
@@ -3714,7 +3648,7 @@ var SecondarySection = ({
|
|
3714
3648
|
},
|
3715
3649
|
tiles.map((tile) => {
|
3716
3650
|
var _a, _b, _c, _d;
|
3717
|
-
return /* @__PURE__ */
|
3651
|
+
return /* @__PURE__ */ React43.createElement(
|
3718
3652
|
VideoTile_default,
|
3719
3653
|
__spreadValues({
|
3720
3654
|
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
@@ -3731,7 +3665,7 @@ var SecondarySection = ({
|
|
3731
3665
|
}, tileLayoutProps)
|
3732
3666
|
);
|
3733
3667
|
}),
|
3734
|
-
/* @__PURE__ */
|
3668
|
+
/* @__PURE__ */ React43.createElement(Box, { css: { gridColumn: `1/span ${tiles.length}` } }, children)
|
3735
3669
|
);
|
3736
3670
|
};
|
3737
3671
|
var ProminenceLayout = {
|
@@ -3746,14 +3680,14 @@ var SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
|
3746
3680
|
const isMobile = useMedia9(config.media.md);
|
3747
3681
|
const maxTileCount = isMobile ? 2 : 4;
|
3748
3682
|
const pagesWithTiles = usePagesWithTiles({ peers, maxTileCount });
|
3749
|
-
const [page, setPage] =
|
3683
|
+
const [page, setPage] = useState22(0);
|
3750
3684
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3751
3685
|
useEffect11(() => {
|
3752
3686
|
if (pageSize > 0) {
|
3753
3687
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3754
3688
|
}
|
3755
3689
|
}, [pageSize, onPageSize]);
|
3756
|
-
return /* @__PURE__ */
|
3690
|
+
return /* @__PURE__ */ React44.createElement(ProminenceLayout.SecondarySection, { tiles: pagesWithTiles[page], edgeToEdge }, !edgeToEdge && /* @__PURE__ */ React44.createElement(
|
3757
3691
|
Pagination,
|
3758
3692
|
{
|
3759
3693
|
page,
|
@@ -3811,7 +3745,7 @@ function RoleProminence({
|
|
3811
3745
|
}) {
|
3812
3746
|
var _a;
|
3813
3747
|
const { prominentPeers, secondaryPeers } = useRoleProminencePeers(prominentRoles, peers, isInsetEnabled);
|
3814
|
-
const localPeer =
|
3748
|
+
const localPeer = useHMSStore20(selectLocalPeer4);
|
3815
3749
|
const maxTileCount = 4;
|
3816
3750
|
const pageList = usePagesWithTiles({
|
3817
3751
|
peers: prominentPeers,
|
@@ -3821,14 +3755,14 @@ function RoleProminence({
|
|
3821
3755
|
pageList,
|
3822
3756
|
maxTileCount
|
3823
3757
|
});
|
3824
|
-
const [page, setPage] =
|
3758
|
+
const [page, setPage] = useState23(0);
|
3825
3759
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3826
3760
|
useEffect12(() => {
|
3827
3761
|
if (pageSize > 0) {
|
3828
3762
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3829
3763
|
}
|
3830
3764
|
}, [pageSize, onPageSize]);
|
3831
|
-
return /* @__PURE__ */
|
3765
|
+
return /* @__PURE__ */ React45.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React45.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React45.createElement(Grid, { ref, tiles: pagesWithTiles[page] })), !edgeToEdge && /* @__PURE__ */ React45.createElement(
|
3832
3766
|
Pagination,
|
3833
3767
|
{
|
3834
3768
|
page,
|
@@ -3838,16 +3772,16 @@ function RoleProminence({
|
|
3838
3772
|
},
|
3839
3773
|
numPages: pagesWithTiles.length
|
3840
3774
|
}
|
3841
|
-
), /* @__PURE__ */
|
3775
|
+
), /* @__PURE__ */ React45.createElement(SecondaryTiles, { peers: secondaryPeers, isInsetEnabled, edgeToEdge }), isInsetEnabled && localPeer && !prominentPeers.includes(localPeer) && /* @__PURE__ */ React45.createElement(InsetTile, null));
|
3842
3776
|
}
|
3843
3777
|
|
3844
3778
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
3845
|
-
import
|
3779
|
+
import React48, { useEffect as useEffect13, useMemo as useMemo5, useState as useState25 } from "react";
|
3846
3780
|
import { useMedia as useMedia10 } from "react-use";
|
3847
|
-
import { selectPeersScreenSharing, useHMSStore as
|
3781
|
+
import { selectPeersScreenSharing, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
3848
3782
|
|
3849
3783
|
// src/Prebuilt/components/ScreenshareTile.jsx
|
3850
|
-
import
|
3784
|
+
import React47, { useRef as useRef7, useState as useState24 } from "react";
|
3851
3785
|
import { useFullscreen as useFullscreen2 } from "react-use";
|
3852
3786
|
import screenfull2 from "screenfull";
|
3853
3787
|
import {
|
@@ -3855,17 +3789,17 @@ import {
|
|
3855
3789
|
selectPeerByID as selectPeerByID2,
|
3856
3790
|
selectScreenShareAudioByPeerID,
|
3857
3791
|
selectScreenShareByPeerID,
|
3858
|
-
useHMSStore as
|
3792
|
+
useHMSStore as useHMSStore21
|
3859
3793
|
} from "@100mslive/react-sdk";
|
3860
3794
|
import { ExpandIcon as ExpandIcon3, ShrinkIcon } from "@100mslive/react-icons";
|
3861
3795
|
|
3862
3796
|
// src/Prebuilt/components/ScreenshareDisplay.jsx
|
3863
|
-
import
|
3797
|
+
import React46 from "react";
|
3864
3798
|
import { useHMSActions as useHMSActions13 } from "@100mslive/react-sdk";
|
3865
|
-
import { CrossIcon as
|
3799
|
+
import { CrossIcon as CrossIcon5, ShareScreenIcon as ShareScreenIcon2 } from "@100mslive/react-icons";
|
3866
3800
|
var ScreenshareDisplay = () => {
|
3867
3801
|
const hmsActions = useHMSActions13();
|
3868
|
-
return /* @__PURE__ */
|
3802
|
+
return /* @__PURE__ */ React46.createElement(
|
3869
3803
|
Flex,
|
3870
3804
|
{
|
3871
3805
|
direction: "column",
|
@@ -3877,9 +3811,9 @@ var ScreenshareDisplay = () => {
|
|
3877
3811
|
color: "$on_surface_high"
|
3878
3812
|
}
|
3879
3813
|
},
|
3880
|
-
/* @__PURE__ */
|
3881
|
-
/* @__PURE__ */
|
3882
|
-
/* @__PURE__ */
|
3814
|
+
/* @__PURE__ */ React46.createElement(ShareScreenIcon2, { width: 48, height: 48 }),
|
3815
|
+
/* @__PURE__ */ React46.createElement(Text, { variant: "h5", css: { m: "$8 0" } }, "You are sharing your screen"),
|
3816
|
+
/* @__PURE__ */ React46.createElement(
|
3883
3817
|
Button,
|
3884
3818
|
{
|
3885
3819
|
variant: "danger",
|
@@ -3889,7 +3823,7 @@ var ScreenshareDisplay = () => {
|
|
3889
3823
|
}),
|
3890
3824
|
"data-testid": "stop_screen_share_btn"
|
3891
3825
|
},
|
3892
|
-
/* @__PURE__ */
|
3826
|
+
/* @__PURE__ */ React46.createElement(CrossIcon5, { width: 18, height: 18 }),
|
3893
3827
|
"\xA0 Stop screen share"
|
3894
3828
|
)
|
3895
3829
|
);
|
@@ -3905,31 +3839,31 @@ var labelStyles = {
|
|
3905
3839
|
flexShrink: 0
|
3906
3840
|
};
|
3907
3841
|
var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
3908
|
-
const isLocal =
|
3909
|
-
const track =
|
3910
|
-
const peer =
|
3842
|
+
const isLocal = useHMSStore21(selectLocalPeerID5) === peerId;
|
3843
|
+
const track = useHMSStore21(selectScreenShareByPeerID(peerId));
|
3844
|
+
const peer = useHMSStore21(selectPeerByID2(peerId));
|
3911
3845
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
3912
|
-
const [isMouseHovered, setIsMouseHovered] =
|
3846
|
+
const [isMouseHovered, setIsMouseHovered] = useState24(false);
|
3913
3847
|
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
3914
|
-
const label = getVideoTileLabel({
|
3915
|
-
peerName: peer.name,
|
3916
|
-
isLocal: false,
|
3917
|
-
track
|
3918
|
-
});
|
3919
3848
|
const fullscreenRef = useRef7(null);
|
3920
|
-
const [fullscreen, setFullscreen] =
|
3849
|
+
const [fullscreen, setFullscreen] = useState24(false);
|
3921
3850
|
const isFullscreen = useFullscreen2(fullscreenRef, fullscreen, {
|
3922
3851
|
onClose: () => setFullscreen(false)
|
3923
3852
|
});
|
3924
3853
|
const isFullScreenSupported = screenfull2.isEnabled;
|
3925
|
-
const audioTrack =
|
3854
|
+
const audioTrack = useHMSStore21(selectScreenShareAudioByPeerID(peer == null ? void 0 : peer.id));
|
3926
3855
|
if (isLocal && !["browser", "window", "application"].includes(track == null ? void 0 : track.displaySurface)) {
|
3927
|
-
return /* @__PURE__ */
|
3856
|
+
return /* @__PURE__ */ React47.createElement(ScreenshareDisplay, null);
|
3928
3857
|
}
|
3929
3858
|
if (!peer) {
|
3930
3859
|
return null;
|
3931
3860
|
}
|
3932
|
-
|
3861
|
+
const label = getVideoTileLabel({
|
3862
|
+
peerName: peer == null ? void 0 : peer.name,
|
3863
|
+
isLocal: false,
|
3864
|
+
track
|
3865
|
+
});
|
3866
|
+
return /* @__PURE__ */ React47.createElement(StyledVideoTile.Root, { css: { width, height, p: 0, minHeight: 0 }, "data-testid": "screenshare_tile" }, /* @__PURE__ */ React47.createElement(
|
3933
3867
|
StyledVideoTile.Container,
|
3934
3868
|
{
|
3935
3869
|
transparentBg: true,
|
@@ -3940,9 +3874,9 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3940
3874
|
setIsMouseHovered(false);
|
3941
3875
|
}
|
3942
3876
|
},
|
3943
|
-
showStatsOnTiles ? /* @__PURE__ */
|
3944
|
-
isFullScreenSupported && isMouseHovered ? /* @__PURE__ */
|
3945
|
-
track ? /* @__PURE__ */
|
3877
|
+
showStatsOnTiles ? /* @__PURE__ */ React47.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
3878
|
+
isFullScreenSupported && isMouseHovered ? /* @__PURE__ */ React47.createElement(StyledVideoTile.FullScreenButton, { onClick: () => setFullscreen(!fullscreen) }, isFullscreen ? /* @__PURE__ */ React47.createElement(ShrinkIcon, null) : /* @__PURE__ */ React47.createElement(ExpandIcon3, null)) : null,
|
3879
|
+
track ? /* @__PURE__ */ React47.createElement(
|
3946
3880
|
Video,
|
3947
3881
|
{
|
3948
3882
|
screenShare: true,
|
@@ -3952,19 +3886,28 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3952
3886
|
css: { minHeight: 0 }
|
3953
3887
|
}
|
3954
3888
|
) : null,
|
3955
|
-
/* @__PURE__ */
|
3956
|
-
isMouseHovered && !
|
3889
|
+
/* @__PURE__ */ React47.createElement(StyledVideoTile.Info, { css: labelStyles }, label),
|
3890
|
+
isMouseHovered && !peer.isLocal ? /* @__PURE__ */ React47.createElement(
|
3891
|
+
TileMenu_default,
|
3892
|
+
{
|
3893
|
+
isScreenshare: true,
|
3894
|
+
peerID: peer.id,
|
3895
|
+
audioTrackID: audioTrack == null ? void 0 : audioTrack.id,
|
3896
|
+
videoTrackID: track == null ? void 0 : track.id,
|
3897
|
+
enableSpotlightingPeer: false
|
3898
|
+
}
|
3899
|
+
) : null
|
3957
3900
|
));
|
3958
3901
|
};
|
3959
|
-
var ScreenshareTile =
|
3902
|
+
var ScreenshareTile = React47.memo(Tile);
|
3960
3903
|
var ScreenshareTile_default = ScreenshareTile;
|
3961
3904
|
|
3962
3905
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
3963
3906
|
var ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
3964
3907
|
var _a;
|
3965
|
-
const peersSharing =
|
3908
|
+
const peersSharing = useHMSStore22(selectPeersScreenSharing);
|
3966
3909
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
3967
|
-
const [page, setPage] =
|
3910
|
+
const [page, setPage] = useState25(0);
|
3968
3911
|
const activeSharePeer = peersSharing[page];
|
3969
3912
|
const isMobile = useMedia10(config.media.md);
|
3970
3913
|
const secondaryPeers = useMemo5(
|
@@ -3977,7 +3920,7 @@ var ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
|
3977
3920
|
setActiveScreenSharePeer("");
|
3978
3921
|
};
|
3979
3922
|
}, [activeSharePeer == null ? void 0 : activeSharePeer.id, isMobile, setActiveScreenSharePeer]);
|
3980
|
-
return /* @__PURE__ */
|
3923
|
+
return /* @__PURE__ */ React48.createElement(ProminenceLayout.Root, { edgeToEdge }, /* @__PURE__ */ React48.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React48.createElement(ScreenshareTile_default, { peerId: (_a = peersSharing[page]) == null ? void 0 : _a.id }), !edgeToEdge && /* @__PURE__ */ React48.createElement(Pagination, { page, onPageChange: setPage, numPages: peersSharing.length })), /* @__PURE__ */ React48.createElement(
|
3981
3924
|
SecondaryTiles,
|
3982
3925
|
{
|
3983
3926
|
peers: secondaryPeers,
|
@@ -4082,9 +4025,9 @@ var GridLayout = ({
|
|
4082
4025
|
edge_to_edge = false,
|
4083
4026
|
hide_metadata_on_tile = false
|
4084
4027
|
}) => {
|
4085
|
-
const peerSharing =
|
4028
|
+
const peerSharing = useHMSStore23(selectPeerScreenSharing);
|
4086
4029
|
const pinnedTrack = usePinnedTrack();
|
4087
|
-
const peers =
|
4030
|
+
const peers = useHMSStore23(selectPeers2);
|
4088
4031
|
const isRoleProminence = prominentRoles.length && peers.some(
|
4089
4032
|
(peer) => peer.roleName && prominentRoles.includes(peer.roleName) && (peer.videoTrack || peer.audioTrack)
|
4090
4033
|
) || pinnedTrack;
|
@@ -4095,10 +4038,10 @@ var GridLayout = ({
|
|
4095
4038
|
return peers;
|
4096
4039
|
}, [isInsetEnabled, isRoleProminence, peerSharing, peers]);
|
4097
4040
|
const vanillaStore = useHMSVanillaStore4();
|
4098
|
-
const [sortedPeers, setSortedPeers] =
|
4041
|
+
const [sortedPeers, setSortedPeers] = useState26(updatedPeers);
|
4099
4042
|
const peersSorter = useMemo6(() => new PeersSorter_default(vanillaStore), [vanillaStore]);
|
4100
|
-
const [pageSize, setPageSize] =
|
4101
|
-
const [mainPage, setMainPage] =
|
4043
|
+
const [pageSize, setPageSize] = useState26(0);
|
4044
|
+
const [mainPage, setMainPage] = useState26(0);
|
4102
4045
|
const tileLayout = {
|
4103
4046
|
enableSpotlightingPeer: enable_spotlighting_peer,
|
4104
4047
|
hideParticipantNameOnTile: hide_participant_name_on_tile,
|
@@ -4118,7 +4061,7 @@ var GridLayout = ({
|
|
4118
4061
|
peersSorter.onUpdate(setSortedPeers);
|
4119
4062
|
}, [mainPage, peersSorter, updatedPeers, pageSize]);
|
4120
4063
|
if (peerSharing) {
|
4121
|
-
return /* @__PURE__ */
|
4064
|
+
return /* @__PURE__ */ React49.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React49.createElement(
|
4122
4065
|
ScreenshareLayout,
|
4123
4066
|
{
|
4124
4067
|
peers: sortedPeers,
|
@@ -4128,7 +4071,7 @@ var GridLayout = ({
|
|
4128
4071
|
}
|
4129
4072
|
));
|
4130
4073
|
} else if (isRoleProminence) {
|
4131
|
-
return /* @__PURE__ */
|
4074
|
+
return /* @__PURE__ */ React49.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React49.createElement(
|
4132
4075
|
RoleProminence,
|
4133
4076
|
{
|
4134
4077
|
peers: sortedPeers,
|
@@ -4140,7 +4083,7 @@ var GridLayout = ({
|
|
4140
4083
|
}
|
4141
4084
|
));
|
4142
4085
|
}
|
4143
|
-
return /* @__PURE__ */
|
4086
|
+
return /* @__PURE__ */ React49.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React49.createElement(
|
4144
4087
|
EqualProminence,
|
4145
4088
|
{
|
4146
4089
|
peers: sortedPeers,
|
@@ -4153,20 +4096,20 @@ var GridLayout = ({
|
|
4153
4096
|
};
|
4154
4097
|
|
4155
4098
|
// src/Prebuilt/layouts/EmbedView.jsx
|
4156
|
-
import
|
4099
|
+
import React50, { useCallback as useCallback8, useEffect as useEffect15, useMemo as useMemo7, useRef as useRef8, useState as useState27 } from "react";
|
4157
4100
|
import {
|
4158
4101
|
selectPeers as selectPeers3,
|
4159
4102
|
selectPeerScreenSharing as selectPeerScreenSharing2,
|
4160
4103
|
throwErrorHandler,
|
4161
|
-
useHMSStore as
|
4104
|
+
useHMSStore as useHMSStore24,
|
4162
4105
|
useScreenShare as useScreenShare3
|
4163
4106
|
} from "@100mslive/react-sdk";
|
4164
4107
|
var EmbedView = () => {
|
4165
|
-
return /* @__PURE__ */
|
4108
|
+
return /* @__PURE__ */ React50.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React50.createElement(EmbedComponent, null));
|
4166
4109
|
};
|
4167
4110
|
var EmbebScreenShareView = ({ children }) => {
|
4168
|
-
const peers =
|
4169
|
-
const peerPresenting =
|
4111
|
+
const peers = useHMSStore24(selectPeers3);
|
4112
|
+
const peerPresenting = useHMSStore24(selectPeerScreenSharing2);
|
4170
4113
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
4171
4114
|
const smallTilePeers = useMemo7(() => {
|
4172
4115
|
const smallTilePeers2 = peers.filter((peer) => peer.id !== (peerPresenting == null ? void 0 : peerPresenting.id));
|
@@ -4178,12 +4121,12 @@ var EmbebScreenShareView = ({ children }) => {
|
|
4178
4121
|
setActiveScreenSharePeer("");
|
4179
4122
|
};
|
4180
4123
|
}, [peerPresenting == null ? void 0 : peerPresenting.id, setActiveScreenSharePeer]);
|
4181
|
-
return /* @__PURE__ */
|
4124
|
+
return /* @__PURE__ */ React50.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React50.createElement(ProminenceLayout.ProminentSection, null, children), /* @__PURE__ */ React50.createElement(SecondaryTiles, { peers: smallTilePeers }));
|
4182
4125
|
};
|
4183
4126
|
var EmbedComponent = () => {
|
4184
4127
|
const { amIScreenSharing, toggleScreenShare } = useScreenShare3(throwErrorHandler);
|
4185
4128
|
const [embedConfig, setEmbedConfig] = useSetAppDataByKey(APP_DATA.embedConfig);
|
4186
|
-
const [wasScreenShared, setWasScreenShared] =
|
4129
|
+
const [wasScreenShared, setWasScreenShared] = useState27(false);
|
4187
4130
|
const screenShareAttemptInProgress = useRef8(false);
|
4188
4131
|
const src = embedConfig.url;
|
4189
4132
|
const iframeRef = useRef8();
|
@@ -4216,7 +4159,7 @@ var EmbedComponent = () => {
|
|
4216
4159
|
}
|
4217
4160
|
};
|
4218
4161
|
}, [wasScreenShared, amIScreenSharing, resetEmbedConfig, toggleScreenShare]);
|
4219
|
-
return /* @__PURE__ */
|
4162
|
+
return /* @__PURE__ */ React50.createElement(Box, { ref: iframeRef, css: { size: "100%" } }, /* @__PURE__ */ React50.createElement(
|
4220
4163
|
"iframe",
|
4221
4164
|
{
|
4222
4165
|
src,
|
@@ -4229,22 +4172,22 @@ var EmbedComponent = () => {
|
|
4229
4172
|
};
|
4230
4173
|
|
4231
4174
|
// src/Prebuilt/layouts/PDFView.jsx
|
4232
|
-
import
|
4175
|
+
import React51, { useCallback as useCallback9, useEffect as useEffect16, useRef as useRef9, useState as useState28 } from "react";
|
4233
4176
|
import { throwErrorHandler as throwErrorHandler2, useScreenShare as useScreenShare4 } from "@100mslive/react-sdk";
|
4234
4177
|
var PDFView = () => {
|
4235
|
-
return /* @__PURE__ */
|
4178
|
+
return /* @__PURE__ */ React51.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React51.createElement(PDFEmbedComponent, null));
|
4236
4179
|
};
|
4237
4180
|
var PDFEmbedComponent = () => {
|
4238
4181
|
const ref = useRef9();
|
4239
4182
|
const themeType = useTheme().themeType;
|
4240
|
-
const [isPDFLoaded, setIsPDFLoaded] =
|
4183
|
+
const [isPDFLoaded, setIsPDFLoaded] = useState28(false);
|
4241
4184
|
let pdfJSURL = define_process_env_default.REACT_APP_PDFJS_IFRAME_URL;
|
4242
4185
|
const { amIScreenSharing, toggleScreenShare } = useScreenShare4(throwErrorHandler2);
|
4243
4186
|
const [pdfConfig, setPDFConfig] = useSetAppDataByKey(APP_DATA.pdfConfig);
|
4244
4187
|
if (pdfConfig.url && !pdfConfig.file) {
|
4245
4188
|
pdfJSURL = pdfJSURL + "?file=" + encodeURIComponent(pdfConfig.url);
|
4246
4189
|
}
|
4247
|
-
const [wasScreenShared, setWasScreenShared] =
|
4190
|
+
const [wasScreenShared, setWasScreenShared] = useState28(false);
|
4248
4191
|
const screenShareAttemptInProgress = useRef9(false);
|
4249
4192
|
const iframeRef = useRef9();
|
4250
4193
|
const resetEmbedConfig = useCallback9(() => {
|
@@ -4285,7 +4228,7 @@ var PDFEmbedComponent = () => {
|
|
4285
4228
|
}
|
4286
4229
|
};
|
4287
4230
|
}, [wasScreenShared, amIScreenSharing, resetEmbedConfig, toggleScreenShare]);
|
4288
|
-
return /* @__PURE__ */
|
4231
|
+
return /* @__PURE__ */ React51.createElement(Box, { ref: iframeRef, css: { size: "100%" } }, /* @__PURE__ */ React51.createElement(
|
4289
4232
|
"iframe",
|
4290
4233
|
{
|
4291
4234
|
src: pdfJSURL,
|
@@ -4319,11 +4262,17 @@ var PDFEmbedComponent = () => {
|
|
4319
4262
|
|
4320
4263
|
// src/Prebuilt/layouts/SidePane.tsx
|
4321
4264
|
import React58 from "react";
|
4265
|
+
import { useMedia as useMedia15 } from "react-use";
|
4266
|
+
import { selectAppData as selectAppData3, selectVideoTrackByPeerID, useHMSStore as useHMSStore33 } from "@100mslive/react-sdk";
|
4267
|
+
|
4268
|
+
// src/Prebuilt/components/SidePaneTabs.tsx
|
4269
|
+
import React55, { useEffect as useEffect21, useState as useState32 } from "react";
|
4322
4270
|
import { useMedia as useMedia14 } from "react-use";
|
4323
|
-
import {
|
4271
|
+
import { selectPeerCount as selectPeerCount3, useHMSStore as useHMSStore30 } from "@100mslive/react-sdk";
|
4272
|
+
import { CrossIcon as CrossIcon7 } from "@100mslive/react-icons";
|
4324
4273
|
|
4325
4274
|
// src/Prebuilt/components/Chat/Chat.jsx
|
4326
|
-
import
|
4275
|
+
import React54, { useCallback as useCallback14, useEffect as useEffect20, useRef as useRef13, useState as useState31 } from "react";
|
4327
4276
|
import { useMedia as useMedia13 } from "react-use";
|
4328
4277
|
import {
|
4329
4278
|
HMSNotificationTypes,
|
@@ -4333,12 +4282,12 @@ import {
|
|
4333
4282
|
selectSessionStore,
|
4334
4283
|
useHMSActions as useHMSActions18,
|
4335
4284
|
useHMSNotifications,
|
4336
|
-
useHMSStore as
|
4285
|
+
useHMSStore as useHMSStore29
|
4337
4286
|
} from "@100mslive/react-sdk";
|
4338
|
-
import { ChevronDownIcon as ChevronDownIcon2, CrossIcon as
|
4287
|
+
import { ChevronDownIcon as ChevronDownIcon2, CrossIcon as CrossIcon6, PinIcon as PinIcon2 } from "@100mslive/react-icons";
|
4339
4288
|
|
4340
4289
|
// src/Prebuilt/components/Chat/ChatBody.jsx
|
4341
|
-
import
|
4290
|
+
import React52, { Fragment as Fragment8, useCallback as useCallback11, useEffect as useEffect17, useLayoutEffect, useMemo as useMemo8, useRef as useRef10, useState as useState29 } from "react";
|
4342
4291
|
import { useInView } from "react-intersection-observer";
|
4343
4292
|
import { useMedia as useMedia11 } from "react-use";
|
4344
4293
|
import AutoSizer from "react-virtualized-auto-sizer";
|
@@ -4352,7 +4301,7 @@ import {
|
|
4352
4301
|
selectPeerNameByID as selectPeerNameByID2,
|
4353
4302
|
selectPermissions as selectPermissions9,
|
4354
4303
|
useHMSActions as useHMSActions15,
|
4355
|
-
useHMSStore as
|
4304
|
+
useHMSStore as useHMSStore26
|
4356
4305
|
} from "@100mslive/react-sdk";
|
4357
4306
|
import { PinIcon, VerticalMenuIcon as VerticalMenuIcon5 } from "@100mslive/react-icons";
|
4358
4307
|
|
@@ -4365,13 +4314,13 @@ import {
|
|
4365
4314
|
selectPeerNameByID,
|
4366
4315
|
selectSessionMetadata,
|
4367
4316
|
useHMSActions as useHMSActions14,
|
4368
|
-
useHMSStore as
|
4317
|
+
useHMSStore as useHMSStore25,
|
4369
4318
|
useHMSVanillaStore as useHMSVanillaStore5
|
4370
4319
|
} from "@100mslive/react-sdk";
|
4371
4320
|
var useSetPinnedMessage = () => {
|
4372
4321
|
const hmsActions = useHMSActions14();
|
4373
4322
|
const vanillaStore = useHMSVanillaStore5();
|
4374
|
-
const pinnedMessage =
|
4323
|
+
const pinnedMessage = useHMSStore25(selectSessionMetadata);
|
4375
4324
|
const setPinnedMessage = useCallback10(
|
4376
4325
|
/**
|
4377
4326
|
* @param {import("@100mslive/react-sdk").HMSMessage | undefined} message
|
@@ -4405,7 +4354,7 @@ var formatTime = (date) => {
|
|
4405
4354
|
return `${hours}:${mins} ${suffix}`;
|
4406
4355
|
};
|
4407
4356
|
var MessageTypeContainer = ({ left, right }) => {
|
4408
|
-
return /* @__PURE__ */
|
4357
|
+
return /* @__PURE__ */ React52.createElement(
|
4409
4358
|
Flex,
|
4410
4359
|
{
|
4411
4360
|
align: "center",
|
@@ -4417,16 +4366,16 @@ var MessageTypeContainer = ({ left, right }) => {
|
|
4417
4366
|
r: "$0"
|
4418
4367
|
}
|
4419
4368
|
},
|
4420
|
-
left && /* @__PURE__ */
|
4421
|
-
left && right && /* @__PURE__ */
|
4422
|
-
right && /* @__PURE__ */
|
4369
|
+
left && /* @__PURE__ */ React52.createElement(SenderName, { variant: "tiny", as: "span", css: { color: "$on_surface_medium" } }, left),
|
4370
|
+
left && right && /* @__PURE__ */ React52.createElement(Box, { css: { borderLeft: "1px solid $border_bright", mx: "$4", h: "$8" } }),
|
4371
|
+
right && /* @__PURE__ */ React52.createElement(SenderName, { as: "span", variant: "tiny", css: { textTransform: "uppercase" } }, right)
|
4423
4372
|
);
|
4424
4373
|
};
|
4425
4374
|
var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
4426
|
-
const peerName =
|
4427
|
-
const localPeerRoleName =
|
4375
|
+
const peerName = useHMSStore26(selectPeerNameByID2(receiver));
|
4376
|
+
const localPeerRoleName = useHMSStore26(selectLocalPeerRoleName);
|
4428
4377
|
if (receiver) {
|
4429
|
-
return /* @__PURE__ */
|
4378
|
+
return /* @__PURE__ */ React52.createElement(
|
4430
4379
|
MessageTypeContainer,
|
4431
4380
|
{
|
4432
4381
|
left: hasCurrentUserSent ? `${peerName ? `TO ${peerName}` : ""}` : "TO YOU",
|
@@ -4435,7 +4384,7 @@ var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
|
4435
4384
|
);
|
4436
4385
|
}
|
4437
4386
|
if (roles && roles.length) {
|
4438
|
-
return /* @__PURE__ */
|
4387
|
+
return /* @__PURE__ */ React52.createElement(MessageTypeContainer, { left: "TO", right: hasCurrentUserSent ? roles.join(",") : localPeerRoleName });
|
4439
4388
|
}
|
4440
4389
|
return null;
|
4441
4390
|
};
|
@@ -4449,10 +4398,10 @@ var Link = styled("a", {
|
|
4449
4398
|
});
|
4450
4399
|
var AnnotisedMessage = ({ message }) => {
|
4451
4400
|
if (!message) {
|
4452
|
-
return /* @__PURE__ */
|
4401
|
+
return /* @__PURE__ */ React52.createElement(Fragment8, null);
|
4453
4402
|
}
|
4454
|
-
return /* @__PURE__ */
|
4455
|
-
(part) => URL_REGEX.test(part) ? /* @__PURE__ */
|
4403
|
+
return /* @__PURE__ */ React52.createElement(Fragment8, null, message.trim().split(/(\s)/).map(
|
4404
|
+
(part) => URL_REGEX.test(part) ? /* @__PURE__ */ React52.createElement(Link, { href: part, key: part, target: "_blank", rel: "noopener noreferrer" }, part) : part
|
4456
4405
|
));
|
4457
4406
|
};
|
4458
4407
|
var getMessageType = ({ roles, receiver }) => {
|
@@ -4462,18 +4411,18 @@ var getMessageType = ({ roles, receiver }) => {
|
|
4462
4411
|
return receiver ? "private" : "";
|
4463
4412
|
};
|
4464
4413
|
var ChatActions = ({ onPin, showPinAction }) => {
|
4465
|
-
const [open, setOpen] =
|
4414
|
+
const [open, setOpen] = useState29(false);
|
4466
4415
|
if (!showPinAction) {
|
4467
4416
|
return null;
|
4468
4417
|
}
|
4469
|
-
return /* @__PURE__ */
|
4418
|
+
return /* @__PURE__ */ React52.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React52.createElement(Dropdown.Trigger, { className: "chat_actions", css: { opacity: open ? 1 : 0, "@md": { opacity: 1 } }, asChild: true }, /* @__PURE__ */ React52.createElement(IconButton, null, /* @__PURE__ */ React52.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React52.createElement(VerticalMenuIcon5, null)))), /* @__PURE__ */ React52.createElement(Dropdown.Portal, null, /* @__PURE__ */ React52.createElement(
|
4470
4419
|
Dropdown.Content,
|
4471
4420
|
{
|
4472
4421
|
sideOffset: 5,
|
4473
4422
|
align: "end",
|
4474
4423
|
css: { width: "$48", backgroundColor: "$surface_bright", py: "$0", border: "1px solid $border_bright" }
|
4475
4424
|
},
|
4476
|
-
/* @__PURE__ */
|
4425
|
+
/* @__PURE__ */ React52.createElement(Dropdown.Item, { "data-testid": "pin_message_btn", onClick: onPin }, /* @__PURE__ */ React52.createElement(PinIcon, null), /* @__PURE__ */ React52.createElement(Text, { variant: "sm", css: { ml: "$4" } }, "Pin Message"))
|
4477
4426
|
)));
|
4478
4427
|
};
|
4479
4428
|
var SenderName = styled(Text, {
|
@@ -4485,7 +4434,7 @@ var SenderName = styled(Text, {
|
|
4485
4434
|
color: "$on_surface_high",
|
4486
4435
|
fontWeight: "$semiBold"
|
4487
4436
|
});
|
4488
|
-
var ChatMessage =
|
4437
|
+
var ChatMessage = React52.memo(({ index, style = {}, message, setRowHeight, onPin }) => {
|
4489
4438
|
var _a, _b;
|
4490
4439
|
const { ref, inView } = useInView({ threshold: 0.5, triggerOnce: true });
|
4491
4440
|
const rowRef = useRef10(null);
|
@@ -4498,8 +4447,8 @@ var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4498
4447
|
const { elements } = useRoomLayoutConferencingScreen();
|
4499
4448
|
const isOverlay = ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isMobile;
|
4500
4449
|
const hmsActions = useHMSActions15();
|
4501
|
-
const localPeerId =
|
4502
|
-
const permissions =
|
4450
|
+
const localPeerId = useHMSStore26(selectLocalPeerID6);
|
4451
|
+
const permissions = useHMSStore26(selectPermissions9);
|
4503
4452
|
const messageType = getMessageType({
|
4504
4453
|
roles: message.recipientRoles,
|
4505
4454
|
receiver: message.recipientPeer
|
@@ -4510,7 +4459,7 @@ var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4510
4459
|
hmsActions.setMessageRead(true, message.id);
|
4511
4460
|
}
|
4512
4461
|
}, [message.read, hmsActions, inView, message.id]);
|
4513
|
-
return /* @__PURE__ */
|
4462
|
+
return /* @__PURE__ */ React52.createElement(
|
4514
4463
|
Box,
|
4515
4464
|
{
|
4516
4465
|
ref,
|
@@ -4518,7 +4467,7 @@ var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4518
4467
|
css: { mb: "$10", pr: "$10", mt: "$8", "&:hover .chat_actions": { opacity: 1 } },
|
4519
4468
|
style
|
4520
4469
|
},
|
4521
|
-
/* @__PURE__ */
|
4470
|
+
/* @__PURE__ */ React52.createElement(
|
4522
4471
|
Flex,
|
4523
4472
|
{
|
4524
4473
|
ref: rowRef,
|
@@ -4535,7 +4484,7 @@ var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4535
4484
|
key: message.time,
|
4536
4485
|
"data-testid": "chat_msg"
|
4537
4486
|
},
|
4538
|
-
/* @__PURE__ */
|
4487
|
+
/* @__PURE__ */ React52.createElement(
|
4539
4488
|
Text,
|
4540
4489
|
{
|
4541
4490
|
css: {
|
@@ -4548,7 +4497,7 @@ var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4548
4497
|
},
|
4549
4498
|
as: "div"
|
4550
4499
|
},
|
4551
|
-
/* @__PURE__ */
|
4500
|
+
/* @__PURE__ */ React52.createElement(Flex, { align: "baseline" }, message.senderName === "You" || !message.senderName ? /* @__PURE__ */ React52.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName || "Anonymous") : /* @__PURE__ */ React52.createElement(Tooltip, { title: message.senderName, side: "top", align: "start" }, /* @__PURE__ */ React52.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName)), !isOverlay ? /* @__PURE__ */ React52.createElement(
|
4552
4501
|
Text,
|
4553
4502
|
{
|
4554
4503
|
as: "span",
|
@@ -4561,7 +4510,7 @@ var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4561
4510
|
},
|
4562
4511
|
formatTime(message.time)
|
4563
4512
|
) : null),
|
4564
|
-
/* @__PURE__ */
|
4513
|
+
/* @__PURE__ */ React52.createElement(
|
4565
4514
|
MessageType,
|
4566
4515
|
{
|
4567
4516
|
hasCurrentUserSent: message.sender === localPeerId,
|
@@ -4569,9 +4518,9 @@ var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4569
4518
|
roles: message.recipientRoles
|
4570
4519
|
}
|
4571
4520
|
),
|
4572
|
-
!isOverlay ? /* @__PURE__ */
|
4521
|
+
!isOverlay ? /* @__PURE__ */ React52.createElement(ChatActions, { onPin, showPinAction }) : null
|
4573
4522
|
),
|
4574
|
-
/* @__PURE__ */
|
4523
|
+
/* @__PURE__ */ React52.createElement(
|
4575
4524
|
Text,
|
4576
4525
|
{
|
4577
4526
|
variant: "sm",
|
@@ -4585,12 +4534,12 @@ var ChatMessage = React53.memo(({ index, style = {}, message, setRowHeight, onPi
|
|
4585
4534
|
},
|
4586
4535
|
onClick: (e) => e.stopPropagation()
|
4587
4536
|
},
|
4588
|
-
/* @__PURE__ */
|
4537
|
+
/* @__PURE__ */ React52.createElement(AnnotisedMessage, { message: message.message })
|
4589
4538
|
)
|
4590
4539
|
)
|
4591
4540
|
);
|
4592
4541
|
});
|
4593
|
-
var ChatList =
|
4542
|
+
var ChatList = React52.forwardRef(
|
4594
4543
|
({ width, height, setRowHeight, getRowHeight, messages, scrollToBottom }, listRef) => {
|
4595
4544
|
const { setPinnedMessage } = useSetPinnedMessage();
|
4596
4545
|
useLayoutEffect(() => {
|
@@ -4598,7 +4547,7 @@ var ChatList = React53.forwardRef(
|
|
4598
4547
|
scrollToBottom(1);
|
4599
4548
|
}
|
4600
4549
|
}, [listRef]);
|
4601
|
-
return /* @__PURE__ */
|
4550
|
+
return /* @__PURE__ */ React52.createElement(
|
4602
4551
|
VariableSizeList,
|
4603
4552
|
{
|
4604
4553
|
ref: listRef,
|
@@ -4610,7 +4559,7 @@ var ChatList = React53.forwardRef(
|
|
4610
4559
|
overflowX: "hidden"
|
4611
4560
|
}
|
4612
4561
|
},
|
4613
|
-
({ index, style }) => /* @__PURE__ */
|
4562
|
+
({ index, style }) => /* @__PURE__ */ React52.createElement(
|
4614
4563
|
ChatMessage,
|
4615
4564
|
{
|
4616
4565
|
style,
|
@@ -4624,7 +4573,7 @@ var ChatList = React53.forwardRef(
|
|
4624
4573
|
);
|
4625
4574
|
}
|
4626
4575
|
);
|
4627
|
-
var VirtualizedChatMessages =
|
4576
|
+
var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom }, listRef) => {
|
4628
4577
|
const rowHeights = useRef10({});
|
4629
4578
|
function getRowHeight(index) {
|
4630
4579
|
return rowHeights.current[index] + 16 || 72;
|
@@ -4636,7 +4585,7 @@ var VirtualizedChatMessages = React53.forwardRef(({ messages, scrollToBottom },
|
|
4636
4585
|
},
|
4637
4586
|
[listRef]
|
4638
4587
|
);
|
4639
|
-
return /* @__PURE__ */
|
4588
|
+
return /* @__PURE__ */ React52.createElement(
|
4640
4589
|
Box,
|
4641
4590
|
{
|
4642
4591
|
css: {
|
@@ -4645,14 +4594,14 @@ var VirtualizedChatMessages = React53.forwardRef(({ messages, scrollToBottom },
|
|
4645
4594
|
},
|
4646
4595
|
as: "div"
|
4647
4596
|
},
|
4648
|
-
/* @__PURE__ */
|
4597
|
+
/* @__PURE__ */ React52.createElement(
|
4649
4598
|
AutoSizer,
|
4650
4599
|
{
|
4651
4600
|
style: {
|
4652
4601
|
width: "90%"
|
4653
4602
|
}
|
4654
4603
|
},
|
4655
|
-
({ height, width }) => /* @__PURE__ */
|
4604
|
+
({ height, width }) => /* @__PURE__ */ React52.createElement(
|
4656
4605
|
ChatList,
|
4657
4606
|
{
|
4658
4607
|
width,
|
@@ -4667,15 +4616,15 @@ var VirtualizedChatMessages = React53.forwardRef(({ messages, scrollToBottom },
|
|
4667
4616
|
)
|
4668
4617
|
);
|
4669
4618
|
});
|
4670
|
-
var ChatBody =
|
4619
|
+
var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) => {
|
4671
4620
|
var _a;
|
4672
4621
|
const storeMessageSelector = role ? selectMessagesByRole(role) : peerId ? selectMessagesByPeerID(peerId) : selectHMSMessages;
|
4673
|
-
let messages =
|
4622
|
+
let messages = useHMSStore26(storeMessageSelector);
|
4674
4623
|
messages = useMemo8(() => (messages == null ? void 0 : messages.filter((message) => message.type === "chat")) || [], [messages]);
|
4675
4624
|
const isMobile = useMedia11(config.media.md);
|
4676
4625
|
const { elements } = useRoomLayoutConferencingScreen();
|
4677
4626
|
if (messages.length === 0 && !(isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay))) {
|
4678
|
-
return /* @__PURE__ */
|
4627
|
+
return /* @__PURE__ */ React52.createElement(
|
4679
4628
|
Flex,
|
4680
4629
|
{
|
4681
4630
|
css: {
|
@@ -4687,7 +4636,7 @@ var ChatBody = React53.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4687
4636
|
align: "center",
|
4688
4637
|
justify: "center"
|
4689
4638
|
},
|
4690
|
-
/* @__PURE__ */
|
4639
|
+
/* @__PURE__ */ React52.createElement(Box, null, /* @__PURE__ */ React52.createElement("img", { src: empty_chat_default, alt: "Empty Chat", height: 132, width: 185, style: { margin: "0 auto" } }), /* @__PURE__ */ React52.createElement(Text, { variant: "h5", css: { mt: "$8", c: "$on_surface_high" } }, "Start a conversation"), /* @__PURE__ */ React52.createElement(
|
4691
4640
|
Text,
|
4692
4641
|
{
|
4693
4642
|
variant: "sm",
|
@@ -4697,11 +4646,11 @@ var ChatBody = React53.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4697
4646
|
))
|
4698
4647
|
);
|
4699
4648
|
}
|
4700
|
-
return /* @__PURE__ */
|
4649
|
+
return /* @__PURE__ */ React52.createElement(Fragment8, null, /* @__PURE__ */ React52.createElement(VirtualizedChatMessages, { messages, scrollToBottom, ref: listRef }));
|
4701
4650
|
});
|
4702
4651
|
|
4703
4652
|
// src/Prebuilt/components/Chat/ChatFooter.tsx
|
4704
|
-
import
|
4653
|
+
import React53, { useCallback as useCallback13, useEffect as useEffect19, useRef as useRef12, useState as useState30 } from "react";
|
4705
4654
|
import { useMedia as useMedia12 } from "react-use";
|
4706
4655
|
import data2 from "@emoji-mart/data";
|
4707
4656
|
import Picker from "@emoji-mart/react";
|
@@ -4710,10 +4659,10 @@ import { EmojiIcon as EmojiIcon3, SendIcon } from "@100mslive/react-icons";
|
|
4710
4659
|
|
4711
4660
|
// src/Prebuilt/components/AppData/useChatState.js
|
4712
4661
|
import { useCallback as useCallback12 } from "react";
|
4713
|
-
import { selectAppData as selectAppData2, useHMSActions as useHMSActions16, useHMSStore as
|
4662
|
+
import { selectAppData as selectAppData2, useHMSActions as useHMSActions16, useHMSStore as useHMSStore27 } from "@100mslive/react-sdk";
|
4714
4663
|
var useChatDraftMessage = () => {
|
4715
4664
|
const hmsActions = useHMSActions16();
|
4716
|
-
let chatDraftMessage =
|
4665
|
+
let chatDraftMessage = useHMSStore27(selectAppData2(APP_DATA.chatDraft));
|
4717
4666
|
if (chatDraftMessage === void 0 || chatDraftMessage === null) {
|
4718
4667
|
chatDraftMessage = "";
|
4719
4668
|
}
|
@@ -4747,6 +4696,7 @@ var useEmojiPickerStyles = (showing) => {
|
|
4747
4696
|
font-family: var(--hms-ui-fonts-sans);
|
4748
4697
|
}
|
4749
4698
|
.sticky {
|
4699
|
+
top: 0.25rem;
|
4750
4700
|
background-color: var(--hms-ui-colors-surface_bright);
|
4751
4701
|
margin-top: 0.5rem;
|
4752
4702
|
}
|
@@ -4777,9 +4727,9 @@ var TextArea = styled("textarea", {
|
|
4777
4727
|
}
|
4778
4728
|
});
|
4779
4729
|
function EmojiPicker({ onSelect }) {
|
4780
|
-
const [showEmoji, setShowEmoji] =
|
4730
|
+
const [showEmoji, setShowEmoji] = useState30(false);
|
4781
4731
|
const ref = useEmojiPickerStyles(showEmoji);
|
4782
|
-
return /* @__PURE__ */
|
4732
|
+
return /* @__PURE__ */ React53.createElement(Popover.Root, { open: showEmoji, onOpenChange: setShowEmoji }, /* @__PURE__ */ React53.createElement(Popover.Trigger, { asChild: true, css: { appearance: "none" } }, /* @__PURE__ */ React53.createElement(IconButton, { as: "div" }, /* @__PURE__ */ React53.createElement(EmojiIcon3, null))), /* @__PURE__ */ React53.createElement(Popover.Portal, null, /* @__PURE__ */ React53.createElement(
|
4783
4733
|
Popover.Content,
|
4784
4734
|
{
|
4785
4735
|
alignOffset: -40,
|
@@ -4789,7 +4739,7 @@ function EmojiPicker({ onSelect }) {
|
|
4789
4739
|
p: 0
|
4790
4740
|
}
|
4791
4741
|
},
|
4792
|
-
/* @__PURE__ */
|
4742
|
+
/* @__PURE__ */ React53.createElement(
|
4793
4743
|
Box,
|
4794
4744
|
{
|
4795
4745
|
css: {
|
@@ -4798,7 +4748,7 @@ function EmojiPicker({ onSelect }) {
|
|
4798
4748
|
},
|
4799
4749
|
ref
|
4800
4750
|
},
|
4801
|
-
/* @__PURE__ */
|
4751
|
+
/* @__PURE__ */ React53.createElement(Picker, { onEmojiSelect: onSelect, data: data2, previewPosition: "none", skinPosition: "search" })
|
4802
4752
|
)
|
4803
4753
|
)));
|
4804
4754
|
}
|
@@ -4850,7 +4800,7 @@ var ChatFooter = ({
|
|
4850
4800
|
setDraftMessage((messageElement == null ? void 0 : messageElement.value) || "");
|
4851
4801
|
};
|
4852
4802
|
}, [setDraftMessage]);
|
4853
|
-
return /* @__PURE__ */
|
4803
|
+
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(Flex, { align: "center", css: { gap: "$4", w: "100%" } }, /* @__PURE__ */ React53.createElement(
|
4854
4804
|
Flex,
|
4855
4805
|
{
|
4856
4806
|
align: "center",
|
@@ -4871,7 +4821,7 @@ var ChatFooter = ({
|
|
4871
4821
|
}
|
4872
4822
|
},
|
4873
4823
|
children,
|
4874
|
-
/* @__PURE__ */
|
4824
|
+
/* @__PURE__ */ React53.createElement(
|
4875
4825
|
TextArea,
|
4876
4826
|
{
|
4877
4827
|
css: {
|
@@ -4898,7 +4848,7 @@ var ChatFooter = ({
|
|
4898
4848
|
onCopy: (e) => e.stopPropagation()
|
4899
4849
|
}
|
4900
4850
|
),
|
4901
|
-
!isMobile ? /* @__PURE__ */
|
4851
|
+
!isMobile ? /* @__PURE__ */ React53.createElement(
|
4902
4852
|
EmojiPicker,
|
4903
4853
|
{
|
4904
4854
|
onSelect: (emoji) => {
|
@@ -4908,7 +4858,7 @@ var ChatFooter = ({
|
|
4908
4858
|
}
|
4909
4859
|
}
|
4910
4860
|
) : null,
|
4911
|
-
/* @__PURE__ */
|
4861
|
+
/* @__PURE__ */ React53.createElement(
|
4912
4862
|
IconButton,
|
4913
4863
|
{
|
4914
4864
|
className: "send-msg",
|
@@ -4921,7 +4871,7 @@ var ChatFooter = ({
|
|
4921
4871
|
},
|
4922
4872
|
"data-testid": "send_msg_btn"
|
4923
4873
|
},
|
4924
|
-
/* @__PURE__ */
|
4874
|
+
/* @__PURE__ */ React53.createElement(SendIcon, null)
|
4925
4875
|
)
|
4926
4876
|
)));
|
4927
4877
|
};
|
@@ -4931,21 +4881,21 @@ import {
|
|
4931
4881
|
selectMessagesUnreadCountByPeerID,
|
4932
4882
|
selectMessagesUnreadCountByRole,
|
4933
4883
|
selectUnreadHMSMessagesCount as selectUnreadHMSMessagesCount2,
|
4934
|
-
useHMSStore as
|
4884
|
+
useHMSStore as useHMSStore28
|
4935
4885
|
} from "@100mslive/react-sdk";
|
4936
4886
|
var useUnreadCount = ({ role, peerId }) => {
|
4937
4887
|
const unreadCountSelector = role ? selectMessagesUnreadCountByRole(role) : peerId ? selectMessagesUnreadCountByPeerID(peerId) : selectUnreadHMSMessagesCount2;
|
4938
|
-
const unreadCount =
|
4888
|
+
const unreadCount = useHMSStore28(unreadCountSelector);
|
4939
4889
|
return unreadCount;
|
4940
4890
|
};
|
4941
4891
|
|
4942
4892
|
// src/Prebuilt/components/Chat/Chat.jsx
|
4943
4893
|
var PINNED_MESSAGE_LENGTH = 80;
|
4944
4894
|
var PinnedMessage = ({ clearPinnedMessage }) => {
|
4945
|
-
const permissions =
|
4946
|
-
const pinnedMessage =
|
4895
|
+
const permissions = useHMSStore29(selectPermissions10);
|
4896
|
+
const pinnedMessage = useHMSStore29(selectSessionStore(SESSION_STORE_KEY.PINNED_MESSAGE));
|
4947
4897
|
const formattedPinnedMessage = (pinnedMessage == null ? void 0 : pinnedMessage.length) && pinnedMessage.length > PINNED_MESSAGE_LENGTH ? `${pinnedMessage.slice(0, PINNED_MESSAGE_LENGTH)}...` : pinnedMessage;
|
4948
|
-
return pinnedMessage ? /* @__PURE__ */
|
4898
|
+
return pinnedMessage ? /* @__PURE__ */ React54.createElement(
|
4949
4899
|
Flex,
|
4950
4900
|
{
|
4951
4901
|
title: pinnedMessage,
|
@@ -4953,8 +4903,8 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
4953
4903
|
align: "center",
|
4954
4904
|
justify: "between"
|
4955
4905
|
},
|
4956
|
-
/* @__PURE__ */
|
4957
|
-
/* @__PURE__ */
|
4906
|
+
/* @__PURE__ */ React54.createElement(PinIcon2, null),
|
4907
|
+
/* @__PURE__ */ React54.createElement(
|
4958
4908
|
Box,
|
4959
4909
|
{
|
4960
4910
|
css: {
|
@@ -4964,30 +4914,30 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
4964
4914
|
overflowY: "auto"
|
4965
4915
|
}
|
4966
4916
|
},
|
4967
|
-
/* @__PURE__ */
|
4917
|
+
/* @__PURE__ */ React54.createElement(Text, { variant: "sm" }, /* @__PURE__ */ React54.createElement(AnnotisedMessage, { message: formattedPinnedMessage }))
|
4968
4918
|
),
|
4969
|
-
permissions.removeOthers && /* @__PURE__ */
|
4919
|
+
permissions.removeOthers && /* @__PURE__ */ React54.createElement(
|
4970
4920
|
Flex,
|
4971
4921
|
{
|
4972
4922
|
onClick: () => clearPinnedMessage(),
|
4973
4923
|
css: { cursor: "pointer", color: "$on_surface_medium", "&:hover": { color: "$on_surface_high" } }
|
4974
4924
|
},
|
4975
|
-
/* @__PURE__ */
|
4925
|
+
/* @__PURE__ */ React54.createElement(CrossIcon6, null)
|
4976
4926
|
)
|
4977
4927
|
) : null;
|
4978
4928
|
};
|
4979
|
-
var Chat = ({ screenType
|
4980
|
-
var _a, _b
|
4929
|
+
var Chat = ({ screenType }) => {
|
4930
|
+
var _a, _b;
|
4981
4931
|
const notification = useHMSNotifications(HMSNotificationTypes.PEER_LEFT);
|
4982
4932
|
const [peerSelector, setPeerSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.PEER_ID);
|
4983
4933
|
const [roleSelector, setRoleSelector] = useSetSubscribedChatSelector(CHAT_SELECTOR.ROLE);
|
4984
|
-
const peerName =
|
4985
|
-
const [chatOptions, setChatOptions] =
|
4934
|
+
const peerName = useHMSStore29(selectPeerNameByID3(peerSelector));
|
4935
|
+
const [chatOptions, setChatOptions] = useState31({
|
4986
4936
|
role: roleSelector || "",
|
4987
4937
|
peerId: peerSelector && peerName ? peerSelector : "",
|
4988
4938
|
selection: roleSelector ? roleSelector : peerSelector && peerName ? peerName : "Everyone"
|
4989
4939
|
});
|
4990
|
-
const [isSelectorOpen
|
4940
|
+
const [isSelectorOpen] = useState31(false);
|
4991
4941
|
const listRef = useRef13(null);
|
4992
4942
|
const hmsActions = useHMSActions18();
|
4993
4943
|
const { setPinnedMessage } = useSetPinnedMessage();
|
@@ -5009,7 +4959,7 @@ var Chat = ({ screenType, hideControls = false }) => {
|
|
5009
4959
|
const currentRef = listRef.current._outerRef;
|
5010
4960
|
isScrolledToBottom = currentRef.scrollHeight - currentRef.clientHeight - currentRef.scrollTop < 10;
|
5011
4961
|
}
|
5012
|
-
const messagesCount =
|
4962
|
+
const messagesCount = useHMSStore29(storeMessageSelector) || 0;
|
5013
4963
|
const scrollToBottom = useCallback14(
|
5014
4964
|
(unreadCount = 0) => {
|
5015
4965
|
var _a2;
|
@@ -5024,19 +4974,17 @@ var Chat = ({ screenType, hideControls = false }) => {
|
|
5024
4974
|
},
|
5025
4975
|
[hmsActions, messagesCount]
|
5026
4976
|
);
|
5027
|
-
return /* @__PURE__ */
|
4977
|
+
return /* @__PURE__ */ React54.createElement(
|
5028
4978
|
Flex,
|
5029
4979
|
{
|
5030
4980
|
direction: "column",
|
5031
4981
|
css: {
|
5032
4982
|
size: "100%",
|
5033
|
-
gap: "$4"
|
5034
|
-
marginTop: hideControls && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) ? "$17" : "0",
|
5035
|
-
transition: "margin 0.3s ease-in-out"
|
4983
|
+
gap: "$4"
|
5036
4984
|
}
|
5037
4985
|
},
|
5038
|
-
isMobile && ((
|
5039
|
-
/* @__PURE__ */
|
4986
|
+
isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) ? null : /* @__PURE__ */ React54.createElement(React54.Fragment, null, ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.allow_pinning_messages) ? /* @__PURE__ */ React54.createElement(PinnedMessage, { clearPinnedMessage: setPinnedMessage }) : null),
|
4987
|
+
/* @__PURE__ */ React54.createElement(
|
5040
4988
|
ChatBody,
|
5041
4989
|
{
|
5042
4990
|
role: chatOptions.role,
|
@@ -5046,7 +4994,7 @@ var Chat = ({ screenType, hideControls = false }) => {
|
|
5046
4994
|
screenType
|
5047
4995
|
}
|
5048
4996
|
),
|
5049
|
-
/* @__PURE__ */
|
4997
|
+
/* @__PURE__ */ React54.createElement(
|
5050
4998
|
ChatFooter,
|
5051
4999
|
{
|
5052
5000
|
role: chatOptions.role,
|
@@ -5064,7 +5012,7 @@ var Chat = ({ screenType, hideControls = false }) => {
|
|
5064
5012
|
},
|
5065
5013
|
peerId: chatOptions.peerId
|
5066
5014
|
},
|
5067
|
-
!isSelectorOpen && !isScrolledToBottom && /* @__PURE__ */
|
5015
|
+
!isSelectorOpen && !isScrolledToBottom && /* @__PURE__ */ React54.createElement(NewMessageIndicator, { role: chatOptions.role, peerId: chatOptions.peerId, scrollToBottom })
|
5068
5016
|
)
|
5069
5017
|
);
|
5070
5018
|
};
|
@@ -5073,7 +5021,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5073
5021
|
if (!unreadCount) {
|
5074
5022
|
return null;
|
5075
5023
|
}
|
5076
|
-
return /* @__PURE__ */
|
5024
|
+
return /* @__PURE__ */ React54.createElement(
|
5077
5025
|
Flex,
|
5078
5026
|
{
|
5079
5027
|
justify: "center",
|
@@ -5084,7 +5032,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5084
5032
|
position: "absolute"
|
5085
5033
|
}
|
5086
5034
|
},
|
5087
|
-
/* @__PURE__ */
|
5035
|
+
/* @__PURE__ */ React54.createElement(
|
5088
5036
|
Button,
|
5089
5037
|
{
|
5090
5038
|
variant: "standard",
|
@@ -5107,22 +5055,123 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5107
5055
|
},
|
5108
5056
|
"New ",
|
5109
5057
|
unreadCount === 1 ? "message" : "messages",
|
5110
|
-
/* @__PURE__ */
|
5058
|
+
/* @__PURE__ */ React54.createElement(ChevronDownIcon2, null)
|
5111
5059
|
)
|
5112
5060
|
);
|
5113
5061
|
};
|
5114
5062
|
|
5063
|
+
// src/Prebuilt/components/SidePaneTabs.tsx
|
5064
|
+
var tabTriggerCSS = {
|
5065
|
+
color: "$on_surface_high",
|
5066
|
+
p: "$4",
|
5067
|
+
fontWeight: "$semiBold",
|
5068
|
+
fontSize: "$sm",
|
5069
|
+
w: "100%",
|
5070
|
+
justifyContent: "center"
|
5071
|
+
};
|
5072
|
+
var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType, hideControls }) => {
|
5073
|
+
var _a;
|
5074
|
+
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
5075
|
+
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
5076
|
+
const resetSidePane = useSidepaneReset();
|
5077
|
+
const [activeTab, setActiveTab] = useState32(active);
|
5078
|
+
const peerCount = useHMSStore30(selectPeerCount3);
|
5079
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
5080
|
+
const showChat = !!(elements == null ? void 0 : elements.chat);
|
5081
|
+
const showParticipants = !!(elements == null ? void 0 : elements.participant_list);
|
5082
|
+
const hideTabs = !(showChat && showParticipants);
|
5083
|
+
const isMobile = useMedia14(config.media.md);
|
5084
|
+
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isMobile;
|
5085
|
+
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
5086
|
+
useEffect21(() => {
|
5087
|
+
if (activeTab === SIDE_PANE_OPTIONS.CHAT && !showChat && showParticipants) {
|
5088
|
+
setActiveTab(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
5089
|
+
} else if (activeTab === SIDE_PANE_OPTIONS.PARTICIPANTS && showChat && !showParticipants) {
|
5090
|
+
setActiveTab(SIDE_PANE_OPTIONS.CHAT);
|
5091
|
+
} else if (!showChat && !showParticipants) {
|
5092
|
+
resetSidePane();
|
5093
|
+
}
|
5094
|
+
}, [showChat, activeTab, showParticipants, resetSidePane]);
|
5095
|
+
useEffect21(() => {
|
5096
|
+
setActiveTab(active);
|
5097
|
+
}, [active]);
|
5098
|
+
return /* @__PURE__ */ React55.createElement(
|
5099
|
+
Flex,
|
5100
|
+
{
|
5101
|
+
direction: "column",
|
5102
|
+
css: {
|
5103
|
+
color: "$on_primary_high",
|
5104
|
+
h: "100%",
|
5105
|
+
marginTop: hideControls && isOverlayChat ? "$17" : "0",
|
5106
|
+
transition: "margin 0.3s ease-in-out"
|
5107
|
+
}
|
5108
|
+
},
|
5109
|
+
isOverlayChat && isChatOpen && showChat ? /* @__PURE__ */ React55.createElement(Chat, { screenType }) : /* @__PURE__ */ React55.createElement(React55.Fragment, null, hideTabs ? /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", p: "$4", c: "$on_surface_high", pr: "$12" } }, showChat ? "Chat" : `Participants (${peerCount})`), showChat ? /* @__PURE__ */ React55.createElement(Chat, { screenType }) : /* @__PURE__ */ React55.createElement(ParticipantList, null)) : /* @__PURE__ */ React55.createElement(
|
5110
|
+
Tabs.Root,
|
5111
|
+
{
|
5112
|
+
value: activeTab,
|
5113
|
+
onValueChange: setActiveTab,
|
5114
|
+
css: {
|
5115
|
+
flexDirection: "column",
|
5116
|
+
size: "100%"
|
5117
|
+
}
|
5118
|
+
},
|
5119
|
+
/* @__PURE__ */ React55.createElement(Tabs.List, { css: { w: "calc(100% - $12)", p: "$2", borderRadius: "$2", bg: "$surface_default" } }, /* @__PURE__ */ React55.createElement(
|
5120
|
+
Tabs.Trigger,
|
5121
|
+
{
|
5122
|
+
value: SIDE_PANE_OPTIONS.CHAT,
|
5123
|
+
onClick: toggleChat,
|
5124
|
+
css: __spreadProps(__spreadValues({}, tabTriggerCSS), {
|
5125
|
+
color: activeTab !== SIDE_PANE_OPTIONS.CHAT ? "$on_surface_low" : "$on_surface_high"
|
5126
|
+
})
|
5127
|
+
},
|
5128
|
+
"Chat"
|
5129
|
+
), /* @__PURE__ */ React55.createElement(
|
5130
|
+
Tabs.Trigger,
|
5131
|
+
{
|
5132
|
+
value: SIDE_PANE_OPTIONS.PARTICIPANTS,
|
5133
|
+
onClick: toggleParticipants,
|
5134
|
+
css: __spreadProps(__spreadValues({}, tabTriggerCSS), {
|
5135
|
+
color: activeTab !== SIDE_PANE_OPTIONS.PARTICIPANTS ? "$on_surface_low" : "$on_surface_high"
|
5136
|
+
})
|
5137
|
+
},
|
5138
|
+
"Participants (",
|
5139
|
+
peerCount,
|
5140
|
+
")"
|
5141
|
+
)),
|
5142
|
+
/* @__PURE__ */ React55.createElement(Tabs.Content, { value: SIDE_PANE_OPTIONS.PARTICIPANTS, css: { p: 0 } }, /* @__PURE__ */ React55.createElement(ParticipantList, null)),
|
5143
|
+
/* @__PURE__ */ React55.createElement(Tabs.Content, { value: SIDE_PANE_OPTIONS.CHAT, css: { p: 0 } }, /* @__PURE__ */ React55.createElement(Chat, { screenType }))
|
5144
|
+
)),
|
5145
|
+
isOverlayChat && isChatOpen ? null : /* @__PURE__ */ React55.createElement(
|
5146
|
+
IconButton,
|
5147
|
+
{
|
5148
|
+
css: { position: "absolute", right: "$10", top: "$11", "@md": { top: "$8", right: "$8" } },
|
5149
|
+
onClick: (e) => {
|
5150
|
+
e.stopPropagation();
|
5151
|
+
if (activeTab === SIDE_PANE_OPTIONS.CHAT) {
|
5152
|
+
toggleChat();
|
5153
|
+
} else {
|
5154
|
+
toggleParticipants();
|
5155
|
+
}
|
5156
|
+
},
|
5157
|
+
"data-testid": "close_chat"
|
5158
|
+
},
|
5159
|
+
/* @__PURE__ */ React55.createElement(CrossIcon7, null)
|
5160
|
+
)
|
5161
|
+
);
|
5162
|
+
});
|
5163
|
+
|
5115
5164
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
5116
5165
|
import React57, { Fragment as Fragment10, useState as useState34 } from "react";
|
5117
|
-
import { selectPermissions as selectPermissions11, useHMSStore as
|
5166
|
+
import { selectPermissions as selectPermissions11, useHMSStore as useHMSStore32, useRecordingStreaming as useRecordingStreaming7 } from "@100mslive/react-sdk";
|
5118
5167
|
import { ColoredHandIcon, CrossIcon as CrossIcon8, GoLiveIcon as GoLiveIcon3 } from "@100mslive/react-icons";
|
5119
5168
|
|
5120
5169
|
// src/Prebuilt/images/rtmp.png
|
5121
5170
|
var rtmp_default = "data:image/png;base64,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";
|
5122
5171
|
|
5123
5172
|
// src/Prebuilt/components/Streaming/HLSStreaming.jsx
|
5124
|
-
import React56, { Fragment as Fragment9, useCallback as useCallback15, useEffect as
|
5125
|
-
import { selectRoomID, useHMSActions as useHMSActions19, useHMSStore as
|
5173
|
+
import React56, { Fragment as Fragment9, useCallback as useCallback15, useEffect as useEffect22, useState as useState33 } from "react";
|
5174
|
+
import { selectRoomID, useHMSActions as useHMSActions19, useHMSStore as useHMSStore31, useRecordingStreaming as useRecordingStreaming6 } from "@100mslive/react-sdk";
|
5126
5175
|
import {
|
5127
5176
|
EndStreamIcon as EndStreamIcon2,
|
5128
5177
|
EyeOpenIcon,
|
@@ -5197,7 +5246,7 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5197
5246
|
};
|
5198
5247
|
var HLSStreaming = ({ onBack }) => {
|
5199
5248
|
const roleNames = useFilteredRoles();
|
5200
|
-
const roomId =
|
5249
|
+
const roomId = useHMSStore31(selectRoomID);
|
5201
5250
|
const cards = roleNames.map((roleName) => getCardData(roleName, roomId));
|
5202
5251
|
const { isHLSRunning } = useRecordingStreaming6();
|
5203
5252
|
const [showLinks, setShowLinks] = useState33(false);
|
@@ -5245,7 +5294,7 @@ var EndHLS = ({ setShowLinks }) => {
|
|
5245
5294
|
const [inProgress, setInProgress] = useState33(false);
|
5246
5295
|
const [error, setError] = useState33("");
|
5247
5296
|
const { isHLSRunning } = useRecordingStreaming6();
|
5248
|
-
|
5297
|
+
useEffect22(() => {
|
5249
5298
|
if (inProgress && !isHLSRunning) {
|
5250
5299
|
setInProgress(false);
|
5251
5300
|
}
|
@@ -5278,7 +5327,7 @@ var EndHLS = ({ setShowLinks }) => {
|
|
5278
5327
|
var StreamingLanding = () => {
|
5279
5328
|
const toggleStreaming = useSidepaneToggle(SIDE_PANE_OPTIONS.STREAMING);
|
5280
5329
|
const { isHLSRunning, isRTMPRunning } = useRecordingStreaming7();
|
5281
|
-
const permissions =
|
5330
|
+
const permissions = useHMSStore32(selectPermissions11);
|
5282
5331
|
const [showHLS, setShowHLS] = useState34(isHLSRunning);
|
5283
5332
|
const [showRTMP, setShowRTMP] = useState34(isRTMPRunning);
|
5284
5333
|
if (!(permissions == null ? void 0 : permissions.hlsStreaming) && !(permissions == null ? void 0 : permissions.rtmpStreaming)) {
|
@@ -5328,22 +5377,27 @@ var SidePane = ({
|
|
5328
5377
|
hideControls = false
|
5329
5378
|
}) => {
|
5330
5379
|
var _a, _b;
|
5331
|
-
const isMobile =
|
5332
|
-
const sidepane =
|
5333
|
-
const activeScreensharePeerId =
|
5334
|
-
const trackId = (_a =
|
5380
|
+
const isMobile = useMedia15(config.media.md);
|
5381
|
+
const sidepane = useHMSStore33(selectAppData3(APP_DATA.sidePane));
|
5382
|
+
const activeScreensharePeerId = useHMSStore33(selectAppData3(APP_DATA.activeScreensharePeerId));
|
5383
|
+
const trackId = (_a = useHMSStore33(selectVideoTrackByPeerID(activeScreensharePeerId))) == null ? void 0 : _a.id;
|
5335
5384
|
const { elements } = useRoomLayoutConferencingScreen();
|
5336
5385
|
let ViewComponent;
|
5337
|
-
if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS) {
|
5338
|
-
ViewComponent = /* @__PURE__ */ React58.createElement(
|
5339
|
-
} else if (sidepane === SIDE_PANE_OPTIONS.CHAT) {
|
5340
|
-
ViewComponent = /* @__PURE__ */ React58.createElement(Chat, { screenType, hideControls });
|
5386
|
+
if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS || sidepane === SIDE_PANE_OPTIONS.CHAT) {
|
5387
|
+
ViewComponent = /* @__PURE__ */ React58.createElement(SidePaneTabs, { screenType, hideControls, active: sidepane });
|
5341
5388
|
} else if (sidepane === SIDE_PANE_OPTIONS.STREAMING) {
|
5342
5389
|
ViewComponent = /* @__PURE__ */ React58.createElement(StreamingLanding, null);
|
5343
5390
|
}
|
5344
5391
|
if (!ViewComponent && !trackId) {
|
5345
5392
|
return null;
|
5346
5393
|
}
|
5394
|
+
const tileLayout = {
|
5395
|
+
hideParticipantNameOnTile: tileProps == null ? void 0 : tileProps.hide_participant_name_on_tile,
|
5396
|
+
roundedVideoTile: tileProps == null ? void 0 : tileProps.rounded_video_tile,
|
5397
|
+
hideAudioMuteOnTile: tileProps == null ? void 0 : tileProps.hide_audio_mute_on_tile,
|
5398
|
+
hideMetadataOnTile: tileProps == null ? void 0 : tileProps.hide_metadata_on_tile,
|
5399
|
+
objectFit: tileProps == null ? void 0 : tileProps.video_object_fit
|
5400
|
+
};
|
5347
5401
|
const mwebStreamingChat = isMobile && sidepane === SIDE_PANE_OPTIONS.CHAT && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.is_overlay);
|
5348
5402
|
return /* @__PURE__ */ React58.createElement(
|
5349
5403
|
Flex,
|
@@ -5365,9 +5419,8 @@ var SidePane = ({
|
|
5365
5419
|
trackId,
|
5366
5420
|
width: "100%",
|
5367
5421
|
height: 225,
|
5368
|
-
rootCSS: { p: 0, alignSelf: "start", flexShrink: 0 }
|
5369
|
-
|
5370
|
-
}, tileProps)
|
5422
|
+
rootCSS: { p: 0, alignSelf: "start", flexShrink: 0 }
|
5423
|
+
}, tileLayout)
|
5371
5424
|
),
|
5372
5425
|
!!ViewComponent && /* @__PURE__ */ React58.createElement(
|
5373
5426
|
Box,
|
@@ -5455,20 +5508,20 @@ var WaitingView = React59.memo(() => {
|
|
5455
5508
|
});
|
5456
5509
|
|
5457
5510
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
5458
|
-
var HLSView = React60.lazy(() => import("./HLSView-
|
5511
|
+
var HLSView = React60.lazy(() => import("./HLSView-HL455FYH.js"));
|
5459
5512
|
var VideoStreamingSection = ({
|
5460
5513
|
screenType,
|
5461
5514
|
elements,
|
5462
5515
|
hideControls = false
|
5463
5516
|
}) => {
|
5464
5517
|
var _a, _b;
|
5465
|
-
const localPeerRole =
|
5466
|
-
const isConnected =
|
5518
|
+
const localPeerRole = useHMSStore34(selectLocalPeerRoleName2);
|
5519
|
+
const isConnected = useHMSStore34(selectIsConnectedToRoom6);
|
5467
5520
|
const hmsActions = useHMSActions20();
|
5468
5521
|
const waitingViewerRole = useWaitingViewerRole();
|
5469
5522
|
const urlToIframe = useUrlToEmbed();
|
5470
5523
|
const pdfAnnotatorActive = usePDFAnnotator();
|
5471
|
-
|
5524
|
+
useEffect23(() => {
|
5472
5525
|
if (!isConnected) {
|
5473
5526
|
return;
|
5474
5527
|
}
|
@@ -5511,28 +5564,30 @@ var VideoStreamingSection = ({
|
|
5511
5564
|
};
|
5512
5565
|
|
5513
5566
|
// src/Prebuilt/components/RoleChangeRequestModal.tsx
|
5514
|
-
import React61, { useEffect as
|
5567
|
+
import React61, { useEffect as useEffect24 } from "react";
|
5515
5568
|
import {
|
5516
5569
|
selectLocalPeerName,
|
5517
5570
|
selectLocalPeerRoleName as selectLocalPeerRoleName3,
|
5518
5571
|
selectRoleChangeRequest,
|
5519
5572
|
useCustomEvent as useCustomEvent2,
|
5520
5573
|
useHMSActions as useHMSActions21,
|
5521
|
-
useHMSStore as
|
5574
|
+
useHMSStore as useHMSStore35
|
5522
5575
|
} from "@100mslive/react-sdk";
|
5523
5576
|
var RoleChangeRequestModal = () => {
|
5524
5577
|
const hmsActions = useHMSActions21();
|
5525
5578
|
const { updateMetaData } = useMyMetadata();
|
5526
|
-
const currentRole =
|
5527
|
-
const roleChangeRequest =
|
5528
|
-
const name =
|
5579
|
+
const currentRole = useHMSStore35(selectLocalPeerRoleName3);
|
5580
|
+
const roleChangeRequest = useHMSStore35(selectRoleChangeRequest);
|
5581
|
+
const name = useHMSStore35(selectLocalPeerName);
|
5529
5582
|
const { sendEvent } = useCustomEvent2({ type: ROLE_CHANGE_DECLINED });
|
5530
|
-
|
5583
|
+
useEffect24(() => {
|
5531
5584
|
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5532
5585
|
return;
|
5533
5586
|
}
|
5534
|
-
|
5535
|
-
|
5587
|
+
(() => __async(void 0, null, function* () {
|
5588
|
+
yield hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
5589
|
+
}))();
|
5590
|
+
}, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
|
5536
5591
|
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5537
5592
|
return null;
|
5538
5593
|
}
|
@@ -5589,12 +5644,12 @@ var Conference = () => {
|
|
5589
5644
|
const { userName, endpoints } = useHMSPrebuiltContext();
|
5590
5645
|
const screenProps = useRoomLayoutConferencingScreen();
|
5591
5646
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
5592
|
-
const roomState =
|
5647
|
+
const roomState = useHMSStore36(selectRoomState);
|
5593
5648
|
const prevState = usePrevious(roomState);
|
5594
|
-
const isConnectedToRoom =
|
5649
|
+
const isConnectedToRoom = useHMSStore36(selectIsConnectedToRoom7);
|
5595
5650
|
const hmsActions = useHMSActions22();
|
5596
5651
|
const [hideControls, setHideControls] = useState35(false);
|
5597
|
-
const dropdownList =
|
5652
|
+
const dropdownList = useHMSStore36(selectAppData4(APP_DATA.dropdownList));
|
5598
5653
|
const authTokenInAppData = useAuthToken();
|
5599
5654
|
const headerRef = useRef14();
|
5600
5655
|
const footerRef = useRef14();
|
@@ -5607,7 +5662,8 @@ var Conference = () => {
|
|
5607
5662
|
setHideControls((value) => !value);
|
5608
5663
|
}
|
5609
5664
|
};
|
5610
|
-
|
5665
|
+
const autoRoomJoined = useRef14(isPreviewScreenEnabled);
|
5666
|
+
useEffect25(() => {
|
5611
5667
|
let timeout = null;
|
5612
5668
|
dropdownListRef.current = dropdownList || [];
|
5613
5669
|
if (dropdownListRef.current.length === 0) {
|
@@ -5622,7 +5678,7 @@ var Conference = () => {
|
|
5622
5678
|
clearTimeout(timeout);
|
5623
5679
|
};
|
5624
5680
|
}, [dropdownList, hideControls, isMobileDevice]);
|
5625
|
-
|
5681
|
+
useEffect25(() => {
|
5626
5682
|
if (!roomId) {
|
5627
5683
|
navigate(`/`);
|
5628
5684
|
return;
|
@@ -5637,8 +5693,8 @@ var Conference = () => {
|
|
5637
5693
|
navigate(`/preview/${roomId || ""}`);
|
5638
5694
|
}
|
5639
5695
|
}, [isConnectedToRoom, prevState, roomState, navigate, role, roomId, isPreviewScreenEnabled]);
|
5640
|
-
|
5641
|
-
if (authTokenInAppData && !isConnectedToRoom && !isPreviewScreenEnabled && roomState !== HMSRoomState.Connecting) {
|
5696
|
+
useEffect25(() => {
|
5697
|
+
if (authTokenInAppData && !isConnectedToRoom && !isPreviewScreenEnabled && roomState !== HMSRoomState.Connecting && !autoRoomJoined.current) {
|
5642
5698
|
hmsActions.join({
|
5643
5699
|
userName,
|
5644
5700
|
authToken: authTokenInAppData,
|
@@ -5649,9 +5705,10 @@ var Conference = () => {
|
|
5649
5705
|
speakerAutoSelectionBlacklist: ["Yeti Stereo Microphone"]
|
5650
5706
|
}
|
5651
5707
|
}).catch(console.error);
|
5708
|
+
autoRoomJoined.current = true;
|
5652
5709
|
}
|
5653
5710
|
}, [authTokenInAppData, endpoints == null ? void 0 : endpoints.init, hmsActions, isConnectedToRoom, isPreviewScreenEnabled, roomState, userName]);
|
5654
|
-
|
5711
|
+
useEffect25(() => {
|
5655
5712
|
return () => {
|
5656
5713
|
PictureInPicture.stop().catch((error) => console.error("stopping pip", error));
|
5657
5714
|
};
|
@@ -5724,4 +5781,4 @@ var conference_default = Conference;
|
|
5724
5781
|
export {
|
5725
5782
|
conference_default as default
|
5726
5783
|
};
|
5727
|
-
//# sourceMappingURL=conference-
|
5784
|
+
//# sourceMappingURL=conference-MPZNWHV5.js.map
|