@100mslive/roomkit-react 0.3.22-alpha.2 → 0.3.22-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Accordion/Accordion.d.ts +322 -134
- package/dist/Accordion/index.d.ts +322 -134
- package/dist/Avatar/Avatar.d.ts +141 -47
- package/dist/Button/Button.d.ts +141 -47
- package/dist/Checkbox/Checkbox.d.ts +322 -134
- package/dist/Collapsible/Collapsible.d.ts +483 -201
- package/dist/Divider/Divider.d.ts +322 -134
- package/dist/Dropdown/Dropdown.d.ts +1932 -804
- package/dist/Fieldset/Fieldset.d.ts +141 -47
- package/dist/Footer/Footer.d.ts +1288 -536
- package/dist/{HLSView-XRGOWFRB.js → HLSView-CSOBLYBP.js} +24 -38
- package/dist/HLSView-CSOBLYBP.js.map +7 -0
- package/dist/{PDFView-RJK44WVO.css → HLSView-QZMIDGI4.css} +3 -3
- package/dist/{EmbedView-Y24VRONT.css.map → HLSView-QZMIDGI4.css.map} +1 -1
- package/dist/IconButton/IconButton.d.ts +141 -47
- package/dist/Input/Input.d.ts +926 -362
- package/dist/Label/Label.d.ts +141 -47
- package/dist/Layout/Box.d.ts +141 -47
- package/dist/Layout/Flex.d.ts +141 -47
- package/dist/Link/Link.d.ts +141 -47
- package/dist/Modal/Dialog.d.ts +987 -329
- package/dist/Modal/DialogContent.d.ts +1127 -469
- package/dist/Pagination/StyledPagination.d.ts +644 -268
- package/dist/Popover/index.d.ts +483 -201
- package/dist/Prebuilt/IconButton.d.ts +322 -134
- package/dist/Prebuilt/components/Chat/ChatBody.d.ts +322 -134
- package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +805 -335
- package/dist/Prebuilt/components/Settings/common.d.ts +322 -134
- package/dist/Progress/index.d.ts +322 -134
- package/dist/RadioGroup/RadioGroup.d.ts +483 -201
- package/dist/ReactSelect/ReactSelect.d.ts +1610 -670
- package/dist/Select/Select.d.ts +483 -201
- package/dist/Sheet/Sheet.d.ts +987 -329
- package/dist/Slider/Slider.d.ts +141 -47
- package/dist/Stats/StyledStats.d.ts +966 -402
- package/dist/Switch/Switch.d.ts +141 -47
- package/dist/Tabs/Tabs.d.ts +644 -268
- package/dist/Text/Text.d.ts +141 -47
- package/dist/TextArea/TextArea.d.ts +141 -47
- package/dist/Theme/base.config.d.ts +78 -26
- package/dist/Theme/stitches.config.d.ts +1514 -1067
- package/dist/TileMenu/StyledMenuTile.d.ts +1127 -469
- package/dist/Toast/Toast.d.ts +946 -382
- package/dist/Video/Video.d.ts +141 -47
- package/dist/VideoList/StyledVideoList.d.ts +483 -201
- package/dist/VideoTile/StyledVideoTile.d.ts +1610 -670
- package/dist/chunk-4VBHLZDR.js +34747 -0
- package/dist/chunk-4VBHLZDR.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +22687 -22873
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +15 -25
- package/dist/meta.cjs.json +5125 -5444
- package/dist/meta.esbuild.json +6238 -9055
- package/package.json +8 -8
- package/src/Avatar/Avatar.tsx +1 -1
- package/src/Popover/Popover.stories.tsx +1 -1
- package/src/Prebuilt/App.tsx +2 -6
- package/src/Prebuilt/components/Chat/Chat.tsx +8 -12
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
- package/src/Prebuilt/components/Notifications/Notifications.tsx +159 -11
- package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +2 -23
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +5 -1
- package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +5 -7
- package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +1 -23
- package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +5 -13
- package/src/Prebuilt/components/StatsForNerds.jsx +3 -32
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +31 -43
- package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
- package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +1 -3
- package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +0 -6
- package/src/Prebuilt/layouts/HLSView.jsx +0 -1
- package/src/Prebuilt/layouts/PDFView.jsx +0 -1
- package/src/Prebuilt/layouts/SidePane.tsx +6 -12
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +34 -35
- package/dist/ConferenceScreen-5G5WGPIO.css +0 -2780
- package/dist/ConferenceScreen-5G5WGPIO.css.map +0 -7
- package/dist/ConferenceScreen-KS5URW6Z.js +0 -1778
- package/dist/ConferenceScreen-KS5URW6Z.js.map +0 -7
- package/dist/EmbedView-BCRQ3GHV.js +0 -17
- package/dist/EmbedView-BCRQ3GHV.js.map +0 -7
- package/dist/EmbedView-Y24VRONT.css +0 -2780
- package/dist/EmojiReaction-NA5F5DWN.js +0 -11
- package/dist/EmojiReaction-NA5F5DWN.js.map +0 -7
- package/dist/HLSView-DC43TOIW.css +0 -2780
- package/dist/HLSView-DC43TOIW.css.map +0 -7
- package/dist/HLSView-XRGOWFRB.js.map +0 -7
- package/dist/LeaveScreen-3OZN3MU3.css +0 -2780
- package/dist/LeaveScreen-3OZN3MU3.css.map +0 -7
- package/dist/LeaveScreen-PC4KB6OG.js +0 -556
- package/dist/LeaveScreen-PC4KB6OG.js.map +0 -7
- package/dist/MoreSettings-KTRYHDB2.css +0 -2780
- package/dist/MoreSettings-KTRYHDB2.css.map +0 -7
- package/dist/MoreSettings-XLNYT7PW.js +0 -16
- package/dist/MoreSettings-XLNYT7PW.js.map +0 -7
- package/dist/PDFView-LJ7I3K3H.js +0 -84
- package/dist/PDFView-LJ7I3K3H.js.map +0 -7
- package/dist/PDFView-RJK44WVO.css.map +0 -7
- package/dist/Polls-AULCHMLW.js +0 -1584
- package/dist/Polls-AULCHMLW.js.map +0 -7
- package/dist/Polls-K4GO5ZOC.css +0 -2780
- package/dist/Polls-K4GO5ZOC.css.map +0 -7
- package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +0 -1
- package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +0 -1
- package/dist/RaiseHand-E4OVMBW6.js +0 -10
- package/dist/RaiseHand-E4OVMBW6.js.map +0 -7
- package/dist/RoleProminence-LHUXHLVI.css +0 -2780
- package/dist/RoleProminence-LHUXHLVI.css.map +0 -7
- package/dist/RoleProminence-RWJP2Z36.js +0 -116
- package/dist/RoleProminence-RWJP2Z36.js.map +0 -7
- package/dist/RoomDetailsPane-6BM2FPWW.css +0 -2780
- package/dist/RoomDetailsPane-6BM2FPWW.css.map +0 -7
- package/dist/RoomDetailsPane-7OP2CNJW.js +0 -53
- package/dist/RoomDetailsPane-7OP2CNJW.js.map +0 -7
- package/dist/ScreenshareLayout-RHTD2PQT.css +0 -2780
- package/dist/ScreenshareLayout-RHTD2PQT.css.map +0 -7
- package/dist/ScreenshareLayout-TM7DLYLH.js +0 -358
- package/dist/ScreenshareLayout-TM7DLYLH.js.map +0 -7
- package/dist/SidePaneTabs-T7BKZ2AT.js +0 -1354
- package/dist/SidePaneTabs-T7BKZ2AT.js.map +0 -7
- package/dist/SidePaneTabs-TBUPHNAU.css +0 -2780
- package/dist/SidePaneTabs-TBUPHNAU.css.map +0 -7
- package/dist/VBPicker-M5VYFEUB.css +0 -2780
- package/dist/VBPicker-M5VYFEUB.css.map +0 -7
- package/dist/VBPicker-TQLIL3NC.js +0 -322
- package/dist/VBPicker-TQLIL3NC.js.map +0 -7
- package/dist/WaitingView-TLJ52XYA.js +0 -10
- package/dist/WaitingView-TLJ52XYA.js.map +0 -7
- package/dist/WhiteboardLayout-PZZTM2FW.css +0 -2780
- package/dist/WhiteboardLayout-PZZTM2FW.css.map +0 -7
- package/dist/WhiteboardLayout-YYZ5UVGG.js +0 -96
- package/dist/WhiteboardLayout-YYZ5UVGG.js.map +0 -7
- package/dist/android-perm-1.png +0 -0
- package/dist/audio-level.png +0 -0
- package/dist/chunk-42XPBCZO.js +0 -487
- package/dist/chunk-42XPBCZO.js.map +0 -7
- package/dist/chunk-4BQ3AMVG.js +0 -16802
- package/dist/chunk-4BQ3AMVG.js.map +0 -7
- package/dist/chunk-4L5OKEIV.js +0 -90
- package/dist/chunk-4L5OKEIV.js.map +0 -7
- package/dist/chunk-6BX3VCVC.js +0 -6337
- package/dist/chunk-6BX3VCVC.js.map +0 -7
- package/dist/chunk-A3COGXMF.js +0 -114
- package/dist/chunk-A3COGXMF.js.map +0 -7
- package/dist/chunk-B3HHL3ND.js +0 -178
- package/dist/chunk-B3HHL3ND.js.map +0 -7
- package/dist/chunk-B5NLX6N6.js +0 -41
- package/dist/chunk-B5NLX6N6.js.map +0 -7
- package/dist/chunk-BXBPZGSP.js +0 -161
- package/dist/chunk-BXBPZGSP.js.map +0 -7
- package/dist/chunk-DVVFWHQG.js +0 -136
- package/dist/chunk-DVVFWHQG.js.map +0 -7
- package/dist/chunk-GV2DTYSU.js +0 -262
- package/dist/chunk-GV2DTYSU.js.map +0 -7
- package/dist/chunk-KF2YEUWU.js +0 -254
- package/dist/chunk-KF2YEUWU.js.map +0 -7
- package/dist/chunk-KQXTIHI6.js +0 -59
- package/dist/chunk-KQXTIHI6.js.map +0 -7
- package/dist/chunk-MR3HE7HV.js +0 -830
- package/dist/chunk-MR3HE7HV.js.map +0 -7
- package/dist/chunk-OQBTPJPO.js +0 -71
- package/dist/chunk-OQBTPJPO.js.map +0 -7
- package/dist/chunk-P7OOTR7P.js +0 -2595
- package/dist/chunk-P7OOTR7P.js.map +0 -7
- package/dist/chunk-THDU2DKP.js +0 -30
- package/dist/chunk-THDU2DKP.js.map +0 -7
- package/dist/chunk-U4QYH2BP.js +0 -98
- package/dist/chunk-U4QYH2BP.js.map +0 -7
- package/dist/chunk-USEEH3QW.js +0 -418
- package/dist/chunk-USEEH3QW.js.map +0 -7
- package/dist/chunk-UZW3C3ML.js +0 -171
- package/dist/chunk-UZW3C3ML.js.map +0 -7
- package/dist/chunk-YDIB6WKJ.js +0 -576
- package/dist/chunk-YDIB6WKJ.js.map +0 -7
- package/dist/chunk-ZFTULCCP.js +0 -62
- package/dist/chunk-ZFTULCCP.js.map +0 -7
- package/dist/empty-chat.svg +0 -12
- package/dist/ios-perm-0.png +0 -0
- package/dist/pdf-share.png +0 -0
- package/dist/screen-share.png +0 -0
- package/dist/transaction_error.svg +0 -12
- package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +0 -18
- package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +0 -56
- package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +0 -24
- package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +0 -71
package/dist/chunk-UZW3C3ML.js
DELETED
@@ -1,171 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
Pagination,
|
3
|
-
usePagesWithTiles,
|
4
|
-
useVideoTileContext
|
5
|
-
} from "./chunk-B3HHL3ND.js";
|
6
|
-
import {
|
7
|
-
VideoTile_default
|
8
|
-
} from "./chunk-4BQ3AMVG.js";
|
9
|
-
import {
|
10
|
-
Box,
|
11
|
-
Flex
|
12
|
-
} from "./chunk-4L5OKEIV.js";
|
13
|
-
import {
|
14
|
-
APP_DATA,
|
15
|
-
__spreadProps,
|
16
|
-
__spreadValues,
|
17
|
-
config,
|
18
|
-
init_define_process_env
|
19
|
-
} from "./chunk-YDIB6WKJ.js";
|
20
|
-
|
21
|
-
// src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx
|
22
|
-
init_define_process_env();
|
23
|
-
import React from "react";
|
24
|
-
var Root = ({
|
25
|
-
children,
|
26
|
-
edgeToEdge,
|
27
|
-
hasSidebar
|
28
|
-
}) => {
|
29
|
-
return /* @__PURE__ */ React.createElement(
|
30
|
-
Flex,
|
31
|
-
{
|
32
|
-
direction: hasSidebar ? "row" : "column",
|
33
|
-
css: { h: "100%", flex: "1 1 0", minWidth: 0, gap: "$6", "@md": { gap: edgeToEdge ? 0 : "$6" } }
|
34
|
-
},
|
35
|
-
children
|
36
|
-
);
|
37
|
-
};
|
38
|
-
var ProminentSection = ({ children, css = {} }) => {
|
39
|
-
return /* @__PURE__ */ React.createElement(Flex, { direction: "column", css: __spreadValues({ flex: "1 1 0", gap: "$2", minHeight: 0 }, css) }, children);
|
40
|
-
};
|
41
|
-
var SecondarySection = ({
|
42
|
-
tiles,
|
43
|
-
children,
|
44
|
-
edgeToEdge,
|
45
|
-
hasSidebar
|
46
|
-
}) => {
|
47
|
-
const tileLayoutProps = useVideoTileContext();
|
48
|
-
if (!(tiles == null ? void 0 : tiles.length)) {
|
49
|
-
return null;
|
50
|
-
}
|
51
|
-
const gridStyles = hasSidebar ? {
|
52
|
-
gridTemplateColumns: "1fr",
|
53
|
-
gridTemplateRows: `repeat(${tiles.length}, minmax(0, 1fr))`,
|
54
|
-
maxHeight: "100%",
|
55
|
-
width: 240
|
56
|
-
} : {
|
57
|
-
gridTemplateRows: React.Children.count(children) > 0 ? "136px auto" : "154px",
|
58
|
-
gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))`
|
59
|
-
};
|
60
|
-
return /* @__PURE__ */ React.createElement(
|
61
|
-
Box,
|
62
|
-
{
|
63
|
-
css: __spreadProps(__spreadValues({
|
64
|
-
display: "grid",
|
65
|
-
margin: "auto",
|
66
|
-
gap: hasSidebar ? "$8" : "$2 $4",
|
67
|
-
placeItems: "center"
|
68
|
-
}, gridStyles), {
|
69
|
-
"@md": { gap: edgeToEdge ? 0 : "$4" }
|
70
|
-
})
|
71
|
-
},
|
72
|
-
tiles.map((tile) => {
|
73
|
-
var _a, _b, _c, _d;
|
74
|
-
return /* @__PURE__ */ React.createElement(
|
75
|
-
VideoTile_default,
|
76
|
-
__spreadValues({
|
77
|
-
key: ((_a = tile.track) == null ? void 0 : _a.id) || ((_b = tile.peer) == null ? void 0 : _b.id),
|
78
|
-
peerId: (_c = tile.peer) == null ? void 0 : _c.id,
|
79
|
-
trackId: (_d = tile.track) == null ? void 0 : _d.id,
|
80
|
-
rootCSS: __spreadProps(__spreadValues({
|
81
|
-
padding: 0,
|
82
|
-
maxWidth: 240,
|
83
|
-
aspectRatio: "16 / 9"
|
84
|
-
}, hasSidebar ? { w: "100%" } : { h: "100%" }), {
|
85
|
-
"@md": { aspectRatio: "1" }
|
86
|
-
}),
|
87
|
-
objectFit: "contain"
|
88
|
-
}, tileLayoutProps)
|
89
|
-
);
|
90
|
-
}),
|
91
|
-
children && /* @__PURE__ */ React.createElement(Box, { css: { gridColumn: hasSidebar ? 1 : `1/span ${tiles.length}` } }, children)
|
92
|
-
);
|
93
|
-
};
|
94
|
-
var ProminenceLayout = {
|
95
|
-
Root,
|
96
|
-
ProminentSection,
|
97
|
-
SecondarySection
|
98
|
-
};
|
99
|
-
|
100
|
-
// src/Prebuilt/components/SecondaryTiles.tsx
|
101
|
-
init_define_process_env();
|
102
|
-
import React2, { useEffect, useRef, useState } from "react";
|
103
|
-
import { useMedia } from "react-use";
|
104
|
-
import { selectAppData, selectSessionStore, selectTrackByID, useHMSStore } from "@100mslive/react-sdk";
|
105
|
-
var SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge, hasSidebar }) => {
|
106
|
-
var _a, _b;
|
107
|
-
const isMobile = useMedia(config.media.md);
|
108
|
-
const maxTileCount = isMobile ? 2 : 4;
|
109
|
-
const [page, setPage] = useState(0);
|
110
|
-
const pinnedTrackId = useHMSStore(selectAppData(APP_DATA.pinnedTrackId));
|
111
|
-
const spotlightPeerId = useHMSStore(selectSessionStore("spotlight" /* SPOTLIGHT */));
|
112
|
-
const activeScreensharePeerId = useHMSStore(selectAppData(APP_DATA.activeScreensharePeerId));
|
113
|
-
const pinnedPeer = (_a = useHMSStore(selectTrackByID(pinnedTrackId))) == null ? void 0 : _a.peerId;
|
114
|
-
const pageChangedAfterPinning = useRef(false);
|
115
|
-
const pagesWithTiles = usePagesWithTiles({
|
116
|
-
peers: spotlightPeerId || pinnedPeer ? [...peers].sort((p1, p2) => {
|
117
|
-
if (activeScreensharePeerId === p1.id) {
|
118
|
-
return -1;
|
119
|
-
}
|
120
|
-
if (activeScreensharePeerId === p2.id) {
|
121
|
-
return 1;
|
122
|
-
}
|
123
|
-
const peerIdList = [pinnedPeer, spotlightPeerId];
|
124
|
-
if (peerIdList.includes(p1.id)) {
|
125
|
-
return -1;
|
126
|
-
}
|
127
|
-
if (peerIdList.includes(p2.id)) {
|
128
|
-
return 1;
|
129
|
-
}
|
130
|
-
return 0;
|
131
|
-
}) : peers,
|
132
|
-
maxTileCount
|
133
|
-
});
|
134
|
-
const pageSize = ((_b = pagesWithTiles[0]) == null ? void 0 : _b.length) || 0;
|
135
|
-
useEffect(() => {
|
136
|
-
var _a2;
|
137
|
-
if (peers.length > 0 && !((_a2 = pagesWithTiles[page]) == null ? void 0 : _a2.length)) {
|
138
|
-
setPage(Math.max(0, page - 1));
|
139
|
-
}
|
140
|
-
}, [peers, page, pagesWithTiles]);
|
141
|
-
useEffect(() => {
|
142
|
-
if (pageSize > 0) {
|
143
|
-
onPageSize == null ? void 0 : onPageSize(pageSize);
|
144
|
-
}
|
145
|
-
}, [pageSize, onPageSize]);
|
146
|
-
useEffect(() => {
|
147
|
-
if ((pinnedPeer || spotlightPeerId) && page !== 0 && !pageChangedAfterPinning.current) {
|
148
|
-
setPage(0);
|
149
|
-
pageChangedAfterPinning.current = true;
|
150
|
-
} else if (!pinnedPeer && !spotlightPeerId) {
|
151
|
-
pageChangedAfterPinning.current = false;
|
152
|
-
}
|
153
|
-
}, [pinnedPeer, spotlightPeerId, page]);
|
154
|
-
return /* @__PURE__ */ React2.createElement(ProminenceLayout.SecondarySection, { tiles: pagesWithTiles[page], edgeToEdge, hasSidebar }, !edgeToEdge && /* @__PURE__ */ React2.createElement(
|
155
|
-
Pagination,
|
156
|
-
{
|
157
|
-
page,
|
158
|
-
onPageChange: (page2) => {
|
159
|
-
setPage(page2);
|
160
|
-
onPageChange == null ? void 0 : onPageChange(page2);
|
161
|
-
},
|
162
|
-
numPages: pagesWithTiles.length
|
163
|
-
}
|
164
|
-
));
|
165
|
-
};
|
166
|
-
|
167
|
-
export {
|
168
|
-
ProminenceLayout,
|
169
|
-
SecondaryTiles
|
170
|
-
};
|
171
|
-
//# sourceMappingURL=chunk-UZW3C3ML.js.map
|
@@ -1,7 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": 3,
|
3
|
-
"sources": ["../src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx", "../src/Prebuilt/components/SecondaryTiles.tsx"],
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { TrackWithPeerAndDimensions } from '@100mslive/react-sdk';\nimport { Box, Flex } from '../../../Layout';\nimport { CSS } from '../../../Theme';\n// @ts-ignore: No implicit Any\nimport VideoTile from '../VideoTile';\nimport { useVideoTileContext } from '../hooks/useVideoTileLayout';\n\nconst Root = ({\n children,\n edgeToEdge,\n hasSidebar,\n}: React.PropsWithChildren<{ edgeToEdge?: boolean; hasSidebar?: boolean }>) => {\n return (\n <Flex\n direction={hasSidebar ? 'row' : 'column'}\n css={{ h: '100%', flex: '1 1 0', minWidth: 0, gap: '$6', '@md': { gap: edgeToEdge ? 0 : '$6' } }}\n >\n {children}\n </Flex>\n );\n};\n\nconst ProminentSection = ({ children, css = {} }: React.PropsWithChildren<{ css?: CSS }>) => {\n return (\n <Flex direction=\"column\" css={{ flex: '1 1 0', gap: '$2', minHeight: 0, ...css }}>\n {children}\n </Flex>\n );\n};\n\nconst SecondarySection = ({\n tiles,\n children,\n edgeToEdge,\n hasSidebar,\n}: React.PropsWithChildren<{ tiles: TrackWithPeerAndDimensions[]; edgeToEdge?: boolean; hasSidebar?: boolean }>) => {\n const tileLayoutProps = useVideoTileContext();\n if (!tiles?.length) {\n return null;\n }\n const gridStyles = hasSidebar\n ? {\n gridTemplateColumns: '1fr',\n gridTemplateRows: `repeat(${tiles.length}, minmax(0, 1fr))`,\n maxHeight: '100%',\n width: 240,\n }\n : {\n gridTemplateRows: React.Children.count(children) > 0 ? '136px auto' : '154px',\n gridTemplateColumns: `repeat(${tiles.length}, minmax(0, 1fr))`,\n };\n return (\n <Box\n css={{\n display: 'grid',\n margin: 'auto',\n gap: hasSidebar ? '$8' : '$2 $4',\n placeItems: 'center',\n ...gridStyles,\n '@md': { gap: edgeToEdge ? 0 : '$4' },\n }}\n >\n {tiles.map(tile => {\n return (\n <VideoTile\n key={tile.track?.id || tile.peer?.id}\n peerId={tile.peer?.id}\n trackId={tile.track?.id}\n rootCSS={{\n padding: 0,\n maxWidth: 240,\n aspectRatio: '16 / 9',\n ...(hasSidebar ? { w: '100%' } : { h: '100%' }),\n '@md': { aspectRatio: '1' },\n }}\n objectFit=\"contain\"\n {...tileLayoutProps}\n />\n );\n })}\n {children && <Box css={{ gridColumn: hasSidebar ? 1 : `1/span ${tiles.length}` }}>{children}</Box>}\n </Box>\n );\n};\n\nexport const ProminenceLayout = {\n Root,\n ProminentSection,\n SecondarySection,\n};\n", "import React, { useEffect, useRef, useState } from 'react';\nimport { useMedia } from 'react-use';\nimport { selectAppData, selectSessionStore, selectTrackByID, useHMSStore } from '@100mslive/react-sdk';\nimport { LayoutProps } from './VideoLayouts/interface';\nimport { ProminenceLayout } from './VideoLayouts/ProminenceLayout';\nimport { config as cssConfig } from '../../Theme';\nimport { Pagination } from './Pagination';\nimport { usePagesWithTiles } from './hooks/useTileLayout';\nimport { APP_DATA, SESSION_STORE_KEY } from '../common/constants';\n\nexport const SecondaryTiles = ({ peers, onPageChange, onPageSize, edgeToEdge, hasSidebar }: LayoutProps) => {\n const isMobile = useMedia(cssConfig.media.md);\n const maxTileCount = isMobile ? 2 : 4;\n const [page, setPage] = useState(0);\n const pinnedTrackId = useHMSStore(selectAppData(APP_DATA.pinnedTrackId));\n const spotlightPeerId = useHMSStore(selectSessionStore(SESSION_STORE_KEY.SPOTLIGHT));\n const activeScreensharePeerId = useHMSStore(selectAppData(APP_DATA.activeScreensharePeerId));\n const pinnedPeer = useHMSStore(selectTrackByID(pinnedTrackId))?.peerId;\n const pageChangedAfterPinning = useRef(false);\n const pagesWithTiles = usePagesWithTiles({\n peers:\n spotlightPeerId || pinnedPeer\n ? [...peers].sort((p1, p2) => {\n if (activeScreensharePeerId === p1.id) {\n return -1;\n }\n if (activeScreensharePeerId === p2.id) {\n return 1;\n }\n const peerIdList = [pinnedPeer, spotlightPeerId];\n // put active screenshare peer, pinned peer, spotlight peer at first\n if (peerIdList.includes(p1.id)) {\n return -1;\n }\n if (peerIdList.includes(p2.id)) {\n return 1;\n }\n return 0;\n })\n : peers,\n maxTileCount,\n });\n const pageSize = pagesWithTiles[0]?.length || 0;\n\n // Handles final peer leaving from the last page\n useEffect(() => {\n if (peers.length > 0 && !pagesWithTiles[page]?.length) {\n setPage(Math.max(0, page - 1));\n }\n }, [peers, page, pagesWithTiles]);\n\n useEffect(() => {\n if (pageSize > 0) {\n onPageSize?.(pageSize);\n }\n }, [pageSize, onPageSize]);\n\n useEffect(() => {\n if ((pinnedPeer || spotlightPeerId) && page !== 0 && !pageChangedAfterPinning.current) {\n setPage(0);\n pageChangedAfterPinning.current = true;\n } else if (!pinnedPeer && !spotlightPeerId) {\n pageChangedAfterPinning.current = false;\n }\n }, [pinnedPeer, spotlightPeerId, page]);\n\n return (\n <ProminenceLayout.SecondarySection tiles={pagesWithTiles[page]} edgeToEdge={edgeToEdge} hasSidebar={hasSidebar}>\n {!edgeToEdge && (\n <Pagination\n page={page}\n onPageChange={page => {\n setPage(page);\n onPageChange?.(page);\n }}\n numPages={pagesWithTiles.length}\n />\n )}\n </ProminenceLayout.SecondarySection>\n );\n};\n"],
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,WAAW;AAQlB,IAAM,OAAO,CAAC;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AACF,MAA+E;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,aAAa,QAAQ;AAAA,MAChC,K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