@100mslive/roomkit-react 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (459) hide show
  1. package/README.md +1 -0
  2. package/dist/Accordion/Accordion.d.ts +964 -0
  3. package/dist/Accordion/index.d.ts +979 -0
  4. package/dist/ActiveSpeakerView-H3VYXANB.js +39 -0
  5. package/dist/ActiveSpeakerView-H3VYXANB.js.map +7 -0
  6. package/dist/ActiveSpeakerView-REZLWPPI.css +11 -0
  7. package/dist/ActiveSpeakerView-REZLWPPI.css.map +7 -0
  8. package/dist/AudioLevel/AudioLevel.d.ts +8 -0
  9. package/dist/AudioLevel/index.d.ts +1 -0
  10. package/dist/Avatar/Avatar.d.ts +487 -0
  11. package/dist/Avatar/getAvatarBg.d.ts +7 -0
  12. package/dist/Avatar/index.d.ts +1 -0
  13. package/dist/Button/Button.d.ts +488 -0
  14. package/dist/Button/index.d.ts +1 -0
  15. package/dist/Checkbox/Checkbox.d.ts +958 -0
  16. package/dist/Checkbox/index.d.ts +1 -0
  17. package/dist/Collapsible/Collapsible.d.ts +1434 -0
  18. package/dist/Collapsible/index.d.ts +1 -0
  19. package/dist/Divider/Divider.d.ts +958 -0
  20. package/dist/Divider/index.d.ts +1 -0
  21. package/dist/Dropdown/Dropdown.d.ts +5728 -0
  22. package/dist/Dropdown/index.d.ts +1 -0
  23. package/dist/Fieldset/Fieldset.d.ts +477 -0
  24. package/dist/Fieldset/index.d.ts +1 -0
  25. package/dist/Footer/Footer.d.ts +3834 -0
  26. package/dist/Footer/index.d.ts +1 -0
  27. package/dist/HLSView-3RDXRV7Y.js +689 -0
  28. package/dist/HLSView-3RDXRV7Y.js.map +7 -0
  29. package/dist/HLSView-6BVBCQM7.css +11 -0
  30. package/dist/HLSView-6BVBCQM7.css.map +7 -0
  31. package/dist/IconButton/IconButton.d.ts +479 -0
  32. package/dist/IconButton/index.d.ts +1 -0
  33. package/dist/Input/Input.d.ts +2917 -0
  34. package/dist/Input/index.d.ts +1 -0
  35. package/dist/Label/Label.d.ts +479 -0
  36. package/dist/Label/index.d.ts +1 -0
  37. package/dist/Layout/Box.d.ts +477 -0
  38. package/dist/Layout/Flex.d.ts +482 -0
  39. package/dist/Layout/index.d.ts +2 -0
  40. package/dist/Link/Link.d.ts +489 -0
  41. package/dist/Link/index.d.ts +2 -0
  42. package/dist/Loading/Loading.d.ts +14 -0
  43. package/dist/Loading/index.d.ts +1 -0
  44. package/dist/Modal/Dialog.d.ts +3826 -0
  45. package/dist/Modal/DialogContent.d.ts +3343 -0
  46. package/dist/Modal/index.d.ts +1 -0
  47. package/dist/Pagination/StyledPagination.d.ts +1918 -0
  48. package/dist/Pagination/index.d.ts +1 -0
  49. package/dist/PinnedTrackView-453PELNU.js +70 -0
  50. package/dist/PinnedTrackView-453PELNU.js.map +7 -0
  51. package/dist/PinnedTrackView-QQ5FDXJX.css +11 -0
  52. package/dist/PinnedTrackView-QQ5FDXJX.css.map +7 -0
  53. package/dist/Popover/index.d.ts +1436 -0
  54. package/dist/Progress/index.d.ts +957 -0
  55. package/dist/QRCode/QRCode.d.ts +3 -0
  56. package/dist/QRCode/index.d.ts +1 -0
  57. package/dist/RadioGroup/RadioGroup.d.ts +1435 -0
  58. package/dist/RadioGroup/index.d.ts +1 -0
  59. package/dist/ReactSelect/ReactSelect.d.ts +4778 -0
  60. package/dist/ReactSelect/index.d.ts +1 -0
  61. package/dist/Select/Select.d.ts +1437 -0
  62. package/dist/Select/index.d.ts +1 -0
  63. package/dist/Slider/Slider.d.ts +488 -0
  64. package/dist/Slider/index.d.ts +1 -0
  65. package/dist/Stats/Stats.d.ts +19 -0
  66. package/dist/Stats/StyledStats.d.ts +2872 -0
  67. package/dist/Stats/formatBytes.d.ts +1 -0
  68. package/dist/Stats/index.d.ts +1 -0
  69. package/dist/Switch/Switch.d.ts +482 -0
  70. package/dist/Switch/index.d.ts +1 -0
  71. package/dist/Tabs/Tabs.d.ts +1912 -0
  72. package/dist/Tabs/index.d.ts +1 -0
  73. package/dist/Text/Text.d.ts +605 -0
  74. package/dist/Text/index.d.ts +1 -0
  75. package/dist/Theme/ThemeProvider.d.ts +397 -0
  76. package/dist/Theme/base.config.d.ts +417 -0
  77. package/dist/Theme/index.d.ts +3 -0
  78. package/dist/Theme/stitches.config.d.ts +4702 -0
  79. package/dist/Theme/themes.d.ts +64 -0
  80. package/dist/Theme/useSSR.d.ts +6 -0
  81. package/dist/TileMenu/StyledMenuTile.d.ts +3351 -0
  82. package/dist/TileMenu/TileMenu.d.ts +6 -0
  83. package/dist/TileMenu/index.d.ts +1 -0
  84. package/dist/Toast/Toast.d.ts +2881 -0
  85. package/dist/Toast/index.d.ts +1 -0
  86. package/dist/Tooltip/Tooltip.d.ts +14 -0
  87. package/dist/Tooltip/index.d.ts +1 -0
  88. package/dist/Video/Video.d.ts +499 -0
  89. package/dist/Video/index.d.ts +1 -0
  90. package/dist/VideoList/StyledVideoList.d.ts +1438 -0
  91. package/dist/VideoList/index.d.ts +2 -0
  92. package/dist/VideoList/videoListUtils.d.ts +1 -0
  93. package/dist/VideoTile/StyledVideoTile.d.ts +4309 -0
  94. package/dist/VideoTile/index.d.ts +1 -0
  95. package/dist/VirtualBackground-LHYBWUT5.js +158 -0
  96. package/dist/VirtualBackground-LHYBWUT5.js.map +7 -0
  97. package/dist/chunk-7YUYZ64D.js +6843 -0
  98. package/dist/chunk-7YUYZ64D.js.map +7 -0
  99. package/dist/chunk-HCAGFNXW.js +8270 -0
  100. package/dist/chunk-HCAGFNXW.js.map +7 -0
  101. package/dist/chunk-KYYP6ZVK.js +907 -0
  102. package/dist/chunk-KYYP6ZVK.js.map +7 -0
  103. package/dist/chunk-ULXGBUSC.js +65 -0
  104. package/dist/chunk-ULXGBUSC.js.map +7 -0
  105. package/dist/chunk-XRJXE6UO.js +243 -0
  106. package/dist/chunk-XRJXE6UO.js.map +7 -0
  107. package/dist/conference-IDNRO4WK.js +3812 -0
  108. package/dist/conference-IDNRO4WK.js.map +7 -0
  109. package/dist/conference-KN6OKGDU.css +11 -0
  110. package/dist/conference-KN6OKGDU.css.map +7 -0
  111. package/dist/fixtures/chats.d.ts +4 -0
  112. package/dist/fixtures/peers.d.ts +3 -0
  113. package/dist/fixtures/tracks.d.ts +2 -0
  114. package/dist/index.cjs.css +11 -0
  115. package/dist/index.cjs.css.map +7 -0
  116. package/dist/index.cjs.js +22987 -0
  117. package/dist/index.cjs.js.map +7 -0
  118. package/dist/index.css +11 -0
  119. package/dist/index.css.map +7 -0
  120. package/dist/index.d.ts +38 -0
  121. package/dist/index.js +133 -0
  122. package/dist/index.js.map +7 -0
  123. package/dist/meta.cjs.json +13085 -0
  124. package/dist/meta.esbuild.json +13693 -0
  125. package/dist/transcription-BTSB7FZH.js +356 -0
  126. package/dist/transcription-BTSB7FZH.js.map +7 -0
  127. package/dist/utils/animations.d.ts +92 -0
  128. package/dist/utils/index.d.ts +2 -0
  129. package/dist/utils/styles.d.ts +21 -0
  130. package/package.json +116 -0
  131. package/src/Accordion/Accordion.stories.tsx +50 -0
  132. package/src/Accordion/Accordion.tsx +88 -0
  133. package/src/Accordion/index.ts +8 -0
  134. package/src/AudioLevel/AudioLevel.tsx +34 -0
  135. package/src/AudioLevel/index.ts +1 -0
  136. package/src/Avatar/Avatar.stories.tsx +33 -0
  137. package/src/Avatar/Avatar.tsx +55 -0
  138. package/src/Avatar/getAvatarBg.ts +46 -0
  139. package/src/Avatar/index.ts +1 -0
  140. package/src/Button/Button.mdx +43 -0
  141. package/src/Button/Button.stories.tsx +52 -0
  142. package/src/Button/Button.tsx +144 -0
  143. package/src/Button/index.tsx +1 -0
  144. package/src/Chat/Chat.mdx +39 -0
  145. package/src/Chat/Chat.stories.tsx +39 -0
  146. package/src/Checkbox/Checkbox.stories.tsx +61 -0
  147. package/src/Checkbox/Checkbox.tsx +33 -0
  148. package/src/Checkbox/index.tsx +1 -0
  149. package/src/Collapsible/Collapsible.tsx +34 -0
  150. package/src/Collapsible/index.tsx +1 -0
  151. package/src/Divider/Divider.tsx +45 -0
  152. package/src/Divider/HorizontalDivider.stories.tsx +34 -0
  153. package/src/Divider/VerticalDivider.stories.tsx +40 -0
  154. package/src/Divider/index.ts +1 -0
  155. package/src/Dropdown/Dropdown.stories.tsx +94 -0
  156. package/src/Dropdown/Dropdown.tsx +142 -0
  157. package/src/Dropdown/index.tsx +1 -0
  158. package/src/Fieldset/Fieldset.stories.tsx +29 -0
  159. package/src/Fieldset/Fieldset.tsx +11 -0
  160. package/src/Fieldset/index.tsx +1 -0
  161. package/src/Footer/Footer.stories.tsx +61 -0
  162. package/src/Footer/Footer.tsx +47 -0
  163. package/src/Footer/index.tsx +1 -0
  164. package/src/IconButton/IconButton.tsx +45 -0
  165. package/src/IconButton/index.tsx +1 -0
  166. package/src/Icons/Icons.stories.mdx +10 -0
  167. package/src/Icons/IconsList.jsx +17 -0
  168. package/src/Input/Input.stories.tsx +25 -0
  169. package/src/Input/Input.tsx +105 -0
  170. package/src/Input/PasswordInput.stories.tsx +53 -0
  171. package/src/Input/index.tsx +1 -0
  172. package/src/Introduction/Integrating.stories.mdx +100 -0
  173. package/src/Introduction/Introduction.stories.mdx +9 -0
  174. package/src/Label/Label.tsx +8 -0
  175. package/src/Label/index.ts +1 -0
  176. package/src/Layout/Box.tsx +3 -0
  177. package/src/Layout/Flex.tsx +76 -0
  178. package/src/Layout/index.tsx +2 -0
  179. package/src/Link/Link.stories.tsx +18 -0
  180. package/src/Link/Link.tsx +54 -0
  181. package/src/Link/index.tsx +2 -0
  182. package/src/Loading/Loading.mdx +15 -0
  183. package/src/Loading/Loading.stories.tsx +37 -0
  184. package/src/Loading/Loading.tsx +33 -0
  185. package/src/Loading/index.ts +1 -0
  186. package/src/Modal/Dialog.mdx +19 -0
  187. package/src/Modal/Dialog.stories.tsx +68 -0
  188. package/src/Modal/Dialog.tsx +26 -0
  189. package/src/Modal/DialogContent.tsx +63 -0
  190. package/src/Modal/index.ts +1 -0
  191. package/src/Pagination/StyledPagination.stories.tsx +80 -0
  192. package/src/Pagination/StyledPagination.tsx +68 -0
  193. package/src/Pagination/index.tsx +1 -0
  194. package/src/Popover/Popover.mdx +9 -0
  195. package/src/Popover/Popover.stories.tsx +95 -0
  196. package/src/Popover/index.tsx +26 -0
  197. package/src/Prebuilt/App.jsx +273 -0
  198. package/src/Prebuilt/AppContext.jsx +21 -0
  199. package/src/Prebuilt/IconButton.jsx +19 -0
  200. package/src/Prebuilt/Prebuilt.stories.tsx +20 -0
  201. package/src/Prebuilt/common/PeersSorter.js +89 -0
  202. package/src/Prebuilt/common/constants.js +208 -0
  203. package/src/Prebuilt/common/hooks.js +47 -0
  204. package/src/Prebuilt/common/roles.js +4 -0
  205. package/src/Prebuilt/common/useSortedPeers.js +28 -0
  206. package/src/Prebuilt/common/utils.js +91 -0
  207. package/src/Prebuilt/components/AppData/AppData.jsx +189 -0
  208. package/src/Prebuilt/components/AppData/useAppConfig.js +7 -0
  209. package/src/Prebuilt/components/AppData/useAppLayout.js +6 -0
  210. package/src/Prebuilt/components/AppData/useChatState.js +18 -0
  211. package/src/Prebuilt/components/AppData/useSidepane.js +49 -0
  212. package/src/Prebuilt/components/AppData/useUISettings.js +164 -0
  213. package/src/Prebuilt/components/AudioLevel/BeamSpeakerLabelsLogging.jsx +16 -0
  214. package/src/Prebuilt/components/AudioVideoToggle.jsx +67 -0
  215. package/src/Prebuilt/components/AuthToken.jsx +133 -0
  216. package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +96 -0
  217. package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.stories.tsx +46 -0
  218. package/src/Prebuilt/components/Chat/Chat.jsx +155 -0
  219. package/src/Prebuilt/components/Chat/ChatBody.jsx +370 -0
  220. package/src/Prebuilt/components/Chat/ChatFooter.jsx +150 -0
  221. package/src/Prebuilt/components/Chat/ChatHeader.jsx +67 -0
  222. package/src/Prebuilt/components/Chat/ChatSelector.jsx +162 -0
  223. package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +30 -0
  224. package/src/Prebuilt/components/Chat/useUnreadCount.js +17 -0
  225. package/src/Prebuilt/components/Connection/ConnectionIndicator.jsx +80 -0
  226. package/src/Prebuilt/components/Connection/TileConnection.jsx +40 -0
  227. package/src/Prebuilt/components/Connection/connectionQualityUtils.js +39 -0
  228. package/src/Prebuilt/components/EmojiReaction.jsx +138 -0
  229. package/src/Prebuilt/components/ErrorBoundary.jsx +105 -0
  230. package/src/Prebuilt/components/FirstPersonDisplay.jsx +50 -0
  231. package/src/Prebuilt/components/Footer/ChatToggle.jsx +27 -0
  232. package/src/Prebuilt/components/Footer/ConferencingFooter.jsx +104 -0
  233. package/src/Prebuilt/components/Footer/StreamingFooter.jsx +71 -0
  234. package/src/Prebuilt/components/Footer.jsx +8 -0
  235. package/src/Prebuilt/components/FullPageProgress.jsx +11 -0
  236. package/src/Prebuilt/components/GoLiveButton.jsx +45 -0
  237. package/src/Prebuilt/components/HMSVideo/Controls.jsx +21 -0
  238. package/src/Prebuilt/components/HMSVideo/FullscreenButton.jsx +18 -0
  239. package/src/Prebuilt/components/HMSVideo/HLSAutoplayBlockedPrompt.jsx +35 -0
  240. package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +82 -0
  241. package/src/Prebuilt/components/HMSVideo/HMSVIdeoUtils.js +27 -0
  242. package/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +11 -0
  243. package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +13 -0
  244. package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +77 -0
  245. package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +31 -0
  246. package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +39 -0
  247. package/src/Prebuilt/components/HMSVideo/index.js +19 -0
  248. package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +217 -0
  249. package/src/Prebuilt/components/Header/AmbientMusic.jsx +88 -0
  250. package/src/Prebuilt/components/Header/ConferencingHeader.jsx +29 -0
  251. package/src/Prebuilt/components/Header/Header.jsx +8 -0
  252. package/src/Prebuilt/components/Header/HeaderComponents.jsx +41 -0
  253. package/src/Prebuilt/components/Header/ParticipantFilter.jsx +91 -0
  254. package/src/Prebuilt/components/Header/ParticipantList.jsx +337 -0
  255. package/src/Prebuilt/components/Header/StreamActions.jsx +225 -0
  256. package/src/Prebuilt/components/Header/StreamingHeader.jsx +55 -0
  257. package/src/Prebuilt/components/Header/index.jsx +1 -0
  258. package/src/Prebuilt/components/HlsStatsOverlay.jsx +101 -0
  259. package/src/Prebuilt/components/Image.jsx +7 -0
  260. package/src/Prebuilt/components/Input/KeyboardInputManager.js +107 -0
  261. package/src/Prebuilt/components/LeaveRoom.jsx +202 -0
  262. package/src/Prebuilt/components/MetaActions.jsx +45 -0
  263. package/src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx +139 -0
  264. package/src/Prebuilt/components/MoreSettings/ChangeNameModal.jsx +92 -0
  265. package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +67 -0
  266. package/src/Prebuilt/components/MoreSettings/EmbedUrl.jsx +106 -0
  267. package/src/Prebuilt/components/MoreSettings/FullScreenItem.jsx +29 -0
  268. package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +225 -0
  269. package/src/Prebuilt/components/MoreSettings/MuteAllModal.jsx +90 -0
  270. package/src/Prebuilt/components/Notifications/AutoplayBlockedModal.jsx +38 -0
  271. package/src/Prebuilt/components/Notifications/InitErrorModal.jsx +39 -0
  272. package/src/Prebuilt/components/Notifications/MessageNotifications.jsx +25 -0
  273. package/src/Prebuilt/components/Notifications/Notifications.jsx +151 -0
  274. package/src/Prebuilt/components/Notifications/PeerNotifications.jsx +45 -0
  275. package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +67 -0
  276. package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +69 -0
  277. package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.jsx +51 -0
  278. package/src/Prebuilt/components/Notifications/TrackNotifications.jsx +19 -0
  279. package/src/Prebuilt/components/Notifications/TrackUnmuteModal.jsx +49 -0
  280. package/src/Prebuilt/components/Notifications/index.jsx +1 -0
  281. package/src/Prebuilt/components/PIP/PIPComponent.jsx +82 -0
  282. package/src/Prebuilt/components/PIP/PIPManager.js +296 -0
  283. package/src/Prebuilt/components/PIP/SetupMediaSession.js +60 -0
  284. package/src/Prebuilt/components/PIP/index.jsx +11 -0
  285. package/src/Prebuilt/components/PIP/pip.test.js +72 -0
  286. package/src/Prebuilt/components/PIP/pipUtils.js +183 -0
  287. package/src/Prebuilt/components/Pagination.jsx +29 -0
  288. package/src/Prebuilt/components/Playlist/Playlist.jsx +129 -0
  289. package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +172 -0
  290. package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +51 -0
  291. package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +95 -0
  292. package/src/Prebuilt/components/PostLeave.jsx +76 -0
  293. package/src/Prebuilt/components/Preview/PreviewContainer.jsx +51 -0
  294. package/src/Prebuilt/components/Preview/PreviewJoin.jsx +196 -0
  295. package/src/Prebuilt/components/Preview/PreviewName.jsx +37 -0
  296. package/src/Prebuilt/components/RoleChangeModal.jsx +185 -0
  297. package/src/Prebuilt/components/RoleChangeRequestModal.jsx +26 -0
  298. package/src/Prebuilt/components/ScreenShare.jsx +45 -0
  299. package/src/Prebuilt/components/ScreenshareDisplay.jsx +45 -0
  300. package/src/Prebuilt/components/ScreenshareHintModal.jsx +37 -0
  301. package/src/Prebuilt/components/ScreenshareTile.jsx +91 -0
  302. package/src/Prebuilt/components/Settings/DeviceSettings.jsx +220 -0
  303. package/src/Prebuilt/components/Settings/LayoutSettings.jsx +91 -0
  304. package/src/Prebuilt/components/Settings/NotificationSettings.jsx +61 -0
  305. package/src/Prebuilt/components/Settings/SettingsModal.jsx +171 -0
  306. package/src/Prebuilt/components/Settings/StartRecording.jsx +130 -0
  307. package/src/Prebuilt/components/Settings/SwitchWithLabel.jsx +40 -0
  308. package/src/Prebuilt/components/Settings/common.js +15 -0
  309. package/src/Prebuilt/components/ShareMenuIcon.jsx +26 -0
  310. package/src/Prebuilt/components/StatsForNerds.jsx +250 -0
  311. package/src/Prebuilt/components/Streaming/Common.jsx +132 -0
  312. package/src/Prebuilt/components/Streaming/HLSStreaming.jsx +226 -0
  313. package/src/Prebuilt/components/Streaming/RTMPIcon.jsx +24 -0
  314. package/src/Prebuilt/components/Streaming/RTMPStreaming.jsx +336 -0
  315. package/src/Prebuilt/components/Streaming/ResolutionInput.jsx +88 -0
  316. package/src/Prebuilt/components/Streaming/StreamingLanding.jsx +76 -0
  317. package/src/Prebuilt/components/TileMenu.jsx +275 -0
  318. package/src/Prebuilt/components/Toast/Toast.jsx +17 -0
  319. package/src/Prebuilt/components/Toast/ToastBatcher.js +57 -0
  320. package/src/Prebuilt/components/Toast/ToastConfig.jsx +134 -0
  321. package/src/Prebuilt/components/Toast/ToastContainer.jsx +30 -0
  322. package/src/Prebuilt/components/Toast/ToastManager.js +44 -0
  323. package/src/Prebuilt/components/VideoList.jsx +101 -0
  324. package/src/Prebuilt/components/VideoTile.jsx +177 -0
  325. package/src/Prebuilt/components/conference.jsx +164 -0
  326. package/src/Prebuilt/components/gridView.jsx +85 -0
  327. package/src/Prebuilt/components/hooks/useDropdownList.jsx +23 -0
  328. package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +6 -0
  329. package/src/Prebuilt/components/hooks/useFeatures.js +22 -0
  330. package/src/Prebuilt/components/hooks/useFullscreen.js +43 -0
  331. package/src/Prebuilt/components/hooks/useMetadata.jsx +52 -0
  332. package/src/Prebuilt/components/hooks/useNavigation.js +19 -0
  333. package/src/Prebuilt/components/hooks/usePlaylist.js +25 -0
  334. package/src/Prebuilt/components/hooks/usePlaylistMusic.js +35 -0
  335. package/src/Prebuilt/components/hooks/useScreenshareAudio.js +28 -0
  336. package/src/Prebuilt/components/hooks/useSetPinnedMessage.js +38 -0
  337. package/src/Prebuilt/components/hooks/useSkipPreview.jsx +20 -0
  338. package/src/Prebuilt/components/hooks/useUserPreferences.jsx +25 -0
  339. package/src/Prebuilt/components/init/Init.jsx +58 -0
  340. package/src/Prebuilt/components/init/initUtils.js +90 -0
  341. package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +29 -0
  342. package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +108 -0
  343. package/src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx +31 -0
  344. package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +32 -0
  345. package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +233 -0
  346. package/src/Prebuilt/components/pdfAnnotator/submitPdf.jsx +89 -0
  347. package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +85 -0
  348. package/src/Prebuilt/components/peerTileUtils.jsx +27 -0
  349. package/src/Prebuilt/hms.js +7 -0
  350. package/src/Prebuilt/images/first_person.png +0 -0
  351. package/src/Prebuilt/index.d.ts +15 -0
  352. package/src/Prebuilt/index.js +2 -0
  353. package/src/Prebuilt/layouts/ActiveSpeakerView.jsx +34 -0
  354. package/src/Prebuilt/layouts/EmbedView.jsx +141 -0
  355. package/src/Prebuilt/layouts/HLSView.jsx +290 -0
  356. package/src/Prebuilt/layouts/InsetView.jsx +222 -0
  357. package/src/Prebuilt/layouts/NonPublisherView.jsx +51 -0
  358. package/src/Prebuilt/layouts/PDFView.jsx +122 -0
  359. package/src/Prebuilt/layouts/PinnedTrackView.jsx +59 -0
  360. package/src/Prebuilt/layouts/SidePane.jsx +51 -0
  361. package/src/Prebuilt/layouts/WaitingView.jsx +51 -0
  362. package/src/Prebuilt/layouts/WhiteboardView.jsx +66 -0
  363. package/src/Prebuilt/layouts/mainGridView.jsx +98 -0
  364. package/src/Prebuilt/layouts/mainView.jsx +113 -0
  365. package/src/Prebuilt/layouts/screenShareView.jsx +185 -0
  366. package/src/Prebuilt/plugins/FlyingEmoji.jsx +132 -0
  367. package/src/Prebuilt/plugins/RemoteStopScreenshare.jsx +18 -0
  368. package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +90 -0
  369. package/src/Prebuilt/plugins/VirtualBackground/vbutils.js +66 -0
  370. package/src/Prebuilt/plugins/confetti.jsx +60 -0
  371. package/src/Prebuilt/plugins/transcription/Transcriber.js +216 -0
  372. package/src/Prebuilt/plugins/transcription/TranscriptionButton.jsx +138 -0
  373. package/src/Prebuilt/plugins/transcription/index.jsx +1 -0
  374. package/src/Prebuilt/plugins/whiteboard/PusherCommunicationProvider.js +110 -0
  375. package/src/Prebuilt/plugins/whiteboard/README.md +29 -0
  376. package/src/Prebuilt/plugins/whiteboard/ToggleWhiteboard.jsx +43 -0
  377. package/src/Prebuilt/plugins/whiteboard/Whiteboard.css +12 -0
  378. package/src/Prebuilt/plugins/whiteboard/Whiteboard.jsx +11 -0
  379. package/src/Prebuilt/plugins/whiteboard/WhiteboardEvents.js +8 -0
  380. package/src/Prebuilt/plugins/whiteboard/index.js +3 -0
  381. package/src/Prebuilt/plugins/whiteboard/useMultiplayerState.js +212 -0
  382. package/src/Prebuilt/plugins/whiteboard/useWhiteboardMetadata.js +47 -0
  383. package/src/Prebuilt/primitives/DialogContent.jsx +280 -0
  384. package/src/Prebuilt/primitives/DropdownTrigger.jsx +46 -0
  385. package/src/Prebuilt/services/FeatureFlags.jsx +47 -0
  386. package/src/Prebuilt/services/tokenService.js +49 -0
  387. package/src/Progress/index.tsx +17 -0
  388. package/src/QRCode/QRCode.mdx +9 -0
  389. package/src/QRCode/QRCode.stories.tsx +29 -0
  390. package/src/QRCode/QRCode.tsx +6 -0
  391. package/src/QRCode/index.tsx +1 -0
  392. package/src/RadioGroup/RadioGroup.stories.tsx +32 -0
  393. package/src/RadioGroup/RadioGroup.tsx +33 -0
  394. package/src/RadioGroup/index.tsx +1 -0
  395. package/src/ReactSelect/ReactSelect.stories.tsx +83 -0
  396. package/src/ReactSelect/ReactSelect.tsx +97 -0
  397. package/src/ReactSelect/index.ts +1 -0
  398. package/src/Select/Select.stories.tsx +33 -0
  399. package/src/Select/Select.tsx +63 -0
  400. package/src/Select/index.ts +1 -0
  401. package/src/Slider/Slider.stories.tsx +21 -0
  402. package/src/Slider/Slider.tsx +70 -0
  403. package/src/Slider/index.ts +1 -0
  404. package/src/Stats/Stats.tsx +211 -0
  405. package/src/Stats/StyledStats.tsx +57 -0
  406. package/src/Stats/formatBytes.ts +19 -0
  407. package/src/Stats/index.tsx +1 -0
  408. package/src/Switch/Switch.mdx +11 -0
  409. package/src/Switch/Switch.stories.tsx +46 -0
  410. package/src/Switch/Switch.tsx +52 -0
  411. package/src/Switch/index.ts +1 -0
  412. package/src/Tabs/Tabs.stories.tsx +77 -0
  413. package/src/Tabs/Tabs.tsx +41 -0
  414. package/src/Tabs/index.tsx +1 -0
  415. package/src/Text/Text.stories.tsx +21 -0
  416. package/src/Text/Text.tsx +149 -0
  417. package/src/Text/index.tsx +1 -0
  418. package/src/Theme/Theme.stories.mdx +8 -0
  419. package/src/Theme/ThemeProvider.tsx +104 -0
  420. package/src/Theme/ThemeStory.jsx +58 -0
  421. package/src/Theme/base.config.ts +264 -0
  422. package/src/Theme/index.tsx +3 -0
  423. package/src/Theme/stitches.config.ts +100 -0
  424. package/src/Theme/themes.ts +70 -0
  425. package/src/Theme/useSSR.tsx +24 -0
  426. package/src/TileMenu/StyledMenuTile.tsx +101 -0
  427. package/src/TileMenu/TileMenu.tsx +96 -0
  428. package/src/TileMenu/index.tsx +1 -0
  429. package/src/Toast/AppToast.stories.tsx +56 -0
  430. package/src/Toast/Toast.mdx +19 -0
  431. package/src/Toast/Toast.stories.tsx +57 -0
  432. package/src/Toast/Toast.tsx +168 -0
  433. package/src/Toast/index.tsx +1 -0
  434. package/src/Tooltip/Tooltip.stories.tsx +62 -0
  435. package/src/Tooltip/Tooltip.tsx +79 -0
  436. package/src/Tooltip/index.ts +1 -0
  437. package/src/Video/UseVideo.mdx +22 -0
  438. package/src/Video/UseVideo.stories.tsx +26 -0
  439. package/src/Video/Video.mdx +24 -0
  440. package/src/Video/Video.stories.tsx +27 -0
  441. package/src/Video/Video.tsx +61 -0
  442. package/src/Video/index.tsx +1 -0
  443. package/src/VideoList/StyledVideoList.tsx +39 -0
  444. package/src/VideoList/VideoList.stories.tsx +92 -0
  445. package/src/VideoList/index.tsx +2 -0
  446. package/src/VideoList/videoListUtils.tsx +20 -0
  447. package/src/VideoTile/StyledVideoTile.tsx +148 -0
  448. package/src/VideoTile/VideoTile.mdx +28 -0
  449. package/src/VideoTile/VideoTile.stories.tsx +32 -0
  450. package/src/VideoTile/index.tsx +1 -0
  451. package/src/fixtures/chats.ts +25 -0
  452. package/src/fixtures/peers.ts +24 -0
  453. package/src/fixtures/tracks.ts +11 -0
  454. package/src/index.ts +38 -0
  455. package/src/store/SetupFakeStore.ts +33 -0
  456. package/src/store/StorybookSDK.ts +229 -0
  457. package/src/utils/animations.ts +90 -0
  458. package/src/utils/index.ts +2 -0
  459. package/src/utils/styles.ts +22 -0
