@100mslive/roomkit-react 0.3.23-alpha.0 → 0.3.24-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) 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-CLPW3BGP.css +2780 -0
  8. package/dist/{HLSView-DDIGCKAW.css.map → ConferenceScreen-CLPW3BGP.css.map} +1 -1
  9. package/dist/ConferenceScreen-M6RBPTAJ.js +1774 -0
  10. package/dist/ConferenceScreen-M6RBPTAJ.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-DDSO7ZCV.js +17 -0
  14. package/dist/EmbedView-DDSO7ZCV.js.map +7 -0
  15. package/dist/EmbedView-HGIUZHKA.css +2780 -0
  16. package/dist/EmbedView-HGIUZHKA.css.map +7 -0
  17. package/dist/EmojiReaction-23JDKJD4.js +11 -0
  18. package/dist/EmojiReaction-23JDKJD4.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-DDIGCKAW.css → HLSView-OW77EAAO.css} +3 -3
  22. package/dist/HLSView-OW77EAAO.css.map +7 -0
  23. package/dist/{HLSView-QZO4JEB7.js → HLSView-Q6GEB3UM.js} +38 -24
  24. package/dist/HLSView-Q6GEB3UM.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-BYTE73MT.js +556 -0
  31. package/dist/LeaveScreen-BYTE73MT.js.map +7 -0
  32. package/dist/LeaveScreen-P7AATEIF.css +2780 -0
  33. package/dist/LeaveScreen-P7AATEIF.css.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-LV5X2U6K.css +2780 -0
  38. package/dist/MoreSettings-LV5X2U6K.css.map +7 -0
  39. package/dist/MoreSettings-WSHMMNOC.js +16 -0
  40. package/dist/MoreSettings-WSHMMNOC.js.map +7 -0
  41. package/dist/PDFView-RIPRIIH6.css +2780 -0
  42. package/dist/PDFView-RIPRIIH6.css.map +7 -0
  43. package/dist/PDFView-ZFSG2ESE.js +84 -0
  44. package/dist/PDFView-ZFSG2ESE.js.map +7 -0
  45. package/dist/Pagination/StyledPagination.d.ts +268 -644
  46. package/dist/Polls-QWW5LTTB.js +1584 -0
  47. package/dist/Polls-QWW5LTTB.js.map +7 -0
  48. package/dist/Polls-ULYGUPPF.css +2780 -0
  49. package/dist/Polls-ULYGUPPF.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/ErrorNotifications.d.ts +1 -0
  56. package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +1 -0
  57. package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +1 -0
  58. package/dist/Prebuilt/components/Notifications/RoleChangeNotification.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-K7NFLH7H.js +10 -0
  63. package/dist/RaiseHand-K7NFLH7H.js.map +7 -0
  64. package/dist/ReactSelect/ReactSelect.d.ts +670 -1610
  65. package/dist/RoleProminence-235AFT7F.js +116 -0
  66. package/dist/RoleProminence-235AFT7F.js.map +7 -0
  67. package/dist/RoleProminence-6XN3POS5.css +2780 -0
  68. package/dist/RoleProminence-6XN3POS5.css.map +7 -0
  69. package/dist/RoomDetailsPane-O5TFMTPI.css +2780 -0
  70. package/dist/RoomDetailsPane-O5TFMTPI.css.map +7 -0
  71. package/dist/RoomDetailsPane-RF3D3TDR.js +53 -0
  72. package/dist/RoomDetailsPane-RF3D3TDR.js.map +7 -0
  73. package/dist/ScreenshareLayout-KNEB3AJJ.css +2780 -0
  74. package/dist/ScreenshareLayout-KNEB3AJJ.css.map +7 -0
  75. package/dist/ScreenshareLayout-PSQMS3NC.js +358 -0
  76. package/dist/ScreenshareLayout-PSQMS3NC.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-I6DECE5R.css +2780 -0
  80. package/dist/SidePaneTabs-I6DECE5R.css.map +7 -0
  81. package/dist/SidePaneTabs-NXHBI2JB.js +1354 -0
  82. package/dist/SidePaneTabs-NXHBI2JB.js.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-2CQ3IIO7.js +322 -0
  94. package/dist/VBPicker-2CQ3IIO7.js.map +7 -0
  95. package/dist/VBPicker-DCNYGO23.css +2780 -0
  96. package/dist/VBPicker-DCNYGO23.css.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-NZIUOXBI.js +10 -0
  101. package/dist/WaitingView-NZIUOXBI.js.map +7 -0
  102. package/dist/WhiteboardLayout-4YLFM3EY.js +96 -0
  103. package/dist/WhiteboardLayout-4YLFM3EY.js.map +7 -0
  104. package/dist/WhiteboardLayout-JUOBDFKY.css +2780 -0
  105. package/dist/WhiteboardLayout-JUOBDFKY.css.map +7 -0
  106. package/dist/android-perm-1.png +0 -0
  107. package/dist/audio-level.png +0 -0
  108. package/dist/chunk-3C7IESSI.js +254 -0
  109. package/dist/chunk-3C7IESSI.js.map +7 -0
  110. package/dist/chunk-7FD3VT6Q.js +114 -0
  111. package/dist/chunk-7FD3VT6Q.js.map +7 -0
  112. package/dist/chunk-AHI4HCY3.js +62 -0
  113. package/dist/chunk-AHI4HCY3.js.map +7 -0
  114. package/dist/chunk-BGSYLCVD.js +6337 -0
  115. package/dist/chunk-BGSYLCVD.js.map +7 -0
  116. package/dist/chunk-DANANDDE.js +418 -0
  117. package/dist/chunk-DANANDDE.js.map +7 -0
  118. package/dist/chunk-ETRNLEWQ.js +2658 -0
  119. package/dist/chunk-ETRNLEWQ.js.map +7 -0
  120. package/dist/chunk-EWPHJFZJ.js +487 -0
  121. package/dist/chunk-EWPHJFZJ.js.map +7 -0
  122. package/dist/chunk-F63YJBI4.js +98 -0
  123. package/dist/chunk-F63YJBI4.js.map +7 -0
  124. package/dist/chunk-GLAJUP3O.js +576 -0
  125. package/dist/chunk-GLAJUP3O.js.map +7 -0
  126. package/dist/chunk-GOXRTCTY.js +90 -0
  127. package/dist/chunk-GOXRTCTY.js.map +7 -0
  128. package/dist/chunk-HMCBZI3A.js +59 -0
  129. package/dist/chunk-HMCBZI3A.js.map +7 -0
  130. package/dist/chunk-HVYTC3PX.js +171 -0
  131. package/dist/chunk-HVYTC3PX.js.map +7 -0
  132. package/dist/chunk-LJVP6AWF.js +262 -0
  133. package/dist/chunk-LJVP6AWF.js.map +7 -0
  134. package/dist/chunk-LXJGCRKM.js +30 -0
  135. package/dist/chunk-LXJGCRKM.js.map +7 -0
  136. package/dist/chunk-MG3UGW66.js +16800 -0
  137. package/dist/chunk-MG3UGW66.js.map +7 -0
  138. package/dist/chunk-MUKUP7JU.js +161 -0
  139. package/dist/chunk-MUKUP7JU.js.map +7 -0
  140. package/dist/chunk-OV6MVDCL.js +41 -0
  141. package/dist/chunk-OV6MVDCL.js.map +7 -0
  142. package/dist/chunk-P6NV2XO4.js +178 -0
  143. package/dist/chunk-P6NV2XO4.js.map +7 -0
  144. package/dist/chunk-REL3HBSD.js +71 -0
  145. package/dist/chunk-REL3HBSD.js.map +7 -0
  146. package/dist/chunk-U4SQBXPZ.js +830 -0
  147. package/dist/chunk-U4SQBXPZ.js.map +7 -0
  148. package/dist/chunk-YEL5ZTFU.js +136 -0
  149. package/dist/chunk-YEL5ZTFU.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 +21713 -21508
  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 +5515 -5153
  160. package/dist/meta.esbuild.json +8998 -6138
  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/MoreSettings/SplitComponents/MwebOptions.tsx +14 -1
  171. package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +18 -0
  172. package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +56 -0
  173. package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +24 -0
  174. package/src/Prebuilt/components/Notifications/Notifications.tsx +13 -171
  175. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +9 -2
  176. package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +71 -0
  177. package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +1 -5
  178. package/src/Prebuilt/components/Notifications/RoleChangeNotification.tsx +24 -0
  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 +122 -9
  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/src/Prebuilt/layouts/WaitingView.tsx +2 -2
  192. package/dist/HLSView-QZO4JEB7.js.map +0 -7
  193. package/dist/chunk-J2QT7G3M.js +0 -34759
  194. package/dist/chunk-J2QT7G3M.js.map +0 -7
