@selfcommunity/react-ui 0.7.9-alpha.9 → 0.7.10-alpha.0

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 (181) hide show
  1. package/lib/cjs/components/AccountRecover/AccountRecover.js +6 -1
  2. package/lib/cjs/components/BottomNavigation/BottomNavigation.js +4 -3
  3. package/lib/cjs/components/CategoryHeader/Skeleton.js +3 -2
  4. package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.js +6 -6
  5. package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +19 -16
  6. package/lib/cjs/components/Composer/Attributes/Attributes.js +3 -3
  7. package/lib/cjs/components/Composer/Composer.js +3 -3
  8. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +1 -1
  9. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +9 -19
  10. package/lib/cjs/components/Editor/Editor.js +2 -0
  11. package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -0
  12. package/lib/cjs/components/Editor/plugins/ImagePlugin.js +4 -0
  13. package/lib/cjs/components/Editor/plugins/ToolbarPlugin.js +17 -3
  14. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +18 -16
  15. package/lib/cjs/components/FeedObject/Contributors/Contributors.js +1 -1
  16. package/lib/cjs/components/FeedObject/FeedObject.d.ts +1 -0
  17. package/lib/cjs/components/FeedObject/FeedObject.js +27 -8
  18. package/lib/cjs/components/FeedObject/Poll/Poll.js +20 -20
  19. package/lib/cjs/components/FeedUpdatesWidget/FeedUpdatesWidget.js +1 -1
  20. package/lib/cjs/components/Footer/Footer.js +1 -1
  21. package/lib/cjs/components/Group/Group.d.ts +9 -1
  22. package/lib/cjs/components/Group/Group.js +18 -6
  23. package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.d.ts +0 -1
  24. package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.js +1 -2
  25. package/lib/cjs/components/GroupForm/GroupForm.js +64 -13
  26. package/lib/cjs/components/GroupHeader/GroupHeader.d.ts +2 -3
  27. package/lib/cjs/components/GroupHeader/GroupHeader.js +38 -5
  28. package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +65 -9
  29. package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +29 -7
  30. package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.d.ts +73 -0
  31. package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +220 -0
  32. package/lib/cjs/components/GroupInvitedWidget/Skeleton.d.ts +22 -0
  33. package/lib/cjs/components/GroupInvitedWidget/Skeleton.js +38 -0
  34. package/lib/cjs/components/GroupInvitedWidget/constants.d.ts +1 -0
  35. package/lib/cjs/components/GroupInvitedWidget/constants.js +4 -0
  36. package/lib/cjs/components/GroupInvitedWidget/index.d.ts +4 -0
  37. package/lib/cjs/components/GroupInvitedWidget/index.js +8 -0
  38. package/lib/cjs/components/GroupMembersButton/GroupMembersButton.js +6 -2
  39. package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +21 -6
  40. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +12 -2
  41. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +13 -12
  42. package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.d.ts +4 -12
  43. package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +33 -19
  44. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -3
  45. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +22 -6
  46. package/lib/cjs/components/Groups/Groups.d.ts +15 -8
  47. package/lib/cjs/components/Groups/Groups.js +86 -32
  48. package/lib/cjs/components/Groups/Skeleton.d.ts +4 -0
  49. package/lib/cjs/components/Groups/Skeleton.js +2 -2
  50. package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +7 -0
  51. package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +4 -4
  52. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +10 -2
  53. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -0
  54. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +9 -1
  55. package/lib/cjs/components/Notification/Group/Group.d.ts +15 -0
  56. package/lib/cjs/components/Notification/Group/Group.js +87 -0
  57. package/lib/cjs/components/Notification/Group/index.d.ts +3 -0
  58. package/lib/cjs/components/Notification/Group/index.js +5 -0
  59. package/lib/cjs/components/Notification/Notification.js +34 -1
  60. package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +16 -5
  61. package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +7 -1
  62. package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +16 -8
  63. package/lib/cjs/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -1
  64. package/lib/cjs/components/PrivateMessageSnippetItem/PrivateMessageSnippetItem.js +11 -6
  65. package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts +9 -4
  66. package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js +24 -6
  67. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts +6 -1
  68. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +46 -20
  69. package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +6 -0
  70. package/lib/cjs/components/SearchAutocomplete/SearchAutocomplete.js +22 -5
  71. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +7 -0
  72. package/lib/cjs/components/ToastNotifications/ToastNotifications.js +7 -0
  73. package/lib/cjs/components/User/User.d.ts +6 -1
  74. package/lib/cjs/components/User/User.js +5 -4
  75. package/lib/cjs/components/UserSubscribedGroupsWidget/Skeleton.d.ts +21 -0
  76. package/lib/cjs/components/UserSubscribedGroupsWidget/Skeleton.js +46 -0
  77. package/lib/cjs/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.d.ts +68 -0
  78. package/lib/cjs/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.js +183 -0
  79. package/lib/cjs/components/UserSubscribedGroupsWidget/constants.d.ts +1 -0
  80. package/lib/cjs/components/UserSubscribedGroupsWidget/constants.js +4 -0
  81. package/lib/cjs/components/UserSubscribedGroupsWidget/index.d.ts +4 -0
  82. package/lib/cjs/components/UserSubscribedGroupsWidget/index.js +8 -0
  83. package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +1 -1
  84. package/lib/cjs/constants/PubSub.d.ts +28 -0
  85. package/lib/cjs/constants/PubSub.js +22 -0
  86. package/lib/cjs/index.d.ts +5 -3
  87. package/lib/cjs/index.js +11 -4
  88. package/lib/cjs/types/index.d.ts +2 -1
  89. package/lib/esm/components/AccountRecover/AccountRecover.js +6 -1
  90. package/lib/esm/components/BottomNavigation/BottomNavigation.js +5 -4
  91. package/lib/esm/components/CategoryHeader/Skeleton.js +3 -2
  92. package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.js +6 -6
  93. package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +19 -16
  94. package/lib/esm/components/Composer/Attributes/Attributes.js +3 -3
  95. package/lib/esm/components/Composer/Composer.js +3 -3
  96. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +1 -1
  97. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +9 -19
  98. package/lib/esm/components/Editor/Editor.js +2 -0
  99. package/lib/esm/components/Editor/nodes/ImageNode.js +6 -0
  100. package/lib/esm/components/Editor/plugins/ImagePlugin.js +4 -0
  101. package/lib/esm/components/Editor/plugins/ToolbarPlugin.js +19 -5
  102. package/lib/esm/components/FeedObject/Actions/Share/Share.js +19 -17
  103. package/lib/esm/components/FeedObject/Contributors/Contributors.js +1 -1
  104. package/lib/esm/components/FeedObject/FeedObject.d.ts +1 -0
  105. package/lib/esm/components/FeedObject/FeedObject.js +28 -9
  106. package/lib/esm/components/FeedObject/Poll/Poll.js +20 -20
  107. package/lib/esm/components/FeedUpdatesWidget/FeedUpdatesWidget.js +1 -1
  108. package/lib/esm/components/Footer/Footer.js +2 -2
  109. package/lib/esm/components/Group/Group.d.ts +9 -1
  110. package/lib/esm/components/Group/Group.js +22 -10
  111. package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.d.ts +0 -1
  112. package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.js +1 -2
  113. package/lib/esm/components/GroupForm/GroupForm.js +64 -13
  114. package/lib/esm/components/GroupHeader/GroupHeader.d.ts +2 -3
  115. package/lib/esm/components/GroupHeader/GroupHeader.js +40 -7
  116. package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +65 -9
  117. package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +29 -7
  118. package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.d.ts +73 -0
  119. package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +217 -0
  120. package/lib/esm/components/GroupInvitedWidget/Skeleton.d.ts +22 -0
  121. package/lib/esm/components/GroupInvitedWidget/Skeleton.js +34 -0
  122. package/lib/esm/components/GroupInvitedWidget/constants.d.ts +1 -0
  123. package/lib/esm/components/GroupInvitedWidget/constants.js +1 -0
  124. package/lib/esm/components/GroupInvitedWidget/index.d.ts +4 -0
  125. package/lib/esm/components/GroupInvitedWidget/index.js +4 -0
  126. package/lib/esm/components/GroupMembersButton/GroupMembersButton.js +7 -3
  127. package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +22 -7
  128. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +12 -2
  129. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +13 -12
  130. package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.d.ts +4 -12
  131. package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +33 -19
  132. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -3
  133. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +22 -6
  134. package/lib/esm/components/Groups/Groups.d.ts +15 -8
  135. package/lib/esm/components/Groups/Groups.js +91 -37
  136. package/lib/esm/components/Groups/Skeleton.d.ts +4 -0
  137. package/lib/esm/components/Groups/Skeleton.js +2 -2
  138. package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +9 -2
  139. package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +4 -4
  140. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +11 -3
  141. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -0
  142. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +11 -3
  143. package/lib/esm/components/Notification/Group/Group.d.ts +15 -0
  144. package/lib/esm/components/Notification/Group/Group.js +84 -0
  145. package/lib/esm/components/Notification/Group/index.d.ts +3 -0
  146. package/lib/esm/components/Notification/Group/index.js +2 -0
  147. package/lib/esm/components/Notification/Notification.js +34 -1
  148. package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +16 -5
  149. package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +7 -1
  150. package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +17 -9
  151. package/lib/esm/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -1
  152. package/lib/esm/components/PrivateMessageSnippetItem/PrivateMessageSnippetItem.js +11 -6
  153. package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts +9 -4
  154. package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js +26 -8
  155. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts +6 -1
  156. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +48 -22
  157. package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +7 -1
  158. package/lib/esm/components/SearchAutocomplete/SearchAutocomplete.js +22 -5
  159. package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +7 -0
  160. package/lib/esm/components/ToastNotifications/ToastNotifications.js +7 -0
  161. package/lib/esm/components/User/User.d.ts +6 -1
  162. package/lib/esm/components/User/User.js +5 -4
  163. package/lib/esm/components/UserSubscribedGroupsWidget/Skeleton.d.ts +21 -0
  164. package/lib/esm/components/UserSubscribedGroupsWidget/Skeleton.js +42 -0
  165. package/lib/esm/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.d.ts +68 -0
  166. package/lib/esm/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.js +180 -0
  167. package/lib/esm/components/UserSubscribedGroupsWidget/constants.d.ts +1 -0
  168. package/lib/esm/components/UserSubscribedGroupsWidget/constants.js +1 -0
  169. package/lib/esm/components/UserSubscribedGroupsWidget/index.d.ts +4 -0
  170. package/lib/esm/components/UserSubscribedGroupsWidget/index.js +4 -0
  171. package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +1 -1
  172. package/lib/esm/constants/PubSub.d.ts +28 -0
  173. package/lib/esm/constants/PubSub.js +19 -0
  174. package/lib/esm/index.d.ts +5 -3
  175. package/lib/esm/index.js +4 -2
  176. package/lib/esm/types/index.d.ts +2 -1
  177. package/lib/umd/311.js +2 -0
  178. package/lib/umd/react-ui.js +1 -1
  179. package/package.json +10 -10
  180. package/lib/umd/871.js +0 -2
  181. /package/lib/umd/{871.js.LICENSE.txt → 311.js.LICENSE.txt} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { __awaiter, __rest } from "tslib";
