@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,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,3 @@
1
+ export const PREFIX = 'SCLiveStreamVideoConference';
2
+ export const REMOVE_ROOM_USER = '_remove_room_user';
3
+ export const 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,2 @@
1
+ import LiveStreamVideoConference from './LiveStreamVideoConference';
2
+ export default LiveStreamVideoConference;
@@ -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,191 @@
1
+ import { useCallback, useEffect, useReducer, useRef } from 'react';
2
+ import { LiveStreamApiClient } from '@selfcommunity/api-services';
3
+ import { useDisconnectButton, useParticipants } from '@livekit/components-react';
4
+ import { useLiveStream } from './LiveStreamProvider';
5
+ import { useSnackbar } from 'notistack';
6
+ import { useIntl } from 'react-intl';
7
+ import { useSCUser } from '@selfcommunity/react-core';
8
+ import { LIVE_CHECKING_INITIAL_DELAY_GUEST, LIVE_CHECKING_INITIAL_DELAY_HOST, LIVE_CHECKING_INTERVAL, WARNING_THRESHOLD_EXPIRING_SOON } from '../constants';
9
+ import { RoomEvent } from 'livekit-client';
10
+ const _INITIAL_STATE = {
11
+ checkStarted: false,
12
+ timeRemaining: 60,
13
+ isExpiringSoonAloneInRoom: false,
14
+ isExpiringSoonMissingHost: false,
15
+ isExpiringSoonFewMinutesRemaining: false,
16
+ isExpiredSoonAloneInRoom: false,
17
+ isExpiredSoonMissingHost: false,
18
+ isExpiredSoonFewMinutesRemaining: false
19
+ };
20
+ const reducer = (state, action) => {
21
+ switch (action.type) {
22
+ case 'startChecking':
23
+ return Object.assign(Object.assign({}, _INITIAL_STATE), { checkStarted: true });
24
+ case 'stopChecking':
25
+ return Object.assign(Object.assign({}, _INITIAL_STATE), { checkStarted: false });
26
+ case 'reset':
27
+ return Object.assign({}, _INITIAL_STATE);
28
+ case 'isExpiringSoonAloneInRoom':
29
+ return Object.assign(Object.assign({}, state), { isExpiringSoonAloneInRoom: action.value });
30
+ case 'isExpiringSoonMissingHost':
31
+ return Object.assign(Object.assign({}, state), { isExpiringSoonMissingHost: action.value });
32
+ case 'isExpiringSoonFewMinutesRemaining':
33
+ return Object.assign(Object.assign({}, state), { isExpiringSoonFewMinutesRemaining: action.value });
34
+ case 'isExpiredAloneInRoom':
35
+ return Object.assign(Object.assign({}, state), { isExpiredAloneInRoom: action.value });
36
+ case 'isExpiredSoonMissingHost':
37
+ return Object.assign(Object.assign({}, state), { isExpiredSoonMissingHost: action.value });
38
+ case 'isExpiredSoonFewMinutesRemaining':
39
+ return Object.assign(Object.assign({}, state), { isExpiredSoonFewMinutesRemaining: action.value });
40
+ case 'timeRemaining':
41
+ return Object.assign(Object.assign({}, state), { timeRemaining: action.value });
42
+ default:
43
+ return Object.assign(Object.assign({}, state), { [action.type]: action.value });
44
+ }
45
+ };
46
+ /**
47
+ * Custom hook for monitoring livestream.
48
+ * @param {number} warningThreshold
49
+ * @param showWarnings
50
+ * @param performDisconnect
51
+ */
52
+ export function useLivestreamCheck(warningThreshold = WARNING_THRESHOLD_EXPIRING_SOON, showWarnings = true, performDisconnect = true) {
53
+ // STATE
54
+ const [state, dispatch] = useReducer(reducer, _INITIAL_STATE);
55
+ const intervalRef = useRef(null);
56
+ // HOOKS
57
+ const scUserContext = useSCUser();
58
+ const participants = useParticipants({
59
+ updateOnlyOn: [
60
+ RoomEvent.ParticipantConnected,
61
+ RoomEvent.ParticipantDisconnected,
62
+ RoomEvent.ConnectionStateChanged,
63
+ RoomEvent.Connected,
64
+ RoomEvent.Disconnected,
65
+ RoomEvent.TrackSubscribed,
66
+ RoomEvent.TrackUnsubscribed
67
+ ]
68
+ });
69
+ const { liveStream } = useLiveStream();
70
+ const { buttonProps } = useDisconnectButton({});
71
+ const { enqueueSnackbar } = useSnackbar();
72
+ const __DEBUG = useRef(true);
73
+ // INTL
74
+ const intl = useIntl();
75
+ /**
76
+ * fetchLivestreamStatus
77
+ */
78
+ const fetchLivestreamStatus = () => {
79
+ LiveStreamApiClient.getMonthlyDuration()
80
+ .then((r) => {
81
+ dispatch({ type: 'timeRemaining', value: r.remaining_minutes });
82
+ if (r.remaining_minutes > 0 && r.remaining_minutes <= warningThreshold) {
83
+ if (!state.isExpiringSoonFewMinutesRemaining &&
84
+ !state.isExpiredSoonFewMinutesRemaining &&
85
+ liveStream.host.id === scUserContext.user.id &&
86
+ showWarnings) {
87
+ __DEBUG && console.log('Warning: ');
88
+ enqueueSnackbar(intl.formatMessage({ id: 'ui.liveStreamRoom.check.fewMinutesRemaining', defaultMessage: 'ui.liveStreamRoom.check.fewMinutesRemaining' }), {
89
+ variant: 'warning',
90
+ autoHideDuration: 30000
91
+ });
92
+ dispatch({ type: 'isExpiringSoonFewMinutesRemaining', value: true });
93
+ }
94
+ }
95
+ else if (r.remaining_minutes <= 0) {
96
+ __DEBUG && console.log('Livestream expired');
97
+ dispatch({ type: 'isExpiredFewMinutesRemaining', value: true });
98
+ }
99
+ else if (state.isExpiredFewMinutesRemaining) {
100
+ dispatch({ type: 'isExpiringSoonFewMinutesRemaining', value: false });
101
+ }
102
+ })
103
+ .catch((error) => {
104
+ console.error('Error fetching live status:', error);
105
+ });
106
+ };
107
+ /**
108
+ * Check live
109
+ */
110
+ const check = useCallback(() => {
111
+ if (__DEBUG) {
112
+ console.log('Checking live status');
113
+ console.log('Status: ', state);
114
+ console.log('Checking participants...', participants.length);
115
+ console.log(participants);
116
+ }
117
+ if (participants.length <= 1) {
118
+ if (!state.isExpiringSoonAloneInRoom && !state.isExpiredAloneInRoom && showWarnings) {
119
+ __DEBUG && console.log('Set expire soon: you are alone in the room');
120
+ enqueueSnackbar(intl.formatMessage({ id: 'ui.liveStreamRoom.check.youAreAloneInTheRoom', defaultMessage: 'ui.liveStreamRoom.check.youAreAloneInTheRoom' }), { variant: 'warning', autoHideDuration: 10000 });
121
+ state.isExpiringSoonAloneInRoom
122
+ ? dispatch({ type: 'isExpiredAloneInRoom', value: true })
123
+ : dispatch({ type: 'isExpiringSoonAloneInRoom', value: true });
124
+ }
125
+ else if (performDisconnect && (state.isExpiringSoonAloneInRoom || state.isExpiredAloneInRoom)) {
126
+ // Leave the room
127
+ __DEBUG && console.log('Leave the room: no participants');
128
+ buttonProps.onClick();
129
+ }
130
+ return;
131
+ }
132
+ else if (state.isExpiringSoonAloneInRoom) {
133
+ __DEBUG && console.log('Reset expire soon');
134
+ dispatch({ type: 'isExpiringSoonAloneInRoom', value: false });
135
+ }
136
+ __DEBUG && console.log('Checking live speaker...');
137
+ const speaker = participants.find((pt) => {
138
+ return pt.name === liveStream.host.username;
139
+ });
140
+ if (!speaker) {
141
+ if (!state.isExpiredSoonMissingHost && !state.isExpiringSoonMissingHost && liveStream.host.id !== scUserContext.user.id && showWarnings) {
142
+ enqueueSnackbar(intl.formatMessage({ id: 'ui.liveStreamRoom.check.hostMissing', defaultMessage: 'ui.liveStreamRoom.check.hostMissing' }), {
143
+ variant: 'warning',
144
+ autoHideDuration: 10000
145
+ });
146
+ state.isExpiringSoonMissingHost
147
+ ? dispatch({ type: 'isExpiredSoonMissingHost', value: true })
148
+ : dispatch({ type: 'isExpiringSoonMissingHost', value: true });
149
+ }
150
+ else if (performDisconnect && (state.isExpiredSoonMissingHost || state.isExpiringSoonMissingHost)) {
151
+ // Leave the room
152
+ __DEBUG && console.log('Leave the room: no host');
153
+ buttonProps.onClick();
154
+ }
155
+ }
156
+ else if (state.isExpiringSoonMissingHost) {
157
+ dispatch({ type: 'isExpiringSoonMissingHost', value: false });
158
+ }
159
+ __DEBUG && console.log('Checking live status resources...');
160
+ fetchLivestreamStatus();
161
+ }, [state, buttonProps, participants]);
162
+ /**
163
+ * Check live status
164
+ */
165
+ useEffect(() => {
166
+ if (state.checkStarted) {
167
+ intervalRef.current = setInterval(check, LIVE_CHECKING_INTERVAL * 60000);
168
+ }
169
+ return () => {
170
+ intervalRef.current && clearInterval(intervalRef.current);
171
+ };
172
+ }, [state, participants]);
173
+ /**
174
+ * Start the checking after a delay
175
+ */
176
+ useEffect(() => {
177
+ let _timeout;
178
+ if (liveStream) {
179
+ _timeout = setTimeout(() => {
180
+ // Start the checking after 5 minutes
181
+ dispatch({ type: 'startChecking' });
182
+ __DEBUG && console.log('Start checking');
183
+ }, (liveStream.host.id === scUserContext.user.id ? LIVE_CHECKING_INITIAL_DELAY_HOST : LIVE_CHECKING_INITIAL_DELAY_GUEST) * 60000);
184
+ }
185
+ return () => {
186
+ _timeout && clearTimeout(_timeout);
187
+ dispatch({ type: 'stopChecking' });
188
+ };
189
+ }, [liveStream]);
190
+ return state;
191
+ }
@@ -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,74 @@
1
+ /*
2
+ * Copyright 2020 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ import clsx from 'clsx';
13
+ /**
14
+ * Calls all functions in the order they were chained with the same arguments.
15
+ * @internal
16
+ */
17
+ export function chain(...callbacks) {
18
+ return (...args) => {
19
+ for (const callback of callbacks) {
20
+ if (typeof callback === 'function') {
21
+ try {
22
+ callback(...args);
23
+ }
24
+ catch (e) {
25
+ console.error(e);
26
+ }
27
+ }
28
+ }
29
+ };
30
+ }
31
+ /**
32
+ * Merges multiple props objects together. Event handlers are chained,
33
+ * classNames are combined, and ids are deduplicated - different ids
34
+ * will trigger a side-effect and re-render components hooked up with `useId`.
35
+ * For all other props, the last prop object overrides all previous ones.
36
+ * @param args - Multiple sets of props to merge together.
37
+ * @internal
38
+ */
39
+ export function mergePropsReactAria(...args) {
40
+ // Start with a base clone of the first argument. This is a lot faster than starting
41
+ // with an empty object and adding properties as we go.
42
+ const result = Object.assign({}, args[0]);
43
+ for (let i = 1; i < args.length; i++) {
44
+ const props = args[i];
45
+ for (const key in props) {
46
+ const a = result[key];
47
+ const b = props[key];
48
+ // Chain events
49
+ if (typeof a === 'function' &&
50
+ typeof b === 'function' &&
51
+ // This is a lot faster than a regex.
52
+ key[0] === 'o' &&
53
+ key[1] === 'n' &&
54
+ key.charCodeAt(2) >= /* 'A' */ 65 &&
55
+ key.charCodeAt(2) <= /* 'Z' */ 90) {
56
+ result[key] = chain(a, b);
57
+ // Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check
58
+ }
59
+ else if ((key === 'className' || key === 'UNSAFE_className') && typeof a === 'string' && typeof b === 'string') {
60
+ result[key] = clsx(a, b);
61
+ }
62
+ else {
63
+ result[key] = b !== undefined ? b : a;
64
+ }
65
+ }
66
+ }
67
+ return result;
68
+ }
69
+ export function isProp(prop) {
70
+ return prop !== undefined;
71
+ }
72
+ export function mergeProps(...props) {
73
+ return mergePropsReactAria(...props.filter(isProp));
74
+ }
@@ -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,21 @@
1
+ export const PREFIX = 'SCLiveStreamRoom';
2
+ export const defaultVideoOptions = {
3
+ hq: true,
4
+ codec: 'vp9'
5
+ };
6
+ /**
7
+ * Start the checking after a delay
8
+ * In minutes
9
+ */
10
+ export const LIVE_CHECKING_INITIAL_DELAY_HOST = 4;
11
+ export const LIVE_CHECKING_INITIAL_DELAY_GUEST = 1;
12
+ /**
13
+ * Checking live status on VideoLiveConference
14
+ * In minutes
15
+ */
16
+ export const LIVE_CHECKING_INTERVAL = 1;
17
+ /**
18
+ * Warning threshold expiring soon
19
+ * In minutes
20
+ */
21
+ export const WARNING_THRESHOLD_EXPIRING_SOON = 5;
@@ -0,0 +1,3 @@
1
+ import LiveStreamRoom, { LiveStreamRoomProps } from './LiveStreamRoom';
2
+ export default LiveStreamRoom;
3
+ export { LiveStreamRoomProps };
@@ -0,0 +1,2 @@
1
+ import LiveStreamRoom from './LiveStreamRoom';
2
+ export default LiveStreamRoom;
@@ -0,0 +1,22 @@
1
+ import { LocalAudioTrack, LocalVideoTrack } from 'livekit-client';
2
+ import { VideoCodec } from 'livekit-client';
3
+ export interface SessionProps {
4
+ roomName: string;
5
+ identity: string;
6
+ audioTrack?: LocalAudioTrack;
7
+ videoTrack?: LocalVideoTrack;
8
+ region?: string;
9
+ turnServer?: RTCIceServer;
10
+ forceRelay?: boolean;
11
+ }
12
+ export interface TokenResult {
13
+ identity: string;
14
+ accessToken: string;
15
+ }
16
+ export declare function isVideoCodec(codec: string): codec is VideoCodec;
17
+ export type ConnectionDetails = {
18
+ serverUrl: string;
19
+ roomName: string;
20
+ participantName: string;
21
+ participantToken: string;
22
+ };
@@ -0,0 +1,4 @@
1
+ import { videoCodecs } from 'livekit-client';
2
+ export function isVideoCodec(codec) {
3
+ return videoCodecs.includes(codec);
4
+ }
@@ -1,6 +1,6 @@
1
1
  import { BoxProps } from '@mui/material';