@@ -0,0 +1,356 @@
1
+ import {
2
+ Box,
3
+ Text
4
+ } from "./chunk-XRJXE6UO.js";
5
+ import {
6
+ IconButton_default,
7
+ SESSION_STORE_KEY,
8
+ Tooltip,
9
+ __async,
10
+ __publicField,
11
+ __spreadProps,
12
+ __spreadValues,
13
+ define_process_env_default,
14
+ init_define_process_env
15
+ } from "./chunk-KYYP6ZVK.js";
16
+
17
+ // src/Prebuilt/plugins/transcription/index.jsx
18
+ init_define_process_env();
19
+
20
+ // src/Prebuilt/plugins/transcription/TranscriptionButton.jsx
21
+ init_define_process_env();
22
+ import React, { useCallback, useEffect, useRef } from "react";
23
+ import {
24
+ selectIsAllowedToPublish,
25
+ selectSessionStore,
26
+ useHMSActions,
27
+ useHMSStore,
28
+ useHMSVanillaStore
29
+ } from "@100mslive/react-sdk";
30
+ import { ClosedCaptionIcon } from "@100mslive/react-icons";
31
+
32
+ // src/Prebuilt/plugins/transcription/Transcriber.js
33
+ init_define_process_env();
34
+ import RecordRTC, { StereoAudioRecorder } from "recordrtc";
35
+ import { selectIsLocalAudioEnabled, selectLocalPeerName } from "@100mslive/react-sdk";
36
+ var Transcriber = class {
37
+ constructor({ hmsStore, setTranscriptAndSpeakingPeer, setIsTranscriptionEnabled }) {
38
+ /**
39
+ * This method is used to get the local peer's stream and observe it for changes.
40
+ * @returns {Promise<void>}
41
+ */
42
+ __publicField(this, "getAndObserveStream", () => __async(this, null, function* () {
43
+ const localPeer = window.__hms.sdk.getLocalPeer();
44
+ const mediaTrack = localPeer.audioTrack.nativeTrack;
45
+ if (!mediaTrack || mediaTrack.id === this.trackIdBeingObserved) {
46
+ return;
47
+ }
48
+ this.trackIdBeingObserved = mediaTrack.id;
49
+ console.log("transcription - observing local peer track", mediaTrack.id);
50
+ try {
51
+ if (this.recordRTCInstance) {
52
+ console.log("transcription - destroying earlier instance");
53
+ this.recordRTCInstance.destroy();
54
+ }
55
+ this.recordRTCInstance = null;
56
+ } catch (err) {
57
+ console.error("transcription - in destroying earlier instance", err);
58
+ }
59
+ const stream = new MediaStream([mediaTrack]);
60
+ yield this.observeStream(stream);
61
+ }));
62
+ this.hmsStore = hmsStore;
63
+ this.enabled = false;
64
+ this.audioSocket = null;
65
+ this.setTranscriptAndSpeakingPeer = setTranscriptAndSpeakingPeer;
66
+ this.setIsTranscriptionEnabled = setIsTranscriptionEnabled;
67
+ this.sttTuningConfig = {
68
+ timeSlice: 250,
69
+ desiredSampRate: 8e3,
70
+ numberOfAudioChannels: 1,
71
+ bufferSize: 256
72
+ };
73
+ this.resetTextTimer = null;
74
+ this.localPeerName = hmsStore.getState(selectLocalPeerName);
75
+ this.observingLocalPeerTrack = false;
76
+ this.trackIdBeingObserved = null;
77
+ this.recordRTCInstance = null;
78
+ this.unsubscribes = [];
79
+ }
80
+ toggleTranscriptionState() {
81
+ return __async(this, null, function* () {
82
+ yield this.enableTranscription(!this.enabled);
83
+ });
84
+ }
85
+ enableTranscription(enable) {
86
+ return __async(this, null, function* () {
87
+ if (enable === this.enabled) {
88
+ return;
89
+ }
90
+ console.log("transcription enabled", enable);
91
+ if (enable) {
92
+ this.enabled = true;
93
+ yield this.setIsTranscriptionEnabled(true);
94
+ yield this.listen();
95
+ } else {
96
+ this.enabled = false;
97
+ yield this.setIsTranscriptionEnabled(false);
98
+ this.cleanup();
99
+ }
100
+ });
101
+ }
102
+ setTranscriptAndPeerWithExpiry(transcript, peerName) {
103
+ if (!transcript) {
104
+ return;
105
+ }
106
+ this.setTranscriptAndSpeakingPeer(transcript, `[${peerName}]`);
107
+ clearTimeout(this.resetTextTimer);
108
+ this.resetTextTimer = setTimeout(() => {
109
+ this.resetTranscriptAndPeer();
110
+ }, 5e3);
111
+ }
112
+ resetTranscriptAndPeer() {
113
+ this.setTranscriptAndSpeakingPeer("", "");
114
+ clearTimeout(this.resetTextTimer);
115
+ }
116
+ listen(retryCount = 0) {
117
+ return __async(this, null, function* () {
118
+ if (retryCount > 5) {
119
+ console.error("transcription", "Max retry count reached!!", retryCount);
120
+ this.cleanup();
121
+ return;
122
+ }
123
+ try {
124
+ let url = define_process_env_default.REACT_APP_DYNAMIC_STT_TOKEN_GENERATION_ENDPOINT;
125
+ let res = yield fetch(url);
126
+ let body = yield res.json();
127
+ const authToken = body.token;
128
+ if (authToken) {
129
+ this.audioSocket = yield new WebSocket(
130
+ `wss://api.assemblyai.com/v2/realtime/ws?sample_rate=${this.sttTuningConfig.desiredSampRate}&token=${authToken}`
131
+ );
132
+ this.resetTranscriptAndPeer();
133
+ this.audioSocket.onmessage = (message) => {
134
+ try {
135
+ const res2 = JSON.parse(message.data);
136
+ if (res2.text && this.enabled) {
137
+ let messageText = res2.text.length >= 80 ? res2.text.split(" ").slice(Math.max(res2.text.split(" ").length - 10, 1)).join(" ") : res2.text;
138
+ if (messageText) {
139
+ this.setTranscriptAndPeerWithExpiry(messageText, this.localPeerName);
140
+ }
141
+ }
142
+ } catch (err) {
143
+ console.error("transcription", err);
144
+ }
145
+ };
146
+ this.audioSocket.onerror = (event) => {
147
+ console.error("transcription", event);
148
+ this.audioSocket.close();
149
+ };
150
+ this.audioSocket.onclose = (event) => {
151
+ try {
152
+ console.log(event);
153
+ this.audioSocket = null;
154
+ if (this.enabled && event.code !== 4001) {
155
+ this.listen(retryCount++);
156
+ }
157
+ } catch (err) {
158
+ console.error("transcription", err);
159
+ }
160
+ };
161
+ this.audioSocket.onopen = () => {
162
+ this.observeLocalPeerTrack();
163
+ };
164
+ } else {
165
+ console.error("Unable to fetch dynamic token!!");
166
+ }
167
+ } catch (err) {
168
+ console.error("transcription", err);
169
+ }
170
+ });
171
+ }
172
+ observeLocalPeerTrack() {
173
+ return __async(this, null, function* () {
174
+ try {
175
+ if (this.observingLocalPeerTrack) {
176
+ return;
177
+ }
178
+ this.observingLocalPeerTrack = true;
179
+ console.log("transcription - observing local peer track");
180
+ let unsub = this.hmsStore.subscribe(this.getAndObserveStream, selectIsLocalAudioEnabled);
181
+ this.unsubscribes.push(unsub);
182
+ this.getAndObserveStream();
183
+ } catch (err) {
184
+ console.error("transcription - observing local peer track", err);
185
+ }
186
+ });
187
+ }
188
+ observeStream(stream) {
189
+ return __async(this, null, function* () {
190
+ this.recordRTCInstance = new RecordRTC(stream, __spreadProps(__spreadValues({}, this.sttTuningConfig), {
191
+ type: "audio",
192
+ mimeType: "audio/webm;codecs=pcm",
193
+ recorderType: StereoAudioRecorder,
194
+ ondataavailable: (blob) => {
195
+ const reader = new FileReader();
196
+ reader.onload = () => {
197
+ const base64data = reader.result;
198
+ if (this.audioSocket && this.enabled && this.audioSocket.readyState && this.audioSocket.readyState === 1) {
199
+ try {
200
+ this.audioSocket.send(JSON.stringify({ audio_data: base64data.split("base64,")[1] }));
201
+ } catch (err) {
202
+ console.error("transcription", err);
203
+ }
204
+ }
205
+ };
206
+ reader.readAsDataURL(blob);
207
+ }
208
+ }));
209
+ this.recordRTCInstance.startRecording();
210
+ });
211
+ }
212
+ cleanup() {
213
+ console.log("transcription - cleanup");
214
+ if (this.audioSocket) {
215
+ try {
216
+ this.audioSocket.close();
217
+ this.audioSocket = null;
218
+ } catch (err) {
219
+ console.error("transcription cleanup - couldn't close socket", err);
220
+ }
221
+ }
222
+ if (this.recordRTCInstance) {
223
+ try {
224
+ this.recordRTCInstance.destroy();
225
+ this.recordRTCInstance = null;
226
+ } catch (err) {
227
+ console.error("transcription cleanup - couldn't stop recording", err);
228
+ }
229
+ }
230
+ for (const unsub of this.unsubscribes) {
231
+ unsub();
232
+ }
233
+ this.resetTranscriptAndPeer();
234
+ }
235
+ };
236
+
237
+ // src/Prebuilt/plugins/transcription/TranscriptionButton.jsx
238
+ function TranscriptionButton() {
239
+ const transcriptionState = useHMSStore(selectSessionStore(SESSION_STORE_KEY.TRANSCRIPTION_STATE));
240
+ const rawStore = useHMSVanillaStore();
241
+ const isTranscriptionEnabled = !!(transcriptionState == null ? void 0 : transcriptionState.enabled);
242
+ let transcript = "", speakingPeer = "";
243
+ if (isTranscriptionEnabled) {
244
+ transcript = transcriptionState.transcript || "";
245
+ speakingPeer = transcriptionState.speakingPeer || "";
246
+ }
247
+ const transcriber = useRef(null);
248
+ const hmsActions = useHMSActions();
249
+ const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
250
+ useEffect(() => {
251
+ hmsActions.sessionStore.observe(SESSION_STORE_KEY.TRANSCRIPTION_STATE);
252
+ }, [hmsActions]);
253
+ useEffect(() => {
254
+ if (!transcriber.current) {
255
+ transcriber.current = new Transcriber({
256
+ hmsStore: rawStore,
257
+ setTranscriptAndSpeakingPeer: (transcript2, peerName) => __async(this, null, function* () {
258
+ var _a;
259
+ const transcriptionCurrentEnabledState = !!((_a = rawStore.getState(
260
+ selectSessionStore(SESSION_STORE_KEY.TRANSCRIPTION_STATE)
261
+ )) == null ? void 0 : _a.enabled);
262
+ yield hmsActions.sessionStore.set(SESSION_STORE_KEY.TRANSCRIPTION_STATE, {
263
+ enabled: transcriptionCurrentEnabledState,
264
+ transcript: transcript2,
265
+ speakingPeer: peerName
266
+ });
267
+ }),
268
+ setIsTranscriptionEnabled: (newEnabledState) => __async(this, null, function* () {
269
+ yield hmsActions.sessionStore.set(SESSION_STORE_KEY.TRANSCRIPTION_STATE, {
270
+ enabled: newEnabledState
271
+ });
272
+ })
273
+ });
274
+ }
275
+ return () => {
276
+ if (transcriber.current) {
277
+ transcriber.current.cleanup();
278
+ }
279
+ };
280
+ }, [hmsActions, rawStore]);
281
+ useEffect(() => {
282
+ if (isTranscriptionEnabled) {
283
+ transcriber.current.enableTranscription(true);
284
+ }
285
+ }, [isTranscriptionEnabled]);
286
+ const toggleTranscriptionState = useCallback(() => {
287
+ transcriber.current.toggleTranscriptionState();
288
+ }, []);
289
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
290
+ Box,
291
+ {
292
+ css: {
293
+ textAlign: "left",
294
+ fontWeight: "$medium",
295
+ bottom: "120px",
296
+ position: "fixed",
297
+ width: "100%",
298
+ fontSize: "$20px",
299
+ zIndex: "1000000",
300
+ color: "white",
301
+ textShadow: "0px 0px 6px #000",
302
+ whiteSpace: "pre-line",
303
+ paddingLeft: "40px"
304
+ }
305
+ }
306
+ ), /* @__PURE__ */ React.createElement(
307
+ Box,
308
+ {
309
+ css: {
310
+ textAlign: "center",
311
+ fontWeight: "$medium",
312
+ bottom: "90px",
313
+ position: "fixed",
314
+ width: "100%",
315
+ fontSize: "$20px",
316
+ zIndex: "1000000",
317
+ color: "white",
318
+ textShadow: "0px 0px 6px #000",
319
+ whiteSpace: "pre-line"
320
+ }
321
+ },
322
+ /* @__PURE__ */ React.createElement(
323
+ Text,
324
+ {
325
+ css: {
326
+ color: "white",
327
+ textShadow: "0px 0px 6px #000"
328
+ }
329
+ },
330
+ transcript
331
+ ),
332
+ /* @__PURE__ */ React.createElement(
333
+ Text,
334
+ {
335
+ css: {
336
+ color: "#c0bbbb",
337
+ textShadow: "0px 0px 6px #000",
338
+ textTransform: "capitalize"
339
+ }
340
+ },
341
+ speakingPeer
342
+ )
343
+ ), isAllowedToPublish.audio && /* @__PURE__ */ React.createElement(Tooltip, { title: `Turn ${!isTranscriptionEnabled ? "on" : "off"} transcription` }, /* @__PURE__ */ React.createElement(
344
+ IconButton_default,
345
+ {
346
+ active: !isTranscriptionEnabled,
347
+ onClick: toggleTranscriptionState,
348
+ "data-testid": "transcription_btn"
349
+ },
350
+ /* @__PURE__ */ React.createElement(ClosedCaptionIcon, null)
351
+ )));
352
+ }
353
+ export {
354
+ TranscriptionButton as default
355
+ };
356
+ //# sourceMappingURL=transcription-BTSB7FZH.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Prebuilt/plugins/transcription/index.jsx", "../src/Prebuilt/plugins/transcription/TranscriptionButton.jsx", "../src/Prebuilt/plugins/transcription/Transcriber.js"],
4
+ "sourcesContent": ["export { TranscriptionButton as default } from './TranscriptionButton';\n", "import React, { useCallback, useEffect, useRef } from 'react';\nimport {\n selectIsAllowedToPublish,\n selectSessionStore,\n useHMSActions,\n useHMSStore,\n useHMSVanillaStore,\n} from '@100mslive/react-sdk';\nimport { ClosedCaptionIcon } from '@100mslive/react-icons';\nimport { Box } from '../../../Layout';\nimport { Text } from '../../../Text';\nimport { Tooltip } from '../../../Tooltip';\nimport IconButton from '../../IconButton';\nimport { Transcriber } from './Transcriber';\nimport { SESSION_STORE_KEY } from '../../common/constants';\n\nexport function TranscriptionButton() {\n const transcriptionState = useHMSStore(selectSessionStore(SESSION_STORE_KEY.TRANSCRIPTION_STATE));\n const rawStore = useHMSVanillaStore();\n const isTranscriptionEnabled = !!transcriptionState?.enabled;\n let transcript = '',\n speakingPeer = '';\n if (isTranscriptionEnabled) {\n transcript = transcriptionState.transcript || '';\n speakingPeer = transcriptionState.speakingPeer || '';\n }\n\n const transcriber = useRef(null);\n const hmsActions = useHMSActions();\n const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);\n\n useEffect(() => {\n hmsActions.sessionStore.observe(SESSION_STORE_KEY.TRANSCRIPTION_STATE);\n }, [hmsActions]);\n\n useEffect(() => {\n if (!transcriber.current) {\n // create transcriber with the current room state for transcription\n transcriber.current = new Transcriber({\n hmsStore: rawStore,\n setTranscriptAndSpeakingPeer: async (transcript, peerName) => {\n const transcriptionCurrentEnabledState = !!rawStore.getState(\n selectSessionStore(SESSION_STORE_KEY.TRANSCRIPTION_STATE),\n )?.enabled;\n await hmsActions.sessionStore.set(SESSION_STORE_KEY.TRANSCRIPTION_STATE, {\n enabled: transcriptionCurrentEnabledState,\n transcript,\n speakingPeer: peerName,\n });\n },\n setIsTranscriptionEnabled: async newEnabledState => {\n await hmsActions.sessionStore.set(SESSION_STORE_KEY.TRANSCRIPTION_STATE, {\n enabled: newEnabledState,\n });\n },\n });\n }\n return () => {\n if (transcriber.current) {\n transcriber.current.cleanup();\n }\n };\n }, [hmsActions, rawStore]);\n\n useEffect(() => {\n // remote enabled transcript\n if (isTranscriptionEnabled) {\n transcriber.current.enableTranscription(true);\n }\n }, [isTranscriptionEnabled]);\n\n const toggleTranscriptionState = useCallback(() => {\n transcriber.current.toggleTranscriptionState();\n }, []);\n\n return (\n <>\n <Box\n css={{\n textAlign: 'left',\n fontWeight: '$medium',\n bottom: '120px',\n position: 'fixed',\n width: '100%',\n fontSize: '$20px',\n zIndex: '1000000',\n color: 'white',\n textShadow: '0px 0px 6px #000',\n whiteSpace: 'pre-line',\n paddingLeft: '40px',\n }}\n />\n <Box\n css={{\n textAlign: 'center',\n fontWeight: '$medium',\n bottom: '90px',\n position: 'fixed',\n width: '100%',\n fontSize: '$20px',\n zIndex: '1000000',\n color: 'white',\n textShadow: '0px 0px 6px #000',\n whiteSpace: 'pre-line',\n }}\n >\n <Text\n css={{\n color: 'white',\n textShadow: '0px 0px 6px #000',\n }}\n >\n {transcript}\n </Text>\n <Text\n css={{\n color: '#c0bbbb',\n textShadow: '0px 0px 6px #000',\n textTransform: 'capitalize',\n }}\n >\n {speakingPeer}\n </Text>\n </Box>\n {isAllowedToPublish.audio && (\n <Tooltip title={`Turn ${!isTranscriptionEnabled ? 'on' : 'off'} transcription`}>\n <IconButton\n active={!isTranscriptionEnabled}\n onClick={toggleTranscriptionState}\n data-testid=\"transcription_btn\"\n >\n <ClosedCaptionIcon />\n </IconButton>\n </Tooltip>\n )}\n </>\n );\n}\n", "import RecordRTC, { StereoAudioRecorder } from 'recordrtc';\nimport { selectIsLocalAudioEnabled, selectLocalPeerName } from '@100mslive/react-sdk';\n\nexport class Transcriber {\n constructor({ hmsStore, setTranscriptAndSpeakingPeer, setIsTranscriptionEnabled }) {\n this.hmsStore = hmsStore;\n this.enabled = false;\n this.audioSocket = null; // this is the socket that will be used to send audio to the STT server\n this.setTranscriptAndSpeakingPeer = setTranscriptAndSpeakingPeer;\n this.setIsTranscriptionEnabled = setIsTranscriptionEnabled;\n this.sttTuningConfig = {\n timeSlice: 250,\n desiredSampRate: 8000,\n numberOfAudioChannels: 1,\n bufferSize: 256,\n };\n this.resetTextTimer = null; // used to reset the transcript after some time, if no new update comes\n this.localPeerName = hmsStore.getState(selectLocalPeerName);\n this.observingLocalPeerTrack = false;\n this.trackIdBeingObserved = null;\n this.recordRTCInstance = null;\n this.unsubscribes = [];\n }\n\n async toggleTranscriptionState() {\n await this.enableTranscription(!this.enabled);\n }\n\n async enableTranscription(enable) {\n if (enable === this.enabled) {\n return;\n }\n console.log('transcription enabled', enable);\n if (enable) {\n this.enabled = true;\n await this.setIsTranscriptionEnabled(true);\n await this.listen();\n } else {\n this.enabled = false;\n await this.setIsTranscriptionEnabled(false);\n this.cleanup();\n }\n }\n\n setTranscriptAndPeerWithExpiry(transcript, peerName) {\n if (!transcript) {\n return;\n }\n this.setTranscriptAndSpeakingPeer(transcript, `[${peerName}]`);\n // reset after some time if no new update comes\n clearTimeout(this.resetTextTimer);\n this.resetTextTimer = setTimeout(() => {\n this.resetTranscriptAndPeer();\n }, 5000);\n }\n\n resetTranscriptAndPeer() {\n this.setTranscriptAndSpeakingPeer('', '');\n clearTimeout(this.resetTextTimer);\n }\n\n async listen(retryCount = 0) {\n if (retryCount > 5) {\n console.error('transcription', 'Max retry count reached!!', retryCount);\n this.cleanup();\n return;\n }\n try {\n let url = process.env.REACT_APP_DYNAMIC_STT_TOKEN_GENERATION_ENDPOINT;\n let res = await fetch(url);\n let body = await res.json();\n const authToken = body.token;\n\n if (authToken) {\n this.audioSocket = await new WebSocket(\n `wss://api.assemblyai.com/v2/realtime/ws?sample_rate=${this.sttTuningConfig.desiredSampRate}&token=${authToken}`,\n );\n this.resetTranscriptAndPeer();\n this.audioSocket.onmessage = message => {\n try {\n const res = JSON.parse(message.data);\n if (res.text && this.enabled) {\n //Limiting the transcript size based on it's charecter length.\n let messageText =\n res.text.length >= 80\n ? res.text\n .split(' ')\n .slice(Math.max(res.text.split(' ').length - 10, 1))\n .join(' ')\n : res.text;\n if (messageText) {\n this.setTranscriptAndPeerWithExpiry(messageText, this.localPeerName);\n }\n }\n } catch (err) {\n console.error('transcription', err);\n }\n };\n\n this.audioSocket.onerror = event => {\n console.error('transcription', event);\n this.audioSocket.close();\n };\n\n this.audioSocket.onclose = event => {\n try {\n console.log(event);\n this.audioSocket = null;\n if (this.enabled && event.code !== 4001) {\n this.listen(retryCount++);\n }\n } catch (err) {\n console.error('transcription', err);\n }\n };\n\n this.audioSocket.onopen = () => {\n this.observeLocalPeerTrack();\n };\n } else {\n console.error('Unable to fetch dynamic token!!');\n }\n } catch (err) {\n console.error('transcription', err);\n }\n }\n\n async observeLocalPeerTrack() {\n try {\n if (this.observingLocalPeerTrack) {\n return;\n }\n this.observingLocalPeerTrack = true;\n console.log('transcription - observing local peer track');\n let unsub = this.hmsStore.subscribe(this.getAndObserveStream, selectIsLocalAudioEnabled);\n this.unsubscribes.push(unsub);\n this.getAndObserveStream(); // call it once to start observing initially\n } catch (err) {\n console.error('transcription - observing local peer track', err);\n }\n }\n\n /**\n * This method is used to get the local peer's stream and observe it for changes.\n * @returns {Promise<void>}\n */\n getAndObserveStream = async () => {\n // a hacky way to get the local peer's stream till we have a better way\n const localPeer = window.__hms.sdk.getLocalPeer();\n const mediaTrack = localPeer.audioTrack.nativeTrack;\n if (!mediaTrack || mediaTrack.id === this.trackIdBeingObserved) {\n return;\n }\n this.trackIdBeingObserved = mediaTrack.id;\n console.log('transcription - observing local peer track', mediaTrack.id);\n try {\n if (this.recordRTCInstance) {\n console.log('transcription - destroying earlier instance');\n this.recordRTCInstance.destroy();\n }\n this.recordRTCInstance = null;\n } catch (err) {\n console.error('transcription - in destroying earlier instance', err);\n }\n const stream = new MediaStream([mediaTrack]);\n await this.observeStream(stream);\n };\n\n async observeStream(stream) {\n this.recordRTCInstance = new RecordRTC(stream, {\n ...this.sttTuningConfig,\n type: 'audio',\n mimeType: 'audio/webm;codecs=pcm',\n recorderType: StereoAudioRecorder,\n ondataavailable: blob => {\n const reader = new FileReader();\n reader.onload = () => {\n const base64data = reader.result;\n if (this.audioSocket && this.enabled && this.audioSocket.readyState && this.audioSocket.readyState === 1) {\n try {\n this.audioSocket.send(JSON.stringify({ audio_data: base64data.split('base64,')[1] }));\n } catch (err) {\n console.error('transcription', err);\n }\n }\n };\n reader.readAsDataURL(blob);\n },\n });\n this.recordRTCInstance.startRecording();\n }\n\n cleanup() {\n console.log('transcription - cleanup');\n if (this.audioSocket) {\n try {\n this.audioSocket.close();\n this.audioSocket = null;\n } catch (err) {\n console.error(\"transcription cleanup - couldn't close socket\", err);\n }\n }\n if (this.recordRTCInstance) {\n try {\n this.recordRTCInstance.destroy();\n this.recordRTCInstance = null;\n } catch (err) {\n console.error(\"transcription cleanup - couldn't stop recording\", err);\n }\n }\n for (const unsub of this.unsubscribes) {\n unsub();\n }\n this.resetTranscriptAndPeer();\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;;;ACAA;AAAA,OAAO,SAAS,aAAa,WAAW,cAAc;AACtD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;;;ACRlC;AAAA,OAAO,aAAa,2BAA2B;AAC/C,SAAS,2BAA2B,2BAA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,QACZ,aAAa;AAAA,MACf;AAAA;AAAA,EACF,GACA;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,QACH,WAAW;AAAA,QACX,YAAY;AAAA,QACZ,QAAQ;AAAA,QACR,UAAU;AAAA,QACV,OAAO;AAAA,QACP,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA;AAAA,IAEA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,UACH,OAAO;AAAA,UACP,YAAY;AAAA,QACd;AAAA;AAAA,MAEC;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,KAAK;AAAA,UACH,OAAO;AAAA,UACP,YAAY;AAAA,UACZ,eAAe;AAAA,QACjB;AAAA;AAAA,MAEC;AAAA,IACH;AAAA,EACF,GACC,mBAAmB,SAClB,oCAAC,WAAQ,OAAO,QAAQ,CAAC,yBAAyB,OAAO,KAAK,oBAC5D;AAAA,IAAC;AAAA;AAAA,MACC,QAAQ,CAAC;AAAA,MACT,SAAS;AAAA,MACT,eAAY;AAAA;AAAA,IAEZ,oCAAC,uBAAkB;AAAA,EACrB,CACF,CAEJ;AAEJ;",
6
+ "names": ["res", "transcript"]
7
+ }
@@ -0,0 +1,92 @@
1
+ export declare const slideDown: (controller: string) => {
2
+ (): string;
3
+ name: string;
4
+ };
5
+ export declare const slideUp: (controller: string) => {
6
+ (): string;
7
+ name: string;
8
+ };
9
+ export declare const dialogOpen: {
10
+ (): string;
11
+ name: string;
12
+ };
13
+ export declare const dialogClose: {
14
+ (): string;
15
+ name: string;
16
+ };
17
+ export declare const slideUpAndFade: (start?: string) => {
18
+ (): string;
19
+ name: string;
20
+ };
21
+ export declare const slideRightAndFade: (start?: string) => {
22
+ (): string;
23
+ name: string;
24
+ };
25
+ export declare const slideDownAndFade: (start?: string) => {
26
+ (): string;
27
+ name: string;
28
+ };
29
+ export declare const slideLeftAndFade: (start?: string) => {
30
+ (): string;
31
+ name: string;
32
+ };
33
+ export declare const popoverAnimation: {
34
+ '@media (prefers-reduced-motion: no-preference)': {
35
+ animationDuration: string;
36
+ animationTimingFunction: string;
37
+ willChange: string;
38
+ '&[data-state="open"]': {
39
+ '&[data-side="top"]': {
40
+ animationName: {
41
+ (): string;
42
+ name: string;
43
+ };
44
+ };
45
+ '&[data-side="right"]': {
46
+ animationName: {
47
+ (): string;
48
+ name: string;
49
+ };
50
+ };
51
+ '&[data-side="bottom"]': {
52
+ animationName: {
53
+ (): string;
54
+ name: string;
55
+ };
56
+ };
57
+ '&[data-side="left"]': {
58
+ animationName: {
59
+ (): string;
60
+ name: string;
61
+ };
62
+ };
63
+ };
64
+ };
65
+ };
66
+ export declare const toastAnimation: {
67
+ '@media (prefers-reduced-motion: no-preference)': {
68
+ animationDuration: string;
69
+ animationTimingFunction: string;
70
+ willChange: string;
71
+ animationName: {
72
+ (): string;
73
+ name: string;
74
+ };
75
+ '&[data-state="open"]': {
76
+ animationName: {
77
+ (): string;
78
+ name: string;
79
+ };
80
+ };
81
+ '&[data-swipe="move"]': {
82
+ transform: string;
83
+ };
84
+ '&[data-swipe="cancel"]': {
85
+ transform: string;
86
+ transition: string;
87
+ };
88
+ '&[data-swipe="end"]': {
89
+ animation: string;
90
+ };
91
+ };
92
+ };
@@ -0,0 +1,2 @@
1
+ export * from './animations';
2
+ export * from './styles';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Flex based centering helper styles
3
+ */
4
+ export declare const flexCenter: {
5
+ display: string;
6
+ justifyContent: string;
7
+ alignItems: string;
8
+ };
9
+ /**
10
+ * Gives styles for text ellipsis, with given width as maxWidth.
11
+ * A number in pixels or css width string value can be passed
12
+ * @param {number|string} width
13
+ * @returns
14
+ */
15
+ export declare const textEllipsis: (width: number | string) => {
16
+ maxWidth: string | number;
17
+ overflow: string;
18
+ textOverflow: string;
19
+ whiteSpace: string;
20
+ minWidth: number;
21
+ };
package/package.json ADDED
@@ -0,0 +1,116 @@
1
+ {
2
+ "name": "@100mslive/roomkit-react",
3
+ "source": "src/index.ts",
4
+ "main": "dist/index.cjs.js",
5
+ "module": "dist/index.js",
6
+ "typings": "dist/index.d.ts",
7
+ "version": "0.1.0",
8
+ "author": "100ms",
9
+ "license": "MIT",
10
+ "files": [
11
+ "dist",
12
+ "src"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "require": "./dist/index.cjs.js",
17
+ "import": "./dist/index.js",
18
+ "default": "./dist/index.js"
19
+ }
20
+ },
21
+ "sideEffects": false,
22
+ "scripts": {
23
+ "prestart": "rm -rf dist && yarn types:build",
24
+ "start": "concurrently \"yarn dev\" \"yarn types\"",
25
+ "dev": "node ../../scripts/dev",
26
+ "build:only": "rm -rf dist && node ../../scripts/build-webapp",
27
+ "build": "yarn build:only && yarn types:build",
28
+ "types": "tsc -w",
29
+ "types:build": "tsc -p tsconfig.json",
30
+ "lint": "eslint -c .eslintrc --no-error-on-unmatched-pattern src --ext .js --ext .jsx --ext .ts --ext .tsx",
31
+ "lint:fix": "yarn lint --fix",
32
+ "format": "prettier -w src/**",
33
+ "storybook": "sb dev -p 6006",
34
+ "build-storybook": "sb build",
35
+ "babel": "npx storybook@latest babelrc"
36
+ },
37
+ "devDependencies": {
38
+ "@babel/core": "^7.18.2",
39
+ "@babel/preset-env": "^7.22.5",
40
+ "@babel/preset-react": "^7.22.5",
41
+ "@babel/preset-typescript": "^7.22.5",
42
+ "@rollup/plugin-commonjs": "^21.0.3",
43
+ "@rollup/plugin-image": "^3.0.2",
44
+ "@rollup/plugin-json": "^6.0.0",
45
+ "@rollup/plugin-node-resolve": "^13.1.3",
46
+ "@rollup/plugin-typescript": "^8.3.1",
47
+ "@storybook/addon-a11y": "^7.0.27",
48
+ "@storybook/addon-actions": "^7.0.27",
49
+ "@storybook/addon-essentials": "^7.0.27",
50
+ "@storybook/addon-interactions": "^7.0.27",
51
+ "@storybook/addon-links": "^7.0.27",
52
+ "@storybook/cli": "^7.0.27",
53
+ "@storybook/react": "^7.0.27",
54
+ "@storybook/react-webpack5": "^7.0.27",
55
+ "@storybook/testing-library": "^0.2.0",
56
+ "@types/lodash.merge": "^4.6.6",
57
+ "@types/mdx": "2.0.2",
58
+ "@types/react": "^18.1.0",
59
+ "babel-loader": "^8.2.5",
60
+ "babel-plugin-react-require": "3.1.3",
61
+ "react": "^18.1.0",
62
+ "rollup": "^2.70.1",
63
+ "rollup-plugin-esbuild": "^5.0.0",
64
+ "rollup-plugin-import-css": "^3.3.1",
65
+ "rollup-plugin-terser": "^7.0.2",
66
+ "storybook-dark-mode": "^3.0.0"
67
+ },
68
+ "peerDependencies": {
69
+ "react": ">=17.0.2 <19.0.0"
70
+ },
71
+ "dependencies": {
72
+ "@100mslive/hls-player": "0.1.10",
73
+ "@100mslive/hms-virtual-background": "1.11.10",
74
+ "@100mslive/react-icons": "0.8.10",
75
+ "@100mslive/react-sdk": "0.8.10",
76
+ "@emoji-mart/data": "^1.0.6",
77
+ "@emoji-mart/react": "^1.0.1",
78
+ "@radix-ui/react-accordion": "1.0.0",
79
+ "@radix-ui/react-checkbox": "1.0.0",
80
+ "@radix-ui/react-collapsible": "1.0.0",
81
+ "@radix-ui/react-dialog": "1.0.0",
82
+ "@radix-ui/react-dropdown-menu": "1.0.0",
83
+ "@radix-ui/react-label": "1.0.0",
84
+ "@radix-ui/react-popover": "1.0.0",
85
+ "@radix-ui/react-progress": "1.0.0",
86
+ "@radix-ui/react-radio-group": "1.0.0",
87
+ "@radix-ui/react-select": "1.0.0",
88
+ "@radix-ui/react-slider": "1.0.0",
89
+ "@radix-ui/react-switch": "1.0.0",
90
+ "@radix-ui/react-tabs": "1.0.0",
91
+ "@radix-ui/react-toast": "1.0.0",
92
+ "@radix-ui/react-tooltip": "1.0.0",
93
+ "@stitches/react": "^1.2.8",
94
+ "@tldraw/tldraw": "^1.18.4",
95
+ "emoji-mart": "^5.2.2",
96
+ "eventemitter2": "^6.4.7",
97
+ "hls.js": "^1.3.0",
98
+ "js-confetti": "^0.10.2",
99
+ "lodash.merge": "^4.6.2",
100
+ "mobx": "^6.3.12",
101
+ "pusher-js": "^7.0.3",
102
+ "qrcode.react": "^3.1.0",
103
+ "react-draggable": "^4.4.5",
104
+ "react-intersection-observer": "^9.4.3",
105
+ "react-router-dom": "^6.3.0",
106
+ "react-use": "^17.4.0",
107
+ "react-virtualized-auto-sizer": "^1.0.7",
108
+ "react-window": "^1.8.7",
109
+ "recordrtc": "^5.6.2",
110
+ "screenfull": "^5.1.0",
111
+ "uuid": "^8.3.2",
112
+ "web-vitals": "^1.0.1",
113
+ "worker-timers": "^7.0.40",
114
+ "zipyai": "^1.3.24"
115
+ }
116
+ }
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
3
+ import { Accordion } from '.';
4
+
5
+ export default {
6
+ title: 'UI Components/Accordion',
7
+ component: Accordion.Root,
8
+ } as ComponentMeta<typeof Accordion.Root>;
9
+
10
+ function AccordionItem({ value, header, content }: { value: string; header: string; content: string }) {
11
+ return (
12
+ <Accordion.Item value={value}>
13
+ <Accordion.Header css={{ padding: '$8 $9' }}>{header}</Accordion.Header>
14
+ <Accordion.Content contentStyles={{ padding: '$8 $9' }}>
15
+ <>
16
+ {content}
17
+ <Accordion.Item value={value + '1'}>
18
+ <Accordion.Header css={{ padding: '$8 $9' }}>nested header</Accordion.Header>
19
+ <Accordion.Content contentStyles={{ padding: '$8 $9' }}>nested item</Accordion.Content>
20
+ </Accordion.Item>
21
+ </>
22
+ </Accordion.Content>
23
+ </Accordion.Item>
24
+ );
25
+ }
26
+
27
+ const Template = () => {
28
+ return (
29
+ <Accordion.Root type="multiple" defaultValue={['item-1']} css={{ width: '300px' }}>
30
+ <AccordionItem
31
+ value="item-1"
32
+ header="Is it accessible?"
33
+ content="Yes. It adheres to the WAI-ARIA design pattern."
34
+ />
35
+ <AccordionItem
36
+ value="item-2"
37
+ header="Is it unstyled?"
38
+ content="Yes. It's unstyled by default, giving you freedom over the look and feel."
39
+ />
40
+ <AccordionItem
41
+ value="item-3"
42
+ header="Can it be animated?"
43
+ content="Yes! You can animate the Accordion. with CSS or JavaScript."
44
+ />
45
+ </Accordion.Root>
46
+ );
47
+ };
48
+
49
+ export const AccordionContent: ComponentStory<typeof Accordion.Root> = Template.bind({});
50
+ AccordionContent.storyName = 'Accordion';