@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.
Files changed (190) hide show
  1. package/dist/Accordion/Accordion.d.ts +322 -134
  2. package/dist/Accordion/index.d.ts +322 -134
  3. package/dist/Avatar/Avatar.d.ts +141 -47
  4. package/dist/Button/Button.d.ts +141 -47
  5. package/dist/Checkbox/Checkbox.d.ts +322 -134
  6. package/dist/Collapsible/Collapsible.d.ts +483 -201
  7. package/dist/Divider/Divider.d.ts +322 -134
  8. package/dist/Dropdown/Dropdown.d.ts +1932 -804
  9. package/dist/Fieldset/Fieldset.d.ts +141 -47
  10. package/dist/Footer/Footer.d.ts +1288 -536
  11. package/dist/{HLSView-XRGOWFRB.js → HLSView-CSOBLYBP.js} +24 -38
  12. package/dist/HLSView-CSOBLYBP.js.map +7 -0
  13. package/dist/{PDFView-RJK44WVO.css → HLSView-QZMIDGI4.css} +3 -3
  14. package/dist/{EmbedView-Y24VRONT.css.map → HLSView-QZMIDGI4.css.map} +1 -1
  15. package/dist/IconButton/IconButton.d.ts +141 -47
  16. package/dist/Input/Input.d.ts +926 -362
  17. package/dist/Label/Label.d.ts +141 -47
  18. package/dist/Layout/Box.d.ts +141 -47
  19. package/dist/Layout/Flex.d.ts +141 -47
  20. package/dist/Link/Link.d.ts +141 -47
  21. package/dist/Modal/Dialog.d.ts +987 -329
  22. package/dist/Modal/DialogContent.d.ts +1127 -469
  23. package/dist/Pagination/StyledPagination.d.ts +644 -268
  24. package/dist/Popover/index.d.ts +483 -201
  25. package/dist/Prebuilt/IconButton.d.ts +322 -134
  26. package/dist/Prebuilt/components/Chat/ChatBody.d.ts +322 -134
  27. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +805 -335
  28. package/dist/Prebuilt/components/Settings/common.d.ts +322 -134
  29. package/dist/Progress/index.d.ts +322 -134
  30. package/dist/RadioGroup/RadioGroup.d.ts +483 -201
  31. package/dist/ReactSelect/ReactSelect.d.ts +1610 -670
  32. package/dist/Select/Select.d.ts +483 -201
  33. package/dist/Sheet/Sheet.d.ts +987 -329
  34. package/dist/Slider/Slider.d.ts +141 -47
  35. package/dist/Stats/StyledStats.d.ts +966 -402
  36. package/dist/Switch/Switch.d.ts +141 -47
  37. package/dist/Tabs/Tabs.d.ts +644 -268
  38. package/dist/Text/Text.d.ts +141 -47
  39. package/dist/TextArea/TextArea.d.ts +141 -47
  40. package/dist/Theme/base.config.d.ts +78 -26
  41. package/dist/Theme/stitches.config.d.ts +1514 -1067
  42. package/dist/TileMenu/StyledMenuTile.d.ts +1127 -469
  43. package/dist/Toast/Toast.d.ts +946 -382
  44. package/dist/Video/Video.d.ts +141 -47
  45. package/dist/VideoList/StyledVideoList.d.ts +483 -201
  46. package/dist/VideoTile/StyledVideoTile.d.ts +1610 -670
  47. package/dist/chunk-4VBHLZDR.js +34747 -0
  48. package/dist/chunk-4VBHLZDR.js.map +7 -0
  49. package/dist/index.cjs.css +2 -2
  50. package/dist/index.cjs.css.map +1 -1
  51. package/dist/index.cjs.js +22687 -22873
  52. package/dist/index.cjs.js.map +4 -4
  53. package/dist/index.css +2 -2
  54. package/dist/index.css.map +1 -1
  55. package/dist/index.js +15 -25
  56. package/dist/meta.cjs.json +5125 -5444
  57. package/dist/meta.esbuild.json +6238 -9055
  58. package/package.json +8 -8
  59. package/src/Avatar/Avatar.tsx +1 -1
  60. package/src/Popover/Popover.stories.tsx +1 -1
  61. package/src/Prebuilt/App.tsx +2 -6
  62. package/src/Prebuilt/components/Chat/Chat.tsx +8 -12
  63. package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
  64. package/src/Prebuilt/components/Notifications/Notifications.tsx +159 -11
  65. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +2 -23
  66. package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +5 -1
  67. package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +5 -7
  68. package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +1 -23
  69. package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +5 -13
  70. package/src/Prebuilt/components/StatsForNerds.jsx +3 -32
  71. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +31 -43
  72. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
  73. package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +1 -3
  74. package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +0 -6
  75. package/src/Prebuilt/layouts/HLSView.jsx +0 -1
  76. package/src/Prebuilt/layouts/PDFView.jsx +0 -1
  77. package/src/Prebuilt/layouts/SidePane.tsx +6 -12
  78. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +34 -35
  79. package/dist/ConferenceScreen-5G5WGPIO.css +0 -2780
  80. package/dist/ConferenceScreen-5G5WGPIO.css.map +0 -7
  81. package/dist/ConferenceScreen-KS5URW6Z.js +0 -1778
  82. package/dist/ConferenceScreen-KS5URW6Z.js.map +0 -7
  83. package/dist/EmbedView-BCRQ3GHV.js +0 -17
  84. package/dist/EmbedView-BCRQ3GHV.js.map +0 -7
  85. package/dist/EmbedView-Y24VRONT.css +0 -2780
  86. package/dist/EmojiReaction-NA5F5DWN.js +0 -11
  87. package/dist/EmojiReaction-NA5F5DWN.js.map +0 -7
  88. package/dist/HLSView-DC43TOIW.css +0 -2780
  89. package/dist/HLSView-DC43TOIW.css.map +0 -7
  90. package/dist/HLSView-XRGOWFRB.js.map +0 -7
  91. package/dist/LeaveScreen-3OZN3MU3.css +0 -2780
  92. package/dist/LeaveScreen-3OZN3MU3.css.map +0 -7
  93. package/dist/LeaveScreen-PC4KB6OG.js +0 -556
  94. package/dist/LeaveScreen-PC4KB6OG.js.map +0 -7
  95. package/dist/MoreSettings-KTRYHDB2.css +0 -2780
  96. package/dist/MoreSettings-KTRYHDB2.css.map +0 -7
  97. package/dist/MoreSettings-XLNYT7PW.js +0 -16
  98. package/dist/MoreSettings-XLNYT7PW.js.map +0 -7
  99. package/dist/PDFView-LJ7I3K3H.js +0 -84
  100. package/dist/PDFView-LJ7I3K3H.js.map +0 -7
  101. package/dist/PDFView-RJK44WVO.css.map +0 -7
  102. package/dist/Polls-AULCHMLW.js +0 -1584
  103. package/dist/Polls-AULCHMLW.js.map +0 -7
  104. package/dist/Polls-K4GO5ZOC.css +0 -2780
  105. package/dist/Polls-K4GO5ZOC.css.map +0 -7
  106. package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +0 -1
  107. package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +0 -1
  108. package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +0 -1
  109. package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +0 -1
  110. package/dist/RaiseHand-E4OVMBW6.js +0 -10
  111. package/dist/RaiseHand-E4OVMBW6.js.map +0 -7
  112. package/dist/RoleProminence-LHUXHLVI.css +0 -2780
  113. package/dist/RoleProminence-LHUXHLVI.css.map +0 -7
  114. package/dist/RoleProminence-RWJP2Z36.js +0 -116
  115. package/dist/RoleProminence-RWJP2Z36.js.map +0 -7
  116. package/dist/RoomDetailsPane-6BM2FPWW.css +0 -2780
  117. package/dist/RoomDetailsPane-6BM2FPWW.css.map +0 -7
  118. package/dist/RoomDetailsPane-7OP2CNJW.js +0 -53
  119. package/dist/RoomDetailsPane-7OP2CNJW.js.map +0 -7
  120. package/dist/ScreenshareLayout-RHTD2PQT.css +0 -2780
  121. package/dist/ScreenshareLayout-RHTD2PQT.css.map +0 -7
  122. package/dist/ScreenshareLayout-TM7DLYLH.js +0 -358
  123. package/dist/ScreenshareLayout-TM7DLYLH.js.map +0 -7
  124. package/dist/SidePaneTabs-T7BKZ2AT.js +0 -1354
  125. package/dist/SidePaneTabs-T7BKZ2AT.js.map +0 -7
  126. package/dist/SidePaneTabs-TBUPHNAU.css +0 -2780
  127. package/dist/SidePaneTabs-TBUPHNAU.css.map +0 -7
  128. package/dist/VBPicker-M5VYFEUB.css +0 -2780
  129. package/dist/VBPicker-M5VYFEUB.css.map +0 -7
  130. package/dist/VBPicker-TQLIL3NC.js +0 -322
  131. package/dist/VBPicker-TQLIL3NC.js.map +0 -7
  132. package/dist/WaitingView-TLJ52XYA.js +0 -10
  133. package/dist/WaitingView-TLJ52XYA.js.map +0 -7
  134. package/dist/WhiteboardLayout-PZZTM2FW.css +0 -2780
  135. package/dist/WhiteboardLayout-PZZTM2FW.css.map +0 -7
  136. package/dist/WhiteboardLayout-YYZ5UVGG.js +0 -96
  137. package/dist/WhiteboardLayout-YYZ5UVGG.js.map +0 -7
  138. package/dist/android-perm-1.png +0 -0
  139. package/dist/audio-level.png +0 -0
  140. package/dist/chunk-42XPBCZO.js +0 -487
  141. package/dist/chunk-42XPBCZO.js.map +0 -7
  142. package/dist/chunk-4BQ3AMVG.js +0 -16802
  143. package/dist/chunk-4BQ3AMVG.js.map +0 -7
  144. package/dist/chunk-4L5OKEIV.js +0 -90
  145. package/dist/chunk-4L5OKEIV.js.map +0 -7
  146. package/dist/chunk-6BX3VCVC.js +0 -6337
  147. package/dist/chunk-6BX3VCVC.js.map +0 -7
  148. package/dist/chunk-A3COGXMF.js +0 -114
  149. package/dist/chunk-A3COGXMF.js.map +0 -7
  150. package/dist/chunk-B3HHL3ND.js +0 -178
  151. package/dist/chunk-B3HHL3ND.js.map +0 -7
  152. package/dist/chunk-B5NLX6N6.js +0 -41
  153. package/dist/chunk-B5NLX6N6.js.map +0 -7
  154. package/dist/chunk-BXBPZGSP.js +0 -161
  155. package/dist/chunk-BXBPZGSP.js.map +0 -7
  156. package/dist/chunk-DVVFWHQG.js +0 -136
  157. package/dist/chunk-DVVFWHQG.js.map +0 -7
  158. package/dist/chunk-GV2DTYSU.js +0 -262
  159. package/dist/chunk-GV2DTYSU.js.map +0 -7
  160. package/dist/chunk-KF2YEUWU.js +0 -254
  161. package/dist/chunk-KF2YEUWU.js.map +0 -7
  162. package/dist/chunk-KQXTIHI6.js +0 -59
  163. package/dist/chunk-KQXTIHI6.js.map +0 -7
  164. package/dist/chunk-MR3HE7HV.js +0 -830
  165. package/dist/chunk-MR3HE7HV.js.map +0 -7
  166. package/dist/chunk-OQBTPJPO.js +0 -71
  167. package/dist/chunk-OQBTPJPO.js.map +0 -7
  168. package/dist/chunk-P7OOTR7P.js +0 -2595
  169. package/dist/chunk-P7OOTR7P.js.map +0 -7
  170. package/dist/chunk-THDU2DKP.js +0 -30
  171. package/dist/chunk-THDU2DKP.js.map +0 -7
  172. package/dist/chunk-U4QYH2BP.js +0 -98
  173. package/dist/chunk-U4QYH2BP.js.map +0 -7
  174. package/dist/chunk-USEEH3QW.js +0 -418
  175. package/dist/chunk-USEEH3QW.js.map +0 -7
  176. package/dist/chunk-UZW3C3ML.js +0 -171
  177. package/dist/chunk-UZW3C3ML.js.map +0 -7
  178. package/dist/chunk-YDIB6WKJ.js +0 -576
  179. package/dist/chunk-YDIB6WKJ.js.map +0 -7
  180. package/dist/chunk-ZFTULCCP.js +0 -62
  181. package/dist/chunk-ZFTULCCP.js.map +0 -7
  182. package/dist/empty-chat.svg +0 -12
  183. package/dist/ios-perm-0.png +0 -0
  184. package/dist/pdf-share.png +0 -0
  185. package/dist/screen-share.png +0 -0
  186. package/dist/transaction_error.svg +0 -12
  187. package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +0 -18
  188. package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +0 -56
  189. package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +0 -24
  190. package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +0 -71
