@selfcommunity/react-ui 0.10.5-alpha.2 → 0.10.5-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/lib/cjs/assets/deafultCover.d.ts +2 -0
  2. package/lib/cjs/assets/deafultCover.js +3 -0
  3. package/lib/cjs/assets/liveStream/event.d.ts +2 -0
  4. package/lib/cjs/assets/liveStream/event.js +3 -0
  5. package/lib/cjs/assets/liveStream/live.d.ts +2 -0
  6. package/lib/cjs/assets/liveStream/live.js +3 -0
  7. package/lib/cjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  8. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +44 -0
  9. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +91 -0
  10. package/lib/cjs/components/CreateLiveStreamButton/index.d.ts +3 -0
  11. package/lib/cjs/components/CreateLiveStreamButton/index.js +5 -0
  12. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +49 -0
  13. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +103 -0
  14. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +47 -0
  15. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +188 -0
  16. package/lib/cjs/components/CreateLiveStreamDialog/constants.d.ts +1 -0
  17. package/lib/cjs/components/CreateLiveStreamDialog/constants.js +4 -0
  18. package/lib/cjs/components/CreateLiveStreamDialog/index.d.ts +3 -0
  19. package/lib/cjs/components/CreateLiveStreamDialog/index.js +5 -0
  20. package/lib/cjs/components/CreateLiveStreamDialog/types.d.ts +8 -0
  21. package/lib/cjs/components/CreateLiveStreamDialog/types.js +13 -0
  22. package/lib/cjs/components/Editor/Editor.d.ts +1 -1
  23. package/lib/cjs/components/Editor/nodes/HashtagNode.d.ts +1 -1
  24. package/lib/cjs/components/Editor/nodes/HashtagNode.js +4 -4
  25. package/lib/cjs/components/Editor/nodes/ImageNode.d.ts +1 -1
  26. package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -6
  27. package/lib/cjs/components/Editor/nodes/MentionNode.d.ts +1 -1
  28. package/lib/cjs/components/Editor/nodes/MentionNode.js +4 -4
  29. package/lib/cjs/components/Editor/plugins/ApiPlugin.d.ts +1 -1
  30. package/lib/cjs/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
  31. package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
  32. package/lib/cjs/components/EventForm/EventAddress.d.ts +4 -2
  33. package/lib/cjs/components/EventForm/EventAddress.js +54 -8
  34. package/lib/cjs/components/EventForm/EventForm.d.ts +12 -1
  35. package/lib/cjs/components/EventForm/EventForm.js +51 -13
  36. package/lib/cjs/components/EventForm/types.d.ts +7 -6
  37. package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
  38. package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
  39. package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +1 -1
  40. package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +1 -1
  41. package/lib/cjs/components/EventMembersWidget/types.d.ts +1 -1
  42. package/lib/cjs/components/Feed/Feed.d.ts +2 -2
  43. package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
  44. package/lib/cjs/components/LiveStream/LiveStream.d.ts +79 -0
  45. package/lib/cjs/components/LiveStream/LiveStream.js +143 -0
  46. package/lib/cjs/components/LiveStream/Skeleton.d.ts +46 -0
  47. package/lib/cjs/components/LiveStream/Skeleton.js +92 -0
  48. package/lib/cjs/components/LiveStream/constants.d.ts +1 -0
  49. package/lib/cjs/components/LiveStream/constants.js +4 -0
  50. package/lib/cjs/components/LiveStream/index.d.ts +4 -0
  51. package/lib/cjs/components/LiveStream/index.js +8 -0
  52. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
  53. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +192 -0
  54. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.d.ts +47 -0
  55. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +75 -0
  56. package/lib/cjs/components/LiveStreamForm/constants.d.ts +15 -0
  57. package/lib/cjs/components/LiveStreamForm/constants.js +18 -0
  58. package/lib/cjs/components/LiveStreamForm/index.d.ts +3 -0
  59. package/lib/cjs/components/LiveStreamForm/index.js +5 -0
  60. package/lib/cjs/components/LiveStreamForm/types.d.ts +11 -0
  61. package/lib/cjs/components/LiveStreamForm/types.js +2 -0
  62. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.d.ts +85 -0
  63. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +199 -0
  64. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +29 -0
  65. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +62 -0
  66. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.d.ts +10 -0
  67. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +76 -0
  68. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +21 -0
  69. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +33 -0
  70. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.d.ts +17 -0
  71. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.js +13 -0
  72. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +77 -0
  73. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +137 -0
  74. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
  75. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +8 -0
  76. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +28 -0
  77. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +65 -0
  78. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +30 -0
  79. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +215 -0
  80. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
  81. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +39 -0
  82. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +55 -0
  83. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +251 -0
  84. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +5 -0
  85. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +32 -0
  86. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +19 -0
  87. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.js +35 -0
  88. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
  89. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +31 -0
  90. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +26 -0
  91. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +151 -0
  92. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +3 -0
  93. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +6 -0
  94. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/index.d.ts +3 -0
  95. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/index.js +5 -0
  96. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.d.ts +7 -0
  97. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.js +195 -0
  98. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +27 -0
  99. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.js +82 -0
  100. package/lib/cjs/components/LiveStreamRoom/constants.d.ts +21 -0
  101. package/lib/cjs/components/LiveStreamRoom/constants.js +24 -0
  102. package/lib/cjs/components/LiveStreamRoom/index.d.ts +3 -0
  103. package/lib/cjs/components/LiveStreamRoom/index.js +5 -0
  104. package/lib/cjs/components/LiveStreamRoom/types.d.ts +22 -0
  105. package/lib/cjs/components/LiveStreamRoom/types.js +8 -0
  106. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
  107. package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
  108. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +16 -0
  109. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +12 -3
  110. package/lib/cjs/components/Notification/LiveStream/LiveStream.d.ts +15 -0
  111. package/lib/cjs/components/Notification/LiveStream/LiveStream.js +75 -0
  112. package/lib/cjs/components/Notification/LiveStream/index.d.ts +3 -0
  113. package/lib/cjs/components/Notification/LiveStream/index.js +5 -0
  114. package/lib/cjs/components/Notification/Notification.js +5 -1
  115. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +5 -5
  116. package/lib/cjs/components/PlatformWidget/constants.d.ts +4 -0
  117. package/lib/cjs/components/PlatformWidget/constants.js +5 -1
  118. package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
  119. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +4 -0
  120. package/lib/cjs/components/ToastNotifications/ToastNotifications.js +6 -2
  121. package/lib/cjs/components/UserLiveStreamWidget/Skeleton.d.ts +2 -0
  122. package/lib/cjs/components/UserLiveStreamWidget/Skeleton.js +28 -0
  123. package/lib/cjs/components/UserLiveStreamWidget/UserLiveStreamWidget.d.ts +47 -0
  124. package/lib/cjs/components/UserLiveStreamWidget/UserLiveStreamWidget.js +133 -0
  125. package/lib/cjs/components/UserLiveStreamWidget/constants.d.ts +1 -0
  126. package/lib/cjs/components/UserLiveStreamWidget/constants.js +4 -0
  127. package/lib/cjs/components/UserLiveStreamWidget/index.d.ts +4 -0
  128. package/lib/cjs/components/UserLiveStreamWidget/index.js +8 -0
  129. package/lib/cjs/constants/LiveStream.d.ts +3 -0
  130. package/lib/cjs/constants/LiveStream.js +6 -0
  131. package/lib/cjs/index.d.ts +12 -1
  132. package/lib/cjs/index.js +33 -6
  133. package/lib/cjs/shared/CopyTextArea/index.d.ts +2 -2
  134. package/lib/cjs/shared/CopyTextArea/index.js +8 -2
  135. package/lib/cjs/shared/EventInfoDetails/index.js +10 -1
  136. package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
  137. package/lib/cjs/shared/LiveStreamInfoDetails/index.d.ts +17 -0
  138. package/lib/cjs/shared/LiveStreamInfoDetails/index.js +53 -0
  139. package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
  140. package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
  141. package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
  142. package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
  143. package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
  144. package/lib/cjs/shared/UpScalingTierBadge/UpScalingTierBadge.js +14 -0
  145. package/lib/cjs/shared/UpScalingTierBadge/index.d.ts +7 -0
  146. package/lib/cjs/shared/UpScalingTierBadge/index.js +63 -0
  147. package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
  148. package/lib/cjs/types/composer.d.ts +1 -1
  149. package/lib/cjs/types/liveStream.d.ts +5 -0
  150. package/lib/cjs/types/liveStream.js +9 -0
  151. package/lib/cjs/utils/liveStream.d.ts +4 -0
  152. package/lib/cjs/utils/liveStream.js +25 -0
  153. package/lib/esm/assets/deafultCover.d.ts +2 -0
  154. package/lib/esm/assets/deafultCover.js +1 -0
  155. package/lib/esm/assets/liveStream/event.d.ts +2 -0
  156. package/lib/esm/assets/liveStream/event.js +1 -0
  157. package/lib/esm/assets/liveStream/live.d.ts +2 -0
  158. package/lib/esm/assets/liveStream/live.js +1 -0
  159. package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  160. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +44 -0
  161. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +88 -0
  162. package/lib/esm/components/CreateLiveStreamButton/index.d.ts +3 -0
  163. package/lib/esm/components/CreateLiveStreamButton/index.js +2 -0
  164. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +49 -0
  165. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +100 -0
  166. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +47 -0
  167. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +183 -0
  168. package/lib/esm/components/CreateLiveStreamDialog/constants.d.ts +1 -0
  169. package/lib/esm/components/CreateLiveStreamDialog/constants.js +1 -0
  170. package/lib/esm/components/CreateLiveStreamDialog/index.d.ts +3 -0
  171. package/lib/esm/components/CreateLiveStreamDialog/index.js +2 -0
  172. package/lib/esm/components/CreateLiveStreamDialog/types.d.ts +8 -0
  173. package/lib/esm/components/CreateLiveStreamDialog/types.js +10 -0
  174. package/lib/esm/components/Editor/Editor.d.ts +1 -1
  175. package/lib/esm/components/Editor/nodes/HashtagNode.d.ts +1 -1
  176. package/lib/esm/components/Editor/nodes/HashtagNode.js +4 -4
  177. package/lib/esm/components/Editor/nodes/ImageNode.d.ts +1 -1
  178. package/lib/esm/components/Editor/nodes/ImageNode.js +6 -6
  179. package/lib/esm/components/Editor/nodes/MentionNode.d.ts +1 -1
  180. package/lib/esm/components/Editor/nodes/MentionNode.js +4 -4
  181. package/lib/esm/components/Editor/plugins/ApiPlugin.d.ts +1 -1
  182. package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
  183. package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
  184. package/lib/esm/components/EventForm/EventAddress.d.ts +4 -2
  185. package/lib/esm/components/EventForm/EventAddress.js +54 -8
  186. package/lib/esm/components/EventForm/EventForm.d.ts +12 -1
  187. package/lib/esm/components/EventForm/EventForm.js +51 -13
  188. package/lib/esm/components/EventForm/types.d.ts +7 -6
  189. package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
  190. package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
  191. package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +1 -1
  192. package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +1 -1
  193. package/lib/esm/components/EventMembersWidget/types.d.ts +1 -1
  194. package/lib/esm/components/Feed/Feed.d.ts +2 -2
  195. package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
  196. package/lib/esm/components/LiveStream/LiveStream.d.ts +79 -0
  197. package/lib/esm/components/LiveStream/LiveStream.js +140 -0
  198. package/lib/esm/components/LiveStream/Skeleton.d.ts +46 -0
  199. package/lib/esm/components/LiveStream/Skeleton.js +89 -0
  200. package/lib/esm/components/LiveStream/constants.d.ts +1 -0
  201. package/lib/esm/components/LiveStream/constants.js +1 -0
  202. package/lib/esm/components/LiveStream/index.d.ts +4 -0
  203. package/lib/esm/components/LiveStream/index.js +4 -0
  204. package/lib/esm/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
  205. package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +189 -0
  206. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.d.ts +47 -0
  207. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +71 -0
  208. package/lib/esm/components/LiveStreamForm/constants.d.ts +15 -0
  209. package/lib/esm/components/LiveStreamForm/constants.js +15 -0
  210. package/lib/esm/components/LiveStreamForm/index.d.ts +3 -0
  211. package/lib/esm/components/LiveStreamForm/index.js +2 -0
  212. package/lib/esm/components/LiveStreamForm/types.d.ts +11 -0
  213. package/lib/esm/components/LiveStreamForm/types.js +1 -0
  214. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.d.ts +85 -0
  215. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +196 -0
  216. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +29 -0
  217. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +58 -0
  218. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.d.ts +10 -0
  219. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/DisconnectButton.js +73 -0
  220. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +21 -0
  221. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +27 -0
  222. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.d.ts +17 -0
  223. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamProvider.js +9 -0
  224. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +77 -0
  225. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +134 -0
  226. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.d.ts +6 -0
  227. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantPlaceholder.js +6 -0
  228. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +28 -0
  229. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +60 -0
  230. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.d.ts +30 -0
  231. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +212 -0
  232. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.d.ts +15 -0
  233. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileAvatar.js +36 -0
  234. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +55 -0
  235. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +245 -0
  236. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +5 -0
  237. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +29 -0
  238. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +19 -0
  239. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.js +30 -0
  240. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.d.ts +23 -0
  241. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/TrackToggle.js +27 -0
  242. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.d.ts +26 -0
  243. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +147 -0
  244. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +3 -0
  245. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +3 -0
  246. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/index.d.ts +3 -0
  247. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/index.js +2 -0
  248. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.d.ts +7 -0
  249. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/useLiveStreamCheck.js +191 -0
  250. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +27 -0
  251. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.js +74 -0
  252. package/lib/esm/components/LiveStreamRoom/constants.d.ts +21 -0
  253. package/lib/esm/components/LiveStreamRoom/constants.js +21 -0
  254. package/lib/esm/components/LiveStreamRoom/index.d.ts +3 -0
  255. package/lib/esm/components/LiveStreamRoom/index.js +2 -0
  256. package/lib/esm/components/LiveStreamRoom/types.d.ts +22 -0
  257. package/lib/esm/components/LiveStreamRoom/types.js +4 -0
  258. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
  259. package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
  260. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +16 -0
  261. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +12 -3
  262. package/lib/esm/components/Notification/LiveStream/LiveStream.d.ts +15 -0
  263. package/lib/esm/components/Notification/LiveStream/LiveStream.js +72 -0
  264. package/lib/esm/components/Notification/LiveStream/index.d.ts +3 -0
  265. package/lib/esm/components/Notification/LiveStream/index.js +2 -0
  266. package/lib/esm/components/Notification/Notification.js +5 -1
  267. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +5 -5
  268. package/lib/esm/components/PlatformWidget/constants.d.ts +4 -0
  269. package/lib/esm/components/PlatformWidget/constants.js +4 -0
  270. package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
  271. package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +4 -0
  272. package/lib/esm/components/ToastNotifications/ToastNotifications.js +6 -2
  273. package/lib/esm/components/UserLiveStreamWidget/Skeleton.d.ts +2 -0
  274. package/lib/esm/components/UserLiveStreamWidget/Skeleton.js +24 -0
  275. package/lib/esm/components/UserLiveStreamWidget/UserLiveStreamWidget.d.ts +47 -0
  276. package/lib/esm/components/UserLiveStreamWidget/UserLiveStreamWidget.js +130 -0
  277. package/lib/esm/components/UserLiveStreamWidget/constants.d.ts +1 -0
  278. package/lib/esm/components/UserLiveStreamWidget/constants.js +1 -0
  279. package/lib/esm/components/UserLiveStreamWidget/index.d.ts +4 -0
  280. package/lib/esm/components/UserLiveStreamWidget/index.js +4 -0
  281. package/lib/esm/constants/LiveStream.d.ts +3 -0
  282. package/lib/esm/constants/LiveStream.js +3 -0
  283. package/lib/esm/index.d.ts +12 -1
  284. package/lib/esm/index.js +13 -2
  285. package/lib/esm/shared/CopyTextArea/index.d.ts +2 -2
  286. package/lib/esm/shared/CopyTextArea/index.js +8 -2
  287. package/lib/esm/shared/EventInfoDetails/index.js +13 -4
  288. package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
  289. package/lib/esm/shared/LiveStreamInfoDetails/index.d.ts +17 -0
  290. package/lib/esm/shared/LiveStreamInfoDetails/index.js +50 -0
  291. package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
  292. package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
  293. package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
  294. package/lib/esm/shared/StickyBox/index.d.ts +4 -4
  295. package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.d.ts +5 -0
  296. package/lib/esm/shared/UpScalingTierBadge/UpScalingTierBadge.js +10 -0
  297. package/lib/esm/shared/UpScalingTierBadge/index.d.ts +7 -0
  298. package/lib/esm/shared/UpScalingTierBadge/index.js +60 -0
  299. package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
  300. package/lib/esm/types/composer.d.ts +1 -1
  301. package/lib/esm/types/liveStream.d.ts +5 -0
  302. package/lib/esm/types/liveStream.js +6 -0
  303. package/lib/esm/utils/liveStream.d.ts +4 -0
  304. package/lib/esm/utils/liveStream.js +18 -0
  305. package/lib/umd/653.js +2 -0
  306. package/lib/umd/react-ui.js +1 -19
  307. package/lib/umd/react-ui.js.LICENSE.txt +2 -0
  308. package/package.json +22 -8
  309. package/lib/umd/314.js +0 -2
  310. /package/lib/umd/{314.js.LICENSE.txt → 653.js.LICENSE.txt} +0 -0