@@ -0,0 +1,262 @@
1
+ import {
2
+ LiveStatus,
3
+ RecordingPauseStatus,
4
+ RecordingStatus,
5
+ StreamActions
6
+ } from "./chunk-3C7IESSI.js";
7
+ import {
8
+ HorizontalDivider,
9
+ Label,
10
+ Logo,
11
+ Sheet,
12
+ SpeakerTag,
13
+ useSheetToggle,
14
+ useSidepaneToggle
15
+ } from "./chunk-MG3UGW66.js";
16
+ import {
17
+ Text
18
+ } from "./chunk-MUKUP7JU.js";
19
+ import {
20
+ ToastManager
21
+ } from "./chunk-DANANDDE.js";
22
+ import {
23
+ Box,
24
+ Flex
25
+ } from "./chunk-GOXRTCTY.js";
26
+ import {
27
+ IconButton_default,
28
+ useRoomLayoutHeader
29
+ } from "./chunk-BGSYLCVD.js";
30
+ import {
31
+ SHEET_OPTIONS,
32
+ SIDE_PANE_OPTIONS,
33
+ __async,
34
+ config,
35
+ init_define_process_env
36
+ } from "./chunk-GLAJUP3O.js";
37
+
38
+ // src/Prebuilt/components/Header/Header.tsx
39
+ init_define_process_env();
40
+ import React3 from "react";
41
+ import { useMedia as useMedia2 } from "react-use";
42
+ import { HMSRoomState, selectRoomState, useHMSStore as useHMSStore2 } from "@100mslive/react-sdk";
43
+
44
+ // src/Prebuilt/components/Header/RoomDetailsHeader.tsx
45
+ init_define_process_env();
46
+ import React from "react";
47
+ import { useMedia } from "react-use";
48
+ import { ChevronRightIcon } from "@100mslive/react-icons";
49
+ var RoomDetailsHeader = () => {
50
+ const { title, description } = useRoomLayoutHeader();
51
+ const isMobile = useMedia(config.media.md);
52
+ const clipLength = 30;
53
+ const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);
54
+ const toggleDetailsSheet = useSheetToggle(SHEET_OPTIONS.ROOM_DETAILS);
55
+ if (!title && !description || isMobile && !title) {
56
+ return null;
57
+ }
58
+ return /* @__PURE__ */ React.createElement(Flex, { direction: isMobile ? "row" : "column", css: { ml: "$8", alignItems: isMobile ? "center" : "start" } }, /* @__PURE__ */ React.createElement(Text, { variant: "sm", css: { c: "$on_surface_high", fontWeight: "$semiBold" } }, title), !isMobile && /* @__PURE__ */ React.createElement(Flex, { align: "end", css: { color: "$on_surface_high" } }, /* @__PURE__ */ React.createElement(Text, { variant: "xs", css: { c: "$on_surface_medium" } }, description.slice(0, clipLength)), description.length > clipLength ? /* @__PURE__ */ React.createElement(
59
+ "span",
60
+ {
61
+ style: { fontWeight: "600", fontSize: "12px", cursor: "pointer", lineHeight: "1rem" },
62
+ onClick: toggleDetailsPane
63
+ },
64
+ "\xA0...more"
65
+ ) : null), isMobile && description ? /* @__PURE__ */ React.createElement(Flex, { css: { color: "$on_surface_medium" } }, /* @__PURE__ */ React.createElement(ChevronRightIcon, { height: 16, width: 16, onClick: toggleDetailsSheet })) : null);
66
+ };
67
+
68
+ // src/Prebuilt/components/Header/common.jsx
69
+ init_define_process_env();
70
+ import React2 from "react";
71
+ import {
72
+ DeviceType,
73
+ getAudioDeviceCategory,
74
+ HMSAudioDeviceCategory,
75
+ selectIsLocalVideoEnabled,
76
+ selectLocalVideoTrackID,
77
+ selectVideoTrackByID,
78
+ useDevices,
79
+ useHMSActions,
80
+ useHMSStore
81
+ } from "@100mslive/react-sdk";
82
+ import {
83
+ BluetoothIcon,
84
+ CameraFlipIcon,
85
+ CheckIcon,
86
+ CrossIcon,
87
+ HeadphonesIcon,
88
+ SpeakerIcon,
89
+ TelePhoneIcon
90
+ } from "@100mslive/react-icons";
91
+ var CamaraFlipActions = () => {
92
+ const actions = useHMSActions();
93
+ const { allDevices } = useDevices();
94
+ const { videoInput } = allDevices;
95
+ const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
96
+ const videoTrackId = useHMSStore(selectLocalVideoTrackID);
97
+ const localVideoTrack = useHMSStore(selectVideoTrackByID(videoTrackId));
98
+ if (!videoInput || !(videoInput == null ? void 0 : videoInput.length) || !(localVideoTrack == null ? void 0 : localVideoTrack.facingMode)) {
99
+ return null;
100
+ }
101
+ return /* @__PURE__ */ React2.createElement(Box, null, /* @__PURE__ */ React2.createElement(
102
+ IconButton_default,
103
+ {
104
+ disabled: !isVideoOn,
105
+ onClick: () => __async(void 0, null, function* () {
106
+ try {
107
+ yield actions.switchCamera();
108
+ } catch (e) {
109
+ ToastManager.addToast({
110
+ title: `Error while flipping camera ${e.message || ""}`,
111
+ variant: "error"
112
+ });
113
+ }
114
+ })
115
+ },
116
+ /* @__PURE__ */ React2.createElement(CameraFlipIcon, null)
117
+ ));
118
+ };
119
+ var AudioActions = () => {
120
+ const { allDevices, selectedDeviceIDs, updateDevice } = useDevices();
121
+ const shouldShowAudioOutput = "setSinkId" in HTMLMediaElement.prototype;
122
+ const { audioInput, audioOutput } = allDevices;
123
+ let availableAudioDevices = audioInput;
124
+ let selectedAudio = selectedDeviceIDs.audioInput;
125
+ if (shouldShowAudioOutput) {
126
+ availableAudioDevices = audioOutput;
127
+ selectedAudio = selectedDeviceIDs.audioOutput;
128
+ }
129
+ const hmsActions = useHMSActions();
130
+ const audioFiltered = availableAudioDevices == null ? void 0 : availableAudioDevices.find((item) => !!item.label);
131
+ const currentSelection = availableAudioDevices == null ? void 0 : availableAudioDevices.find((item) => item.deviceId === selectedAudio);
132
+ if (!audioFiltered) {
133
+ return null;
134
+ }
135
+ const deviceCategory = getAudioDeviceCategory(currentSelection == null ? void 0 : currentSelection.label);
136
+ let AudioIcon = /* @__PURE__ */ React2.createElement(SpeakerIcon, null);
137
+ if (deviceCategory === HMSAudioDeviceCategory.BLUETOOTH) {
138
+ AudioIcon = /* @__PURE__ */ React2.createElement(BluetoothIcon, null);
139
+ } else if (deviceCategory === HMSAudioDeviceCategory.WIRED) {
140
+ AudioIcon = /* @__PURE__ */ React2.createElement(HeadphonesIcon, null);
141
+ } else if (deviceCategory === HMSAudioDeviceCategory.EARPIECE) {
142
+ AudioIcon = /* @__PURE__ */ React2.createElement(TelePhoneIcon, null);
143
+ }
144
+ return /* @__PURE__ */ React2.createElement(
145
+ AudioSelectionSheet,
146
+ {
147
+ audioDevices: availableAudioDevices,
148
+ audioSelected: selectedAudio,
149
+ onChange: (deviceId) => __async(void 0, null, function* () {
150
+ try {
151
+ yield updateDevice({
152
+ deviceId,
153
+ deviceType: shouldShowAudioOutput ? DeviceType.audioOutput : DeviceType.audioInput
154
+ });
155
+ } catch (e) {
156
+ ToastManager.addToast({
157
+ title: `Error while changing audio device ${e.message || ""}`,
158
+ variant: "error"
159
+ });
160
+ }
161
+ })
162
+ },
163
+ /* @__PURE__ */ React2.createElement(
164
+ Box,
165
+ {
166
+ onClick: () => __async(void 0, null, function* () {
167
+ yield hmsActions.refreshDevices();
168
+ })
169
+ },
170
+ /* @__PURE__ */ React2.createElement(IconButton_default, null, AudioIcon)
171
+ )
172
+ );
173
+ };
174
+ var AudioSelectionSheet = ({ audioDevices, audioSelected, onChange, children }) => {
175
+ return /* @__PURE__ */ React2.createElement(Sheet.Root, null, /* @__PURE__ */ React2.createElement(Sheet.Trigger, { asChild: true }, children), /* @__PURE__ */ React2.createElement(Sheet.Content, null, /* @__PURE__ */ React2.createElement(Sheet.Title, { css: { py: "$10", px: "$8", alignItems: "center" } }, /* @__PURE__ */ React2.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%" } }, /* @__PURE__ */ React2.createElement(Text, { variant: "h6", css: { display: "flex" } }, "Audio"), /* @__PURE__ */ React2.createElement(Sheet.Close, null, /* @__PURE__ */ React2.createElement(IconButton_default, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React2.createElement(CrossIcon, null))))), /* @__PURE__ */ React2.createElement(HorizontalDivider, null), /* @__PURE__ */ React2.createElement(
176
+ Flex,
177
+ {
178
+ direction: "column",
179
+ css: {
180
+ px: "$8",
181
+ maxHeight: "80vh",
182
+ overflowY: "auto"
183
+ }
184
+ },
185
+ audioDevices.map((audioDevice) => {
186
+ return /* @__PURE__ */ React2.createElement(
187
+ SelectWithLabel,
188
+ {
189
+ key: audioDevice.deviceId,
190
+ label: audioDevice.label,
191
+ id: audioDevice.deviceId,
192
+ checked: audioDevice.deviceId === audioSelected,
193
+ onChange: () => onChange(audioDevice.deviceId)
194
+ }
195
+ );
196
+ })
197
+ )));
198
+ };
199
+ var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React2.createElement(React2.Fragment, null), checked, id, onChange }) => {
200
+ return /* @__PURE__ */ React2.createElement(
201
+ Flex,
202
+ {
203
+ align: "center",
204
+ css: {
205
+ my: "$2",
206
+ py: "$8",
207
+ w: "100%",
208
+ borderBottom: "1px solid $border_default"
209
+ },
210
+ onClick: onChange
211
+ },
212
+ /* @__PURE__ */ React2.createElement(
213
+ Label,
214
+ {
215
+ htmlFor: id,
216
+ css: {
217
+ fontSize: "$md",
218
+ fontWeight: "$semiBold",
219
+ color: "$on_surface_high",
220
+ cursor: "pointer",
221
+ display: "flex",
222
+ alignItems: "center",
223
+ gap: "$8",
224
+ flex: "1 1 0"
225
+ }
226
+ },
227
+ icon,
228
+ label
229
+ ),
230
+ checked && /* @__PURE__ */ React2.createElement(CheckIcon, { width: 24, height: 24 })
231
+ );
232
+ };
233
+
234
+ // src/Prebuilt/components/Header/Header.tsx
235
+ var Header = () => {
236
+ const roomState = useHMSStore2(selectRoomState);
237
+ const isMobile = useMedia2(config.media.md);
238
+ if (roomState !== HMSRoomState.Connected) {
239
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null);
240
+ }
241
+ return /* @__PURE__ */ React3.createElement(Flex, { justify: "between", align: "center", css: { position: "relative", height: "100%" } }, /* @__PURE__ */ React3.createElement(Flex, { align: "center", gap: "2", css: { position: "absolute", left: "$10" } }, /* @__PURE__ */ React3.createElement(Logo, null), /* @__PURE__ */ React3.createElement(RoomDetailsHeader, null), /* @__PURE__ */ React3.createElement(SpeakerTag, null), isMobile && /* @__PURE__ */ React3.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React3.createElement(LiveStatus, null), /* @__PURE__ */ React3.createElement(RecordingStatus, null), /* @__PURE__ */ React3.createElement(RecordingPauseStatus, null))), /* @__PURE__ */ React3.createElement(
242
+ Flex,
243
+ {
244
+ align: "center",
245
+ css: {
246
+ position: "absolute",
247
+ right: "$10",
248
+ gap: "$4"
249
+ }
250
+ },
251
+ /* @__PURE__ */ React3.createElement(StreamActions, null),
252
+ isMobile ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(CamaraFlipActions, null), /* @__PURE__ */ React3.createElement(AudioActions, null)) : null
253
+ ));
254
+ };
255
+
256
+ // src/Prebuilt/components/Header/index.tsx
257
+ init_define_process_env();
258
+
259
+ export {
260
+ Header
261
+ };
262
+ //# sourceMappingURL=chunk-LJVP6AWF.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Prebuilt/components/Header/Header.tsx", "../src/Prebuilt/components/Header/RoomDetailsHeader.tsx", "../src/Prebuilt/components/Header/common.jsx", "../src/Prebuilt/components/Header/index.tsx"],
4
+ "sourcesContent": ["import React from 'react';\nimport { useMedia } from 'react-use';\nimport { HMSRoomState, selectRoomState, useHMSStore } from '@100mslive/react-sdk';\nimport { config as cssConfig, Flex } from '../../..';\n// @ts-ignore: No implicit any\nimport { Logo, SpeakerTag } from './HeaderComponents';\n// @ts-ignore: No implicit any\nimport { RoomDetailsHeader } from './RoomDetailsHeader';\nimport { LiveStatus, RecordingPauseStatus, RecordingStatus, StreamActions } from './StreamActions';\n// @ts-ignore: No implicit any\nimport { AudioActions, CamaraFlipActions } from './common';\n\nexport const Header = () => {\n const roomState = useHMSStore(selectRoomState);\n const isMobile = useMedia(cssConfig.media.md);\n // Header should be present only inside the call - not in preview, leave room states\n if (roomState !== HMSRoomState.Connected) {\n return <></>;\n }\n return (\n <Flex justify=\"between\" align=\"center\" css={{ position: 'relative', height: '100%' }}>\n <Flex align=\"center\" gap=\"2\" css={{ position: 'absolute', left: '$10' }}>\n <Logo />\n <RoomDetailsHeader />\n <SpeakerTag />\n {isMobile && (\n <Flex align=\"center\" css={{ gap: '$4' }}>\n <LiveStatus />\n <RecordingStatus />\n <RecordingPauseStatus />\n </Flex>\n )}\n </Flex>\n <Flex\n align=\"center\"\n css={{\n position: 'absolute',\n right: '$10',\n gap: '$4',\n }}\n >\n <StreamActions />\n {isMobile ? (\n <>\n <CamaraFlipActions />\n <AudioActions />\n </>\n ) : null}\n </Flex>\n </Flex>\n );\n};\n", "import React from 'react';\nimport { useMedia } from 'react-use';\nimport { ChevronRightIcon } from '@100mslive/react-icons';\nimport { Flex } from '../../../Layout';\nimport { Text } from '../../../Text';\nimport { config as cssConfig } from '../../../Theme';\nimport { useRoomLayoutHeader } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\nimport { useSheetToggle } from '../AppData/useSheet';\n// @ts-ignore\nimport { useSidepaneToggle } from '../AppData/useSidepane';\nimport { SHEET_OPTIONS, SIDE_PANE_OPTIONS } from '../../common/constants';\n\nexport const RoomDetailsHeader = () => {\n const { title, description } = useRoomLayoutHeader();\n const isMobile = useMedia(cssConfig.media.md);\n const clipLength = 30;\n const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);\n const toggleDetailsSheet = useSheetToggle(SHEET_OPTIONS.ROOM_DETAILS);\n\n if ((!title && !description) || (isMobile && !title)) {\n return null;\n }\n\n return (\n <Flex direction={isMobile ? 'row' : 'column'} css={{ ml: '$8', alignItems: isMobile ? 'center' : 'start' }}>\n <Text variant=\"sm\" css={{ c: '$on_surface_high', fontWeight: '$semiBold' }}>\n {title}\n </Text>\n {!isMobile && (\n <Flex align=\"end\" css={{ color: '$on_surface_high' }}>\n <Text variant=\"xs\" css={{ c: '$on_surface_medium' }}>\n {description.slice(0, clipLength)}\n </Text>\n {description.length > clipLength ? (\n <span\n style={{ fontWeight: '600', fontSize: '12px', cursor: 'pointer', lineHeight: '1rem' }}\n onClick={toggleDetailsPane}\n >\n &nbsp;...more\n </span>\n ) : null}\n </Flex>\n )}\n {isMobile && description ? (\n <Flex css={{ color: '$on_surface_medium' }}>\n <ChevronRightIcon height={16} width={16} onClick={toggleDetailsSheet} />\n </Flex>\n ) : null}\n </Flex>\n );\n};\n", "import React from 'react';\nimport {\n DeviceType,\n getAudioDeviceCategory,\n HMSAudioDeviceCategory,\n selectIsLocalVideoEnabled,\n selectLocalVideoTrackID,\n selectVideoTrackByID,\n useDevices,\n useHMSActions,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport {\n BluetoothIcon,\n CameraFlipIcon,\n CheckIcon,\n CrossIcon,\n HeadphonesIcon,\n SpeakerIcon,\n TelePhoneIcon,\n} from '@100mslive/react-icons';\nimport { HorizontalDivider } from '../../../Divider';\nimport { Label } from '../../../Label';\nimport { Box, Flex } from '../../../Layout';\nimport { Sheet } from '../../../Sheet';\nimport { Text } from '../../../Text';\nimport IconButton from '../../IconButton';\nimport { ToastManager } from '../Toast/ToastManager';\n\nexport const CamaraFlipActions = () => {\n const actions = useHMSActions();\n const { allDevices } = useDevices();\n const { videoInput } = allDevices;\n const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);\n\n const videoTrackId = useHMSStore(selectLocalVideoTrackID);\n const localVideoTrack = useHMSStore(selectVideoTrackByID(videoTrackId));\n if (!videoInput || !videoInput?.length || !localVideoTrack?.facingMode) {\n return null;\n }\n return (\n <Box>\n <IconButton\n disabled={!isVideoOn}\n onClick={async () => {\n try {\n await actions.switchCamera();\n } catch (e) {\n ToastManager.addToast({\n title: `Error while flipping camera ${e.message || ''}`,\n variant: 'error',\n });\n }\n }}\n >\n <CameraFlipIcon />\n </IconButton>\n </Box>\n );\n};\n\n// It will handle and show audio input devices in Mweb while audio output devices in desktop\nexport const AudioActions = () => {\n const { allDevices, selectedDeviceIDs, updateDevice } = useDevices();\n\n // don't show speaker selector where the API is not supported, and use\n // a generic word(\"Audio\") for Mic. In some cases(Chrome Android for example) this changes both mic and speaker keeping them in sync.\n const shouldShowAudioOutput = 'setSinkId' in HTMLMediaElement.prototype;\n const { audioInput, audioOutput } = allDevices;\n let availableAudioDevices = audioInput;\n let selectedAudio = selectedDeviceIDs.audioInput;\n if (shouldShowAudioOutput) {\n availableAudioDevices = audioOutput;\n selectedAudio = selectedDeviceIDs.audioOutput;\n }\n const hmsActions = useHMSActions();\n const audioFiltered = availableAudioDevices?.find(item => !!item.label);\n const currentSelection = availableAudioDevices?.find(item => item.deviceId === selectedAudio);\n\n if (!audioFiltered) {\n return null;\n }\n const deviceCategory = getAudioDeviceCategory(currentSelection?.label);\n let AudioIcon = <SpeakerIcon />;\n if (deviceCategory === HMSAudioDeviceCategory.BLUETOOTH) {\n AudioIcon = <BluetoothIcon />;\n } else if (deviceCategory === HMSAudioDeviceCategory.WIRED) {\n AudioIcon = <HeadphonesIcon />;\n } else if (deviceCategory === HMSAudioDeviceCategory.EARPIECE) {\n AudioIcon = <TelePhoneIcon />;\n }\n return (\n <AudioSelectionSheet\n audioDevices={availableAudioDevices}\n audioSelected={selectedAudio}\n onChange={async deviceId => {\n try {\n await updateDevice({\n deviceId,\n deviceType: shouldShowAudioOutput ? DeviceType.audioOutput : DeviceType.audioInput,\n });\n } catch (e) {\n ToastManager.addToast({\n title: `Error while changing audio device ${e.message || ''}`,\n variant: 'error',\n });\n }\n }}\n >\n <Box\n onClick={async () => {\n // refresh device as `devicechange` listener won't work in mobile device\n await hmsActions.refreshDevices();\n }}\n >\n <IconButton>{AudioIcon}</IconButton>\n </Box>\n </AudioSelectionSheet>\n );\n};\n\nconst AudioSelectionSheet = ({ audioDevices, audioSelected, onChange, children }) => {\n return (\n <Sheet.Root>\n <Sheet.Trigger asChild>{children}</Sheet.Trigger>\n <Sheet.Content>\n <Sheet.Title css={{ py: '$10', px: '$8', alignItems: 'center' }}>\n <Flex direction=\"row\" justify=\"between\" css={{ w: '100%' }}>\n <Text variant=\"h6\" css={{ display: 'flex' }}>\n Audio\n </Text>\n <Sheet.Close>\n <IconButton as=\"div\" data-testid=\"dialog_cross_icon\">\n <CrossIcon />\n </IconButton>\n </Sheet.Close>\n </Flex>\n </Sheet.Title>\n <HorizontalDivider />\n <Flex\n direction=\"column\"\n css={{\n px: '$8',\n maxHeight: '80vh',\n overflowY: 'auto',\n }}\n >\n {audioDevices.map(audioDevice => {\n return (\n <SelectWithLabel\n key={audioDevice.deviceId}\n label={audioDevice.label}\n id={audioDevice.deviceId}\n checked={audioDevice.deviceId === audioSelected}\n onChange={() => onChange(audioDevice.deviceId)}\n />\n );\n })}\n </Flex>\n </Sheet.Content>\n </Sheet.Root>\n );\n};\n\nconst SelectWithLabel = ({ label, icon = <></>, checked, id, onChange }) => {\n return (\n <Flex\n align=\"center\"\n css={{\n my: '$2',\n py: '$8',\n w: '100%',\n borderBottom: '1px solid $border_default',\n }}\n onClick={onChange}\n >\n <Label\n htmlFor={id}\n css={{\n fontSize: '$md',\n fontWeight: '$semiBold',\n color: '$on_surface_high',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n gap: '$8',\n flex: '1 1 0',\n }}\n >\n {icon}\n {label}\n </Label>\n {checked && <CheckIcon width={24} height={24} />}\n </Flex>\n );\n};\n", "export { Header } from './Header';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAOA,YAAW;AAClB,SAAS,YAAAC,iBAAgB;AACzB,SAAS,cAAc,iBAAiB,eAAAC,oBAAmB;;;ACF3D;AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AAU1B,IAAM,oBAAoB,MAAM;AACrC,QAAM,EAAE,OAAO,YAAY,IAAI,oBAAoB;AACnD,QAAM,WAAW,SAAS,OAAU,MAAM,EAAE;AAC5C,QAAM,aAAa;AACnB,QAAM,oBAAoB,kBAAkB,kBAAkB,YAAY;AAC1E,QAAM,qBAAqB,eAAe,cAAc,YAAY;AAEpE,MAAK,CAAC,SAAS,CAAC,eAAiB,YAAY,CAAC,OAAQ;AACpD,WAAO;AAAA,EACT;AAEA,SACE,oCAAC,QAAK,WAAW,WAAW,QAAQ,UAAU,KAAK,EAAE,IAAI,MAAM,YAAY,WAAW,WAAW,QAAQ,KACvG,oCAAC,QAAK,SAAQ,MAAK,KAAK,EAAE,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kB,GACnB,gBAAAA,OAAA,cAAC,gBAAW,GACX,YACC,gBAAAA,OAAA,cAAC,QAAK,OAAM,UAAS,KAAK,EAAE,KAAK,KAAK,KACpC,gBAAAA,OAAA,cAAC,gBAAW,GACZ,gBAAAA,OAAA,cAAC,qBAAgB,GACjB,gBAAAA,OAAA,cAAC,0BAAqB,CACxB,CAEJ,GACA,gBAAAA,OAAA;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,KAAK;AAAA,QACH,UAAU;AAAA,QACV,OAAO;AAAA,QACP,KAAK;AAAA,MACP;AAAA;AAAA,IAEA,gBAAAA,OAAA,cAAC,mBAAc;AAAA,IACd,WACC,gBAAAA,OAAA,cAAAA,OAAA,gBACE,gBAAAA,OAAA,cAAC,uBAAkB,GACnB,gBAAAA,OAAA,cAAC,kBAAa,CAChB,IACE;AAAA,EACN,CACF;AAEJ;;;AGnDA;",
6
+ "names": ["React", "useMedia", "useHMSStore", "React", "React", "useHMSStore", "useMedia", "React"]
7
+ }
@@ -0,0 +1,30 @@
1
+ import {
2
+ useSidepaneReset
3
+ } from "./chunk-MG3UGW66.js";
4
+ import {
5
+ useRoomLayoutConferencingScreen
6
+ } from "./chunk-BGSYLCVD.js";
7
+ import {
8
+ APP_DATA,
9
+ init_define_process_env
10
+ } from "./chunk-GLAJUP3O.js";
11
+
12
+ // src/Prebuilt/components/AppData/useSidepaneResetOnLayoutUpdate.tsx
13
+ init_define_process_env();
14
+ import { useEffect } from "react";
15
+ import { selectAppData, useHMSStore } from "@100mslive/react-sdk";
16
+ var useSidepaneResetOnLayoutUpdate = (layoutKey, sidepaneOption) => {
17
+ const { elements } = useRoomLayoutConferencingScreen();
18
+ const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
19
+ const resetSidePane = useSidepaneReset();
20
+ useEffect(() => {
21
+ if (sidepane === sidepaneOption && !(elements == null ? void 0 : elements[layoutKey])) {
22
+ resetSidePane();
23
+ }
24
+ }, [elements, elements == null ? void 0 : elements[layoutKey], resetSidePane, sidepane, layoutKey, sidepaneOption]);
25
+ };
26
+
27
+ export {
28
+ useSidepaneResetOnLayoutUpdate
29
+ };
30
+ //# sourceMappingURL=chunk-LXJGCRKM.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Prebuilt/components/AppData/useSidepaneResetOnLayoutUpdate.tsx"],
4
+ "sourcesContent": ["import { useEffect } from 'react';\nimport { DefaultConferencingScreen_Elements } from '@100mslive/types-prebuilt';\nimport { selectAppData, useHMSStore } from '@100mslive/react-sdk';\nimport { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\n// @ts-ignore\nimport { useSidepaneReset } from './useSidepane';\nimport { APP_DATA, SidePaneOption } from '../../common/constants';\n\n// Closes the sidepane if an element is removed from the layout via the customiser\nexport const useSidepaneResetOnLayoutUpdate = (\n layoutKey: keyof DefaultConferencingScreen_Elements,\n sidepaneOption: SidePaneOption,\n) => {\n const { elements } = useRoomLayoutConferencingScreen();\n const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));\n const resetSidePane = useSidepaneReset();\n useEffect(() => {\n if (sidepane === sidepaneOption && !elements?.[layoutKey]) {\n resetSidePane();\n }\n }, [elements, elements?.[layoutKey], resetSidePane, sidepane, layoutKey, sidepaneOption]);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;AAAA;AAAA,SAAS,iBAAiB;AAE1B,SAAS,eAAe,mBAAmB;AAOpC,IAAM,iCAAiC,CAC5C,WACA,mBACG;AACH,QAAM,EAAE,SAAS,IAAI,gCAAgC;AACrD,QAAM,WAAW,YAAY,cAAc,SAAS,QAAQ,CAAC;AAC7D,QAAM,gBAAgB,iBAAiB;AACvC,YAAU,MAAM;AACd,QAAI,aAAa,kBAAkB,EAAC,qCAAW,aAAY;AACzD,oBAAc;AAAA,IAChB;AAAA,EACF,GAAG,CAAC,UAAU,qCAAW,YAAY,eAAe,UAAU,WAAW,cAAc,CAAC;AAC1F;",
6
+ "names": []
7
+ }