@selfcommunity/react-ui 0.11.0-alpha.6 → 0.11.0-alpha.60

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 (163) hide show
  1. package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
  2. package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
  3. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
  4. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
  5. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +9 -1
  6. package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +1 -1
  7. package/lib/cjs/components/CreateEventButton/CreateEventButton.js +1 -1
  8. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
  9. package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
  10. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
  11. package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
  12. package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +10 -2
  13. package/lib/cjs/components/Editor/Editor.js +9 -9
  14. package/lib/cjs/components/Editor/nodes/HashtagNode.js +2 -0
  15. package/lib/cjs/components/Editor/nodes/MentionNode.js +2 -0
  16. package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
  17. package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.js +34 -0
  18. package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
  19. package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.js +2 -3
  20. package/lib/cjs/components/Event/Event.js +6 -3
  21. package/lib/cjs/components/EventForm/EventAddress.js +1 -1
  22. package/lib/cjs/components/EventForm/EventForm.js +40 -22
  23. package/lib/cjs/components/EventForm/utils.d.ts +1 -0
  24. package/lib/cjs/components/EventForm/utils.js +6 -1
  25. package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
  26. package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
  27. package/lib/cjs/components/EventHeader/EventHeader.js +3 -2
  28. package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +12 -12
  29. package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +8 -8
  30. package/lib/cjs/components/EventMembersWidget/types.d.ts +4 -5
  31. package/lib/cjs/components/EventMembersWidget/types.js +7 -7
  32. package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
  33. package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
  34. package/lib/cjs/components/Events/Events.d.ts +11 -0
  35. package/lib/cjs/components/Events/Events.js +21 -10
  36. package/lib/cjs/components/Events/OngoingEventsFilter.d.ts +8 -0
  37. package/lib/cjs/components/Events/OngoingEventsFilter.js +24 -0
  38. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +4 -1
  39. package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
  40. package/lib/cjs/components/Footer/Footer.js +9 -6
  41. package/lib/cjs/components/Footer/constants.d.ts +1 -0
  42. package/lib/cjs/components/Footer/constants.js +2 -1
  43. package/lib/cjs/components/GroupForm/GroupForm.js +2 -2
  44. package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
  45. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
  46. package/lib/cjs/components/Groups/Groups.js +18 -16
  47. package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +65 -6
  48. package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
  49. package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
  50. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
  51. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
  52. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
  53. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
  54. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +106 -0
  55. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
  56. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +37 -0
  57. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
  58. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
  59. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
  60. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
  61. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +62 -5
  62. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
  63. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
  64. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
  65. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +2 -2
  66. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
  67. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
  68. package/lib/cjs/components/Notification/Event/Event.js +20 -2
  69. package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
  70. package/lib/cjs/components/SearchDialog/SearchDialog.d.ts +4 -1
  71. package/lib/cjs/components/SearchDialog/SearchDialog.js +2 -2
  72. package/lib/cjs/constants/LiveStream.d.ts +1 -0
  73. package/lib/cjs/constants/LiveStream.js +2 -1
  74. package/lib/cjs/shared/EventActionsMenu/index.js +5 -1
  75. package/lib/cjs/shared/UpScalingTierBadge/index.js +9 -0
  76. package/lib/cjs/utils/buttonCounters.d.ts +1 -0
  77. package/lib/cjs/utils/buttonCounters.js +4 -3
  78. package/lib/cjs/utils/events.d.ts +1 -0
  79. package/lib/cjs/utils/events.js +6 -1
  80. package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
  81. package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
  82. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
  83. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
  84. package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +10 -2
  85. package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +1 -1
  86. package/lib/esm/components/CreateEventButton/CreateEventButton.js +1 -1
  87. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
  88. package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
  89. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
  90. package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
  91. package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +12 -4
  92. package/lib/esm/components/Editor/Editor.js +8 -8
  93. package/lib/esm/components/Editor/nodes/HashtagNode.js +2 -0
  94. package/lib/esm/components/Editor/nodes/MentionNode.js +2 -0
  95. package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
  96. package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.js +30 -0
  97. package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
  98. package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.js +1 -1
  99. package/lib/esm/components/Event/Event.js +6 -3
  100. package/lib/esm/components/EventForm/EventAddress.js +1 -1
  101. package/lib/esm/components/EventForm/EventForm.js +42 -24
  102. package/lib/esm/components/EventForm/utils.d.ts +1 -0
  103. package/lib/esm/components/EventForm/utils.js +4 -0
  104. package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
  105. package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
  106. package/lib/esm/components/EventHeader/EventHeader.js +3 -2
  107. package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +14 -14
  108. package/lib/esm/components/EventMembersWidget/TabContentComponent.js +9 -9
  109. package/lib/esm/components/EventMembersWidget/types.d.ts +4 -5
  110. package/lib/esm/components/EventMembersWidget/types.js +6 -6
  111. package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
  112. package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
  113. package/lib/esm/components/Events/Events.d.ts +11 -0
  114. package/lib/esm/components/Events/Events.js +22 -11
  115. package/lib/esm/components/Events/OngoingEventsFilter.d.ts +8 -0
  116. package/lib/esm/components/Events/OngoingEventsFilter.js +21 -0
  117. package/lib/esm/components/FeedObject/Actions/Share/Share.js +4 -1
  118. package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
  119. package/lib/esm/components/Footer/Footer.js +10 -7
  120. package/lib/esm/components/Footer/constants.d.ts +1 -0
  121. package/lib/esm/components/Footer/constants.js +1 -0
  122. package/lib/esm/components/GroupForm/GroupForm.js +2 -2
  123. package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
  124. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
  125. package/lib/esm/components/Groups/Groups.js +21 -19
  126. package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +67 -8
  127. package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
  128. package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
  129. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
  130. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
  131. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
  132. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
  133. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +103 -0
  134. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
  135. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +34 -0
  136. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
  137. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
  138. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
  139. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
  140. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +66 -9
  141. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
  142. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
  143. package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
  144. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +2 -2
  145. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
  146. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
  147. package/lib/esm/components/Notification/Event/Event.js +21 -3
  148. package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
  149. package/lib/esm/components/SearchDialog/SearchDialog.d.ts +4 -1
  150. package/lib/esm/components/SearchDialog/SearchDialog.js +2 -2
  151. package/lib/esm/constants/LiveStream.d.ts +1 -0
  152. package/lib/esm/constants/LiveStream.js +1 -0
  153. package/lib/esm/shared/EventActionsMenu/index.js +6 -2
  154. package/lib/esm/shared/UpScalingTierBadge/index.js +9 -0
  155. package/lib/esm/utils/buttonCounters.d.ts +1 -0
  156. package/lib/esm/utils/buttonCounters.js +3 -2
  157. package/lib/esm/utils/events.d.ts +1 -0
  158. package/lib/esm/utils/events.js +4 -0
  159. package/lib/umd/239.js +2 -0
  160. package/lib/umd/react-ui.js +1 -1
  161. package/package.json +14 -13
  162. package/lib/umd/653.js +0 -2
  163. /package/lib/umd/{653.js.LICENSE.txt → 239.js.LICENSE.txt} +0 -0