2
2
  export declare const PREFIX = "SCDefaultDrawerSkeleton";
3
- export declare type DefaultDrawerSkeletonProps = BoxProps;
3
+ export type DefaultDrawerSkeletonProps = BoxProps;
4
4
  /**
5
5
  * > API documentation for the Community-JS Default Drawer Skeleton component. Learn about the available props and the CSS API.
6
6
 
@@ -1,3 +1,3 @@
1
1
  import { BoxProps } from '@mui/material';
2
- export declare type DefaultHeaderContentProps = BoxProps;
2
+ export type DefaultHeaderContentProps = BoxProps;
3
3
  export default function DefaultHeaderContent(inProps: DefaultHeaderContentProps): JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DrawerProps } from '@mui/material';
3
+ import { CreateLiveStreamButtonProps } from '../CreateLiveStreamButton';
3
4
  export interface NavigationMenuDrawerProps extends DrawerProps {
4
5
  /**
5
6
  * Hide drawer header
@@ -16,6 +17,16 @@ export interface NavigationMenuDrawerProps extends DrawerProps {
16
17
  * @default null
17
18
  */
18
19
  drawerContent?: React.ReactNode;
20
+ /**
21
+ * Hide drawer footer
22
+ * @default true
23
+ */
24
+ showDrawerFooter?: boolean;
25
+ /**
26
+ * Custom Drawer footer content
27
+ * @default null
28
+ */
29
+ drawerFooterContent?: React.ReactNode;
19
30
  /**
20
31
  * Props to spread to ScrollContainer component
21
32
  * This lib use 'react-custom-scrollbars' component to perform scrollbars
@@ -23,6 +34,11 @@ export interface NavigationMenuDrawerProps extends DrawerProps {
23
34
  * @default {}
24
35
  */
