@100mslive/roomkit-react 0.3.22-alpha.0 → 0.3.22-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. package/dist/Accordion/Accordion.d.ts +134 -322
  2. package/dist/Accordion/index.d.ts +134 -322
  3. package/dist/Avatar/Avatar.d.ts +47 -141
  4. package/dist/Button/Button.d.ts +47 -141
  5. package/dist/Checkbox/Checkbox.d.ts +134 -322
  6. package/dist/Collapsible/Collapsible.d.ts +201 -483
  7. package/dist/ConferenceScreen-5G5WGPIO.css +2780 -0
  8. package/dist/{HLSView-JYFTZVCM.css.map → ConferenceScreen-5G5WGPIO.css.map} +1 -1
  9. package/dist/ConferenceScreen-KS5URW6Z.js +1778 -0
  10. package/dist/ConferenceScreen-KS5URW6Z.js.map +7 -0
  11. package/dist/Divider/Divider.d.ts +134 -322
  12. package/dist/Dropdown/Dropdown.d.ts +804 -1932
  13. package/dist/EmbedView-BCRQ3GHV.js +17 -0
  14. package/dist/EmbedView-BCRQ3GHV.js.map +7 -0
  15. package/dist/EmbedView-Y24VRONT.css +2780 -0
  16. package/dist/EmbedView-Y24VRONT.css.map +7 -0
  17. package/dist/EmojiReaction-NA5F5DWN.js +11 -0
  18. package/dist/EmojiReaction-NA5F5DWN.js.map +7 -0
  19. package/dist/Fieldset/Fieldset.d.ts +47 -141
  20. package/dist/Footer/Footer.d.ts +536 -1288
  21. package/dist/{HLSView-JYFTZVCM.css → HLSView-DC43TOIW.css} +3 -3
  22. package/dist/HLSView-DC43TOIW.css.map +7 -0
  23. package/dist/{HLSView-EPPGI6XI.js → HLSView-XRGOWFRB.js} +38 -24
  24. package/dist/HLSView-XRGOWFRB.js.map +7 -0
  25. package/dist/IconButton/IconButton.d.ts +47 -141
  26. package/dist/Input/Input.d.ts +362 -926
  27. package/dist/Label/Label.d.ts +47 -141
  28. package/dist/Layout/Box.d.ts +47 -141
  29. package/dist/Layout/Flex.d.ts +47 -141
  30. package/dist/LeaveScreen-3OZN3MU3.css +2780 -0
  31. package/dist/LeaveScreen-3OZN3MU3.css.map +7 -0
  32. package/dist/LeaveScreen-PC4KB6OG.js +556 -0
  33. package/dist/LeaveScreen-PC4KB6OG.js.map +7 -0
  34. package/dist/Link/Link.d.ts +47 -141
  35. package/dist/Modal/Dialog.d.ts +329 -987
  36. package/dist/Modal/DialogContent.d.ts +469 -1127
  37. package/dist/MoreSettings-KTRYHDB2.css +2780 -0
  38. package/dist/MoreSettings-KTRYHDB2.css.map +7 -0
  39. package/dist/MoreSettings-XLNYT7PW.js +16 -0
  40. package/dist/MoreSettings-XLNYT7PW.js.map +7 -0
  41. package/dist/PDFView-LJ7I3K3H.js +84 -0
  42. package/dist/PDFView-LJ7I3K3H.js.map +7 -0
  43. package/dist/PDFView-RJK44WVO.css +2780 -0
  44. package/dist/PDFView-RJK44WVO.css.map +7 -0
  45. package/dist/Pagination/StyledPagination.d.ts +268 -644
  46. package/dist/Polls-AULCHMLW.js +1584 -0
  47. package/dist/Polls-AULCHMLW.js.map +7 -0
  48. package/dist/Polls-K4GO5ZOC.css +2780 -0
  49. package/dist/Polls-K4GO5ZOC.css.map +7 -0
  50. package/dist/Popover/index.d.ts +201 -483
  51. package/dist/Prebuilt/IconButton.d.ts +134 -322
  52. package/dist/Prebuilt/components/Chat/ChatBody.d.ts +134 -322
  53. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +335 -805
  54. package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +1 -0
  55. package/dist/Prebuilt/components/Notifications/DeviceInUseError.d.ts +2 -0
  56. package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +1 -0
  57. package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +1 -0
  58. package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +1 -0
  59. package/dist/Prebuilt/components/Settings/common.d.ts +134 -322
  60. package/dist/Progress/index.d.ts +134 -322
  61. package/dist/RadioGroup/RadioGroup.d.ts +201 -483
  62. package/dist/RaiseHand-E4OVMBW6.js +10 -0
  63. package/dist/RaiseHand-E4OVMBW6.js.map +7 -0
  64. package/dist/ReactSelect/ReactSelect.d.ts +670 -1610
  65. package/dist/RoleProminence-LHUXHLVI.css +2780 -0
  66. package/dist/RoleProminence-LHUXHLVI.css.map +7 -0
  67. package/dist/RoleProminence-RWJP2Z36.js +116 -0
  68. package/dist/RoleProminence-RWJP2Z36.js.map +7 -0
  69. package/dist/RoomDetailsPane-6BM2FPWW.css +2780 -0
  70. package/dist/RoomDetailsPane-6BM2FPWW.css.map +7 -0
  71. package/dist/RoomDetailsPane-7OP2CNJW.js +53 -0
  72. package/dist/RoomDetailsPane-7OP2CNJW.js.map +7 -0
  73. package/dist/ScreenshareLayout-RHTD2PQT.css +2780 -0
  74. package/dist/ScreenshareLayout-RHTD2PQT.css.map +7 -0
  75. package/dist/ScreenshareLayout-TM7DLYLH.js +358 -0
  76. package/dist/ScreenshareLayout-TM7DLYLH.js.map +7 -0
  77. package/dist/Select/Select.d.ts +201 -483
  78. package/dist/Sheet/Sheet.d.ts +329 -987
  79. package/dist/SidePaneTabs-T7BKZ2AT.js +1354 -0
  80. package/dist/SidePaneTabs-T7BKZ2AT.js.map +7 -0
  81. package/dist/SidePaneTabs-TBUPHNAU.css +2780 -0
  82. package/dist/SidePaneTabs-TBUPHNAU.css.map +7 -0
  83. package/dist/Slider/Slider.d.ts +47 -141
  84. package/dist/Stats/StyledStats.d.ts +402 -966
  85. package/dist/Switch/Switch.d.ts +47 -141
  86. package/dist/Tabs/Tabs.d.ts +268 -644
  87. package/dist/Text/Text.d.ts +47 -141
  88. package/dist/TextArea/TextArea.d.ts +47 -141
  89. package/dist/Theme/base.config.d.ts +26 -78
  90. package/dist/Theme/stitches.config.d.ts +1046 -1493
  91. package/dist/TileMenu/StyledMenuTile.d.ts +469 -1127
  92. package/dist/Toast/Toast.d.ts +382 -946
  93. package/dist/VBPicker-M5VYFEUB.css +2780 -0
  94. package/dist/VBPicker-M5VYFEUB.css.map +7 -0
  95. package/dist/VBPicker-TQLIL3NC.js +322 -0
  96. package/dist/VBPicker-TQLIL3NC.js.map +7 -0
  97. package/dist/Video/Video.d.ts +47 -141
  98. package/dist/VideoList/StyledVideoList.d.ts +201 -483
  99. package/dist/VideoTile/StyledVideoTile.d.ts +670 -1610
  100. package/dist/WaitingView-TLJ52XYA.js +10 -0
  101. package/dist/WaitingView-TLJ52XYA.js.map +7 -0
  102. package/dist/WhiteboardLayout-PZZTM2FW.css +2780 -0
  103. package/dist/WhiteboardLayout-PZZTM2FW.css.map +7 -0
  104. package/dist/WhiteboardLayout-YYZ5UVGG.js +96 -0
  105. package/dist/WhiteboardLayout-YYZ5UVGG.js.map +7 -0
  106. package/dist/android-perm-1.png +0 -0
  107. package/dist/audio-level.png +0 -0
  108. package/dist/chunk-42XPBCZO.js +487 -0
  109. package/dist/chunk-42XPBCZO.js.map +7 -0
  110. package/dist/chunk-4BQ3AMVG.js +16802 -0
  111. package/dist/chunk-4BQ3AMVG.js.map +7 -0
  112. package/dist/chunk-4L5OKEIV.js +90 -0
  113. package/dist/chunk-4L5OKEIV.js.map +7 -0
  114. package/dist/chunk-6BX3VCVC.js +6337 -0
  115. package/dist/chunk-6BX3VCVC.js.map +7 -0
  116. package/dist/chunk-A3COGXMF.js +114 -0
  117. package/dist/chunk-A3COGXMF.js.map +7 -0
  118. package/dist/chunk-B3HHL3ND.js +178 -0
  119. package/dist/chunk-B3HHL3ND.js.map +7 -0
  120. package/dist/chunk-B5NLX6N6.js +41 -0
  121. package/dist/chunk-B5NLX6N6.js.map +7 -0
  122. package/dist/chunk-BXBPZGSP.js +161 -0
  123. package/dist/chunk-BXBPZGSP.js.map +7 -0
  124. package/dist/chunk-DVVFWHQG.js +136 -0
  125. package/dist/chunk-DVVFWHQG.js.map +7 -0
  126. package/dist/chunk-GV2DTYSU.js +262 -0
  127. package/dist/chunk-GV2DTYSU.js.map +7 -0
  128. package/dist/chunk-KF2YEUWU.js +254 -0
  129. package/dist/chunk-KF2YEUWU.js.map +7 -0
  130. package/dist/chunk-KQXTIHI6.js +59 -0
  131. package/dist/chunk-KQXTIHI6.js.map +7 -0
  132. package/dist/chunk-MR3HE7HV.js +830 -0
  133. package/dist/chunk-MR3HE7HV.js.map +7 -0
  134. package/dist/chunk-OQBTPJPO.js +71 -0
  135. package/dist/chunk-OQBTPJPO.js.map +7 -0
  136. package/dist/chunk-P7OOTR7P.js +2595 -0
  137. package/dist/chunk-P7OOTR7P.js.map +7 -0
  138. package/dist/chunk-THDU2DKP.js +30 -0
  139. package/dist/chunk-THDU2DKP.js.map +7 -0
  140. package/dist/chunk-U4QYH2BP.js +98 -0
  141. package/dist/chunk-U4QYH2BP.js.map +7 -0
  142. package/dist/chunk-USEEH3QW.js +418 -0
  143. package/dist/chunk-USEEH3QW.js.map +7 -0
  144. package/dist/chunk-UZW3C3ML.js +171 -0
  145. package/dist/chunk-UZW3C3ML.js.map +7 -0
  146. package/dist/chunk-YDIB6WKJ.js +576 -0
  147. package/dist/chunk-YDIB6WKJ.js.map +7 -0
  148. package/dist/chunk-ZFTULCCP.js +62 -0
  149. package/dist/chunk-ZFTULCCP.js.map +7 -0
  150. package/dist/empty-chat.svg +12 -0
  151. package/dist/index.cjs.css +2 -2
  152. package/dist/index.cjs.css.map +1 -1
  153. package/dist/index.cjs.js +22737 -22481
  154. package/dist/index.cjs.js.map +4 -4
  155. package/dist/index.css +2 -2
  156. package/dist/index.css.map +1 -1
  157. package/dist/index.js +25 -15
  158. package/dist/ios-perm-0.png +0 -0
  159. package/dist/meta.cjs.json +5680 -5307
  160. package/dist/meta.esbuild.json +8824 -5953
  161. package/dist/pdf-share.png +0 -0
  162. package/dist/screen-share.png +0 -0
  163. package/dist/transaction_error.svg +12 -0
  164. package/package.json +8 -8
  165. package/src/Avatar/Avatar.tsx +1 -1
  166. package/src/Popover/Popover.stories.tsx +1 -1
  167. package/src/Prebuilt/App.tsx +6 -2
  168. package/src/Prebuilt/components/Chat/Chat.tsx +12 -8
  169. package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
  170. package/src/Prebuilt/components/Header/common.jsx +6 -5
  171. package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +18 -0
  172. package/src/Prebuilt/components/Notifications/DeviceInUseError.tsx +79 -0
  173. package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +56 -0
  174. package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +24 -0
  175. package/src/Prebuilt/components/Notifications/Notifications.tsx +13 -159
  176. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +23 -2
  177. package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +71 -0
  178. package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +1 -5
  179. package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +7 -5
  180. package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +23 -1
  181. package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +13 -5
  182. package/src/Prebuilt/components/StatsForNerds.jsx +32 -3
  183. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +43 -31
  184. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
  185. package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +3 -1
  186. package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +6 -0
  187. package/src/Prebuilt/layouts/HLSView.jsx +1 -0
  188. package/src/Prebuilt/layouts/PDFView.jsx +1 -0
  189. package/src/Prebuilt/layouts/SidePane.tsx +12 -6
  190. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +35 -34
  191. package/dist/HLSView-EPPGI6XI.js.map +0 -7
  192. package/dist/chunk-ZAX5VT7V.js +0 -34686
  193. package/dist/chunk-ZAX5VT7V.js.map +0 -7
@@ -0,0 +1,171 @@
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
@@ -0,0 +1,7 @@
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,KAAK,EAAE,GAAG,QAAQ,MAAM,SAAS,UAAU,GAAG,KAAK,MAAM,OAAO,EAAE,KAAK,aAAa,IAAI,KAAK,EAAE;AAAA;AAAA,IAE9F;AAAA,EACH;AAEJ;AAEA,IAAM,mBAAmB,CAAC,EAAE,UAAU,MAAM,CAAC,EAAE,MAA8C;AAC3F,SACE,oCAAC,QAAK,WAAU,UAAS,KAAK,iBAAE,MAAM,SAAS,KAAK,MAAM,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