@@ -21,10 +21,13 @@ const Skeleton_1 = tslib_1.__importDefault(require("../Events/Skeleton"));
21
21
  const constants_1 = require("./constants");
22
22
  const LocationEventsFilter_1 = tslib_1.__importDefault(require("./LocationEventsFilter"));
23
23
  const PastEventsFilter_1 = tslib_1.__importDefault(require("./PastEventsFilter"));
24
+ const OngoingEventsFilter_1 = tslib_1.__importDefault(require("./OngoingEventsFilter"));
24
25
  const classes = {
25
26
  root: `${constants_1.PREFIX}-root`,
26
27
  filters: `${constants_1.PREFIX}-filters`,
27
28
  events: `${constants_1.PREFIX}-events`,
29
+ sectionTitle: `${constants_1.PREFIX}-section-title`,
30
+ divider: `${constants_1.PREFIX}-divider`,
28
31
  item: `${constants_1.PREFIX}-item`,
29
32
  itemSkeleton: `${constants_1.PREFIX}-item-skeleton`,
30
33
  noResults: `${constants_1.PREFIX}-no-results`,
@@ -32,7 +35,7 @@ const classes = {
32
35
  search: `${constants_1.PREFIX}-search`
33
36
  };
34
37
  const options = [
35
- { value: types_1.SCEventDateFilterType.ANY, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.any", defaultMessage: "ui.events.select.any" }) },
38
+ { value: types_1.SCEventDateFilterType.ALL, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.any", defaultMessage: "ui.events.select.any" }) },
36
39
  { value: types_1.SCEventDateFilterType.TODAY, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.today", defaultMessage: "ui.events.select.today" }) },
37
40
  { value: types_1.SCEventDateFilterType.TOMORROW, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.tomorrow", defaultMessage: "ui.events.select.tomorrow" }) },
38
41
  { value: types_1.SCEventDateFilterType.THIS_WEEK, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.select.thisWeek", defaultMessage: "ui.events.select.thisWeek" }) },
@@ -46,7 +49,7 @@ const Root = (0, material_1.styled)(material_1.Box, {
46
49
  exports.EventsChipRoot = (0, material_1.styled)(material_1.Chip, {
47
50
  name: constants_1.PREFIX,
48
51
  slot: 'EventsChipRoot',
49
- shouldForwardProp: (prop) => prop !== 'showFollowed' && prop !== 'showPastEvents'
52
+ shouldForwardProp: (prop) => prop !== 'showFollowed' && prop !== 'showPastEvents' && prop !== 'showOngoingEvents'
50
53
  })(() => ({}));
51
54
  /**
52
55
  * > API documentation for the Community-JS Events component. Learn about the available props and the CSS API.
@@ -81,7 +84,7 @@ function Events(inProps) {
81
84
  props: inProps,
82
85
  name: constants_1.PREFIX
83
86
  });
84
- const { endpoint = api_services_1.Endpoints.SearchEvents, endpointQueryParams = { limit: 8, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, className, EventComponentProps = { elevation: 0, square: true }, EventsSkeletonComponentProps = {}, EventSkeletonComponentProps = { elevation: 0, square: true }, GridContainerComponentProps = {}, GridItemComponentProps = {}, showFilters = false, filters, general = true } = props, rest = tslib_1.__rest(props, ["endpoint", "endpointQueryParams", "className", "EventComponentProps", "EventsSkeletonComponentProps", "EventSkeletonComponentProps", "GridContainerComponentProps", "GridItemComponentProps", "showFilters", "filters", "general"]);
87
+ const { endpoint = api_services_1.Endpoints.SearchEvents, endpointQueryParams = { limit: 8, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, className, EventComponentProps = { elevation: 0, square: true }, EventsSkeletonComponentProps = {}, EventSkeletonComponentProps = { elevation: 0, square: true }, GridContainerComponentProps = {}, GridItemComponentProps = {}, CreateEventButtonProps = {}, showFilters = false, filters, general = true, hideTitle = false } = props, rest = tslib_1.__rest(props, ["endpoint", "endpointQueryParams", "className", "EventComponentProps", "EventsSkeletonComponentProps", "EventSkeletonComponentProps", "GridContainerComponentProps", "GridItemComponentProps", "CreateEventButtonProps", "showFilters", "filters", "general", "hideTitle"]);
85
88
  // STATE
86
89
  const [events, setEvents] = (0, react_1.useState)([]);
87
90
  const [loading, setLoading] = (0, react_1.useState)(true);
@@ -91,7 +94,9 @@ function Events(inProps) {
91
94
  const [location, setLocation] = (0, react_1.useState)(types_1.SCEventLocationFilterType.ANY);
92
95
  const [showFollowed, setShowFollowed] = (0, react_1.useState)(false);
93
96
  const [showPastEvents, setShowPastEvents] = (0, react_1.useState)(false);
97
+ const [showOngoingEvents, setShowOngoingEvents] = (0, react_1.useState)(false);
94
98
  const [showMyEvents, setShowMyEvents] = (0, react_1.useState)(false);
99
+ const showUserEvents = !general && (events.length || (!events.length && (showPastEvents || showMyEvents || location !== types_1.SCEventLocationFilterType.ANY)));
95
100
  // CONTEXT
96
101
  const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
97
102
  const scPreferencesContext = (0, react_1.useContext)(react_core_1.SCPreferencesContext);
@@ -118,6 +123,12 @@ function Events(inProps) {
118
123
  const handleDeletePastClick = () => {
119
124
  setShowPastEvents(false);
120
125
  };
126
+ const handleChipOngoingClick = () => {
127
+ setShowOngoingEvents(!showOngoingEvents);
128
+ };
129
+ const handleDeleteOngoingClick = () => {
130
+ setShowOngoingEvents(false);
131
+ };
121
132
  /**
122
133
  * Fetches events list
123
134
  */
@@ -128,7 +139,7 @@ function Events(inProps) {
128
139
  url: endpoint.url({}),
129
140
  method: endpoint.method,
130
141
  params: Object.assign(Object.assign({}, endpointQueryParams), (general
131
- ? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (query && { search: query })), (dateSearch !== types_1.SCEventDateFilterType.ANY && { date_filter: dateSearch })), (location !== types_1.SCEventLocationFilterType.ANY && { location })), (showFollowed && { follows: showFollowed })), (showPastEvents && { date_filter: types_1.SCEventDateFilterType.PAST })) : Object.assign(Object.assign(Object.assign({ subscription_status: types_1.SCEventSubscriptionStatusType.GOING }, (location !== types_1.SCEventLocationFilterType.ANY && { location })), (showPastEvents && { past: showPastEvents })), (showMyEvents && { created_by: authUserId }))))
142
+ ? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (query && { search: query })), (dateSearch !== types_1.SCEventDateFilterType.ALL && { date_filter: dateSearch })), (location !== types_1.SCEventLocationFilterType.ANY && { location })), (showFollowed && { follows: showFollowed })), (showOngoingEvents && { date_filter: types_1.SCEventDateFilterType.NOT_PAST })) : Object.assign(Object.assign(Object.assign({ subscription_status: types_1.SCEventSubscriptionStatusType.GOING }, (location !== types_1.SCEventLocationFilterType.ANY && { location })), (showPastEvents && { past: showPastEvents })), (showMyEvents && { created_by: authUserId }))))
132
143
  })