25
36
  ScrollContainerProps?: Record<string, any>;
37
+ /**
38
+ * Props to spread to CreateLiveStreamButton component
39
+ * @default {}
40
+ */
41
+ CreateLiveStreamButtonComponentProps?: CreateLiveStreamButtonProps;
26
42
  /**
27
43
  * Any other properties
28
44
  */
@@ -1,5 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useMemo } from 'react';
3
4
  import { styled } from '@mui/material/styles';
4
5
  import { Box, Divider, Drawer, Icon, IconButton, List } from '@mui/material';
5
6
  import classNames from 'classnames';
@@ -7,6 +8,8 @@ import { useThemeProps } from '@mui/system';
7
8
  import ScrollContainer from '../../shared/ScrollContainer';
8
9
  import DefaultDrawerContent from './DefaultDrawerContent';
9
10
  import DefaultHeaderContent from './DefaultHeaderContent';
11
+ import CreateLiveStreamButton from '../CreateLiveStreamButton';
12
+ import { useSCUser } from '@selfcommunity/react-core';
10
13
  const PREFIX = 'SCNavigationMenuDrawer';
11
14
  const classes = {
12
15
  root: `${PREFIX}-root`,
@@ -14,7 +17,10 @@ const classes = {
14
17
  drawerRoot: `${PREFIX}-drawer-root`,
15
18
  drawerHeader: `${PREFIX}-drawer-header`,
16
19
  drawerHeaderAction: `${PREFIX}-drawer-header-action`,
17
- drawerContent: `${PREFIX}-drawer-content`
20
+ drawerContent: `${PREFIX}-drawer-content`,
21
+ drawerFooter: `${PREFIX}-drawer-footer`,
22
+ drawerFooterLiveStream: `${PREFIX}-drawer-footer-live`,
23
+ drawerFooterLiveStreamButton: `${PREFIX}-drawer-footer-live-button`
18
24
  };
19
25
  const Root = styled(Drawer, {
20
26
  name: PREFIX,
@@ -22,11 +28,14 @@ const Root = styled(Drawer, {
22
28
  overridesResolver: (props, styles) => styles.root
23
29
  })(({ theme }) => ({}));
24
30
  export default function NavigationMenuDrawer(inProps) {
31
+ var _a;
25
32
  // PROPS
26
33
  const props = useThemeProps({
27
34
  props: inProps,
28
35
  name: PREFIX
29
36
  });
30
- const { className = null, showDrawerHeader = true, drawerHeaderContent = _jsx(DefaultHeaderContent, {}), drawerContent = _jsx(DefaultDrawerContent, {}), ScrollContainerProps = {}, open, onClose } = props, rest = __rest(props, ["className", "showDrawerHeader", "drawerHeaderContent", "drawerContent", "ScrollContainerProps", "open", "onClose"]);
31
- return (_jsxs(Root, Object.assign({ anchor: "left", className: classNames(classes.root, className), open: open, onClose: onClose }, rest, { children: [showDrawerHeader && (_jsxs(_Fragment, { children: [_jsxs(Box, Object.assign({ className: classes.drawerHeader }, { children: [drawerHeaderContent, _jsx(IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: onClose }, { children: _jsx(Icon, { children: "close" }) }))] })), _jsx(Divider, {})] })), _jsx(ScrollContainer, Object.assign({}, ScrollContainerProps, { children: _jsx(List, Object.assign({ className: classes.drawerContent, onClick: onClose }, { children: drawerContent })) }))] })));
37
+ const { className = null, showDrawerHeader = true, drawerHeaderContent = _jsx(DefaultHeaderContent, {}), drawerContent = _jsx(DefaultDrawerContent, {}), showDrawerFooterContent = true, drawerFooterContent = null, ScrollContainerProps = {}, CreateLiveStreamButtonComponentProps = {}, open, onClose } = props, rest = __rest(props, ["className", "showDrawerHeader", "drawerHeaderContent", "drawerContent", "showDrawerFooterContent", "drawerFooterContent", "ScrollContainerProps", "CreateLiveStreamButtonComponentProps", "open", "onClose"]);
38
+ const scUserContext = useSCUser();
39
+ const canCreateLiveStream = useMemo(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_livestream; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
40
+ return (_jsxs(Root, Object.assign({ anchor: "left", className: classNames(classes.root, className), open: open, onClose: onClose }, rest, { children: [showDrawerHeader && (_jsxs(_Fragment, { children: [_jsxs(Box, Object.assign({ className: classes.drawerHeader }, { children: [drawerHeaderContent, _jsx(IconButton, Object.assign({ className: classes.drawerHeaderAction, onClick: onClose }, { children: _jsx(Icon, { children: "close" }) }))] })), _jsx(Divider, {})] })), _jsx(ScrollContainer, Object.assign({}, ScrollContainerProps, { children: _jsx(List, Object.assign({ className: classes.drawerContent, onClick: onClose }, { children: drawerContent })) })), showDrawerFooterContent && (_jsx(_Fragment, { children: _jsx(Box, Object.assign({ className: classes.drawerFooter }, { children: drawerFooterContent ? (drawerFooterContent) : (_jsxs(_Fragment, { children: [canCreateLiveStream && _jsx(Divider, {}), _jsx(Box, Object.assign({ className: classes.drawerFooterLiveStream }, { children: _jsx(CreateLiveStreamButton, Object.assign({ color: "primary", className: classes.drawerFooterLiveStreamButton, fullWidth: true }, CreateLiveStreamButtonComponentProps)) }))] })) })) }))] })));
32
41
  }
@@ -0,0 +1,15 @@
1
+ import { SCNotificationLiveStreamActivityType } from '@selfcommunity/types';
2
+ import { NotificationItemProps } from '../../../shared/NotificationItem';
3
+ export interface NotificationLiveStreamProps extends Pick<NotificationItemProps, Exclude<keyof NotificationItemProps, 'image' | 'disableTypography' | 'primary' | 'primaryTypographyProps' | 'secondary' | 'secondaryTypographyProps' | 'actions' | 'footer' | 'isNew'>> {
4
+ /**
5
+ * Notification obj
6
+ * @default null
7
+ */
8
+ notificationObject: SCNotificationLiveStreamActivityType;
9
+ }
10
+ /**
11
+ * This component render the content of the notification of type live stream
12
+ * @constructor
13
+ * @param props
14
+ */
15
+ export default function LiveStreamNotification(props: NotificationLiveStreamProps): JSX.Element;
@@ -0,0 +1,72 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useState } from 'react';
4
+ import { styled } from '@mui/material/styles';
5
+ import { Avatar, Box, Icon, Stack, Typography } from '@mui/material';
6
+ import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
7
+ import { FormattedMessage } from 'react-intl';
8
+ import DateTimeAgo from '../../../shared/DateTimeAgo';
9
+ import classNames from 'classnames';
10
+ import { SCNotificationObjectTemplateType } from '../../../types';
11
+ import NotificationItem from '../../../shared/NotificationItem';
12
+ import { LoadingButton } from '@mui/lab';
13
+ import UserDeletedSnackBar from '../../../shared/UserDeletedSnackBar';
14
+ import UserAvatar from '../../../shared/UserAvatar';
15
+ import { PREFIX } from '../constants';
16
+ import LiveStream from '../../LiveStream';
17
+ const classes = {
18
+ root: `${PREFIX}-live-root`,
19
+ avatar: `${PREFIX}-avatar`,
20
+ actions: `${PREFIX}-actions`,
21
+ seeButton: `${PREFIX}see-button`,
22
+ activeAt: `${PREFIX}-active-at`,
23
+ snippetTime: `${PREFIX}-snippet-time`,
24
+ username: `${PREFIX}-username`
25
+ };
26
+ const Root = styled(NotificationItem, {
27
+ name: PREFIX,
28
+ slot: 'LiveStreamRoot'
29
+ })(() => ({}));
30
+ /**
31
+ * This component render the content of the notification of type live stream
32
+ * @constructor
33
+ * @param props
34
+ */
35
+ export default function LiveStreamNotification(props) {
36
+ // PROPS
37
+ const { notificationObject, id = `n_${props.notificationObject['sid']}`, className, template = SCNotificationObjectTemplateType.DETAIL } = props, rest = __rest(props, ["notificationObject", "id", "className", "template"]);
38
+ // CONTEXT
39
+ const scRoutingContext = useSCRouting();
40
+ // STATE
41
+ const [openAlert, setOpenAlert] = useState(false);
42
+ // CONST
43
+ const isSnippetTemplate = template === SCNotificationObjectTemplateType.SNIPPET;
44
+ const isToastTemplate = template === SCNotificationObjectTemplateType.TOAST;
45
+ const inProgress = Boolean(!notificationObject.live_stream.closed_at_by_host &&
46
+ notificationObject.live_stream.last_started_at &&
47
+ !notificationObject.live_stream.last_finished_at);
48
+ // RENDER
49
+ if (isSnippetTemplate) {
50
+ return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.live_stream.host.deleted && {
51
+ to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.live_stream.host)
52
+ }), { onClick: notificationObject.live_stream.host.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !notificationObject.live_stream.host.community_badge, smaller: true }, { children: _jsx(Avatar, { alt: notificationObject.live_stream.host.username, variant: "circular", src: notificationObject.live_stream.host.avatar, classes: { root: classes.avatar } }) })) })), primary: _jsxs(Box, { children: [_jsx(Link, Object.assign({}, (!notificationObject.live_stream.host.deleted && {
53
+ to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.live_stream.host)
54
+ }), { onClick: notificationObject.live_stream.host.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.live_stream.host.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.${notificationObject.type}.title`, defaultMessage: `ui.notification.${notificationObject.type}.title`, values: {
55
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
56
+ // @ts-ignore
57
+ icon: (...chunks) => _jsx(Icon, { children: chunks }),
58
+ live: notificationObject.live_stream.title,
59
+ link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: chunks }))
60
+ } })] }), footer: isToastTemplate ? (_jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at }), _jsx(Typography, Object.assign({ color: "primary" }, { children: _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: _jsx(FormattedMessage, { id: "ui.notification.live_stream_started.join", defaultMessage: "ui.notification.live_stream_started.join" }) })) }))] }))) : (_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.snippetTime })) }, rest)));
61
+ }
62
+ return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: _jsx(Link, Object.assign({}, (!notificationObject.live_stream.host.deleted && {
63
+ to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.live_stream.host)
64
+ }), { onClick: notificationObject.live_stream.host.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !notificationObject.live_stream.host.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, alt: notificationObject.live_stream.host.username, variant: "circular", src: notificationObject.live_stream.host.avatar }) })) })), primary: _jsxs(_Fragment, { children: [_jsx(Link, Object.assign({}, (!notificationObject.live_stream.host.deleted && {
65
+ to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject.live_stream.host)
66
+ }), { onClick: notificationObject.live_stream.host.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: notificationObject.live_stream.host.username })), ' ', _jsx(FormattedMessage, { id: `ui.notification.${notificationObject.type}`, defaultMessage: `ui.notification.${notificationObject.type}`, values: {
67
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
68
+ // @ts-ignore
69
+ live: notificationObject.live_stream.title,
70
+ link: (...chunks) => _jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: chunks }))
71
+ } }), _jsx(LiveStream, { liveStream: notificationObject.live_stream, hideInProgress: !inProgress, actions: _jsx(_Fragment, {}), elevation: 0 })] }), actions: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [_jsx(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt }), _jsx(LoadingButton, Object.assign({ color: 'primary', variant: "outlined", size: "small", classes: { root: classes.seeButton }, component: Link, disabled: Boolean(notificationObject.live_stream.closed_at_by_host), to: scRoutingContext.url(SCRoutes.LIVESTREAM_ROUTE_NAME, notificationObject.live_stream) }, { children: _jsx(FormattedMessage, { id: "ui.notification.live_stream_started.join", defaultMessage: "ui.notification.live_stream_started.join" }) }))] })) }, rest)), openAlert && _jsx(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })] }));
72
+ }
@@ -0,0 +1,3 @@
1
+ import LiveStreamNotification, { NotificationLiveStreamProps } from './LiveStream';
2
+ export default LiveStreamNotification;
3
+ export { NotificationLiveStreamProps };
@@ -0,0 +1,2 @@
1
+ import LiveStreamNotification from './LiveStream';
2
+ export default LiveStreamNotification;
@@ -16,6 +16,8 @@ import KindlyNoticeForNotification from './KindlyNoticeFor';
16
16
  import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
17
17
  import KindlyNoticeFlagNotification from './KindlyNoticeFlag';
18
18
  import VoteUpNotification from './VoteUp';
19
+ import EventNotification from './Event/Event';
20
+ import LiveStreamNotification from './LiveStream/LiveStream';
19
21
  import Icon from '@mui/material/Icon';
20
22
  import { SCOPE_SC_UI } from '../../constants/Errors';
21
23
  import { getContribution, getContributionRouteName, getContributionSnippet, getRouteData } from '../../utils/contribution';
@@ -35,7 +37,6 @@ import UserDeletedSnackBar from '../../shared/UserDeletedSnackBar';
35
37
  import UserAvatar from '../../shared/UserAvatar';
36
38
  import { PREFIX } from './constants';
37
39
  import GroupNotification from './Group';
38
- import EventNotification from './Event/Event';
39
40
  const messages = defineMessages({
40
41
  receivePrivateMessage: {
41
42
  id: 'ui.notification.receivePrivateMessage',
@@ -306,6 +307,9 @@ export default function UserNotification(inProps) {
306
307
  n.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_EVENT) {
307
308
  return _jsx(EventNotification, { notificationObject: n }, i);
308
309
  }
310
+ else if (n.type === SCNotificationTypologyType.LIVE_STREAM_STARTED) {
311
+ return _jsx(LiveStreamNotification, { notificationObject: n }, i);
312
+ }
309
313
  return null;
310
314
  }
311
315
  /**