@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,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SettingsMenuToggle = exports.useSettingsToggle = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const React = tslib_1.__importStar(require("react"));
7
+ const utils_1 = require("./utils");
8
+ const components_react_1 = require("@livekit/components-react");
9
+ /**
10
+ * The `useSettingsToggle` hook provides state and functions for toggling the settings menu.
11
+ */
12
+ function useSettingsToggle({ props }) {
13
+ const { dispatch, state } = (0, components_react_1.useLayoutContext)().widget;
14
+ const className = 'lk-button lk-settings-toggle';
15
+ const mergedProps = React.useMemo(() => {
16
+ return (0, utils_1.mergePropsReactAria)(props, {
17
+ className,
18
+ onClick: () => {
19
+ if (dispatch)
20
+ dispatch({ msg: 'toggle_settings' });
21
+ },
22
+ 'aria-pressed': (state === null || state === void 0 ? void 0 : state.showSettings) ? 'true' : 'false'
23
+ });
24
+ }, [props, className, dispatch, state]);
25
+ return { mergedProps };
26
+ }
27
+ exports.useSettingsToggle = useSettingsToggle;
28
+ /**
29
+ * The `SettingsMenuToggle` component is a button that toggles the visibility of the `SettingsMenu` component.
30
+ */
31
+ exports.SettingsMenuToggle =
32
+ /* @__PURE__ */ React.forwardRef(function SettingsMenuToggle(props, ref) {
33
+ const { mergedProps } = useSettingsToggle({ props });
34
+ return ((0, jsx_runtime_1.jsx)("button", Object.assign({ ref: ref }, mergedProps, { children: props.children })));
35
+ });
@@ -0,0 +1,23 @@
1
+ import type { CaptureOptionsBySource, ToggleSource } from '@livekit/components-core';
2
+ import * as React from 'react';
3
+ import { Track, TrackPublishOptions } from 'livekit-client';
4
+ export declare function getSourceIcon(source: Track.Source, enabled: boolean): JSX.Element;
5
+ export interface TrackToggleProps<T extends ToggleSource> extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
6
+ source: T;
7
+ showIcon?: boolean;
8
+ initialState?: boolean;
9
+ disabled?: boolean;
10
+ /**
11
+ * Function that is called when the enabled state of the toggle changes.
12
+ * The second function argument `isUserInitiated` is `true` if the change was initiated by a user interaction, such as a click.
13
+ */
14
+ onChange?: (enabled: boolean, isUserInitiated: boolean) => void;
15
+ captureOptions?: CaptureOptionsBySource<T>;
16
+ publishOptions?: TrackPublishOptions;
17
+ onDeviceError?: (error: Error) => void;
18
+ }
19
+ /**
20
+ * With the `TrackToggle` component it is possible to mute and unmute your camera and microphone.
21
+ * The component uses an html button element under the hood so you can treat it like a button.
22
+ */
23
+ export declare const TrackToggle: <T extends ToggleSource>(props: TrackToggleProps<T> & React.RefAttributes<HTMLButtonElement>) => React.ReactNode;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrackToggle = exports.getSourceIcon = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const React = tslib_1.__importStar(require("react"));
7
+ const livekit_client_1 = require("livekit-client");
8
+ const components_react_1 = require("@livekit/components-react");
9
+ function getSourceIcon(source, enabled) {
10
+ switch (source) {
11
+ case livekit_client_1.Track.Source.Microphone:
12
+ return enabled ? (0, jsx_runtime_1.jsx)(components_react_1.MicIcon, {}) : (0, jsx_runtime_1.jsx)(components_react_1.MicDisabledIcon, {});
13
+ case livekit_client_1.Track.Source.Camera:
14
+ return enabled ? (0, jsx_runtime_1.jsx)(components_react_1.CameraIcon, {}) : (0, jsx_runtime_1.jsx)(components_react_1.CameraDisabledIcon, {});
15
+ case livekit_client_1.Track.Source.ScreenShare:
16
+ return enabled ? (0, jsx_runtime_1.jsx)(components_react_1.ScreenShareStopIcon, {}) : (0, jsx_runtime_1.jsx)(components_react_1.ScreenShareIcon, {});
17
+ default:
18
+ return undefined;
19
+ }
20
+ }
21
+ exports.getSourceIcon = getSourceIcon;
22
+ /**
23
+ * With the `TrackToggle` component it is possible to mute and unmute your camera and microphone.
24
+ * The component uses an html button element under the hood so you can treat it like a button.
25
+ */
26
+ exports.TrackToggle =
27
+ /* @__PURE__ */ React.forwardRef(function TrackToggle(_a, ref) {
28
+ var { showIcon, disabled } = _a, props = tslib_1.__rest(_a, ["showIcon", "disabled"]);
29
+ const { buttonProps, enabled } = (0, components_react_1.useTrackToggle)(props);
30
+ return ((0, jsx_runtime_1.jsxs)("button", Object.assign({ ref: ref }, buttonProps, { disabled: disabled }, { children: [(showIcon !== null && showIcon !== void 0 ? showIcon : true) && getSourceIcon(props.source, enabled && !disabled), props.children] })));
31
+ });
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ import type { MessageDecoder, MessageEncoder } from '@livekit/components-core';
3
+ import { MessageFormatter } from '@livekit/components-react';
4
+ import { SCUserType } from '@selfcommunity/types';
5
+ export interface VideoConferenceProps {
6
+ className?: string;
7
+ chatMessageFormatter?: MessageFormatter;
8
+ chatMessageEncoder?: MessageEncoder;
9
+ chatMessageDecoder?: MessageDecoder;
10
+ /** @alpha */
11
+ SettingsComponent?: React.ComponentType;
12
+ speakerFocused?: SCUserType;
13
+ disableChat?: boolean;
14
+ disableMicrophone?: boolean;
15
+ disableCamera?: boolean;
16
+ disableShareScreen?: boolean;
17
+ hideParticipantsList?: boolean;
18
+ showSettings?: boolean;
19
+ }
20
+ /**
21
+ * The `VideoConference` ready-made component is your drop-in solution for a classic video conferencing application.
22
+ * It provides functionality such as focusing on one participant, grid view with pagination to handle large numbers
23
+ * of participants, basic non-persistent chat, screen sharing, and more.
24
+ *
25
+ */
26
+ export declare function VideoConference(inProps: VideoConferenceProps): JSX.Element;
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VideoConference = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const React = tslib_1.__importStar(require("react"));
7
+ const components_core_1 = require("@livekit/components-core");
8
+ const livekit_client_1 = require("livekit-client");
9
+ const components_react_1 = require("@livekit/components-react");
10
+ const ParticipantTile_1 = require("./ParticipantTile");
11
+ const ControlBar_1 = require("./ControlBar");
12
+ const react_1 = require("react");
13
+ const useLiveStreamCheck_1 = require("./useLiveStreamCheck");
14
+ const FocusLayout_1 = require("./FocusLayout");
15
+ const react_core_1 = require("@selfcommunity/react-core");
16
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
17
+ const styles_1 = require("@mui/material/styles");
18
+ const material_1 = require("@mui/material");
19
+ const system_1 = require("@mui/system");
20
+ const PREFIX = 'SCVideoConference';
21
+ const classes = {
22
+ root: `${PREFIX}-root`
23
+ };
24
+ const Root = (0, styles_1.styled)(material_1.Box, {
25
+ name: PREFIX,
26
+ slot: 'Root',
27
+ overridesResolver: (props, styles) => styles.root
28
+ })(({ theme }) => ({
29
+ '& .lk-chat': {
30
+ height: '100%'
31
+ }
32
+ }));
33
+ /**
34
+ * The `VideoConference` ready-made component is your drop-in solution for a classic video conferencing application.
35
+ * It provides functionality such as focusing on one participant, grid view with pagination to handle large numbers
36
+ * of participants, basic non-persistent chat, screen sharing, and more.
37
+ *
38
+ */
39
+ function VideoConference(inProps) {
40
+ var _a, _b;
41
+ // PROPS
42
+ const props = (0, system_1.useThemeProps)({
43
+ props: inProps,
44
+ name: PREFIX
45
+ });
46
+ const { className, chatMessageFormatter, chatMessageDecoder, chatMessageEncoder, SettingsComponent, speakerFocused, disableChat = false, disableMicrophone = false, disableCamera = false, disableShareScreen = false, hideParticipantsList = false, showSettings } = props, rest = tslib_1.__rest(props, ["className", "chatMessageFormatter", "chatMessageDecoder", "chatMessageEncoder", "SettingsComponent", "speakerFocused", "disableChat", "disableMicrophone", "disableCamera", "disableShareScreen", "hideParticipantsList", "showSettings"]);
47
+ // STATE
48
+ const [widgetState, setWidgetState] = React.useState({
49
+ showChat: false,
50
+ unreadMessages: 0,
51
+ showSettings: showSettings || false
52
+ });
53
+ const [focusInitialized, setFocusInitialized] = React.useState(false);
54
+ const lastAutoFocusedScreenShareTrack = React.useRef(null);
55
+ // HOOKS
56
+ const scUserContext = (0, react_core_1.useSCUser)();
57
+ const tracks = (0, components_react_1.useTracks)([
58
+ { source: livekit_client_1.Track.Source.Camera, withPlaceholder: true },
59
+ { source: livekit_client_1.Track.Source.ScreenShare, withPlaceholder: false }
60
+ ], { updateOnlyOn: [livekit_client_1.RoomEvent.ActiveSpeakersChanged], onlySubscribed: false });
61
+ const participants = (0, components_react_1.useParticipants)();
62
+ const layoutContext = (0, components_react_1.useCreateLayoutContext)();
63
+ const screenShareTracks = tracks.filter(components_core_1.isTrackReference).filter((track) => track.publication.source === livekit_client_1.Track.Source.ScreenShare);
64
+ const focusTrack = (_a = (0, components_react_1.usePinnedTracks)(layoutContext)) === null || _a === void 0 ? void 0 : _a[0];
65
+ const carouselTracks = tracks.filter((track) => !(0, components_core_1.isEqualTrackRef)(track, focusTrack));
66
+ (0, useLiveStreamCheck_1.useLivestreamCheck)();
67
+ /**
68
+ * widgetUpdate
69
+ * @param state
70
+ */
71
+ const widgetUpdate = (state) => {
72
+ components_core_1.log.debug('updating widget state', state);
73
+ setWidgetState(state);
74
+ };
75
+ /**
76
+ * handleFocusStateChange
77
+ * @param state
78
+ */
79
+ const handleFocusStateChange = (state) => {
80
+ var _a, _b;
81
+ components_core_1.log.debug('updating widget state', state);
82
+ if (state && state.participant) {
83
+ const updatedFocusTrack = tracks.find((tr) => tr.participant.identity === state.participant.identity);
84
+ if (updatedFocusTrack) {
85
+ (_b = (_a = layoutContext.pin).dispatch) === null || _b === void 0 ? void 0 : _b.call(_a, { msg: 'set_pin', trackReference: updatedFocusTrack });
86
+ }
87
+ }
88
+ };
89
+ (0, react_1.useEffect)(() => {
90
+ var _a, _b, _c, _d, _e, _f, _g, _h;
91
+ // If screen share tracks are published, and no pin is set explicitly, auto set the screen share.
92
+ if (screenShareTracks.some((track) => track.publication.isSubscribed) && lastAutoFocusedScreenShareTrack.current === null) {
93
+ components_core_1.log.debug('Auto set screen share focus:', { newScreenShareTrack: screenShareTracks[0] });
94
+ (_b = (_a = layoutContext.pin).dispatch) === null || _b === void 0 ? void 0 : _b.call(_a, { msg: 'set_pin', trackReference: screenShareTracks[0] });
95
+ lastAutoFocusedScreenShareTrack.current = screenShareTracks[0];
96
+ }
97
+ else if (lastAutoFocusedScreenShareTrack.current &&
98
+ !screenShareTracks.some((track) => { var _a, _b; return track.publication.trackSid === ((_b = (_a = lastAutoFocusedScreenShareTrack.current) === null || _a === void 0 ? void 0 : _a.publication) === null || _b === void 0 ? void 0 : _b.trackSid); })) {
99
+ components_core_1.log.debug('Auto clearing screen share focus.');
100
+ (_d = (_c = layoutContext.pin).dispatch) === null || _d === void 0 ? void 0 : _d.call(_c, { msg: 'clear_pin' });
101
+ lastAutoFocusedScreenShareTrack.current = null;
102
+ }
103
+ if (focusTrack) {
104
+ let updatedFocusTrack;
105
+ const isFocusTrackParticipantExist = participants.find((pt) => pt.identity === focusTrack.participant.identity);
106
+ if (!isFocusTrackParticipantExist) {
107
+ // Focus track is relative to a participant that has left the room
108
+ updatedFocusTrack = tracks.find((tr) => tr.participant.identity === scUserContext.user.id.toString());
109
+ (_f = (_e = layoutContext.pin).dispatch) === null || _f === void 0 ? void 0 : _f.call(_e, { msg: 'set_pin', trackReference: updatedFocusTrack });
110
+ }
111
+ else if (!(0, components_core_1.isTrackReference)(focusTrack)) {
112
+ // You are not subscribet to the track
113
+ updatedFocusTrack = tracks.find((tr) => tr.participant.identity === focusTrack.participant.identity && tr.source === focusTrack.source);
114
+ if (updatedFocusTrack !== focusTrack && (0, components_core_1.isTrackReference)(updatedFocusTrack)) {
115
+ (_h = (_g = layoutContext.pin).dispatch) === null || _h === void 0 ? void 0 : _h.call(_g, { msg: 'set_pin', trackReference: updatedFocusTrack });
116
+ }
117
+ }
118
+ }
119
+ }, [
120
+ screenShareTracks.map((ref) => `${ref.publication.trackSid}_${ref.publication.isSubscribed}`).join(),
121
+ (_b = focusTrack === null || focusTrack === void 0 ? void 0 : focusTrack.publication) === null || _b === void 0 ? void 0 : _b.trackSid,
122
+ tracks,
123
+ participants,
124
+ speakerFocused
125
+ ]);
126
+ (0, react_1.useEffect)(() => {
127
+ var _a, _b;
128
+ if (speakerFocused && !focusInitialized) {
129
+ const speaker = participants.find((pt) => {
130
+ return pt.name === speakerFocused.username;
131
+ });
132
+ if (speaker) {
133
+ const updatedFocusTrack = tracks.find((tr) => {
134
+ if (tr) {
135
+ return tr.participant.identity === speaker.identity;
136
+ }
137
+ return false;
138
+ });
139
+ (_b = (_a = layoutContext.pin).dispatch) === null || _b === void 0 ? void 0 : _b.call(_a, { msg: 'set_pin', trackReference: updatedFocusTrack });
140
+ setFocusInitialized(true);
141
+ }
142
+ }
143
+ }, [tracks, participants, speakerFocused]);
144
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root, 'lk-video-conference') }, rest, { children: [(0, components_core_1.isWeb)() && ((0, jsx_runtime_1.jsxs)(components_react_1.LayoutContextProvider, Object.assign({ value: layoutContext, onPinChange: handleFocusStateChange, onWidgetChange: widgetUpdate }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-conference-inner" }, { children: [!focusTrack ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-grid-layout-wrapper" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.GridLayout, Object.assign({ tracks: tracks }, { children: (0, jsx_runtime_1.jsx)(ParticipantTile_1.ParticipantTile, {}) })) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-focus-layout-wrapper" }, { children: hideParticipantsList ? ((0, jsx_runtime_1.jsx)(FocusLayout_1.FocusLayoutContainerNoParticipants, { children: focusTrack && (0, jsx_runtime_1.jsx)(FocusLayout_1.FocusLayout, { trackRef: focusTrack }) })) : ((0, jsx_runtime_1.jsxs)(FocusLayout_1.FocusLayoutContainer, { children: [(0, jsx_runtime_1.jsx)(components_react_1.CarouselLayout, Object.assign({ tracks: carouselTracks }, { children: (0, jsx_runtime_1.jsx)(ParticipantTile_1.ParticipantTile, {}) })), focusTrack && (0, jsx_runtime_1.jsx)(FocusLayout_1.FocusLayout, { trackRef: focusTrack })] })) }))), (0, jsx_runtime_1.jsx)(ControlBar_1.ControlBar, { controls: Object.assign({
145
+ chat: !disableChat,
146
+ microphone: !disableMicrophone,
147
+ camera: !disableCamera,
148
+ screenShare: !disableShareScreen
149
+ }, { settings: !!SettingsComponent }) })] })), !disableChat && ((0, jsx_runtime_1.jsx)(components_react_1.Chat, { style: { display: widgetState.showChat ? 'grid' : 'none' }, messageFormatter: chatMessageFormatter, messageEncoder: chatMessageEncoder, messageDecoder: chatMessageDecoder })), SettingsComponent && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-settings-menu-modal", style: { display: widgetState.showSettings ? 'block' : 'none' } }, { children: (0, jsx_runtime_1.jsx)(SettingsComponent, {}) })))] }))), (0, jsx_runtime_1.jsx)(components_react_1.RoomAudioRenderer, {}), (0, jsx_runtime_1.jsx)(components_react_1.ConnectionStateToast, {})] })));
150
+ }
151
+ exports.VideoConference = VideoConference;
@@ -0,0 +1,3 @@
1
+ export declare const PREFIX = "SCLiveStreamVideoConference";
2
+ export declare const REMOVE_ROOM_USER = "_remove_room_user";
3
+ export declare const BAN_ROOM_USER = "_ban_room_user";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BAN_ROOM_USER = exports.REMOVE_ROOM_USER = exports.PREFIX = void 0;
4
+ exports.PREFIX = 'SCLiveStreamVideoConference';
5
+ exports.REMOVE_ROOM_USER = '_remove_room_user';
6
+ exports.BAN_ROOM_USER = '_ban_room_user';
@@ -0,0 +1,3 @@
1
+ import LiveStreamVideoConference, { LiveStreamVideoConferenceProps } from './LiveStreamVideoConference';
2
+ export default LiveStreamVideoConference;
3
+ export { LiveStreamVideoConferenceProps };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const LiveStreamVideoConference_1 = tslib_1.__importDefault(require("./LiveStreamVideoConference"));
5
+ exports.default = LiveStreamVideoConference_1.default;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Custom hook for monitoring livestream.
3
+ * @param {number} warningThreshold
4
+ * @param showWarnings
5
+ * @param performDisconnect
6
+ */
7
+ export declare function useLivestreamCheck(warningThreshold?: number, showWarnings?: boolean, performDisconnect?: boolean): any;
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLivestreamCheck = void 0;
4
+ const react_1 = require("react");
5
+ const api_services_1 = require("@selfcommunity/api-services");
6
+ const components_react_1 = require("@livekit/components-react");
7
+ const LiveStreamProvider_1 = require("./LiveStreamProvider");
8
+ const notistack_1 = require("notistack");
9
+ const react_intl_1 = require("react-intl");
10
+ const react_core_1 = require("@selfcommunity/react-core");
11
+ const constants_1 = require("../constants");
12
+ const livekit_client_1 = require("livekit-client");
13
+ const _INITIAL_STATE = {
14
+ checkStarted: false,
15
+ timeRemaining: 60,
16
+ isExpiringSoonAloneInRoom: false,
17
+ isExpiringSoonMissingHost: false,
18
+ isExpiringSoonFewMinutesRemaining: false,
19
+ isExpiredSoonAloneInRoom: false,
20
+ isExpiredSoonMissingHost: false,
21
+ isExpiredSoonFewMinutesRemaining: false
22
+ };
23
+ const reducer = (state, action) => {
24
+ switch (action.type) {
25
+ case 'startChecking':
26
+ return Object.assign(Object.assign({}, _INITIAL_STATE), { checkStarted: true });
27
+ case 'stopChecking':
28
+ return Object.assign(Object.assign({}, _INITIAL_STATE), { checkStarted: false });
29
+ case 'reset':
30
+ return Object.assign({}, _INITIAL_STATE);
31
+ case 'isExpiringSoonAloneInRoom':
32
+ return Object.assign(Object.assign({}, state), { isExpiringSoonAloneInRoom: action.value });
33
+ case 'isExpiringSoonMissingHost':
34
+ return Object.assign(Object.assign({}, state), { isExpiringSoonMissingHost: action.value });
35
+ case 'isExpiringSoonFewMinutesRemaining':
36
+ return Object.assign(Object.assign({}, state), { isExpiringSoonFewMinutesRemaining: action.value });
37
+ case 'isExpiredAloneInRoom':
38
+ return Object.assign(Object.assign({}, state), { isExpiredAloneInRoom: action.value });
39
+ case 'isExpiredSoonMissingHost':
40
+ return Object.assign(Object.assign({}, state), { isExpiredSoonMissingHost: action.value });
41
+ case 'isExpiredSoonFewMinutesRemaining':
42
+ return Object.assign(Object.assign({}, state), { isExpiredSoonFewMinutesRemaining: action.value });
43
+ case 'timeRemaining':
44
+ return Object.assign(Object.assign({}, state), { timeRemaining: action.value });
45
+ default:
46
+ return Object.assign(Object.assign({}, state), { [action.type]: action.value });
47
+ }
48
+ };
49
+ /**
50
+ * Custom hook for monitoring livestream.
51
+ * @param {number} warningThreshold
52
+ * @param showWarnings
53
+ * @param performDisconnect
54
+ */
55
+ function useLivestreamCheck(warningThreshold = constants_1.WARNING_THRESHOLD_EXPIRING_SOON, showWarnings = true, performDisconnect = true) {
56
+ // STATE
57
+ const [state, dispatch] = (0, react_1.useReducer)(reducer, _INITIAL_STATE);
58
+ const intervalRef = (0, react_1.useRef)(null);
59
+ // HOOKS
60
+ const scUserContext = (0, react_core_1.useSCUser)();
61
+ const participants = (0, components_react_1.useParticipants)({
62
+ updateOnlyOn: [
63
+ livekit_client_1.RoomEvent.ParticipantConnected,
64
+ livekit_client_1.RoomEvent.ParticipantDisconnected,
65
+ livekit_client_1.RoomEvent.ConnectionStateChanged,
66
+ livekit_client_1.RoomEvent.Connected,
67
+ livekit_client_1.RoomEvent.Disconnected,
68
+ livekit_client_1.RoomEvent.TrackSubscribed,
69
+ livekit_client_1.RoomEvent.TrackUnsubscribed
70
+ ]
71
+ });
72
+ const { liveStream } = (0, LiveStreamProvider_1.useLiveStream)();
73
+ const { buttonProps } = (0, components_react_1.useDisconnectButton)({});
74
+ const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
75
+ const __DEBUG = (0, react_1.useRef)(true);
76
+ // INTL
77
+ const intl = (0, react_intl_1.useIntl)();
78
+ /**
79
+ * fetchLivestreamStatus
80
+ */
81
+ const fetchLivestreamStatus = () => {
82
+ api_services_1.LiveStreamApiClient.getMonthlyDuration()
83
+ .then((r) => {
84
+ dispatch({ type: 'timeRemaining', value: r.remaining_minutes });
85
+ if (r.remaining_minutes > 0 && r.remaining_minutes <= warningThreshold) {
86
+ if (!state.isExpiringSoonFewMinutesRemaining &&
87
+ !state.isExpiredSoonFewMinutesRemaining &&
88
+ liveStream.host.id === scUserContext.user.id &&
89
+ showWarnings) {
90
+ __DEBUG && console.log('Warning: ');
91
+ enqueueSnackbar(intl.formatMessage({ id: 'ui.liveStreamRoom.check.fewMinutesRemaining', defaultMessage: 'ui.liveStreamRoom.check.fewMinutesRemaining' }), {
92
+ variant: 'warning',
93
+ autoHideDuration: 30000
94
+ });
95
+ dispatch({ type: 'isExpiringSoonFewMinutesRemaining', value: true });
96
+ }
97
+ }
98
+ else if (r.remaining_minutes <= 0) {
99
+ __DEBUG && console.log('Livestream expired');
100
+ dispatch({ type: 'isExpiredFewMinutesRemaining', value: true });
101
+ }
102
+ else if (state.isExpiredFewMinutesRemaining) {
103
+ dispatch({ type: 'isExpiringSoonFewMinutesRemaining', value: false });
104
+ }
105
+ })
106
+ .catch((error) => {
107
+ console.error('Error fetching live status:', error);
108
+ });
109
+ };
110
+ /**
111
+ * Check live
112
+ */
113
+ const check = (0, react_1.useCallback)(() => {
114
+ if (__DEBUG) {
115
+ console.log('Checking live status');
116
+ console.log('Status: ', state);
117
+ console.log('Checking participants...', participants.length);
118
+ console.log(participants);
119
+ }
120
+ if (participants.length <= 1) {
121
+ if (!state.isExpiringSoonAloneInRoom && !state.isExpiredAloneInRoom && showWarnings) {
122
+ __DEBUG && console.log('Set expire soon: you are alone in the room');
123
+ enqueueSnackbar(intl.formatMessage({ id: 'ui.liveStreamRoom.check.youAreAloneInTheRoom', defaultMessage: 'ui.liveStreamRoom.check.youAreAloneInTheRoom' }), { variant: 'warning', autoHideDuration: 10000 });
124
+ state.isExpiringSoonAloneInRoom
125
+ ? dispatch({ type: 'isExpiredAloneInRoom', value: true })
126
+ : dispatch({ type: 'isExpiringSoonAloneInRoom', value: true });
127
+ }
128
+ else if (performDisconnect && (state.isExpiringSoonAloneInRoom || state.isExpiredAloneInRoom)) {
129
+ // Leave the room
130
+ __DEBUG && console.log('Leave the room: no participants');
131
+ buttonProps.onClick();
132
+ }
133
+ return;
134
+ }
135
+ else if (state.isExpiringSoonAloneInRoom) {
136
+ __DEBUG && console.log('Reset expire soon');
137
+ dispatch({ type: 'isExpiringSoonAloneInRoom', value: false });
138
+ }
139
+ __DEBUG && console.log('Checking live speaker...');
140
+ const speaker = participants.find((pt) => {
141
+ return pt.name === liveStream.host.username;
142
+ });
143
+ if (!speaker) {
144
+ if (!state.isExpiredSoonMissingHost && !state.isExpiringSoonMissingHost && liveStream.host.id !== scUserContext.user.id && showWarnings) {
145
+ enqueueSnackbar(intl.formatMessage({ id: 'ui.liveStreamRoom.check.hostMissing', defaultMessage: 'ui.liveStreamRoom.check.hostMissing' }), {
146
+ variant: 'warning',
147
+ autoHideDuration: 10000
148
+ });
149
+ state.isExpiringSoonMissingHost
150
+ ? dispatch({ type: 'isExpiredSoonMissingHost', value: true })
151
+ : dispatch({ type: 'isExpiringSoonMissingHost', value: true });
152
+ }
153
+ else if (performDisconnect && (state.isExpiredSoonMissingHost || state.isExpiringSoonMissingHost)) {
154
+ // Leave the room
155
+ __DEBUG && console.log('Leave the room: no host');
156
+ buttonProps.onClick();
157
+ }
158
+ }
159
+ else if (state.isExpiringSoonMissingHost) {
160
+ dispatch({ type: 'isExpiringSoonMissingHost', value: false });
161
+ }
162
+ __DEBUG && console.log('Checking live status resources...');
163
+ fetchLivestreamStatus();
164
+ }, [state, buttonProps, participants]);
165
+ /**
166
+ * Check live status
167
+ */
168
+ (0, react_1.useEffect)(() => {
169
+ if (state.checkStarted) {
170
+ intervalRef.current = setInterval(check, constants_1.LIVE_CHECKING_INTERVAL * 60000);
171
+ }
172
+ return () => {
173
+ intervalRef.current && clearInterval(intervalRef.current);
174
+ };
175
+ }, [state, participants]);
176
+ /**
177
+ * Start the checking after a delay
178
+ */
179
+ (0, react_1.useEffect)(() => {
180
+ let _timeout;
181
+ if (liveStream) {
182
+ _timeout = setTimeout(() => {
183
+ // Start the checking after 5 minutes
184
+ dispatch({ type: 'startChecking' });
185
+ __DEBUG && console.log('Start checking');
186
+ }, (liveStream.host.id === scUserContext.user.id ? constants_1.LIVE_CHECKING_INITIAL_DELAY_HOST : constants_1.LIVE_CHECKING_INITIAL_DELAY_GUEST) * 60000);
187
+ }
188
+ return () => {
189
+ _timeout && clearTimeout(_timeout);
190
+ dispatch({ type: 'stopChecking' });
191
+ };
192
+ }, [liveStream]);
193
+ return state;
194
+ }
195
+ exports.useLivestreamCheck = useLivestreamCheck;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Calls all functions in the order they were chained with the same arguments.
4
+ * @internal
5
+ */
6
+ export declare function chain(...callbacks: any[]): (...args: any[]) => void;
7
+ interface Props {
8
+ [key: string]: any;
9
+ }
10
+ type TupleTypes<T> = {
11
+ [P in keyof T]: T[P];
12
+ } extends {
13
+ [key: number]: infer V;
14
+ } ? V : never;
15
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
16
+ /**
17
+ * Merges multiple props objects together. Event handlers are chained,
18
+ * classNames are combined, and ids are deduplicated - different ids
19
+ * will trigger a side-effect and re-render components hooked up with `useId`.
20
+ * For all other props, the last prop object overrides all previous ones.
21
+ * @param args - Multiple sets of props to merge together.
22
+ * @internal
23
+ */
24
+ export declare function mergePropsReactAria<T extends Props[]>(...args: T): UnionToIntersection<TupleTypes<T>>;
25
+ export declare function isProp<U extends HTMLElement, T extends React.HTMLAttributes<U>>(prop: T | undefined): prop is T;
26
+ export declare function mergeProps<U extends HTMLElement, T extends Array<React.HTMLAttributes<U> | undefined>>(...props: T): import("react").HTMLAttributes<U>;
27
+ export {};
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2020 Adobe. All rights reserved.
4
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License. You may obtain a copy
6
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ * Unless required by applicable law or agreed to in writing, software distributed under
9
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
10
+ * OF ANY KIND, either express or implied. See the License for the specific language
11
+ * governing permissions and limitations under the License.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.mergeProps = exports.isProp = exports.mergePropsReactAria = exports.chain = void 0;
15
+ const tslib_1 = require("tslib");
16
+ const clsx_1 = tslib_1.__importDefault(require("clsx"));
17
+ /**
18
+ * Calls all functions in the order they were chained with the same arguments.
19
+ * @internal
20
+ */
21
+ function chain(...callbacks) {
22
+ return (...args) => {
23
+ for (const callback of callbacks) {
24
+ if (typeof callback === 'function') {
25
+ try {
26
+ callback(...args);
27
+ }
28
+ catch (e) {
29
+ console.error(e);
30
+ }
31
+ }
32
+ }
33
+ };
34
+ }
35
+ exports.chain = chain;
36
+ /**
37
+ * Merges multiple props objects together. Event handlers are chained,
38
+ * classNames are combined, and ids are deduplicated - different ids
39
+ * will trigger a side-effect and re-render components hooked up with `useId`.
40
+ * For all other props, the last prop object overrides all previous ones.
41
+ * @param args - Multiple sets of props to merge together.
42
+ * @internal
43
+ */
44
+ function mergePropsReactAria(...args) {
45
+ // Start with a base clone of the first argument. This is a lot faster than starting
46
+ // with an empty object and adding properties as we go.
47
+ const result = Object.assign({}, args[0]);
48
+ for (let i = 1; i < args.length; i++) {
49
+ const props = args[i];
50
+ for (const key in props) {
51
+ const a = result[key];
52
+ const b = props[key];
53
+ // Chain events
54
+ if (typeof a === 'function' &&
55
+ typeof b === 'function' &&
56
+ // This is a lot faster than a regex.
57
+ key[0] === 'o' &&
58
+ key[1] === 'n' &&
59
+ key.charCodeAt(2) >= /* 'A' */ 65 &&
60
+ key.charCodeAt(2) <= /* 'Z' */ 90) {
61
+ result[key] = chain(a, b);
62
+ // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check
63
+ }
64
+ else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') {
65
+ result[key] = (0, clsx_1.default)(a, b);
66
+ }
67
+ else {
68
+ result[key] = b !== undefined ? b : a;
69
+ }
70
+ }
71
+ }
72
+ return result;
73
+ }
74
+ exports.mergePropsReactAria = mergePropsReactAria;
75
+ function isProp(prop) {
76
+ return prop !== undefined;
77
+ }
78
+ exports.isProp = isProp;
79
+ function mergeProps(...props) {
80
+ return mergePropsReactAria(...props.filter(isProp));
81
+ }
82
+ exports.mergeProps = mergeProps;
@@ -0,0 +1,21 @@
1
+ export declare const PREFIX = "SCLiveStreamRoom";
2
+ export declare const defaultVideoOptions: {
3
+ readonly hq: true;
4
+ readonly codec: "vp9";
5
+ };
6
+ /**
7
+ * Start the checking after a delay
8
+ * In minutes
9
+ */
10
+ export declare const LIVE_CHECKING_INITIAL_DELAY_HOST = 4;
11
+ export declare const LIVE_CHECKING_INITIAL_DELAY_GUEST = 1;
12
+ /**
13
+ * Checking live status on VideoLiveConference
14
+ * In minutes
15
+ */
16
+ export declare const LIVE_CHECKING_INTERVAL = 1;
17
+ /**
18
+ * Warning threshold expiring soon
19
+ * In minutes
20
+ */
21
+ export declare const WARNING_THRESHOLD_EXPIRING_SOON = 5;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WARNING_THRESHOLD_EXPIRING_SOON = exports.LIVE_CHECKING_INTERVAL = exports.LIVE_CHECKING_INITIAL_DELAY_GUEST = exports.LIVE_CHECKING_INITIAL_DELAY_HOST = exports.defaultVideoOptions = exports.PREFIX = void 0;
4
+ exports.PREFIX = 'SCLiveStreamRoom';
5
+ exports.defaultVideoOptions = {
6
+ hq: true,
7
+ codec: 'vp9'
8
+ };
9
+ /**
10
+ * Start the checking after a delay
11
+ * In minutes
12
+ */
13
+ exports.LIVE_CHECKING_INITIAL_DELAY_HOST = 4;
14
+ exports.LIVE_CHECKING_INITIAL_DELAY_GUEST = 1;
15
+ /**
16
+ * Checking live status on VideoLiveConference
17
+ * In minutes
18
+ */
19
+ exports.LIVE_CHECKING_INTERVAL = 1;
20
+ /**
21
+ * Warning threshold expiring soon
22
+ * In minutes
23
+ */
24
+ exports.WARNING_THRESHOLD_EXPIRING_SOON = 5;