133
144
  .then((res) => {
134
145
  setEvents(res.data.results);
@@ -149,7 +160,7 @@ function Events(inProps) {
149
160
  else {
150
161
  fetchEvents();
151
162
  }
152
- }, [contentAvailability, authUserId, dateSearch, location, showFollowed, showPastEvents, showMyEvents]);
163
+ }, [contentAvailability, authUserId, dateSearch, location, showFollowed, showPastEvents, showMyEvents, showOngoingEvents]);
153
164
  /**
154
165
  * Subscriber for pubsub callback
155
166
  */
@@ -212,24 +223,24 @@ function Events(inProps) {
212
223
  /**
213
224
  * Renders events list
214
225
  */
215
- const c = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot, { color: showMyEvents ? 'secondary' : 'default', variant: showMyEvents ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByCreatedByMe", defaultMessage: "ui.events.filterByCreatedByMe" }), onClick: () => setShowMyEvents(!showMyEvents),
226
+ const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : showUserEvents ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot, { color: showMyEvents ? 'secondary' : 'default', variant: showMyEvents ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByCreatedByMe", defaultMessage: "ui.events.filterByCreatedByMe" }), onClick: () => setShowMyEvents(!showMyEvents),
216
227
  // @ts-expect-error this is needed to use showFollowed into SCEvents
217
- showFollowed: showMyEvents, deleteIcon: showMyEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showMyEvents ? () => setShowMyEvents(false) : null, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 3 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.search, size: 'small', fullWidth: true, value: query, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
228
+ showFollowed: showMyEvents, deleteIcon: showMyEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showMyEvents ? () => setShowMyEvents(false) : null, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: loading }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) }))] })) : general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 3 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.search, size: 'small', fullWidth: true, value: query, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
218
229
  e.preventDefault();
219
230
  if (e.key === 'Enter') {
220
231
  fetchEvents();
221
232
  }
222
233
  }, InputProps: {
223
234
  endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: isMobile ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => fetchEvents(), disabled: loading }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", variant: "contained", color: "secondary", onClick: () => fetchEvents(), endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }), disabled: loading })) })))
224
- } }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ disabled: showPastEvents || loading, size: 'small', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ value: option.value }, { children: [(0, jsx_runtime_1.jsx)(material_1.Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) })), authUserId && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot, { color: showFollowed ? 'secondary' : 'default', variant: showFollowed ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByFollowedInterest", defaultMessage: "ui.events.filterByFollowedInterest" }), onClick: handleChipClick,
235
+ } }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ disabled: showOngoingEvents || loading, size: 'small', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }), value: dateSearch, onChange: handleOnChangeTimeFrame, renderValue: (selected) => options.find((option) => option.value === selected).label }, { children: options.map((option) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ value: option.value }, { children: [(0, jsx_runtime_1.jsx)(material_1.Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: (0, jsx_runtime_1.jsx)(LocationEventsFilter_1.default, { value: location, disabled: loading, handleOnChange: handleOnChangeLocation }) })), authUserId && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(exports.EventsChipRoot, { color: showFollowed ? 'secondary' : 'default', variant: showFollowed ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByFollowedInterest", defaultMessage: "ui.events.filterByFollowedInterest" }), onClick: handleChipClick,
225
236
  // @ts-expect-error this is needed to use showFollowed into SCEvents
226
- showFollowed: showFollowed, deleteIcon: showFollowed ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showFollowed ? handleDeleteClick : null, disabled: loading }) }))), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(PastEventsFilter_1.default, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, disabled: dateSearch !== types_1.SCEventDateFilterType.ANY || loading }) }))] })) }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({}, EventsSkeletonComponentProps, { EventSkeletonProps: EventSkeletonComponentProps }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !events.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (onlyStaffEnabled && react_core_1.UserUtils.isStaff(scUserContext.user)) || !onlyStaffEnabled ? (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, {}) : null })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.noEvents.title", defaultMessage: "ui.events.noEvents.title" }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (onlyStaffEnabled && react_core_1.UserUtils.isStaff(scUserContext.user)) || !onlyStaffEnabled ? (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, {}) : null })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.noEvents.title.personal", defaultMessage: "ui.events.noEvents.title.personal" }) }))] })) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.events }, GridContainerComponentProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [events.map((event) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, className: classes.item }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Event_1.default, Object.assign({ event: event, eventId: event.id }, EventComponentProps)) }), event.id))), authUserId && events.length % 2 !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, className: classes.itemSkeleton }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, Object.assign({ variant: "outlined", color: "primary", size: "small" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.skeleton.action.add", defaultMessage: "ui.events.skeleton.action.add" }) })) })) }), 'skeleton-item'))] }) })), Boolean(next) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.button.seeMore", defaultMessage: "ui.events.button.seeMore" }) })))] })) })) })] }));
237
+ showFollowed: showFollowed, deleteIcon: showFollowed ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showFollowed ? handleDeleteClick : null, disabled: loading }) }))), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(OngoingEventsFilter_1.default, { showOngoingEvents: showOngoingEvents, handleClick: handleChipOngoingClick, handleDeleteClick: handleDeleteOngoingClick, disabled: dateSearch !== types_1.SCEventDateFilterType.ALL || loading }) }))] })) : null }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, Object.assign({}, EventsSkeletonComponentProps, { EventSkeletonProps: EventSkeletonComponentProps }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !events.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (onlyStaffEnabled && react_core_1.UserUtils.isStaff(scUserContext.user)) || !onlyStaffEnabled ? ((0, jsx_runtime_1.jsx)(CreateEventButton_1.default, Object.assign({}, CreateEventButtonProps))) : null })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.noEvents.title", defaultMessage: "ui.events.noEvents.title" }) }))] })) : showUserEvents ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.noEvents.title.personal", defaultMessage: "ui.events.noEvents.title.personal" }) })) })) : null }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.events }, GridContainerComponentProps, { children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [events.map((event) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, className: classes.item }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Event_1.default, Object.assign({ event: event, eventId: event.id }, EventComponentProps)) }), event.id))), authUserId && events.length % 2 !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, className: classes.itemSkeleton }, GridItemComponentProps, { children: (0, jsx_runtime_1.jsx)(Event_1.EventSkeleton, Object.assign({}, EventSkeletonComponentProps, { skeletonsAnimation: false, actions: (0, jsx_runtime_1.jsx)(CreateEventButton_1.default, Object.assign({ variant: "outlined", color: "primary", size: "small" }, CreateEventButtonProps, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.skeleton.action.add", defaultMessage: "ui.events.skeleton.action.add" }) })) })) }), 'skeleton-item'))] }) })), Boolean(next) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", variant: "text", onClick: handleNext, className: classes.showMore }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.button.seeMore", defaultMessage: "ui.events.button.seeMore" }) })))] })) })) })] }));
227
238
  /**
228
239
  * Renders root object (if content availability community option is false and user is anonymous, component is hidden)
229
240
  */
230
241
  if (!contentAvailability && !scUserContext.user) {
231
242
  return null;
232
243
  }
233
- return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: c })));
244
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: showUserEvents && !hideTitle ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.sectionTitle }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.myEvents.title", defaultMessage: "ui.events.myEvents.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.divider })] })) : general ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", className: classes.sectionTitle }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.allEvents.title", defaultMessage: "ui.events.allEvents.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Divider, { className: classes.divider })] })) : null }), content] })));
234
245
  }
