@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
@@ -1,5 +1,5 @@
1
1
  import { BottomNavigationProps as MuiBottomNavigationProps } from '@mui/material';
2
- export declare type BottomNavigationProps = MuiBottomNavigationProps;
2
+ export type BottomNavigationProps = MuiBottomNavigationProps;
3
3
  /**
4
4
  * > API documentation for the Community-JS Bottom Navigation component. Learn about the available props and the CSS API.
5
5
  *
@@ -16,6 +16,8 @@ const Errors_1 = require("../../constants/Errors");
16
16
  const utils_1 = require("@selfcommunity/utils");
17
17
  const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
18
18
  const constants_1 = require("./constants");
19
+ const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
20
+ const PubSub_1 = require("../../constants/PubSub");
19
21
  const classes = {
20
22
  root: `${constants_1.PREFIX}-root`,
21
23
  filters: `${constants_1.PREFIX}-filter`,
@@ -73,6 +75,7 @@ function Categories(inProps) {
73
75
  const authUserId = scUserContext.user ? scUserContext.user.id : null;
74
76
  // REFS
75
77
  const isMountedRef = (0, react_core_1.useIsComponentMountedRef)();
78
+ const updatesSubscription = (0, react_1.useRef)(null);
76
79
  /**
77
80
  * Fetches categories list
78
81
  */
@@ -104,6 +107,25 @@ function Categories(inProps) {
104
107
  });
105
108
  }
106
109
  }, [contentAvailability, authUserId, prefetchedCategories.length]);
110
+ /**
111
+ * Subscriber for pubsub callback
112
+ */
113
+ const onEditCategoryHandler = (0, react_1.useCallback)((_msg, edited) => {
114
+ setCategories((prev) => {
115
+ return prev.map((c) => (c.id === edited.id ? Object.assign(Object.assign({}, c), edited) : c));
116
+ });
117
+ }, [categories]);
118
+ /**
119
+ * On mount, subscribe to receive event updates (only edit)
120
+ */
121
+ (0, react_1.useEffect)(() => {
122
+ if (categories) {
123
+ updatesSubscription.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.CATEGORY}.${PubSub_1.SCCategoryEventType.EDIT}`, onEditCategoryHandler);
124
+ }
125
+ return () => {
126
+ updatesSubscription.current && pubsub_js_1.default.unsubscribe(updatesSubscription.current);
127
+ };
128
+ }, [categories]);
107
129
  /**
108
130
  * Get categories filtered
109
131
  */
@@ -20,6 +20,8 @@ const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/Hidden
20
20
  const react_core_1 = require("@selfcommunity/react-core");
21
21
  const widget_1 = require("../../utils/widget");
22
22
  const constants_1 = require("./constants");
23
+ const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
24
+ const PubSub_1 = require("../../constants/PubSub");
23
25
  const classes = {
24
26
  root: `${constants_1.PREFIX}-root`,
25
27
  title: `${constants_1.PREFIX}-title`,
@@ -89,6 +91,8 @@ function CategoriesPopularWidget(inProps) {
89
91
  // HOOKS
90
92
  const theme = (0, material_1.useTheme)();
91
93
  const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
94
+ // REFS
95
+ const updatesSubscription = (0, react_1.useRef)(null);
92
96
  /**
93
97
  * Initialize component
94
98
  * Fetch data only if the component is not initialized and it is not loading data
@@ -106,6 +110,23 @@ function CategoriesPopularWidget(inProps) {
106
110
  });
107
111
  }
108
112
  }, [state.isLoadingNext, state.initialized, limit, dispatch]);
113
+ /**
114
+ * Subscriber for pubsub callback
115
+ */
116
+ const onEditCategoryHandler = (0, react_1.useCallback)((_msg, edited) => {
117
+ const _categories = [...state.results];
118
+ const updatedCategories = _categories.map((c) => (c.id === edited.id ? Object.assign(Object.assign({}, c), edited) : c));
119
+ dispatch({ type: widget_1.actionWidgetTypes.SET_RESULTS, payload: { results: updatedCategories } });
120
+ }, [dispatch, state.results]);
121
+ /**
122
+ * On mount, subscribe to receive event updates (only edit)
123
+ */
124
+ (0, react_1.useEffect)(() => {
125
+ updatesSubscription.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.CATEGORY}.${PubSub_1.SCCategoryEventType.EDIT}`, onEditCategoryHandler);
126
+ return () => {
127
+ updatesSubscription.current && pubsub_js_1.default.unsubscribe(updatesSubscription.current);
128
+ };
129
+ }, [onEditCategoryHandler]);
109
130
  // EFFECTS