@@ -0,0 +1,71 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Box, FormControl, Icon, InputLabel, MenuItem, Select, Stack, Switch, Typography } from '@mui/material';
4
+ import { styled } from '@mui/material/styles';
5
+ import { useThemeProps } from '@mui/system';
6
+ import { SCCommunitySubscriptionTier, SCLiveStreamViewType } from '@selfcommunity/types';
7
+ import classNames from 'classnames';
8
+ import { useContext, useMemo } from 'react';
9
+ import { FormattedMessage } from 'react-intl';
10
+ import { LIVESTREAM_DEFAULT_SETTINGS } from './constants';
11
+ import { SCPreferences, SCUserContext, useSCPreferences } from '@selfcommunity/react-core';
12
+ import UpScalingTierBadge from '../../shared/UpScalingTierBadge';
13
+ export const PREFIX = 'SCLiveStreamFormSettings';
14
+ const classes = {
15
+ root: `${PREFIX}-root`,
16
+ switch: `${PREFIX}-switch`,
17
+ switchLabel: `${PREFIX}-switch-Label`,
18
+ accessView: `${PREFIX}-access-view`,
19
+ accessViewIcon: `${PREFIX}-access-view-icon`
20
+ };
21
+ const Root = styled(Box, {
22
+ name: PREFIX,
23
+ slot: 'Root'
24
+ })(({ theme }) => ({}));
25
+ /**
26
+ *> API documentation for the Community-JS LiveStreamSettingsForm component. Learn about the available props and the CSS API.
27
+ *
28
+ #### Import
29
+ ```jsx
30
+ import {LiveStreamSettingsForm} from '@selfcommunity/react-ui';
31
+ ```
32
+
33
+ #### Component Name
34
+ The name `LiveStreamSettingsForm` can be used when providing style overrides in the theme.
35
+
36
+ #### CSS
37
+
38
+ |Rule Name|Global class|Description|
39
+ |---|---|---|
40
+ |root|.SCLiveStreamForm-root|Styles applied to the root element.|
41
+ |switch|.SCLiveStreamForm-switch|Styles applied to the switch element.|
42
+ |switchLabel|.SCLiveStreamForm-switch-label|Styles applied to the switchLabel element.|
43
+ |accessView|.SCLiveStreamForm-access-view|Styles applied to the access view.|
44
+
45
+ * @param inProps
46
+ */
47
+ export default function LiveStreamSettingsForm(inProps) {
48
+ var _a;
49
+ //PROPS
50
+ const props = useThemeProps({
51
+ props: inProps,
52
+ name: PREFIX
53
+ });
54
+ const { className, settings = LIVESTREAM_DEFAULT_SETTINGS, onChange } = props, rest = __rest(props, ["className", "settings", "onChange"]);
55
+ // CONTEXT
56
+ const scUserContext = useContext(SCUserContext);
57
+ const { preferences } = useSCPreferences();
58
+ const authUserId = useMemo(() => (scUserContext.user ? scUserContext.user.id : null), [scUserContext.user]);
59
+ const isCommunityOwner = useMemo(() => authUserId === 1, [authUserId]);
60
+ const isEnterpriseTier = useMemo(() => preferences &&
61
+ SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
62
+ preferences[SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
63
+ preferences[SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === SCCommunitySubscriptionTier.ENTERPRISE, [preferences]);
64
+ const isEnterpriseFeaturesVisible = useMemo(() => Boolean(isEnterpriseTier || isCommunityOwner), [isEnterpriseTier, isCommunityOwner]);
65
+ /**
66
+ * Renders root object
67
+ */
68
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.muteParticipants), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, LIVESTREAM_DEFAULT_SETTINGS), settings), { ['muteParticipants']: !(settings === null || settings === void 0 ? void 0 : settings.muteParticipants) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.muteParticipants", defaultMessage: "ui.liveStreamForm.muteParticipants" }) }))] })), isEnterpriseFeaturesVisible && (_jsxs(_Fragment, { children: [_jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableVideo), disabled: !isEnterpriseTier, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableVideo']: !(settings === null || settings === void 0 ? void 0 : settings.disableVideo) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.disableVideo", defaultMessage: "ui.liveStreamForm.disableVideo" }) })), _jsx(UpScalingTierBadge, { desiredTier: SCCommunitySubscriptionTier.ENTERPRISE })] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen), disabled: !isEnterpriseTier, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableShareScreen']: !(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.disableShareScreen", defaultMessage: "ui.liveStreamForm.disableShareScreen" }) })), _jsx(UpScalingTierBadge, { desiredTier: SCCommunitySubscriptionTier.ENTERPRISE })] }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableChat), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableChat']: !(settings === null || settings === void 0 ? void 0 : settings.disableChat) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.disableChat", defaultMessage: "ui.liveStreamForm.disableChat" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, LIVESTREAM_DEFAULT_SETTINGS), settings), { ['hideParticipantsList']: !(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.hideParticipantsList", defaultMessage: "ui.liveStreamForm.hideParticipantsList" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, LIVESTREAM_DEFAULT_SETTINGS), settings), { ['automaticallyNotifyFollowers']: !(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.automaticallyNotifyFollowers", defaultMessage: "ui.liveStreamForm.automaticallyNotifyFollowers" }) }))] })), _jsxs(Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.showInProfile), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, LIVESTREAM_DEFAULT_SETTINGS), settings), { ['showInProfile']: !(settings === null || settings === void 0 ? void 0 : settings.showInProfile) })) }), _jsx(Typography, Object.assign({ className: classes.switchLabel }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.showInProfile", defaultMessage: "ui.liveStreamForm.showInProfile" }) }))] })), _jsxs(FormControl, Object.assign({ className: classes.accessView }, { children: [_jsx(InputLabel, Object.assign({ id: "viewLabel" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }) })), _jsx(Select, Object.assign({ name: "view", label: _jsx(FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }), labelId: "viewLabel", fullWidth: true, value: (_a = settings === null || settings === void 0 ? void 0 : settings.view) !== null && _a !== void 0 ? _a : SCLiveStreamViewType.SPEAKER, onChange: (e) => onChange(Object.assign(Object.assign(Object.assign({}, LIVESTREAM_DEFAULT_SETTINGS), settings), { ['view']: e.target.value })), displayEmpty: true, renderValue: (selected) => {
69
+ return (_jsxs(_Fragment, { children: [_jsx(Icon, Object.assign({ className: classes.accessViewIcon }, { children: selected === SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", _jsx(FormattedMessage, { id: `ui.liveStreamForm.view.${selected}`, defaultMessage: `ui.liveStreamForm.view.${selected}` })] }));
70
+ } }, { children: Object.values(SCLiveStreamViewType).map((f) => (_jsx(MenuItem, Object.assign({ value: f }, { children: _jsxs(Box, { children: [_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsxs("b", { children: [_jsx(Icon, Object.assign({ className: classes.accessViewIcon }, { children: f === SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", _jsx(FormattedMessage, { id: `ui.liveStreamForm.view.${f}`, defaultMessage: `ui.liveStreamForm.view.${f}` })] }) })), _jsx(Typography, { children: _jsx(FormattedMessage, { id: `ui.liveStreamForm.view.${f}.description`, defaultMessage: `ui.liveStreamForm.view.${f}.description` }) })] }) }), f))) }))] }))] })));
71
+ }
@@ -0,0 +1,15 @@
1
+ import { SCLiveStreamViewType } from '@selfcommunity/types';
2
+ export declare const PREFIX = "SCLiveStreamForm";
3
+ /**
4
+ * Default live stream settings
5
+ */
6
+ export declare const LIVESTREAM_DEFAULT_SETTINGS: {
7
+ muteParticipants: boolean;
8
+ hideParticipantsList: boolean;
9
+ automaticallyNotifyFollowers: boolean;
10
+ disableVideo: boolean;
11
+ disableChat: boolean;
12
+ disableShareScreen: boolean;
13
+ showInProfile: boolean;
14
+ view: SCLiveStreamViewType;
15
+ };
@@ -0,0 +1,15 @@
1
+ import { SCLiveStreamViewType } from '@selfcommunity/types';
2
+ export const PREFIX = 'SCLiveStreamForm';
3
+ /**
4
+ * Default live stream settings
5
+ */
6
+ export const LIVESTREAM_DEFAULT_SETTINGS = {
7
+ muteParticipants: true,
8
+ hideParticipantsList: false,
9
+ automaticallyNotifyFollowers: false,
10
+ disableVideo: true,
11
+ disableChat: false,
12
+ disableShareScreen: true,
13
+ showInProfile: true,
14
+ view: SCLiveStreamViewType.SPEAKER
15
+ };
@@ -0,0 +1,3 @@
1
+ import LiveStreamForm, { LiveStreamFormProps } from './LiveStreamForm';
2
+ export default LiveStreamForm;
3
+ export { LiveStreamFormProps };
@@ -0,0 +1,2 @@
1
+ import LiveStreamForm from './LiveStreamForm';
2
+ export default LiveStreamForm;
@@ -0,0 +1,11 @@
1
+ export type InitialFieldState = {
2
+ title: string;
3
+ description: string;
4
+ slug?: string;
5
+ settings?: Record<string, any>;
6
+ cover?: string | ArrayBuffer;
7
+ coverFile?: string | Blob;
8
+ isSubmitting: boolean;
9
+ };
10
+ export type FieldStateKeys = keyof InitialFieldState;
11
+ export type FieldStateValues = InitialFieldState[FieldStateKeys];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,85 @@
1
+ import { BoxProps } from '@mui/material';
2
+ import { SCLiveStreamType } from '@selfcommunity/types';
3
+ import { LocalUserChoices } from '@livekit/components-react';
4
+ import React from 'react';
5
+ import { ConnectionDetails } from './types';
6
+ import { LiveStreamVideoConferenceProps } from './LiveStreamVideoConference';
7
+ import '@livekit/components-styles';
8
+ export interface LiveStreamRoomProps extends BoxProps {
9
+ /**
10
+ * Overrides or extends the styles applied to the component.
11
+ * @default null
12
+ */
13
+ className?: string;
14
+ /**
15
+ * Event Object
16
+ * @default null
17
+ */
18
+ liveStream?: SCLiveStreamType;
19
+ /**
20
+ * Id of the liveStream for filter the feed
21
+ * @default null
22
+ */
23
+ liveStreamId?: number;
24
+ /**
25
+ * Element to be inserted before title
26
+ */
27
+ startPrejoinContent?: React.ReactNode | null;
28
+ /**
29
+ * Element to be inserted after title
30
+ */
31
+ endPrejoinContent?: React.ReactNode | null;
32
+ /**
33
+ * Show title of livestream in prejoin
34
+ */
35
+ showPrejoinTitle?: boolean;
36
+ /**
37
+ * Show description of livestream in prejoin
38
+ */
39
+ showPrejoinDescription?: boolean;
40
+ /**
41
+ * ConnectionDetails Object
42
+ * @default null
43
+ */
44
+ presetConnectionDetails?: ConnectionDetails;
45
+ /**
46
+ * LocalUserChoices Object
47
+ * @default null
48
+ */
49
+ presetPreJoinChoices?: LocalUserChoices;
50
+ /**
51
+ * Props to spread to LiveStreamVideoConference Component
52
+ * @default {}
53
+ */
54
+ LiveStreamVideoConferenceComponentProps?: LiveStreamVideoConferenceProps;
55
+ /**
56
+ * Any other properties
57
+ */
58
+ [p: string]: any;
59
+ }
60
+ /**
61
+ *> API documentation for the Community-JS LiveStreamRoom component. Learn about the available props and the CSS API.
62
+ *
63
+ #### Import
64
+ ```jsx
65
+ import {LiveStreamRoom} from '@selfcommunity/react-ui';
66
+ ```
67
+
68
+ #### Component Name
69
+ The name `LiveStreamRoom` can be used when providing style overrides in the theme.
70
+
71
+ #### CSS
72
+
73
+ |Rule Name|Global class|Description|
74
+ |---|---|---|
75
+ |root|.SCLiveStreamRoom-root|Styles applied to the root element.|
76
+ |title|.SCLiveStreamRoom-title|Styles applied to the title element.|
77
+ |description|.SCLiveStreamRoom-description|Styles applied to the description element.|
78
+ |content|.SCLiveStreamRoom-content|Styles applied to the content.|
79
+ |prejoin|.SCLiveStreamRoom-prejoin|Styles applied to the prejoin.|
80
+ |conference|.SCLiveStreamRoom-conference|Styles applied to the conference.|
81
+ |error|.SCLiveStreamRoom-error|Styles applied to the error elements.|
82
+
83
+ * @param inProps
84
+ */
85
+ export default function LiveStreamRoom(inProps: LiveStreamRoomProps): JSX.Element;
@@ -0,0 +1,196 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Alert, AlertTitle, Box, Button, CircularProgress, Stack, Typography } from '@mui/material';
4
+ import { styled } from '@mui/material/styles';
5
+ import { useThemeProps } from '@mui/system';
6
+ import { Link, SCPreferences, SCPreferencesContext, SCRoutes, useSCFetchLiveStream, useSCPreferences, useSCRouting, useSCUser } from '@selfcommunity/react-core';
7
+ import { SCFeatureName, SCLiveStreamConnectionDetailsErrorType } from '@selfcommunity/types';
8
+ import classNames from 'classnames';
9
+ import { FormattedMessage, useIntl } from 'react-intl';
10
+ import { PREFIX } from './constants';
11
+ import { useCallback, useContext, useMemo, useState } from 'react';
12
+ import LiveStreamVideoConference from './LiveStreamVideoConference';
13
+ import '@livekit/components-styles';
14
+ import { LiveStreamService } from '@selfcommunity/api-services';
15
+ import { camelCase, Logger } from '@selfcommunity/utils';
16
+ import { SCOPE_SC_UI } from '../../constants/Errors';
17
+ import { PreJoin } from './LiveStreamVideoConference/PreJoin';
18
+ import { LiveStreamContext } from './LiveStreamVideoConference/LiveStreamProvider';
19
+ import { useSnackbar } from 'notistack';
20
+ import DialogContent from '@mui/material/DialogContent';
21
+ import BaseDialog from '../../shared/BaseDialog';
22
+ import CopyTextField from '../../shared/CopyTextArea';
23
+ const classes = {
24
+ root: `${PREFIX}-root`,
25
+ content: `${PREFIX}-content`,
26
+ title: `${PREFIX}-title`,
27
+ description: `${PREFIX}-description`,
28
+ endConferenceWrap: `${PREFIX}-end-conference-wrap`,
29
+ btnBackHome: `${PREFIX}-btn-back-home`,
30
+ startPrejoinContent: `${PREFIX}-start-prejoin-content`,
31
+ preJoin: `${PREFIX}-prejoin`,
32
+ preJoinLoading: `${PREFIX}-prejoin-loading`,
33
+ prejoinLoader: `${PREFIX}-prejoin-loader`,
34
+ preJoinAlert: `${PREFIX}-prejoin-alert`,
35
+ shareLink: `${PREFIX}-share-link`,
36
+ endPrejoinContent: `${PREFIX}-end-prejoin-content`,
37
+ endPrejoinContentBox: `${PREFIX}-end-prejoin-content-box`,
38
+ conference: `${PREFIX}-conference`,
39
+ error: `${PREFIX}-error`
40
+ };
41
+ const Root = styled(Box, {
42
+ name: PREFIX,
43
+ slot: 'Root'
44
+ })(({ theme }) => ({}));
45
+ const DialogRoot = styled(BaseDialog, {
46
+ name: PREFIX,
47
+ slot: 'Root',
48
+ overridesResolver: (props, styles) => styles.dialogRoot
49
+ })(({ theme }) => ({}));
50
+ /**
51
+ *> API documentation for the Community-JS LiveStreamRoom component. Learn about the available props and the CSS API.
52
+ *
53
+ #### Import
54
+ ```jsx
55
+ import {LiveStreamRoom} from '@selfcommunity/react-ui';
56
+ ```
57
+
58
+ #### Component Name
59
+ The name `LiveStreamRoom` can be used when providing style overrides in the theme.
60
+
61
+ #### CSS
62
+
63
+ |Rule Name|Global class|Description|
64
+ |---|---|---|
65
+ |root|.SCLiveStreamRoom-root|Styles applied to the root element.|
66
+ |title|.SCLiveStreamRoom-title|Styles applied to the title element.|
67
+ |description|.SCLiveStreamRoom-description|Styles applied to the description element.|
68
+ |content|.SCLiveStreamRoom-content|Styles applied to the content.|
69
+ |prejoin|.SCLiveStreamRoom-prejoin|Styles applied to the prejoin.|
70
+ |conference|.SCLiveStreamRoom-conference|Styles applied to the conference.|
71
+ |error|.SCLiveStreamRoom-error|Styles applied to the error elements.|
72
+
73
+ * @param inProps
74
+ */
75
+ export default function LiveStreamRoom(inProps) {
76
+ var _a, _b, _c, _d, _e, _f;
77
+ //PROPS
78
+ const props = useThemeProps({
79
+ props: inProps,
80
+ name: PREFIX
81
+ });
82
+ const { id = `live_stream_room_object_${props.liveStreamId ? props.liveStreamId : props.liveStream ? props.liveStream.id : ''}`, liveStreamId = null, liveStream = null, className, showPrejoinTitle = true, showPrejoinDescription = false, startPrejoinContent, endPrejoinContent, presetConnectionDetails, presetPreJoinChoices, LiveStreamVideoConferenceComponentProps = { options: { codec: 'vp8', hq: false } } } = props, rest = __rest(props, ["id", "liveStreamId", "liveStream", "className", "showPrejoinTitle", "showPrejoinDescription", "startPrejoinContent", "endPrejoinContent", "presetConnectionDetails", "presetPreJoinChoices", "LiveStreamVideoConferenceComponentProps"]);
83
+ // CONTEXT
84
+ const scUserContext = useSCUser();
85
+ const scRoutingContext = useSCRouting();
86
+ const { preferences, features } = useSCPreferences();
87
+ // STATE
88
+ const { scLiveStream } = useSCFetchLiveStream({ id: liveStreamId, liveStream });
89
+ const [preJoinChoices, setPreJoinChoices] = useState(presetPreJoinChoices);
90
+ const [loading, setLoading] = useState(false);
91
+ const [error, setError] = useState(null);
92
+ const preJoinDefaults = useMemo(() => {
93
+ var _a, _b, _c;
94
+ return {
95
+ username: ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.username) || '',
96
+ videoEnabled: ((_b = scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo) === false,
97
+ audioEnabled: ((_c = scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.settings) === null || _c === void 0 ? void 0 : _c.muteParticipants) === false
98
+ };
99
+ }, [scUserContext.user, scLiveStream]);
100
+ const [connectionDetails, setConnectionDetails] = useState(presetConnectionDetails);
101
+ const liveStreamEnabled = useMemo(() => preferences &&
102
+ features &&
103
+ features.includes(SCFeatureName.LIVE_STREAM) &&
104
+ SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
105
+ preferences[SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [preferences, features]);
106
+ const scPreferencesContext = useContext(SCPreferencesContext);
107
+ const appUrl = useMemo(() => scPreferencesContext.preferences && scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_APP_URL].value, [scPreferencesContext.preferences]);
108
+ // INTL
109
+ const intl = useIntl();
110
+ // MESSAGES
111
+ const { enqueueSnackbar } = useSnackbar();
112
+ // HANDLERS
113
+ /**
114
+ * Handle PreJoin Submit
115
+ */
116
+ const handlePreJoinSubmit = useCallback((values) => {
117
+ if (scLiveStream || !loading) {
118
+ setLoading(true);
119
+ setError(null);
120
+ toggleAttrDisabledPrejoinActions(true);
121
+ LiveStreamService.join(scLiveStream.id)
122
+ .then((data) => {
123
+ setPreJoinChoices(values);
124
+ setConnectionDetails(Object.assign(Object.assign({}, data), { participantName: scUserContext.user.username }));
125
+ toggleAttrDisabledPrejoinActions(false);
126
+ setLoading(false);
127
+ })
128
+ .catch((error) => {
129
+ Logger.error(SCOPE_SC_UI, error);
130
+ if (error.response &&
131
+ error.response.data &&
132
+ typeof error.response.data === 'object' &&
133
+ error.response.data.errors &&
134
+ error.response.data.errors.length) {
135
+ let _msg = (_jsx(FormattedMessage, { id: "ui.liveStreamRoom.connect.error.generic", defaultMessage: "'ui.liveStreamRoom.connect.error.generic", values: { link: (...chunks) => _jsx(Link, Object.assign({ to: '/' }, { children: chunks })) } }));
136
+ if (error.response.data.errors[0].code) {
137
+ const _error = `ui.liveStreamRoom.connect.error.${camelCase(error.response.data.errors[0].code)}`;
138
+ _msg = (_jsx(FormattedMessage, { id: _error, defaultMessage: _error, values: {
139
+ link: (...chunks) => (_jsx(Link, Object.assign({ style: { color: '#FFF' }, to: error.response.data.errors[0].code !== SCLiveStreamConnectionDetailsErrorType.PARTICIPATE_THE_EVENT_TO_JOIN_LIVE_STREAM &&
140
+ scLiveStream.event
141
+ ? scRoutingContext.url(SCRoutes.EVENTS_ROUTE_NAME, scLiveStream.event)
142
+ : '/' }, { children: chunks })))
143
+ } }));
144
+ if (error.response.data.errors[0].code !== SCLiveStreamConnectionDetailsErrorType.WAITING_HOST_TO_START_LIVE_STREAM &&
145
+ error.response.data.errors[0].code !== SCLiveStreamConnectionDetailsErrorType.PARTICIPANTS_LIMIT_REACHED) {
146
+ setError(_msg);
147
+ }
148
+ else {
149
+ setTimeout(() => toggleAttrDisabledPrejoinActions(false), 10000);
150
+ }
151
+ enqueueSnackbar(_msg, { variant: 'error', autoHideDuration: 5000 });
152
+ }
153
+ else {
154
+ enqueueSnackbar(_msg, { variant: 'error' });
155
+ setError(_msg);
156
+ }
157
+ }
158
+ setLoading(false);
159
+ });
160
+ }
161
+ }, [scUserContext.user, setPreJoinChoices, setConnectionDetails, scLiveStream, setError, loading]);
162
+ /**
163
+ * Handle disable controls button
164
+ */
165
+ const toggleAttrDisabledPrejoinActions = useCallback((disabled) => {
166
+ const container = document.querySelector('.lk-prejoin');
167
+ if (container) {
168
+ const buttons = container.querySelectorAll('button.lk-button');
169
+ buttons.forEach((button) => {
170
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
171
+ // @ts-ignore
172
+ button.disabled = disabled;
173
+ });
174
+ }
175
+ }, []);
176
+ /**
177
+ * Handle PreJoin Error
178
+ */
179
+ const handlePreJoinError = useCallback((e) => console.error(e), []);
180
+ /**
181
+ * User must be authenticated
182
+ */
183
+ if (!scLiveStream || !scUserContext.user || !liveStreamEnabled) {
184
+ return _jsx(CircularProgress, {});
185
+ }
186
+ /**
187
+ * Renders root object
188
+ */
189
+ return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest, { children: scLiveStream.closed_at_by_host ? (_jsx(DialogRoot, Object.assign({ open: true, maxWidth: 'md', fullWidth: true }, { children: _jsxs(DialogContent, Object.assign({ className: classes.endConferenceWrap }, { children: [_jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.conference.closed", defaultMessage: "ui.liveStreamRoom.conference.closed" }) })), _jsx(Button, Object.assign({ variant: "contained", color: "secondary", component: Link, to: '/', className: classes.btnBackHome }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.button.backHome", defaultMessage: "ui.liveStreamRoom.button.backHome" }) }))] })) }))) : (_jsx(Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? (_jsxs(_Fragment, { children: [startPrejoinContent && _jsx(Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title) && (_jsx(Typography, Object.assign({ component: 'div', variant: "h4", className: classes.title, alignContent: 'center' }, { children: scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title }))), _jsxs(Box, Object.assign({ className: classNames(classes.preJoin, { [classes.preJoinLoading]: loading || error }) }, { children: [_jsx(LiveStreamContext.Provider, Object.assign({ value: { liveStream: scLiveStream } }, { children: _jsx(PreJoin, { defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError, joinLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.joinRoom', defaultMessage: 'ui.liveStreamRoom.preJoin.joinRoom' }), micLabel: intl.formatMessage({
190
+ id: 'ui.liveStreamRoom.preJoin.microphone',
191
+ defaultMessage: 'ui.liveStreamRoom.preJoin.microphone'
192
+ }), camLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.camera', defaultMessage: 'ui.liveStreamRoom.preJoin.camera' }), userLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.username', defaultMessage: 'ui.liveStreamRoom.preJoin.username' }) }) })), loading && (_jsxs(Box, Object.assign({ className: classes.prejoinLoader }, { children: [_jsx(CircularProgress, {}), _jsx(Typography, Object.assign({ component: 'div', variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.connecting", defaultMessage: "ui.liveStreamRoom.connecting" }) }))] })))] })), _jsxs(Box, Object.assign({ className: classes.endPrejoinContent }, { children: [Boolean(scUserContext.user &&
193
+ scUserContext.user.id !== scLiveStream.host.id &&
194
+ scLiveStream &&
195
+ (((_a = scLiveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipants) || (scLiveStream && ((_b = scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo)))) && (_jsxs(Stack, Object.assign({ sx: { width: '47%' }, spacing: 1, className: classes.endPrejoinContentBox }, { children: [scLiveStream && (((_c = scLiveStream.settings) === null || _c === void 0 ? void 0 : _c.muteParticipants) || ((_d = scLiveStream.settings) === null || _d === void 0 ? void 0 : _d.disableVideo)) && (_jsxs(Alert, Object.assign({ variant: "filled", severity: "info", className: classes.preJoinAlert }, { children: [_jsx(AlertTitle, { children: _jsx("b", { children: "Info" }) }), ((_e = scLiveStream.settings) === null || _e === void 0 ? void 0 : _e.muteParticipants) && (_jsxs(_Fragment, { children: ["-", ' ', _jsx(FormattedMessage, { id: "ui.liveStreamRoom.hostDisableMicrophone", defaultMessage: "ui.liveStreamRoom.hostDisableMicrophone" }), _jsx("br", {})] })), ((_f = scLiveStream.settings) === null || _f === void 0 ? void 0 : _f.disableVideo) && (_jsxs(_Fragment, { children: ["- ", _jsx(FormattedMessage, { id: "ui.liveStreamRoom.hostDisableVideo", defaultMessage: "ui.liveStreamRoom.hostDisableVideo" })] }))] }))), _jsx(CopyTextField, { className: classes.shareLink, value: `${appUrl}${scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream)}`, label: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.shareLink", defaultMessage: "ui.liveStreamRoom.shareLink" }) }), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description) && (_jsxs(Alert, Object.assign({ variant: "filled", severity: "info", className: classes.description }, { children: [_jsx(AlertTitle, { children: _jsx("b", { children: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.description", defaultMessage: "ui.liveStreamRoom.description" }) }) }), scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description] })))] }))), endPrejoinContent] }))] })) : (_jsx(Box, Object.assign({ className: classes.conference }, { children: _jsx(LiveStreamContext.Provider, Object.assign({ value: { liveStream: scLiveStream } }, { children: _jsx(LiveStreamVideoConference, Object.assign({ connectionDetails: connectionDetails, userChoices: preJoinChoices }, LiveStreamVideoConferenceComponentProps)) })) }))) }))) })));
196
+ }
@@ -0,0 +1,29 @@
1
+ import { Track } from 'livekit-client';
2
+ import * as React from 'react';
3
+ /** @public */
4
+ export type ControlBarControls = {
5
+ microphone?: boolean;
6
+ camera?: boolean;
7
+ chat?: boolean;
8
+ screenShare?: boolean;
9
+ leave?: boolean;
10
+ settings?: boolean;
11
+ };
12
+ export interface ControlBarProps extends React.HTMLAttributes<HTMLDivElement> {
13
+ onDeviceError?: (error: {
14
+ source: Track.Source;
15
+ error: Error;
16
+ }) => void;
17
+ variation?: 'minimal' | 'verbose' | 'textOnly';
18
+ controls?: ControlBarControls;
19
+ /**
20
+ * If `true`, the user's device choices will be persisted.
21
+ * This will enable the user to have the same device choices when they rejoin the room.
22
+ */
23
+ saveUserChoices?: boolean;
24
+ }
25
+ /**
26
+ * The `ControlBar` prefab gives the user the basic user interface to control their
27
+ * media devices (camera, microphone and screen share), open the `Chat` and leave the room.
28
+ */
29
+ export declare function ControlBar({ variation, controls, saveUserChoices, onDeviceError, ...props }: ControlBarProps): JSX.Element;
@@ -0,0 +1,58 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Track } from 'livekit-client';
4
+ import * as React from 'react';
5
+ import { supportsScreenSharing } from '@livekit/components-core';
6
+ import { ChatIcon, ChatToggle, GearIcon, LeaveIcon, MediaDeviceMenu, StartMediaButton, useLocalParticipantPermissions, useMaybeLayoutContext, usePersistentUserChoices } from '@livekit/components-react';
7
+ import { TrackToggle } from './TrackToggle';
8
+ import { useMediaQuery } from '@mui/material';
9
+ import { SettingsMenuToggle } from './SettingsMenuToggle';
10
+ import { DisconnectButton } from './DisconnectButton';
11
+ import { mergeProps } from './utils';
12
+ /**
13
+ * The `ControlBar` prefab gives the user the basic user interface to control their
14
+ * media devices (camera, microphone and screen share), open the `Chat` and leave the room.
15
+ */
16
+ export function ControlBar(_a) {
17
+ var _b, _c, _d, _e, _f;
18
+ var { variation, controls, saveUserChoices = true, onDeviceError } = _a, props = __rest(_a, ["variation", "controls", "saveUserChoices", "onDeviceError"]);
19
+ const [isChatOpen, setIsChatOpen] = React.useState(false);
20
+ const layoutContext = useMaybeLayoutContext();
21
+ React.useEffect(() => {
22
+ var _a, _b;
23
+ if (((_a = layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.widget.state) === null || _a === void 0 ? void 0 : _a.showChat) !== undefined) {
24
+ setIsChatOpen((_b = layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.widget.state) === null || _b === void 0 ? void 0 : _b.showChat);
25
+ }
26
+ }, [(_b = layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.widget.state) === null || _b === void 0 ? void 0 : _b.showChat]);
27
+ const isTooLittleSpace = useMediaQuery(`(max-width: ${isChatOpen ? 1000 : 760}px)`);
28
+ const defaultVariation = isTooLittleSpace ? 'minimal' : 'verbose';
29
+ variation !== null && variation !== void 0 ? variation : (variation = defaultVariation);
30
+ const visibleControls = Object.assign({ leave: true }, controls);
31
+ const localPermissions = useLocalParticipantPermissions();
32
+ if (!localPermissions) {
33
+ visibleControls.camera = false;
34
+ visibleControls.chat = false;
35
+ visibleControls.microphone = false;
36
+ visibleControls.screenShare = false;
37
+ }
38
+ else {
39
+ (_c = visibleControls.camera) !== null && _c !== void 0 ? _c : (visibleControls.camera = localPermissions.canPublish);
40
+ (_d = visibleControls.microphone) !== null && _d !== void 0 ? _d : (visibleControls.microphone = localPermissions.canPublish);
41
+ (_e = visibleControls.screenShare) !== null && _e !== void 0 ? _e : (visibleControls.screenShare = localPermissions.canPublish);
42
+ (_f = visibleControls.chat) !== null && _f !== void 0 ? _f : (visibleControls.chat = localPermissions.canPublishData && (controls === null || controls === void 0 ? void 0 : controls.chat));
43
+ }
44
+ const showIcon = React.useMemo(() => variation === 'minimal' || variation === 'verbose', [variation]);
45
+ const showText = React.useMemo(() => variation === 'textOnly' || variation === 'verbose', [variation]);
46
+ const browserSupportsScreenSharing = supportsScreenSharing();
47
+ const [isScreenShareEnabled, setIsScreenShareEnabled] = React.useState(false);
48
+ const onScreenShareChange = React.useCallback((enabled) => {
49
+ setIsScreenShareEnabled(enabled);
50
+ }, [setIsScreenShareEnabled]);
51
+ const htmlProps = mergeProps({ className: 'lk-control-bar' }, props);
52
+ const { saveAudioInputEnabled, saveVideoInputEnabled, saveAudioInputDeviceId, saveVideoInputDeviceId } = usePersistentUserChoices({
53
+ preventSave: !saveUserChoices
54
+ });
55
+ const microphoneOnChange = React.useCallback((enabled, isUserInitiated) => (isUserInitiated ? saveAudioInputEnabled(enabled) : null), [saveAudioInputEnabled]);
56
+ const cameraOnChange = React.useCallback((enabled, isUserInitiated) => (isUserInitiated ? saveVideoInputEnabled(enabled) : null), [saveVideoInputEnabled]);
57
+ return (_jsxs("div", Object.assign({}, htmlProps, { children: [visibleControls.microphone && (_jsxs("div", Object.assign({ className: "lk-button-group" }, { children: [_jsx(_Fragment, { children: _jsx(TrackToggle, Object.assign({ source: Track.Source.Microphone, showIcon: showIcon, onChange: microphoneOnChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: Track.Source.Microphone, error }) }, { children: showText && 'Microphone' })) }), _jsx("div", Object.assign({ className: "lk-button-group-menu" }, { children: _jsx(MediaDeviceMenu, { kind: "audioinput", onActiveDeviceChange: (_kind, deviceId) => saveAudioInputDeviceId(deviceId !== null && deviceId !== void 0 ? deviceId : '') }) }))] }))), visibleControls.camera && (_jsxs("div", Object.assign({ className: "lk-button-group" }, { children: [_jsx(_Fragment, { children: _jsx(TrackToggle, Object.assign({ source: Track.Source.Camera, showIcon: showIcon, onChange: cameraOnChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: Track.Source.Camera, error }) }, { children: showText && 'Camera' })) }), _jsx("div", Object.assign({ className: "lk-button-group-menu" }, { children: _jsx(MediaDeviceMenu, { kind: "videoinput", onActiveDeviceChange: (_kind, deviceId) => saveVideoInputDeviceId(deviceId !== null && deviceId !== void 0 ? deviceId : '') }) }))] }))), visibleControls.screenShare && browserSupportsScreenSharing && (_jsx(_Fragment, { children: _jsx(TrackToggle, Object.assign({ source: Track.Source.ScreenShare, captureOptions: { audio: true, selfBrowserSurface: 'include', surfaceSwitching: 'exclude' }, showIcon: showIcon, onChange: onScreenShareChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: Track.Source.ScreenShare, error }) }, { children: showText && (isScreenShareEnabled ? 'Stop screen share' : 'Share screen') })) })), visibleControls.chat && (_jsx(_Fragment, { children: _jsxs(ChatToggle, { children: [showIcon && _jsx(ChatIcon, {}), showText && 'Chat'] }) })), visibleControls.settings && (_jsx(_Fragment, { children: _jsxs(SettingsMenuToggle, { children: [showIcon && _jsx(GearIcon, {}), showText && 'Settings'] }) })), visibleControls.leave && (_jsx(_Fragment, { children: _jsxs(DisconnectButton, { children: [showIcon && _jsx(LeaveIcon, {}), showText && 'Leave'] }) })), _jsx(StartMediaButton, {})] })));
58
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ /** @public */
3
+ export interface DisconnectButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
+ stopTracks?: boolean;
5
+ }
6
+ /**
7
+ * The `DisconnectButton` is a basic html button with the added ability to disconnect from a LiveKit room.
8
+ * Normally this is the big red button that allows end users to leave the video or audio call.
9
+ */
10
+ export declare const DisconnectButton: (props: DisconnectButtonProps & React.RefAttributes<HTMLButtonElement>) => React.ReactNode;
@@ -0,0 +1,73 @@
1
+ import { __awaiter, __rest } from "tslib";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from 'react';
4
+ import { useDisconnectButton } from '@livekit/components-react';
5
+ import { useCallback, useMemo, useState } from 'react';
6
+ import { LiveStreamApiClient } from '@selfcommunity/api-services';
7
+ import { useLiveStream } from './LiveStreamProvider';
8
+ import { FormattedMessage } from 'react-intl';
9
+ import { Checkbox, FormControlLabel, FormGroup } from '@mui/material';
10
+ import { useSCUser } from '@selfcommunity/react-core';
11
+ import ConfirmDialog from '../../../shared/ConfirmDialog/ConfirmDialog';
12
+ /**
13
+ * The `DisconnectButton` is a basic html button with the added ability to disconnect from a LiveKit room.
14
+ * Normally this is the big red button that allows end users to leave the video or audio call.
15
+ */
16
+ export const DisconnectButton =
17
+ /* @__PURE__ */ React.forwardRef(function DisconnectButton(props, ref) {
18
+ // CONTEXT
19
+ const { liveStream } = useLiveStream();
20
+ const scUserContext = useSCUser();
21
+ // STATE
22
+ const [closeLive, setCloseLive] = useState(false);
23
+ const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
24
+ const [isUpdating, setIsUpdating] = useState(false);
25
+ const { buttonProps } = useDisconnectButton(props);
26
+ const { onClick } = buttonProps, rest = __rest(buttonProps, ["onClick"]);
27
+ /**
28
+ * Intercept fist leave action
29
+ */
30
+ const handleOnLeave = useCallback(() => {
31
+ if (liveStream && scUserContext.user.id === liveStream.host.id) {
32
+ setOpenConfirmDialog(true);
33
+ }
34
+ else {
35
+ onClick === null || onClick === void 0 ? void 0 : onClick();
36
+ }
37
+ }, [setOpenConfirmDialog, liveStream, scUserContext.user]);
38
+ /**
39
+ * Control close live
40
+ */
41
+ const handleChangeCloseLive = useCallback((event) => {
42
+ setCloseLive(event.target.checked);
43
+ }, [closeLive]);
44
+ /**
45
+ * Perform set liveStream as closed
46
+ */
47
+ const performCloseLiveStream = useMemo(() => () => __awaiter(this, void 0, void 0, function* () {
48
+ const res = yield LiveStreamApiClient.close(liveStream.id);
49
+ if (res.status >= 300) {
50
+ return Promise.reject(res);
51
+ }
52
+ return yield Promise.resolve(res.data);
53
+ }), [liveStream]);
54
+ /**
55
+ * Perform patch liveStream before leave the live
56
+ */
57
+ const handleLeaveAction = () => {
58
+ if (!isUpdating && liveStream && scUserContext.user.id === liveStream.host.id && closeLive) {
59
+ setIsUpdating(true);
60
+ performCloseLiveStream()
61
+ .then(() => {
62
+ onClick === null || onClick === void 0 ? void 0 : onClick();
63
+ })
64
+ .catch((error) => {
65
+ console.error(error);
66
+ });
67
+ }
68
+ else {
69
+ onClick === null || onClick === void 0 ? void 0 : onClick();
70
+ }
71
+ };
72
+ return (_jsxs(_Fragment, { children: [_jsx("button", Object.assign({ ref: ref }, rest, { onClick: handleOnLeave }, { children: props.children })), openConfirmDialog && (_jsx(ConfirmDialog, { open: openConfirmDialog, title: _jsx(_Fragment, {}), content: _jsxs(_Fragment, { children: [_jsx(FormattedMessage, { id: "ui.liveStreamRoom.live.terminate", defaultMessage: "ui.liveStreamRoom.live.terminate" }), _jsx(FormGroup, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: closeLive, onChange: handleChangeCloseLive, inputProps: { 'aria-label': 'controlled' } }), label: _jsx(FormattedMessage, { id: "ui.liveStreamRoom.live.terminatePermanently", defaultMessage: "ui.liveStreamRoom.live.terminatePermanently" }) }) })] }), onConfirm: handleLeaveAction, isUpdating: isUpdating, onClose: () => setOpenConfirmDialog(false) }))] }));
73
+ });
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ import type { TrackReferenceOrPlaceholder } from '@livekit/components-core';
3
+ import type { ParticipantClickEvent } from '@livekit/components-core';
4
+ export type FocusLayoutContainerProps = React.HTMLAttributes<HTMLDivElement>;
5
+ /**
6
+ * The `FocusLayoutContainer` is a layout component that expects two children:
7
+ * A small side component: In a video conference, this is usually a carousel of participants
8
+ * who are not in focus. And a larger main component to display the focused participant.
9
+ * For example, with the `FocusLayout` component.
10
+ */
11
+ export declare function FocusLayoutContainer(props: FocusLayoutContainerProps): JSX.Element;
12
+ export declare function FocusLayoutContainerNoParticipants(props: FocusLayoutContainerProps): JSX.Element;
13
+ export interface FocusLayoutProps extends React.HTMLAttributes<HTMLElement> {
14
+ /** The track to display in the focus layout. */
15
+ trackRef?: TrackReferenceOrPlaceholder;
16
+ onParticipantClick?: (evt: ParticipantClickEvent) => void;
17
+ }
18
+ /**
19
+ * The `FocusLayout` component is just a light wrapper around the `ParticipantTile` to display a single participant.
20
+ */
21
+ export declare function FocusLayout({ trackRef, ...htmlProps }: FocusLayoutProps): JSX.Element;