235
246
  exports.default = Events;
@@ -0,0 +1,8 @@
1
+ import { ChipProps } from '@mui/material';
2
+ export interface OngoingEventsFilterProps extends ChipProps {
3
+ autoHide?: boolean;
4
+ showOngoingEvents: boolean;
5
+ handleClick: () => void;
6
+ handleDeleteClick?: () => void;
7
+ }
8
+ export default function OngoingEventsFilter(inProps: OngoingEventsFilterProps): JSX.Element;
@@ -0,0 +1,24 @@
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 react_intl_1 = require("react-intl");
7
+ const constants_1 = require("./constants");
8
+ const Events_1 = require("./Events");
9
+ function OngoingEventsFilter(inProps) {
10
+ // PROPS
11
+ const props = (0, material_1.useThemeProps)({
12
+ props: inProps,
13
+ name: constants_1.PREFIX
14
+ });
15
+ const { autoHide = false, showOngoingEvents, handleClick, handleDeleteClick } = props, rest = tslib_1.__rest(props, ["autoHide", "showOngoingEvents", "handleClick", "handleDeleteClick"]);
16
+ if (autoHide) {
17
+ return null;
18
+ }
19
+ return ((0, jsx_runtime_1.jsx)(Events_1.EventsChipRoot, Object.assign({ color: showOngoingEvents ? 'secondary' : 'default', variant: showOngoingEvents ? 'filled' : 'outlined', label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.events.filterByOngoingEvents", defaultMessage: "ui.events.filterByOngoingEvents" }), onClick: handleClick,
20
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
21
+ // @ts-ignore
22
+ showOngoingEvents: showOngoingEvents, deleteIcon: showOngoingEvents ? (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) : null, onDelete: showOngoingEvents ? handleDeleteClick : undefined }, rest)));
23
+ }
24
+ exports.default = OngoingEventsFilter;
@@ -75,6 +75,9 @@ function Share(props) {
75
75
  const showShareAction = (0, react_1.useMemo)(() => {
76
76
  return !scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_POST_ONLY_STAFF_ENABLED].value || react_core_1.UserUtils.isStaff(scUserContext.user);
77
77
  }, [scPreferencesContext, scUserContext.user]);
78
+ const showSocialShareActions = (0, react_1.useMemo)(() => {
79
+ return scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value;
80
+ }, [scPreferencesContext]);
78
81
  // INTL
79
82
  const intl = (0, react_intl_1.useIntl)();
80
83
  // HANDLERS
@@ -190,7 +193,7 @@ function Share(props) {
190
193
  return audience;
191
194
  }
