@selfcommunity/react-ui 0.8.0-embeds.17 → 0.8.0-live.41

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 (317) hide show
  1. package/lib/cjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  2. package/lib/cjs/components/Categories/Categories.js +22 -0
  3. package/lib/cjs/components/CategoriesPopularWidget/CategoriesPopularWidget.js +21 -0
  4. package/lib/cjs/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +21 -0
  5. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +1 -1
  6. package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +2 -2
  7. package/lib/cjs/components/CreateEventButton/CreateEventButton.js +4 -4
  8. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +49 -0
  9. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +94 -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 +51 -0
  13. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +123 -0
  14. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +46 -0
  15. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +166 -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/EditEventButton/EditEventButton.js +1 -1
  23. package/lib/cjs/components/Editor/Editor.d.ts +1 -1
  24. package/lib/cjs/components/Editor/nodes/HashtagNode.d.ts +1 -1
  25. package/lib/cjs/components/Editor/nodes/HashtagNode.js +4 -4
  26. package/lib/cjs/components/Editor/nodes/ImageNode.d.ts +1 -1
  27. package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -6
  28. package/lib/cjs/components/Editor/nodes/MentionNode.d.ts +1 -1
  29. package/lib/cjs/components/Editor/nodes/MentionNode.js +4 -4
  30. package/lib/cjs/components/Editor/plugins/ApiPlugin.d.ts +1 -1
  31. package/lib/cjs/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
  32. package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
  33. package/lib/cjs/components/Event/Event.js +1 -1
  34. package/lib/cjs/components/EventForm/EventForm.d.ts +7 -12
  35. package/lib/cjs/components/EventForm/EventForm.js +55 -55
  36. package/lib/cjs/components/EventForm/types.d.ts +5 -5
  37. package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +48 -0
  38. package/lib/cjs/components/EventFormDialog/EventFormDialog.js +56 -0
  39. package/lib/cjs/components/EventFormDialog/constants.d.ts +1 -0
  40. package/lib/cjs/components/EventFormDialog/constants.js +4 -0
  41. package/lib/cjs/components/EventFormDialog/index.d.ts +3 -0
  42. package/lib/cjs/components/EventFormDialog/index.js +5 -0
  43. package/lib/cjs/components/EventHeader/EventHeader.js +3 -7
  44. package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +6 -4
  45. package/lib/cjs/components/EventMediaWidget/EventMediaWidget.d.ts +41 -0
  46. package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +253 -0
  47. package/lib/cjs/components/EventMediaWidget/Skeleton.d.ts +2 -0
  48. package/lib/cjs/components/EventMediaWidget/Skeleton.js +28 -0
  49. package/lib/cjs/components/EventMediaWidget/TriggerButton.d.ts +17 -0
  50. package/lib/cjs/components/EventMediaWidget/TriggerButton.js +66 -0
  51. package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +7 -0
  52. package/lib/cjs/components/EventMediaWidget/asUploadButton.js +25 -0
  53. package/lib/cjs/components/EventMediaWidget/constants.d.ts +1 -0
  54. package/lib/cjs/components/EventMediaWidget/constants.js +4 -0
  55. package/lib/cjs/components/EventMediaWidget/index.d.ts +4 -0
  56. package/lib/cjs/components/EventMediaWidget/index.js +8 -0
  57. package/lib/cjs/components/EventMembersWidget/EventMembersWidget.d.ts +3 -0
  58. package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +18 -13
  59. package/lib/cjs/components/EventMembersWidget/types.d.ts +1 -1
  60. package/lib/cjs/components/Events/Events.js +15 -6
  61. package/lib/cjs/components/Events/LocationEventsFilter.d.ts +14 -0
  62. package/lib/cjs/components/Events/LocationEventsFilter.js +45 -0
  63. package/lib/cjs/components/Events/PastEventsFilter.js +1 -2
  64. package/lib/cjs/components/Feed/Feed.d.ts +2 -2
  65. package/lib/cjs/components/Feed/Feed.js +3 -2
  66. package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
  67. package/lib/cjs/components/GroupActionsMenu/index.d.ts +57 -0
  68. package/lib/cjs/components/GroupActionsMenu/index.js +157 -0
  69. package/lib/cjs/components/GroupHeader/GroupHeader.d.ts +6 -0
  70. package/lib/cjs/components/GroupHeader/GroupHeader.js +8 -4
  71. package/lib/cjs/components/Groups/Groups.js +26 -0
  72. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
  73. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +156 -0
  74. package/lib/cjs/components/LiveStreamForm/constants.d.ts +1 -0
  75. package/lib/cjs/components/LiveStreamForm/constants.js +4 -0
  76. package/lib/cjs/components/LiveStreamForm/index.d.ts +3 -0
  77. package/lib/cjs/components/LiveStreamForm/index.js +5 -0
  78. package/lib/cjs/components/LiveStreamForm/types.d.ts +10 -0
  79. package/lib/cjs/components/LiveStreamForm/types.js +2 -0
  80. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.d.ts +48 -0
  81. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +123 -0
  82. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +69 -0
  83. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +186 -0
  84. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +4 -0
  85. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +31 -0
  86. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +1 -0
  87. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +4 -0
  88. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/index.d.ts +3 -0
  89. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/index.js +5 -0
  90. package/lib/cjs/components/LiveStreamRoom/constants.d.ts +5 -0
  91. package/lib/cjs/components/LiveStreamRoom/constants.js +8 -0
  92. package/lib/cjs/components/LiveStreamRoom/index.d.ts +3 -0
  93. package/lib/cjs/components/LiveStreamRoom/index.js +5 -0
  94. package/lib/cjs/components/LiveStreamRoom/types.d.ts +22 -0
  95. package/lib/cjs/components/LiveStreamRoom/types.js +8 -0
  96. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +1 -1
  97. package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
  98. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +47 -0
  99. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +39 -0
  100. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +9 -20
  101. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.js +4 -20
  102. package/lib/cjs/components/NavigationMenuIconButton/index.d.ts +2 -1
  103. package/lib/cjs/components/NavigationMenuIconButton/index.js +3 -1
  104. package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +35 -2
  105. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +5 -0
  106. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +3 -3
  107. package/lib/cjs/components/OnBoardingWidget/ActionsButton.d.ts +7 -0
  108. package/lib/cjs/components/OnBoardingWidget/ActionsButton.js +84 -0
  109. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.d.ts +5 -1
  110. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +96 -23
  111. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +23 -16
  112. package/lib/cjs/components/OnBoardingWidget/Steps/Invite/Invite.js +56 -12
  113. package/lib/cjs/components/PlatformWidget/constants.d.ts +0 -4
  114. package/lib/cjs/components/PlatformWidget/constants.js +1 -5
  115. package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
  116. package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +1 -3
  117. package/lib/cjs/constants/GroupActionsMenu.d.ts +5 -0
  118. package/lib/cjs/constants/GroupActionsMenu.js +8 -0
  119. package/lib/cjs/constants/LiveStream.d.ts +3 -0
  120. package/lib/cjs/constants/LiveStream.js +6 -0
  121. package/lib/cjs/constants/PubSub.d.ts +8 -1
  122. package/lib/cjs/constants/PubSub.js +9 -1
  123. package/lib/cjs/index.d.ts +15 -4
  124. package/lib/cjs/index.js +35 -9
  125. package/lib/cjs/shared/EventActionsMenu/index.d.ts +1 -1
  126. package/lib/cjs/shared/EventActionsMenu/index.js +11 -15
  127. package/lib/cjs/shared/EventInfoDetails/index.js +3 -3
  128. package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
  129. package/lib/cjs/shared/InfiniteScroll/index.js +4 -4
  130. package/lib/cjs/shared/Lightbox/BaseLightbox.d.ts +19 -0
  131. package/lib/cjs/shared/Lightbox/BaseLightbox.js +35 -0
  132. package/lib/cjs/shared/Lightbox/Lightbox.d.ts +31 -17
  133. package/lib/cjs/shared/Lightbox/Lightbox.js +16 -19
  134. package/lib/cjs/shared/Lightbox/constants.d.ts +1 -0
  135. package/lib/cjs/shared/Lightbox/constants.js +4 -0
  136. package/lib/cjs/shared/Lightbox/index.d.ts +4 -2
  137. package/lib/cjs/shared/Lightbox/index.js +4 -1
  138. package/lib/cjs/shared/Media/File/DisplayComponent.js +23 -6
  139. package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
  140. package/lib/cjs/shared/Media/Link/DisplayComponent.js +5 -5
  141. package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
  142. package/lib/cjs/shared/MediaChunkUploader/index.js +13 -11
  143. package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
  144. package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
  145. package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
  146. package/lib/cjs/types/composer.d.ts +1 -1
  147. package/lib/cjs/utils/events.d.ts +2 -0
  148. package/lib/cjs/utils/events.js +10 -0
  149. package/lib/cjs/utils/hash.d.ts +2 -1
  150. package/lib/cjs/utils/liveStream.d.ts +4 -0
  151. package/lib/cjs/utils/liveStream.js +25 -0
  152. package/lib/cjs/utils/widget.d.ts +1 -0
  153. package/lib/cjs/utils/widget.js +14 -0
  154. package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  155. package/lib/esm/components/Categories/Categories.js +23 -1
  156. package/lib/esm/components/CategoriesPopularWidget/CategoriesPopularWidget.js +22 -1
  157. package/lib/esm/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +22 -1
  158. package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +2 -2
  159. package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +2 -2
  160. package/lib/esm/components/CreateEventButton/CreateEventButton.js +4 -4
  161. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +49 -0
  162. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +91 -0
  163. package/lib/esm/components/CreateLiveStreamButton/index.d.ts +3 -0
  164. package/lib/esm/components/CreateLiveStreamButton/index.js +2 -0
  165. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +51 -0
  166. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +120 -0
  167. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.d.ts +46 -0
  168. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +163 -0
  169. package/lib/esm/components/CreateLiveStreamDialog/constants.d.ts +1 -0
  170. package/lib/esm/components/CreateLiveStreamDialog/constants.js +1 -0
  171. package/lib/esm/components/CreateLiveStreamDialog/index.d.ts +3 -0
  172. package/lib/esm/components/CreateLiveStreamDialog/index.js +2 -0
  173. package/lib/esm/components/CreateLiveStreamDialog/types.d.ts +8 -0
  174. package/lib/esm/components/CreateLiveStreamDialog/types.js +10 -0
  175. package/lib/esm/components/EditEventButton/EditEventButton.js +1 -1
  176. package/lib/esm/components/Editor/Editor.d.ts +1 -1
  177. package/lib/esm/components/Editor/nodes/HashtagNode.d.ts +1 -1
  178. package/lib/esm/components/Editor/nodes/HashtagNode.js +4 -4
  179. package/lib/esm/components/Editor/nodes/ImageNode.d.ts +1 -1
  180. package/lib/esm/components/Editor/nodes/ImageNode.js +6 -6
  181. package/lib/esm/components/Editor/nodes/MentionNode.d.ts +1 -1
  182. package/lib/esm/components/Editor/nodes/MentionNode.js +4 -4
  183. package/lib/esm/components/Editor/plugins/ApiPlugin.d.ts +1 -1
  184. package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
  185. package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
  186. package/lib/esm/components/Event/Event.js +1 -1
  187. package/lib/esm/components/EventForm/EventForm.d.ts +7 -12
  188. package/lib/esm/components/EventForm/EventForm.js +56 -56
  189. package/lib/esm/components/EventForm/types.d.ts +5 -5
  190. package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +48 -0
  191. package/lib/esm/components/EventFormDialog/EventFormDialog.js +53 -0
  192. package/lib/esm/components/EventFormDialog/constants.d.ts +1 -0
  193. package/lib/esm/components/EventFormDialog/constants.js +1 -0
  194. package/lib/esm/components/EventFormDialog/index.d.ts +3 -0
  195. package/lib/esm/components/EventFormDialog/index.js +2 -0
  196. package/lib/esm/components/EventHeader/EventHeader.js +3 -7
  197. package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +6 -4
  198. package/lib/esm/components/EventMediaWidget/EventMediaWidget.d.ts +41 -0
  199. package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +250 -0
  200. package/lib/esm/components/EventMediaWidget/Skeleton.d.ts +2 -0
  201. package/lib/esm/components/EventMediaWidget/Skeleton.js +22 -0
  202. package/lib/esm/components/EventMediaWidget/TriggerButton.d.ts +17 -0
  203. package/lib/esm/components/EventMediaWidget/TriggerButton.js +64 -0
  204. package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +7 -0
  205. package/lib/esm/components/EventMediaWidget/asUploadButton.js +23 -0
  206. package/lib/esm/components/EventMediaWidget/constants.d.ts +1 -0
  207. package/lib/esm/components/EventMediaWidget/constants.js +1 -0
  208. package/lib/esm/components/EventMediaWidget/index.d.ts +4 -0
  209. package/lib/esm/components/EventMediaWidget/index.js +4 -0
  210. package/lib/esm/components/EventMembersWidget/EventMembersWidget.d.ts +3 -0
  211. package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +18 -13
  212. package/lib/esm/components/EventMembersWidget/types.d.ts +1 -1
  213. package/lib/esm/components/Events/Events.js +16 -7
  214. package/lib/esm/components/Events/LocationEventsFilter.d.ts +14 -0
  215. package/lib/esm/components/Events/LocationEventsFilter.js +41 -0
  216. package/lib/esm/components/Events/PastEventsFilter.js +1 -2
  217. package/lib/esm/components/Feed/Feed.d.ts +2 -2
  218. package/lib/esm/components/Feed/Feed.js +4 -3
  219. package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
  220. package/lib/esm/components/GroupActionsMenu/index.d.ts +57 -0
  221. package/lib/esm/components/GroupActionsMenu/index.js +154 -0
  222. package/lib/esm/components/GroupHeader/GroupHeader.d.ts +6 -0
  223. package/lib/esm/components/GroupHeader/GroupHeader.js +9 -5
  224. package/lib/esm/components/Groups/Groups.js +27 -1
  225. package/lib/esm/components/LiveStreamForm/LiveStreamForm.d.ts +55 -0
  226. package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +153 -0
  227. package/lib/esm/components/LiveStreamForm/constants.d.ts +1 -0
  228. package/lib/esm/components/LiveStreamForm/constants.js +1 -0
  229. package/lib/esm/components/LiveStreamForm/index.d.ts +3 -0
  230. package/lib/esm/components/LiveStreamForm/index.js +2 -0
  231. package/lib/esm/components/LiveStreamForm/types.d.ts +10 -0
  232. package/lib/esm/components/LiveStreamForm/types.js +1 -0
  233. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.d.ts +48 -0
  234. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +120 -0
  235. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.d.ts +69 -0
  236. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamVideoConference.js +183 -0
  237. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.d.ts +4 -0
  238. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/RecordingIndicator.js +28 -0
  239. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.d.ts +1 -0
  240. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/constants.js +1 -0
  241. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/index.d.ts +3 -0
  242. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/index.js +2 -0
  243. package/lib/esm/components/LiveStreamRoom/constants.d.ts +5 -0
  244. package/lib/esm/components/LiveStreamRoom/constants.js +5 -0
  245. package/lib/esm/components/LiveStreamRoom/index.d.ts +3 -0
  246. package/lib/esm/components/LiveStreamRoom/index.js +2 -0
  247. package/lib/esm/components/LiveStreamRoom/types.d.ts +22 -0
  248. package/lib/esm/components/LiveStreamRoom/types.js +4 -0
  249. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +2 -2
  250. package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
  251. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +47 -0
  252. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +36 -0
  253. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +9 -20
  254. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +6 -22
  255. package/lib/esm/components/NavigationMenuIconButton/index.d.ts +2 -1
  256. package/lib/esm/components/NavigationMenuIconButton/index.js +2 -1
  257. package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +38 -5
  258. package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +5 -0
  259. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +3 -3
  260. package/lib/esm/components/OnBoardingWidget/ActionsButton.d.ts +7 -0
  261. package/lib/esm/components/OnBoardingWidget/ActionsButton.js +81 -0
  262. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.d.ts +5 -1
  263. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +99 -26
  264. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +24 -17
  265. package/lib/esm/components/OnBoardingWidget/Steps/Invite/Invite.js +59 -14
  266. package/lib/esm/components/PlatformWidget/constants.d.ts +0 -4
  267. package/lib/esm/components/PlatformWidget/constants.js +0 -4
  268. package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
  269. package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +1 -3
  270. package/lib/esm/constants/GroupActionsMenu.d.ts +5 -0
  271. package/lib/esm/constants/GroupActionsMenu.js +5 -0
  272. package/lib/esm/constants/LiveStream.d.ts +3 -0
  273. package/lib/esm/constants/LiveStream.js +3 -0
  274. package/lib/esm/constants/PubSub.d.ts +8 -1
  275. package/lib/esm/constants/PubSub.js +8 -0
  276. package/lib/esm/index.d.ts +15 -4
  277. package/lib/esm/index.js +17 -7
  278. package/lib/esm/shared/EventActionsMenu/index.d.ts +1 -1
  279. package/lib/esm/shared/EventActionsMenu/index.js +11 -15
  280. package/lib/esm/shared/EventInfoDetails/index.js +3 -3
  281. package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
  282. package/lib/esm/shared/InfiniteScroll/index.js +4 -4
  283. package/lib/esm/shared/Lightbox/BaseLightbox.d.ts +19 -0
  284. package/lib/esm/shared/Lightbox/BaseLightbox.js +33 -0
  285. package/lib/esm/shared/Lightbox/Lightbox.d.ts +31 -17
  286. package/lib/esm/shared/Lightbox/Lightbox.js +15 -19
  287. package/lib/esm/shared/Lightbox/constants.d.ts +1 -0
  288. package/lib/esm/shared/Lightbox/constants.js +1 -0
  289. package/lib/esm/shared/Lightbox/index.d.ts +4 -2
  290. package/lib/esm/shared/Lightbox/index.js +3 -1
  291. package/lib/esm/shared/Media/File/DisplayComponent.js +23 -6
  292. package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
  293. package/lib/esm/shared/Media/Link/DisplayComponent.js +5 -5
  294. package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
  295. package/lib/esm/shared/MediaChunkUploader/index.js +14 -12
  296. package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
  297. package/lib/esm/shared/StickyBox/index.d.ts +4 -4
  298. package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
  299. package/lib/esm/types/composer.d.ts +1 -1
  300. package/lib/esm/utils/events.d.ts +2 -0
  301. package/lib/esm/utils/events.js +6 -0
  302. package/lib/esm/utils/hash.d.ts +2 -1
  303. package/lib/esm/utils/liveStream.d.ts +4 -0
  304. package/lib/esm/utils/liveStream.js +18 -0
  305. package/lib/esm/utils/widget.d.ts +1 -0
  306. package/lib/esm/utils/widget.js +14 -0
  307. package/lib/umd/245.js +1 -0
  308. package/lib/umd/43.js +2 -0
  309. package/lib/umd/react-ui.js +1 -1
  310. package/lib/umd/react-ui.js.LICENSE.txt +2 -0
  311. package/package.json +22 -10
  312. package/lib/cjs/shared/Media/File/Lightbox/index.d.ts +0 -28
  313. package/lib/cjs/shared/Media/File/Lightbox/index.js +0 -37
  314. package/lib/esm/shared/Media/File/Lightbox/index.d.ts +0 -28
  315. package/lib/esm/shared/Media/File/Lightbox/index.js +0 -34
  316. package/lib/umd/99.js +0 -2
  317. /package/lib/umd/{99.js.LICENSE.txt → 43.js.LICENSE.txt} +0 -0
