@100mslive/roomkit-react 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HLSView-4NSE37G7.js → HLSView-3S74KF3A.js} +23 -4
- package/dist/HLSView-3S74KF3A.js.map +7 -0
- package/dist/Prebuilt/components/RoleChangeRequest/RequestPrompt.d.ts +9 -0
- package/dist/VideoTile/StyledVideoTile.d.ts +445 -3
- package/dist/{VirtualBackground-A5UM363O.js → VirtualBackground-3TI5NA4V.js} +3 -3
- package/dist/{chunk-BUWIMYLW.js → chunk-36X4ZCLC.js} +2 -2
- package/dist/{chunk-NMOZ33TX.js → chunk-5DQ3WTED.js} +3 -2
- package/dist/{chunk-NMOZ33TX.js.map → chunk-5DQ3WTED.js.map} +2 -2
- package/dist/{chunk-Q6U22HIE.js → chunk-Z7P5WITU.js} +223 -200
- package/dist/chunk-Z7P5WITU.js.map +7 -0
- package/dist/{conference-S7R3O4OC.js → conference-JNABIZBG.js} +534 -504
- package/dist/conference-JNABIZBG.js.map +7 -0
- package/dist/index.cjs.js +1011 -924
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +2 -2
- package/dist/meta.cjs.json +241 -167
- package/dist/meta.esbuild.json +276 -203
- package/package.json +6 -6
- package/src/Input/Input.tsx +1 -1
- package/src/Prebuilt/common/hooks.js +1 -2
- package/src/Prebuilt/common/utils.js +7 -2
- package/src/Prebuilt/components/Chat/ChatBody.jsx +125 -106
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -0
- package/src/Prebuilt/components/Footer/Footer.tsx +4 -1
- package/src/Prebuilt/components/Footer/ParticipantList.jsx +8 -9
- package/src/Prebuilt/components/Header/ParticipantFilter.jsx +9 -12
- package/src/Prebuilt/components/Leave/DesktopLeaveRoom.tsx +36 -44
- package/src/Prebuilt/components/Leave/MwebLeaveRoom.tsx +23 -35
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +4 -2
- package/src/Prebuilt/components/Notifications/Notifications.jsx +14 -1
- package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +4 -15
- package/src/Prebuilt/components/Preview/PreviewJoin.tsx +12 -5
- package/src/Prebuilt/components/RaiseHand.jsx +3 -6
- package/src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx +66 -0
- package/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +89 -0
- package/src/Prebuilt/components/SidePaneTabs.tsx +21 -2
- package/src/Prebuilt/components/VideoTile.jsx +24 -15
- package/src/Prebuilt/components/conference.jsx +1 -1
- package/src/Prebuilt/components/hooks/useMetadata.jsx +15 -4
- package/src/Prebuilt/layouts/HLSView.jsx +20 -1
- package/src/Prebuilt/layouts/SidePane.tsx +0 -1
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/VideoTile/StyledVideoTile.tsx +10 -14
- package/src/fixtures/peers.ts +5 -3
- package/dist/HLSView-4NSE37G7.js.map +0 -7
- package/dist/chunk-Q6U22HIE.js.map +0 -7
- package/dist/conference-S7R3O4OC.js.map +0 -7
- package/src/Prebuilt/components/RoleChangeRequestModal.tsx +0 -120
- /package/dist/Prebuilt/components/{RoleChangeRequestModal.d.ts → RoleChangeRequest/RoleChangeRequestModal.d.ts} +0 -0
- /package/dist/{VirtualBackground-A5UM363O.js.map → VirtualBackground-3TI5NA4V.js.map} +0 -0
- /package/dist/{chunk-BUWIMYLW.js.map → chunk-36X4ZCLC.js.map} +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
ActionTile
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-36X4ZCLC.js";
|
4
4
|
import {
|
5
5
|
APP_DATA,
|
6
6
|
Accordion,
|
@@ -58,7 +58,6 @@ import {
|
|
58
58
|
isChrome,
|
59
59
|
isIOS,
|
60
60
|
isIPadOS,
|
61
|
-
isInternalRole,
|
62
61
|
isMacOS,
|
63
62
|
isScreenshareSupported,
|
64
63
|
useAuthToken,
|
@@ -84,7 +83,7 @@ import {
|
|
84
83
|
useUrlToEmbed,
|
85
84
|
useUserPreferences,
|
86
85
|
useWaitingViewerRole
|
87
|
-
} from "./chunk-
|
86
|
+
} from "./chunk-Z7P5WITU.js";
|
88
87
|
import {
|
89
88
|
Box,
|
90
89
|
Flex,
|
@@ -103,10 +102,10 @@ import {
|
|
103
102
|
slideLeftAndFade,
|
104
103
|
styled,
|
105
104
|
textEllipsis
|
106
|
-
} from "./chunk-
|
105
|
+
} from "./chunk-5DQ3WTED.js";
|
107
106
|
|
108
107
|
// src/Prebuilt/components/conference.jsx
|
109
|
-
import
|
108
|
+
import React63, { useEffect as useEffect25, useRef as useRef14, useState as useState35 } from "react";
|
110
109
|
import { useNavigate, useParams } from "react-router-dom";
|
111
110
|
import { usePrevious } from "react-use";
|
112
111
|
import {
|
@@ -115,13 +114,14 @@ import {
|
|
115
114
|
selectIsConnectedToRoom as selectIsConnectedToRoom7,
|
116
115
|
selectRoomState,
|
117
116
|
useHMSActions as useHMSActions22,
|
118
|
-
useHMSStore as
|
117
|
+
useHMSStore as useHMSStore35
|
119
118
|
} from "@100mslive/react-sdk";
|
120
119
|
|
121
120
|
// src/Prebuilt/components/Footer/Footer.tsx
|
122
121
|
import React36, { Suspense, useEffect as useEffect6 } from "react";
|
123
122
|
import { useMedia as useMedia5 } from "react-use";
|
124
123
|
import { Chat_ChatState } from "@100mslive/types-prebuilt/elements/chat";
|
124
|
+
import { useAVToggle as useAVToggle2 } from "@100mslive/react-sdk";
|
125
125
|
|
126
126
|
// src/Prebuilt/components/EmojiReaction.jsx
|
127
127
|
import React2, { Fragment, useState } from "react";
|
@@ -345,11 +345,12 @@ var DesktopLeaveRoom = ({
|
|
345
345
|
const permissions = useHMSStore2(selectPermissions);
|
346
346
|
const { isStreamingOn } = useRecordingStreaming();
|
347
347
|
const showStream = screenType !== "hls_live_streaming" && isStreamingOn;
|
348
|
+
const showLeaveOptions = (permissions == null ? void 0 : permissions.hlsStreaming) && isStreamingOn || (permissions == null ? void 0 : permissions.endRoom);
|
348
349
|
useDropdownList({ open: open || showEndStreamAlert || showLeaveRoomAlert, name: "LeaveRoom" });
|
349
350
|
if (!permissions || !isConnected) {
|
350
351
|
return null;
|
351
352
|
}
|
352
|
-
return /* @__PURE__ */ React6.createElement(Fragment2, null,
|
353
|
+
return /* @__PURE__ */ React6.createElement(Fragment2, null, showLeaveOptions ? /* @__PURE__ */ React6.createElement(Flex, null, /* @__PURE__ */ React6.createElement(
|
353
354
|
LeaveIconButton,
|
354
355
|
{
|
355
356
|
key: "LeaveRoom",
|
@@ -358,9 +359,7 @@ var DesktopLeaveRoom = ({
|
|
358
359
|
borderTopRightRadius: 0,
|
359
360
|
borderBottomRightRadius: 0
|
360
361
|
},
|
361
|
-
onClick: () =>
|
362
|
-
leaveRoom({ endstream: false });
|
363
|
-
}
|
362
|
+
onClick: () => setShowLeaveRoomAlert(true)
|
364
363
|
},
|
365
364
|
/* @__PURE__ */ React6.createElement(Tooltip, { title: "Leave Room" }, /* @__PURE__ */ React6.createElement(Box, null, /* @__PURE__ */ React6.createElement(ExitIcon, { style: { transform: "rotate(180deg)" } })))
|
366
365
|
), /* @__PURE__ */ React6.createElement(Dropdown.Root, { open, onOpenChange: setOpen, modal: false }, /* @__PURE__ */ React6.createElement(
|
@@ -379,7 +378,7 @@ var DesktopLeaveRoom = ({
|
|
379
378
|
{
|
380
379
|
css: {
|
381
380
|
bg: "$surface_dim",
|
382
|
-
color: "$
|
381
|
+
color: "$on_surface_medium",
|
383
382
|
"&:hover": { bg: "$surface_default", color: "$on_surface_high" }
|
384
383
|
},
|
385
384
|
onClick: () => leaveRoom({ endstream: false }),
|
@@ -397,7 +396,7 @@ var DesktopLeaveRoom = ({
|
|
397
396
|
css: { p: 0 }
|
398
397
|
}
|
399
398
|
)
|
400
|
-
),
|
399
|
+
), /* @__PURE__ */ React6.createElement(
|
401
400
|
Dropdown.Item,
|
402
401
|
{
|
403
402
|
css: {
|
@@ -422,15 +421,11 @@ var DesktopLeaveRoom = ({
|
|
422
421
|
css: { p: 0 }
|
423
422
|
}
|
424
423
|
)
|
425
|
-
)
|
424
|
+
)))) : /* @__PURE__ */ React6.createElement(
|
426
425
|
LeaveIconButton,
|
427
426
|
{
|
428
427
|
onClick: () => {
|
429
|
-
|
430
|
-
setShowLeaveRoomAlert(true);
|
431
|
-
} else {
|
432
|
-
leaveRoom({ endstream: false });
|
433
|
-
}
|
428
|
+
setShowLeaveRoomAlert(true);
|
434
429
|
},
|
435
430
|
key: "LeaveRoom",
|
436
431
|
"data-testid": "leave_room_btn"
|
@@ -444,7 +439,7 @@ var DesktopLeaveRoom = ({
|
|
444
439
|
isStreamingOn,
|
445
440
|
isModal: true
|
446
441
|
}
|
447
|
-
)))),
|
442
|
+
)))), /* @__PURE__ */ React6.createElement(Dialog.Root, { open: showLeaveRoomAlert, modal: false }, /* @__PURE__ */ React6.createElement(Dialog.Portal, null, /* @__PURE__ */ React6.createElement(Dialog.Overlay, null), /* @__PURE__ */ React6.createElement(Dialog.Content, { css: { w: "min(420px, 90%)", p: "$8", bg: "$surface_dim" } }, /* @__PURE__ */ React6.createElement(LeaveSessionContent, { setShowLeaveRoomAlert, leaveRoom, isModal: true })))));
|
448
443
|
};
|
449
444
|
|
450
445
|
// src/Prebuilt/components/Leave/MwebLeaveRoom.tsx
|
@@ -463,11 +458,12 @@ var MwebLeaveRoom = ({
|
|
463
458
|
const permissions = useHMSStore3(selectPermissions2);
|
464
459
|
const { isStreamingOn } = useRecordingStreaming2();
|
465
460
|
const showStream = screenType !== "hls_live_streaming" && isStreamingOn;
|
461
|
+
const showLeaveOptions = (permissions == null ? void 0 : permissions.hlsStreaming) && isStreamingOn || (permissions == null ? void 0 : permissions.endRoom);
|
466
462
|
useDropdownList({ open, name: "LeaveRoom" });
|
467
463
|
if (!permissions || !isConnected) {
|
468
464
|
return null;
|
469
465
|
}
|
470
|
-
return /* @__PURE__ */ React7.createElement(Fragment3, null,
|
466
|
+
return /* @__PURE__ */ React7.createElement(Fragment3, null, showLeaveOptions ? /* @__PURE__ */ React7.createElement(Sheet.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React7.createElement(Sheet.Trigger, { asChild: true }, /* @__PURE__ */ React7.createElement(
|
471
467
|
LeaveIconButton,
|
472
468
|
{
|
473
469
|
key: "LeaveRoom",
|
@@ -489,7 +485,7 @@ var MwebLeaveRoom = ({
|
|
489
485
|
onClick: () => leaveRoom({ endstream: false }),
|
490
486
|
css: { pt: 0, mt: "$10", color: "$on_surface_low", "&:hover": { color: "$on_surface_high" } }
|
491
487
|
}
|
492
|
-
),
|
488
|
+
), /* @__PURE__ */ React7.createElement(
|
493
489
|
LeaveCard,
|
494
490
|
{
|
495
491
|
title: showStream ? "End Stream" : "End Session",
|
@@ -503,28 +499,14 @@ var MwebLeaveRoom = ({
|
|
503
499
|
setShowEndStreamAlert(true);
|
504
500
|
}
|
505
501
|
}
|
506
|
-
) : null)) : /* @__PURE__ */ React7.createElement(
|
507
|
-
LeaveIconButton,
|
508
|
-
{
|
509
|
-
key: "LeaveRoom",
|
510
|
-
"data-testid": "leave_room_btn",
|
511
|
-
onClick: () => {
|
512
|
-
if (screenType === "hls_live_streaming") {
|
513
|
-
setShowLeaveRoomAlert(true);
|
514
|
-
} else {
|
515
|
-
leaveRoom({ endstream: false });
|
516
|
-
}
|
517
|
-
}
|
518
|
-
},
|
519
|
-
/* @__PURE__ */ React7.createElement(Tooltip, { title: "Leave Room" }, /* @__PURE__ */ React7.createElement(Box, null, /* @__PURE__ */ React7.createElement(ExitIcon2, { style: { transform: "rotate(180deg)" } })))
|
520
|
-
), /* @__PURE__ */ React7.createElement(Sheet.Root, { open: showEndStreamAlert, onOpenChange: setShowEndStreamAlert }, /* @__PURE__ */ React7.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$10", pb: "$12" } }, /* @__PURE__ */ React7.createElement(
|
502
|
+
))) : /* @__PURE__ */ React7.createElement(LeaveIconButton, { key: "LeaveRoom", "data-testid": "leave_room_btn", onClick: () => setShowLeaveRoomAlert(true) }, /* @__PURE__ */ React7.createElement(Tooltip, { title: "Leave Room" }, /* @__PURE__ */ React7.createElement(Box, null, /* @__PURE__ */ React7.createElement(ExitIcon2, { style: { transform: "rotate(180deg)" } })))), /* @__PURE__ */ React7.createElement(Sheet.Root, { open: showEndStreamAlert, onOpenChange: setShowEndStreamAlert }, /* @__PURE__ */ React7.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$10", pb: "$12" } }, /* @__PURE__ */ React7.createElement(
|
521
503
|
EndSessionContent,
|
522
504
|
{
|
523
505
|
setShowEndStreamAlert,
|
524
506
|
leaveRoom: isStreamingOn ? leaveRoom : endRoom,
|
525
507
|
isStreamingOn
|
526
508
|
}
|
527
|
-
))),
|
509
|
+
))), /* @__PURE__ */ React7.createElement(Sheet.Root, { open: showLeaveRoomAlert, onOpenChange: setShowLeaveRoomAlert }, /* @__PURE__ */ React7.createElement(Sheet.Content, { css: { bg: "$surface_dim", p: "$10", pb: "$12" } }, /* @__PURE__ */ React7.createElement(LeaveSessionContent, { setShowLeaveRoomAlert, leaveRoom }))));
|
528
510
|
};
|
529
511
|
|
530
512
|
// src/Prebuilt/components/Leave/LeaveRoom.tsx
|
@@ -1881,6 +1863,7 @@ import {
|
|
1881
1863
|
selectIsConnectedToRoom as selectIsConnectedToRoom5,
|
1882
1864
|
selectPeerCount,
|
1883
1865
|
selectPermissions as selectPermissions6,
|
1866
|
+
useAVToggle,
|
1884
1867
|
useHMSActions as useHMSActions9,
|
1885
1868
|
useHMSStore as useHMSStore11,
|
1886
1869
|
useRecordingStreaming as useRecordingStreaming5
|
@@ -1925,6 +1908,8 @@ var MwebOptions = ({
|
|
1925
1908
|
const peerCount = useHMSStore11(selectPeerCount);
|
1926
1909
|
const emojiCardRef = useRef5(null);
|
1927
1910
|
const { isBRBOn, toggleBRB, isHandRaised, toggleHandRaise } = useMyMetadata();
|
1911
|
+
const { toggleAudio, toggleVideo } = useAVToggle();
|
1912
|
+
const noAVPermissions = !(toggleAudio || toggleVideo);
|
1928
1913
|
useDropdownList({ open: openModals.size > 0 || openOptionsSheet || openSettingsSheet, name: "MoreSettings" });
|
1929
1914
|
const updateState = (modalName, value) => {
|
1930
1915
|
setOpenModals((modals) => {
|
@@ -1981,7 +1966,7 @@ var MwebOptions = ({
|
|
1981
1966
|
/* @__PURE__ */ React22.createElement(PeopleIcon, null),
|
1982
1967
|
/* @__PURE__ */ React22.createElement(ActionTile.Title, null, "Participants")
|
1983
1968
|
),
|
1984
|
-
|
1969
|
+
!noAVPermissions ? /* @__PURE__ */ React22.createElement(
|
1985
1970
|
ActionTile.Root,
|
1986
1971
|
{
|
1987
1972
|
active: isHandRaised,
|
@@ -2079,7 +2064,6 @@ var MwebOptions = ({
|
|
2079
2064
|
), showEmojiCard && /* @__PURE__ */ React22.createElement(
|
2080
2065
|
Box,
|
2081
2066
|
{
|
2082
|
-
onClick: () => setShowEmojiCard(false),
|
2083
2067
|
ref: emojiCardRef,
|
2084
2068
|
css: {
|
2085
2069
|
maxWidth: "100%",
|
@@ -2128,19 +2112,17 @@ var MoreSettings = ({
|
|
2128
2112
|
|
2129
2113
|
// src/Prebuilt/components/RaiseHand.jsx
|
2130
2114
|
import React24 from "react";
|
2131
|
-
import { selectLocalPeer, selectPeerMetadata, useHMSStore as useHMSStore12 } from "@100mslive/react-sdk";
|
2132
2115
|
import { HandIcon as HandIcon2 } from "@100mslive/react-icons";
|
2133
2116
|
var RaiseHand = () => {
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
return /* @__PURE__ */ React24.createElement(Tooltip, { title: isHandRaised ? "Lower hand" : "Raise hand" }, /* @__PURE__ */ React24.createElement(IconButton_default, { active: !isHandRaised, onClick: toggleHandRaise }, /* @__PURE__ */ React24.createElement(HandIcon2, null)));
|
2117
|
+
const { isHandRaised, toggleHandRaise } = useMyMetadata();
|
2118
|
+
return /* @__PURE__ */ React24.createElement(Tooltip, { title: isHandRaised ? "Lower hand" : "Raise hand" }, /* @__PURE__ */ React24.createElement(IconButton_default, { active: !isHandRaised, onClick: () => __async(void 0, null, function* () {
|
2119
|
+
return yield toggleHandRaise();
|
2120
|
+
}) }, /* @__PURE__ */ React24.createElement(HandIcon2, null)));
|
2139
2121
|
};
|
2140
2122
|
|
2141
2123
|
// src/Prebuilt/components/ScreenShareToggle.jsx
|
2142
2124
|
import React31, { Fragment as Fragment6 } from "react";
|
2143
|
-
import { selectIsAllowedToPublish, useHMSStore as
|
2125
|
+
import { selectIsAllowedToPublish, useHMSStore as useHMSStore12, useScreenShare as useScreenShare2 } from "@100mslive/react-sdk";
|
2144
2126
|
import { ShareScreenIcon } from "@100mslive/react-icons";
|
2145
2127
|
|
2146
2128
|
// src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx
|
@@ -2622,7 +2604,7 @@ function ShareScreenOptions() {
|
|
2622
2604
|
|
2623
2605
|
// src/Prebuilt/components/ScreenShareToggle.jsx
|
2624
2606
|
var ScreenshareToggle = ({ css = {} }) => {
|
2625
|
-
const isAllowedToPublish =
|
2607
|
+
const isAllowedToPublish = useHMSStore12(selectIsAllowedToPublish);
|
2626
2608
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
2627
2609
|
const { amIScreenSharing, screenShareVideoTrackId: video, toggleScreenShare } = useScreenShare2();
|
2628
2610
|
const isVideoScreenshare = amIScreenSharing && !!video;
|
@@ -2647,10 +2629,10 @@ var ScreenshareToggle = ({ css = {} }) => {
|
|
2647
2629
|
|
2648
2630
|
// src/Prebuilt/components/Footer/ChatToggle.tsx
|
2649
2631
|
import React32 from "react";
|
2650
|
-
import { selectUnreadHMSMessagesCount, useHMSStore as
|
2632
|
+
import { selectUnreadHMSMessagesCount, useHMSStore as useHMSStore13 } from "@100mslive/react-sdk";
|
2651
2633
|
import { ChatIcon, ChatUnreadIcon } from "@100mslive/react-icons";
|
2652
2634
|
var ChatToggle = () => {
|
2653
|
-
const countUnreadMessages =
|
2635
|
+
const countUnreadMessages = useHMSStore13(selectUnreadHMSMessagesCount);
|
2654
2636
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
2655
2637
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
2656
2638
|
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,14 +2642,15 @@ var ChatToggle = () => {
|
|
2660
2642
|
import React35, { Fragment as Fragment7, useCallback as useCallback6, useEffect as useEffect5, useState as useState18 } from "react";
|
2661
2643
|
import { useDebounce, useMedia as useMedia4 } from "react-use";
|
2662
2644
|
import {
|
2645
|
+
selectHandRaisedPeers,
|
2646
|
+
selectHasPeerHandRaised,
|
2663
2647
|
selectIsPeerAudioEnabled,
|
2664
2648
|
selectLocalPeerID as selectLocalPeerID4,
|
2665
2649
|
selectPeerCount as selectPeerCount2,
|
2666
|
-
selectPeerMetadata
|
2667
|
-
selectPeersByCondition as selectPeersByCondition2,
|
2650
|
+
selectPeerMetadata,
|
2668
2651
|
selectPermissions as selectPermissions8,
|
2669
2652
|
useHMSActions as useHMSActions11,
|
2670
|
-
useHMSStore as
|
2653
|
+
useHMSStore as useHMSStore15
|
2671
2654
|
} from "@100mslive/react-sdk";
|
2672
2655
|
import {
|
2673
2656
|
ChangeRoleIcon as ChangeRoleIcon2,
|
@@ -2686,7 +2669,7 @@ import { FixedSizeList } from "react-window";
|
|
2686
2669
|
|
2687
2670
|
// src/Prebuilt/components/Footer/RoleOptions.tsx
|
2688
2671
|
import React33, { useState as useState17 } from "react";
|
2689
|
-
import { selectPermissions as selectPermissions7, useHMSActions as useHMSActions10, useHMSStore as
|
2672
|
+
import { selectPermissions as selectPermissions7, useHMSActions as useHMSActions10, useHMSStore as useHMSStore14, useHMSVanillaStore as useHMSVanillaStore2 } from "@100mslive/react-sdk";
|
2690
2673
|
import {
|
2691
2674
|
MicOffIcon as MicOffIcon2,
|
2692
2675
|
MicOnIcon,
|
@@ -2700,7 +2683,7 @@ var dropdownItemCSS = { backgroundColor: "$surface_default", gap: "$4", p: "$8"
|
|
2700
2683
|
var optionTextCSS = { fontWeight: "$semiBold", color: "$on_surface_high", textTransform: "none" };
|
2701
2684
|
var RoleOptions = ({ roleName, peerList }) => {
|
2702
2685
|
const [openOptions, setOpenOptions] = useState17(false);
|
2703
|
-
const permissions =
|
2686
|
+
const permissions = useHMSStore14(selectPermissions7);
|
2704
2687
|
const hmsActions = useHMSActions10();
|
2705
2688
|
const { elements } = useRoomLayoutConferencingScreen();
|
2706
2689
|
const { on_stage_role, off_stage_roles = [] } = (elements == null ? void 0 : elements.on_stage_exp) || {};
|
@@ -2873,10 +2856,7 @@ var ParticipantList = () => {
|
|
2873
2856
|
const [filter, setFilter] = useState18();
|
2874
2857
|
const { participants, isConnected, peerCount } = useParticipants(filter);
|
2875
2858
|
const peersOrderedByRoles = {};
|
2876
|
-
const handRaisedPeers =
|
2877
|
-
var _a;
|
2878
|
-
return (_a = JSON.parse(peer.metadata || "{}")) == null ? void 0 : _a.isHandRaised;
|
2879
|
-
}));
|
2859
|
+
const handRaisedPeers = useHMSStore15(selectHandRaisedPeers);
|
2880
2860
|
participants.forEach((participant) => {
|
2881
2861
|
if (peersOrderedByRoles[participant.roleName] === void 0) {
|
2882
2862
|
peersOrderedByRoles[participant.roleName] = [];
|
@@ -2906,7 +2886,7 @@ var ParticipantList = () => {
|
|
2906
2886
|
)));
|
2907
2887
|
};
|
2908
2888
|
var ParticipantCount = () => {
|
2909
|
-
const peerCount =
|
2889
|
+
const peerCount = useHMSStore15(selectPeerCount2);
|
2910
2890
|
const toggleSidepane = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
2911
2891
|
const isParticipantsOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
2912
2892
|
useEffect5(() => {
|
@@ -2934,7 +2914,7 @@ var ParticipantCount = () => {
|
|
2934
2914
|
"data-testid": "participant_list"
|
2935
2915
|
},
|
2936
2916
|
/* @__PURE__ */ React35.createElement(PeopleIcon2, null),
|
2937
|
-
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { mx: "$4", c: "inherit" } }, peerCount)
|
2917
|
+
/* @__PURE__ */ React35.createElement(Text, { variant: "sm", css: { mx: "$4", c: "inherit" } }, getFormattedCount(peerCount))
|
2938
2918
|
);
|
2939
2919
|
};
|
2940
2920
|
var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter, handRaisedList = [] }) => {
|
@@ -2974,7 +2954,7 @@ var VirtualizedParticipants = ({ peersOrderedByRoles = {}, isConnected, filter,
|
|
2974
2954
|
);
|
2975
2955
|
};
|
2976
2956
|
var Participant = ({ peer, isConnected }) => {
|
2977
|
-
const localPeerId =
|
2957
|
+
const localPeerId = useHMSStore15(selectLocalPeerID4);
|
2978
2958
|
return /* @__PURE__ */ React35.createElement(
|
2979
2959
|
Flex,
|
2980
2960
|
{
|
@@ -2995,11 +2975,11 @@ var Participant = ({ peer, isConnected }) => {
|
|
2995
2975
|
);
|
2996
2976
|
};
|
2997
2977
|
var ParticipantActions = React35.memo(({ peerId, role, isLocal }) => {
|
2998
|
-
var _a
|
2999
|
-
const isHandRaised = (
|
3000
|
-
const canChangeRole = (
|
2978
|
+
var _a;
|
2979
|
+
const isHandRaised = useHMSStore15(selectHasPeerHandRaised(peerId));
|
2980
|
+
const canChangeRole = (_a = useHMSStore15(selectPermissions8)) == null ? void 0 : _a.changeRole;
|
3001
2981
|
const shouldShowMoreActions = canChangeRole;
|
3002
|
-
const isAudioMuted = !
|
2982
|
+
const isAudioMuted = !useHMSStore15(selectIsPeerAudioEnabled(peerId));
|
3003
2983
|
return /* @__PURE__ */ React35.createElement(
|
3004
2984
|
Flex,
|
3005
2985
|
{
|
@@ -3028,13 +3008,13 @@ var ParticipantActions = React35.memo(({ peerId, role, isLocal }) => {
|
|
3028
3008
|
},
|
3029
3009
|
/* @__PURE__ */ React35.createElement(MicOffIcon3, { height: 19, width: 19 })
|
3030
3010
|
) : null,
|
3031
|
-
shouldShowMoreActions && !
|
3011
|
+
shouldShowMoreActions && !isLocal ? /* @__PURE__ */ React35.createElement(ParticipantMoreActions, { peerId, role }) : null
|
3032
3012
|
);
|
3033
3013
|
});
|
3034
3014
|
var ParticipantMoreActions = ({ peerId, role }) => {
|
3035
3015
|
var _a;
|
3036
3016
|
const hmsActions = useHMSActions11();
|
3037
|
-
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } =
|
3017
|
+
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } = useHMSStore15(selectPermissions8);
|
3038
3018
|
const { elements } = useRoomLayoutConferencingScreen();
|
3039
3019
|
const {
|
3040
3020
|
bring_to_stage_label,
|
@@ -3044,8 +3024,8 @@ var ParticipantMoreActions = ({ peerId, role }) => {
|
|
3044
3024
|
} = elements.on_stage_exp || {};
|
3045
3025
|
const isInStage = role === on_stage_role;
|
3046
3026
|
const shouldShowStageRoleChange = canChangeRole && (isInStage && remove_from_stage_label || (off_stage_roles == null ? void 0 : off_stage_roles.includes(role)) && bring_to_stage_label);
|
3047
|
-
const prevRole = (_a =
|
3048
|
-
const localPeerId =
|
3027
|
+
const prevRole = (_a = useHMSStore15(selectPeerMetadata(peerId))) == null ? void 0 : _a.prevRole;
|
3028
|
+
const localPeerId = useHMSStore15(selectLocalPeerID4);
|
3049
3029
|
const isLocal = localPeerId === peerId;
|
3050
3030
|
const [open, setOpen] = useState18(false);
|
3051
3031
|
const handleStageAction = () => __async(void 0, null, function* () {
|
@@ -3121,7 +3101,7 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3121
3101
|
{
|
3122
3102
|
type: "text",
|
3123
3103
|
placeholder: placeholder || "Search for participants",
|
3124
|
-
css: { w: "100%", p: "$6", pl: "$
|
3104
|
+
css: { w: "100%", p: "$6", pl: "$16", mr: "$4", bg: inSidePane ? "$surface_default" : "$surface_dim" },
|
3125
3105
|
value,
|
3126
3106
|
onKeyDown: (event) => {
|
3127
3107
|
event.stopPropagation();
|
@@ -3137,7 +3117,7 @@ var ParticipantSearch = ({ onSearch, placeholder, inSidePane = false }) => {
|
|
3137
3117
|
};
|
3138
3118
|
|
3139
3119
|
// src/Prebuilt/components/Footer/Footer.tsx
|
3140
|
-
var VirtualBackground = React36.lazy(() => import("./VirtualBackground-
|
3120
|
+
var VirtualBackground = React36.lazy(() => import("./VirtualBackground-3TI5NA4V.js"));
|
3141
3121
|
var Footer2 = ({
|
3142
3122
|
screenType,
|
3143
3123
|
elements
|
@@ -3146,6 +3126,8 @@ var Footer2 = ({
|
|
3146
3126
|
const isMobile = useMedia5(config.media.md);
|
3147
3127
|
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay);
|
3148
3128
|
const openByDefault = ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.initial_state) === Chat_ChatState.CHAT_STATE_OPEN;
|
3129
|
+
const { toggleAudio, toggleVideo } = useAVToggle2();
|
3130
|
+
const noAVPermissions = !(toggleAudio || toggleVideo);
|
3149
3131
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
3150
3132
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
3151
3133
|
useEffect6(() => {
|
@@ -3192,7 +3174,7 @@ var Footer2 = ({
|
|
3192
3174
|
}
|
3193
3175
|
}
|
3194
3176
|
},
|
3195
|
-
isMobile ? /* @__PURE__ */ React36.createElement(React36.Fragment, null,
|
3177
|
+
isMobile ? /* @__PURE__ */ React36.createElement(React36.Fragment, null, noAVPermissions ? /* @__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 }))
|
3196
3178
|
),
|
3197
3179
|
/* @__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 }))
|
3198
3180
|
);
|
@@ -3200,9 +3182,9 @@ var Footer2 = ({
|
|
3200
3182
|
|
3201
3183
|
// src/Prebuilt/components/Notifications/HLSFailureModal.jsx
|
3202
3184
|
import React37, { useCallback as useCallback7, useState as useState19 } from "react";
|
3203
|
-
import { selectHLSState as selectHLSState2, useHMSActions as useHMSActions12, useHMSStore as
|
3185
|
+
import { selectHLSState as selectHLSState2, useHMSActions as useHMSActions12, useHMSStore as useHMSStore16 } from "@100mslive/react-sdk";
|
3204
3186
|
function HLSFailureModal() {
|
3205
|
-
const { hlsError } =
|
3187
|
+
const { hlsError } = useHMSStore16(selectHLSState2).error || false;
|
3206
3188
|
const [openModal, setOpenModal] = useState19(!!hlsError);
|
3207
3189
|
const hmsActions = useHMSActions12();
|
3208
3190
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
@@ -3247,29 +3229,128 @@ function HLSFailureModal() {
|
|
3247
3229
|
) : null;
|
3248
3230
|
}
|
3249
3231
|
|
3232
|
+
// src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx
|
3233
|
+
import React39, { useEffect as useEffect7 } from "react";
|
3234
|
+
import {
|
3235
|
+
selectLocalPeerName,
|
3236
|
+
selectLocalPeerRoleName,
|
3237
|
+
selectRoleChangeRequest,
|
3238
|
+
useCustomEvent as useCustomEvent2,
|
3239
|
+
useHMSActions as useHMSActions13,
|
3240
|
+
useHMSStore as useHMSStore17
|
3241
|
+
} from "@100mslive/react-sdk";
|
3242
|
+
|
3243
|
+
// src/Prebuilt/components/RoleChangeRequest/RequestPrompt.tsx
|
3244
|
+
import React38 from "react";
|
3245
|
+
import { useMedia as useMedia6 } from "react-use";
|
3246
|
+
var RequestPrompt = ({
|
3247
|
+
open = true,
|
3248
|
+
onOpenChange,
|
3249
|
+
title,
|
3250
|
+
body,
|
3251
|
+
actionText = "Accept",
|
3252
|
+
onAction
|
3253
|
+
}) => {
|
3254
|
+
const isMobile = useMedia6(config.media.md);
|
3255
|
+
if (isMobile) {
|
3256
|
+
return /* @__PURE__ */ React38.createElement(Sheet.Root, { open, onOpenChange }, /* @__PURE__ */ React38.createElement(Sheet.Content, { css: { py: "$8" } }, /* @__PURE__ */ React38.createElement(Text, { css: { fontWeight: "$semiBold", c: "$on_surface_high", "@md": { px: "$8" } } }, title), body, /* @__PURE__ */ React38.createElement(RequestActions, { actionText, onAction })));
|
3257
|
+
}
|
3258
|
+
return /* @__PURE__ */ React38.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React38.createElement(Dialog.Portal, null, /* @__PURE__ */ React38.createElement(Dialog.Overlay, null), /* @__PURE__ */ React38.createElement(Dialog.Content, { css: { p: "$10" } }, /* @__PURE__ */ React38.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md", justifyContent: "center" } }, /* @__PURE__ */ React38.createElement(Text, { variant: "h6" }, title)), /* @__PURE__ */ React38.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React38.createElement(RequestActions, { actionText, onAction }))));
|
3259
|
+
};
|
3260
|
+
var RequestActions = ({ onAction, actionText }) => /* @__PURE__ */ React38.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md", "@md": { mt: "$8", px: "$8" } } }, /* @__PURE__ */ React38.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React38.createElement(Dialog.Close, { css: { width: "100%" } }, /* @__PURE__ */ React38.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%" } }, "Decline"))), /* @__PURE__ */ React38.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React38.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction }, actionText)));
|
3261
|
+
|
3262
|
+
// src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx
|
3263
|
+
var RoleChangeRequestModal = () => {
|
3264
|
+
const hmsActions = useHMSActions13();
|
3265
|
+
const { updateMetaData } = useMyMetadata();
|
3266
|
+
const currentRole = useHMSStore17(selectLocalPeerRoleName);
|
3267
|
+
const roleChangeRequest = useHMSStore17(selectRoleChangeRequest);
|
3268
|
+
const name = useHMSStore17(selectLocalPeerName);
|
3269
|
+
const { sendEvent } = useCustomEvent2({ type: ROLE_CHANGE_DECLINED });
|
3270
|
+
useEffect7(() => {
|
3271
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
3272
|
+
return;
|
3273
|
+
}
|
3274
|
+
(() => __async(void 0, null, function* () {
|
3275
|
+
yield hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
3276
|
+
}))();
|
3277
|
+
}, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
|
3278
|
+
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
3279
|
+
return null;
|
3280
|
+
}
|
3281
|
+
const body = /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(
|
3282
|
+
Text,
|
3283
|
+
{
|
3284
|
+
variant: "xs",
|
3285
|
+
css: {
|
3286
|
+
c: "$on_surface_medium",
|
3287
|
+
textAlign: "center",
|
3288
|
+
"@md": { textAlign: "left", borderBottom: "1px solid $border_bright", pb: "$4", px: "$8" }
|
3289
|
+
}
|
3290
|
+
},
|
3291
|
+
"Setup your audio and video before joining"
|
3292
|
+
), /* @__PURE__ */ React39.createElement(
|
3293
|
+
Flex,
|
3294
|
+
{
|
3295
|
+
align: "center",
|
3296
|
+
justify: "center",
|
3297
|
+
css: {
|
3298
|
+
"@sm": { width: "100%" },
|
3299
|
+
flexDirection: "column",
|
3300
|
+
mt: "$6",
|
3301
|
+
"@md": { px: "$8" }
|
3302
|
+
}
|
3303
|
+
},
|
3304
|
+
/* @__PURE__ */ React39.createElement(PreviewTile, { name: name || "" }),
|
3305
|
+
/* @__PURE__ */ React39.createElement(PreviewControls, { hideSettings: true })
|
3306
|
+
));
|
3307
|
+
return /* @__PURE__ */ React39.createElement(
|
3308
|
+
RequestPrompt,
|
3309
|
+
{
|
3310
|
+
title: "You're invited to join the stage",
|
3311
|
+
onOpenChange: (value) => __async(void 0, null, function* () {
|
3312
|
+
var _a;
|
3313
|
+
if (!value) {
|
3314
|
+
hmsActions.rejectChangeRole(roleChangeRequest);
|
3315
|
+
sendEvent(__spreadProps(__spreadValues({}, roleChangeRequest), { peerName: name }), { peerId: (_a = roleChangeRequest.requestedBy) == null ? void 0 : _a.id });
|
3316
|
+
yield hmsActions.cancelMidCallPreview();
|
3317
|
+
yield hmsActions.lowerLocalPeerHand();
|
3318
|
+
}
|
3319
|
+
}),
|
3320
|
+
body,
|
3321
|
+
onAction: () => __async(void 0, null, function* () {
|
3322
|
+
yield hmsActions.acceptChangeRole(roleChangeRequest);
|
3323
|
+
yield updateMetaData({ prevRole: currentRole });
|
3324
|
+
yield hmsActions.lowerLocalPeerHand();
|
3325
|
+
}),
|
3326
|
+
actionText: "Accept"
|
3327
|
+
}
|
3328
|
+
);
|
3329
|
+
};
|
3330
|
+
|
3250
3331
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
3251
|
-
import
|
3252
|
-
import { selectIsConnectedToRoom as selectIsConnectedToRoom6, selectLocalPeerRoleName as
|
3332
|
+
import React62, { Suspense as Suspense2, useEffect as useEffect24 } from "react";
|
3333
|
+
import { selectIsConnectedToRoom as selectIsConnectedToRoom6, selectLocalPeerRoleName as selectLocalPeerRoleName3, useHMSActions as useHMSActions21, useHMSStore as useHMSStore34 } from "@100mslive/react-sdk";
|
3253
3334
|
|
3254
3335
|
// src/Prebuilt/components/VideoLayouts/GridLayout.tsx
|
3255
|
-
import
|
3336
|
+
import React51, { useEffect as useEffect15, useMemo as useMemo6, useState as useState26 } from "react";
|
3256
3337
|
import { selectPeers as selectPeers2, selectPeerScreenSharing, useHMSStore as useHMSStore23, useHMSVanillaStore as useHMSVanillaStore4 } from "@100mslive/react-sdk";
|
3257
3338
|
|
3258
3339
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3259
|
-
import
|
3260
|
-
import { useMedia as
|
3261
|
-
import { selectLocalPeer as
|
3340
|
+
import React44, { useEffect as useEffect11, useMemo as useMemo3, useState as useState21 } from "react";
|
3341
|
+
import { useMedia as useMedia9 } from "react-use";
|
3342
|
+
import { selectLocalPeer as selectLocalPeer2, useHMSStore as useHMSStore19 } from "@100mslive/react-sdk";
|
3262
3343
|
|
3263
3344
|
// src/Prebuilt/components/InsetTile.tsx
|
3264
|
-
import
|
3345
|
+
import React41, { useEffect as useEffect8, useRef as useRef6 } from "react";
|
3265
3346
|
import Draggable from "react-draggable";
|
3266
|
-
import { useMedia as
|
3267
|
-
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer
|
3347
|
+
import { useMedia as useMedia7 } from "react-use";
|
3348
|
+
import { selectIsAllowedToPublish as selectIsAllowedToPublish2, selectLocalPeer, selectVideoTrackByID, useHMSStore as useHMSStore18 } from "@100mslive/react-sdk";
|
3268
3349
|
import { ExpandIcon as ExpandIcon2 } from "@100mslive/react-icons";
|
3269
3350
|
|
3270
3351
|
// src/Prebuilt/components/hooks/useVideoTileLayout.ts
|
3271
|
-
import
|
3272
|
-
var VideoTileContext =
|
3352
|
+
import React40, { useContext } from "react";
|
3353
|
+
var VideoTileContext = React40.createContext({
|
3273
3354
|
enableSpotlightingPeer: true,
|
3274
3355
|
hideParticipantNameOnTile: false,
|
3275
3356
|
roundedVideoTile: true,
|
@@ -3285,14 +3366,14 @@ var useVideoTileContext = () => {
|
|
3285
3366
|
|
3286
3367
|
// src/Prebuilt/components/InsetTile.tsx
|
3287
3368
|
var MinimisedTile = ({ setMinimised }) => {
|
3288
|
-
return /* @__PURE__ */
|
3369
|
+
return /* @__PURE__ */ React41.createElement(Flex, { align: "center", css: { gap: "$6", r: "$1", bg: "$surface_default", p: "$4", color: "$on_surface_high" } }, /* @__PURE__ */ React41.createElement(AudioVideoToggle, { hideOptions: true }), /* @__PURE__ */ React41.createElement(Text, null, "You"), /* @__PURE__ */ React41.createElement(
|
3289
3370
|
IconButton_default,
|
3290
3371
|
{
|
3291
3372
|
className: "__cancel-drag-event",
|
3292
3373
|
onClick: () => setMinimised(false),
|
3293
3374
|
css: { bg: "transparent", border: "transparent" }
|
3294
3375
|
},
|
3295
|
-
/* @__PURE__ */
|
3376
|
+
/* @__PURE__ */ React41.createElement(ExpandIcon2, null)
|
3296
3377
|
));
|
3297
3378
|
};
|
3298
3379
|
var insetHeightPx = 180;
|
@@ -3300,9 +3381,9 @@ var insetMaxWidthPx = 240;
|
|
3300
3381
|
var defaultMobileAspectRatio = 9 / 16;
|
3301
3382
|
var desktopAspectRatio = 1 / defaultMobileAspectRatio;
|
3302
3383
|
var InsetTile = () => {
|
3303
|
-
const isMobile =
|
3304
|
-
const isLandscape =
|
3305
|
-
const localPeer = useHMSStore18(
|
3384
|
+
const isMobile = useMedia7(config.media.md);
|
3385
|
+
const isLandscape = useMedia7(config.media.ls);
|
3386
|
+
const localPeer = useHMSStore18(selectLocalPeer);
|
3306
3387
|
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
3307
3388
|
const videoTrack = useHMSStore18(selectVideoTrackByID(localPeer == null ? void 0 : localPeer.videoTrack));
|
3308
3389
|
const isAllowedToPublish = useHMSStore18(selectIsAllowedToPublish2);
|
@@ -3318,7 +3399,7 @@ var InsetTile = () => {
|
|
3318
3399
|
height = width / aspectRatio;
|
3319
3400
|
}
|
3320
3401
|
const nodeRef = useRef6(null);
|
3321
|
-
|
3402
|
+
useEffect8(() => {
|
3322
3403
|
const node = nodeRef.current;
|
3323
3404
|
if (!node || !window.ResizeObserver) {
|
3324
3405
|
return;
|
@@ -3339,7 +3420,7 @@ var InsetTile = () => {
|
|
3339
3420
|
if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {
|
3340
3421
|
return null;
|
3341
3422
|
}
|
3342
|
-
return /* @__PURE__ */
|
3423
|
+
return /* @__PURE__ */ React41.createElement(Draggable, { bounds: "parent", nodeRef, cancel: ".__cancel-drag-event" }, /* @__PURE__ */ React41.createElement(
|
3343
3424
|
Box,
|
3344
3425
|
{
|
3345
3426
|
ref: nodeRef,
|
@@ -3355,7 +3436,7 @@ var InsetTile = () => {
|
|
3355
3436
|
h: height
|
3356
3437
|
} : {})
|
3357
3438
|
},
|
3358
|
-
minimised ? /* @__PURE__ */
|
3439
|
+
minimised ? /* @__PURE__ */ React41.createElement(MinimisedTile, { setMinimised }) : /* @__PURE__ */ React41.createElement(
|
3359
3440
|
VideoTile_default,
|
3360
3441
|
__spreadProps(__spreadValues({
|
3361
3442
|
peerId: localPeer == null ? void 0 : localPeer.id,
|
@@ -3377,7 +3458,7 @@ var InsetTile = () => {
|
|
3377
3458
|
};
|
3378
3459
|
|
3379
3460
|
// src/Prebuilt/components/Pagination.tsx
|
3380
|
-
import
|
3461
|
+
import React42, { useEffect as useEffect9 } from "react";
|
3381
3462
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon as ChevronRightIcon2 } from "@100mslive/react-icons";
|
3382
3463
|
var Pagination = ({
|
3383
3464
|
page,
|
@@ -3394,7 +3475,7 @@ var Pagination = ({
|
|
3394
3475
|
e.stopPropagation();
|
3395
3476
|
onPageChange(Math.max(page - 1, 0));
|
3396
3477
|
};
|
3397
|
-
|
3478
|
+
useEffect9(() => {
|
3398
3479
|
if (page >= numPages) {
|
3399
3480
|
onPageChange(Math.max(0, numPages - 1));
|
3400
3481
|
}
|
@@ -3402,7 +3483,7 @@ var Pagination = ({
|
|
3402
3483
|
if (numPages <= 1) {
|
3403
3484
|
return null;
|
3404
3485
|
}
|
3405
|
-
return /* @__PURE__ */
|
3486
|
+
return /* @__PURE__ */ React42.createElement(StyledPagination.Root, { css: { flexShrink: 0 } }, /* @__PURE__ */ React42.createElement(StyledPagination.Chevron, { disabled: disableLeft, onClick: prevPage }, /* @__PURE__ */ React42.createElement(ChevronLeftIcon2, { width: 16, height: 16, style: { cursor: disableLeft ? "not-allowed" : "pointer" } })), numPages <= 5 ? /* @__PURE__ */ React42.createElement(StyledPagination.Dots, null, [...Array(numPages)].map((_, i) => /* @__PURE__ */ React42.createElement(
|
3406
3487
|
StyledPagination.Dot,
|
3407
3488
|
{
|
3408
3489
|
key: i,
|
@@ -3412,15 +3493,15 @@ var Pagination = ({
|
|
3412
3493
|
onPageChange(i);
|
3413
3494
|
}
|
3414
3495
|
}
|
3415
|
-
))) : null, /* @__PURE__ */
|
3496
|
+
))) : null, /* @__PURE__ */ React42.createElement(StyledPagination.Chevron, { disabled: disableRight, onClick: nextPage }, /* @__PURE__ */ React42.createElement(ChevronRightIcon2, { width: 16, height: 16, style: { cursor: disableRight ? "not-allowed" : "pointer" } })));
|
3416
3497
|
};
|
3417
3498
|
|
3418
3499
|
// src/Prebuilt/components/VideoLayouts/Grid.tsx
|
3419
|
-
import
|
3420
|
-
var Grid =
|
3500
|
+
import React43 from "react";
|
3501
|
+
var Grid = React43.forwardRef(
|
3421
3502
|
({ tiles, edgeToEdge }, ref) => {
|
3422
3503
|
const videoTileProps = useVideoTileContext();
|
3423
|
-
return /* @__PURE__ */
|
3504
|
+
return /* @__PURE__ */ React43.createElement(
|
3424
3505
|
Box,
|
3425
3506
|
{
|
3426
3507
|
ref,
|
@@ -3438,7 +3519,7 @@ var Grid = React41.forwardRef(
|
|
3438
3519
|
},
|
3439
3520
|
tiles == null ? void 0 : tiles.map((tile) => {
|
3440
3521
|
var _a, _b, _c, _d;
|
3441
|
-
return /* @__PURE__ */
|
3522
|
+
return /* @__PURE__ */ React43.createElement(
|
3442
3523
|
VideoTile_default,
|
3443
3524
|
__spreadValues({
|
3444
3525
|
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
@@ -3456,8 +3537,8 @@ var Grid = React41.forwardRef(
|
|
3456
3537
|
);
|
3457
3538
|
|
3458
3539
|
// src/Prebuilt/components/hooks/useTileLayout.tsx
|
3459
|
-
import { useEffect as
|
3460
|
-
import { useMeasure as useMeasure2, useMedia as
|
3540
|
+
import { useEffect as useEffect10, useMemo as useMemo2, useState as useState20 } from "react";
|
3541
|
+
import { useMeasure as useMeasure2, useMedia as useMedia8 } from "react-use";
|
3461
3542
|
import {
|
3462
3543
|
getPeersWithTiles,
|
3463
3544
|
selectTracksMap as selectTracksMap3,
|
@@ -3493,9 +3574,9 @@ var useTileLayout = ({
|
|
3493
3574
|
}) => {
|
3494
3575
|
const vanillaStore = useHMSVanillaStore3();
|
3495
3576
|
const [ref, { width, height }] = useMeasure2();
|
3496
|
-
const isMobile =
|
3577
|
+
const isMobile = useMedia8(config.media.lg);
|
3497
3578
|
const [pagesWithTiles, setPagesWithTiles] = useState20([]);
|
3498
|
-
|
3579
|
+
useEffect10(() => {
|
3499
3580
|
if (width === 0 || height === 0) {
|
3500
3581
|
return;
|
3501
3582
|
}
|
@@ -3562,8 +3643,8 @@ var useTileLayout = ({
|
|
3562
3643
|
// src/Prebuilt/components/VideoLayouts/EqualProminence.tsx
|
3563
3644
|
function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSize, edgeToEdge }) {
|
3564
3645
|
var _a;
|
3565
|
-
const localPeer = useHMSStore19(
|
3566
|
-
const isMobile =
|
3646
|
+
const localPeer = useHMSStore19(selectLocalPeer2);
|
3647
|
+
const isMobile = useMedia9(config.media.md);
|
3567
3648
|
let maxTileCount = useUISettings(UI_SETTINGS.maxTileCount);
|
3568
3649
|
maxTileCount = isMobile ? Math.min(maxTileCount, 6) : maxTileCount;
|
3569
3650
|
let pageList = usePagesWithTiles({
|
@@ -3585,12 +3666,12 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3585
3666
|
});
|
3586
3667
|
const [page, setPage] = useState21(0);
|
3587
3668
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3588
|
-
|
3669
|
+
useEffect11(() => {
|
3589
3670
|
if (pageSize > 0) {
|
3590
3671
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3591
3672
|
}
|
3592
3673
|
}, [pageSize, onPageSize]);
|
3593
|
-
return /* @__PURE__ */
|
3674
|
+
return /* @__PURE__ */ React44.createElement(Flex, { direction: "column", css: { flex: "1 1 0", h: "100%", position: "relative", minWidth: 0 } }, /* @__PURE__ */ React44.createElement(Grid, { tiles: pagesWithTiles[page], ref, edgeToEdge }), !edgeToEdge && /* @__PURE__ */ React44.createElement(
|
3594
3675
|
Pagination,
|
3595
3676
|
{
|
3596
3677
|
page,
|
@@ -3600,20 +3681,20 @@ function EqualProminence({ isInsetEnabled = false, peers, onPageChange, onPageSi
|
|
3600
3681
|
},
|
3601
3682
|
numPages: pagesWithTiles.length
|
3602
3683
|
}
|
3603
|
-
), isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== (localPeer == null ? void 0 : localPeer.id) && /* @__PURE__ */
|
3684
|
+
), isInsetEnabled && pageList.length > 0 && pageList[0][0].peer.id !== (localPeer == null ? void 0 : localPeer.id) && /* @__PURE__ */ React44.createElement(InsetTile, null));
|
3604
3685
|
}
|
3605
3686
|
|
3606
3687
|
// src/Prebuilt/components/VideoLayouts/RoleProminence.tsx
|
3607
|
-
import
|
3608
|
-
import { selectLocalPeer as
|
3688
|
+
import React47, { useEffect as useEffect13, useState as useState23 } from "react";
|
3689
|
+
import { selectLocalPeer as selectLocalPeer3, useHMSStore as useHMSStore20 } from "@100mslive/react-sdk";
|
3609
3690
|
|
3610
3691
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3611
|
-
import
|
3612
|
-
import { useMedia as
|
3692
|
+
import React46, { useEffect as useEffect12, useState as useState22 } from "react";
|
3693
|
+
import { useMedia as useMedia10 } from "react-use";
|
3613
3694
|
|
3614
3695
|
// src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx
|
3615
|
-
import
|
3616
|
-
var Root = ({ children, edgeToEdge }) => /* @__PURE__ */
|
3696
|
+
import React45 from "react";
|
3697
|
+
var Root = ({ children, edgeToEdge }) => /* @__PURE__ */ React45.createElement(
|
3617
3698
|
Flex,
|
3618
3699
|
{
|
3619
3700
|
direction: "column",
|
@@ -3622,7 +3703,7 @@ var Root = ({ children, edgeToEdge }) => /* @__PURE__ */ React43.createElement(
|
|
3622
3703
|
children
|
3623
3704
|
);
|
3624
3705
|
var ProminentSection = ({ children, css = {} }) => {
|
3625
|
-
return /* @__PURE__ */
|
3706
|
+
return /* @__PURE__ */ React45.createElement(Flex, { direction: "column", css: __spreadValues({ flex: "1 1 0", gap: "$2", minHeight: 0 }, css) }, children);
|
3626
3707
|
};
|
3627
3708
|
var SecondarySection = ({
|
3628
3709
|
tiles,
|
@@ -3633,12 +3714,12 @@ var SecondarySection = ({
|
|
3633
3714
|
if (!(tiles == null ? void 0 : tiles.length)) {
|
3634
3715
|
return null;
|
3635
3716
|
}
|
3636
|
-
return /* @__PURE__ */
|
3717
|
+
return /* @__PURE__ */ React45.createElement(
|
3637
3718
|
Box,
|
3638
3719
|
{
|
3639
3720
|
css: {
|
3640
3721
|
display: "grid",
|
3641
|
-
gridTemplateRows:
|
3722
|
+
gridTemplateRows: React45.Children.count(children) > 0 ? "136px auto" : "154px",
|
3642
3723
|
gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))`,
|
3643
3724
|
margin: "0 auto",
|
3644
3725
|
gap: "$2 $4",
|
@@ -3648,7 +3729,7 @@ var SecondarySection = ({
|
|
3648
3729
|
},
|
3649
3730
|
tiles.map((tile) => {
|
3650
3731
|
var _a, _b, _c, _d;
|
3651
|
-
return /* @__PURE__ */
|
3732
|
+
return /* @__PURE__ */ React45.createElement(
|
3652
3733
|
VideoTile_default,
|
3653
3734
|
__spreadValues({
|
3654
3735
|
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
@@ -3665,7 +3746,7 @@ var SecondarySection = ({
|
|
3665
3746
|
}, tileLayoutProps)
|
3666
3747
|
);
|
3667
3748
|
}),
|
3668
|
-
/* @__PURE__ */
|
3749
|
+
/* @__PURE__ */ React45.createElement(Box, { css: { gridColumn: `1/span ${tiles.length}` } }, children)
|
3669
3750
|
);
|
3670
3751
|
};
|
3671
3752
|
var ProminenceLayout = {
|
@@ -3677,17 +3758,17 @@ var ProminenceLayout = {
|
|
3677
3758
|
// src/Prebuilt/components/SecondaryTiles.tsx
|
3678
3759
|
var SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
3679
3760
|
var _a;
|
3680
|
-
const isMobile =
|
3761
|
+
const isMobile = useMedia10(config.media.md);
|
3681
3762
|
const maxTileCount = isMobile ? 2 : 4;
|
3682
3763
|
const pagesWithTiles = usePagesWithTiles({ peers, maxTileCount });
|
3683
3764
|
const [page, setPage] = useState22(0);
|
3684
3765
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3685
|
-
|
3766
|
+
useEffect12(() => {
|
3686
3767
|
if (pageSize > 0) {
|
3687
3768
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3688
3769
|
}
|
3689
3770
|
}, [pageSize, onPageSize]);
|
3690
|
-
return /* @__PURE__ */
|
3771
|
+
return /* @__PURE__ */ React46.createElement(ProminenceLayout.SecondarySection, { tiles: pagesWithTiles[page], edgeToEdge }, !edgeToEdge && /* @__PURE__ */ React46.createElement(
|
3691
3772
|
Pagination,
|
3692
3773
|
{
|
3693
3774
|
page,
|
@@ -3745,7 +3826,7 @@ function RoleProminence({
|
|
3745
3826
|
}) {
|
3746
3827
|
var _a;
|
3747
3828
|
const { prominentPeers, secondaryPeers } = useRoleProminencePeers(prominentRoles, peers, isInsetEnabled);
|
3748
|
-
const localPeer = useHMSStore20(
|
3829
|
+
const localPeer = useHMSStore20(selectLocalPeer3);
|
3749
3830
|
const maxTileCount = 4;
|
3750
3831
|
const pageList = usePagesWithTiles({
|
3751
3832
|
peers: prominentPeers,
|
@@ -3757,12 +3838,12 @@ function RoleProminence({
|
|
3757
3838
|
});
|
3758
3839
|
const [page, setPage] = useState23(0);
|
3759
3840
|
const pageSize = ((_a = pagesWithTiles[0]) == null ? void 0 : _a.length) || 0;
|
3760
|
-
|
3841
|
+
useEffect13(() => {
|
3761
3842
|
if (pageSize > 0) {
|
3762
3843
|
onPageSize == null ? void 0 : onPageSize(pageSize);
|
3763
3844
|
}
|
3764
3845
|
}, [pageSize, onPageSize]);
|
3765
|
-
return /* @__PURE__ */
|
3846
|
+
return /* @__PURE__ */ React47.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React47.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React47.createElement(Grid, { ref, tiles: pagesWithTiles[page] })), !edgeToEdge && /* @__PURE__ */ React47.createElement(
|
3766
3847
|
Pagination,
|
3767
3848
|
{
|
3768
3849
|
page,
|
@@ -3772,16 +3853,16 @@ function RoleProminence({
|
|
3772
3853
|
},
|
3773
3854
|
numPages: pagesWithTiles.length
|
3774
3855
|
}
|
3775
|
-
), /* @__PURE__ */
|
3856
|
+
), /* @__PURE__ */ React47.createElement(SecondaryTiles, { peers: secondaryPeers, isInsetEnabled, edgeToEdge }), isInsetEnabled && localPeer && !prominentPeers.includes(localPeer) && /* @__PURE__ */ React47.createElement(InsetTile, null));
|
3776
3857
|
}
|
3777
3858
|
|
3778
3859
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
3779
|
-
import
|
3780
|
-
import { useMedia as
|
3860
|
+
import React50, { useEffect as useEffect14, useMemo as useMemo5, useState as useState25 } from "react";
|
3861
|
+
import { useMedia as useMedia11 } from "react-use";
|
3781
3862
|
import { selectPeersScreenSharing, useHMSStore as useHMSStore22 } from "@100mslive/react-sdk";
|
3782
3863
|
|
3783
3864
|
// src/Prebuilt/components/ScreenshareTile.jsx
|
3784
|
-
import
|
3865
|
+
import React49, { useRef as useRef7, useState as useState24 } from "react";
|
3785
3866
|
import { useFullscreen as useFullscreen2 } from "react-use";
|
3786
3867
|
import screenfull2 from "screenfull";
|
3787
3868
|
import {
|
@@ -3794,12 +3875,12 @@ import {
|
|
3794
3875
|
import { ExpandIcon as ExpandIcon3, ShrinkIcon } from "@100mslive/react-icons";
|
3795
3876
|
|
3796
3877
|
// src/Prebuilt/components/ScreenshareDisplay.jsx
|
3797
|
-
import
|
3798
|
-
import { useHMSActions as
|
3878
|
+
import React48 from "react";
|
3879
|
+
import { useHMSActions as useHMSActions14 } from "@100mslive/react-sdk";
|
3799
3880
|
import { CrossIcon as CrossIcon5, ShareScreenIcon as ShareScreenIcon2 } from "@100mslive/react-icons";
|
3800
3881
|
var ScreenshareDisplay = () => {
|
3801
|
-
const hmsActions =
|
3802
|
-
return /* @__PURE__ */
|
3882
|
+
const hmsActions = useHMSActions14();
|
3883
|
+
return /* @__PURE__ */ React48.createElement(
|
3803
3884
|
Flex,
|
3804
3885
|
{
|
3805
3886
|
direction: "column",
|
@@ -3811,9 +3892,9 @@ var ScreenshareDisplay = () => {
|
|
3811
3892
|
color: "$on_surface_high"
|
3812
3893
|
}
|
3813
3894
|
},
|
3814
|
-
/* @__PURE__ */
|
3815
|
-
/* @__PURE__ */
|
3816
|
-
/* @__PURE__ */
|
3895
|
+
/* @__PURE__ */ React48.createElement(ShareScreenIcon2, { width: 48, height: 48 }),
|
3896
|
+
/* @__PURE__ */ React48.createElement(Text, { variant: "h5", css: { m: "$8 0" } }, "You are sharing your screen"),
|
3897
|
+
/* @__PURE__ */ React48.createElement(
|
3817
3898
|
Button,
|
3818
3899
|
{
|
3819
3900
|
variant: "danger",
|
@@ -3823,7 +3904,7 @@ var ScreenshareDisplay = () => {
|
|
3823
3904
|
}),
|
3824
3905
|
"data-testid": "stop_screen_share_btn"
|
3825
3906
|
},
|
3826
|
-
/* @__PURE__ */
|
3907
|
+
/* @__PURE__ */ React48.createElement(CrossIcon5, { width: 18, height: 18 }),
|
3827
3908
|
"\xA0 Stop screen share"
|
3828
3909
|
)
|
3829
3910
|
);
|
@@ -3853,7 +3934,7 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3853
3934
|
const isFullScreenSupported = screenfull2.isEnabled;
|
3854
3935
|
const audioTrack = useHMSStore21(selectScreenShareAudioByPeerID(peer == null ? void 0 : peer.id));
|
3855
3936
|
if (isLocal && !["browser", "window", "application"].includes(track == null ? void 0 : track.displaySurface)) {
|
3856
|
-
return /* @__PURE__ */
|
3937
|
+
return /* @__PURE__ */ React49.createElement(ScreenshareDisplay, null);
|
3857
3938
|
}
|
3858
3939
|
if (!peer) {
|
3859
3940
|
return null;
|
@@ -3863,7 +3944,7 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3863
3944
|
isLocal: false,
|
3864
3945
|
track
|
3865
3946
|
});
|
3866
|
-
return /* @__PURE__ */
|
3947
|
+
return /* @__PURE__ */ React49.createElement(StyledVideoTile.Root, { css: { width, height, p: 0, minHeight: 0 }, "data-testid": "screenshare_tile" }, /* @__PURE__ */ React49.createElement(
|
3867
3948
|
StyledVideoTile.Container,
|
3868
3949
|
{
|
3869
3950
|
transparentBg: true,
|
@@ -3874,9 +3955,9 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3874
3955
|
setIsMouseHovered(false);
|
3875
3956
|
}
|
3876
3957
|
},
|
3877
|
-
showStatsOnTiles ? /* @__PURE__ */
|
3878
|
-
isFullScreenSupported && isMouseHovered ? /* @__PURE__ */
|
3879
|
-
track ? /* @__PURE__ */
|
3958
|
+
showStatsOnTiles ? /* @__PURE__ */ React49.createElement(VideoTileStats, { audioTrackID: audioTrack == null ? void 0 : audioTrack.id, videoTrackID: track == null ? void 0 : track.id, peerID: peerId, isLocal }) : null,
|
3959
|
+
isFullScreenSupported && isMouseHovered ? /* @__PURE__ */ React49.createElement(StyledVideoTile.FullScreenButton, { onClick: () => setFullscreen(!fullscreen) }, isFullscreen ? /* @__PURE__ */ React49.createElement(ShrinkIcon, null) : /* @__PURE__ */ React49.createElement(ExpandIcon3, null)) : null,
|
3960
|
+
track ? /* @__PURE__ */ React49.createElement(
|
3880
3961
|
Video,
|
3881
3962
|
{
|
3882
3963
|
screenShare: true,
|
@@ -3886,8 +3967,8 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3886
3967
|
css: { minHeight: 0 }
|
3887
3968
|
}
|
3888
3969
|
) : null,
|
3889
|
-
/* @__PURE__ */
|
3890
|
-
isMouseHovered && !peer.isLocal ? /* @__PURE__ */
|
3970
|
+
/* @__PURE__ */ React49.createElement(StyledVideoTile.Info, { css: labelStyles }, label),
|
3971
|
+
isMouseHovered && !peer.isLocal ? /* @__PURE__ */ React49.createElement(
|
3891
3972
|
TileMenu_default,
|
3892
3973
|
{
|
3893
3974
|
isScreenshare: true,
|
@@ -3899,7 +3980,7 @@ var Tile = ({ peerId, width = "100%", height = "100%" }) => {
|
|
3899
3980
|
) : null
|
3900
3981
|
));
|
3901
3982
|
};
|
3902
|
-
var ScreenshareTile =
|
3983
|
+
var ScreenshareTile = React49.memo(Tile);
|
3903
3984
|
var ScreenshareTile_default = ScreenshareTile;
|
3904
3985
|
|
3905
3986
|
// src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx
|
@@ -3909,18 +3990,18 @@ var ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge }) => {
|
|
3909
3990
|
const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
|
3910
3991
|
const [page, setPage] = useState25(0);
|
3911
3992
|
const activeSharePeer = peersSharing[page];
|
3912
|
-
const isMobile =
|
3993
|
+
const isMobile = useMedia11(config.media.md);
|
3913
3994
|
const secondaryPeers = useMemo5(
|
3914
3995
|
() => isMobile ? activeSharePeer ? [activeSharePeer, ...peers.filter((p) => p.id !== (activeSharePeer == null ? void 0 : activeSharePeer.id))] : peers : peers.filter((p) => p.id !== (activeSharePeer == null ? void 0 : activeSharePeer.id)),
|
3915
3996
|
[activeSharePeer, peers, isMobile]
|
3916
3997
|
);
|
3917
|
-
|
3998
|
+
useEffect14(() => {
|
3918
3999
|
setActiveScreenSharePeer(isMobile ? "" : activeSharePeer == null ? void 0 : activeSharePeer.id);
|
3919
4000
|
return () => {
|
3920
4001
|
setActiveScreenSharePeer("");
|
3921
4002
|
};
|
3922
4003
|
}, [activeSharePeer == null ? void 0 : activeSharePeer.id, isMobile, setActiveScreenSharePeer]);
|
3923
|
-
return /* @__PURE__ */
|
4004
|
+
return /* @__PURE__ */ React50.createElement(ProminenceLayout.Root, { edgeToEdge }, /* @__PURE__ */ React50.createElement(ProminenceLayout.ProminentSection, null, /* @__PURE__ */ React50.createElement(ScreenshareTile_default, { peerId: (_a = peersSharing[page]) == null ? void 0 : _a.id }), !edgeToEdge && /* @__PURE__ */ React50.createElement(Pagination, { page, onPageChange: setPage, numPages: peersSharing.length })), /* @__PURE__ */ React50.createElement(
|
3924
4005
|
SecondaryTiles,
|
3925
4006
|
{
|
3926
4007
|
peers: secondaryPeers,
|
@@ -4050,7 +4131,7 @@ var GridLayout = ({
|
|
4050
4131
|
hideMetadataOnTile: hide_metadata_on_tile,
|
4051
4132
|
objectFit: video_object_fit
|
4052
4133
|
};
|
4053
|
-
|
4134
|
+
useEffect15(() => {
|
4054
4135
|
if (mainPage !== 0) {
|
4055
4136
|
return;
|
4056
4137
|
}
|
@@ -4061,7 +4142,7 @@ var GridLayout = ({
|
|
4061
4142
|
peersSorter.onUpdate(setSortedPeers);
|
4062
4143
|
}, [mainPage, peersSorter, updatedPeers, pageSize]);
|
4063
4144
|
if (peerSharing) {
|
4064
|
-
return /* @__PURE__ */
|
4145
|
+
return /* @__PURE__ */ React51.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React51.createElement(
|
4065
4146
|
ScreenshareLayout,
|
4066
4147
|
{
|
4067
4148
|
peers: sortedPeers,
|
@@ -4071,7 +4152,7 @@ var GridLayout = ({
|
|
4071
4152
|
}
|
4072
4153
|
));
|
4073
4154
|
} else if (isRoleProminence) {
|
4074
|
-
return /* @__PURE__ */
|
4155
|
+
return /* @__PURE__ */ React51.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React51.createElement(
|
4075
4156
|
RoleProminence,
|
4076
4157
|
{
|
4077
4158
|
peers: sortedPeers,
|
@@ -4083,7 +4164,7 @@ var GridLayout = ({
|
|
4083
4164
|
}
|
4084
4165
|
));
|
4085
4166
|
}
|
4086
|
-
return /* @__PURE__ */
|
4167
|
+
return /* @__PURE__ */ React51.createElement(VideoTileContext.Provider, { value: tileLayout }, /* @__PURE__ */ React51.createElement(
|
4087
4168
|
EqualProminence,
|
4088
4169
|
{
|
4089
4170
|
peers: sortedPeers,
|
@@ -4096,7 +4177,7 @@ var GridLayout = ({
|
|
4096
4177
|
};
|
4097
4178
|
|
4098
4179
|
// src/Prebuilt/layouts/EmbedView.jsx
|
4099
|
-
import
|
4180
|
+
import React52, { useCallback as useCallback8, useEffect as useEffect16, useMemo as useMemo7, useRef as useRef8, useState as useState27 } from "react";
|
4100
4181
|
import {
|
4101
4182
|
selectPeers as selectPeers3,
|
4102
4183
|
selectPeerScreenSharing as selectPeerScreenSharing2,
|
@@ -4105,7 +4186,7 @@ import {
|
|
4105
4186
|
useScreenShare as useScreenShare3
|
4106
4187
|
} from "@100mslive/react-sdk";
|
4107
4188
|
var EmbedView = () => {
|
4108
|
-
return /* @__PURE__ */
|
4189
|
+
return /* @__PURE__ */ React52.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React52.createElement(EmbedComponent, null));
|
4109
4190
|
};
|
4110
4191
|
var EmbebScreenShareView = ({ children }) => {
|
4111
4192
|
const peers = useHMSStore24(selectPeers3);
|
@@ -4115,13 +4196,13 @@ var EmbebScreenShareView = ({ children }) => {
|
|
4115
4196
|
const smallTilePeers2 = peers.filter((peer) => peer.id !== (peerPresenting == null ? void 0 : peerPresenting.id));
|
4116
4197
|
return smallTilePeers2;
|
4117
4198
|
}, [peers, peerPresenting]);
|
4118
|
-
|
4199
|
+
useEffect16(() => {
|
4119
4200
|
setActiveScreenSharePeer(peerPresenting == null ? void 0 : peerPresenting.id);
|
4120
4201
|
return () => {
|
4121
4202
|
setActiveScreenSharePeer("");
|
4122
4203
|
};
|
4123
4204
|
}, [peerPresenting == null ? void 0 : peerPresenting.id, setActiveScreenSharePeer]);
|
4124
|
-
return /* @__PURE__ */
|
4205
|
+
return /* @__PURE__ */ React52.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React52.createElement(ProminenceLayout.ProminentSection, null, children), /* @__PURE__ */ React52.createElement(SecondaryTiles, { peers: smallTilePeers }));
|
4125
4206
|
};
|
4126
4207
|
var EmbedComponent = () => {
|
4127
4208
|
const { amIScreenSharing, toggleScreenShare } = useScreenShare3(throwErrorHandler);
|
@@ -4135,7 +4216,7 @@ var EmbedComponent = () => {
|
|
4135
4216
|
setEmbedConfig({ url: "" });
|
4136
4217
|
}
|
4137
4218
|
}, [src, setEmbedConfig]);
|
4138
|
-
|
4219
|
+
useEffect16(() => {
|
4139
4220
|
if (embedConfig.shareScreen && !amIScreenSharing && !wasScreenShared && !screenShareAttemptInProgress.current) {
|
4140
4221
|
screenShareAttemptInProgress.current = true;
|
4141
4222
|
toggleScreenShare({
|
@@ -4148,7 +4229,7 @@ var EmbedComponent = () => {
|
|
4148
4229
|
});
|
4149
4230
|
}
|
4150
4231
|
}, []);
|
4151
|
-
|
4232
|
+
useEffect16(() => {
|
4152
4233
|
if (wasScreenShared && !amIScreenSharing) {
|
4153
4234
|
resetEmbedConfig();
|
4154
4235
|
}
|
@@ -4159,7 +4240,7 @@ var EmbedComponent = () => {
|
|
4159
4240
|
}
|
4160
4241
|
};
|
4161
4242
|
}, [wasScreenShared, amIScreenSharing, resetEmbedConfig, toggleScreenShare]);
|
4162
|
-
return /* @__PURE__ */
|
4243
|
+
return /* @__PURE__ */ React52.createElement(Box, { ref: iframeRef, css: { size: "100%" } }, /* @__PURE__ */ React52.createElement(
|
4163
4244
|
"iframe",
|
4164
4245
|
{
|
4165
4246
|
src,
|
@@ -4172,10 +4253,10 @@ var EmbedComponent = () => {
|
|
4172
4253
|
};
|
4173
4254
|
|
4174
4255
|
// src/Prebuilt/layouts/PDFView.jsx
|
4175
|
-
import
|
4256
|
+
import React53, { useCallback as useCallback9, useEffect as useEffect17, useRef as useRef9, useState as useState28 } from "react";
|
4176
4257
|
import { throwErrorHandler as throwErrorHandler2, useScreenShare as useScreenShare4 } from "@100mslive/react-sdk";
|
4177
4258
|
var PDFView = () => {
|
4178
|
-
return /* @__PURE__ */
|
4259
|
+
return /* @__PURE__ */ React53.createElement(EmbebScreenShareView, null, /* @__PURE__ */ React53.createElement(PDFEmbedComponent, null));
|
4179
4260
|
};
|
4180
4261
|
var PDFEmbedComponent = () => {
|
4181
4262
|
const ref = useRef9();
|
@@ -4193,7 +4274,7 @@ var PDFEmbedComponent = () => {
|
|
4193
4274
|
const resetEmbedConfig = useCallback9(() => {
|
4194
4275
|
setPDFConfig({ state: false });
|
4195
4276
|
}, [setPDFConfig]);
|
4196
|
-
|
4277
|
+
useEffect17(() => {
|
4197
4278
|
if (isPDFLoaded && ref.current) {
|
4198
4279
|
ref.current.contentWindow.postMessage(
|
4199
4280
|
{
|
@@ -4203,7 +4284,7 @@ var PDFEmbedComponent = () => {
|
|
4203
4284
|
);
|
4204
4285
|
}
|
4205
4286
|
}, [isPDFLoaded, themeType]);
|
4206
|
-
|
4287
|
+
useEffect17(() => {
|
4207
4288
|
if (!amIScreenSharing && !wasScreenShared && !screenShareAttemptInProgress.current) {
|
4208
4289
|
screenShareAttemptInProgress.current = true;
|
4209
4290
|
toggleScreenShare({
|
@@ -4217,7 +4298,7 @@ var PDFEmbedComponent = () => {
|
|
4217
4298
|
});
|
4218
4299
|
}
|
4219
4300
|
}, []);
|
4220
|
-
|
4301
|
+
useEffect17(() => {
|
4221
4302
|
if (wasScreenShared && !amIScreenSharing) {
|
4222
4303
|
resetEmbedConfig();
|
4223
4304
|
}
|
@@ -4228,7 +4309,7 @@ var PDFEmbedComponent = () => {
|
|
4228
4309
|
}
|
4229
4310
|
};
|
4230
4311
|
}, [wasScreenShared, amIScreenSharing, resetEmbedConfig, toggleScreenShare]);
|
4231
|
-
return /* @__PURE__ */
|
4312
|
+
return /* @__PURE__ */ React53.createElement(Box, { ref: iframeRef, css: { size: "100%" } }, /* @__PURE__ */ React53.createElement(
|
4232
4313
|
"iframe",
|
4233
4314
|
{
|
4234
4315
|
src: pdfJSURL,
|
@@ -4261,47 +4342,47 @@ var PDFEmbedComponent = () => {
|
|
4261
4342
|
};
|
4262
4343
|
|
4263
4344
|
// src/Prebuilt/layouts/SidePane.tsx
|
4264
|
-
import
|
4265
|
-
import { useMedia as
|
4345
|
+
import React60 from "react";
|
4346
|
+
import { useMedia as useMedia16 } from "react-use";
|
4266
4347
|
import { selectAppData as selectAppData3, selectVideoTrackByPeerID, useHMSStore as useHMSStore33 } from "@100mslive/react-sdk";
|
4267
4348
|
|
4268
4349
|
// src/Prebuilt/components/SidePaneTabs.tsx
|
4269
|
-
import
|
4270
|
-
import { useMedia as
|
4350
|
+
import React57, { useEffect as useEffect22, useState as useState32 } from "react";
|
4351
|
+
import { useMedia as useMedia15 } from "react-use";
|
4271
4352
|
import { selectPeerCount as selectPeerCount3, useHMSStore as useHMSStore30 } from "@100mslive/react-sdk";
|
4272
4353
|
import { CrossIcon as CrossIcon7 } from "@100mslive/react-icons";
|
4273
4354
|
|
4274
4355
|
// src/Prebuilt/components/Chat/Chat.jsx
|
4275
|
-
import
|
4276
|
-
import { useMedia as
|
4356
|
+
import React56, { useCallback as useCallback14, useEffect as useEffect21, useRef as useRef13, useState as useState31 } from "react";
|
4357
|
+
import { useMedia as useMedia14 } from "react-use";
|
4277
4358
|
import {
|
4278
4359
|
HMSNotificationTypes,
|
4279
4360
|
selectHMSMessagesCount,
|
4280
4361
|
selectPeerNameByID as selectPeerNameByID3,
|
4281
4362
|
selectPermissions as selectPermissions10,
|
4282
4363
|
selectSessionStore,
|
4283
|
-
useHMSActions as
|
4364
|
+
useHMSActions as useHMSActions19,
|
4284
4365
|
useHMSNotifications,
|
4285
4366
|
useHMSStore as useHMSStore29
|
4286
4367
|
} from "@100mslive/react-sdk";
|
4287
4368
|
import { ChevronDownIcon as ChevronDownIcon2, CrossIcon as CrossIcon6, PinIcon as PinIcon2 } from "@100mslive/react-icons";
|
4288
4369
|
|
4289
4370
|
// src/Prebuilt/components/Chat/ChatBody.jsx
|
4290
|
-
import
|
4371
|
+
import React54, { Fragment as Fragment8, useCallback as useCallback11, useEffect as useEffect18, useLayoutEffect, useMemo as useMemo8, useRef as useRef10, useState as useState29 } from "react";
|
4291
4372
|
import { useInView } from "react-intersection-observer";
|
4292
|
-
import { useMedia as
|
4373
|
+
import { useMedia as useMedia12 } from "react-use";
|
4293
4374
|
import AutoSizer from "react-virtualized-auto-sizer";
|
4294
4375
|
import { VariableSizeList } from "react-window";
|
4295
4376
|
import {
|
4296
4377
|
selectHMSMessages,
|
4297
4378
|
selectLocalPeerID as selectLocalPeerID6,
|
4298
|
-
selectLocalPeerRoleName,
|
4379
|
+
selectLocalPeerRoleName as selectLocalPeerRoleName2,
|
4299
4380
|
selectMessagesByPeerID,
|
4300
4381
|
selectMessagesByRole,
|
4301
4382
|
selectPeerNameByID as selectPeerNameByID2,
|
4302
4383
|
selectPermissions as selectPermissions9,
|
4303
|
-
useHMSActions as
|
4304
|
-
useHMSStore as
|
4384
|
+
useHMSActions as useHMSActions16,
|
4385
|
+
useHMSStore as useHMSStore27
|
4305
4386
|
} from "@100mslive/react-sdk";
|
4306
4387
|
import { PinIcon, VerticalMenuIcon as VerticalMenuIcon5 } from "@100mslive/react-icons";
|
4307
4388
|
|
@@ -4313,12 +4394,12 @@ import { useCallback as useCallback10 } from "react";
|
|
4313
4394
|
import {
|
4314
4395
|
selectPeerNameByID,
|
4315
4396
|
selectSessionMetadata,
|
4316
|
-
useHMSActions as
|
4397
|
+
useHMSActions as useHMSActions15,
|
4317
4398
|
useHMSStore as useHMSStore25,
|
4318
4399
|
useHMSVanillaStore as useHMSVanillaStore5
|
4319
4400
|
} from "@100mslive/react-sdk";
|
4320
4401
|
var useSetPinnedMessage = () => {
|
4321
|
-
const hmsActions =
|
4402
|
+
const hmsActions = useHMSActions15();
|
4322
4403
|
const vanillaStore = useHMSVanillaStore5();
|
4323
4404
|
const pinnedMessage = useHMSStore25(selectSessionMetadata);
|
4324
4405
|
const setPinnedMessage = useCallback10(
|
@@ -4337,6 +4418,19 @@ var useSetPinnedMessage = () => {
|
|
4337
4418
|
return { setPinnedMessage };
|
4338
4419
|
};
|
4339
4420
|
|
4421
|
+
// src/Prebuilt/components/Chat/useUnreadCount.js
|
4422
|
+
import {
|
4423
|
+
selectMessagesUnreadCountByPeerID,
|
4424
|
+
selectMessagesUnreadCountByRole,
|
4425
|
+
selectUnreadHMSMessagesCount as selectUnreadHMSMessagesCount2,
|
4426
|
+
useHMSStore as useHMSStore26
|
4427
|
+
} from "@100mslive/react-sdk";
|
4428
|
+
var useUnreadCount = ({ role, peerId }) => {
|
4429
|
+
const unreadCountSelector = role ? selectMessagesUnreadCountByRole(role) : peerId ? selectMessagesUnreadCountByPeerID(peerId) : selectUnreadHMSMessagesCount2;
|
4430
|
+
const unreadCount = useHMSStore26(unreadCountSelector);
|
4431
|
+
return unreadCount;
|
4432
|
+
};
|
4433
|
+
|
4340
4434
|
// src/Prebuilt/components/Chat/ChatBody.jsx
|
4341
4435
|
var formatTime = (date) => {
|
4342
4436
|
if (!(date instanceof Date)) {
|
@@ -4354,7 +4448,7 @@ var formatTime = (date) => {
|
|
4354
4448
|
return `${hours}:${mins} ${suffix}`;
|
4355
4449
|
};
|
4356
4450
|
var MessageTypeContainer = ({ left, right }) => {
|
4357
|
-
return /* @__PURE__ */
|
4451
|
+
return /* @__PURE__ */ React54.createElement(
|
4358
4452
|
Flex,
|
4359
4453
|
{
|
4360
4454
|
align: "center",
|
@@ -4366,16 +4460,16 @@ var MessageTypeContainer = ({ left, right }) => {
|
|
4366
4460
|
r: "$0"
|
4367
4461
|
}
|
4368
4462
|
},
|
4369
|
-
left && /* @__PURE__ */
|
4370
|
-
left && right && /* @__PURE__ */
|
4371
|
-
right && /* @__PURE__ */
|
4463
|
+
left && /* @__PURE__ */ React54.createElement(SenderName, { variant: "tiny", as: "span", css: { color: "$on_surface_medium" } }, left),
|
4464
|
+
left && right && /* @__PURE__ */ React54.createElement(Box, { css: { borderLeft: "1px solid $border_bright", mx: "$4", h: "$8" } }),
|
4465
|
+
right && /* @__PURE__ */ React54.createElement(SenderName, { as: "span", variant: "tiny", css: { textTransform: "uppercase" } }, right)
|
4372
4466
|
);
|
4373
4467
|
};
|
4374
4468
|
var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
4375
|
-
const peerName =
|
4376
|
-
const localPeerRoleName =
|
4469
|
+
const peerName = useHMSStore27(selectPeerNameByID2(receiver));
|
4470
|
+
const localPeerRoleName = useHMSStore27(selectLocalPeerRoleName2);
|
4377
4471
|
if (receiver) {
|
4378
|
-
return /* @__PURE__ */
|
4472
|
+
return /* @__PURE__ */ React54.createElement(
|
4379
4473
|
MessageTypeContainer,
|
4380
4474
|
{
|
4381
4475
|
left: hasCurrentUserSent ? `${peerName ? `TO ${peerName}` : ""}` : "TO YOU",
|
@@ -4384,7 +4478,7 @@ var MessageType = ({ roles, hasCurrentUserSent, receiver }) => {
|
|
4384
4478
|
);
|
4385
4479
|
}
|
4386
4480
|
if (roles && roles.length) {
|
4387
|
-
return /* @__PURE__ */
|
4481
|
+
return /* @__PURE__ */ React54.createElement(MessageTypeContainer, { left: "TO", right: hasCurrentUserSent ? roles.join(",") : localPeerRoleName });
|
4388
4482
|
}
|
4389
4483
|
return null;
|
4390
4484
|
};
|
@@ -4398,10 +4492,10 @@ var Link = styled("a", {
|
|
4398
4492
|
});
|
4399
4493
|
var AnnotisedMessage = ({ message }) => {
|
4400
4494
|
if (!message) {
|
4401
|
-
return /* @__PURE__ */
|
4495
|
+
return /* @__PURE__ */ React54.createElement(Fragment8, null);
|
4402
4496
|
}
|
4403
|
-
return /* @__PURE__ */
|
4404
|
-
(part) => URL_REGEX.test(part) ? /* @__PURE__ */
|
4497
|
+
return /* @__PURE__ */ React54.createElement(Fragment8, null, message.trim().split(/(\s)/).map(
|
4498
|
+
(part) => URL_REGEX.test(part) ? /* @__PURE__ */ React54.createElement(Link, { href: part, key: part, target: "_blank", rel: "noopener noreferrer" }, part) : part
|
4405
4499
|
));
|
4406
4500
|
};
|
4407
4501
|
var getMessageType = ({ roles, receiver }) => {
|
@@ -4415,14 +4509,14 @@ var ChatActions = ({ onPin, showPinAction }) => {
|
|
4415
4509
|
if (!showPinAction) {
|
4416
4510
|
return null;
|
4417
4511
|
}
|
4418
|
-
return /* @__PURE__ */
|
4512
|
+
return /* @__PURE__ */ React54.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React54.createElement(Dropdown.Trigger, { className: "chat_actions", css: { opacity: open ? 1 : 0, "@md": { opacity: 1 } }, asChild: true }, /* @__PURE__ */ React54.createElement(IconButton, null, /* @__PURE__ */ React54.createElement(Tooltip, { title: "More options" }, /* @__PURE__ */ React54.createElement(VerticalMenuIcon5, null)))), /* @__PURE__ */ React54.createElement(Dropdown.Portal, null, /* @__PURE__ */ React54.createElement(
|
4419
4513
|
Dropdown.Content,
|
4420
4514
|
{
|
4421
4515
|
sideOffset: 5,
|
4422
4516
|
align: "end",
|
4423
4517
|
css: { width: "$48", backgroundColor: "$surface_bright", py: "$0", border: "1px solid $border_bright" }
|
4424
4518
|
},
|
4425
|
-
/* @__PURE__ */
|
4519
|
+
/* @__PURE__ */ React54.createElement(Dropdown.Item, { "data-testid": "pin_message_btn", onClick: onPin }, /* @__PURE__ */ React54.createElement(PinIcon, null), /* @__PURE__ */ React54.createElement(Text, { variant: "sm", css: { ml: "$4" } }, "Pin Message"))
|
4426
4520
|
)));
|
4427
4521
|
};
|
4428
4522
|
var SenderName = styled(Text, {
|
@@ -4434,120 +4528,127 @@ var SenderName = styled(Text, {
|
|
4434
4528
|
color: "$on_surface_high",
|
4435
4529
|
fontWeight: "$semiBold"
|
4436
4530
|
});
|
4437
|
-
var ChatMessage =
|
4438
|
-
|
4439
|
-
|
4440
|
-
|
4441
|
-
|
4442
|
-
|
4443
|
-
|
4444
|
-
|
4445
|
-
|
4446
|
-
|
4447
|
-
|
4448
|
-
|
4449
|
-
|
4450
|
-
|
4451
|
-
|
4452
|
-
|
4453
|
-
|
4454
|
-
|
4455
|
-
|
4456
|
-
|
4457
|
-
|
4458
|
-
|
4459
|
-
|
4460
|
-
|
4461
|
-
|
4462
|
-
|
4463
|
-
|
4464
|
-
|
4465
|
-
|
4466
|
-
|
4467
|
-
|
4468
|
-
|
4469
|
-
|
4470
|
-
/* @__PURE__ */ React52.createElement(
|
4471
|
-
Flex,
|
4531
|
+
var ChatMessage = React54.memo(
|
4532
|
+
({ index, style = {}, message, setRowHeight, isLast = false, unreadCount = 0, scrollToBottom, onPin }) => {
|
4533
|
+
var _a, _b;
|
4534
|
+
const { ref, inView } = useInView({ threshold: 0.5, triggerOnce: true });
|
4535
|
+
const rowRef = useRef10(null);
|
4536
|
+
useEffect18(() => {
|
4537
|
+
if (rowRef.current) {
|
4538
|
+
setRowHeight(index, rowRef.current.clientHeight);
|
4539
|
+
}
|
4540
|
+
}, [index, setRowHeight]);
|
4541
|
+
const isMobile = useMedia12(config.media.md);
|
4542
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
4543
|
+
const isOverlay = ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isMobile;
|
4544
|
+
const hmsActions = useHMSActions16();
|
4545
|
+
const localPeerId = useHMSStore27(selectLocalPeerID6);
|
4546
|
+
const permissions = useHMSStore27(selectPermissions9);
|
4547
|
+
const messageType = getMessageType({
|
4548
|
+
roles: message.recipientRoles,
|
4549
|
+
receiver: message.recipientPeer
|
4550
|
+
});
|
4551
|
+
const showPinAction = permissions.removeOthers && !messageType && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.allow_pinning_messages);
|
4552
|
+
useEffect18(() => {
|
4553
|
+
if (message.id && !message.read && inView) {
|
4554
|
+
hmsActions.setMessageRead(true, message.id);
|
4555
|
+
}
|
4556
|
+
}, [message.read, hmsActions, inView, message.id]);
|
4557
|
+
useEffect18(() => {
|
4558
|
+
if (isLast && inView && unreadCount >= 1) {
|
4559
|
+
scrollToBottom(1);
|
4560
|
+
}
|
4561
|
+
}, [inView, isLast, scrollToBottom, unreadCount]);
|
4562
|
+
return /* @__PURE__ */ React54.createElement(
|
4563
|
+
Box,
|
4472
4564
|
{
|
4473
|
-
ref
|
4474
|
-
|
4475
|
-
css: {
|
4476
|
-
|
4477
|
-
// Theme independent color, token should not be used for transparent chat
|
4478
|
-
bg: messageType ? isOverlay ? "rgba(0, 0, 0, 0.64)" : "$surface_default" : void 0,
|
4479
|
-
r: messageType ? "$1" : void 0,
|
4480
|
-
px: messageType ? "$4" : "$2",
|
4481
|
-
py: messageType ? "$4" : 0,
|
4482
|
-
userSelect: "none"
|
4483
|
-
},
|
4484
|
-
key: message.time,
|
4485
|
-
"data-testid": "chat_msg"
|
4565
|
+
ref,
|
4566
|
+
as: "div",
|
4567
|
+
css: { mb: "$10", pr: "$10", mt: "$8", "&:hover .chat_actions": { opacity: 1 } },
|
4568
|
+
style
|
4486
4569
|
},
|
4487
|
-
/* @__PURE__ */
|
4488
|
-
|
4570
|
+
/* @__PURE__ */ React54.createElement(
|
4571
|
+
Flex,
|
4489
4572
|
{
|
4573
|
+
ref: rowRef,
|
4574
|
+
align: "center",
|
4490
4575
|
css: {
|
4491
|
-
|
4492
|
-
|
4493
|
-
|
4494
|
-
|
4495
|
-
|
4496
|
-
|
4576
|
+
flexWrap: "wrap",
|
4577
|
+
// Theme independent color, token should not be used for transparent chat
|
4578
|
+
bg: messageType ? isOverlay ? "rgba(0, 0, 0, 0.64)" : "$surface_default" : void 0,
|
4579
|
+
r: messageType ? "$1" : void 0,
|
4580
|
+
px: messageType ? "$4" : "$2",
|
4581
|
+
py: messageType ? "$4" : 0,
|
4582
|
+
userSelect: "none"
|
4497
4583
|
},
|
4498
|
-
|
4584
|
+
key: message.time,
|
4585
|
+
"data-testid": "chat_msg"
|
4499
4586
|
},
|
4500
|
-
/* @__PURE__ */
|
4587
|
+
/* @__PURE__ */ React54.createElement(
|
4501
4588
|
Text,
|
4502
4589
|
{
|
4503
|
-
as: "span",
|
4504
|
-
variant: "xs",
|
4505
4590
|
css: {
|
4506
|
-
|
4507
|
-
|
4508
|
-
|
4509
|
-
|
4591
|
+
color: isOverlay ? "#FFF" : "$on_surface_high",
|
4592
|
+
fontWeight: "$semiBold",
|
4593
|
+
display: "inline-flex",
|
4594
|
+
alignItems: "center",
|
4595
|
+
justifyContent: "space-between",
|
4596
|
+
width: "100%"
|
4597
|
+
},
|
4598
|
+
as: "div"
|
4510
4599
|
},
|
4511
|
-
|
4512
|
-
|
4513
|
-
|
4514
|
-
|
4515
|
-
|
4516
|
-
|
4517
|
-
|
4518
|
-
|
4519
|
-
|
4600
|
+
/* @__PURE__ */ React54.createElement(Flex, { align: "baseline" }, message.senderName === "You" || !message.senderName ? /* @__PURE__ */ React54.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName || "Anonymous") : /* @__PURE__ */ React54.createElement(Tooltip, { title: message.senderName, side: "top", align: "start" }, /* @__PURE__ */ React54.createElement(SenderName, { as: "span", variant: "sm", css: { color: isOverlay ? "#FFF" : "$on_surface_high" } }, message.senderName)), !isOverlay ? /* @__PURE__ */ React54.createElement(
|
4601
|
+
Text,
|
4602
|
+
{
|
4603
|
+
as: "span",
|
4604
|
+
variant: "xs",
|
4605
|
+
css: {
|
4606
|
+
ml: "$4",
|
4607
|
+
color: "$on_surface_medium",
|
4608
|
+
flexShrink: 0
|
4609
|
+
}
|
4610
|
+
},
|
4611
|
+
formatTime(message.time)
|
4612
|
+
) : null),
|
4613
|
+
/* @__PURE__ */ React54.createElement(
|
4614
|
+
MessageType,
|
4615
|
+
{
|
4616
|
+
hasCurrentUserSent: message.sender === localPeerId,
|
4617
|
+
receiver: message.recipientPeer,
|
4618
|
+
roles: message.recipientRoles
|
4619
|
+
}
|
4620
|
+
),
|
4621
|
+
!isOverlay ? /* @__PURE__ */ React54.createElement(ChatActions, { onPin, showPinAction }) : null
|
4520
4622
|
),
|
4521
|
-
|
4522
|
-
|
4523
|
-
|
4524
|
-
|
4525
|
-
|
4526
|
-
|
4527
|
-
|
4528
|
-
|
4529
|
-
|
4530
|
-
|
4531
|
-
|
4532
|
-
|
4533
|
-
|
4623
|
+
/* @__PURE__ */ React54.createElement(
|
4624
|
+
Text,
|
4625
|
+
{
|
4626
|
+
variant: "sm",
|
4627
|
+
css: {
|
4628
|
+
w: "100%",
|
4629
|
+
mt: "$2",
|
4630
|
+
wordBreak: "break-word",
|
4631
|
+
whiteSpace: "pre-wrap",
|
4632
|
+
userSelect: "all",
|
4633
|
+
color: isOverlay ? "#FFF" : "$on_surface_high"
|
4634
|
+
},
|
4635
|
+
onClick: (e) => e.stopPropagation()
|
4534
4636
|
},
|
4535
|
-
|
4536
|
-
|
4537
|
-
/* @__PURE__ */ React52.createElement(AnnotisedMessage, { message: message.message })
|
4637
|
+
/* @__PURE__ */ React54.createElement(AnnotisedMessage, { message: message.message })
|
4638
|
+
)
|
4538
4639
|
)
|
4539
|
-
)
|
4540
|
-
|
4541
|
-
|
4542
|
-
var ChatList =
|
4543
|
-
({ width, height, setRowHeight, getRowHeight, messages, scrollToBottom }, listRef) => {
|
4640
|
+
);
|
4641
|
+
}
|
4642
|
+
);
|
4643
|
+
var ChatList = React54.forwardRef(
|
4644
|
+
({ width, height, setRowHeight, getRowHeight, messages, unreadCount = 0, scrollToBottom }, listRef) => {
|
4544
4645
|
const { setPinnedMessage } = useSetPinnedMessage();
|
4545
4646
|
useLayoutEffect(() => {
|
4546
4647
|
if (listRef.current && listRef.current.scrollToItem) {
|
4547
4648
|
scrollToBottom(1);
|
4548
4649
|
}
|
4549
4650
|
}, [listRef]);
|
4550
|
-
return /* @__PURE__ */
|
4651
|
+
return /* @__PURE__ */ React54.createElement(
|
4551
4652
|
VariableSizeList,
|
4552
4653
|
{
|
4553
4654
|
ref: listRef,
|
@@ -4559,7 +4660,7 @@ var ChatList = React52.forwardRef(
|
|
4559
4660
|
overflowX: "hidden"
|
4560
4661
|
}
|
4561
4662
|
},
|
4562
|
-
({ index, style }) => /* @__PURE__ */
|
4663
|
+
({ index, style }) => /* @__PURE__ */ React54.createElement(
|
4563
4664
|
ChatMessage,
|
4564
4665
|
{
|
4565
4666
|
style,
|
@@ -4567,13 +4668,16 @@ var ChatList = React52.forwardRef(
|
|
4567
4668
|
key: messages[index].id,
|
4568
4669
|
message: messages[index],
|
4569
4670
|
setRowHeight,
|
4671
|
+
unreadCount,
|
4672
|
+
isLast: index >= messages.length - 2,
|
4673
|
+
scrollToBottom,
|
4570
4674
|
onPin: () => setPinnedMessage(messages[index])
|
4571
4675
|
}
|
4572
4676
|
)
|
4573
4677
|
);
|
4574
4678
|
}
|
4575
4679
|
);
|
4576
|
-
var VirtualizedChatMessages =
|
4680
|
+
var VirtualizedChatMessages = React54.forwardRef(({ messages, unreadCount = 0, scrollToBottom }, listRef) => {
|
4577
4681
|
const rowHeights = useRef10({});
|
4578
4682
|
function getRowHeight(index) {
|
4579
4683
|
return rowHeights.current[index] + 16 || 72;
|
@@ -4585,7 +4689,7 @@ var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom },
|
|
4585
4689
|
},
|
4586
4690
|
[listRef]
|
4587
4691
|
);
|
4588
|
-
return /* @__PURE__ */
|
4692
|
+
return /* @__PURE__ */ React54.createElement(
|
4589
4693
|
Box,
|
4590
4694
|
{
|
4591
4695
|
css: {
|
@@ -4594,14 +4698,14 @@ var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom },
|
|
4594
4698
|
},
|
4595
4699
|
as: "div"
|
4596
4700
|
},
|
4597
|
-
/* @__PURE__ */
|
4701
|
+
/* @__PURE__ */ React54.createElement(
|
4598
4702
|
AutoSizer,
|
4599
4703
|
{
|
4600
4704
|
style: {
|
4601
4705
|
width: "90%"
|
4602
4706
|
}
|
4603
4707
|
},
|
4604
|
-
({ height, width }) => /* @__PURE__ */
|
4708
|
+
({ height, width }) => /* @__PURE__ */ React54.createElement(
|
4605
4709
|
ChatList,
|
4606
4710
|
{
|
4607
4711
|
width,
|
@@ -4610,21 +4714,23 @@ var VirtualizedChatMessages = React52.forwardRef(({ messages, scrollToBottom },
|
|
4610
4714
|
setRowHeight,
|
4611
4715
|
getRowHeight,
|
4612
4716
|
scrollToBottom,
|
4613
|
-
ref: listRef
|
4717
|
+
ref: listRef,
|
4718
|
+
unreadCount
|
4614
4719
|
}
|
4615
4720
|
)
|
4616
4721
|
)
|
4617
4722
|
);
|
4618
4723
|
});
|
4619
|
-
var ChatBody =
|
4724
|
+
var ChatBody = React54.forwardRef(({ role, peerId, scrollToBottom }, listRef) => {
|
4620
4725
|
var _a;
|
4621
4726
|
const storeMessageSelector = role ? selectMessagesByRole(role) : peerId ? selectMessagesByPeerID(peerId) : selectHMSMessages;
|
4622
|
-
let messages =
|
4727
|
+
let messages = useHMSStore27(storeMessageSelector);
|
4623
4728
|
messages = useMemo8(() => (messages == null ? void 0 : messages.filter((message) => message.type === "chat")) || [], [messages]);
|
4624
|
-
const isMobile =
|
4729
|
+
const isMobile = useMedia12(config.media.md);
|
4625
4730
|
const { elements } = useRoomLayoutConferencingScreen();
|
4731
|
+
const unreadCount = useUnreadCount({ role, peerId });
|
4626
4732
|
if (messages.length === 0 && !(isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay))) {
|
4627
|
-
return /* @__PURE__ */
|
4733
|
+
return /* @__PURE__ */ React54.createElement(
|
4628
4734
|
Flex,
|
4629
4735
|
{
|
4630
4736
|
css: {
|
@@ -4636,7 +4742,7 @@ var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4636
4742
|
align: "center",
|
4637
4743
|
justify: "center"
|
4638
4744
|
},
|
4639
|
-
/* @__PURE__ */
|
4745
|
+
/* @__PURE__ */ React54.createElement(Box, null, /* @__PURE__ */ React54.createElement("img", { src: empty_chat_default, alt: "Empty Chat", height: 132, width: 185, style: { margin: "0 auto" } }), /* @__PURE__ */ React54.createElement(Text, { variant: "h5", css: { mt: "$8", c: "$on_surface_high" } }, "Start a conversation"), /* @__PURE__ */ React54.createElement(
|
4640
4746
|
Text,
|
4641
4747
|
{
|
4642
4748
|
variant: "sm",
|
@@ -4646,23 +4752,31 @@ var ChatBody = React52.forwardRef(({ role, peerId, scrollToBottom }, listRef) =>
|
|
4646
4752
|
))
|
4647
4753
|
);
|
4648
4754
|
}
|
4649
|
-
return /* @__PURE__ */
|
4755
|
+
return /* @__PURE__ */ React54.createElement(Fragment8, null, /* @__PURE__ */ React54.createElement(
|
4756
|
+
VirtualizedChatMessages,
|
4757
|
+
{
|
4758
|
+
messages,
|
4759
|
+
scrollToBottom,
|
4760
|
+
unreadCount,
|
4761
|
+
ref: listRef
|
4762
|
+
}
|
4763
|
+
));
|
4650
4764
|
});
|
4651
4765
|
|
4652
4766
|
// src/Prebuilt/components/Chat/ChatFooter.tsx
|
4653
|
-
import
|
4654
|
-
import { useMedia as
|
4767
|
+
import React55, { useCallback as useCallback13, useEffect as useEffect20, useRef as useRef12, useState as useState30 } from "react";
|
4768
|
+
import { useMedia as useMedia13 } from "react-use";
|
4655
4769
|
import data2 from "@emoji-mart/data";
|
4656
4770
|
import Picker from "@emoji-mart/react";
|
4657
|
-
import { useHMSActions as
|
4771
|
+
import { useHMSActions as useHMSActions18 } from "@100mslive/react-sdk";
|
4658
4772
|
import { EmojiIcon as EmojiIcon3, SendIcon } from "@100mslive/react-icons";
|
4659
4773
|
|
4660
4774
|
// src/Prebuilt/components/AppData/useChatState.js
|
4661
4775
|
import { useCallback as useCallback12 } from "react";
|
4662
|
-
import { selectAppData as selectAppData2, useHMSActions as
|
4776
|
+
import { selectAppData as selectAppData2, useHMSActions as useHMSActions17, useHMSStore as useHMSStore28 } from "@100mslive/react-sdk";
|
4663
4777
|
var useChatDraftMessage = () => {
|
4664
|
-
const hmsActions =
|
4665
|
-
let chatDraftMessage =
|
4778
|
+
const hmsActions = useHMSActions17();
|
4779
|
+
let chatDraftMessage = useHMSStore28(selectAppData2(APP_DATA.chatDraft));
|
4666
4780
|
if (chatDraftMessage === void 0 || chatDraftMessage === null) {
|
4667
4781
|
chatDraftMessage = "";
|
4668
4782
|
}
|
@@ -4676,10 +4790,10 @@ var useChatDraftMessage = () => {
|
|
4676
4790
|
};
|
4677
4791
|
|
4678
4792
|
// src/Prebuilt/components/Chat/useEmojiPickerStyles.js
|
4679
|
-
import { useEffect as
|
4793
|
+
import { useEffect as useEffect19, useRef as useRef11 } from "react";
|
4680
4794
|
var useEmojiPickerStyles = (showing) => {
|
4681
4795
|
const ref = useRef11(null);
|
4682
|
-
|
4796
|
+
useEffect19(() => {
|
4683
4797
|
if (showing) {
|
4684
4798
|
setTimeout(() => {
|
4685
4799
|
var _a, _b;
|
@@ -4729,7 +4843,7 @@ var TextArea = styled("textarea", {
|
|
4729
4843
|
function EmojiPicker({ onSelect }) {
|
4730
4844
|
const [showEmoji, setShowEmoji] = useState30(false);
|
4731
4845
|
const ref = useEmojiPickerStyles(showEmoji);
|
4732
|
-
return /* @__PURE__ */
|
4846
|
+
return /* @__PURE__ */ React55.createElement(Popover.Root, { open: showEmoji, onOpenChange: setShowEmoji }, /* @__PURE__ */ React55.createElement(Popover.Trigger, { asChild: true, css: { appearance: "none" } }, /* @__PURE__ */ React55.createElement(IconButton, { as: "div" }, /* @__PURE__ */ React55.createElement(EmojiIcon3, null))), /* @__PURE__ */ React55.createElement(Popover.Portal, null, /* @__PURE__ */ React55.createElement(
|
4733
4847
|
Popover.Content,
|
4734
4848
|
{
|
4735
4849
|
alignOffset: -40,
|
@@ -4739,7 +4853,7 @@ function EmojiPicker({ onSelect }) {
|
|
4739
4853
|
p: 0
|
4740
4854
|
}
|
4741
4855
|
},
|
4742
|
-
/* @__PURE__ */
|
4856
|
+
/* @__PURE__ */ React55.createElement(
|
4743
4857
|
Box,
|
4744
4858
|
{
|
4745
4859
|
css: {
|
@@ -4748,7 +4862,7 @@ function EmojiPicker({ onSelect }) {
|
|
4748
4862
|
},
|
4749
4863
|
ref
|
4750
4864
|
},
|
4751
|
-
/* @__PURE__ */
|
4865
|
+
/* @__PURE__ */ React55.createElement(Picker, { onEmojiSelect: onSelect, data: data2, previewPosition: "none", skinPosition: "search" })
|
4752
4866
|
)
|
4753
4867
|
)));
|
4754
4868
|
}
|
@@ -4759,10 +4873,10 @@ var ChatFooter = ({
|
|
4759
4873
|
children
|
4760
4874
|
}) => {
|
4761
4875
|
var _a;
|
4762
|
-
const hmsActions =
|
4876
|
+
const hmsActions = useHMSActions18();
|
4763
4877
|
const inputRef = useRef12(null);
|
4764
4878
|
const [draftMessage, setDraftMessage] = useChatDraftMessage();
|
4765
|
-
const isMobile =
|
4879
|
+
const isMobile = useMedia13(config.media.md);
|
4766
4880
|
const { elements } = useRoomLayoutConferencingScreen();
|
4767
4881
|
const isOverlayChat = (_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay;
|
4768
4882
|
const sendMessage = useCallback13(() => __async(void 0, null, function* () {
|
@@ -4788,19 +4902,19 @@ var ChatFooter = ({
|
|
4788
4902
|
ToastManager.addToast({ title: err.message });
|
4789
4903
|
}
|
4790
4904
|
}), [role, peerId, hmsActions, onSend]);
|
4791
|
-
|
4905
|
+
useEffect20(() => {
|
4792
4906
|
const messageElement = inputRef.current;
|
4793
4907
|
if (messageElement) {
|
4794
4908
|
messageElement.value = draftMessage;
|
4795
4909
|
}
|
4796
4910
|
}, [draftMessage]);
|
4797
|
-
|
4911
|
+
useEffect20(() => {
|
4798
4912
|
const messageElement = inputRef.current;
|
4799
4913
|
return () => {
|
4800
4914
|
setDraftMessage((messageElement == null ? void 0 : messageElement.value) || "");
|
4801
4915
|
};
|
4802
4916
|
}, [setDraftMessage]);
|
4803
|
-
return /* @__PURE__ */
|
4917
|
+
return /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Flex, { align: "center", css: { gap: "$4", w: "100%" } }, /* @__PURE__ */ React55.createElement(
|
4804
4918
|
Flex,
|
4805
4919
|
{
|
4806
4920
|
align: "center",
|
@@ -4821,13 +4935,14 @@ var ChatFooter = ({
|
|
4821
4935
|
}
|
4822
4936
|
},
|
4823
4937
|
children,
|
4824
|
-
/* @__PURE__ */
|
4938
|
+
/* @__PURE__ */ React55.createElement(
|
4825
4939
|
TextArea,
|
4826
4940
|
{
|
4827
4941
|
css: {
|
4828
4942
|
c: "$on_surface_high",
|
4829
4943
|
"&:valid ~ .send-msg": { color: "$on_surface_high" },
|
4830
|
-
"& ~ .send-msg": { color: "$on_surface_low" }
|
4944
|
+
"& ~ .send-msg": { color: "$on_surface_low" },
|
4945
|
+
"&::placeholder": { color: "$on_surface_medium" }
|
4831
4946
|
},
|
4832
4947
|
placeholder: "Send a message....",
|
4833
4948
|
ref: inputRef,
|
@@ -4848,7 +4963,7 @@ var ChatFooter = ({
|
|
4848
4963
|
onCopy: (e) => e.stopPropagation()
|
4849
4964
|
}
|
4850
4965
|
),
|
4851
|
-
!isMobile ? /* @__PURE__ */
|
4966
|
+
!isMobile ? /* @__PURE__ */ React55.createElement(
|
4852
4967
|
EmojiPicker,
|
4853
4968
|
{
|
4854
4969
|
onSelect: (emoji) => {
|
@@ -4858,7 +4973,7 @@ var ChatFooter = ({
|
|
4858
4973
|
}
|
4859
4974
|
}
|
4860
4975
|
) : null,
|
4861
|
-
/* @__PURE__ */
|
4976
|
+
/* @__PURE__ */ React55.createElement(
|
4862
4977
|
IconButton,
|
4863
4978
|
{
|
4864
4979
|
className: "send-msg",
|
@@ -4871,31 +4986,18 @@ var ChatFooter = ({
|
|
4871
4986
|
},
|
4872
4987
|
"data-testid": "send_msg_btn"
|
4873
4988
|
},
|
4874
|
-
/* @__PURE__ */
|
4989
|
+
/* @__PURE__ */ React55.createElement(SendIcon, null)
|
4875
4990
|
)
|
4876
4991
|
)));
|
4877
4992
|
};
|
4878
4993
|
|
4879
|
-
// src/Prebuilt/components/Chat/useUnreadCount.js
|
4880
|
-
import {
|
4881
|
-
selectMessagesUnreadCountByPeerID,
|
4882
|
-
selectMessagesUnreadCountByRole,
|
4883
|
-
selectUnreadHMSMessagesCount as selectUnreadHMSMessagesCount2,
|
4884
|
-
useHMSStore as useHMSStore28
|
4885
|
-
} from "@100mslive/react-sdk";
|
4886
|
-
var useUnreadCount = ({ role, peerId }) => {
|
4887
|
-
const unreadCountSelector = role ? selectMessagesUnreadCountByRole(role) : peerId ? selectMessagesUnreadCountByPeerID(peerId) : selectUnreadHMSMessagesCount2;
|
4888
|
-
const unreadCount = useHMSStore28(unreadCountSelector);
|
4889
|
-
return unreadCount;
|
4890
|
-
};
|
4891
|
-
|
4892
4994
|
// src/Prebuilt/components/Chat/Chat.jsx
|
4893
4995
|
var PINNED_MESSAGE_LENGTH = 80;
|
4894
4996
|
var PinnedMessage = ({ clearPinnedMessage }) => {
|
4895
4997
|
const permissions = useHMSStore29(selectPermissions10);
|
4896
4998
|
const pinnedMessage = useHMSStore29(selectSessionStore(SESSION_STORE_KEY.PINNED_MESSAGE));
|
4897
4999
|
const formattedPinnedMessage = (pinnedMessage == null ? void 0 : pinnedMessage.length) && pinnedMessage.length > PINNED_MESSAGE_LENGTH ? `${pinnedMessage.slice(0, PINNED_MESSAGE_LENGTH)}...` : pinnedMessage;
|
4898
|
-
return pinnedMessage ? /* @__PURE__ */
|
5000
|
+
return pinnedMessage ? /* @__PURE__ */ React56.createElement(
|
4899
5001
|
Flex,
|
4900
5002
|
{
|
4901
5003
|
title: pinnedMessage,
|
@@ -4903,8 +5005,8 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
4903
5005
|
align: "center",
|
4904
5006
|
justify: "between"
|
4905
5007
|
},
|
4906
|
-
/* @__PURE__ */
|
4907
|
-
/* @__PURE__ */
|
5008
|
+
/* @__PURE__ */ React56.createElement(PinIcon2, null),
|
5009
|
+
/* @__PURE__ */ React56.createElement(
|
4908
5010
|
Box,
|
4909
5011
|
{
|
4910
5012
|
css: {
|
@@ -4914,15 +5016,15 @@ var PinnedMessage = ({ clearPinnedMessage }) => {
|
|
4914
5016
|
overflowY: "auto"
|
4915
5017
|
}
|
4916
5018
|
},
|
4917
|
-
/* @__PURE__ */
|
5019
|
+
/* @__PURE__ */ React56.createElement(Text, { variant: "sm" }, /* @__PURE__ */ React56.createElement(AnnotisedMessage, { message: formattedPinnedMessage }))
|
4918
5020
|
),
|
4919
|
-
permissions.removeOthers && /* @__PURE__ */
|
5021
|
+
permissions.removeOthers && /* @__PURE__ */ React56.createElement(
|
4920
5022
|
Flex,
|
4921
5023
|
{
|
4922
5024
|
onClick: () => clearPinnedMessage(),
|
4923
5025
|
css: { cursor: "pointer", color: "$on_surface_medium", "&:hover": { color: "$on_surface_high" } }
|
4924
5026
|
},
|
4925
|
-
/* @__PURE__ */
|
5027
|
+
/* @__PURE__ */ React56.createElement(CrossIcon6, null)
|
4926
5028
|
)
|
4927
5029
|
) : null;
|
4928
5030
|
};
|
@@ -4939,9 +5041,9 @@ var Chat = ({ screenType }) => {
|
|
4939
5041
|
});
|
4940
5042
|
const [isSelectorOpen] = useState31(false);
|
4941
5043
|
const listRef = useRef13(null);
|
4942
|
-
const hmsActions =
|
5044
|
+
const hmsActions = useHMSActions19();
|
4943
5045
|
const { setPinnedMessage } = useSetPinnedMessage();
|
4944
|
-
|
5046
|
+
useEffect21(() => {
|
4945
5047
|
if (notification && notification.data && peerSelector === notification.data.id) {
|
4946
5048
|
setPeerSelector("");
|
4947
5049
|
setChatOptions({
|
@@ -4953,7 +5055,7 @@ var Chat = ({ screenType }) => {
|
|
4953
5055
|
}, [notification, peerSelector, setPeerSelector]);
|
4954
5056
|
const storeMessageSelector = selectHMSMessagesCount;
|
4955
5057
|
const { elements } = useRoomLayoutConferencingScreen();
|
4956
|
-
const isMobile =
|
5058
|
+
const isMobile = useMedia14(config.media.md);
|
4957
5059
|
let isScrolledToBottom = false;
|
4958
5060
|
if (listRef.current) {
|
4959
5061
|
const currentRef = listRef.current._outerRef;
|
@@ -4974,7 +5076,7 @@ var Chat = ({ screenType }) => {
|
|
4974
5076
|
},
|
4975
5077
|
[hmsActions, messagesCount]
|
4976
5078
|
);
|
4977
|
-
return /* @__PURE__ */
|
5079
|
+
return /* @__PURE__ */ React56.createElement(
|
4978
5080
|
Flex,
|
4979
5081
|
{
|
4980
5082
|
direction: "column",
|
@@ -4983,8 +5085,8 @@ var Chat = ({ screenType }) => {
|
|
4983
5085
|
gap: "$4"
|
4984
5086
|
}
|
4985
5087
|
},
|
4986
|
-
isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) ? null : /* @__PURE__ */
|
4987
|
-
/* @__PURE__ */
|
5088
|
+
isMobile && ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) ? null : /* @__PURE__ */ React56.createElement(React56.Fragment, null, ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.allow_pinning_messages) ? /* @__PURE__ */ React56.createElement(PinnedMessage, { clearPinnedMessage: setPinnedMessage }) : null),
|
5089
|
+
/* @__PURE__ */ React56.createElement(
|
4988
5090
|
ChatBody,
|
4989
5091
|
{
|
4990
5092
|
role: chatOptions.role,
|
@@ -4994,7 +5096,7 @@ var Chat = ({ screenType }) => {
|
|
4994
5096
|
screenType
|
4995
5097
|
}
|
4996
5098
|
),
|
4997
|
-
/* @__PURE__ */
|
5099
|
+
/* @__PURE__ */ React56.createElement(
|
4998
5100
|
ChatFooter,
|
4999
5101
|
{
|
5000
5102
|
role: chatOptions.role,
|
@@ -5012,7 +5114,7 @@ var Chat = ({ screenType }) => {
|
|
5012
5114
|
},
|
5013
5115
|
peerId: chatOptions.peerId
|
5014
5116
|
},
|
5015
|
-
!isSelectorOpen && !isScrolledToBottom && /* @__PURE__ */
|
5117
|
+
!isSelectorOpen && !isScrolledToBottom && /* @__PURE__ */ React56.createElement(NewMessageIndicator, { role: chatOptions.role, peerId: chatOptions.peerId, scrollToBottom })
|
5016
5118
|
)
|
5017
5119
|
);
|
5018
5120
|
};
|
@@ -5021,7 +5123,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5021
5123
|
if (!unreadCount) {
|
5022
5124
|
return null;
|
5023
5125
|
}
|
5024
|
-
return /* @__PURE__ */
|
5126
|
+
return /* @__PURE__ */ React56.createElement(
|
5025
5127
|
Flex,
|
5026
5128
|
{
|
5027
5129
|
justify: "center",
|
@@ -5032,7 +5134,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5032
5134
|
position: "absolute"
|
5033
5135
|
}
|
5034
5136
|
},
|
5035
|
-
/* @__PURE__ */
|
5137
|
+
/* @__PURE__ */ React56.createElement(
|
5036
5138
|
Button,
|
5037
5139
|
{
|
5038
5140
|
variant: "standard",
|
@@ -5055,7 +5157,7 @@ var NewMessageIndicator = ({ role, peerId, scrollToBottom }) => {
|
|
5055
5157
|
},
|
5056
5158
|
"New ",
|
5057
5159
|
unreadCount === 1 ? "message" : "messages",
|
5058
|
-
/* @__PURE__ */
|
5160
|
+
/* @__PURE__ */ React56.createElement(ChevronDownIcon2, null)
|
5059
5161
|
)
|
5060
5162
|
);
|
5061
5163
|
};
|
@@ -5069,7 +5171,10 @@ var tabTriggerCSS = {
|
|
5069
5171
|
w: "100%",
|
5070
5172
|
justifyContent: "center"
|
5071
5173
|
};
|
5072
|
-
var
|
5174
|
+
var ParticipantCount2 = ({ count }) => {
|
5175
|
+
return count < 1e3 ? /* @__PURE__ */ React57.createElement("span", null, "(", count, ")") : /* @__PURE__ */ React57.createElement(Tooltip, { title: count }, /* @__PURE__ */ React57.createElement("span", null, "(", getFormattedCount(count), ")"));
|
5176
|
+
};
|
5177
|
+
var SidePaneTabs = React57.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType, hideControls }) => {
|
5073
5178
|
var _a;
|
5074
5179
|
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
|
5075
5180
|
const toggleParticipants = useSidepaneToggle(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
@@ -5080,10 +5185,10 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5080
5185
|
const showChat = !!(elements == null ? void 0 : elements.chat);
|
5081
5186
|
const showParticipants = !!(elements == null ? void 0 : elements.participant_list);
|
5082
5187
|
const hideTabs = !(showChat && showParticipants);
|
5083
|
-
const isMobile =
|
5188
|
+
const isMobile = useMedia15(config.media.md);
|
5084
5189
|
const isOverlayChat = !!((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.is_overlay) && isMobile;
|
5085
5190
|
const isChatOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.CHAT);
|
5086
|
-
|
5191
|
+
useEffect22(() => {
|
5087
5192
|
if (activeTab === SIDE_PANE_OPTIONS.CHAT && !showChat && showParticipants) {
|
5088
5193
|
setActiveTab(SIDE_PANE_OPTIONS.PARTICIPANTS);
|
5089
5194
|
} else if (activeTab === SIDE_PANE_OPTIONS.PARTICIPANTS && showChat && !showParticipants) {
|
@@ -5092,10 +5197,10 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5092
5197
|
resetSidePane();
|
5093
5198
|
}
|
5094
5199
|
}, [showChat, activeTab, showParticipants, resetSidePane]);
|
5095
|
-
|
5200
|
+
useEffect22(() => {
|
5096
5201
|
setActiveTab(active);
|
5097
5202
|
}, [active]);
|
5098
|
-
return /* @__PURE__ */
|
5203
|
+
return /* @__PURE__ */ React57.createElement(
|
5099
5204
|
Flex,
|
5100
5205
|
{
|
5101
5206
|
direction: "column",
|
@@ -5106,7 +5211,7 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5106
5211
|
transition: "margin 0.3s ease-in-out"
|
5107
5212
|
}
|
5108
5213
|
},
|
5109
|
-
isOverlayChat && isChatOpen && showChat ? /* @__PURE__ */
|
5214
|
+
isOverlayChat && isChatOpen && showChat ? /* @__PURE__ */ React57.createElement(Chat, { screenType }) : /* @__PURE__ */ React57.createElement(React57.Fragment, null, hideTabs ? /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(Text, { variant: "sm", css: { fontWeight: "$semiBold", p: "$4", c: "$on_surface_high", pr: "$12" } }, showChat ? "Chat" : /* @__PURE__ */ React57.createElement("span", null, "Participants ", /* @__PURE__ */ React57.createElement(ParticipantCount2, { count: peerCount }))), showChat ? /* @__PURE__ */ React57.createElement(Chat, { screenType }) : /* @__PURE__ */ React57.createElement(ParticipantList, null)) : /* @__PURE__ */ React57.createElement(
|
5110
5215
|
Tabs.Root,
|
5111
5216
|
{
|
5112
5217
|
value: activeTab,
|
@@ -5116,7 +5221,7 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5116
5221
|
size: "100%"
|
5117
5222
|
}
|
5118
5223
|
},
|
5119
|
-
/* @__PURE__ */
|
5224
|
+
/* @__PURE__ */ React57.createElement(Tabs.List, { css: { w: "calc(100% - $12)", p: "$2", borderRadius: "$2", bg: "$surface_default" } }, /* @__PURE__ */ React57.createElement(
|
5120
5225
|
Tabs.Trigger,
|
5121
5226
|
{
|
5122
5227
|
value: SIDE_PANE_OPTIONS.CHAT,
|
@@ -5126,7 +5231,7 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5126
5231
|
})
|
5127
5232
|
},
|
5128
5233
|
"Chat"
|
5129
|
-
), /* @__PURE__ */
|
5234
|
+
), /* @__PURE__ */ React57.createElement(
|
5130
5235
|
Tabs.Trigger,
|
5131
5236
|
{
|
5132
5237
|
value: SIDE_PANE_OPTIONS.PARTICIPANTS,
|
@@ -5135,14 +5240,13 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5135
5240
|
color: activeTab !== SIDE_PANE_OPTIONS.PARTICIPANTS ? "$on_surface_low" : "$on_surface_high"
|
5136
5241
|
})
|
5137
5242
|
},
|
5138
|
-
"Participants
|
5139
|
-
peerCount
|
5140
|
-
")"
|
5243
|
+
"Participants ",
|
5244
|
+
/* @__PURE__ */ React57.createElement(ParticipantCount2, { count: peerCount })
|
5141
5245
|
)),
|
5142
|
-
/* @__PURE__ */
|
5143
|
-
/* @__PURE__ */
|
5246
|
+
/* @__PURE__ */ React57.createElement(Tabs.Content, { value: SIDE_PANE_OPTIONS.PARTICIPANTS, css: { p: 0 } }, /* @__PURE__ */ React57.createElement(ParticipantList, null)),
|
5247
|
+
/* @__PURE__ */ React57.createElement(Tabs.Content, { value: SIDE_PANE_OPTIONS.CHAT, css: { p: 0 } }, /* @__PURE__ */ React57.createElement(Chat, { screenType }))
|
5144
5248
|
)),
|
5145
|
-
isOverlayChat && isChatOpen ? null : /* @__PURE__ */
|
5249
|
+
isOverlayChat && isChatOpen ? null : /* @__PURE__ */ React57.createElement(
|
5146
5250
|
IconButton,
|
5147
5251
|
{
|
5148
5252
|
css: { position: "absolute", right: "$10", top: "$11", "@md": { top: "$8", right: "$8" } },
|
@@ -5156,13 +5260,13 @@ var SidePaneTabs = React55.memo(({ active = SIDE_PANE_OPTIONS.CHAT, screenType,
|
|
5156
5260
|
},
|
5157
5261
|
"data-testid": "close_chat"
|
5158
5262
|
},
|
5159
|
-
/* @__PURE__ */
|
5263
|
+
/* @__PURE__ */ React57.createElement(CrossIcon7, null)
|
5160
5264
|
)
|
5161
5265
|
);
|
5162
5266
|
});
|
5163
5267
|
|
5164
5268
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
5165
|
-
import
|
5269
|
+
import React59, { Fragment as Fragment10, useState as useState34 } from "react";
|
5166
5270
|
import { selectPermissions as selectPermissions11, useHMSStore as useHMSStore32, useRecordingStreaming as useRecordingStreaming7 } from "@100mslive/react-sdk";
|
5167
5271
|
import { ColoredHandIcon, CrossIcon as CrossIcon8, GoLiveIcon as GoLiveIcon3 } from "@100mslive/react-icons";
|
5168
5272
|
|
@@ -5170,8 +5274,8 @@ import { ColoredHandIcon, CrossIcon as CrossIcon8, GoLiveIcon as GoLiveIcon3 } f
|
|
5170
5274
|
var rtmp_default = "data:image/png;base64,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";
|
5171
5275
|
|
5172
5276
|
// src/Prebuilt/components/Streaming/HLSStreaming.jsx
|
5173
|
-
import
|
5174
|
-
import { selectRoomID, useHMSActions as
|
5277
|
+
import React58, { Fragment as Fragment9, useCallback as useCallback15, useEffect as useEffect23, useState as useState33 } from "react";
|
5278
|
+
import { selectRoomID, useHMSActions as useHMSActions20, useHMSStore as useHMSStore31, useRecordingStreaming as useRecordingStreaming6 } from "@100mslive/react-sdk";
|
5175
5279
|
import {
|
5176
5280
|
EndStreamIcon as EndStreamIcon2,
|
5177
5281
|
EyeOpenIcon,
|
@@ -5190,7 +5294,7 @@ var getCardData = (roleName, roomId) => {
|
|
5190
5294
|
data3 = {
|
5191
5295
|
title: formattedRoleName,
|
5192
5296
|
content: "Broadcasters can livestream audio or video, manage stream appearance and control the room via HLS.",
|
5193
|
-
icon: /* @__PURE__ */
|
5297
|
+
icon: /* @__PURE__ */ React58.createElement(SupportIcon, null)
|
5194
5298
|
};
|
5195
5299
|
break;
|
5196
5300
|
}
|
@@ -5198,7 +5302,7 @@ var getCardData = (roleName, roomId) => {
|
|
5198
5302
|
data3 = {
|
5199
5303
|
title: "HLS Viewer",
|
5200
5304
|
content: "Viewers can view and send chat messages, but need to be made broadcasters to participate with audio or video.",
|
5201
|
-
icon: /* @__PURE__ */
|
5305
|
+
icon: /* @__PURE__ */ React58.createElement(EyeOpenIcon, null)
|
5202
5306
|
};
|
5203
5307
|
break;
|
5204
5308
|
}
|
@@ -5206,7 +5310,7 @@ var getCardData = (roleName, roomId) => {
|
|
5206
5310
|
data3 = {
|
5207
5311
|
title: formattedRoleName,
|
5208
5312
|
content: `${formattedRoleName} is customised with specific permissions, which will determine how it interacts with this room.`,
|
5209
|
-
icon: /* @__PURE__ */
|
5313
|
+
icon: /* @__PURE__ */ React58.createElement(WrenchIcon, null),
|
5210
5314
|
order: 1
|
5211
5315
|
};
|
5212
5316
|
}
|
@@ -5215,7 +5319,7 @@ var getCardData = (roleName, roomId) => {
|
|
5215
5319
|
};
|
5216
5320
|
var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
5217
5321
|
const [copied, setCopied] = useState33(false);
|
5218
|
-
return isHLSRunning ? /* @__PURE__ */
|
5322
|
+
return isHLSRunning ? /* @__PURE__ */ React58.createElement(
|
5219
5323
|
Box,
|
5220
5324
|
{
|
5221
5325
|
key: title,
|
@@ -5226,9 +5330,9 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5226
5330
|
borderRadius: "$2"
|
5227
5331
|
}
|
5228
5332
|
},
|
5229
|
-
/* @__PURE__ */
|
5230
|
-
/* @__PURE__ */
|
5231
|
-
/* @__PURE__ */
|
5333
|
+
/* @__PURE__ */ React58.createElement(Flex, { align: "center", gap: "2", css: { color: "$primary_bright" } }, icon, /* @__PURE__ */ React58.createElement(Text, { variant: "h6", css: { fontWeight: "$semiBold" } }, title)),
|
5334
|
+
/* @__PURE__ */ React58.createElement(Text, { variant: "sm", css: { color: "$on_surface_medium", mt: "$6" } }, content),
|
5335
|
+
/* @__PURE__ */ React58.createElement(
|
5232
5336
|
Button,
|
5233
5337
|
{
|
5234
5338
|
variant: "standard",
|
@@ -5240,7 +5344,7 @@ var Card = ({ title, icon, link, content, isHLSRunning, order = 0 }) => {
|
|
5240
5344
|
css: { w: "100%", r: "$1", mt: "$10", fontWeight: "$semiBold" },
|
5241
5345
|
icon: true
|
5242
5346
|
},
|
5243
|
-
copied ? /* @__PURE__ */
|
5347
|
+
copied ? /* @__PURE__ */ React58.createElement(React58.Fragment, null, "Link copied!") : /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(LinkIcon, { style: { color: "inherit" } }), "Copy Invite Link")
|
5244
5348
|
)
|
5245
5349
|
) : null;
|
5246
5350
|
};
|
@@ -5250,12 +5354,12 @@ var HLSStreaming = ({ onBack }) => {
|
|
5250
5354
|
const cards = roleNames.map((roleName) => getCardData(roleName, roomId));
|
5251
5355
|
const { isHLSRunning } = useRecordingStreaming6();
|
5252
5356
|
const [showLinks, setShowLinks] = useState33(false);
|
5253
|
-
return !showLinks ? /* @__PURE__ */
|
5357
|
+
return !showLinks ? /* @__PURE__ */ React58.createElement(Container, { rounded: true }, /* @__PURE__ */ React58.createElement(ContentHeader, { title: "Start Streaming", content: "HLS", onBack }), /* @__PURE__ */ React58.createElement(ContentBody, { title: "HLS Streaming", Icon: GoLiveIcon2, removeVerticalPadding: true }, "Stream directly from the browser using any device with multiple hosts and real-time messaging, all within this platform."), isHLSRunning ? /* @__PURE__ */ React58.createElement(EndHLS, { setShowLinks }) : /* @__PURE__ */ React58.createElement(StartHLS, null)) : /* @__PURE__ */ React58.createElement(Container, { rounded: true }, /* @__PURE__ */ React58.createElement(ContentHeader, { title: "Invite People", content: "Start the conversation", onBack: () => setShowLinks(false) }), /* @__PURE__ */ React58.createElement(Flex, { direction: "column", css: { gap: "$10", p: "$0 $10", overflowY: "auto", mb: "$10" } }, cards.map((card) => /* @__PURE__ */ React58.createElement(Card, __spreadProps(__spreadValues({ key: card.title }, card), { isHLSRunning })))));
|
5254
5358
|
};
|
5255
5359
|
var StartHLS = () => {
|
5256
5360
|
const [record, setRecord] = useState33(false);
|
5257
5361
|
const [error, setError] = useState33(false);
|
5258
|
-
const hmsActions =
|
5362
|
+
const hmsActions = useHMSActions20();
|
5259
5363
|
const [isHLSStarted, setHLSStarted] = useSetAppDataByKey(APP_DATA.hlsStarted);
|
5260
5364
|
const startHLS = useCallback15(
|
5261
5365
|
(variants) => __async(void 0, null, function* () {
|
@@ -5276,7 +5380,7 @@ var StartHLS = () => {
|
|
5276
5380
|
}),
|
5277
5381
|
[hmsActions, record, isHLSStarted, setHLSStarted]
|
5278
5382
|
);
|
5279
|
-
return /* @__PURE__ */
|
5383
|
+
return /* @__PURE__ */ React58.createElement(Fragment9, null, /* @__PURE__ */ React58.createElement(RecordStream, { record, setRecord, testId: "hls-recording" }), /* @__PURE__ */ React58.createElement(Box, { css: { p: "$4 $10" } }, /* @__PURE__ */ React58.createElement(ErrorText, { error }), /* @__PURE__ */ React58.createElement(
|
5280
5384
|
Button,
|
5281
5385
|
{
|
5282
5386
|
"data-testid": "start_hls",
|
@@ -5285,21 +5389,21 @@ var StartHLS = () => {
|
|
5285
5389
|
onClick: () => startHLS(),
|
5286
5390
|
disabled: isHLSStarted
|
5287
5391
|
},
|
5288
|
-
isHLSStarted ? /* @__PURE__ */
|
5392
|
+
isHLSStarted ? /* @__PURE__ */ React58.createElement(Loading, { size: 24, color: "currentColor" }) : /* @__PURE__ */ React58.createElement(GoLiveIcon2, null),
|
5289
5393
|
isHLSStarted ? "Starting stream..." : "Go Live"
|
5290
|
-
)), /* @__PURE__ */
|
5394
|
+
)), /* @__PURE__ */ React58.createElement(Flex, { align: "center", css: { p: "$4 $10" } }, /* @__PURE__ */ React58.createElement(Text, null, /* @__PURE__ */ React58.createElement(InfoIcon4, { width: 16, height: 16 })), /* @__PURE__ */ React58.createElement(Text, { variant: "tiny", color: "$on_surface_medium", css: { mx: "$8" } }, "You cannot start recording once the stream starts, you will have to stop the stream to enable recording.")));
|
5291
5395
|
};
|
5292
5396
|
var EndHLS = ({ setShowLinks }) => {
|
5293
|
-
const hmsActions =
|
5397
|
+
const hmsActions = useHMSActions20();
|
5294
5398
|
const [inProgress, setInProgress] = useState33(false);
|
5295
5399
|
const [error, setError] = useState33("");
|
5296
5400
|
const { isHLSRunning } = useRecordingStreaming6();
|
5297
|
-
|
5401
|
+
useEffect23(() => {
|
5298
5402
|
if (inProgress && !isHLSRunning) {
|
5299
5403
|
setInProgress(false);
|
5300
5404
|
}
|
5301
5405
|
}, [inProgress, isHLSRunning]);
|
5302
|
-
return /* @__PURE__ */
|
5406
|
+
return /* @__PURE__ */ React58.createElement(Box, { css: { p: "$4 $10" } }, /* @__PURE__ */ React58.createElement(ErrorText, { error }), /* @__PURE__ */ React58.createElement(
|
5303
5407
|
Button,
|
5304
5408
|
{
|
5305
5409
|
"data-testid": "stop_hls",
|
@@ -5318,9 +5422,9 @@ var EndHLS = ({ setShowLinks }) => {
|
|
5318
5422
|
}
|
5319
5423
|
})
|
5320
5424
|
},
|
5321
|
-
/* @__PURE__ */
|
5425
|
+
/* @__PURE__ */ React58.createElement(EndStreamIcon2, null),
|
5322
5426
|
"End Stream"
|
5323
|
-
), /* @__PURE__ */
|
5427
|
+
), /* @__PURE__ */ React58.createElement(Button, { icon: true, css: { w: "100%", r: "$0", mt: "$8" }, onClick: () => setShowLinks(true) }, /* @__PURE__ */ React58.createElement(PeopleIcon3, null), " Invite People"));
|
5324
5428
|
};
|
5325
5429
|
|
5326
5430
|
// src/Prebuilt/components/Streaming/StreamingLanding.jsx
|
@@ -5334,7 +5438,7 @@ var StreamingLanding = () => {
|
|
5334
5438
|
toggleStreaming();
|
5335
5439
|
return null;
|
5336
5440
|
}
|
5337
|
-
return /* @__PURE__ */
|
5441
|
+
return /* @__PURE__ */ React59.createElement(Fragment10, null, /* @__PURE__ */ React59.createElement(Flex, { css: { w: "100%", py: "$8" } }, /* @__PURE__ */ React59.createElement(
|
5338
5442
|
Box,
|
5339
5443
|
{
|
5340
5444
|
css: {
|
@@ -5344,8 +5448,8 @@ var StreamingLanding = () => {
|
|
5344
5448
|
r: "$round"
|
5345
5449
|
}
|
5346
5450
|
},
|
5347
|
-
/* @__PURE__ */
|
5348
|
-
), /* @__PURE__ */
|
5451
|
+
/* @__PURE__ */ React59.createElement(ColoredHandIcon, { width: 40, height: 40 })
|
5452
|
+
), /* @__PURE__ */ React59.createElement(Box, { css: { flex: "1 1 0", mx: "$8" } }, /* @__PURE__ */ React59.createElement(Text, { variant: "sm" }, "Welcome !"), /* @__PURE__ */ React59.createElement(Text, { variant: "h6" }, "Let\u2019s get you started")), /* @__PURE__ */ React59.createElement(IconButton_default, { onClick: toggleStreaming, css: { alignSelf: "flex-start" }, "data-testid": "close_streaming" }, /* @__PURE__ */ React59.createElement(CrossIcon8, null))), /* @__PURE__ */ React59.createElement(Text, { variant: "tiny", color: "$on_surface_medium" }, "Start Streaming"), (permissions == null ? void 0 : permissions.hlsStreaming) && /* @__PURE__ */ React59.createElement(
|
5349
5453
|
StreamCard,
|
5350
5454
|
{
|
5351
5455
|
testId: "hls_stream",
|
@@ -5355,7 +5459,7 @@ var StreamingLanding = () => {
|
|
5355
5459
|
onClick: () => setShowHLS(true),
|
5356
5460
|
Icon: GoLiveIcon3
|
5357
5461
|
}
|
5358
|
-
), (permissions == null ? void 0 : permissions.rtmpStreaming) && /* @__PURE__ */
|
5462
|
+
), (permissions == null ? void 0 : permissions.rtmpStreaming) && /* @__PURE__ */ React59.createElement(
|
5359
5463
|
StreamCard,
|
5360
5464
|
{
|
5361
5465
|
testId: "rtmp_stream",
|
@@ -5367,7 +5471,7 @@ var StreamingLanding = () => {
|
|
5367
5471
|
},
|
5368
5472
|
imgSrc: rtmp_default
|
5369
5473
|
}
|
5370
|
-
), showHLS && /* @__PURE__ */
|
5474
|
+
), showHLS && /* @__PURE__ */ React59.createElement(HLSStreaming, { onBack: () => setShowHLS(false) }), showRTMP && /* @__PURE__ */ React59.createElement(RTMPStreaming, { onBack: () => setShowRTMP(false) }));
|
5371
5475
|
};
|
5372
5476
|
|
5373
5477
|
// src/Prebuilt/layouts/SidePane.tsx
|
@@ -5377,16 +5481,16 @@ var SidePane = ({
|
|
5377
5481
|
hideControls = false
|
5378
5482
|
}) => {
|
5379
5483
|
var _a, _b;
|
5380
|
-
const isMobile =
|
5484
|
+
const isMobile = useMedia16(config.media.md);
|
5381
5485
|
const sidepane = useHMSStore33(selectAppData3(APP_DATA.sidePane));
|
5382
5486
|
const activeScreensharePeerId = useHMSStore33(selectAppData3(APP_DATA.activeScreensharePeerId));
|
5383
5487
|
const trackId = (_a = useHMSStore33(selectVideoTrackByPeerID(activeScreensharePeerId))) == null ? void 0 : _a.id;
|
5384
5488
|
const { elements } = useRoomLayoutConferencingScreen();
|
5385
5489
|
let ViewComponent;
|
5386
5490
|
if (sidepane === SIDE_PANE_OPTIONS.PARTICIPANTS || sidepane === SIDE_PANE_OPTIONS.CHAT) {
|
5387
|
-
ViewComponent = /* @__PURE__ */
|
5491
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(SidePaneTabs, { screenType, hideControls, active: sidepane });
|
5388
5492
|
} else if (sidepane === SIDE_PANE_OPTIONS.STREAMING) {
|
5389
|
-
ViewComponent = /* @__PURE__ */
|
5493
|
+
ViewComponent = /* @__PURE__ */ React60.createElement(StreamingLanding, null);
|
5390
5494
|
}
|
5391
5495
|
if (!ViewComponent && !trackId) {
|
5392
5496
|
return null;
|
@@ -5399,7 +5503,7 @@ var SidePane = ({
|
|
5399
5503
|
objectFit: tileProps == null ? void 0 : tileProps.video_object_fit
|
5400
5504
|
};
|
5401
5505
|
const mwebStreamingChat = isMobile && sidepane === SIDE_PANE_OPTIONS.CHAT && ((_b = elements == null ? void 0 : elements.chat) == null ? void 0 : _b.is_overlay);
|
5402
|
-
return /* @__PURE__ */
|
5506
|
+
return /* @__PURE__ */ React60.createElement(
|
5403
5507
|
Flex,
|
5404
5508
|
{
|
5405
5509
|
direction: "column",
|
@@ -5412,17 +5516,16 @@ var SidePane = ({
|
|
5412
5516
|
"@md": { position: mwebStreamingChat ? "absolute" : "", zIndex: 12 }
|
5413
5517
|
}
|
5414
5518
|
},
|
5415
|
-
trackId && /* @__PURE__ */
|
5519
|
+
trackId && /* @__PURE__ */ React60.createElement(
|
5416
5520
|
VideoTile_default,
|
5417
5521
|
__spreadValues({
|
5418
5522
|
peerId: activeScreensharePeerId,
|
5419
5523
|
trackId,
|
5420
|
-
width: "100%",
|
5421
5524
|
height: 225,
|
5422
5525
|
rootCSS: { p: 0, alignSelf: "start", flexShrink: 0 }
|
5423
5526
|
}, tileLayout)
|
5424
5527
|
),
|
5425
|
-
!!ViewComponent && /* @__PURE__ */
|
5528
|
+
!!ViewComponent && /* @__PURE__ */ React60.createElement(
|
5426
5529
|
Box,
|
5427
5530
|
{
|
5428
5531
|
css: {
|
@@ -5458,10 +5561,10 @@ var SidePane = ({
|
|
5458
5561
|
var SidePane_default = SidePane;
|
5459
5562
|
|
5460
5563
|
// src/Prebuilt/layouts/WaitingView.jsx
|
5461
|
-
import
|
5564
|
+
import React61 from "react";
|
5462
5565
|
import { ColoredTimeIcon } from "@100mslive/react-icons";
|
5463
|
-
var WaitingView =
|
5464
|
-
return /* @__PURE__ */
|
5566
|
+
var WaitingView = React61.memo(() => {
|
5567
|
+
return /* @__PURE__ */ React61.createElement(
|
5465
5568
|
Box,
|
5466
5569
|
{
|
5467
5570
|
css: {
|
@@ -5475,7 +5578,7 @@ var WaitingView = React59.memo(() => {
|
|
5475
5578
|
},
|
5476
5579
|
"data-testid": "waiting_view"
|
5477
5580
|
},
|
5478
|
-
/* @__PURE__ */
|
5581
|
+
/* @__PURE__ */ React61.createElement(
|
5479
5582
|
Flex,
|
5480
5583
|
{
|
5481
5584
|
align: "center",
|
@@ -5489,8 +5592,8 @@ var WaitingView = React59.memo(() => {
|
|
5489
5592
|
gap: "$8"
|
5490
5593
|
}
|
5491
5594
|
},
|
5492
|
-
/* @__PURE__ */
|
5493
|
-
/* @__PURE__ */
|
5595
|
+
/* @__PURE__ */ React61.createElement(ColoredTimeIcon, { width: "80px", height: "80px" }),
|
5596
|
+
/* @__PURE__ */ React61.createElement(
|
5494
5597
|
Flex,
|
5495
5598
|
{
|
5496
5599
|
direction: "column",
|
@@ -5500,28 +5603,28 @@ var WaitingView = React59.memo(() => {
|
|
5500
5603
|
gap: "$4"
|
5501
5604
|
}
|
5502
5605
|
},
|
5503
|
-
/* @__PURE__ */
|
5504
|
-
/* @__PURE__ */
|
5606
|
+
/* @__PURE__ */ React61.createElement(Text, { color: "white", variant: "h6", css: { "@md": { fontSize: "$md" } } }, "Please wait"),
|
5607
|
+
/* @__PURE__ */ React61.createElement(Text, { color: "$on_surface_medium", css: { mt: "$4", "@md": { fontSize: "$sm" } } }, "Sit back and relax till others let you join.")
|
5505
5608
|
)
|
5506
5609
|
)
|
5507
5610
|
);
|
5508
5611
|
});
|
5509
5612
|
|
5510
5613
|
// src/Prebuilt/layouts/VideoStreamingSection.tsx
|
5511
|
-
var HLSView =
|
5614
|
+
var HLSView = React62.lazy(() => import("./HLSView-3S74KF3A.js"));
|
5512
5615
|
var VideoStreamingSection = ({
|
5513
5616
|
screenType,
|
5514
5617
|
elements,
|
5515
5618
|
hideControls = false
|
5516
5619
|
}) => {
|
5517
5620
|
var _a, _b;
|
5518
|
-
const localPeerRole = useHMSStore34(
|
5621
|
+
const localPeerRole = useHMSStore34(selectLocalPeerRoleName3);
|
5519
5622
|
const isConnected = useHMSStore34(selectIsConnectedToRoom6);
|
5520
|
-
const hmsActions =
|
5623
|
+
const hmsActions = useHMSActions21();
|
5521
5624
|
const waitingViewerRole = useWaitingViewerRole();
|
5522
5625
|
const urlToIframe = useUrlToEmbed();
|
5523
5626
|
const pdfAnnotatorActive = usePDFAnnotator();
|
5524
|
-
|
5627
|
+
useEffect24(() => {
|
5525
5628
|
if (!isConnected) {
|
5526
5629
|
return;
|
5527
5630
|
}
|
@@ -5532,17 +5635,17 @@ var VideoStreamingSection = ({
|
|
5532
5635
|
}
|
5533
5636
|
let ViewComponent;
|
5534
5637
|
if (screenType === "hls_live_streaming") {
|
5535
|
-
ViewComponent = /* @__PURE__ */
|
5638
|
+
ViewComponent = /* @__PURE__ */ React62.createElement(HLSView, null);
|
5536
5639
|
} else if (localPeerRole === waitingViewerRole) {
|
5537
|
-
ViewComponent = /* @__PURE__ */
|
5640
|
+
ViewComponent = /* @__PURE__ */ React62.createElement(WaitingView, null);
|
5538
5641
|
} else if (pdfAnnotatorActive) {
|
5539
|
-
ViewComponent = /* @__PURE__ */
|
5642
|
+
ViewComponent = /* @__PURE__ */ React62.createElement(PDFView, null);
|
5540
5643
|
} else if (urlToIframe) {
|
5541
|
-
ViewComponent = /* @__PURE__ */
|
5644
|
+
ViewComponent = /* @__PURE__ */ React62.createElement(EmbedView, null);
|
5542
5645
|
} else {
|
5543
|
-
ViewComponent = /* @__PURE__ */
|
5646
|
+
ViewComponent = /* @__PURE__ */ React62.createElement(GridLayout, __spreadValues({}, (_a = elements == null ? void 0 : elements.video_tile_layout) == null ? void 0 : _a.grid));
|
5544
5647
|
}
|
5545
|
-
return /* @__PURE__ */
|
5648
|
+
return /* @__PURE__ */ React62.createElement(Suspense2, { fallback: /* @__PURE__ */ React62.createElement(FullPageProgress_default, null) }, /* @__PURE__ */ React62.createElement(
|
5546
5649
|
Flex,
|
5547
5650
|
{
|
5548
5651
|
css: {
|
@@ -5552,7 +5655,7 @@ var VideoStreamingSection = ({
|
|
5552
5655
|
}
|
5553
5656
|
},
|
5554
5657
|
ViewComponent,
|
5555
|
-
/* @__PURE__ */
|
5658
|
+
/* @__PURE__ */ React62.createElement(
|
5556
5659
|
SidePane_default,
|
5557
5660
|
{
|
5558
5661
|
screenType,
|
@@ -5563,79 +5666,6 @@ var VideoStreamingSection = ({
|
|
5563
5666
|
));
|
5564
5667
|
};
|
5565
5668
|
|
5566
|
-
// src/Prebuilt/components/RoleChangeRequestModal.tsx
|
5567
|
-
import React61, { useEffect as useEffect24 } from "react";
|
5568
|
-
import {
|
5569
|
-
selectLocalPeerName,
|
5570
|
-
selectLocalPeerRoleName as selectLocalPeerRoleName3,
|
5571
|
-
selectRoleChangeRequest,
|
5572
|
-
useCustomEvent as useCustomEvent2,
|
5573
|
-
useHMSActions as useHMSActions21,
|
5574
|
-
useHMSStore as useHMSStore35
|
5575
|
-
} from "@100mslive/react-sdk";
|
5576
|
-
var RoleChangeRequestModal = () => {
|
5577
|
-
const hmsActions = useHMSActions21();
|
5578
|
-
const { updateMetaData } = useMyMetadata();
|
5579
|
-
const currentRole = useHMSStore35(selectLocalPeerRoleName3);
|
5580
|
-
const roleChangeRequest = useHMSStore35(selectRoleChangeRequest);
|
5581
|
-
const name = useHMSStore35(selectLocalPeerName);
|
5582
|
-
const { sendEvent } = useCustomEvent2({ type: ROLE_CHANGE_DECLINED });
|
5583
|
-
useEffect24(() => {
|
5584
|
-
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5585
|
-
return;
|
5586
|
-
}
|
5587
|
-
(() => __async(void 0, null, function* () {
|
5588
|
-
yield hmsActions.preview({ asRole: roleChangeRequest.role.name });
|
5589
|
-
}))();
|
5590
|
-
}, [hmsActions, roleChangeRequest, currentRole, updateMetaData]);
|
5591
|
-
if (!(roleChangeRequest == null ? void 0 : roleChangeRequest.role)) {
|
5592
|
-
return null;
|
5593
|
-
}
|
5594
|
-
const body = /* @__PURE__ */ React61.createElement(React61.Fragment, null, /* @__PURE__ */ React61.createElement(Text, { css: { fontWeight: 400, c: "$on_surface_medium", textAlign: "center" } }, "Setup your audio and video before joining"), /* @__PURE__ */ React61.createElement(
|
5595
|
-
Flex,
|
5596
|
-
{
|
5597
|
-
align: "center",
|
5598
|
-
justify: "center",
|
5599
|
-
css: {
|
5600
|
-
"@sm": { width: "100%" },
|
5601
|
-
flexDirection: "column",
|
5602
|
-
mt: "$6"
|
5603
|
-
}
|
5604
|
-
},
|
5605
|
-
/* @__PURE__ */ React61.createElement(PreviewTile, { name: name || "" }),
|
5606
|
-
/* @__PURE__ */ React61.createElement(PreviewControls, { hideSettings: true })
|
5607
|
-
));
|
5608
|
-
return /* @__PURE__ */ React61.createElement(
|
5609
|
-
RequestDialog,
|
5610
|
-
{
|
5611
|
-
title: `You're invited to join the ${roleChangeRequest.role.name} role`,
|
5612
|
-
onOpenChange: (value) => __async(void 0, null, function* () {
|
5613
|
-
var _a;
|
5614
|
-
if (!value) {
|
5615
|
-
yield hmsActions.rejectChangeRole(roleChangeRequest);
|
5616
|
-
sendEvent(__spreadProps(__spreadValues({}, roleChangeRequest), { peerName: name }), { peerId: (_a = roleChangeRequest.requestedBy) == null ? void 0 : _a.id });
|
5617
|
-
yield hmsActions.cancelMidCallPreview();
|
5618
|
-
yield updateMetaData({ isHandRaised: false });
|
5619
|
-
}
|
5620
|
-
}),
|
5621
|
-
body,
|
5622
|
-
onAction: () => __async(void 0, null, function* () {
|
5623
|
-
yield hmsActions.acceptChangeRole(roleChangeRequest);
|
5624
|
-
yield updateMetaData({ isHandRaised: false, prevRole: currentRole });
|
5625
|
-
}),
|
5626
|
-
actionText: "Accept"
|
5627
|
-
}
|
5628
|
-
);
|
5629
|
-
};
|
5630
|
-
var RequestDialog = ({
|
5631
|
-
open = true,
|
5632
|
-
onOpenChange,
|
5633
|
-
title,
|
5634
|
-
body,
|
5635
|
-
actionText = "Accept",
|
5636
|
-
onAction
|
5637
|
-
}) => /* @__PURE__ */ React61.createElement(Dialog.Root, { open, onOpenChange }, /* @__PURE__ */ React61.createElement(Dialog.Portal, null, /* @__PURE__ */ React61.createElement(Dialog.Overlay, null), /* @__PURE__ */ React61.createElement(Dialog.Content, { css: { p: "$10" } }, /* @__PURE__ */ React61.createElement(Dialog.Title, { css: { p: 0, display: "flex", flexDirection: "row", gap: "$md", justifyContent: "center" } }, /* @__PURE__ */ React61.createElement(Text, { variant: "h6" }, title)), /* @__PURE__ */ React61.createElement(Box, { css: { mt: "$4", mb: "$10" } }, body), /* @__PURE__ */ React61.createElement(Flex, { justify: "center", align: "center", css: { width: "100%", gap: "$md" } }, /* @__PURE__ */ React61.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React61.createElement(Dialog.Close, { css: { width: "100%" } }, /* @__PURE__ */ React61.createElement(Button, { variant: "standard", outlined: true, css: { width: "100%" } }, "Cancel"))), /* @__PURE__ */ React61.createElement(Box, { css: { width: "50%" } }, /* @__PURE__ */ React61.createElement(Button, { variant: "primary", css: { width: "100%" }, onClick: onAction }, actionText))))));
|
5638
|
-
|
5639
5669
|
// src/Prebuilt/components/conference.jsx
|
5640
5670
|
var Conference = () => {
|
5641
5671
|
var _a, _b, _c, _d, _e;
|
@@ -5644,12 +5674,12 @@ var Conference = () => {
|
|
5644
5674
|
const { userName, endpoints } = useHMSPrebuiltContext();
|
5645
5675
|
const screenProps = useRoomLayoutConferencingScreen();
|
5646
5676
|
const { isPreviewScreenEnabled } = useRoomLayoutPreviewScreen();
|
5647
|
-
const roomState =
|
5677
|
+
const roomState = useHMSStore35(selectRoomState);
|
5648
5678
|
const prevState = usePrevious(roomState);
|
5649
|
-
const isConnectedToRoom =
|
5679
|
+
const isConnectedToRoom = useHMSStore35(selectIsConnectedToRoom7);
|
5650
5680
|
const hmsActions = useHMSActions22();
|
5651
5681
|
const [hideControls, setHideControls] = useState35(false);
|
5652
|
-
const dropdownList =
|
5682
|
+
const dropdownList = useHMSStore35(selectAppData4(APP_DATA.dropdownList));
|
5653
5683
|
const authTokenInAppData = useAuthToken();
|
5654
5684
|
const headerRef = useRef14();
|
5655
5685
|
const footerRef = useRef14();
|
@@ -5714,9 +5744,9 @@ var Conference = () => {
|
|
5714
5744
|
};
|
5715
5745
|
}, []);
|
5716
5746
|
if (!isConnectedToRoom) {
|
5717
|
-
return /* @__PURE__ */
|
5747
|
+
return /* @__PURE__ */ React63.createElement(FullPageProgress_default, { text: "Joining..." });
|
5718
5748
|
}
|
5719
|
-
return /* @__PURE__ */
|
5749
|
+
return /* @__PURE__ */ React63.createElement(React63.Fragment, null, isHLSStarted ? /* @__PURE__ */ React63.createElement(Box, { css: { position: "fixed", zIndex: 100, w: "100%", h: "100%", left: 0, top: 0 } }, /* @__PURE__ */ React63.createElement(FullPageProgress_default, { text: "Starting live stream...", css: { opacity: 0.8, bg: "$background_dim" } })) : null, /* @__PURE__ */ React63.createElement(Flex, { css: { size: "100%", overflow: "hidden" }, direction: "column" }, !screenProps.hideSections.includes("header") && /* @__PURE__ */ React63.createElement(
|
5720
5750
|
Box,
|
5721
5751
|
{
|
5722
5752
|
ref: headerRef,
|
@@ -5730,8 +5760,8 @@ var Conference = () => {
|
|
5730
5760
|
},
|
5731
5761
|
"data-testid": "header"
|
5732
5762
|
},
|
5733
|
-
/* @__PURE__ */
|
5734
|
-
), /* @__PURE__ */
|
5763
|
+
/* @__PURE__ */ React63.createElement(Header, { elements: screenProps.elements, screenType: screenProps.screenType })
|
5764
|
+
), /* @__PURE__ */ React63.createElement(
|
5735
5765
|
Box,
|
5736
5766
|
{
|
5737
5767
|
css: {
|
@@ -5749,7 +5779,7 @@ var Conference = () => {
|
|
5749
5779
|
"data-testid": "conferencing",
|
5750
5780
|
onClick: toggleControls
|
5751
5781
|
},
|
5752
|
-
/* @__PURE__ */
|
5782
|
+
/* @__PURE__ */ React63.createElement(
|
5753
5783
|
VideoStreamingSection,
|
5754
5784
|
{
|
5755
5785
|
screenType: screenProps.screenType,
|
@@ -5757,7 +5787,7 @@ var Conference = () => {
|
|
5757
5787
|
hideControls
|
5758
5788
|
}
|
5759
5789
|
)
|
5760
|
-
), !screenProps.hideSections.includes("footer") && /* @__PURE__ */
|
5790
|
+
), !screenProps.hideSections.includes("footer") && /* @__PURE__ */ React63.createElement(
|
5761
5791
|
Box,
|
5762
5792
|
{
|
5763
5793
|
ref: footerRef,
|
@@ -5774,11 +5804,11 @@ var Conference = () => {
|
|
5774
5804
|
},
|
5775
5805
|
"data-testid": "footer"
|
5776
5806
|
},
|
5777
|
-
/* @__PURE__ */
|
5778
|
-
), /* @__PURE__ */
|
5807
|
+
/* @__PURE__ */ React63.createElement(Footer2, { elements: screenProps.elements, screenType: screenProps.screenType })
|
5808
|
+
), /* @__PURE__ */ React63.createElement(RoleChangeRequestModal, null), /* @__PURE__ */ React63.createElement(HLSFailureModal, null), /* @__PURE__ */ React63.createElement(ActivatedPIP, null)));
|
5779
5809
|
};
|
5780
5810
|
var conference_default = Conference;
|
5781
5811
|
export {
|
5782
5812
|
conference_default as default
|
5783
5813
|
};
|
5784
|
-
//# sourceMappingURL=conference-
|
5814
|
+
//# sourceMappingURL=conference-JNABIZBG.js.map
|