192
195
  function renderShareMenuItems() {
193
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(!feedObject.group || isGroupPublic) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showShareAction && ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, Object.assign({ onClick: () => share(false) }, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "redo" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.shareNow", defaultMessage: "ui.feedObject.share.shareNow" }) })] }))), facebookShareEnabled && ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, Object.assign({ onClick: () => window.open(SocialShare_1.FACEBOOK_SHARE + url, 'facebook-share-dialog', 'width=626,height=436') }, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "facebook" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.facebook", defaultMessage: "ui.feedObject.share.facebook" }) })] }))), xShareEnabled && ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, Object.assign({ onClick: () => window.open(SocialShare_1.X_SHARE + url, 'x-share-dialog', 'width=626,height=436') }, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "twitter" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.x", defaultMessage: "ui.feedObject.share.x" }) })] }))), linkedinShareEnabled && ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, Object.assign({ onClick: () => window.open(SocialShare_1.LINKEDIN_SHARE + url, 'linkedin-share-dialog', 'width=626,height=436') }, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "linkedin" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.linkedin", defaultMessage: "ui.feedObject.share.linkedin" }) })] })))] })), (0, jsx_runtime_1.jsxs)(MenuItem_1.default, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "link" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.permanentLink", defaultMessage: "ui.feedObject.share.permanentLink" }), onClick: () => getPermalink() })] })] }));
196
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(!feedObject.group || isGroupPublic) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showShareAction && ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, Object.assign({ onClick: () => share(false) }, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "redo" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.shareNow", defaultMessage: "ui.feedObject.share.shareNow" }) })] }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: showSocialShareActions && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [facebookShareEnabled && ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, Object.assign({ onClick: () => window.open(SocialShare_1.FACEBOOK_SHARE + url, 'facebook-share-dialog', 'width=626,height=436') }, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "facebook" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.facebook", defaultMessage: "ui.feedObject.share.facebook" }) })] }))), xShareEnabled && ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, Object.assign({ onClick: () => window.open(SocialShare_1.X_SHARE + url, 'x-share-dialog', 'width=626,height=436') }, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "twitter" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.x", defaultMessage: "ui.feedObject.share.x" }) })] }))), linkedinShareEnabled && ((0, jsx_runtime_1.jsxs)(MenuItem_1.default, Object.assign({ onClick: () => window.open(SocialShare_1.LINKEDIN_SHARE + url, 'linkedin-share-dialog', 'width=626,height=436') }, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "linkedin" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.linkedin", defaultMessage: "ui.feedObject.share.linkedin" }) })] })))] })) })] })), (0, jsx_runtime_1.jsxs)(MenuItem_1.default, { children: [(0, jsx_runtime_1.jsx)(ListItemIcon_1.default, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "link" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.feedObject.share.permanentLink", defaultMessage: "ui.feedObject.share.permanentLink" }), onClick: () => getPermalink() })] })] }));
194
197
  }
195
198
  /**
196
199
  * Renders vote action if withAction==true
@@ -43,7 +43,7 @@ function Activities(props) {
43
43
  : comments_1.SCCommentsOrderBy.ADDED_AT_DESC
44
44
  });
45
45
  const objId = commentsObject.feedObject ? commentsObject.feedObject.id : null;
46
- const skeletonsCount = Math.min(3, commentsObject.feedObject ? commentsObject.feedObject.comment_count : 2);
46
+ const skeletonsCount = Math.min(2, commentsObject.feedObject ? commentsObject.feedObject.comment_count : 2);
47
47
  const existFeedObjectActivities = feedObjectActivities && feedObjectActivities.length > 0;
48
48
  /**
49
49
  * Sync activities type if prop change
@@ -22,7 +22,7 @@ const classes = {
22
22
  const Root = (0, styles_1.styled)(material_1.Box, {
23
23
  name: constants_1.PREFIX,
24
24
  slot: 'Root'
25
- })(({ theme }) => ({}));
25
+ })(() => ({}));
26
26
  /**
27
27
  * > API documentation for the Community-JS Footer component. Learn about the available props and the CSS API.
28
28
  *
@@ -57,12 +57,13 @@ function Footer(inProps) {
57
57
  });
58
58
  const { className, menu = null, startActions = null, endActions = null } = props, rest = tslib_1.__rest(props, ["className", "menu", "startActions", "endActions"]);
59
59
  // PREFERENCES
60
- const scPreferences = (0, react_core_1.useSCPreferences)();
60
+ const { preferences } = (0, react_core_1.useSCPreferences)();
61
61
  const copyright = (0, react_1.useMemo)(() => {
62
- return scPreferences.preferences && react_core_1.SCPreferences.TEXT_APPLICATION_COPYRIGHT in scPreferences.preferences
63
- ? scPreferences.preferences[react_core_1.SCPreferences.TEXT_APPLICATION_COPYRIGHT].value.replace('$year', new Date().getFullYear())
62
+ return preferences && react_core_1.SCPreferences.TEXT_APPLICATION_COPYRIGHT in preferences
63
+ ? preferences[react_core_1.SCPreferences.TEXT_APPLICATION_COPYRIGHT].value.replace('$year', new Date().getFullYear())
64
64
  : null;
65
- }, [scPreferences.preferences]);
65
+ }, [preferences]);
66
+ const exploreStreamEnabled = preferences[react_core_1.SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value;
66
67
  // STATE
67
68
  const [_menu, setMenu] = (0, react_1.useState)(menu);
68
69
  const [loading, setLoading] = (0, react_1.useState)(!menu);
@@ -95,6 +96,8 @@ function Footer(inProps) {
95
96
  if (loading) {
96
97
  return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
97
98
  }
98
- return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({}, rest, { className: (0, classnames_1.default)(classes.root, className) }, { children: [startActions, (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.itemList }, { children: (0, utils_1.sortByAttr)(_menu.items, 'order').map((item, index) => ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, className: classes.item, to: item.url, variant: "text" }, { children: item.label }), item.id))) })), endActions, (0, jsx_runtime_1.jsx)(material_1.Typography, { textAlign: "center", className: classes.copyright, variant: "body2", dangerouslySetInnerHTML: { __html: copyright } })] })));
99
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({}, rest, { className: (0, classnames_1.default)(classes.root, className) }, { children: [startActions, (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.itemList }, { children: (0, utils_1.sortByAttr)(_menu.items, 'order')
100
+ .filter((item) => exploreStreamEnabled || item.url !== constants_1.EXPLORE_MENU_ITEM)
101
+ .map((item, index) => ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, className: classes.item, to: item.url, variant: "text" }, { children: item.label }), item.id))) })), endActions, (0, jsx_runtime_1.jsx)(material_1.Typography, { textAlign: "center", className: classes.copyright, variant: "body2", dangerouslySetInnerHTML: { __html: copyright } })] })));
99
102
  }
100
103
  exports.default = Footer;
@@ -1 +1,2 @@
1
1
  export declare const PREFIX = "SCFooter";
2
+ export declare const EXPLORE_MENU_ITEM = "/explore/";
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PREFIX = void 0;
3
+ exports.EXPLORE_MENU_ITEM = exports.PREFIX = void 0;
4
4
  exports.PREFIX = 'SCFooter';
5
+ exports.EXPLORE_MENU_ITEM = '/explore/';
@@ -195,10 +195,10 @@ function GroupForm(inProps) {
195
195
  }
196
196
  groupService
197
197
  .then((data) => {
198
- onSuccess && onSuccess(data);
198
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(data);
199
199
  notifyChanges(data);
200
- onClose && onClose();
201
200
  setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: false })));
201
+ onClose === null || onClose === void 0 ? void 0 : onClose();
202
202
  })
203
203
  .catch((e) => {
204
204
  setError(Object.assign(Object.assign({}, error), (0, api_services_1.formatHttpErrorCode)(e)));
@@ -195,7 +195,7 @@ function GroupInvitedWidget(inProps) {
195
195
  setOpenDialog((prev) => !prev);
196
196
  };
197
197
  // RENDER
198
- if ((!state.count && state.initialized) || !contentAvailability || !scGroup || !state.count || !state.results.length || !isGroupAdmin) {
198
+ if ((!state.count && state.initialized) || (!contentAvailability && !scUserContext.user) || !scGroup || !isGroupAdmin) {
199
199
  return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
200
200
  }
201
201
  if (!state.initialized) {
@@ -181,7 +181,7 @@ function GroupRequestsWidget(inProps) {
181
181
  onSubscribeActon && onSubscribeActon(user);
182
182
  }, [dispatch, state.count, state.results, onSubscribeActon]);
183
183
  // RENDER
184
- if ((!state.count && state.initialized) || !contentAvailability || !scGroup || !state.count || !state.results.length || !isGroupAdmin) {
184
+ if ((!state.count && state.initialized) || (!contentAvailability && !scUserContext.user) || !scGroup || !isGroupAdmin) {
185
185
  return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
186
186
  }
187
187
  if (!state.initialized) {
@@ -23,6 +23,7 @@ const PubSub_1 = require("../../constants/PubSub");
23
23
  const classes = {
24
24
  root: `${constants_1.PREFIX}-root`,
25
25
  filters: `${constants_1.PREFIX}-filter`,
26
+ search: `${constants_1.PREFIX}-search`,
26
27
  groups: `${constants_1.PREFIX}-groups`,
27
28
  item: `${constants_1.PREFIX}-item`,
28
29
  noResults: `${constants_1.PREFIX}-no-results`,
@@ -96,13 +97,14 @@ function Groups(inProps) {
96
97
  /**
97
98
  * Fetches groups list
98
99
  */
99
- const fetchGroups = () => {
100
+ const fetchGroups = (searchValue = search) => {
101
+ setLoading(true);
100
102
  let groupService;
101
103
  if (general) {
102
- groupService = api_services_1.GroupService.searchGroups(Object.assign(Object.assign({}, endpointQueryParams), (search !== '' && { search: search })));
104
+ groupService = api_services_1.GroupService.searchGroups(Object.assign(Object.assign({}, endpointQueryParams), (searchValue && { search: searchValue })));
103
105
  }
104
106
  else {
105
- groupService = api_services_1.GroupService.getUserGroups(Object.assign(Object.assign({}, endpointQueryParams), (search !== '' && { search: search })));
107
+ groupService = api_services_1.GroupService.getUserGroups(Object.assign(Object.assign({}, endpointQueryParams), (searchValue && { search: searchValue })));
106
108
  }
107
109
  groupService
108
110
  .then((res) => {
@@ -124,7 +126,7 @@ function Groups(inProps) {
124
126
  else {
125
127
  fetchGroups();
126
128
  }
127
- }, [contentAvailability, authUserId, search]);
129
+ }, [contentAvailability, authUserId]);
128
130
  /**
129
131
  * Subscriber for pubsub callback
130
132
  */
@@ -163,15 +165,6 @@ function Groups(inProps) {
163
165
  .catch((error) => console.log(error))
164
166
  .then(() => setLoading(false));
165
167
  }, [next]);
166
- /**
167
- * Get groups filtered
168
- */
169
- const getFilteredGroups = () => {
170
- if (search) {
171
- return groups.filter((g) => g.name.toLowerCase().includes(search.toLowerCase()));
172
- }
173
- return groups;
174
- };
175
168
  /**
176
169
  * Handle change filter name
177
170
  * @param event
@@ -182,12 +175,21 @@ function Groups(inProps) {
182
175
  /**
183
176
  * Renders groups list
184
177
  */
185
- const filteredGroups = (0, utils_1.sortByAttr)(getFilteredGroups(), 'order');
186
- const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && groups.length !== 0 && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, direction: "row", justifyContent: "center", alignItems: "center", className: classes.filters }, { children: filters ? (filters) : ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { fullWidth: true, value: search, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.filterByName", defaultMessage: "ui.groups.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading }) }))) }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !groups.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: !onlyStaffEnabled ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.title", defaultMessage: "ui.groups.noGroups.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.subtitle", defaultMessage: "ui.groups.noGroups.subtitle" }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.title.onlyStaff", defaultMessage: "ui.groups.noGroups.title.onlyStaff" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.subtitle.onlyStaff", defaultMessage: "ui.groups.noGroups.subtitle.onlyStaff" }) }))] })) }))) : ((0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: groups.length, next: handleNext, hasMoreNext: Boolean(next), loaderNext: isMobile ? (0, jsx_runtime_1.jsx)(Group_1.GroupSkeleton, {}) : (0, jsx_runtime_1.jsx)(Skeleton_1.default, { groupsNumber: 2 }), endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "div", className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.endMessage", defaultMessage: "ui.groups.endMessage", values: {
178
+ const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showFilters && (groups.length !== 0 || search.length !== 0) && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, direction: "row", justifyContent: "center", alignItems: "center", className: classes.filters }, { children: filters ? (filters) : ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.search, fullWidth: true, value: search, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.filterByName", defaultMessage: "ui.groups.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading, onKeyUp: (e) => {
179
+ e.preventDefault();
180
+ if (e.key === 'Enter') {
181
+ fetchGroups();
182
+ }
183
+ }, InputProps: {
184
+ endAdornment: ((0, jsx_runtime_1.jsxs)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: [search.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => {
185
+ setSearch('');
186
+ fetchGroups('');
187
+ }, disabled: loading }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "close" }) }))), isMobile ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => fetchGroups(), disabled: loading }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", variant: "contained", color: "secondary", onClick: () => fetchGroups(), endIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "search" }), disabled: loading }))] })))
188
+ } }) }))) }))), (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !groups.length ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.noResults }, { children: search.length ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noResults", defaultMessage: "ui.groups.noResults" }) }))) : !onlyStaffEnabled ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.title", defaultMessage: "ui.groups.noGroups.title" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.subtitle", defaultMessage: "ui.groups.noGroups.subtitle" }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.title.onlyStaff", defaultMessage: "ui.groups.noGroups.title.onlyStaff" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.noGroups.subtitle.onlyStaff", defaultMessage: "ui.groups.noGroups.subtitle.onlyStaff" }) }))] })) }))) : ((0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: groups.length, next: handleNext, hasMoreNext: Boolean(next), loaderNext: isMobile ? (0, jsx_runtime_1.jsx)(Group_1.GroupSkeleton, {}) : (0, jsx_runtime_1.jsx)(Skeleton_1.default, { groupsNumber: 2 }), endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "div", className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.groups.endMessage", defaultMessage: "ui.groups.endMessage", values: {
187
189
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
188
190
  // @ts-ignore
189
191
  button: (chunk) => ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ color: "secondary", variant: "text", onClick: handleScrollUp }, { children: chunk })))