@@ -0,0 +1,153 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { LoadingButton } from '@mui/lab';
4
+ import { Box, FormGroup, TextField, Typography } from '@mui/material';
5
+ import { styled } from '@mui/material/styles';
6
+ import { useThemeProps } from '@mui/system';
7
+ import { EventService, formatHttpErrorCode } from '@selfcommunity/api-services';
8
+ import { SCPreferences, useSCContext, useSCPreferences } from '@selfcommunity/react-core';
9
+ import { Logger } from '@selfcommunity/utils';
10
+ import classNames from 'classnames';
11
+ import { useCallback, useMemo, useState } from 'react';
12
+ import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
13
+ import { SCOPE_SC_UI } from '../../constants/Errors';
14
+ import { LIVE_STREAM_DESCRIPTION_MAX_LENGTH, LIVE_STREAM_TITLE_MAX_LENGTH, LIVE_STREAM_SLUG_MAX_LENGTH } from '../../constants/LiveStream';
15
+ import { PREFIX } from './constants';
16
+ const classes = {
17
+ root: `${PREFIX}-root`,
18
+ form: `${PREFIX}-form`,
19
+ title: `${PREFIX}-title`,
20
+ slug: `${PREFIX}-slug`,
21
+ description: `${PREFIX}-description`,
22
+ content: `${PREFIX}-content`,
23
+ actions: `${PREFIX}-actions`,
24
+ error: `${PREFIX}-error`
25
+ };
26
+ const Root = styled(Box, {
27
+ name: PREFIX,
28
+ slot: 'Root'
29
+ })(({ theme }) => ({}));
30
+ const messages = defineMessages({
31
+ title: {
32
+ id: 'ui.liveStreamForm.title.placeholder',
33
+ defaultMessage: 'ui.liveStreamForm.title.placeholder'
34
+ },
35
+ slug: {
36
+ id: 'ui.liveStreamForm.slug.placeholder',
37
+ defaultMessage: 'ui.liveStreamForm.slug.placeholder'
38
+ },
39
+ description: {
40
+ id: 'ui.liveStreamForm.description.placeholder',
41
+ defaultMessage: 'ui.liveStreamForm.description.placeholder'
42
+ }
43
+ });
44
+ /**
45
+ *> API documentation for the Community-JS LiveStreamForm component. Learn about the available props and the CSS API.
46
+ *
47
+ #### Import
48
+ ```jsx
49
+ import {LiveStreamForm} from '@selfcommunity/react-ui';
50
+ ```
51
+
52
+ #### Component Name
53
+ The name `LiveStreamForm` can be used when providing style overrides in the theme.
54
+
55
+ #### CSS
56
+
57
+ |Rule Name|Global class|Description|
58
+ |---|---|---|
59
+ |root|.SCLiveStreamForm-root|Styles applied to the root element.|
60
+ |title|.SCLiveStreamForm-title|Styles applied to the title element.|
61
+ |cover|.SCLiveStreamForm-cover|Styles applied to the cover field.|
62
+ |form|.SCLiveStreamForm-form|Styles applied to the form element.|
63
+ |name|.SCLiveStreamForm-name|Styles applied to the name field.|
64
+ |description|.SCLiveStreamForm-description|Styles applied to the description field.|
65
+ |content|.SCLiveStreamForm-content|Styles applied to the element.|
66
+ |error|.SCLiveStreamForm-error|Styles applied to the error elements.|
67
+
68
+ * @param inProps
69
+ */
70
+ export default function LiveStreamForm(inProps) {
71
+ var _a, _b, _c;
72
+ //PROPS
73
+ const props = useThemeProps({
74
+ props: inProps,
75
+ name: PREFIX
76
+ });
77
+ const { className, onSuccess, onError, liveStream = null } = props, rest = __rest(props, ["className", "onSuccess", "onError", "liveStream"]);
78
+ // CONTEXT
79
+ const scContext = useSCContext();
80
+ // INTL
81
+ const intl = useIntl();
82
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
83
+ // @ts-ignore
84
+ const initialFieldState = {
85
+ title: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.title) || '',
86
+ description: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.description) || '',
87
+ slug: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.slug) || '',
88
+ cover: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.cover) || '',
89
+ isSubmitting: false
90
+ };
91
+ // STATE
92
+ const [field, setField] = useState(initialFieldState);
93
+ const [error, setError] = useState({});
94
+ // PREFERENCES
95
+ const scPreferences = useSCPreferences();
96
+ const privateEnabled = useMemo(() => scPreferences.preferences[SCPreferences.CONFIGURATIONS_EVENTS_PRIVATE_ENABLED].value, [scPreferences.preferences]);
97
+ const visibilityEnabled = useMemo(() => scPreferences.preferences[SCPreferences.CONFIGURATIONS_EVENTS_VISIBILITY_ENABLED].value, [scPreferences.preferences]);
98
+ const handleSubmit = useCallback(() => {
99
+ setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: true })));
100
+ const formData = new FormData();
101
+ if (visibilityEnabled) {
102
+ formData.append('visible', 'true');
103
+ }
104
+ formData.append('description', field.description);
105
+ let eventService;
106
+ if (liveStream) {
107
+ eventService = EventService.updateEvent(liveStream.id, formData, { headers: { 'Content-Type': 'multipart/form-data' } });
108
+ }
109
+ else {
110
+ eventService = EventService.createEvent(formData, { headers: { 'Content-Type': 'multipart/form-data' } });
111
+ }
112
+ eventService
113
+ .then((data) => {
114
+ setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
115
+ // onSuccess?.(data);
116
+ })
117
+ .catch((e) => {
118
+ const _error = formatHttpErrorCode(e);
119
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
120
+ // @ts-ignore
121
+ if (Object.values(_error)[0].error === 'unique') {
122
+ setError(Object.assign(Object.assign({}, error), { ['titleError']: _jsx(FormattedMessage, { id: "ui.liveStreamForm.title.error.unique", defaultMessage: "ui.liveStreamForm.title.error.unique" }) }));
123
+ }
124
+ else {
125
+ setError(Object.assign(Object.assign({}, error), _error));
126
+ }
127
+ setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
128
+ Logger.error(SCOPE_SC_UI, e);
129
+ onError === null || onError === void 0 ? void 0 : onError(e);
130
+ });
131
+ }, [field, privateEnabled, visibilityEnabled, onSuccess, onError]);
132
+ const handleChange = useCallback((event) => {
133
+ const { name, value } = event.target;
134
+ setField((prev) => (Object.assign(Object.assign({}, prev), { [name]: value })));
135
+ if (error[`${name}Error`]) {
136
+ delete error[`${name}Error`];
137
+ setError(error);
138
+ }
139
+ }, [error]);
140
+ /**
141
+ * Renders root object
142
+ */
143
+ return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(FormGroup, Object.assign({ className: classes.form }, { children: [_jsx(TextField, { required: true, className: classes.title, placeholder: `${intl.formatMessage(messages.title)}`, margin: "normal", value: field.title, name: "title", onChange: handleChange, InputProps: {
144
+ endAdornment: _jsx(Typography, Object.assign({ variant: "body2" }, { children: LIVE_STREAM_TITLE_MAX_LENGTH - field.title.length }))
145
+ }, error: Boolean(field.title.length > LIVE_STREAM_TITLE_MAX_LENGTH) || Boolean(error['titleError']), helperText: field.title.length > LIVE_STREAM_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.liveStreamForm.title.error.maxLength", defaultMessage: "ui.liveStreamForm.title.error.maxLength" })) : error['titleError'] ? (error['titleError']) : null }), _jsx(TextField, { required: true, className: classes.slug, placeholder: `${intl.formatMessage(messages.slug)}`, margin: "normal", value: field.slug, name: "slug", onChange: handleChange, InputProps: {
146
+ endAdornment: _jsx(Typography, Object.assign({ variant: "body2" }, { children: LIVE_STREAM_SLUG_MAX_LENGTH - field.title.length }))
147
+ }, error: Boolean(field.slug.length > LIVE_STREAM_SLUG_MAX_LENGTH) || Boolean(error['nameError']), helperText: field.title.length > LIVE_STREAM_SLUG_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.liveStreamForm.slug.error.maxLength", defaultMessage: "ui.liveStreamForm.slug.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), _jsx(TextField, { multiline: true, rows: 4, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
148
+ endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_a = field.description) === null || _a === void 0 ? void 0 : _a.length) ? LIVE_STREAM_DESCRIPTION_MAX_LENGTH - field.description.length : LIVE_STREAM_DESCRIPTION_MAX_LENGTH })))
149
+ }, error: Boolean(((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) > LIVE_STREAM_DESCRIPTION_MAX_LENGTH), helperText: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > LIVE_STREAM_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.liveStreamForm.description.error.maxLength", defaultMessage: "ui.liveStreamForm.description.error.maxLength" })) : null }), _jsx(Box, Object.assign({ className: classes.actions }, { children: _jsx(LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.title ||
150
+ Object.keys(error).length !== 0 ||
151
+ field.title.length > LIVE_STREAM_TITLE_MAX_LENGTH ||
152
+ field.description.length > LIVE_STREAM_DESCRIPTION_MAX_LENGTH, variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: liveStream ? (_jsx(FormattedMessage, { id: "ui.liveStreamForm.button.edit", defaultMessage: "ui.liveStreamForm.button.edit" })) : (_jsx(FormattedMessage, { id: "ui.liveStreamForm.button.create", defaultMessage: "ui.liveStreamForm.button.create" })) })) }))] })) })));
153
+ }
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCLiveStreamForm";
@@ -0,0 +1 @@
1
+ export const PREFIX = 'SCLiveStreamForm';
@@ -0,0 +1,3 @@
1
+ import LiveStreamForm, { LiveStreamFormProps } from './LiveStreamForm';
2
+ export default LiveStreamForm;
3
+ export { LiveStreamFormProps };
@@ -0,0 +1,2 @@
1
+ import LiveStreamForm from './LiveStreamForm';
2
+ export default LiveStreamForm;
@@ -0,0 +1,10 @@
1
+ export type InitialFieldState = Geolocation & {
2
+ title: string;
3
+ description: string;
4
+ slug?: string;
5
+ settings?: Record<string, any>;
6
+ cover?: string;
7
+ isSubmitting: boolean;
8
+ };
9
+ export type FieldStateKeys = keyof InitialFieldState;
10
+ export type FieldStateValues = InitialFieldState[FieldStateKeys];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,48 @@
1
+ import { BoxProps } from '@mui/material';
2
+ import { SCLiveStreamType } from '@selfcommunity/types';
3
+ import '@livekit/components-styles';
4
+ export interface LiveStreamRoomProps extends BoxProps {
5
+ /**
6
+ * Overrides or extends the styles applied to the component.
7
+ * @default null
8
+ */
9
+ className?: string;
10
+ /**
11
+ * Event Object
12
+ * @default null
13
+ */
14
+ liveStream?: SCLiveStreamType;
15
+ /**
16
+ * Endpoint livestream access
17
+ */
18
+ connectionDetailsEndpoint?: string;
19
+ /**
20
+ * Any other properties
21
+ */
22
+ [p: string]: any;
23
+ }
24
+ /**
25
+ *> API documentation for the Community-JS LiveStreamRoom component. Learn about the available props and the CSS API.
26
+ *
27
+ #### Import
28
+ ```jsx
29
+ import {LiveStreamRoom} from '@selfcommunity/react-ui';
30
+ ```
31
+
32
+ #### Component Name
33
+ The name `LiveStreamRoom` can be used when providing style overrides in the theme.
34
+
35
+ #### CSS
36
+
37
+ |Rule Name|Global class|Description|
38
+ |---|---|---|
39
+ |root|.SCLiveStreamForm-root|Styles applied to the root element.|
40
+ |title|.SCLiveStreamForm-title|Styles applied to the title element.|
41
+ |description|.SCLiveStreamForm-description|Styles applied to the description element.|
42
+ |content|.SCLiveStreamForm-content|Styles applied to the content.|
43
+ |prejoin|.SCLiveStreamForm-prejoin|Styles applied to the prejoin.|
44
+ |error|.SCLiveStreamForm-error|Styles applied to the error elements.|
45
+
46
+ * @param inProps
47
+ */
48
+ export default function LiveStreamRoom(inProps: LiveStreamRoomProps): JSX.Element;
@@ -0,0 +1,120 @@
1
+ import { __awaiter, __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Box, CircularProgress } from '@mui/material';
4
+ import { styled } from '@mui/material/styles';
5
+ import { useThemeProps } from '@mui/system';
6
+ import { useSCPreferences, useSCUser } from '@selfcommunity/react-core';
7
+ import classNames from 'classnames';
8
+ import { useIntl } from 'react-intl';
9
+ import { PREFIX } from './constants';
10
+ import { PreJoin } from '@livekit/components-react';
11
+ import { useCallback, useMemo, useState } from 'react';
12
+ import LiveStreamVideoConference from './LiveStreamVideoConference';
13
+ import '@livekit/components-styles';
14
+ import { generateRoomId } from '../../utils/liveStream';
15
+ const classes = {
16
+ root: `${PREFIX}-root`,
17
+ content: `${PREFIX}-content`,
18
+ title: `${PREFIX}-title`,
19
+ description: `${PREFIX}-description`,
20
+ preJoin: `${PREFIX}-prejoin`,
21
+ error: `${PREFIX}-error`
22
+ };
23
+ const Root = styled(Box, {
24
+ name: PREFIX,
25
+ slot: 'Root'
26
+ })(({ theme }) => ({}));
27
+ /**
28
+ *> API documentation for the Community-JS LiveStreamRoom component. Learn about the available props and the CSS API.
29
+ *
30
+ #### Import
31
+ ```jsx
32
+ import {LiveStreamRoom} from '@selfcommunity/react-ui';
33
+ ```
34
+
35
+ #### Component Name
36
+ The name `LiveStreamRoom` can be used when providing style overrides in the theme.
37
+
38
+ #### CSS
39
+
40
+ |Rule Name|Global class|Description|
41
+ |---|---|---|
42
+ |root|.SCLiveStreamForm-root|Styles applied to the root element.|
43
+ |title|.SCLiveStreamForm-title|Styles applied to the title element.|
44
+ |description|.SCLiveStreamForm-description|Styles applied to the description element.|
45
+ |content|.SCLiveStreamForm-content|Styles applied to the content.|
46
+ |prejoin|.SCLiveStreamForm-prejoin|Styles applied to the prejoin.|
47
+ |error|.SCLiveStreamForm-error|Styles applied to the error elements.|
48
+
49
+ * @param inProps
50
+ */
51
+ export default function LiveStreamRoom(inProps) {
52
+ var _a;
53
+ //PROPS
54
+ const props = useThemeProps({
55
+ props: inProps,
56
+ name: PREFIX
57
+ });
58
+ const { className, liveStream = null, connectionDetailsEndpoint } = props, rest = __rest(props, ["className", "liveStream", "connectionDetailsEndpoint"]);
59
+ // CONTEXT
60
+ const scUserContext = useSCUser();
61
+ const { preferences, features } = useSCPreferences();
62
+ // INTL
63
+ const intl = useIntl();
64
+ // STATE
65
+ const [preJoinChoices, setPreJoinChoices] = useState(undefined);
66
+ const preJoinDefaults = useMemo(() => {
67
+ var _a;
68
+ return {
69
+ username: ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.username) || '',
70
+ videoEnabled: true,
71
+ audioEnabled: true
72
+ };
73
+ }, [scUserContext.user]);
74
+ const [connectionDetails, setConnectionDetails] = useState(undefined);
75
+ const liveStreamEnabled = true;
76
+ /* const liveStreamEnabled = useMemo(
77
+ () =>
78
+ preferences &&
79
+ features &&
80
+ features.includes(SCFeatureName.LIVE_STREAM) &&
81
+ SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
82
+ preferences[SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value,
83
+ [preferences, features]
84
+ ); */
85
+ const canCreateLiveStream = useMemo(() => true /* scUserContext?.user?.permission?.create_livestream */, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
86
+ // HANDLERS
87
+ /**
88
+ * Handle PreJoin Submit
89
+ */
90
+ const handlePreJoinSubmit = useCallback((values) => __awaiter(this, void 0, void 0, function* () {
91
+ var _b;
92
+ // eslint-disable-next-line no-constant-condition
93
+ if ((liveStream || true) && connectionDetailsEndpoint) {
94
+ setPreJoinChoices(values);
95
+ const url = new URL(connectionDetailsEndpoint, window.location.origin);
96
+ url.searchParams.append('roomName', generateRoomId());
97
+ url.searchParams.append('participantName', (_b = scUserContext.user) === null || _b === void 0 ? void 0 : _b.username);
98
+ // if (liveStream.region) {
99
+ // url.searchParams.append('region', liveStream.region);
100
+ // }
101
+ const connectionDetailsResp = yield fetch(url.toString());
102
+ const connectionDetailsData = yield connectionDetailsResp.json();
103
+ setConnectionDetails(connectionDetailsData);
104
+ }
105
+ }), []);
106
+ /**
107
+ * Handle PreJoin Error
108
+ */
109
+ const handlePreJoinError = useCallback((e) => console.error(e), []);
110
+ /**
111
+ * User must be authenticated
112
+ */
113
+ if (!scUserContext.user || !liveStreamEnabled || !canCreateLiveStream) {
114
+ return _jsx(CircularProgress, {});
115
+ }
116
+ /**
117
+ * Renders root object
118
+ */
119
+ return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: [_jsx(Box, Object.assign({ className: classes.title }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.title })), _jsx(Box, Object.assign({ className: classes.description }, { children: liveStream === null || liveStream === void 0 ? void 0 : liveStream.description })), connectionDetails === undefined || preJoinChoices === undefined ? (_jsx(Box, Object.assign({ className: classes.preJoin }, { children: _jsx(PreJoin, { persistUserChoices: true, defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError }) }))) : (_jsx(LiveStreamVideoConference, { connectionDetails: connectionDetails, userChoices: preJoinChoices, options: { codec: props.codec, hq: props.hq } }))] })) })));
120
+ }
@@ -0,0 +1,69 @@
1
+ import { BoxProps } from '@mui/material';
2
+ import { SCLiveStreamType } from '@selfcommunity/types/src/index';
3
+ import { LiveKitRoomProps, LocalUserChoices } from '@livekit/components-react';
4
+ import { VideoCodec } from 'livekit-client';
5
+ import { ConnectionDetails } from '../types';
6
+ export interface LiveStreamVideoConferenceProps extends BoxProps {
7
+ /**
8
+ * Overrides or extends the styles applied to the component.
9
+ * @default null
10
+ */
11
+ className?: string;
12
+ /**
13
+ * Livestream Object
14
+ * @default null
15
+ */
16
+ liveStream?: SCLiveStreamType;
17
+ /**
18
+ * User choices
19
+ */
20
+ userChoices: LocalUserChoices;
21
+ /**
22
+ * Connection details, include
23
+ * serverUrl: serverUrl,
24
+ * roomName: roomName,
25
+ * participantToken: participantToken,
26
+ * participantName: participantName
27
+ */
28
+ connectionDetails: ConnectionDetails;
29
+ /**
30
+ * Override video options
31
+ */
32
+ options: {
33
+ hq: boolean;
34
+ codec: VideoCodec;
35
+ };
36
+ /**
37
+ * onLeave room callback
38
+ */
39
+ handleOnLeaveRoom?: () => void;
40
+ /**
41
+ * Props to spread to LiveKitRoomComponent
42
+ * @default {}
43
+ */
44
+ LiveKitRoomComponentsProps?: LiveKitRoomProps;
45
+ /**
46
+ * Any other properties
47
+ */
48
+ [p: string]: any;
49
+ }
50
+ /**
51
+ *> API documentation for the Community-JS LiveStreamVideoConference component. Learn about the available props and the CSS API.
52
+ *
53
+ #### Import
54
+ ```jsx
55
+ import {LiveStreamVideoConference} from '@selfcommunity/react-ui';
56
+ ```
57
+
58
+ #### Component Name
59
+ The name `LiveStreamVideoConference` can be used when providing style overrides in the theme.
60
+
61
+ #### CSS
62
+
63
+ |Rule Name|Global class|Description|
64
+ |---|---|---|
65
+ |root|.SCLiveStreamForm-root|Styles applied to the root element.|
66
+
67
+ * @param inProps
68
+ */
69
+ export default function LiveStreamVideoConference(inProps: LiveStreamVideoConferenceProps): JSX.Element;
@@ -0,0 +1,183 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4
+ // @ts-nocheck
5
+ import { Box, CircularProgress } from '@mui/material';
6
+ import { styled } from '@mui/material/styles';
7
+ import { useThemeProps } from '@mui/system';
8
+ import { useSCPreferences, useSCUser } from '@selfcommunity/react-core';
9
+ import classNames from 'classnames';
10
+ import { PREFIX } from './constants';
11
+ import { ConnectionState, formatChatMessageLinks, LiveKitRoom, VideoConference } from '@livekit/components-react';
12
+ import { ExternalE2EEKeyProvider, VideoPresets, Room, DeviceUnsupportedError } from 'livekit-client';
13
+ import { useCallback, useEffect, useMemo, useState } from 'react';
14
+ import { decodePassphrase } from '../../../utils/liveStream';
15
+ import RecordingIndicator from './RecordingIndicator';
16
+ import { defaultUserChoices } from '@livekit/components-core';
17
+ import { defaultVideoOptions } from '../constants';
18
+ const classes = {
19
+ root: `${PREFIX}-root`,
20
+ title: `${PREFIX}-title`,
21
+ content: `${PREFIX}-content`,
22
+ actions: `${PREFIX}-actions`,
23
+ error: `${PREFIX}-error`
24
+ };
25
+ const Root = styled(Box, {
26
+ name: PREFIX,
27
+ slot: 'Root'
28
+ })(({ theme }) => ({}));
29
+ /**
30
+ *> API documentation for the Community-JS LiveStreamVideoConference component. Learn about the available props and the CSS API.
31
+ *
32
+ #### Import
33
+ ```jsx
34
+ import {LiveStreamVideoConference} from '@selfcommunity/react-ui';
35
+ ```
36
+
37
+ #### Component Name
38
+ The name `LiveStreamVideoConference` can be used when providing style overrides in the theme.
39
+
40
+ #### CSS
41
+
42
+ |Rule Name|Global class|Description|
43
+ |---|---|---|
44
+ |root|.SCLiveStreamForm-root|Styles applied to the root element.|
45
+
46
+ * @param inProps
47
+ */
48
+ export default function LiveStreamVideoConference(inProps) {
49
+ //PROPS
50
+ const props = useThemeProps({
51
+ props: inProps,
52
+ name: PREFIX
53
+ });
54
+ const { className, liveStream = null, handleOnLeaveRoom, userChoices = defaultUserChoices, connectionDetails = {}, LiveKitRoomComponentsProps = {
55
+ /* simulateParticipants: true */
56
+ }, options = defaultVideoOptions } = props, rest = __rest(props, ["className", "liveStream", "handleOnLeaveRoom", "userChoices", "connectionDetails", "LiveKitRoomComponentsProps", "options"]);
57
+ // CONTEXT
58
+ const scUserContext = useSCUser();
59
+ const { preferences, features } = useSCPreferences();
60
+ // Passphrase
61
+ const e2eePassphrase = typeof window !== 'undefined' && decodePassphrase(location.hash.substring(1));
62
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
63
+ // @ts-ignore
64
+ const worker = typeof window !== 'undefined' && e2eePassphrase && new Worker(new URL('livekit-client/e2ee-worker', import.meta.url));
65
+ const e2eeEnabled = !!(e2eePassphrase && worker);
66
+ const keyProvider = new ExternalE2EEKeyProvider();
67
+ const [e2eeSetupComplete, setE2eeSetupComplete] = useState(false);
68
+ const [liveActive, setLiveActive] = useState(false);
69
+ const [error, setError] = useState(null);
70
+ const liveStreamRoomMaxParticipants = 25;
71
+ /* const liveStreamRoomMaxParticipants = useMemo(
72
+ () =>
73
+ preferences &&
74
+ SCPreferences.CONFIGURATIONS_LIVE_STREAM_MAX_PARTICIPANTS in preferences &&
75
+ preferences[SCPreferences.CONFIGURATIONS_LIVE_STREAM_MAX_PARTICIPANTS].value,
76
+ [preferences]
77
+ ); */
78
+ // Room options
79
+ const roomOptions = useMemo(() => {
80
+ var _a, _b;
81
+ let videoCodec = options.codec ? options.codec : defaultVideoOptions.codec;
82
+ if (e2eeEnabled && (videoCodec === 'av1' || videoCodec === 'vp9')) {
83
+ videoCodec = undefined;
84
+ }
85
+ return {
86
+ // emptyTimeout: 3 * 60, // 3 minutes
87
+ // maxParticipants: liveStreamRoomMaxParticipants,
88
+ videoCaptureDefaults: {
89
+ deviceId: (_a = userChoices.videoDeviceId) !== null && _a !== void 0 ? _a : undefined,
90
+ resolution: options.hq ? VideoPresets.h2160 : VideoPresets.h720
91
+ },
92
+ publishDefaults: {
93
+ dtx: false,
94
+ videoSimulcastLayers: options.hq ? [VideoPresets.h1080, VideoPresets.h720] : [VideoPresets.h540, VideoPresets.h216],
95
+ red: !e2eeEnabled,
96
+ videoCodec
97
+ },
98
+ audioCaptureDefaults: {
99
+ deviceId: (_b = userChoices.audioDeviceId) !== null && _b !== void 0 ? _b : undefined
100
+ },
101
+ adaptiveStream: { pixelDensity: 'screen' },
102
+ dynacast: true,
103
+ e2ee: e2eeEnabled
104
+ ? {
105
+ keyProvider,
106
+ worker
107
+ }
108
+ : undefined
109
+ };
110
+ }, [liveStreamRoomMaxParticipants, userChoices, options.hq, options.codec]);
111
+ // Create room - only initial
112
+ const room = useMemo(() => {
113
+ if (liveStreamRoomMaxParticipants) {
114
+ return new Room(roomOptions);
115
+ }
116
+ }, [liveStreamRoomMaxParticipants]);
117
+ const connectOptions = useMemo(() => {
118
+ return {
119
+ autoSubscribe: true
120
+ };
121
+ }, []);
122
+ useEffect(() => {
123
+ if (room) {
124
+ if (e2eeEnabled) {
125
+ keyProvider
126
+ .setKey(decodePassphrase(e2eePassphrase))
127
+ .then(() => {
128
+ room.setE2EEEnabled(true).catch((e) => {
129
+ if (e instanceof DeviceUnsupportedError) {
130
+ alert(`You're trying to join an encrypted meeting, but your browser does not support it. Please update it to the latest version and try again.`);
131
+ console.error(e);
132
+ }
133
+ else {
134
+ throw e;
135
+ }
136
+ });
137
+ })
138
+ .then(() => {
139
+ setE2eeSetupComplete(true);
140
+ setLiveActive(true);
141
+ });
142
+ }
143
+ else {
144
+ setE2eeSetupComplete(true);
145
+ setLiveActive(true);
146
+ }
147
+ }
148
+ }, [e2eeEnabled, room, e2eePassphrase]);
149
+ // HANDLERS
150
+ /**
151
+ * Handle on leave
152
+ */
153
+ const handleOnLeave = useCallback(() => {
154
+ setLiveActive(false);
155
+ handleOnLeaveRoom === null || handleOnLeaveRoom === void 0 ? void 0 : handleOnLeaveRoom();
156
+ }, [handleOnLeaveRoom]);
157
+ /**
158
+ * Handle on error
159
+ */
160
+ const handleError = useCallback((error) => {
161
+ console.error(error);
162
+ setError(`Encountered an unexpected error, check the console logs for details: ${error.message}`);
163
+ setLiveActive(false);
164
+ }, []);
165
+ /**
166
+ * Handle encryption error
167
+ */
168
+ const handleEncryptionError = useCallback((error) => {
169
+ console.error(error);
170
+ setError(`Encountered an unexpected encryption error, check the console logs for details: ${error.message}`);
171
+ setLiveActive(false);
172
+ }, []);
173
+ /**
174
+ * User must be authenticated
175
+ */
176
+ if (!scUserContext.user || !connectionDetails) {
177
+ return _jsx(CircularProgress, {});
178
+ }
179
+ /**
180
+ * Renders root object
181
+ */
182
+ return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: room && liveActive && !error ? (_jsx(_Fragment, { children: _jsxs(LiveKitRoom, Object.assign({ connect: Boolean(e2eeSetupComplete && liveActive && room), room: room, token: connectionDetails['participantToken'], serverUrl: connectionDetails['serverUrl'], connectOptions: connectOptions, video: userChoices.videoEnabled, audio: userChoices.audioEnabled, onDisconnected: handleOnLeave, onEncryptionError: handleEncryptionError, onError: handleError }, LiveKitRoomComponentsProps, { children: [_jsx(VideoConference, { chatMessageFormatter: formatChatMessageLinks }), _jsx(RecordingIndicator, {}), _jsx(ConnectionState, {})] })) })) : (_jsx(_Fragment, { children: error ? error : liveActive === false ? _jsx(_Fragment, { children: "Grazie!" }) : _jsx(CircularProgress, {}) })) })));
183
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @alpha
3
+ */
4
+ export default function RecordingIndicator(): JSX.Element;
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useIsRecording } from '@livekit/components-react';
4
+ import { useEffect, useState } from 'react';
5
+ /**
6
+ * @alpha
7
+ */
8
+ export default function RecordingIndicator() {
9
+ const isRecording = useIsRecording();
10
+ const [wasRecording, setWasRecording] = useState(false);
11
+ useEffect(() => {
12
+ if (isRecording !== wasRecording) {
13
+ setWasRecording(isRecording);
14
+ if (isRecording) {
15
+ window.alert('This meeting is being recorded');
16
+ }
17
+ }
18
+ }, [isRecording]);
19
+ return (_jsx("div", { style: {
20
+ position: 'absolute',
21
+ top: '0',
22
+ left: '0',
23
+ width: '100%',
24
+ height: '100%',
25
+ boxShadow: isRecording ? 'red 0px 0px 0px 3px inset' : 'none',
26
+ pointerEvents: 'none'
27
+ } }));
28
+ }
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCLiveStreamVideoConference";
@@ -0,0 +1 @@
1
+ export const PREFIX = 'SCLiveStreamVideoConference';
@@ -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,5 @@
1
+ export declare const PREFIX = "SCLiveStreamRoom";
2
+ export declare const defaultVideoOptions: {
3
+ readonly hq: true;
4
+ readonly codec: "vp9";
5
+ };