2
- import React, { useState } from 'react';
2
+ import React, { useContext, useState } from 'react';
3
3
  import { styled } from '@mui/material/styles';
4
4
  import { ListItem, Typography, IconButton, Box, useTheme, Button } from '@mui/material';
5
5
  import PrivateMessageThreadItemSkeleton from './Skeleton';
@@ -8,6 +8,7 @@ import { SCMessageFileType, SCPrivateMessageStatusType } from '@selfcommunity/ty
8
8
  import Icon from '@mui/material/Icon';
9
9
  import classNames from 'classnames';
10
10
  import { useThemeProps } from '@mui/system';
11
+ import { SCUserContext } from '@selfcommunity/react-core';
11
12
  import useMediaQuery from '@mui/material/useMediaQuery';
12
13
  import PrivateMessageSettingsIconButton from '../PrivateMessageSettingsIconButton';
13
14
  import { bytesToSize } from '../../utils/sizeCoverter';
@@ -19,6 +20,7 @@ import { PREFIX } from './constants';
19
20
  import { isSupportedVideoFormat } from '../../utils/thumbnailCoverter';
20
21
  const classes = {
21
22
  root: `${PREFIX}-root`,
23
+ username: `${PREFIX}-username`,
22
24
  text: `${PREFIX}-text`,
23
25
  img: `${PREFIX}-img`,
24
26
  document: `${PREFIX}-document`,
@@ -70,6 +72,7 @@ const Root = styled(ListItem, {
70
72
  * @param inProps
71
73
  */
72
74
  export default function PrivateMessageThreadItem(inProps) {
75
+ var _a;
73
76
  // PROPS
74
77
  const props = useThemeProps({
75
78
  props: inProps,
@@ -78,6 +81,8 @@ export default function PrivateMessageThreadItem(inProps) {
78
81
  const { message = null, className = null, mouseEvents = {}, isHovering = null, showMenuIcon = false, onMenuIconClick = null } = props, rest = __rest(props, ["message", "className", "mouseEvents", "isHovering", "showMenuIcon", "onMenuIconClick"]);
79
82
  // INTL
80
83
  const intl = useIntl();
84
+ // CONTEXT
85
+ const scUserContext = useContext(SCUserContext);
81
86
  // STATE
82
87
  const theme = useTheme();
83
88
  const isMobile = useMediaQuery(theme.breakpoints.down('md'));
@@ -165,6 +170,7 @@ export default function PrivateMessageThreadItem(inProps) {
165
170
  return (React.createElement(Root, Object.assign({ className: classNames(classes.root, className) }, getMouseEvents(mouseEvents.onMouseEnter, mouseEvents.onMouseLeave), rest, { secondaryAction: (isHovering || isMobile) &&
166
171
  showMenuIcon &&
167
172
  message.status !== SCPrivateMessageStatusType.HIDDEN && React.createElement(PrivateMessageSettingsIconButton, { onMenuItemDeleteClick: handleMenuItemClick }) }),
173
+ message.group && ((_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.username) !== message.sender.username && (React.createElement(Typography, { color: "secondary", variant: "h4", className: classes.username }, message.sender.username)),
168
174
  React.createElement(React.Fragment, null,
169
175
  hasFile && message.status !== SCPrivateMessageStatusType.HIDDEN ? (renderMessageFile(message)) : (React.createElement(Box, { className: classes.text },
170
176
  React.createElement(Typography, { component: "span", dangerouslySetInnerHTML: { __html: message.message } }))),
@@ -73,6 +73,25 @@ export default function SearchAutocomplete(inProps) {
73
73
  setOptions([]);
74
74
  onClear && onClear();
75
75
  };
76
+ const getOptionData = (option) => {
77
+ let data = {};
78
+ if (option.type === SuggestionType.USER) {
79
+ data.name = option[SuggestionType.USER]['username'];
80
+ data.image = option[SuggestionType.USER]['avatar'];
81
+ data.variant = 'circular';
82
+ }
83
+ else if (option.type === SuggestionType.CATEGORY) {
84
+ data.name = option[SuggestionType.CATEGORY]['name'];
85
+ data.image = option[SuggestionType.CATEGORY]['image_medium'];
86
+ data.variant = 'square';
87
+ }
88
+ else if (option.type === SuggestionType.GROUP) {
89
+ data.name = option[SuggestionType.GROUP]['name'];
90
+ data.image = option[SuggestionType.GROUP]['image_big'];
91
+ data.variant = 'circular';
92
+ }
93
+ return data;
94
+ };
76
95
  function fetchResults() {
77
96
  setIsLoading(true);
78
97
  SuggestionService.getSearchSuggestion(value)
@@ -96,11 +115,9 @@ export default function SearchAutocomplete(inProps) {
96
115
  return option;
97
116
  }
98
117
  return (_a = option[option.type]['username']) !== null && _a !== void 0 ? _a : option[option.type]['name'];
99
- }, renderOption: (props, option) => (React.createElement(Box, Object.assign({ component: "li" }, props), option.type === SuggestionType.USER ? (React.createElement(React.Fragment, null,
100
- React.createElement(Avatar, { alt: option[SuggestionType.USER]['username'], src: option[SuggestionType.USER]['avatar'] }),
101
- React.createElement(Typography, { ml: 1 }, option[SuggestionType.USER]['username']))) : (React.createElement(React.Fragment, null,
102
- React.createElement(Avatar, { alt: option[SuggestionType.CATEGORY]['name'], src: option[SuggestionType.CATEGORY]['image_medium'], variant: "square" }),
103
- React.createElement(Typography, { ml: 1 }, option[SuggestionType.CATEGORY]['name']))))), renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { placeholder: `${intl.formatMessage(messages.placeholder, {
118
+ }, renderOption: (props, option) => (React.createElement(Box, Object.assign({ component: "li" }, props),
119
+ React.createElement(Avatar, { alt: getOptionData(option).name, src: getOptionData(option).image, variant: getOptionData(option).variant }),
120
+ React.createElement(Typography, { ml: 1 }, getOptionData(option).name))), renderInput: (params) => (React.createElement(TextField, Object.assign({}, params, { placeholder: `${intl.formatMessage(messages.placeholder, {
104
121
  community: scPreferences.preferences[SCPreferences.TEXT_APPLICATION_NAME].value
105
122
  })}`, InputProps: Object.assign(Object.assign({}, params.InputProps), { autoFocus, name: 'search-autocomplete', className: classes.input, startAdornment: React.createElement(Icon, { className: classes.icon }, "search"), endAdornment: (React.createElement(Fade, { in: value.length > 0 || Boolean(onClear), appear: false },
106
123
  React.createElement(IconButton, { className: classes.clear, onClick: handleClear, size: "small" },
@@ -31,6 +31,7 @@ import { useThemeProps } from '@mui/system';
31
31
  import ContributionNotification from '../Notification/Contribution';
32
32
  import NotificationItem from '../../shared/NotificationItem';
33
33
  import { PREFIX } from './constants';
34
+ import GroupNotification from '../Notification/Group';
34
35
  const classes = {
35
36
  root: `${PREFIX}-root`,
36
37
  notificationsWrap: `${PREFIX}-notifications-wrap`,
@@ -252,6 +253,12 @@ export default function SnippetNotifications(inProps) {
252
253
  else if (type === SCNotificationTypologyType.CONTRIBUTION) {
253
254
  content = React.createElement(ContributionNotification, { notificationObject: n, key: i, template: SCNotificationObjectTemplateType.SNIPPET });
254
255
  }
256
+ else if (n.type === SCNotificationTypologyType.USER_ADDED_TO_GROUP ||
257
+ n.type === SCNotificationTypologyType.USER_INVITED_TO_JOIN_GROUP ||
258
+ n.type === SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_GROUP ||
259
+ n.type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_GROUP) {
260
+ return React.createElement(GroupNotification, { notificationObject: n, key: i, template: SCNotificationObjectTemplateType.SNIPPET });
261
+ }
255
262
  if (type && handleNotification) {
256
263
  /** Override content */
257
264
  content = handleNotification(type, n, content);
@@ -21,6 +21,7 @@ import Message from '../BroadcastMessages/Message';
21
21
  import { useThemeProps } from '@mui/system';
22
22
  import ContributionNotification from '../Notification/Contribution';
23
23
  import { PREFIX } from './constants';
24
+ import GroupNotification from '../Notification/Group';
24
25
  const Root = styled(Box, {
25
26
  name: PREFIX,
26
27
  slot: 'Root'
@@ -108,6 +109,12 @@ export default function UserToastNotifications(inProps) {
108
109
  else if (type === SCNotificationTypologyType.CONTRIBUTION) {
109
110
  content = React.createElement(ContributionNotification, { notificationObject: n.notification_obj, template: SCNotificationObjectTemplateType.TOAST });
110
111
  }
112
+ else if (type === SCNotificationTypologyType.USER_ADDED_TO_GROUP ||
113
+ type === SCNotificationTypologyType.USER_INVITED_TO_JOIN_GROUP ||
114
+ type === SCNotificationTypologyType.USER_ACCEPTED_TO_JOIN_GROUP ||
115
+ type === SCNotificationTypologyType.USER_REQUESTED_TO_JOIN_GROUP) {
116
+ content = React.createElement(GroupNotification, { notificationObject: n.notification_obj, template: SCNotificationObjectTemplateType.TOAST });
117
+ }
111
118
  }
112
119
  if (n.activity_type && n.activity_type === SCNotificationTypologyType.NOTIFICATION_BANNER) {
113
120
  /** Notification of type: 'notification_banner' */
@@ -34,6 +34,11 @@ export interface UserProps extends WidgetProps {
34
34
  * Badge content to show as user avatar badge if show reaction is true.
35
35
  */
36
36
  badgeContent?: any;
37
+ /**
38
+ * If true, shows a custom label next to the user username
39
+ * @default false
40
+ */
41
+ isGroupAdmin?: boolean;
37
42
  /**
38
43
  * Prop to add actions
39
44
  * @default null
@@ -43,7 +48,7 @@ export interface UserProps extends WidgetProps {
43
48
  * Props to spread to the button
44
49
  * @default {}
45
50
  */
46
- buttonProps?: ButtonBaseProps;
51
+ buttonProps?: ButtonBaseProps | null;
47
52
  /**
48
53
  * Any other properties
49
54
  */
@@ -21,7 +21,8 @@ const messages = defineMessages({
21
21
  const classes = {
22
22
  root: `${PREFIX}-root`,
23
23
  avatar: `${PREFIX}-avatar`,
24
- staffBadgeLabel: `${PREFIX}-staff-badge-label`
24
+ staffBadgeLabel: `${PREFIX}-staff-badge-label`,
25
+ groupAdminBadgeLabel: `${PREFIX}-group-admin-badge-label`
25
26
  };
26
27
  const Root = styled(BaseItemButton, {
27
28
  name: PREFIX,
@@ -64,7 +65,7 @@ export default function User(inProps) {
64
65
  props: inProps,
65
66
  name: PREFIX
66
67
  });
67
- const { userId = null, user = null, handleIgnoreAction, className = null, followConnectUserButtonProps = {}, showFollowers = false, elevation, badgeContent = null, actions = null, buttonProps = {} } = props, rest = __rest(props, ["userId", "user", "handleIgnoreAction", "className", "followConnectUserButtonProps", "showFollowers", "elevation", "badgeContent", "actions", "buttonProps"]);
68
+ const { userId = null, user = null, handleIgnoreAction, className = null, followConnectUserButtonProps = {}, showFollowers = false, elevation, badgeContent = null, actions = null, isGroupAdmin = false, buttonProps = null } = props, rest = __rest(props, ["userId", "user", "handleIgnoreAction", "className", "followConnectUserButtonProps", "showFollowers", "elevation", "badgeContent", "actions", "isGroupAdmin", "buttonProps"]);
68
69
  // STATE
69
70
  const { scUser, setSCUser } = useSCFetchUser({ id: userId, user });
70
71
  // CONTEXT
@@ -104,8 +105,8 @@ export default function User(inProps) {
104
105
  ? { onClick: () => setOpenAlert(true) }
105
106
  : { component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUser) }), image: badgeContent ? (React.createElement(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: badgeContent },
106
107
  React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))) : (React.createElement(UserAvatar, { hide: !hasBadge },
107
- React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))), primary: hasBadge && preferences ? (React.createElement(React.Fragment, null,
108
+ React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar, className: classes.avatar }))), primary: (hasBadge && preferences) || isGroupAdmin ? (React.createElement(React.Fragment, null,
108
109
  scUser.username,
109
- React.createElement(Chip, { component: "span", className: classes.staffBadgeLabel, size: "small", label: preferences[SCPreferences.STAFF_STAFF_BADGE_LABEL] }))) : (scUser.username), secondary: showFollowers ? `${intl.formatMessage(messages.userFollowers, { total: scUser.followers_counter })}` : scUser.description, actions: actions !== null && actions !== void 0 ? actions : renderAuthenticatedActions() })),
110
+ React.createElement(Chip, { component: "span", className: isGroupAdmin ? classes.groupAdminBadgeLabel : classes.staffBadgeLabel, size: "small", label: isGroupAdmin ? (React.createElement(FormattedMessage, { defaultMessage: "ui.user.group.admin", id: "ui.user.group.admin" })) : (preferences[SCPreferences.STAFF_STAFF_BADGE_LABEL]) }))) : (scUser.username), secondary: showFollowers ? `${intl.formatMessage(messages.userFollowers, { total: scUser.followers_counter })}` : scUser.description, actions: actions !== null && actions !== void 0 ? actions : renderAuthenticatedActions() })),
110
111
  openAlert && React.createElement(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })));
111
112
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * > API documentation for the Community-JS User Profile Categories Followed Widget Skeleton component. Learn about the available props and the CSS API.
3
+
4
+ #### Import
5
+
6
+ ```jsx
7
+ import {UserSubscribedGroupsWidgetSkeleton} from '@selfcommunity/react-ui';
8
+ ```
9
+
10
+ #### Component Name
11
+
12
+ The name `SCUserCategoriesFollowedWidget-skeleton-root` can be used when providing style overrides in the theme.
13
+
14
+ #### CSS
15
+
16
+ |Rule Name|Global class|Description|
17
+ |---|---|---|
18
+ |root|.SCUserSubscribedGroupsWidget-skeleton-root|Styles applied to the root element.|
19
+ *
20
+ */
21
+ export default function UserSubscribedGroupsWidgetSkeleton(props: any): JSX.Element;
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import Widget from '../Widget';
3
+ import { styled } from '@mui/material/styles';
4
+ import { CardContent, ListItem } from '@mui/material';
5
+ import List from '@mui/material/List';
6
+ import GroupSkeleton from '../Group/Skeleton';
7
+ const PREFIX = 'SCUserSubscribedGroupsWidgetSkeleton';
8
+ const classes = {
9
+ root: `${PREFIX}-skeleton-root`,
10
+ list: `${PREFIX}-list`
11
+ };
12
+ const Root = styled(Widget, {
13
+ name: PREFIX,
14
+ slot: 'SkeletonRoot'
15
+ })(() => ({}));
16
+ /**
17
+ * > API documentation for the Community-JS User Profile Categories Followed Widget Skeleton component. Learn about the available props and the CSS API.
18
+
19
+ #### Import
20
+
21
+ ```jsx
22
+ import {UserSubscribedGroupsWidgetSkeleton} from '@selfcommunity/react-ui';
23
+ ```
24
+
25
+ #### Component Name
26
+
27
+ The name `SCUserCategoriesFollowedWidget-skeleton-root` can be used when providing style overrides in the theme.
28
+
29
+ #### CSS
30
+
31
+ |Rule Name|Global class|Description|
32
+ |---|---|---|
33
+ |root|.SCUserSubscribedGroupsWidget-skeleton-root|Styles applied to the root element.|
34
+ *
35
+ */
36
+ export default function UserSubscribedGroupsWidgetSkeleton(props) {
37
+ return (React.createElement(Root, Object.assign({ className: classes.root }, props),
38
+ React.createElement(CardContent, null,
39
+ React.createElement(List, { className: classes.list }, [...Array(3)].map((category, index) => (React.createElement(ListItem, { key: index },
40
+ React.createElement(GroupSkeleton, { elevation: 0 })))))),
41
+ ");"));
42
+ }
@@ -0,0 +1,68 @@
1
+ import { CacheStrategies } from '@selfcommunity/utils';
2
+ import { BaseDialogProps } from '../../shared/BaseDialog';
3
+ import { WidgetProps } from '../Widget';
4
+ import { VirtualScrollerItemProps } from '../../types/virtualScroller';
5
+ import { GroupProps } from '../Group';
6
+ export interface UserSubscribedGroupsWidgetProps extends VirtualScrollerItemProps, WidgetProps {
7
+ /**
8
+ * The user id
9
+ * @default null
10
+ */
11
+ userId: number;
12
+ /**
13
+ * Hides this component
14
+ * @default false
15
+ */
16
+ autoHide?: boolean;
17
+ /**
18
+ * Limit the number of groups to show
19
+ * @default false
20
+ */
21
+ limit?: number;
22
+ /**
23
+ * Props to spread to single group object
24
+ * @default empty object
25
+ */
26
+ GroupProps?: GroupProps;
27
+ /**
28
+ * Caching strategies
29
+ * @default CacheStrategies.CACHE_FIRST
30
+ */
31
+ cacheStrategy?: CacheStrategies;
32
+ /**
33
+ * Props to spread to subscribed groups dialog
34
+ * @default {}
35
+ */
36
+ DialogProps?: BaseDialogProps;
37
+ /**
38
+ * Other props
39
+ */
40
+ [p: string]: any;
41
+ }
42
+ /**
43
+ * > API documentation for the Community-JS User Profile Groups Subscribed Widget component. Learn about the available props and the CSS API.
44
+ *
45
+ *
46
+ * This component renders the list of the groups that the given user follows.
47
+ * Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/UserSubscribedGroups)
48
+
49
+ #### Import
50
+ ```jsx
51
+ import {UserSubscribedGroupsWidget} from '@selfcommunity/react-ui';
52
+ ```
53
+ #### Component Name
54
+ The name `SCUserSubscribedGroupsWidget` can be used when providing style overrides in the theme.
55
+
56
+ #### CSS
57
+
58
+ |Rule Name|Global class|Description|
59
+ |---|---|---|
60
+ |root|.SCUserSubscribedGroupsWidget-root|Styles applied to the root element.|
61
+ |title|.SCUserSubscribedGroupsWidget-title|Styles applied to the title element.|
62
+ |noResults|.SCUserSubscribedGroupsWidget-no-results|Styles applied to no results section.|
63
+ |showMore|.SCUserSubscribedGroupsWidget-show-more|Styles applied to show more button element.|
64
+ |dialogRoot|.SCUserSubscribedGroupsWidget-dialog-root|Styles applied to the root dialog element.|
65
+ |endMessage|.SCUserSubscribedGroupsWidget-end-message|Styles applied to the end message element.|
66
+ * @param inProps
67
+ */
68
+ export default function UserSubscribedGroupsWidget(inProps: UserSubscribedGroupsWidgetProps): JSX.Element;
@@ -0,0 +1,180 @@
1
+ import { __rest } from "tslib";
2
+ import React, { useEffect, useMemo, useReducer, useState } from 'react';
3
+ import { styled } from '@mui/material/styles';
4
+ import List from '@mui/material/List';
5
+ import { Button, CardContent, ListItem, Typography } from '@mui/material';
6
+ import { GroupService } from '@selfcommunity/api-services';
7
+ import { CacheStrategies, isInteger, Logger } from '@selfcommunity/utils';
8
+ import { SCCache, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
9
+ import { actionWidgetTypes, dataWidgetReducer, stateWidgetInitializer } from '../../utils/widget';
10
+ import { SCFeatureName, SCGroupPrivacyType, SCGroupSubscriptionStatusType } from '@selfcommunity/types';
11
+ import { SCOPE_SC_UI } from '../../constants/Errors';
12
+ import { FormattedMessage } from 'react-intl';
13
+ import Skeleton from './Skeleton';
14
+ import classNames from 'classnames';
15
+ import BaseDialog from '../../shared/BaseDialog';
16
+ import Widget from '../Widget';
17
+ import { useThemeProps } from '@mui/system';
18
+ import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
19
+ import { PREFIX } from './constants';
20
+ import Group, { GroupSkeleton } from '../Group';
21
+ const classes = {
22
+ root: `${PREFIX}-root`,
23
+ title: `${PREFIX}-title`,
24
+ noResults: `${PREFIX}-no-results`,
25
+ showMore: `${PREFIX}-show-more`,
26
+ dialogRoot: `${PREFIX}-dialog-root`,
27
+ endMessage: `${PREFIX}-end-message`
28
+ };
29
+ const Root = styled(Widget, {
30
+ name: PREFIX,
31
+ slot: 'Root'
32
+ })(() => ({}));
33
+ const DialogRoot = styled(BaseDialog, {
34
+ name: PREFIX,
35
+ slot: 'DialogRoot'
36
+ })(() => ({}));
37
+ /**
38
+ * > API documentation for the Community-JS User Profile Groups Subscribed Widget component. Learn about the available props and the CSS API.
39
+ *
40
+ *
41
+ * This component renders the list of the groups that the given user follows.
42
+ * Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/UserSubscribedGroups)
43
+
44
+ #### Import
45
+ ```jsx
46
+ import {UserSubscribedGroupsWidget} from '@selfcommunity/react-ui';
47
+ ```
48
+ #### Component Name
49
+ The name `SCUserSubscribedGroupsWidget` can be used when providing style overrides in the theme.
50
+
51
+ #### CSS
52
+
53
+ |Rule Name|Global class|Description|
54
+ |---|---|---|
55
+ |root|.SCUserSubscribedGroupsWidget-root|Styles applied to the root element.|
56
+ |title|.SCUserSubscribedGroupsWidget-title|Styles applied to the title element.|
57
+ |noResults|.SCUserSubscribedGroupsWidget-no-results|Styles applied to no results section.|
58
+ |showMore|.SCUserSubscribedGroupsWidget-show-more|Styles applied to show more button element.|
59
+ |dialogRoot|.SCUserSubscribedGroupsWidget-dialog-root|Styles applied to the root dialog element.|
60
+ |endMessage|.SCUserSubscribedGroupsWidget-end-message|Styles applied to the end message element.|
61
+ * @param inProps
62
+ */
63
+ export default function UserSubscribedGroupsWidget(inProps) {
64
+ // PROPS
65
+ const props = useThemeProps({
66
+ props: inProps,
67
+ name: PREFIX
68
+ });
69
+ const { userId, autoHide, limit = 3, className, GroupProps = {}, cacheStrategy = CacheStrategies.NETWORK_ONLY, onHeightChange, onStateChange, DialogProps = {} } = props, rest = __rest(props, ["userId", "autoHide", "limit", "className", "GroupProps", "cacheStrategy", "onHeightChange", "onStateChange", "DialogProps"]);
70
+ // CONTEXT
71
+ const scUserContext = useSCUser();
72
+ const isMe = useMemo(() => scUserContext.user && userId === scUserContext.user.id, [scUserContext.user, userId]);
73
+ const { features } = useSCPreferences();
74
+ const groupsEnabled = useMemo(() => features.includes(SCFeatureName.GROUPING), [features]);
75
+ // STATE
76
+ const [state, dispatch] = useReducer(dataWidgetReducer, {
77
+ isLoadingNext: false,
78
+ next: null,
79
+ cacheKey: SCCache.getWidgetStateCacheKey(SCCache.GROUPS_SUBSCRIBED_TOOLS_STATE_CACHE_PREFIX_KEY, userId),
80
+ cacheStrategy
81
+ }, stateWidgetInitializer);
82
+ const [openDialog, setOpenDialog] = useState(false);
83
+ /**
84
+ * Initialize component
85
+ * Fetch data only if the component is not initialized and it is not loading data
86
+ */
87
+ const _initComponent = useMemo(() => () => {
88
+ if (!state.initialized && !state.isLoadingNext) {
89
+ GroupService.getUserSubscribedGroups(userId)
90
+ .then((groups) => {
91
+ dispatch({
92
+ type: actionWidgetTypes.LOAD_NEXT_SUCCESS,
93
+ payload: {
94
+ count: groups.count,
95
+ results: groups.results,
96
+ initialized: true
97
+ }
98
+ });
99
+ })
100
+ .catch((error) => {
101
+ dispatch({ type: actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
102
+ Logger.error(SCOPE_SC_UI, error);
103
+ });
104
+ }
105
+ }, [state.isLoadingNext, state.initialized, userId, dispatch]);
106
+ // EFFECTS
107
+ useEffect(() => {
108
+ let _t;
109
+ if (groupsEnabled || (isInteger(userId) && scUserContext.user !== undefined)) {
110
+ _t = setTimeout(_initComponent);
111
+ return () => {
112
+ _t && clearTimeout(_t);
113
+ };
114
+ }
115
+ }, [scUserContext.user, groupsEnabled, userId]);
116
+ /**
117
+ * Virtual feed update
118
+ */
119
+ useEffect(() => {
120
+ onHeightChange && onHeightChange();
121
+ }, [state.results.length]);
122
+ useEffect(() => {
123
+ if ((!groupsEnabled && !scUserContext.user) || !isInteger(userId)) {
124
+ return;
125
+ }
126
+ else if (cacheStrategy === CacheStrategies.NETWORK_ONLY) {
127
+ onStateChange && onStateChange({ cacheStrategy: CacheStrategies.CACHE_FIRST });
128
+ }
129
+ }, [groupsEnabled, cacheStrategy, scUserContext.user, userId]);
130
+ // HANDLERS
131
+ const handleOnSubscribe = (group) => {
132
+ if (isMe) {
133
+ const newGroups = [...state.results];
134
+ const index = newGroups.findIndex((u) => u.id === group.id);
135
+ if (index !== -1) {
136
+ if (group.subscription_status === SCGroupSubscriptionStatusType.SUBSCRIBED) {
137
+ newGroups[index].subscribers_counter = group.subscribers_counter - 1;
138
+ newGroups[index].subscription_status = null;
139
+ }
140
+ else {
141
+ newGroups[index].subscribers_counter =
142
+ group.privacy === SCGroupPrivacyType.PUBLIC ? group.subscribers_counter + 1 : group.subscribers_counter;
143
+ newGroups[index].subscription_status =
144
+ group.privacy === SCGroupPrivacyType.PUBLIC ? SCGroupSubscriptionStatusType.SUBSCRIBED : SCGroupSubscriptionStatusType.REQUESTED;
145
+ }
146
+ dispatch({ type: actionWidgetTypes.SET_RESULTS, payload: { results: newGroups } });
147
+ }
148
+ }
149
+ };
150
+ const handleToggleDialogOpen = () => {
151
+ setOpenDialog((prev) => !prev);
152
+ };
153
+ // RENDER
154
+ if (!groupsEnabled || (autoHide && !state.count && state.initialized) || !userId) {
155
+ return React.createElement(HiddenPlaceholder, null);
156
+ }
157
+ if (!state.initialized) {
158
+ return React.createElement(Skeleton, null);
159
+ }
160
+ const content = (React.createElement(CardContent, null,
161
+ React.createElement(Typography, { className: classes.title, variant: "h5" },
162
+ React.createElement(FormattedMessage, { id: "ui.userSubscribedGroupsWidget.title", defaultMessage: "ui.userSubscribedGroupsWidget.title", values: {
163
+ total: isMe ? state.results.filter((g) => g.subscription_status === SCGroupSubscriptionStatusType.SUBSCRIBED).length : state.count
164
+ } })),
165
+ !state.count ? (React.createElement(Typography, { className: classes.noResults, variant: "body2" },
166
+ React.createElement(FormattedMessage, { id: "ui.userSubscribedGroupsWidget.subtitle.noResults", defaultMessage: "ui.userSubscribedGroupsWidget.subtitle.noResults" }))) : (React.createElement(React.Fragment, null,
167
+ React.createElement(List, null, state.results.slice(0, limit).map((group) => (React.createElement(ListItem, { key: group.id },
168
+ React.createElement(Group, Object.assign({ elevation: 0, group: group, groupSubscribeButtonProps: { onSubscribe: handleOnSubscribe } }, GroupProps)))))),
169
+ limit < state.count && (React.createElement(Button, { className: classes.showMore, onClick: handleToggleDialogOpen },
170
+ React.createElement(FormattedMessage, { id: "ui.userSubscribedGroupsWidget.button.showAll", defaultMessage: "ui.userSubscribedGroupsWidget.button.showAll" }))),
171
+ openDialog && (React.createElement(DialogRoot, Object.assign({ className: classes.dialogRoot, title: React.createElement(FormattedMessage, { id: "ui.userSubscribedGroupsWidget.title", defaultMessage: "ui.userSubscribedGroupsWidget.title", values: { total: state.count } }), onClose: handleToggleDialogOpen, open: openDialog, scroll: "paper" }, DialogProps),
172
+ React.createElement(List, null,
173
+ state.results.map((g) => (React.createElement(ListItem, { key: g.id },
174
+ React.createElement(Group, Object.assign({ elevation: 0, group: g, groupSubscribeButtonProps: { onSubscribe: handleOnSubscribe } }, GroupProps))))),
175
+ state.isLoadingNext && (React.createElement(ListItem, null,
176
+ React.createElement(GroupSkeleton, Object.assign({ elevation: 0 }, GroupProps))))),
177
+ React.createElement(Typography, { className: classes.endMessage },
178
+ React.createElement(FormattedMessage, { id: "ui.userSubscribedGroupsWidget.noMoreResults", defaultMessage: "ui.userSubscribedGroupsWidget.noMoreResults" }))))))));
179
+ return (React.createElement(Root, Object.assign({ className: classNames(classes.root, className) }, rest), content));
180
+ }
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCUserSubscribedGroupsWidget";
@@ -0,0 +1 @@
1
+ export const PREFIX = 'SCUserSubscribedGroupsWidget';
@@ -0,0 +1,4 @@
1
+ import UserSubscribedGroupsWidget, { UserSubscribedGroupsWidgetProps } from './UserSubscribedGroupsWidget';
2
+ import UserSubscribedGroupsWidgetSkeleton from './Skeleton';
3
+ export default UserSubscribedGroupsWidget;
4
+ export { UserSubscribedGroupsWidgetSkeleton, UserSubscribedGroupsWidgetProps };
@@ -0,0 +1,4 @@
1
+ import UserSubscribedGroupsWidget from './UserSubscribedGroupsWidget';
2
+ import UserSubscribedGroupsWidgetSkeleton from './Skeleton';
3
+ export default UserSubscribedGroupsWidget;
4
+ export { UserSubscribedGroupsWidgetSkeleton };
@@ -132,5 +132,5 @@ export default function VoteAudienceButton(inProps) {
132
132
  React.createElement(FormattedMessage, { id: "ui.voteAudienceButton.dialog.end", defaultMessage: "ui.voteAudienceButton.dialog.end" })) },
133
133
  React.createElement(List, null, voteList.map((vote) => (React.createElement(ListItem, { key: vote.user.id },
134
134
  React.createElement(User, { elevation: 0, user: vote.user, badgeContent: React.createElement(Avatar, { className: classes.dialogVoteBadge }, vote.reaction ? (React.createElement(Icon, null,
135
- React.createElement("img", { alt: vote.reaction.label, src: vote.reaction.image, width: "100%", height: "100%" }))) : (React.createElement(Icon, null, "thumb_up"))) })))))))))));
135
+ React.createElement("img", { alt: vote.reaction.label, src: vote.reaction.image, width: "100%", height: "100%" }))) : (React.createElement(Icon, null, "thumb_up"))), onClick: handleClose })))))))))));
136
136
  }
@@ -0,0 +1,28 @@
1
+ import { SCUserType, SCGroupType } from '@selfcommunity/types';
2
+ /**
3
+ * Define topics for pubsub
4
+ */
5
+ export declare enum SCTopicType {
6
+ GROUP = "group"
7
+ }
8
+ /**
9
+ * Event types
10
+ */
11
+ export declare enum SCEventType {
12
+ CREATE = "create",
13
+ EDIT = "edit",
14
+ MEMBERS = "members",
15
+ ADD_MEMBER = "members.add_member",
16
+ INVITE_MEMBER = "members.invite_member",
17
+ REMOVE_MEMBER = "members.remove_member"
18
+ }
19
+ /**
20
+ * Event structure
21
+ */
22
+ export interface SCGroupChangeEventType {
23
+ group: SCGroupType;
24
+ }
25
+ export interface SCGroupMembersEventType {
26
+ group: SCGroupType;
27
+ user?: SCUserType;
28
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Define topics for pubsub
3
+ */
4
+ export var SCTopicType;
5
+ (function (SCTopicType) {
6
+ SCTopicType["GROUP"] = "group";
7
+ })(SCTopicType || (SCTopicType = {}));
8
+ /**
9
+ * Event types
10
+ */
11
+ export var SCEventType;
12
+ (function (SCEventType) {
13
+ SCEventType["CREATE"] = "create";
14
+ SCEventType["EDIT"] = "edit";
15
+ SCEventType["MEMBERS"] = "members";
16
+ SCEventType["ADD_MEMBER"] = "members.add_member";
17
+ SCEventType["INVITE_MEMBER"] = "members.invite_member";
18
+ SCEventType["REMOVE_MEMBER"] = "members.remove_member";
19
+ })(SCEventType || (SCEventType = {}));
@@ -72,7 +72,7 @@ import AccountRecover, { AccountRecoverProps } from './components/AccountRecover
72
72
  import AccountReset, { AccountResetProps } from './components/AccountReset';
73
73
  import AccountVerify, { AccountVerifyProps } from './components/AccountVerify';
74
74
  import AccountChangeMailValidation, { AccountChangeMailValidationProps } from './components/AccountChangeMailValidation';
75
- import { SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations } from './types';
75
+ import { SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, VirtualScrollerItemProps } from './types';
76
76
  import Widget, { WidgetProps } from './components/Widget';
77
77
  import ConfirmDialog from './shared/ConfirmDialog/ConfirmDialog';
78
78
  import LanguageSwitcher from './shared/LanguageSwitcher';
@@ -113,13 +113,15 @@ import CreateGroupButton, { CreateGroupButtonProps } from './components/CreateGr
113
113
  import EditGroupButton, { EditGroupButtonProps } from './components/EditGroupButton';
114
114
  import GroupInviteButton, { GroupInviteButtonProps } from './components/GroupInviteButton';
115
115
  import GroupInfoWidget, { GroupInfoWidgetProps, GroupInfoWidgetSkeleton } from './components/GroupInfoWidget';
116
- import Group, { GroupProps } from './components/Group';
116
+ import Group, { GroupProps, GroupSkeleton } from './components/Group';
117
117
  import GroupSubscribeButton, { GroupSubscribeButtonProps } from './components/GroupSubscribeButton';
118
118
  import GroupMembersWidget, { GroupMembersWidgetProps, GroupMembersWidgetSkeleton } from './components/GroupMembersWidget';
119
119
  import GroupRequestsWidget, { GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton } from './components/GroupRequestsWidget';
120
120
  import Groups, { GroupsProps, GroupsSkeleton } from './components/Groups';
121
121
  import GroupForm, { GroupFormProps } from './components/GroupForm';
122
122
  import GroupSettingsIconButton, { GroupSettingsIconButtonProps } from './components/GroupSettingsIconButton';
123
+ import GroupInvitedWidget, { GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton } from './components/GroupInvitedWidget';
124
+ import UserSubscribedGroupsWidget, { UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton } from './components/UserSubscribedGroupsWidget';
123
125
  /**
124
126
  * Constants
125
127
  */
@@ -144,4 +146,4 @@ import FeedObjectMediaPreview, { FeedObjectMediaPreviewProps } from './component
144
146
  /**
145
147
  * List all exports
146
148
  */
147
- export { AccountDataPortability, AccountDataPortabilityProps, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDelete, AccountDeleteProps, AccountDeleteButton, AccountDeleteButtonProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AccountChangeMailValidation, AccountChangeMailValidationProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbar, NavigationToolbarProps, NavigationToolbarSkeleton, NavigationMenuIconButton, NavigationMenuContent, NavigationMenuIconButtonProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, Category, CategoryProps, CategorySkeleton, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, Categories, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, ChangeCover, ChangePicture, ChangePictureProps, ChangeCoverProps, Composer, ComposerProps, ComposerIconButton, ComposerIconButtonProps, Editor, EditorProps, EditorSkeleton, FriendshipUserButton, FriendshipButtonProps, Feed, FeedRef, FeedProps, FeedSidebarProps, FeedSkeleton, CategoryFollowButton, CategoryFollowButtonProps, FollowUserButton, FollowUserButtonProps, ConnectionUserButton, FeedObject, FeedObjectProps, FeedObjectSkeleton, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, GenericSkeleton, AvatarGroupSkeleton, CommentObject, CommentsObject, CommentsObjectProps, CommentObjectProps, CommentsObjectSkeleton, CommentObjectSkeleton, CommentObjectReply, CommentObjectReplyProps, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, ReplyComment, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, Notification, NotificationProps, NotificationSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, PlatformWidget, PlatformWidgetProps, PlatformWidgetSkeleton, LocationAutocomplete, LocationAutocompleteProps, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CategoryTrendingPeopleWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectWidgetProps, RelatedFeedObjectsWidgetSkeleton, UserActionIconButton, UserActionIconButtonProps, UserCounters, UserCountersProps, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserInfoDialog, UserInfoDialogProps, UserInfo, UserInfoProps, UserInfoSkeleton, UserProfileBlocked, UserProfileBlockedProps, SCUserProfileFields, SCUserProfileSettings, UserProfileEdit, UserProfileEditProps, UserProfileEditSkeleton, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserSocialAssociation, UserSocialAssociationProps, SCUserSocialAssociations, CustomAdv, CustomAdvProps, CustomAdvSkeleton, User, UserProps, UserSkeleton, PrivateMessageThread, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Widget, WidgetProps, SCFeedWidgetType, SCFeedObjectTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCMediaObjectType, SCMediaChunkType, SCNotificationObjectTemplateType, SCBroadcastMessageTemplateType, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupMembersButton, GroupMembersButtonProps, CreateGroupButton, CreateGroupButtonProps, EditGroupButton, EditGroupButtonProps, GroupInviteButton, GroupInviteButtonProps, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, Group, GroupProps, GroupSubscribeButton, GroupSubscribeButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupsProps, GroupsSkeleton, GroupForm, GroupFormProps, HiddenPlaceholder, UrlTextField, UsernameTextField, EmailTextField, PasswordTextField, PhoneTextField, MetadataField, InfiniteScroll, StickyBox, useStickyBox, StickyBoxProps, StickyBoxComponent, UseStickyBoxProps, TagChip, TagChipProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserAvatar, UserAvatarProps, Lightbox, CentralProgress, ConfirmDialog, LanguageSwitcher, MediaChunkUploader, MediaChunkUploaderProps, File, Link, Share, EditMediaProps, MEDIA_TYPE_EMBED, FACEBOOK_SHARE, TWITTER_SHARE, LINKEDIN_SHARE, DEFAULT_PRELOAD_OFFSET_VIEWPORT, MIN_PRELOAD_OFFSET_VIEWPORT, MAX_PRELOAD_OFFSET_VIEWPORT, ConsentSolution, ConsentSolutionProps, ConsentSolutionSkeleton, ConsentSolutionButton, ConsentSolutionButtonProps, LEGAL_POLICIES, DEFAULT_FIELDS, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_LIMIT, DEFAULT_WIDGETS_NUMBER, PollSuggestionWidget, PollSuggestionWidgetProps, Incubator, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorDetail, IncubatorDetailProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, ContributionUtils, bytesToSize, getUnseenNotification, getUnseenNotificationCounter, MessageUploaderUtils, getRelativeTime, Footer, FooterProps, FooterSkeleton, BaseItem, BaseItemProps, BaseDialog, BaseDialogProps, GroupSettingsIconButton, GroupSettingsIconButtonProps };
149
+ export { AccountDataPortability, AccountDataPortabilityProps, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDelete, AccountDeleteProps, AccountDeleteButton, AccountDeleteButtonProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AccountChangeMailValidation, AccountChangeMailValidationProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbar, NavigationToolbarProps, NavigationToolbarSkeleton, NavigationMenuIconButton, NavigationMenuContent, NavigationMenuIconButtonProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, Category, CategoryProps, CategorySkeleton, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, Categories, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, ChangeCover, ChangePicture, ChangePictureProps, ChangeCoverProps, Composer, ComposerProps, ComposerIconButton, ComposerIconButtonProps, Editor, EditorProps, EditorSkeleton, FriendshipUserButton, FriendshipButtonProps, Feed, FeedRef, FeedProps, FeedSidebarProps, FeedSkeleton, CategoryFollowButton, CategoryFollowButtonProps, FollowUserButton, FollowUserButtonProps, ConnectionUserButton, FeedObject, FeedObjectProps, FeedObjectSkeleton, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, GenericSkeleton, AvatarGroupSkeleton, CommentObject, CommentsObject, CommentsObjectProps, CommentObjectProps, CommentsObjectSkeleton, CommentObjectSkeleton, CommentObjectReply, CommentObjectReplyProps, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, ReplyComment, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, Notification, NotificationProps, NotificationSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, PlatformWidget, PlatformWidgetProps, PlatformWidgetSkeleton, LocationAutocomplete, LocationAutocompleteProps, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CategoryTrendingPeopleWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectWidgetProps, RelatedFeedObjectsWidgetSkeleton, UserActionIconButton, UserActionIconButtonProps, UserCounters, UserCountersProps, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserInfoDialog, UserInfoDialogProps, UserInfo, UserInfoProps, UserInfoSkeleton, UserProfileBlocked, UserProfileBlockedProps, SCUserProfileFields, SCUserProfileSettings, UserProfileEdit, UserProfileEditProps, UserProfileEditSkeleton, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserSocialAssociation, UserSocialAssociationProps, SCUserSocialAssociations, VirtualScrollerItemProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, User, UserProps, UserSkeleton, PrivateMessageThread, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Widget, WidgetProps, SCFeedWidgetType, SCFeedObjectTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCMediaObjectType, SCMediaChunkType, SCNotificationObjectTemplateType, SCBroadcastMessageTemplateType, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupMembersButton, GroupMembersButtonProps, CreateGroupButton, CreateGroupButtonProps, EditGroupButton, EditGroupButtonProps, GroupInviteButton, GroupInviteButtonProps, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, Group, GroupProps, GroupSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupsProps, GroupsSkeleton, GroupForm, GroupFormProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, HiddenPlaceholder, UrlTextField, UsernameTextField, EmailTextField, PasswordTextField, PhoneTextField, MetadataField, InfiniteScroll, StickyBox, useStickyBox, StickyBoxProps, StickyBoxComponent, UseStickyBoxProps, TagChip, TagChipProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserAvatar, UserAvatarProps, Lightbox, CentralProgress, ConfirmDialog, LanguageSwitcher, MediaChunkUploader, MediaChunkUploaderProps, File, Link, Share, EditMediaProps, MEDIA_TYPE_EMBED, FACEBOOK_SHARE, TWITTER_SHARE, LINKEDIN_SHARE, DEFAULT_PRELOAD_OFFSET_VIEWPORT, MIN_PRELOAD_OFFSET_VIEWPORT, MAX_PRELOAD_OFFSET_VIEWPORT, ConsentSolution, ConsentSolutionProps, ConsentSolutionSkeleton, ConsentSolutionButton, ConsentSolutionButtonProps, LEGAL_POLICIES, DEFAULT_FIELDS, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_LIMIT, DEFAULT_WIDGETS_NUMBER, PollSuggestionWidget, PollSuggestionWidgetProps, Incubator, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorDetail, IncubatorDetailProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, ContributionUtils, bytesToSize, getUnseenNotification, getUnseenNotificationCounter, MessageUploaderUtils, getRelativeTime, Footer, FooterProps, FooterSkeleton, BaseItem, BaseItemProps, BaseDialog, BaseDialogProps, GroupSettingsIconButton, GroupSettingsIconButtonProps };