@@ -1,98 +0,0 @@
1
- import {
2
- ProminenceLayout,
3
- SecondaryTiles
4
- } from "./chunk-UZW3C3ML.js";
5
- import {
6
- ToastManager
7
- } from "./chunk-USEEH3QW.js";
8
- import {
9
- Box
10
- } from "./chunk-4L5OKEIV.js";
11
- import {
12
- useResetEmbedConfig,
13
- useSetAppDataByKey
14
- } from "./chunk-6BX3VCVC.js";
15
- import {
16
- APP_DATA,
17
- __async,
18
- init_define_process_env
19
- } from "./chunk-YDIB6WKJ.js";
20
-
21
- // src/Prebuilt/layouts/EmbedView.jsx
22
- init_define_process_env();
23
- import React, { useEffect, useMemo } from "react";
24
- import { selectAppData, selectPeers, selectPeerScreenSharing, useEmbedShare, useHMSStore } from "@100mslive/react-sdk";
25
- var EmbedView = () => {
26
- return /* @__PURE__ */ React.createElement(EmbedScreenShareView, null, /* @__PURE__ */ React.createElement(EmbedComponent, null));
27
- };
28
- var EmbedScreenShareView = ({ children }) => {
29
- const peers = useHMSStore(selectPeers);
30
- const peerPresenting = useHMSStore(selectPeerScreenSharing);
31
- const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);
32
- const smallTilePeers = useMemo(() => {
33
- const smallTilePeers2 = peers.filter((peer) => peer.id !== (peerPresenting == null ? void 0 : peerPresenting.id));
34
- return smallTilePeers2;
35
- }, [peers, peerPresenting]);
36
- useEffect(() => {
37
- setActiveScreenSharePeer(peerPresenting == null ? void 0 : peerPresenting.id);
38
- return () => {
39
- setActiveScreenSharePeer("");
40
- };
41
- }, [peerPresenting == null ? void 0 : peerPresenting.id, setActiveScreenSharePeer]);
42
- return /* @__PURE__ */ React.createElement(ProminenceLayout.Root, null, /* @__PURE__ */ React.createElement(ProminenceLayout.ProminentSection, null, children), /* @__PURE__ */ React.createElement(SecondaryTiles, { peers: smallTilePeers }));
43
- };
44
- var EmbedComponent = () => {
45
- const embedConfig = useHMSStore(selectAppData(APP_DATA.embedConfig));
46
- const resetConfig = useResetEmbedConfig();
47
- const { iframeRef, startEmbedShare, isEmbedShareInProgress } = useEmbedShare(resetConfig);
48
- useEffect(() => {
49
- (() => __async(void 0, null, function* () {
50
- if (embedConfig && !isEmbedShareInProgress) {
51
- try {
52
- yield startEmbedShare(embedConfig);
53
- } catch (err) {
54
- resetConfig();
55
- ToastManager.addToast({
56
- title: `Error while sharing embed url ${err.message || ""}`,
57
- variant: "error"
58
- });
59
- }
60
- }
61
- }))();
62
- }, [isEmbedShareInProgress, embedConfig, startEmbedShare, resetConfig]);
63
- return /* @__PURE__ */ React.createElement(
64
- Box,
65
- {
66
- css: {
67
- mx: "$8",
68
- flex: "3 1 0",
69
- "@lg": {
70
- flex: "2 1 0",
71
- display: "flex",
72
- alignItems: "center"
73
- }
74
- }
75
- },
76
- /* @__PURE__ */ React.createElement(
77
- "iframe",
78
- {
79
- title: "Embed View",
80
- ref: iframeRef,
81
- style: {
82
- width: "100%",
83
- height: "100%",
84
- border: 0,
85
- borderRadius: "0.75rem"
86
- },
87
- allow: "autoplay; clipboard-write;",
88
- referrerPolicy: "no-referrer"
89
- }
90
- )
91
- );
92
- };
93
-
94
- export {
95
- EmbedView,
96
- EmbedScreenShareView
97
- };
98
- //# sourceMappingURL=chunk-U4QYH2BP.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/Prebuilt/layouts/EmbedView.jsx"],
4
- "sourcesContent": ["import React, { useEffect, useMemo } from 'react';\nimport { selectAppData, selectPeers, selectPeerScreenSharing, useEmbedShare, useHMSStore } from '@100mslive/react-sdk';\nimport { SecondaryTiles } from '../components/SecondaryTiles';\nimport { ToastManager } from '../components/Toast/ToastManager';\nimport { ProminenceLayout } from '../components/VideoLayouts/ProminenceLayout';\nimport { Box } from '../../Layout';\nimport { useResetEmbedConfig, useSetAppDataByKey } from '../components/AppData/useUISettings';\nimport { APP_DATA } from '../common/constants';\n\nexport const EmbedView = () => {\n return (\n <EmbedScreenShareView>\n <EmbedComponent />\n </EmbedScreenShareView>\n );\n};\n\nexport const EmbedScreenShareView = ({ children }) => {\n const peers = useHMSStore(selectPeers);\n\n const peerPresenting = useHMSStore(selectPeerScreenSharing);\n const [, setActiveScreenSharePeer] = useSetAppDataByKey(APP_DATA.activeScreensharePeerId);\n\n const smallTilePeers = useMemo(() => {\n const smallTilePeers = peers.filter(peer => peer.id !== peerPresenting?.id);\n return smallTilePeers;\n }, [peers, peerPresenting]);\n\n useEffect(() => {\n setActiveScreenSharePeer(peerPresenting?.id);\n return () => {\n setActiveScreenSharePeer('');\n };\n }, [peerPresenting?.id, setActiveScreenSharePeer]);\n return (\n <ProminenceLayout.Root>\n <ProminenceLayout.ProminentSection>{children}</ProminenceLayout.ProminentSection>\n <SecondaryTiles peers={smallTilePeers} />\n </ProminenceLayout.Root>\n );\n};\n/**\n * EmbedView is responsible for rendering the iframe and managing the screen sharing functionality.\n */\nconst EmbedComponent = () => {\n const embedConfig = useHMSStore(selectAppData(APP_DATA.embedConfig));\n const resetConfig = useResetEmbedConfig();\n\n // need to send resetConfig to clear configuration, if stop screenshare occurs.\n const { iframeRef, startEmbedShare, isEmbedShareInProgress } = useEmbedShare(resetConfig);\n\n useEffect(() => {\n (async () => {\n if (embedConfig && !isEmbedShareInProgress) {\n try {\n await startEmbedShare(embedConfig);\n } catch (err) {\n resetConfig();\n ToastManager.addToast({\n title: `Error while sharing embed url ${err.message || ''}`,\n variant: 'error',\n });\n }\n }\n })();\n }, [isEmbedShareInProgress, embedConfig, startEmbedShare, resetConfig]);\n\n return (\n <Box\n css={{\n mx: '$8',\n flex: '3 1 0',\n '@lg': {\n flex: '2 1 0',\n display: 'flex',\n alignItems: 'center',\n },\n }}\n >\n <iframe\n title=\"Embed View\"\n ref={iframeRef}\n style={{\n width: '100%',\n height: '100%',\n border: 0,\n borderRadius: '0.75rem',\n }}\n allow=\"autoplay; clipboard-write;\"\n referrerPolicy=\"no-referrer\"\n />\n </Box>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,SAAS,WAAW,eAAe;AAC1C,SAAS,eAAe,aAAa,yBAAyB,eAAe,mBAAmB;AAQzF,IAAM,YAAY,MAAM;AAC7B,SACE,oCAAC,4BACC,oCAAC,oBAAe,CAClB;AAEJ;AAEO,IAAM,uBAAuB,CAAC,EAAE,SAAS,MAAM;AACpD,QAAM,QAAQ,YAAY,WAAW;AAErC,QAAM,iBAAiB,YAAY,uBAAuB;AAC1D,QAAM,CAAC,EAAE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A,UACL,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,cAAc;AAAA,QAChB;AAAA,QACA,OAAM;AAAA,QACN,gBAAe;AAAA;AAAA,IACjB;AAAA,EACF;AAEJ;",
6
- "names": ["smallTilePeers"]
7
- }
@@ -1,418 +0,0 @@
1
- import {
2
- isScreenshareSupported,
3
- useRoomLayout,
4
- useRoomLayoutConferencingScreen,
5
- useSetAppDataByKey
6
- } from "./chunk-6BX3VCVC.js";
7
- import {
8
- APP_DATA,
9
- CHAT_SELECTOR,
10
- RTMP_RECORD_DEFAULT_RESOLUTION,
11
- __async,
12
- __spreadProps,
13
- __spreadValues,
14
- config,
15
- init_define_process_env,
16
- styled
17
- } from "./chunk-YDIB6WKJ.js";
18
-
19
- // src/Dropdown/Dropdown.tsx
20
- init_define_process_env();
21
- import {
22
- CheckboxItem,
23
- Content,
24
- Group,
25
- Item,
26
- ItemIndicator,
27
- Label,
28
- Portal,
29
- Root,
30
- Separator,
31
- Sub,
32
- SubContent,
33
- SubTrigger,
34
- Trigger
35
- } from "@radix-ui/react-dropdown-menu";
36
- var DropdownRoot = styled(Root, {});
37
- var DropdownTrigger = styled(Trigger, {
38
- cursor: "pointer",
39
- appearance: "none !important",
40
- '&[data-state="open"]': {
41
- backgroundColor: "$surface_bright"
42
- },
43
- "&:focus": {
44
- outline: "none"
45
- },
46
- "&:focus-visible": {
47
- boxShadow: "0 0 0 3px $colors$primary_default"
48
- }
49
- });
50
- var DropdownTriggerItem = styled(SubTrigger, {
51
- w: "100%",
52
- color: "$on_surface_high",
53
- p: "$8",
54
- display: "flex",
55
- alignItems: "center",
56
- "&:hover": {
57
- cursor: "pointer",
58
- bg: "$surface_brighter"
59
- },
60
- "&:focus-visible": {
61
- bg: "$surface_brighter",
62
- outline: "none"
63
- }
64
- });
65
- var DropdownItem = styled(Item, {
66
- color: "$on_surface_high",
67
- p: "$8",
68
- display: "flex",
69
- alignItems: "center",
70
- outline: "none",
71
- backgroundColor: "$surface_dim",
72
- "&:hover": {
73
- cursor: "pointer",
74
- bg: "$surface_bright"
75
- },
76
- "&:focus-visible": {
77
- bg: "$surface_bright"
78
- }
79
- });
80
- var DropdownItemSeparator = styled(Separator, {
81
- h: 1,
82
- backgroundColor: "$border_bright",
83
- m: "$4 $8"
84
- });
85
- var DropdownContent = styled(Content, {
86
- w: "$80",
87
- maxHeight: "$64",
88
- r: "$1",
89
- py: "$4",
90
- backgroundColor: "$surface_dim",
91
- overflowY: "auto",
92
- boxShadow: "0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)",
93
- zIndex: 20,
94
- fontFamily: "$sans"
95
- });
96
- var DropdownLabel = styled(Label, {
97
- display: "flex",
98
- alignItems: "center",
99
- h: "$12",
100
- w: "100%",
101
- p: "$8 $4"
102
- });
103
- var DropdownGroup = styled(Group, {});
104
- var DropdownSubMenu = styled(Sub, {});
105
- var DropdownSubMenuContent = styled(SubContent, {
106
- w: "$80",
107
- maxHeight: "$64",
108
- r: "$1",
109
- py: "$4",
110
- backgroundColor: "$surface_bright",
111
- overflowY: "auto",
112
- boxShadow: "0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)",
113
- zIndex: 20
114
- });
115
- var DropdownCheckboxItem = styled(CheckboxItem, {
116
- color: "$on_surface_high",
117
- p: "$8",
118
- display: "flex",
119
- alignItems: "center",
120
- outline: "none",
121
- "&:hover": {
122
- cursor: "pointer",
123
- bg: "$surface_brighter"
124
- },
125
- "&:focus-visible": {
126
- bg: "$surface_brighter"
127
- },
128
- gap: "$2"
129
- });
130
- var DropdownItemIndicator = styled(ItemIndicator, {
131
- w: "$10",
132
- display: "inline-flex",
133
- alignItems: "center",
134
- justifyContent: "center"
135
- });
136
- var Dropdown = {
137
- Root: DropdownRoot,
138
- Trigger: DropdownTrigger,
139
- TriggerItem: DropdownTriggerItem,
140
- Content: DropdownContent,
141
- Portal,
142
- SubMenu: DropdownSubMenu,
143
- SubMenuContent: DropdownSubMenuContent,
144
- Item: DropdownItem,
145
- Label: DropdownLabel,
146
- Group: DropdownGroup,
147
- ItemSeparator: DropdownItemSeparator,
148
- CheckboxItem: DropdownCheckboxItem,
149
- ItemIndicator: DropdownItemIndicator
150
- };
151
-
152
- // src/Prebuilt/components/Toast/ToastManager.js
153
- init_define_process_env();
154
- import { v4 } from "uuid";
155
- var ToastManager = {
156
- toasts: /* @__PURE__ */ new Map(),
157
- listeners: /* @__PURE__ */ new Map(),
158
- addToast(toast) {
159
- const id = toast.id ? toast.id : v4();
160
- this.toasts.set(id, __spreadProps(__spreadValues({}, toast), { id }));
161
- this.onChange();
162
- return id;
163
- },
164
- clearAllToast() {
165
- this.toasts.clear();
166
- this.onChange();
167
- },
168
- removeToast(id) {
169
- this.toasts.delete(id);
170
- this.onChange();
171
- },
172
- replaceToast(id, toast) {
173
- if (this.isActive(id)) {
174
- this.toasts.set(id, __spreadValues(__spreadValues({}, this.toasts.get(id)), toast));
175
- this.onChange();
176
- return id;
177
- } else {
178
- return this.addToast(toast);
179
- }
180
- },
181
- addListener(cb) {
182
- this.listeners.set(cb, cb);
183
- },
184
- removeListener(cb) {
185
- this.listeners.delete(cb);
186
- },
187
- isActive(id) {
188
- return this.toasts.has(id);
189
- },
190
- onChange() {
191
- const toasts = Array.from(this.toasts.values());
192
- this.listeners.forEach((listener) => listener(toasts));
193
- }
194
- };
195
-
196
- // src/Prebuilt/common/hooks.ts
197
- init_define_process_env();
198
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
199
- import { useMedia } from "react-use";
200
- import { JoinForm_JoinBtnType } from "@100mslive/types-prebuilt/elements/join_form";
201
- import {
202
- parsedUserAgent,
203
- selectAvailableRoleNames,
204
- selectIsAllowedToPublish,
205
- selectIsConnectedToRoom,
206
- selectLocalPeerRole,
207
- selectPeerCount,
208
- selectPeerMetadata,
209
- selectPeers,
210
- selectPeersByRoles,
211
- selectRecordingState,
212
- selectRemotePeers,
213
- selectRolesMap,
214
- useHMSActions,
215
- useHMSStore,
216
- useHMSVanillaStore
217
- } from "@100mslive/react-sdk";
218
- var useFilteredRoles = () => {
219
- var _a;
220
- const { elements } = useRoomLayoutConferencingScreen();
221
- return ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.roles_whitelist) || [];
222
- };
223
- var useDefaultChatSelection = () => {
224
- var _a;
225
- const { elements } = useRoomLayoutConferencingScreen();
226
- const roles = useFilteredRoles();
227
- if ((_a = elements == null ? void 0 : elements.chat) == null ? void 0 : _a.public_chat_enabled) {
228
- return CHAT_SELECTOR.EVERYONE;
229
- }
230
- if (roles.length > 0) {
231
- return roles[0];
232
- }
233
- return "";
234
- };
235
- var useShowStreamingUI = () => {
236
- var _a, _b, _c;
237
- const layout = useRoomLayout();
238
- const { join_form } = ((_c = (_b = (_a = layout == null ? void 0 : layout.screens) == null ? void 0 : _a.preview) == null ? void 0 : _b.default) == null ? void 0 : _c.elements) || {};
239
- return (join_form == null ? void 0 : join_form.join_btn_type) === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE;
240
- };
241
- var useParticipants = (params) => {
242
- var _a;
243
- const isConnected = useHMSStore(selectIsConnectedToRoom);
244
- const peerCount = useHMSStore(selectPeerCount);
245
- const availableRoles = useHMSStore(selectAvailableRoleNames);
246
- let participantList = useHMSStore(isConnected ? selectPeers : selectRemotePeers);
247
- const rolesWithParticipants = Array.from(new Set(participantList.map((peer) => peer.roleName)));
248
- const vanillaStore = useHMSVanillaStore();
249
- if ((_a = params == null ? void 0 : params.metadata) == null ? void 0 : _a.isHandRaised) {
250
- participantList = participantList.filter((peer) => {
251
- return vanillaStore.getState(selectPeerMetadata(peer.id)).isHandRaised;
252
- });
253
- }
254
- if ((params == null ? void 0 : params.role) && availableRoles.includes(params.role)) {
255
- participantList = participantList.filter((peer) => peer.roleName === params.role);
256
- }
257
- if (params == null ? void 0 : params.search) {
258
- const search = params.search;
259
- participantList = participantList.filter((peer) => peer.name.toLowerCase().includes(search));
260
- }
261
- return { participants: participantList, isConnected, peerCount, rolesWithParticipants };
262
- };
263
- var useIsLandscape = () => {
264
- const isMobile = parsedUserAgent.getDevice().type === "mobile";
265
- const isLandscape = useMedia(config.media.ls);
266
- return isMobile && isLandscape;
267
- };
268
- var useLandscapeHLSStream = () => {
269
- const isLandscape = useIsLandscape();
270
- const { screenType } = useRoomLayoutConferencingScreen();
271
- return isLandscape && screenType === "hls_live_streaming";
272
- };
273
- var useMobileHLSStream = () => {
274
- const isMobile = useMedia(config.media.md);
275
- const { screenType } = useRoomLayoutConferencingScreen();
276
- return isMobile && screenType === "hls_live_streaming";
277
- };
278
- var useKeyboardHandler = (isPaused, hlsPlayer) => {
279
- const handleKeyEvent = useCallback(
280
- (event) => __async(void 0, null, function* () {
281
- switch (event.key) {
282
- case " ":
283
- if (isPaused) {
284
- yield hlsPlayer == null ? void 0 : hlsPlayer.play();
285
- } else {
286
- hlsPlayer == null ? void 0 : hlsPlayer.pause();
287
- }
288
- break;
289
- case "ArrowRight":
290
- hlsPlayer == null ? void 0 : hlsPlayer.seekTo((hlsPlayer == null ? void 0 : hlsPlayer.getVideoElement().currentTime) + 10);
291
- break;
292
- case "ArrowLeft":
293
- hlsPlayer == null ? void 0 : hlsPlayer.seekTo((hlsPlayer == null ? void 0 : hlsPlayer.getVideoElement().currentTime) - 10);
294
- break;
295
- }
296
- }),
297
- [hlsPlayer, isPaused]
298
- );
299
- return handleKeyEvent;
300
- };
301
- var useRecordingHandler = () => {
302
- const hmsActions = useHMSActions();
303
- const recordingState = useHMSStore(selectRecordingState);
304
- const [isRecordingLoading, setIsRecordingLoading] = useState(false);
305
- const [recordingStarted, setRecordingState] = useSetAppDataByKey(APP_DATA.recordingStarted);
306
- useEffect(() => {
307
- if (recordingState.browser.error && recordingStarted) {
308
- setRecordingState(false);
309
- }
310
- }, [recordingStarted, recordingState.browser.error, setRecordingState]);
311
- const startRecording = useCallback(
312
- (resolution = null) => __async(void 0, null, function* () {
313
- try {
314
- setRecordingState(true);
315
- setIsRecordingLoading(true);
316
- yield hmsActions.startRTMPOrRecording({
317
- resolution: getResolution(resolution),
318
- record: true
319
- });
320
- } catch (error) {
321
- const err = error;
322
- if (err.message.includes("stream already running")) {
323
- ToastManager.addToast({
324
- title: "Recording already running",
325
- variant: "error"
326
- });
327
- } else {
328
- ToastManager.addToast({
329
- title: err.message,
330
- variant: "error"
331
- });
332
- }
333
- setRecordingState(false);
334
- }
335
- setIsRecordingLoading(false);
336
- }),
337
- [hmsActions, setRecordingState]
338
- );
339
- return {
340
- recordingStarted,
341
- startRecording,
342
- isRecordingLoading
343
- };
344
- };
345
- function getResolution(recordingResolution) {
346
- if (!recordingResolution) {
347
- return void 0;
348
- }
349
- const resolution = RTMP_RECORD_DEFAULT_RESOLUTION;
350
- if (recordingResolution.width) {
351
- resolution.width = recordingResolution.width;
352
- }
353
- if (recordingResolution.height) {
354
- resolution.height = recordingResolution.height;
355
- }
356
- return resolution;
357
- }
358
- function useWaitingRoomInfo() {
359
- const localPeerRole = useHMSStore(selectLocalPeerRole);
360
- const { video, audio, screen } = useHMSStore(selectIsAllowedToPublish);
361
- const isScreenShareAllowed = isScreenshareSupported();
362
- const roles = useHMSStore(selectRolesMap);
363
- const peersByRoles = useHMSStore(selectPeersByRoles((localPeerRole == null ? void 0 : localPeerRole.subscribeParams.subscribeToRoles) || []));
364
- const isNotAllowedToPublish = !(video || audio || screen && isScreenShareAllowed);
365
- const isScreenOnlyPublishParams = screen && !(video || audio);
366
- const hasSubscribedRolePublishing = useMemo(() => {
367
- return peersByRoles.some((peer) => {
368
- var _a;
369
- if (peer.roleName && roles[peer.roleName] && !peer.isLocal) {
370
- return !!((_a = roles[peer.roleName].publishParams) == null ? void 0 : _a.allowed.length);
371
- }
372
- return false;
373
- });
374
- }, [peersByRoles, roles]);
375
- return {
376
- isNotAllowedToPublish,
377
- isScreenOnlyPublishParams,
378
- hasSubscribedRolePublishing
379
- };
380
- }
381
-
382
- // src/Prebuilt/components/hooks/useDropdownList.ts
383
- init_define_process_env();
384
- import { useEffect as useEffect2 } from "react";
385
- var useDropdownList = ({ name, open }) => {
386
- const [dropdownList = [], setDropdownList] = useSetAppDataByKey(APP_DATA.dropdownList);
387
- useEffect2(() => {
388
- if (open) {
389
- if (!dropdownList.includes(name)) {
390
- setDropdownList([...dropdownList, name]);
391
- }
392
- } else {
393
- const index = dropdownList.indexOf(name);
394
- if (index >= 0) {
395
- const newDropdownList = [...dropdownList];
396
- newDropdownList.splice(index, 1);
397
- setDropdownList(newDropdownList);
398
- }
399
- }
400
- }, [open, name]);
401
- };
402
-
403
- export {
404
- Dropdown,
405
- ToastManager,
406
- useFilteredRoles,
407
- useDefaultChatSelection,
408
- useShowStreamingUI,
409
- useParticipants,
410
- useIsLandscape,
411
- useLandscapeHLSStream,
412
- useMobileHLSStream,
413
- useKeyboardHandler,
414
- useRecordingHandler,
415
- useWaitingRoomInfo,
416
- useDropdownList
417
- };
418
- //# sourceMappingURL=chunk-USEEH3QW.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/Dropdown/Dropdown.tsx", "../src/Prebuilt/components/Toast/ToastManager.js", "../src/Prebuilt/common/hooks.ts", "../src/Prebuilt/components/hooks/useDropdownList.ts"],
4
- "sourcesContent": ["import {\n CheckboxItem,\n Content,\n Group,\n Item,\n ItemIndicator,\n Label,\n Portal,\n Root,\n Separator,\n Sub,\n SubContent,\n SubTrigger,\n Trigger,\n} from '@radix-ui/react-dropdown-menu';\nimport { styled } from '../Theme';\n\nconst DropdownRoot = styled(Root, {});\n\nconst DropdownTrigger = styled(Trigger, {\n cursor: 'pointer',\n appearance: 'none !important',\n '&[data-state=\"open\"]': {\n backgroundColor: '$surface_bright',\n },\n '&:focus': {\n outline: 'none',\n },\n '&:focus-visible': {\n boxShadow: '0 0 0 3px $colors$primary_default',\n },\n});\n\nconst DropdownTriggerItem = styled(SubTrigger, {\n w: '100%',\n color: '$on_surface_high',\n p: '$8',\n display: 'flex',\n alignItems: 'center',\n '&:hover': {\n cursor: 'pointer',\n bg: '$surface_brighter',\n },\n '&:focus-visible': {\n bg: '$surface_brighter',\n outline: 'none',\n },\n});\n\nconst DropdownItem = styled(Item, {\n color: '$on_surface_high',\n p: '$8',\n display: 'flex',\n alignItems: 'center',\n outline: 'none',\n backgroundColor: '$surface_dim',\n '&:hover': {\n cursor: 'pointer',\n bg: '$surface_bright',\n },\n '&:focus-visible': {\n bg: '$surface_bright',\n },\n});\n\nconst DropdownItemSeparator = styled(Separator, {\n h: 1,\n backgroundColor: '$border_bright',\n m: '$4 $8',\n});\n\nconst DropdownContent = styled(Content, {\n w: '$80',\n maxHeight: '$64',\n r: '$1',\n py: '$4',\n backgroundColor: '$surface_dim',\n overflowY: 'auto',\n boxShadow: '0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)',\n zIndex: 20,\n fontFamily: '$sans',\n});\n\nconst DropdownLabel = styled(Label, {\n display: 'flex',\n alignItems: 'center',\n h: '$12',\n w: '100%',\n p: '$8 $4',\n});\n\nconst DropdownGroup = styled(Group, {});\n\nconst DropdownSubMenu = styled(Sub, {});\n\nconst DropdownSubMenuContent = styled(SubContent, {\n w: '$80',\n maxHeight: '$64',\n r: '$1',\n py: '$4',\n backgroundColor: '$surface_bright',\n overflowY: 'auto',\n boxShadow: '0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)',\n zIndex: 20,\n});\n\nconst DropdownCheckboxItem = styled(CheckboxItem, {\n color: '$on_surface_high',\n p: '$8',\n display: 'flex',\n alignItems: 'center',\n outline: 'none',\n '&:hover': {\n cursor: 'pointer',\n bg: '$surface_brighter',\n },\n '&:focus-visible': {\n bg: '$surface_brighter',\n },\n gap: '$2',\n});\n\nconst DropdownItemIndicator = styled(ItemIndicator, {\n w: '$10',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n});\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: DropdownTrigger,\n TriggerItem: DropdownTriggerItem,\n Content: DropdownContent,\n Portal: Portal,\n SubMenu: DropdownSubMenu,\n SubMenuContent: DropdownSubMenuContent,\n Item: DropdownItem,\n Label: DropdownLabel,\n Group: DropdownGroup,\n ItemSeparator: DropdownItemSeparator,\n CheckboxItem: DropdownCheckboxItem,\n ItemIndicator: DropdownItemIndicator,\n};\n", "import { v4 } from 'uuid';\n\nexport const ToastManager = {\n toasts: new Map(),\n listeners: new Map(),\n addToast(toast) {\n const id = toast.id ? toast.id : v4();\n this.toasts.set(id, { ...toast, id });\n this.onChange();\n return id;\n },\n\n clearAllToast() {\n this.toasts.clear();\n this.onChange();\n },\n\n removeToast(id) {\n this.toasts.delete(id);\n this.onChange();\n },\n replaceToast(id, toast) {\n if (this.isActive(id)) {\n this.toasts.set(id, { ...this.toasts.get(id), ...toast });\n this.onChange();\n return id;\n } else {\n return this.addToast(toast);\n }\n },\n addListener(cb) {\n this.listeners.set(cb, cb);\n },\n removeListener(cb) {\n this.listeners.delete(cb);\n },\n isActive(id) {\n return this.toasts.has(id);\n },\n onChange() {\n const toasts = Array.from(this.toasts.values());\n this.listeners.forEach(listener => listener(toasts));\n },\n};\n", "import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useMedia } from 'react-use';\nimport { HMSHLSPlayer } from '@100mslive/hls-player';\nimport { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form';\nimport {\n HMSPeer,\n HMSRecording,\n parsedUserAgent,\n selectAvailableRoleNames,\n selectIsAllowedToPublish,\n selectIsConnectedToRoom,\n selectLocalPeerRole,\n selectPeerCount,\n selectPeerMetadata,\n selectPeers,\n selectPeersByRoles,\n selectRecordingState,\n selectRemotePeers,\n selectRolesMap,\n useHMSActions,\n useHMSStore,\n useHMSVanillaStore,\n} from '@100mslive/react-sdk';\n// @ts-ignore: No implicit any\nimport { ToastManager } from '../components/Toast/ToastManager';\nimport { config } from '../../Theme';\nimport { useRoomLayout } from '../provider/roomLayoutProvider';\n// @ts-ignore\nimport { useSetAppDataByKey } from '../components/AppData/useUISettings';\nimport { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\n// @ts-ignore: No implicit any\nimport { isScreenshareSupported } from '../common/utils';\nimport { APP_DATA, CHAT_SELECTOR, RTMP_RECORD_DEFAULT_RESOLUTION } from './constants';\n/**\n * Hook to execute a callback when alone in room(after a certain 5d of time)\n * @param {number} thresholdMs The threshold(in ms) after which the callback is executed,\n * starting from the instant when alone in room.\n * note: the cb is not called when another peer joins during this period.\n */\nexport const useWhenAloneInRoom = (thresholdMs = 5 * 60 * 1000) => {\n const isConnected = useHMSStore(selectIsConnectedToRoom);\n const peerCount = useHMSStore(selectPeerCount);\n const [aloneForLong, setAloneForLong] = useState(false);\n const cbTimeout = useRef(null);\n const alone = isConnected && peerCount === 1;\n\n useEffect(() => {\n if (alone && !cbTimeout.current) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n cbTimeout.current = setTimeout(() => {\n setAloneForLong(true);\n }, thresholdMs);\n } else if (!alone) {\n cbTimeout.current && clearTimeout(cbTimeout.current);\n cbTimeout.current = null;\n setAloneForLong(false);\n }\n }, [alone, thresholdMs]);\n\n useEffect(() => {\n return () => {\n if (cbTimeout.current) {\n clearTimeout(cbTimeout.current);\n }\n };\n }, []);\n\n return { alone, aloneForLong };\n};\n\nexport const useFilteredRoles = () => {\n const { elements } = useRoomLayoutConferencingScreen();\n return elements?.chat?.roles_whitelist || [];\n};\n\nexport const useDefaultChatSelection = () => {\n const { elements } = useRoomLayoutConferencingScreen();\n const roles = useFilteredRoles();\n // default is everyone for public chat\n if (elements?.chat?.public_chat_enabled) {\n return CHAT_SELECTOR.EVERYONE;\n }\n // sending first role as default\n if (roles.length > 0) {\n return roles[0];\n }\n // sending empty\n return '';\n};\n\nexport const useShowStreamingUI = () => {\n const layout = useRoomLayout();\n const { join_form } = layout?.screens?.preview?.default?.elements || {};\n return join_form?.join_btn_type === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE;\n};\n\n// The search results should not have role name matches\nexport const useParticipants = (params?: { metadata?: { isHandRaised?: boolean }; role?: string; search?: string }) => {\n const isConnected = useHMSStore(selectIsConnectedToRoom);\n const peerCount = useHMSStore(selectPeerCount);\n const availableRoles = useHMSStore(selectAvailableRoleNames);\n let participantList = useHMSStore(isConnected ? selectPeers : selectRemotePeers);\n const rolesWithParticipants = Array.from(new Set(participantList.map(peer => peer.roleName)));\n const vanillaStore = useHMSVanillaStore();\n if (params?.metadata?.isHandRaised) {\n participantList = participantList.filter(peer => {\n return vanillaStore.getState(selectPeerMetadata(peer.id)).isHandRaised;\n });\n }\n if (params?.role && availableRoles.includes(params.role)) {\n participantList = participantList.filter(peer => peer.roleName === params.role);\n }\n if (params?.search) {\n const search = params.search;\n // Removed peer.roleName?.toLowerCase().includes(search)\n participantList = participantList.filter(peer => peer.name.toLowerCase().includes(search));\n }\n return { participants: participantList, isConnected, peerCount, rolesWithParticipants };\n};\n\nexport const useIsLandscape = () => {\n const isMobile = parsedUserAgent.getDevice().type === 'mobile';\n const isLandscape = useMedia(config.media.ls);\n return isMobile && isLandscape;\n};\n\nexport const useLandscapeHLSStream = () => {\n const isLandscape = useIsLandscape();\n const { screenType } = useRoomLayoutConferencingScreen();\n return isLandscape && screenType === 'hls_live_streaming';\n};\n\nexport const useMobileHLSStream = () => {\n const isMobile = useMedia(config.media.md);\n const { screenType } = useRoomLayoutConferencingScreen();\n return isMobile && screenType === 'hls_live_streaming';\n};\n\nexport const useKeyboardHandler = (isPaused: boolean, hlsPlayer: HMSHLSPlayer) => {\n const handleKeyEvent = useCallback(\n async (event: KeyboardEvent) => {\n switch (event.key) {\n case ' ':\n if (isPaused) {\n await hlsPlayer?.play();\n } else {\n hlsPlayer?.pause();\n }\n break;\n case 'ArrowRight':\n hlsPlayer?.seekTo(hlsPlayer?.getVideoElement().currentTime + 10);\n break;\n case 'ArrowLeft':\n hlsPlayer?.seekTo(hlsPlayer?.getVideoElement().currentTime - 10);\n break;\n }\n },\n [hlsPlayer, isPaused],\n );\n\n return handleKeyEvent;\n};\nexport interface RTMPRecordingResolution {\n width: number;\n height: number;\n}\nexport const useRecordingHandler = () => {\n const hmsActions = useHMSActions();\n const recordingState: HMSRecording = useHMSStore(selectRecordingState);\n const [isRecordingLoading, setIsRecordingLoading] = useState(false);\n const [recordingStarted, setRecordingState] = useSetAppDataByKey(APP_DATA.recordingStarted);\n useEffect(() => {\n if (recordingState.browser.error && recordingStarted) {\n setRecordingState(false);\n }\n }, [recordingStarted, recordingState.browser.error, setRecordingState]);\n const startRecording = useCallback(\n async (resolution: RTMPRecordingResolution | null = null) => {\n try {\n setRecordingState(true);\n setIsRecordingLoading(true);\n await hmsActions.startRTMPOrRecording({\n resolution: getResolution(resolution),\n record: true,\n });\n } catch (error) {\n const err = error as Error;\n if (err.message.includes('stream already running')) {\n ToastManager.addToast({\n title: 'Recording already running',\n variant: 'error',\n });\n } else {\n ToastManager.addToast({\n title: err.message,\n variant: 'error',\n });\n }\n setRecordingState(false);\n }\n setIsRecordingLoading(false);\n },\n [hmsActions, setRecordingState],\n );\n return {\n recordingStarted,\n startRecording,\n isRecordingLoading,\n };\n};\n\nexport function getResolution(\n recordingResolution: RTMPRecordingResolution | null,\n): RTMPRecordingResolution | undefined {\n if (!recordingResolution) {\n return undefined;\n }\n const resolution: RTMPRecordingResolution = RTMP_RECORD_DEFAULT_RESOLUTION;\n if (recordingResolution.width) {\n resolution.width = recordingResolution.width;\n }\n if (recordingResolution.height) {\n resolution.height = recordingResolution.height;\n }\n return resolution;\n}\n\nexport interface WaitingRoomInfo {\n isNotAllowedToPublish: boolean;\n isScreenOnlyPublishParams: boolean;\n hasSubscribedRolePublishing: boolean;\n}\nexport function useWaitingRoomInfo(): WaitingRoomInfo {\n const localPeerRole = useHMSStore(selectLocalPeerRole);\n const { video, audio, screen } = useHMSStore(selectIsAllowedToPublish);\n const isScreenShareAllowed = isScreenshareSupported();\n const roles = useHMSStore(selectRolesMap);\n const peersByRoles = useHMSStore(selectPeersByRoles(localPeerRole?.subscribeParams.subscribeToRoles || []));\n // show no publish as screenshare in mweb is not possible\n const isNotAllowedToPublish = !(video || audio || (screen && isScreenShareAllowed));\n const isScreenOnlyPublishParams: boolean = screen && !(video || audio);\n const hasSubscribedRolePublishing: boolean = useMemo(() => {\n return peersByRoles.some((peer: HMSPeer) => {\n if (peer.roleName && roles[peer.roleName] && !peer.isLocal) {\n return !!roles[peer.roleName].publishParams?.allowed.length;\n }\n return false;\n });\n }, [peersByRoles, roles]);\n\n return {\n isNotAllowedToPublish,\n isScreenOnlyPublishParams,\n hasSubscribedRolePublishing,\n };\n}\n", "import { useEffect } from 'react';\n// @ts-ignore: No implicit Any\nimport { useSetAppDataByKey } from '../AppData/useUISettings';\nimport { APP_DATA } from '../../common/constants';\n\nexport const useDropdownList = ({ name, open }: { name: string; open: boolean }) => {\n const [dropdownList = [], setDropdownList] = useSetAppDataByKey(APP_DATA.dropdownList);\n\n useEffect(() => {\n if (open) {\n if (!dropdownList.includes(name)) {\n setDropdownList([...dropdownList, name]);\n }\n } else {\n const index = dropdownList.indexOf(name);\n if (index >= 0) {\n const newDropdownList = [...dropdownList];\n newDropdownList.splice(index, 1);\n setDropdownList(newDropdownList);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, name]);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,IAAM,eAAe,OAAO,MAAM,CAAC,CAAC;AAEpC,IAAM,kBAAkB,OAAO,SAAS;AAAA,EACtC,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,wBAAwB;AAAA,IACtB,iBAAiB;AAAA,E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