110
131
  (0, react_1.useEffect)(() => {
111
132
  var _a;
@@ -20,6 +20,8 @@ const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"))
20
20
  const Errors_1 = require("../../constants/Errors");
21
21
  const InfiniteScroll_1 = tslib_1.__importDefault(require("../../shared/InfiniteScroll"));
22
22
  const constants_1 = require("./constants");
23
+ const pubsub_js_1 = tslib_1.__importDefault(require("pubsub-js"));
24
+ const PubSub_1 = require("../../constants/PubSub");
23
25
  const classes = {
24
26
  root: `${constants_1.PREFIX}-root`,
25
27
  title: `${constants_1.PREFIX}-title`,
@@ -85,6 +87,8 @@ function CategoriesSuggestionWidget(inProps) {
85
87
  // HOOKS
86
88
  const theme = (0, material_1.useTheme)();
87
89
  const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
90
+ // REFS
91
+ const updatesSubscription = (0, react_1.useRef)(null);
88
92
  /**
89
93
  * Initialize component
90
94
  * Fetch data only if the component is not initialized and it is not loading data
@@ -102,6 +106,23 @@ function CategoriesSuggestionWidget(inProps) {
102
106
  });
103
107
  }
104
108
  }, [state.isLoadingNext, state.initialized, limit, dispatch]);
109
+ /**
110
+ * Subscriber for pubsub callback
111
+ */
112
+ const onEditCategoryHandler = (0, react_1.useCallback)((_msg, edited) => {
113
+ const _categories = [...state.results];
114
+ const updatedCategories = _categories.map((c) => (c.id === edited.id ? Object.assign(Object.assign({}, c), edited) : c));
115
+ dispatch({ type: widget_1.actionWidgetTypes.SET_RESULTS, payload: { results: updatedCategories } });
116
+ }, [dispatch, state.results]);
117
+ /**
118
+ * On mount, subscribe to receive event updates (only edit)
119
+ */
120
+ (0, react_1.useEffect)(() => {
121
+ updatesSubscription.current = pubsub_js_1.default.subscribe(`${PubSub_1.SCTopicType.CATEGORY}.${PubSub_1.SCCategoryEventType.EDIT}`, onEditCategoryHandler);
122
+ return () => {
123
+ updatesSubscription.current && pubsub_js_1.default.unsubscribe(updatesSubscription.current);
124
+ };
125
+ }, [onEditCategoryHandler]);
105
126
  // EFFECTS
106
127
  (0, react_1.useEffect)(() => {
107
128
  let _t;
@@ -37,6 +37,6 @@ function ComposerTypeButtonGroup(props) {
37
37
  const handleChange = (0, react_1.useCallback)((event, value) => {
38
38
  onChange && onChange(value);
39
39
  }, [onChange]);
40
- return (0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onChange: handleChange, exclusive: true, value: value }, rest, { children: [hasPostType && (0, jsx_runtime_1.jsx)(material_1.ToggleButton, Object.assign({ value: Composer_1.COMPOSER_TYPE_POST }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.typeSwitch.post", defaultMessage: "ui.composer.typeSwitch.post" }) })), hasDiscussionType && (0, jsx_runtime_1.jsx)(material_1.ToggleButton, Object.assign({ value: Composer_1.COMPOSER_TYPE_DISCUSSION }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.typeSwitch.discussion", defaultMessage: "ui.composer.typeSwitch.discussion" }) })), hasPollType && (0, jsx_runtime_1.jsx)(material_1.ToggleButton, Object.assign({ value: Composer_1.COMPOSER_TYPE_POLL }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.typeSwitch.poll", defaultMessage: "ui.composer.typeSwitch.poll" }) }))] }));
40
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onChange: handleChange, exclusive: true, value: value }, rest, { children: [hasPostType && ((0, jsx_runtime_1.jsx)(material_1.ToggleButton, Object.assign({ value: Composer_1.COMPOSER_TYPE_POST }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.typeSwitch.post", defaultMessage: "ui.composer.typeSwitch.post" }) }))), hasDiscussionType && ((0, jsx_runtime_1.jsx)(material_1.ToggleButton, Object.assign({ value: Composer_1.COMPOSER_TYPE_DISCUSSION }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.typeSwitch.discussion", defaultMessage: "ui.composer.typeSwitch.discussion" }) }))), hasPostType && hasPollType && ((0, jsx_runtime_1.jsx)(material_1.ToggleButton, Object.assign({ value: Composer_1.COMPOSER_TYPE_POLL }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.composer.typeSwitch.poll", defaultMessage: "ui.composer.typeSwitch.poll" }) })))] })));
41
41
  }
42
42
  exports.default = ComposerTypeButtonGroup;
@@ -1,5 +1,5 @@
1
1
  import { ButtonProps } from '@mui/material/Button/Button';
2
- import { EventFormProps } from '../EventForm';
2
+ import { EventFormDialogProps } from '../EventFormDialog';
3
3
  export interface CreateEventButtonProps extends ButtonProps {
4
4
  /**
5
5
  * Overrides or extends the styles applied to the component.
@@ -10,7 +10,7 @@ export interface CreateEventButtonProps extends ButtonProps {
10
10
  * Props to spread to CreateGroup component
11
11
  * @default empty object
12
12
  */
13
- EventFormProps?: EventFormProps;
13
+ EventFormDialogComponentProps?: EventFormDialogProps;
14
14
  /**
15
15
  * Any other properties
16
16
  */
@@ -9,7 +9,7 @@ const react_core_1 = require("@selfcommunity/react-core");
9
9
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
10
  const react_1 = tslib_1.__importStar(require("react"));
11
11
  const react_intl_1 = require("react-intl");
12
- const EventForm_1 = tslib_1.__importDefault(require("../EventForm"));
12
+ const EventFormDialog_1 = tslib_1.__importDefault(require("../EventFormDialog"));
13
13
  const types_1 = require("@selfcommunity/types");
14
14
  const PREFIX = 'SCCreateEventButton';
15
15
  const classes = {
@@ -40,13 +40,13 @@ const Root = (0, styles_1.styled)(material_1.Button, {
40
40
  * @param inProps
41
41
  */
42
42
  function CreateEventButton(inProps) {
43
- var _a;
43
+ var _a, _b;
44
44
  //PROPS
45
45
  const props = (0, system_1.useThemeProps)({
46
46
  props: inProps,
47
47
  name: PREFIX
48
48
  });
49
- const { className, EventFormProps = {}, children } = props, rest = tslib_1.__rest(props, ["className", "EventFormProps", "children"]);
49
+ const { className, EventFormDialogComponentProps = {}, children } = props, rest = tslib_1.__rest(props, ["className", "EventFormDialogComponentProps", "children"]);
50
50
  // CONTEXT
51
51
  const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
52
52
  // STATE
@@ -78,6 +78,6 @@ function CreateEventButton(inProps) {
78
78
  /**
79
79
  * Renders root object
80
80
  */
81
- return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClick, variant: "contained", color: "secondary", startIcon: !EventFormProps.event && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "add" })) }, rest, { children: children !== null && children !== void 0 ? children : (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEventButton", defaultMessage: "ui.createEventButton" }) })), open && (0, jsx_runtime_1.jsx)(EventForm_1.default, Object.assign({}, EventFormProps, { open: true, onClose: handleClick }))] }));
81
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClick, variant: "contained", color: "secondary", startIcon: !((_b = EventFormDialogComponentProps.EventFormComponentProps) === null || _b === void 0 ? void 0 : _b.event) && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "add" })) }, rest, { children: children !== null && children !== void 0 ? children : (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEventButton", defaultMessage: "ui.createEventButton" }) })), open && (0, jsx_runtime_1.jsx)(EventFormDialog_1.default, Object.assign({}, EventFormDialogComponentProps, { open: true, onClose: handleClick }))] }));
82
82
  }
83
83
  exports.default = CreateEventButton;
@@ -0,0 +1,49 @@
1
+ import { ButtonProps } from '@mui/material/Button/Button';
2
+ import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
3
+ import { CreateLiveStreamDialogProps } from '../CreateLiveStreamDialog';
4
+ export interface CreateLiveStreamButtonProps extends ButtonProps {
5
+ /**
6
+ * Overrides or extends the styles applied to the component.
7
+ * @default null
8
+ */
9
+ className?: string;
10
+ /**
11
+ * Props to spread to CreateGroup component
12
+ * @default empty object
13
+ */
14
+ CreateLiveStreamDialogComponentProps?: CreateLiveStreamDialogProps;
15
+ /**
16
+ * On click callback function
17
+ * @default null
18
+ */
19
+ onButtonClick?: (event: any, reason: any) => void;
20
+ /**
21
+ * On success callback function
22
+ * @default null
23
+ */
24
+ onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
25
+ /**
26
+ * Any other properties
27
+ */
28
+ [p: string]: any;
29
+ }
30
+ /**
31
+ *> API documentation for the Community-JS CreateLiveStreamButton component. Learn about the available props and the CSS API.
32
+ *
33
+ #### Import
34
+ ```jsx
35
+ import {CreateLiveStreamButton} from '@selfcommunity/react-ui';
36
+ ```
37
+
38
+ #### Component Name
39
+ The name `SCCreateLiveStreamButton` can be used when providing style overrides in the theme.
40
+
41
+ #### CSS
42
+
43
+ |Rule Name|Global class|Description|
44
+ |---|---|---|
45
+ |root|.SCCreateLivestreamButton-root|Styles applied to the root element.|
46
+
47
+ * @param inProps
48
+ */
49
+ export default function CreateLiveStreamButton(inProps: CreateLiveStreamButtonProps): JSX.Element;
@@ -0,0 +1,94 @@
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 = tslib_1.__importStar(require("react"));
11
+ const react_intl_1 = require("react-intl");
12
+ const CreateLiveStreamDialog_1 = tslib_1.__importDefault(require("../CreateLiveStreamDialog"));
13
+ const PREFIX = 'SCCreateLivestreamButton';
14
+ const classes = {
15
+ root: `${PREFIX}-root`
16
+ };
17
+ const Root = (0, styles_1.styled)(material_1.Button, {
18
+ name: PREFIX,
19
+ slot: 'Root',
20
+ overridesResolver: (props, styles) => styles.root
21
+ })(() => ({}));
22
+ /**
23
+ *> API documentation for the Community-JS CreateLiveStreamButton component. Learn about the available props and the CSS API.
24
+ *
25
+ #### Import
26
+ ```jsx
27
+ import {CreateLiveStreamButton} from '@selfcommunity/react-ui';
28
+ ```
29
+
30
+ #### Component Name
31
+ The name `SCCreateLiveStreamButton` can be used when providing style overrides in the theme.
32
+
33
+ #### CSS
34
+
35
+ |Rule Name|Global class|Description|
36
+ |---|---|---|
37
+ |root|.SCCreateLivestreamButton-root|Styles applied to the root element.|
38
+
39
+ * @param inProps
40
+ */
41
+ function CreateLiveStreamButton(inProps) {
42
+ var _a;
43
+ //PROPS
44
+ const props = (0, system_1.useThemeProps)({
45
+ props: inProps,
46
+ name: PREFIX
47
+ });
48
+ const { className, CreateLiveStreamDialogComponentProps = {}, onSuccess, children } = props, rest = tslib_1.__rest(props, ["className", "CreateLiveStreamDialogComponentProps", "onSuccess", "children"]);
49
+ // CONTEXT
50
+ const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
51
+ // STATE
52
+ const [open, setOpen] = react_1.default.useState(false);
53
+ // CONST
54
+ const authUserId = scUserContext.user ? scUserContext.user.id : null;
55
+ const { preferences, features } = (0, react_core_1.useSCPreferences)();
56
+ // TODO
57
+ const liveStreamEnabled = true;
58
+ /* const liveStreamEnabled = useMemo(
59
+ () =>
60
+ preferences &&
61
+ features &&
62
+ features.includes(SCFeatureName.LIVE_STREAM) &&
63
+ SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
64
+ preferences[SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value,
65
+ [preferences, features]
66
+ ); */
67
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
68
+ // @ts-ignore
69
+ const canCreateLiveStream = (0, react_1.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]);
70
+ /**
71
+ * Handle close
72
+ */
73
+ const handleClose = () => {
74
+ setOpen((o) => !o);
75
+ };
76
+ /**
77
+ * Handle close
78
+ */
79
+ const handleSuccess = (data) => {
80
+ onSuccess && onSuccess(data);
81
+ setOpen((o) => !o);
82
+ };
83
+ /**
84
+ * If there's no authUserId, component is hidden.
85
+ */
86
+ if (!liveStreamEnabled || !canCreateLiveStream || !authUserId) {
87
+ return null;
88
+ }
89
+ /**
90
+ * Renders root object
91
+ */
92
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClose, variant: "contained", color: "secondary", startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "photo_camera" }) }, rest, { children: children !== null && children !== void 0 ? children : (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createEventButton.goLive", defaultMessage: "ui.createEventButton.goLive" }) })), open && (0, jsx_runtime_1.jsx)(CreateLiveStreamDialog_1.default, Object.assign({ open: true, onClose: handleClose, onSuccess: handleSuccess }, CreateLiveStreamDialogComponentProps))] }));
93
+ }
94
+ exports.default = CreateLiveStreamButton;
@@ -0,0 +1,3 @@
1
+ import CreateLiveStreamButton, { CreateLiveStreamButtonProps } from './CreateLiveStreamButton';
2
+ export default CreateLiveStreamButton;
3
+ export { CreateLiveStreamButtonProps };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const CreateLiveStreamButton_1 = tslib_1.__importDefault(require("./CreateLiveStreamButton"));
5
+ exports.default = CreateLiveStreamButton_1.default;
@@ -0,0 +1,51 @@
1
+ import { SCEventType, SCLiveStreamType } from '@selfcommunity/types';
2
+ import { BaseDialogProps } from '../../shared/BaseDialog';
3
+ export interface CreateLiveStreamDialogProps extends BaseDialogProps {
4
+ /**
5
+ * Overrides or extends the styles applied to the component.
6
+ * @default null
7
+ */
8
+ className?: string;
9
+ /**
10
+ * Open dialog
11
+ * @default true
12
+ */
13
+ open?: boolean;
14
+ /**
15
+ * On dialog close callback function
16
+ * @default null
17
+ */
18
+ onClose?: () => void;
19
+ /**
20
+ * On success callback function
21
+ * @default null
22
+ */
23
+ onSuccess?: (data: SCEventType | SCLiveStreamType) => void;
24
+ /**
25
+ * Any other properties
26
+ */
27
+ [p: string]: any;
28
+ }
29
+ /**
30
+ *> API documentation for the Community-JS CreateLiveStreamDialog component. Learn about the available props and the CSS API.
31
+ *
32
+ #### Import
33
+ ```jsx
34
+ import {CreateLivestreamDialog} from '@selfcommunity/react-ui';
35
+ ```
36
+
37
+ #### Component Name
38
+ The name `SCCreateLivestreamDialog` can be used when providing style overrides in the theme.
39
+
40
+ #### CSS
41
+
42
+ |Rule Name|Global class|Description|
43
+ |---|---|---|
44
+ |root|.SCCreateLivestreamDialog-root|Styles applied to the root element.|
45
+ |content|.SCCreateLivestreamDialog-content|Styles applied to the content element.|
46
+
47
+
48
+
49
+ * @param inProps
50
+ */
51
+ export default function CreateLiveStreamDialog(inProps: CreateLiveStreamDialogProps): JSX.Element;
@@ -0,0 +1,123 @@
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 react_1 = tslib_1.__importStar(require("react"));
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 types_1 = require("@selfcommunity/types");
10
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
11
+ const react_intl_1 = require("react-intl");
12
+ const BaseDialog_1 = tslib_1.__importDefault(require("../../shared/BaseDialog"));
13
+ const constants_1 = require("./constants");
14
+ const EventForm_1 = tslib_1.__importDefault(require("../EventForm"));
15
+ const LiveStreamSelector_1 = tslib_1.__importDefault(require("./LiveStreamSelector/LiveStreamSelector"));
16
+ const types_2 = require("./types");
17
+ const LiveStreamForm_1 = tslib_1.__importDefault(require("../LiveStreamForm"));
18
+ const Slide_1 = tslib_1.__importDefault(require("@mui/material/Slide"));
19
+ const material_1 = require("@mui/material");
20
+ const classes = {
21
+ root: `${constants_1.PREFIX}-root`,
22
+ title: `${constants_1.PREFIX}-title`,
23
+ content: `${constants_1.PREFIX}-content`
24
+ };
25
+ const Root = (0, styles_1.styled)(BaseDialog_1.default, {
26
+ name: constants_1.PREFIX,
27
+ slot: 'Root'
28
+ })(({ theme }) => ({
29
+ paddingBottom: '0px !important',
30
+ [`& .${classes.title}`]: {
31
+ display: 'flex'
32
+ },
33
+ [`& .${classes.content}`]: {
34
+ paddingBottom: 0
35
+ }
36
+ }));
37
+ const Transition = react_1.default.forwardRef(function Transition(props, ref) {
38
+ return (0, jsx_runtime_1.jsx)(Slide_1.default, Object.assign({ direction: "up", ref: ref }, props));
39
+ });
40
+ /**
41
+ *> API documentation for the Community-JS CreateLiveStreamDialog component. Learn about the available props and the CSS API.
42
+ *
43
+ #### Import
44
+ ```jsx
45
+ import {CreateLivestreamDialog} from '@selfcommunity/react-ui';
46
+ ```
47
+
48
+ #### Component Name
49
+ The name `SCCreateLivestreamDialog` can be used when providing style overrides in the theme.
50
+
51
+ #### CSS
52
+
53
+ |Rule Name|Global class|Description|
54
+ |---|---|---|
55
+ |root|.SCCreateLivestreamDialog-root|Styles applied to the root element.|
56
+ |content|.SCCreateLivestreamDialog-content|Styles applied to the content element.|
57
+
58
+
59
+
60
+ * @param inProps
61
+ */
62
+ function CreateLiveStreamDialog(inProps) {
63
+ //PROPS
64
+ const props = (0, system_1.useThemeProps)({
65
+ props: inProps,
66
+ name: constants_1.PREFIX
67
+ });
68
+ const { className, open = true, onClose, onSuccess } = props, rest = tslib_1.__rest(props, ["className", "open", "onClose", "onSuccess"]);
69
+ // CONTEXT
70
+ const scContext = (0, react_core_1.useSCContext)();
71
+ const scUserContext = (0, react_core_1.useSCUser)();
72
+ const { preferences, features } = (0, react_core_1.useSCPreferences)();
73
+ const liveStreamEnabled = (0, react_1.useMemo)(() => true,
74
+ /* preferences &&
75
+ features &&
76
+ features.includes(SCFeatureName.LIVE_STREAM) &&
77
+ SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
78
+ preferences[SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value*/ [preferences, features]);
79
+ const onlyStaffLiveStreamEnabled = (0, react_1.useMemo)(() => true /* preferences[SCPreferences.CONFIGURATIONS_LIVESTREAM_ONLY_STAFF_ENABLED].value */, [preferences]);
80
+ const canCreateLiveStream = (0, react_1.useMemo)(() => true /* liveStreamEnabled && (scUserContext?.user?.permission?.create_livestream || (onlyStaffLiveStreamEnabled && UserUtils.isStaff(scUserContext.user)))*/, [scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user, onlyStaffLiveStreamEnabled]);
81
+ console.log(canCreateLiveStream);
82
+ const eventsEnabled = (0, react_1.useMemo)(() => preferences &&
83
+ features &&
84
+ features.includes(types_1.SCFeatureName.TAGGING) &&
85
+ react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in preferences &&
86
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [preferences, features]);
87
+ const onlyStaffEventEnabled = (0, react_1.useMemo)(() => preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ONLY_STAFF_ENABLED].value, [preferences]);
88
+ const canCreateEvent = (0, react_1.useMemo)(() => { var _a, _b; return eventsEnabled && (((_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_event) || true || (onlyStaffEventEnabled && react_core_1.UserUtils.isStaff(scUserContext.user))); }, [scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user, eventsEnabled, onlyStaffEventEnabled]);
89
+ console.log(canCreateEvent);
90
+ const canCreateLiveStreamEvent = (0, react_1.useMemo)(() => Boolean(canCreateLiveStream && canCreateEvent), [canCreateEvent, canCreateLiveStream]);
91
+ console.log(canCreateLiveStreamEvent);
92
+ // STATE
93
+ const [step, setStep] = (0, react_1.useState)(canCreateLiveStreamEvent ? types_2.CreateLiveStreamStep.SELECT_TYPE : types_2.CreateLiveStreamStep.CREATE_LIVE);
94
+ const [liveType, setLiveType] = (0, react_1.useState)(canCreateLiveStreamEvent ? null : types_2.LiveStreamType.DIRECT_LIVE);
95
+ // HANDLER
96
+ const handleLiveTypeSelected = (0, react_1.useCallback)((l) => {
97
+ setLiveType(l);
98
+ }, []);
99
+ const handleLiveTypeSelectedNext = (0, react_1.useCallback)((l) => {
100
+ setLiveType(l);
101
+ setStep(types_2.CreateLiveStreamStep.CREATE_LIVE);
102
+ }, []);
103
+ const handleBack = (0, react_1.useCallback)((l) => {
104
+ setStep(types_2.CreateLiveStreamStep.SELECT_TYPE);
105
+ }, []);
106
+ const handleSubmit = (0, react_1.useCallback)((e) => {
107
+ onSuccess && onSuccess(e);
108
+ }, []);
109
+ (0, react_1.useEffect)(() => {
110
+ if (!canCreateLiveStreamEvent) {
111
+ setLiveType(types_2.LiveStreamType.DIRECT_LIVE);
112
+ }
113
+ }, [canCreateLiveStreamEvent]);
114
+ // user must be logged
115
+ if (!scUserContext.user) {
116
+ return null;
117
+ }
118
+ /**
119
+ * Renders root object
120
+ */
121
+ return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: 'md', title: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.title, component: 'span' }, { children: [step === types_2.CreateLiveStreamStep.CREATE_LIVE && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "arrow_back" }) }, { children: "Back" }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: 'span' }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createLivestreamDialog.title", defaultMessage: "ui.createLivestreamDialog.title" }) }))] })), fullWidth: true, open: open, onClose: onClose, className: (0, classnames_1.default)(classes.root, className), TransitionComponent: Transition, PaperProps: { elevation: 0 } }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.content }, { children: [step === types_2.CreateLiveStreamStep.SELECT_TYPE && ((0, jsx_runtime_1.jsx)(LiveStreamSelector_1.default, { liveSelected: liveType, onLiveSelected: handleLiveTypeSelected, onNext: handleLiveTypeSelectedNext })), step === types_2.CreateLiveStreamStep.CREATE_LIVE && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: liveType === types_2.LiveStreamType.EVENT_LIVE ? (0, jsx_runtime_1.jsx)(EventForm_1.default, { onSuccess: handleSubmit }) : (0, jsx_runtime_1.jsx)(LiveStreamForm_1.default, { onSuccess: handleSubmit }) }))] })) })));
122
+ }
123
+ exports.default = CreateLiveStreamDialog;
@@ -0,0 +1,46 @@
1
+ import { LiveStreamType } from '../types';
2
+ export interface LiveStreamSelectorProps {
3
+ /**
4
+ * Overrides or extends the styles applied to the component.
5
+ * @default null
6
+ */
7
+ className?: string;
8
+ /**
9
+ * Option selected
10
+ */
11
+ liveSelected?: LiveStreamType;
12
+ /**
13
+ * Callback on selected option
14
+ * @param LiveStreamType
15
+ */
16
+ onLiveSelected?: (live: LiveStreamType) => void;
17
+ /**
18
+ * On success callback function
19
+ * @default null
20
+ */
21
+ onNext?: (live: LiveStreamType) => void;
22
+ /**
23
+ * Any other properties
24
+ */
25
+ [p: string]: any;
26
+ }
27
+ /**
28
+ *> API documentation for the Community-JS LiveStreamSelector component. Learn about the available props and the CSS API.
29
+ *
30
+ #### Import
31
+ ```jsx
32
+ import {LiveStreamSelector} from '@selfcommunity/react-ui';
33
+ ```
34
+
35
+ #### Component Name
36
+ The name `SCLiveStreamSelector` can be used when providing style overrides in the theme.
37
+
38
+ #### CSS
39
+
40
+ |Rule Name|Global class|Description|
41
+ |---|---|---|
42
+ |root|.SCCreateLivestreamDialog-root|Styles applied to the root element.|
43
+
44
+ * @param inProps
45
+ */
46
+ export default function LiveStreamSelector(inProps: LiveStreamSelectorProps): JSX.Element;