190
- } }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.groups }, { children: filteredGroups.map((group) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 8, md: 6, className: classes.item }, { children: (0, jsx_runtime_1.jsx)(Group_1.default, Object.assign({ group: group, groupId: group.id, actionRedirect: true }, GroupComponentProps)) }), group.id))) })) }))) })] }));
192
+ } }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: { xs: 2 }, className: classes.groups }, { children: groups.map((group) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 8, md: 6, className: classes.item }, { children: (0, jsx_runtime_1.jsx)(Group_1.default, Object.assign({ group: group, groupId: group.id, actionRedirect: true }, GroupComponentProps)) }), group.id))) })) }))) })] }));
191
193
  // RENDER
192
194
  if (!contentAvailability && !scUserContext.user) {
193
195
  return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
@@ -6,6 +6,7 @@ const lab_1 = require("@mui/lab");
6
6
  const material_1 = require("@mui/material");
7
7
  const styles_1 = require("@mui/material/styles");
8
8
  const system_1 = require("@mui/system");
9
+ const types_1 = require("@selfcommunity/types");
9
10
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
11
  const react_1 = require("react");
11
12
  const react_intl_1 = require("react-intl");
@@ -17,8 +18,12 @@ const api_services_1 = require("@selfcommunity/api-services");
17
18
  const Errors_1 = require("../../constants/Errors");
18
19
  const utils_1 = require("@selfcommunity/utils");
19
20
  const deafultCover_1 = tslib_1.__importDefault(require("../../assets/deafultCover"));
21
+ const react_core_1 = require("@selfcommunity/react-core");
22
+ const constants_2 = require("../PlatformWidget/constants");
23
+ const constants_3 = require("../LiveStreamRoom/constants");
20
24
  const classes = {
21
25
  root: `${constants_1.PREFIX}-root`,
26
+ warning: `${constants_1.PREFIX}-warning`,
22
27
  form: `${constants_1.PREFIX}-form`,
23
28
  title: `${constants_1.PREFIX}-title`,
24
29
  cover: `${constants_1.PREFIX}-cover`,
@@ -74,14 +79,30 @@ const messages = (0, react_intl_1.defineMessages)({
74
79
  * @param inProps
75
80
  */
76
81
  function LiveStreamForm(inProps) {
77
- var _a, _b, _c;
82
+ var _a, _b, _c, _d;
78
83
  //PROPS
79
84
  const props = (0, system_1.useThemeProps)({
80
85
  props: inProps,
81
86
  name: constants_1.PREFIX
82
87
  });
83
88
  const { className, onSuccess, onError, liveStream = null } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "liveStream"]);
84
- // INTL
89
+ // HOOKS
90
+ const scUserContext = (0, react_core_1.useSCUser)();
91
+ const { preferences } = (0, react_core_1.useSCPreferences)();
92
+ const isCommunityOwner = (0, react_1.useMemo)(() => { var _a; return ((_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.id) === 1; }, [scUserContext.user]);
93
+ const isFreeTrialTier = (0, react_1.useMemo)(() => preferences &&
94
+ react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
95
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
96
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === types_1.SCCommunitySubscriptionTier.FREE_TRIAL, [preferences]);
97
+ const isEnterpriseTier = (0, react_1.useMemo)(() => preferences &&
98
+ react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER in preferences &&
99
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value &&
100
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SUBSCRIPTION_TIER].value === types_1.SCCommunitySubscriptionTier.ENTERPRISE, [preferences]);
101
+ const isStage = (0, react_1.useMemo)(() => preferences &&
102
+ react_core_1.SCPreferences.STATIC_ENVIRONMENT in preferences &&
103
+ preferences[react_core_1.SCPreferences.STATIC_ENVIRONMENT].value === types_1.SCCommunityEnvironment.STAGE, [preferences]);
104
+ const communityStackId = (0, react_1.useMemo)(() => preferences && react_core_1.SCPreferences.STATIC_ENVIRONMENT in preferences && preferences[react_core_1.SCPreferences.STATIC_STACKID].value, [preferences]);
105
+ const canCreateLiveStream = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_live_stream; }, [(_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission]);
85
106
  const intl = (0, react_intl_1.useIntl)();
86
107
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
87
108
  // @ts-ignore
@@ -98,6 +119,7 @@ function LiveStreamForm(inProps) {
98
119
  const [field, setField] = (0, react_1.useState)(initialFieldState);
99
120
  const [error, setError] = (0, react_1.useState)({});
100
121
  const [genericError, setGenericError] = (0, react_1.useState)(null);
122
+ const [timeRemaining, setTimeRemaining] = (0, react_1.useState)(null);
101
123
  const _backgroundCover = Object.assign({}, (field.cover ? { background: `url('${field.cover}') center / cover` } : { background: `url('${deafultCover_1.default}') no-repeat 0 0 / 100% 100%` }));
102
124
  const handleChangeCover = (0, react_1.useCallback)((cover) => {
103
125
  setField((prev) => (Object.assign(Object.assign({}, prev), { ['coverFile']: cover })));
@@ -175,18 +197,55 @@ function LiveStreamForm(inProps) {
175
197
  const handleChangeSettings = (0, react_1.useCallback)((data) => {
176
198
  setField((prev) => (Object.assign(Object.assign({}, prev), { settings: data })));
177
199
  }, [setField]);
200
+ const warning = (0, react_1.useMemo)(() => {
201
+ let _message;
202
+ if (isFreeTrialTier && isCommunityOwner && !isEnterpriseTier) {
203
+ _message = ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.selector.warningSubscriptionRequired", defaultMessage: "ui.liveStreamForm.selector.warningSubscriptionRequired", values: {
204
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
205
+ // @ts-ignore
206
+ link: (...chunks) => ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "_blank", to: `${isStage ? constants_2.HUB_STAGE : constants_2.HUB_PROD}dashboard/community/${communityStackId}/subscription` }, { children: chunks })))
207
+ } }));
208
+ }
209
+ else if (timeRemaining !== null && timeRemaining <= constants_3.WARNING_THRESHOLD_EXPIRING_SOON) {
210
+ if (timeRemaining <= 1) {
211
+ _message = ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.selector.warningMinutesExausted", defaultMessage: "ui.liveStreamForm.selector.warningMinutesExausted" }));
212
+ }
213
+ else if (timeRemaining <= constants_3.WARNING_THRESHOLD_EXPIRING_SOON) {
214
+ _message = ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.selector.warningRemainingMinutes", defaultMessage: "ui.liveStreamForm.selector.warningRemainingMinutes", values: { minutes: timeRemaining } }));
215
+ }
216
+ }
217
+ if (_message) {
218
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.warning }, { children: (0, jsx_runtime_1.jsx)(material_1.Alert, Object.assign({ variant: "filled", severity: "warning" }, { children: _message })) })));
219
+ }
220
+ return null;
221
+ }, [isFreeTrialTier, isCommunityOwner, timeRemaining]);
222
+ const fetchLivestreamStatus = () => {
223
+ api_services_1.LiveStreamApiClient.getMonthlyDuration()
224
+ .then((r) => {
225
+ setTimeRemaining(r.remaining_minutes);
226
+ })
227
+ .catch((error) => {
228
+ console.error('Error fetching live status:', error);
229
+ });
230
+ };
231
+ (0, react_1.useEffect)(() => {
232
+ fetchLivestreamStatus();
233
+ }, []);
178
234
  /**
179
235
  * Renders root object
180
236
  */
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: {
237
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [warning, (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
238
  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
239
  }, 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
240
  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
241
  }, 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 ||
242
+ endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) ? LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH - field.description.length : LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH })))
243
+ }, error: Boolean(((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) > LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH), helperText: ((_d = field.description) === null || _d === void 0 ? void 0 : _d.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
244
  field.isSubmitting ||
189
245
  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" })) })) }))] }))] })));
246
+ field.description.length > LiveStream_1.LIVE_STREAM_DESCRIPTION_MAX_LENGTH ||
247
+ isFreeTrialTier ||
248
+ timeRemaining <= constants_3.WARNING_THRESHOLD_EXPIRING_SOON ||
249
+ !canCreateLiveStream, 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
250
  }
192
251
  exports.default = LiveStreamForm;
@@ -24,7 +24,7 @@ const classes = {
24
24
  const Root = (0, styles_1.styled)(material_1.Box, {
25
25
  name: exports.PREFIX,
26
26
  slot: 'Root'
27
- })(({ theme }) => ({}));
27
+ })(() => ({}));
28
28
  /**
29
29
  *> API documentation for the Community-JS LiveStreamSettingsForm component. Learn about the available props and the CSS API.
30
30
  *
@@ -63,6 +63,11 @@ function LiveStreamSettingsForm(inProps) {
63
63
  features.includes(types_1.SCFeatureName.LIVE_STREAM) &&
64
64
  react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED in preferences &&
65
65
  preferences[react_core_1.SCPreferences.CONFIGURATIONS_LIVE_STREAM_ENABLED].value, [preferences, features]);
66
+ const liveStreamVideoConferenceEnabled = (0, react_1.useMemo)(() => preferences &&
67
+ features &&
68
+ features.includes(types_1.SCFeatureName.LIVE_STREAM) &&
69
+ react_core_1.SCPreferences.CONFIGURATIONS_LIVE_VIDEO_CONFERENCE_ENABLED in preferences &&
70
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_LIVE_VIDEO_CONFERENCE_ENABLED].value, [preferences, features]);
66
71
  const authUserId = (0, react_1.useMemo)(() => (scUserContext.user ? scUserContext.user.id : null), [scUserContext.user]);
67
72
  const isCommunityOwner = (0, react_1.useMemo)(() => authUserId === 1, [authUserId]);
68
73
  const isEnterpriseTier = (0, react_1.useMemo)(() => preferences &&
@@ -73,8 +78,8 @@ function LiveStreamSettingsForm(inProps) {
73
78
  /**
74
79
  * Renders root object
75
80
  */
