@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,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ const styles_1 = require("@mui/material/styles");
7
+ const system_1 = require("@mui/system");
8
+ const react_core_1 = require("@selfcommunity/react-core");
9
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
+ const react_1 = require("react");
11
+ const react_intl_1 = require("react-intl");
12
+ const BaseItem_1 = tslib_1.__importDefault(require("../../shared/BaseItem"));
13
+ const Calendar_1 = tslib_1.__importDefault(require("../../shared/Calendar"));
14
+ const liveStream_1 = require("../../types/liveStream");
15
+ const User_1 = tslib_1.__importDefault(require("../User"));
16
+ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
17
+ const constants_1 = require("./constants");
18
+ const index_1 = require("./index");
19
+ const LiveStreamInfoDetails_1 = tslib_1.__importDefault(require("../../shared/LiveStreamInfoDetails"));
20
+ const classes = {
21
+ root: `${constants_1.PREFIX}-root`,
22
+ detailRoot: `${constants_1.PREFIX}-detail-root`,
23
+ previewRoot: `${constants_1.PREFIX}-preview-root`,
24
+ snippetRoot: `${constants_1.PREFIX}-snippet-root`,
25
+ detailImageWrapper: `${constants_1.PREFIX}-detail-image-wrapper`,
26
+ detailImage: `${constants_1.PREFIX}-detail-image`,
27
+ detailInProgress: `${constants_1.PREFIX}-detail-in-progress`,
28
+ detailNameWrapper: `${constants_1.PREFIX}-detail-name-wrapper`,
29
+ detailName: `${constants_1.PREFIX}-detail-name`,
30
+ detailContent: `${constants_1.PREFIX}-detail-content`,
31
+ detailUser: `${constants_1.PREFIX}-detail-user`,
32
+ detailFirstDivider: `${constants_1.PREFIX}-detail-first-divider`,
33
+ detailSecondDivider: `${constants_1.PREFIX}-detail-second-divider`,
34
+ detailActions: `${constants_1.PREFIX}-detail-actions`,
35
+ previewImageWrapper: `${constants_1.PREFIX}-preview-image-wrapper`,
36
+ previewImage: `${constants_1.PREFIX}-preview-image`,
37
+ previewInProgress: `${constants_1.PREFIX}-preview-in-progress`,
38
+ previewNameWrapper: `${constants_1.PREFIX}-preview-name-wrapper`,
39
+ previewName: `${constants_1.PREFIX}-preview-name`,
40
+ previewContent: `${constants_1.PREFIX}-preview-content`,
41
+ previewActions: `${constants_1.PREFIX}-preview-actions`,
42
+ snippetImage: `${constants_1.PREFIX}-snippet-image`,
43
+ snippetAvatar: `${constants_1.PREFIX}-snippet-avatar`,
44
+ snippetInProgress: `${constants_1.PREFIX}-snippet-in-progress`,
45
+ snippetPrimary: `${constants_1.PREFIX}-snippet-primary`,
46
+ snippetSecondary: `${constants_1.PREFIX}-snippet-secondary`,
47
+ snippetActions: `${constants_1.PREFIX}-snippet-actions`
48
+ };
49
+ const Root = (0, styles_1.styled)(Widget_1.default, {
50
+ name: constants_1.PREFIX,
51
+ slot: 'Root',
52
+ overridesResolver: (props, styles) => styles.root
53
+ })(() => ({}));
54
+ const DetailRoot = (0, styles_1.styled)(material_1.Box, {
55
+ name: constants_1.PREFIX,
56
+ slot: 'DetailRoot',
57
+ overridesResolver: (props, styles) => styles.detailRoot
58
+ })(() => ({}));
59
+ const PreviewRoot = (0, styles_1.styled)(material_1.Box, {
60
+ name: constants_1.PREFIX,
61
+ slot: 'PreviewRoot',
62
+ overridesResolver: (props, styles) => styles.previewRoot
63
+ })(() => ({}));
64
+ const SnippetRoot = (0, styles_1.styled)(BaseItem_1.default, {
65
+ name: constants_1.PREFIX,
66
+ slot: 'SnippetRoot',
67
+ overridesResolver: (props, styles) => styles.snippetRoot
68
+ })(() => ({}));
69
+ /**
70
+ * > API documentation for the Community-JS Live Stream component. Learn about the available props and the CSS API.
71
+ *
72
+ *
73
+ * This component renders an liveStream item.
74
+ * Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/Event)
75
+
76
+ #### Import
77
+
78
+ ```jsx
79
+ import {liveStream} from '@selfcommunity/react-ui';
80
+ ```
81
+
82
+ #### Component Name
83
+
84
+ The name `SCLiveStream` can be used when providing style overrides in the theme.
85
+
86
+
87
+ #### CSS
88
+
89
+ |Rule Name|Global class|Description|
90
+ |---|---|---|
91
+ |root|.SCLiveStream-root|Styles applied to the root element.|
92
+ |avatar|.SCLiveStream-avatar|Styles applied to the avatar element.|
93
+ |primary|.SCLiveStream-primary|Styles applied to the primary item element section|
94
+ |secondary|.SCLiveStream-secondary|Styles applied to the secondary item element section|
95
+ |actions|.SCLiveStream-actions|Styles applied to the actions section.|
96
+
97
+
98
+ *
99
+ * @param inProps
100
+ */
101
+ function LiveStream(inProps) {
102
+ // PROPS
103
+ const props = (0, system_1.useThemeProps)({
104
+ props: inProps,
105
+ name: constants_1.PREFIX
106
+ });
107
+ const { id = `live_stream_object_${props.liveStreamId ? props.liveStreamId : props.liveStream ? props.liveStream.id : ''}`, liveStreamId = null, liveStream = null, className = null, template = liveStream_1.SCLiveStreamTemplateType.SNIPPET, hideInProgress = false, hideLiveStreamHost = false, actions, EventSkeletonComponentProps = {} } = props, rest = tslib_1.__rest(props, ["id", "liveStreamId", "liveStream", "className", "template", "hideInProgress", "hideLiveStreamHost", "actions", "EventSkeletonComponentProps"]);
108
+ // STATE
109
+ const { scLiveStream } = (0, react_core_1.useSCFetchLiveStream)({ id: liveStreamId, liveStream });
110
+ const inProgress = (0, react_1.useMemo)(() => scLiveStream /* && scLiveStream.running */, [scLiveStream]);
111
+ // CONTEXT
112
+ const scRoutingContext = (0, react_core_1.useSCRouting)();
113
+ // HOOKS
114
+ const intl = (0, react_intl_1.useIntl)();
115
+ /**
116
+ * Renders liveStream object
117
+ */
118
+ if (!scLiveStream) {
119
+ return (0, jsx_runtime_1.jsx)(index_1.LiveStreamSkeleton, Object.assign({ template: template }, EventSkeletonComponentProps, rest, { actions: actions }));
120
+ }
121
+ /**
122
+ * Renders liveStream object
123
+ */
124
+ let contentObj;
125
+ if (template === liveStream_1.SCLiveStreamTemplateType.DETAIL) {
126
+ contentObj = ((0, jsx_runtime_1.jsxs)(DetailRoot, Object.assign({ className: classes.detailRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.detailImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scLiveStream.cover, alt: scLiveStream.title, className: classes.detailImage }), !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStream.inProgress", defaultMessage: "ui.liveStream.inProgress" }), className: classes.detailInProgress })), (0, jsx_runtime_1.jsx)(Calendar_1.default, { day: new Date(scLiveStream.created_at).getDate() })] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.detailContent }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.detailNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", className: classes.detailName }, { children: scLiveStream.title })) })), (0, jsx_runtime_1.jsx)(LiveStreamInfoDetails_1.default, { liveStream: scLiveStream }), !hideLiveStreamHost && ((0, jsx_runtime_1.jsx)(User_1.default, { user: scLiveStream.host, elevation: 0, secondary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.myEventsWidget.planner", defaultMessage: "ui.myEventsWidget.planner" }) })), actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), className: classes.detailUser })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.detailSecondDivider })] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.detailActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.liveStream.see", id: "ui.liveStream.see" }) })) })))] })));
127
+ }
128
+ else if (template === liveStream_1.SCLiveStreamTemplateType.PREVIEW) {
129
+ contentObj = ((0, jsx_runtime_1.jsxs)(PreviewRoot, Object.assign({ className: classes.previewRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative", className: classes.previewImageWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { component: "img", image: scLiveStream.cover, alt: scLiveStream.title, className: classes.previewImage }), !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStream.inProgress", defaultMessage: "ui.liveStream.inProgress" }), className: classes.previewInProgress }))] })), (0, jsx_runtime_1.jsx)(material_1.CardContent, Object.assign({ className: classes.previewContent }, { children: (0, jsx_runtime_1.jsx)(LiveStreamInfoDetails_1.default, { liveStream: scLiveStream, beforeDateInfo: (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream), className: classes.previewNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.previewName }, { children: scLiveStream.title })) })) }) })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.previewActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.liveStream.see", id: "ui.liveStream.see" }) })) })))] })));
130
+ }
131
+ else {
132
+ contentObj = ((0, jsx_runtime_1.jsx)(SnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.snippetRoot, image: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.snippetImage }, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "square", alt: scLiveStream.title, src: scLiveStream.cover, className: classes.snippetAvatar }), ' ', !hideInProgress && inProgress && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStream.inProgress", defaultMessage: "ui.liveStream.inProgress" }), className: classes.snippetInProgress }))] })), primary: (0, jsx_runtime_1.jsxs)(react_core_1.Link, Object.assign({}, (scLiveStream.id && { to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) }), { className: classes.snippetPrimary }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span" }, { children: `${intl.formatDate(scLiveStream.created_at, {
133
+ weekday: 'long',
134
+ month: 'long',
135
+ day: 'numeric'
136
+ })}` })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: scLiveStream.title }))] })), secondary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "p", variant: "body2", className: classes.snippetSecondary }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventForm.address.liveStream.label`, defaultMessage: `ui.eventForm.address.liveStream.label` }) })), actions: actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.snippetActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.liveStream.see", id: "ui.liveStream.see" }) })) }))) }));
137
+ }
138
+ /**
139
+ * Renders root object
140
+ */
141
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className, `${constants_1.PREFIX}-${template}`) }, rest, { children: contentObj })));
142
+ }
143
+ exports.default = LiveStream;
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import { SCLiveStreamTemplateType } from '../../types/liveStream';
3
+ import { WidgetProps } from '../Widget';
4
+ export interface LiveStreamSkeletonProps extends WidgetProps {
5
+ /**
6
+ * Overrides or extends the styles applied to the component.
7
+ * @default null
8
+ */
9
+ className?: string;
10
+ /**
11
+ * LiveStream template type
12
+ * @default 'preview'
13
+ */
14
+ template?: SCLiveStreamTemplateType;
15
+ /**
16
+ * Disable skeleton animation
17
+ */
18
+ skeletonsAnimation?: false | 'wave' | 'pulse';
19
+ /**
20
+ * Prop to pass an action to be rendered next to the skeleton
21
+ */
22
+ actions?: React.ReactNode;
23
+ }
24
+ /**
25
+ * > API documentation for the Community-JS LiveStream Skeleton component. Learn about the available props and the CSS API.
26
+
27
+ #### Import
28
+
29
+ ```jsx
30
+ import {LiveStreamSkeleton} from '@selfcommunity/react-ui';
31
+ ```
32
+
33
+ #### Component Name
34
+
35
+ The name `SCLiveStream-skeleton-root` can be used when providing style overrides in the theme.
36
+
37
+ #### CSS
38
+
39
+ |Rule Name|Global class|Description|
40
+ |---|---|---|
41
+ |root|.SCLiveStream-skeleton-root|Styles applied to the root element.|
42
+ |image|.SCLiveStream-skeleton-image|Styles applied to the image element.|
43
+ |action|.SCLiveStream-skeleton-action|Styles applied to action section.|
44
+ *
45
+ */
46
+ export default function LiveStreamSkeleton(inProps: LiveStreamSkeletonProps): JSX.Element;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ const Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton"));
7
+ const styles_1 = require("@mui/material/styles");
8
+ const system_1 = require("@mui/system");
9
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
+ const BaseItem_1 = tslib_1.__importDefault(require("../../shared/BaseItem"));
11
+ const liveStream_1 = require("../../types/liveStream");
12
+ const Widget_1 = tslib_1.__importDefault(require("../Widget"));
13
+ const constants_1 = require("./constants");
14
+ const classes = {
15
+ root: `${constants_1.PREFIX}-skeleton-root`,
16
+ skeletonDetailRoot: `${constants_1.PREFIX}-skeleton-detail-root`,
17
+ skeletonPreviewRoot: `${constants_1.PREFIX}-skeleton-preview-root`,
18
+ skeletonSnippetRoot: `${constants_1.PREFIX}-skeleton-snippet-root`,
19
+ skeletonDetailCalendar: `${constants_1.PREFIX}-skeleton-detail-calendar`,
20
+ skeletonDetailContent: `${constants_1.PREFIX}-skeleton-detail-content`,
21
+ skeletonDetailActions: `${constants_1.PREFIX}-skeleton-detail-actions`,
22
+ skeletonDetailUser: `${constants_1.PREFIX}-skeleton-detail-user`,
23
+ skeletonDetailFirstDivider: `${constants_1.PREFIX}-skeleton-detail-first-divider`,
24
+ skeletonDetailSecondDivider: `${constants_1.PREFIX}-skeleton-detail-second-divider`,
25
+ skeletonPreviewContent: `${constants_1.PREFIX}-skeleton-preview-content`,
26
+ skeletonPreviewName: `${constants_1.PREFIX}-skeleton-preview-name`,
27
+ skeletonPreviewActions: `${constants_1.PREFIX}-skeleton-preview-actions`,
28
+ skeletonSnippetImage: `${constants_1.PREFIX}-skeleton-snippet-image`,
29
+ skeletonSnippetAction: `${constants_1.PREFIX}-skeleton-snippet-action`
30
+ };
31
+ const Root = (0, styles_1.styled)(Widget_1.default, {
32
+ name: constants_1.PREFIX,
33
+ slot: 'SkeletonRoot'
34
+ })(() => ({}));
35
+ const SkeletonDetailRoot = (0, styles_1.styled)(material_1.Box, {
36
+ name: constants_1.PREFIX,
37
+ slot: 'SkeletonDetailRoot'
38
+ })(() => ({}));
39
+ const SkeletonPreviewRoot = (0, styles_1.styled)(material_1.Box, {
40
+ name: constants_1.PREFIX,
41
+ slot: 'SkeletonPreviewRoot'
42
+ })(() => ({}));
43
+ const SkeletonSnippetRoot = (0, styles_1.styled)(BaseItem_1.default, {
44
+ name: constants_1.PREFIX,
45
+ slot: 'SkeletonSnippetRoot'
46
+ })(() => ({}));
47
+ /**
48
+ * > API documentation for the Community-JS LiveStream Skeleton component. Learn about the available props and the CSS API.
49
+
50
+ #### Import
51
+
52
+ ```jsx
53
+ import {LiveStreamSkeleton} from '@selfcommunity/react-ui';
54
+ ```
55
+
56
+ #### Component Name
57
+
58
+ The name `SCLiveStream-skeleton-root` can be used when providing style overrides in the theme.
59
+
60
+ #### CSS
61
+
62
+ |Rule Name|Global class|Description|
63
+ |---|---|---|
64
+ |root|.SCLiveStream-skeleton-root|Styles applied to the root element.|
65
+ |image|.SCLiveStream-skeleton-image|Styles applied to the image element.|
66
+ |action|.SCLiveStream-skeleton-action|Styles applied to action section.|
67
+ *
68
+ */
69
+ function LiveStreamSkeleton(inProps) {
70
+ // PROPS
71
+ const props = (0, system_1.useThemeProps)({
72
+ props: inProps,
73
+ name: constants_1.PREFIX
74
+ });
75
+ const { className, template = liveStream_1.SCLiveStreamTemplateType.SNIPPET, skeletonsAnimation = 'wave', actions } = props, rest = tslib_1.__rest(props, ["className", "template", "skeletonsAnimation", "actions"]);
76
+ const theme = (0, material_1.useTheme)();
77
+ /**
78
+ * Renders liveStream object
79
+ */
80
+ let contentObj;
81
+ if (template === liveStream_1.SCLiveStreamTemplateType.DETAIL) {
82
+ contentObj = ((0, jsx_runtime_1.jsxs)(SkeletonDetailRoot, Object.assign({ className: classes.skeletonDetailRoot }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ position: "relative" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rectangular", animation: skeletonsAnimation, width: "100%", height: "170px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { className: classes.skeletonDetailCalendar, variant: "rounded", animation: skeletonsAnimation, width: "60px", height: "60px" })] })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.skeletonDetailContent }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "36%", height: "40px" }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "9px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "50%", height: "20px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "9px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "35%", height: "20px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "14px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "27%", height: "20px" })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", gap: "8px", className: classes.skeletonDetailUser }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "36px", height: "36px" }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ gap: "1px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "75px", height: "15px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "86px", height: "16px" })] }))] })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.skeletonDetailFirstDivider }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", gap: "8px", alignItems: "center", height: "28px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "68px", height: "20px" }), (0, jsx_runtime_1.jsxs)(material_1.AvatarGroup, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "21px", height: "21px" })] })] })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.skeletonDetailSecondDivider })] })), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.skeletonDetailActions }, { children: actions !== undefined ? actions : (0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rounded", width: 100, height: 30 }) }))] })));
83
+ }
84
+ else if (template === liveStream_1.SCLiveStreamTemplateType.PREVIEW) {
85
+ contentObj = ((0, jsx_runtime_1.jsxs)(SkeletonPreviewRoot, Object.assign({ className: classes.skeletonPreviewRoot }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ position: "relative" }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rectangular", animation: skeletonsAnimation, width: "100%", height: "80px" }) })), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.skeletonPreviewContent }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px" }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: "21px", height: "21px" }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "50%", height: "20px" })] })), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "67%", height: "25px", className: classes.skeletonPreviewName }), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ direction: "row", alignItems: "center", gap: "8px", marginBottom: "2px" }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, width: "27%", height: "18px" }) })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ direction: "row", gap: "8px", alignItems: "center" }, { children: (0, jsx_runtime_1.jsxs)(material_1.AvatarGroup, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: `${theme.selfcommunity.user.avatar.sizeSmall}px`, height: `${theme.selfcommunity.user.avatar.sizeSmall}px` }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: `${theme.selfcommunity.user.avatar.sizeSmall}px`, height: `${theme.selfcommunity.user.avatar.sizeSmall}px` }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "circular", width: `${theme.selfcommunity.user.avatar.sizeSmall}px`, height: `${theme.selfcommunity.user.avatar.sizeSmall}px` })] }) }))] })), (0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.skeletonPreviewActions }, { children: actions !== undefined ? actions : (0, jsx_runtime_1.jsx)(Skeleton_1.default, { variant: "rounded", width: 100, height: 30 }) }))] })));
86
+ }
87
+ else {
88
+ contentObj = ((0, jsx_runtime_1.jsx)(SkeletonSnippetRoot, { elevation: 0, square: true, disableTypography: true, className: classes.skeletonSnippetRoot, image: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.skeletonSnippetImage }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "rectangular", width: 100, height: 60 }), " ", (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "large" }, { children: "CalendarIcon" }))] })), primary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "rectangular", height: 10, width: "40%", style: { marginBottom: 12 } }), secondary: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "rectangular", height: 10, width: "60%", style: { marginBottom: 10, marginRight: 5 } }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, variant: "rectangular", height: 10, width: "35%" })] }), actions: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: actions !== undefined ? (actions) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ size: "small", variant: "outlined", disabled: true }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: skeletonsAnimation, height: 10, width: 30, style: { marginTop: 5, marginBottom: 5 } }) }))) }) }));
89
+ }
90
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className, `${constants_1.PREFIX}-skeleton-${template}`) }, rest, { children: contentObj })));
91
+ }
92
+ exports.default = LiveStreamSkeleton;
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCLiveStream";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PREFIX = void 0;
4
+ exports.PREFIX = 'SCLiveStream';
@@ -0,0 +1,4 @@
1
+ import LiveStream, { LiveStreamProps } from './LiveStream';
2
+ import LiveStreamSkeleton, { LiveStreamSkeletonProps } from './Skeleton';
3
+ export default LiveStream;
4
+ export { LiveStreamProps, LiveStreamSkeleton, LiveStreamSkeletonProps };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiveStreamSkeleton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const LiveStream_1 = tslib_1.__importDefault(require("./LiveStream"));
6
+ const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
7
+ exports.LiveStreamSkeleton = Skeleton_1.default;
8
+ exports.default = LiveStream_1.default;
@@ -0,0 +1,55 @@
1
+ import { BoxProps } from '@mui/material';
2
+ import { SCLiveStreamType } from '@selfcommunity/types';
3
+ export interface LiveStreamFormProps extends BoxProps {
4
+ /**
5
+ * Overrides or extends the styles applied to the component.
6
+ * @default null
7
+ */
8
+ className?: string;
9
+ /**
10
+ * Event Object
11
+ * @default null
12
+ */
13
+ liveStream?: SCLiveStreamType;
14
+ /**
15
+ * On success callback function
16
+ * @default null
17
+ */
18
+ onSuccess?: (data: SCLiveStreamType) => void;
19
+ /**
20
+ * On error callback function
21
+ * @default null
22
+ */
23
+ onError?: (error: any) => void;
24
+ /**
25
+ * Any other properties
26
+ */
27
+ [p: string]: any;
28
+ }
29
+ /**
30
+ *> API documentation for the Community-JS LiveStreamForm component. Learn about the available props and the CSS API.
31
+ *
32
+ #### Import
33
+ ```jsx
34
+ import {LiveStreamForm} from '@selfcommunity/react-ui';
35
+ ```
36
+
37
+ #### Component Name
38
+ The name `LiveStreamForm` 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
+ |title|.SCLiveStreamForm-title|Styles applied to the title element.|
46
+ |cover|.SCLiveStreamForm-cover|Styles applied to the cover field.|
47
+ |form|.SCLiveStreamForm-form|Styles applied to the form element.|
48
+ |name|.SCLiveStreamForm-name|Styles applied to the name field.|
49
+ |description|.SCLiveStreamForm-description|Styles applied to the description field.|
50
+ |content|.SCLiveStreamForm-content|Styles applied to the element.|
51
+ |error|.SCLiveStreamForm-error|Styles applied to the error elements.|
52
+
53
+ * @param inProps
54
+ */
55
+ export default function LiveStreamForm(inProps: LiveStreamFormProps): JSX.Element;
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const lab_1 = require("@mui/lab");
6
+ const material_1 = require("@mui/material");
7
+ const styles_1 = require("@mui/material/styles");
8
+ const system_1 = require("@mui/system");
9
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
+ const react_1 = require("react");
11
+ const react_intl_1 = require("react-intl");
12
+ const LiveStream_1 = require("../../constants/LiveStream");
13
+ const constants_1 = require("./constants");
14
+ const UploadEventCover_1 = tslib_1.__importDefault(require("../EventForm/UploadEventCover"));
15
+ const LiveStreamFormSettings_1 = tslib_1.__importDefault(require("./LiveStreamFormSettings"));
16
+ const api_services_1 = require("@selfcommunity/api-services");
17
+ const Errors_1 = require("../../constants/Errors");
18
+ const utils_1 = require("@selfcommunity/utils");
19
+ const deafultCover_1 = tslib_1.__importDefault(require("../../assets/deafultCover"));
20
+ const classes = {
21
+ root: `${constants_1.PREFIX}-root`,
22
+ form: `${constants_1.PREFIX}-form`,
23
+ title: `${constants_1.PREFIX}-title`,
24
+ cover: `${constants_1.PREFIX}-cover`,
25
+ slug: `${constants_1.PREFIX}-slug`,
26
+ description: `${constants_1.PREFIX}-description`,
27
+ content: `${constants_1.PREFIX}-content`,
28
+ actions: `${constants_1.PREFIX}-actions`,
29
+ error: `${constants_1.PREFIX}-error`,
30
+ genericError: `${constants_1.PREFIX}-generic-error`
31
+ };
32
+ const Root = (0, styles_1.styled)(material_1.Box, {
33
+ name: constants_1.PREFIX,
34
+ slot: 'Root'
35
+ })(({ theme }) => ({}));
36
+ const messages = (0, react_intl_1.defineMessages)({
37
+ title: {
38
+ id: 'ui.liveStreamForm.title.placeholder',
39
+ defaultMessage: 'ui.liveStreamForm.title.placeholder'
40
+ },
41
+ slug: {
42
+ id: 'ui.liveStreamForm.slug.placeholder',
43
+ defaultMessage: 'ui.liveStreamForm.slug.placeholder'
44
+ },
45
+ description: {
46
+ id: 'ui.liveStreamForm.description.placeholder',
47
+ defaultMessage: 'ui.liveStreamForm.description.placeholder'
48
+ }
49
+ });
50
+ /**
51
+ *> API documentation for the Community-JS LiveStreamForm component. Learn about the available props and the CSS API.
52
+ *
53
+ #### Import
54
+ ```jsx
55
+ import {LiveStreamForm} from '@selfcommunity/react-ui';
56
+ ```
57
+
58
+ #### Component Name
59
+ The name `LiveStreamForm` 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
+ |title|.SCLiveStreamForm-title|Styles applied to the title element.|
67
+ |cover|.SCLiveStreamForm-cover|Styles applied to the cover field.|
68
+ |form|.SCLiveStreamForm-form|Styles applied to the form element.|
69
+ |name|.SCLiveStreamForm-name|Styles applied to the name field.|
70
+ |description|.SCLiveStreamForm-description|Styles applied to the description field.|
71
+ |content|.SCLiveStreamForm-content|Styles applied to the element.|
72
+ |error|.SCLiveStreamForm-error|Styles applied to the error elements.|
73
+
74
+ * @param inProps
75
+ */
76
+ function LiveStreamForm(inProps) {
77
+ var _a, _b, _c;
78
+ //PROPS
79
+ const props = (0, system_1.useThemeProps)({
80
+ props: inProps,
81
+ name: constants_1.PREFIX
82
+ });
83
+ const { className, onSuccess, onError, liveStream = null } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "liveStream"]);
84
+ // INTL
85
+ const intl = (0, react_intl_1.useIntl)();
86
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
87
+ // @ts-ignore
88
+ const initialFieldState = {
89
+ title: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.title) || '',
90
+ description: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.description) || '',
91
+ slug: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.slug) || '',
92
+ settings: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.settings) || constants_1.LIVESTREAM_DEFAULT_SETTINGS,
93
+ cover: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.cover) || '',
94
+ coverFile: (liveStream === null || liveStream === void 0 ? void 0 : liveStream.cover) || '',
95
+ isSubmitting: false
96
+ };
97
+ // STATE
98
+ const [field, setField] = (0, react_1.useState)(initialFieldState);
99
+ const [error, setError] = (0, react_1.useState)({});
100
+ const [genericError, setGenericError] = (0, react_1.useState)(null);
101
+ const _backgroundCover = Object.assign({}, (field.cover ? { background: `url('${field.cover}') center / cover` } : { background: `url('${deafultCover_1.default}') no-repeat 0 0 / 100% 100%` }));
102
+ const handleChangeCover = (0, react_1.useCallback)((cover) => {
103
+ setField((prev) => (Object.assign(Object.assign({}, prev), { ['coverFile']: cover })));
104
+ const reader = new FileReader();
105
+ reader.onloadend = () => {
106
+ setField((prev) => (Object.assign(Object.assign({}, prev), { ['cover']: reader.result })));
107
+ };
108
+ reader.readAsDataURL(cover);
109
+ if (error.coverError) {
110
+ delete error.coverError;
111
+ setError(error);
112
+ }
113
+ }, [error]);
114
+ const handleSubmit = (0, react_1.useCallback)(() => {
115
+ setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: true })));
116
+ setGenericError(null);
117
+ const formData = new FormData();
118
+ if (field.coverFile) {
119
+ formData.append('cover', field.coverFile);
120
+ }
121
+ formData.append('title', field.title);
122
+ formData.append('description', field.description);
123
+ formData.append('slug', field.slug);
124
+ formData.append('settings', JSON.stringify(field.settings));
125
+ let liveStreamService;
126
+ if (liveStream) {
127
+ liveStreamService = api_services_1.LiveStreamService.update(liveStream.id, formData, {
128
+ headers: { 'Content-Type': 'multipart/form-data' }
129
+ });
130
+ }
131
+ else {
132
+ liveStreamService = api_services_1.LiveStreamService.create(formData, { headers: { 'Content-Type': 'multipart/form-data' } });
133
+ }
134
+ liveStreamService
135
+ .then((data) => {
136
+ setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
137
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data);
138
+ })
139
+ .catch((e) => {
140
+ const _error = (0, api_services_1.formatHttpErrorCode)(e);
141
+ if ('errorsError' in _error || !Object.keys(_error).length) {
142
+ setGenericError(intl.formatMessage({
143
+ id: 'ui.liveStreamForm.error.monthlyMinuteLimitReached',
144
+ defaultMessage: 'ui.liveStreamForm.error.monthlyMinuteLimitReached'
145
+ }));
146
+ }
147
+ else {
148
+ setGenericError(null);
149
+ }
150
+ let __errors = {};
151
+ if ('coverError' in _error) {
152
+ __errors = Object.assign(Object.assign({}, __errors), { ['coverError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.cover.error.invalid", defaultMessage: "ui.liveStreamForm.cover.error.invalid" }) });
153
+ }
154
+ if ('titleError' in _error) {
155
+ __errors = Object.assign(Object.assign({}, __errors), { ['titleError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.title.error.invalid", defaultMessage: "ui.liveStreamForm.title.error.invalid" }) });
156
+ }
157
+ if ('slugError' in _error) {
158
+ __errors = Object.assign(Object.assign({}, __errors), { ['slugError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.slug.error.invalid", defaultMessage: "ui.liveStreamForm.slug.error.invalid" }) });
159
+ }
160
+ setError(__errors);
161
+ setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
162
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
163
+ onError === null || onError === void 0 ? void 0 : onError(e);
164
+ });
165
+ }, [field, onSuccess, onError]);
166
+ const handleChange = (0, react_1.useCallback)((event) => {
167
+ const { name, value } = event.target;
168
+ setField((prev) => (Object.assign(Object.assign({}, prev), { [name]: value })));
169
+ if (error[`${name}Error`]) {
170
+ delete error[`${name}Error`];
171
+ setError(error);
172
+ }
173
+ setGenericError(null);
174
+ }, [error, setGenericError]);
175
+ const handleChangeSettings = (0, react_1.useCallback)((data) => {
176
+ setField((prev) => (Object.assign(Object.assign({}, prev), { settings: data })));
177
+ }, [setField]);
178
+ /**
179
+ * Renders root object
180
+ */
181
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: (0, jsx_runtime_1.jsx)(UploadEventCover_1.default, { isCreationMode: true, onChange: handleChangeCover }) })), Boolean(error['coverError']) && (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: "error" }, { children: error['coverError'] })), (0, jsx_runtime_1.jsxs)(material_1.FormGroup, Object.assign({ className: classes.form }, { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.title, placeholder: `${intl.formatMessage(messages.title)}`, margin: "normal", value: field.title, name: "title", onChange: handleChange, InputProps: {
182
+ endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: LiveStream_1.LIVE_STREAM_TITLE_MAX_LENGTH - field.title.length }))
183
+ }, error: Boolean(field.title.length > LiveStream_1.LIVE_STREAM_TITLE_MAX_LENGTH) || Boolean(error['titleError']), helperText: field.title.length > LiveStream_1.LIVE_STREAM_TITLE_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.title.error.maxLength", defaultMessage: "ui.liveStreamForm.title.error.maxLength" })) : error['titleError'] ? (error['titleError']) : null }), (0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.slug, placeholder: `${intl.formatMessage(messages.slug)}`, margin: "normal", value: field.slug, name: "slug", onChange: handleChange, InputProps: {
184
+ endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: LiveStream_1.LIVE_STREAM_SLUG_MAX_LENGTH - field.slug.length }))
185
+ }, error: Boolean(field.slug.length > LiveStream_1.LIVE_STREAM_SLUG_MAX_LENGTH) || Boolean(error['slugError']), helperText: field.title.length > LiveStream_1.LIVE_STREAM_SLUG_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.slug.error.maxLength", defaultMessage: "ui.liveStreamForm.slug.error.maxLength" })) : error['slugError'] ? (error['slugError']) : null }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, rows: 4, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
186
+ endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_a = field.description) === null || _a === void 0 ? void 0 : _a.length) ? LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH - field.description.length : LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH })))
187
+ }, error: Boolean(((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) > LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH), helperText: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.description.error.maxLength", defaultMessage: "ui.liveStreamForm.description.error.maxLength" })) : null }), (0, jsx_runtime_1.jsx)(LiveStreamFormSettings_1.default, { settings: field.settings, onChange: handleChangeSettings }), genericError && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.genericError }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ variant: "filled", severity: "error" }, { children: genericError })) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.title ||
188
+ field.isSubmitting ||
189
+ field.title.length > LiveStream_1.LIVE_STREAM_TITLE_MAX_LENGTH ||
190
+ field.description.length > LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH, variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: liveStream ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.button.edit", defaultMessage: "ui.liveStreamForm.button.edit" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.button.create", defaultMessage: "ui.liveStreamForm.button.create" })) })) }))] }))] })));
191
+ }
192
+ exports.default = LiveStreamForm;
@@ -0,0 +1,47 @@
1
+ import { BoxProps } from '@mui/material';
2
+ import { SCLiveStreamSettingsType } from '@selfcommunity/types';
3
+ export declare const PREFIX = "SCLiveStreamFormSettings";
4
+ export interface LiveStreamFormSettingsProps 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
+ settings?: SCLiveStreamSettingsType;
15
+ /**
16
+ * onChange callback
17
+ * @param data
18
+ */
19
+ onChange?: (data: any) => void;
20
+ /**
21
+ * Any other properties
22
+ */
23
+ [p: string]: any;
24
+ }
25
+ /**
26
+ *> API documentation for the Community-JS LiveStreamSettingsForm component. Learn about the available props and the CSS API.
27
+ *
28
+ #### Import
29
+ ```jsx
30
+ import {LiveStreamSettingsForm} from '@selfcommunity/react-ui';
31
+ ```
32
+
33
+ #### Component Name
34
+ The name `LiveStreamSettingsForm` can be used when providing style overrides in the theme.
35
+
36
+ #### CSS
37
+
38
+ |Rule Name|Global class|Description|
39
+ |---|---|---|
40
+ |root|.SCLiveStreamForm-root|Styles applied to the root element.|
41
+ |switch|.SCLiveStreamForm-switch|Styles applied to the switch element.|
42
+ |switchLabel|.SCLiveStreamForm-switch-label|Styles applied to the switchLabel element.|
43
+ |accessView|.SCLiveStreamForm-access-view|Styles applied to the access view.|
44
+
45
+ * @param inProps
46
+ */
47
+ export default function LiveStreamSettingsForm(inProps: LiveStreamFormSettingsProps): JSX.Element;