76
- return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.muteParticipants), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['muteParticipants']: !(settings === null || settings === void 0 ? void 0 : settings.muteParticipants) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.muteParticipants", defaultMessage: "ui.liveStreamForm.muteParticipants" }) }))] })), isEnterpriseFeaturesVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableVideo), disabled: !isEnterpriseTier || !liveStreamEnabled, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableVideo']: !(settings === null || settings === void 0 ? void 0 : settings.disableVideo) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableVideo", defaultMessage: "ui.liveStreamForm.disableVideo" }) })), (0, jsx_runtime_1.jsx)(UpScalingTierBadge_1.default, { desiredTier: types_1.SCCommunitySubscriptionTier.ENTERPRISE })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen), disabled: !isEnterpriseTier || !liveStreamEnabled, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableShareScreen']: !(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableShareScreen", defaultMessage: "ui.liveStreamForm.disableShareScreen" }) })), (0, jsx_runtime_1.jsx)(UpScalingTierBadge_1.default, { desiredTier: types_1.SCCommunitySubscriptionTier.ENTERPRISE })] }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableChat), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableChat']: !(settings === null || settings === void 0 ? void 0 : settings.disableChat) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableChat", defaultMessage: "ui.liveStreamForm.disableChat" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['hideParticipantsList']: !(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.hideParticipantsList", defaultMessage: "ui.liveStreamForm.hideParticipantsList" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['automaticallyNotifyFollowers']: !(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.automaticallyNotifyFollowers", defaultMessage: "ui.liveStreamForm.automaticallyNotifyFollowers" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.showInProfile), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['showInProfile']: !(settings === null || settings === void 0 ? void 0 : settings.showInProfile) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.showInProfile", defaultMessage: "ui.liveStreamForm.showInProfile" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ className: classes.accessView }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, Object.assign({ id: "viewLabel" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }) })), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ name: "view", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }), labelId: "viewLabel", disabled: !liveStreamEnabled, fullWidth: true, value: (_a = settings === null || settings === void 0 ? void 0 : settings.view) !== null && _a !== void 0 ? _a : types_1.SCLiveStreamViewType.SPEAKER, onChange: (e) => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['view']: e.target.value })), displayEmpty: true, renderValue: (selected) => {
81
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: !(settings === null || settings === void 0 ? void 0 : settings.muteParticipants), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['muteParticipants']: !(settings === null || settings === void 0 ? void 0 : settings.muteParticipants) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.muteParticipants", defaultMessage: "ui.liveStreamForm.muteParticipants" }) }))] })), liveStreamEnabled && (isEnterpriseFeaturesVisible || liveStreamVideoConferenceEnabled) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: !(settings === null || settings === void 0 ? void 0 : settings.disableVideo), disabled: !isEnterpriseTier && !liveStreamVideoConferenceEnabled, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableVideo']: !(settings === null || settings === void 0 ? void 0 : settings.disableVideo) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableVideo", defaultMessage: "ui.liveStreamForm.disableVideo" }) })), !liveStreamVideoConferenceEnabled && (0, jsx_runtime_1.jsx)(UpScalingTierBadge_1.default, { desiredTier: types_1.SCCommunitySubscriptionTier.ENTERPRISE })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: !(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen), disabled: !isEnterpriseTier && !liveStreamVideoConferenceEnabled, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableShareScreen']: !(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableShareScreen", defaultMessage: "ui.liveStreamForm.disableShareScreen" }) })), !liveStreamVideoConferenceEnabled && (0, jsx_runtime_1.jsx)(UpScalingTierBadge_1.default, { desiredTier: types_1.SCCommunitySubscriptionTier.ENTERPRISE })] }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: !(settings === null || settings === void 0 ? void 0 : settings.disableChat), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableChat']: !(settings === null || settings === void 0 ? void 0 : settings.disableChat) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableChat", defaultMessage: "ui.liveStreamForm.disableChat" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['hideParticipantsList']: !(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.hideParticipantsList", defaultMessage: "ui.liveStreamForm.hideParticipantsList" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['automaticallyNotifyFollowers']: !(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.automaticallyNotifyFollowers", defaultMessage: "ui.liveStreamForm.automaticallyNotifyFollowers" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.showInProfile), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['showInProfile']: !(settings === null || settings === void 0 ? void 0 : settings.showInProfile) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.showInProfile", defaultMessage: "ui.liveStreamForm.showInProfile" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ className: classes.accessView }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, Object.assign({ id: "viewLabel" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }) })), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ name: "view", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }), labelId: "viewLabel", disabled: !liveStreamEnabled, fullWidth: true, value: (_a = settings === null || settings === void 0 ? void 0 : settings.view) !== null && _a !== void 0 ? _a : types_1.SCLiveStreamViewType.SPEAKER, onChange: (e) => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['view']: e.target.value })), displayEmpty: true, renderValue: (selected) => {
77
82
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.accessViewIcon }, { children: selected === types_1.SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${selected}`, defaultMessage: `ui.liveStreamForm.view.${selected}` })] }));
78
- } }, { children: Object.values(types_1.SCLiveStreamViewType).map((f) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: f }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsxs)("b", { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.accessViewIcon }, { children: f === types_1.SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}`, defaultMessage: `ui.liveStreamForm.view.${f}` })] }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}.description`, defaultMessage: `ui.liveStreamForm.view.${f}.description` }) })] }) }), f))) }))] }))] })));
83
+ } }, { children: Object.values(types_1.SCLiveStreamViewType).map((f) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: f }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsxs)("b", { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.accessViewIcon }, { children: f === types_1.SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}`, defaultMessage: `ui.liveStreamForm.view.${f}` })] }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ sx: { textWrap: 'auto' } }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}.description`, defaultMessage: `ui.liveStreamForm.view.${f}.description` }) }))] }) }), f))) }))] }))] })));
79
84
  }
80
85
  exports.default = LiveStreamSettingsForm;