@selfcommunity/react-ui 0.8.0-embeds.17 → 0.8.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 (69) hide show
  1. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +1 -1
  2. package/lib/cjs/components/Events/Events.js +15 -5
  3. package/lib/cjs/components/Events/LocationEventsFilter.d.ts +14 -0
  4. package/lib/cjs/components/Events/LocationEventsFilter.js +45 -0
  5. package/lib/cjs/components/Events/PastEventsFilter.js +1 -2
  6. package/lib/cjs/components/Feed/Feed.js +3 -2
  7. package/lib/cjs/components/GroupActionsMenu/index.d.ts +57 -0
  8. package/lib/cjs/components/GroupActionsMenu/index.js +157 -0
  9. package/lib/cjs/components/GroupHeader/GroupHeader.d.ts +6 -0
  10. package/lib/cjs/components/GroupHeader/GroupHeader.js +8 -4
  11. package/lib/cjs/components/Groups/Groups.js +26 -0
  12. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +31 -0
  13. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +35 -0
  14. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +9 -20
  15. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.js +4 -20
  16. package/lib/cjs/components/NavigationMenuIconButton/index.d.ts +2 -1
  17. package/lib/cjs/components/NavigationMenuIconButton/index.js +3 -1
  18. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +5 -0
  19. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +2 -2
  20. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.d.ts +5 -1
  21. package/lib/cjs/components/OnBoardingWidget/OnBoardingWidget.js +30 -7
  22. package/lib/cjs/components/OnBoardingWidget/Steps/Appearance/Appearance.js +8 -4
  23. package/lib/cjs/components/OnBoardingWidget/Steps/Invite/Invite.js +56 -12
  24. package/lib/cjs/components/PlatformWidget/constants.d.ts +0 -4
  25. package/lib/cjs/components/PlatformWidget/constants.js +1 -5
  26. package/lib/cjs/constants/GroupActionsMenu.d.ts +5 -0
  27. package/lib/cjs/constants/GroupActionsMenu.js +8 -0
  28. package/lib/cjs/index.d.ts +4 -2
  29. package/lib/cjs/index.js +11 -5
  30. package/lib/cjs/shared/EventInfoDetails/index.js +3 -3
  31. package/lib/cjs/shared/InfiniteScroll/index.js +4 -4
  32. package/lib/cjs/shared/Media/Link/DisplayComponent.js +5 -5
  33. package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +2 -2
  34. package/lib/esm/components/Events/Events.js +16 -6
  35. package/lib/esm/components/Events/LocationEventsFilter.d.ts +14 -0
  36. package/lib/esm/components/Events/LocationEventsFilter.js +41 -0
  37. package/lib/esm/components/Events/PastEventsFilter.js +1 -2
  38. package/lib/esm/components/Feed/Feed.js +4 -3
  39. package/lib/esm/components/GroupActionsMenu/index.d.ts +57 -0
  40. package/lib/esm/components/GroupActionsMenu/index.js +154 -0
  41. package/lib/esm/components/GroupHeader/GroupHeader.d.ts +6 -0
  42. package/lib/esm/components/GroupHeader/GroupHeader.js +9 -5
  43. package/lib/esm/components/Groups/Groups.js +27 -1
  44. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +31 -0
  45. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +32 -0
  46. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +9 -20
  47. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +6 -22
  48. package/lib/esm/components/NavigationMenuIconButton/index.d.ts +2 -1
  49. package/lib/esm/components/NavigationMenuIconButton/index.js +2 -1
  50. package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +5 -0
  51. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +2 -2
  52. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.d.ts +5 -1
  53. package/lib/esm/components/OnBoardingWidget/OnBoardingWidget.js +31 -8
  54. package/lib/esm/components/OnBoardingWidget/Steps/Appearance/Appearance.js +9 -5
  55. package/lib/esm/components/OnBoardingWidget/Steps/Invite/Invite.js +59 -14
  56. package/lib/esm/components/PlatformWidget/constants.d.ts +0 -4
  57. package/lib/esm/components/PlatformWidget/constants.js +0 -4
  58. package/lib/esm/constants/GroupActionsMenu.d.ts +5 -0
  59. package/lib/esm/constants/GroupActionsMenu.js +5 -0
  60. package/lib/esm/index.d.ts +4 -2
  61. package/lib/esm/index.js +5 -3
  62. package/lib/esm/shared/EventInfoDetails/index.js +3 -3
  63. package/lib/esm/shared/InfiniteScroll/index.js +4 -4
  64. package/lib/esm/shared/Media/Link/DisplayComponent.js +5 -5
  65. package/lib/umd/148.js +2 -0
  66. package/lib/umd/react-ui.js +1 -1
  67. package/package.json +9 -9
  68. package/lib/umd/99.js +0 -2
  69. /package/lib/umd/{99.js.LICENSE.txt → 148.js.LICENSE.txt} +0 -0
package/lib/cjs/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConnectionUserButton = exports.ConfirmDialog = exports.ComposerIconButton = exports.Composer = exports.CommentsObjectSkeleton = exports.CommentsObject = exports.CommentsFeedObjectSkeleton = exports.CommentsFeedObject = exports.CommentObjectSkeleton = exports.CommentObjectReply = exports.CommentObject = exports.ChangePicture = exports.ChangeGroupPicture = exports.ChangeGroupCover = exports.ChangeCover = exports.CentralProgress = exports.CategoryTrendingUsersWidget = exports.CategoryTrendingPeopleWidgetSkeleton = exports.CategoryTrendingFeedWidgetSkeleton = exports.CategoryTrendingFeedWidget = exports.CategorySkeleton = exports.CategoryHeaderSkeleton = exports.CategoryHeader = exports.CategoryFollowersButton = exports.CategoryFollowButton = exports.CategoryAutocomplete = exports.Category = exports.CategoriesSuggestionWidgetSkeleton = exports.CategoriesSuggestionWidget = exports.CategoriesSkeleton = exports.CategoriesPopularWidgetSkeleton = exports.CategoriesPopularWidget = exports.Categories = exports.Calendar = exports.bytesToSize = exports.BroadcastMessagesSkeleton = exports.BroadcastMessages = exports.BottomNavigation = exports.BaseItem = exports.BaseDialog = exports.AvatarGroupSkeleton = exports.AccountVerify = exports.AccountReset = exports.AccountRecover = exports.AccountDeleteButton = exports.AccountDelete = exports.AccountDataPortabilityButton = exports.AccountDataPortability = exports.AccountChangeMailValidation = exports.AcceptRequestUserEventButton = void 0;
4
- exports.FooterSkeleton = exports.Footer = exports.FollowUserButton = exports.File = exports.FeedUpdatesWidgetSkeleton = exports.FeedUpdatesWidget = exports.FeedSkeleton = exports.FeedObjectSkeleton = exports.FeedObjectMediaPreview = exports.FeedObject = exports.Feed = exports.FACEBOOK_SHARE = exports.EventsSkeleton = exports.EventSkeleton = exports.Events = exports.EventParticipantsButton = exports.EventMembersWidgetSkeleton = exports.EventMembersWidget = exports.EventLocationWidgetSkeleton = exports.EventLocationWidget = exports.EventInviteButton = exports.EventInfoWidget = exports.EventInfoDetails = exports.EventHeaderSkeleton = exports.EventHeader = exports.EventActionsMenu = exports.Event = exports.EmailTextField = exports.EditorSkeleton = exports.Editor = exports.EditGroupButton = exports.EditEventButton = exports.DefaultHeaderContent = exports.DefaultDrawerContent = exports.DEFAULT_WIDGETS_NUMBER = exports.DEFAULT_PRELOAD_OFFSET_VIEWPORT = exports.DEFAULT_PAGINATION_QUERY_PARAM_NAME = exports.DEFAULT_PAGINATION_OFFSET = exports.DEFAULT_PAGINATION_LIMIT = exports.DEFAULT_FIELDS = exports.CustomAdvSkeleton = exports.CustomAdv = exports.CreateGroupButton = exports.CreateEventWidgetSkeleton = exports.CreateEventWidget = exports.CreateEventButton = exports.ContributionUtils = exports.ConsentSolutionSkeleton = exports.ConsentSolutionButton = exports.ConsentSolution = void 0;
5
- exports.MEDIA_TYPE_EVENT = exports.MEDIA_TYPE_EMBED = exports.MEDIA_TYPE_DOCUMENT = exports.MEDIA_EMBED_SC_SHARED_OBJECT = exports.MEDIA_EMBED_SC_SHARED_EVENT = exports.MEDIA_EMBED_SC_LINK_TYPE = exports.MAX_PRELOAD_OFFSET_VIEWPORT = exports.LoyaltyProgramWidgetSkeleton = exports.LoyaltyProgramWidget = exports.LogoSelfCommunity = exports.LocationAutocomplete = exports.LINKEDIN_SHARE = exports.Link = exports.Lightbox = exports.LEGAL_POLICIES = exports.LanguageSwitcher = exports.InviteUserEventButton = exports.InlineComposerWidgetSkeleton = exports.InlineComposerWidget = exports.InfiniteScroll = exports.IncubatorSuggestionWidget = exports.IncubatorSubscribeButton = exports.IncubatorListWidget = exports.IncubatorDetail = exports.Incubator = exports.HiddenPlaceholder = exports.GroupSubscribeButton = exports.GroupsSkeleton = exports.GroupSkeleton = exports.GroupSettingsIconButton = exports.Groups = exports.GroupRequestsWidgetSkeleton = exports.GroupRequestsWidget = exports.GroupMembersWidgetSkeleton = exports.GroupMembersWidget = exports.GroupMembersButton = exports.GroupInvitedWidgetSkeleton = exports.GroupInvitedWidget = exports.GroupInviteButton = exports.GroupInfoWidgetSkeleton = exports.GroupInfoWidget = exports.GroupHeaderSkeleton = exports.GroupHeader = exports.GroupForm = exports.Group = exports.getUnseenNotificationCounter = exports.getUnseenNotification = exports.getRelativeTime = exports.GenericSkeleton = exports.FriendshipUserButton = void 0;
6
- exports.SCFeedObjectActivitiesType = exports.SCCommentsOrderBy = exports.SCBroadcastMessageTemplateType = exports.ReplyComment = exports.RelatedFeedObjectsWidgetSkeleton = exports.RelatedFeedObjectsWidget = exports.RelatedEventsWidgetSkeleton = exports.RelatedEventsWidget = exports.ProgressBar = exports.PrivateMessageThreadSkeleton = exports.PrivateMessageThreadItemSkeleton = exports.PrivateMessageThreadItem = exports.PrivateMessageThread = exports.PrivateMessageSnippetsSkeleton = exports.PrivateMessageSnippets = exports.PrivateMessageSnippetItemSkeleton = exports.PrivateMessageSnippetItem = exports.PrivateMessageSettingsIconButton = exports.PrivateMessageEditorSkeleton = exports.PrivateMessageEditor = exports.PrivateMessageComponentSkeleton = exports.PrivateMessageComponent = exports.PollSuggestionWidget = exports.PlatformWidgetSkeleton = exports.PlatformWidget = exports.PhoneTextField = exports.PasswordTextField = exports.OnBoardingWidgetSkeleton = exports.OnBoardingWidget = exports.NotificationSkeleton = exports.Notification = exports.NavigationToolbarSkeleton = exports.NavigationToolbarMobileSkeleton = exports.NavigationToolbarMobile = exports.NavigationToolbar = exports.NavigationSettingsIconButton = exports.NavigationMenuIconButton = exports.NavigationMenuHeader = exports.NavigationMenuContent = exports.MyEventsWidgetSkeleton = exports.MyEventsWidget = exports.MIN_PRELOAD_OFFSET_VIEWPORT = exports.MetadataField = exports.MessageUploaderUtils = exports.MediaChunkUploader = exports.MEDIA_TYPE_VIDEO = exports.MEDIA_TYPE_URL = exports.MEDIA_TYPE_SHARE = exports.MEDIA_TYPE_LINK = exports.MEDIA_TYPE_IMAGE = void 0;
7
- exports.UserSubscribedGroupsWidgetSkeleton = exports.UserSubscribedGroupsWidget = exports.UserSocialAssociation = exports.UserSkeleton = exports.UserProfileHeaderSkeleton = exports.UserProfileHeader = exports.UserProfileEditSkeleton = exports.UserProfileEditSectionSettings = exports.UserProfileEditSectionPublicInfo = exports.UserProfileEditSectionAccount = exports.UserProfileEdit = exports.UserProfileBlocked = exports.UsernameTextField = exports.UserInfoSkeleton = exports.UserInfoDialog = exports.UserInfo = exports.UserFollowersWidgetSkeleton = exports.UserFollowersWidget = exports.UserFollowedUsersWidgetSkeleton = exports.UserFollowedUsersWidget = exports.UserFollowedCategoriesWidgetSkeleton = exports.UserFollowedCategoriesWidget = exports.UserDeletedSnackBar = exports.UserCounters = exports.UserConnectionsWidgetSkeleton = exports.UserConnectionsWidget = exports.UserConnectionsRequestsWidgetSkeleton = exports.UserConnectionsRequestsWidget = exports.UserConnectionsRequestsSentWidgetSkeleton = exports.UserConnectionsRequestsSentWidget = exports.UserAvatar = exports.UserActionIconButton = exports.User = exports.UrlTextField = exports.ToastNotificationsSkeleton = exports.ToastNotifications = exports.TagChip = exports.SuggestedEventsWidgetSkeleton = exports.SuggestedEventsWidget = exports.StickyBox = exports.SnippetNotificationsSkeleton = exports.SnippetNotifications = exports.Share = exports.SearchDialog = exports.SearchAutocomplete = exports.SCUserSocialAssociations = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectTemplateType = void 0;
8
- exports.X_SHARE = exports.Widget = exports.SCEventTemplateType = exports.useStickyBox = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = void 0;
4
+ exports.FollowUserButton = exports.File = exports.FeedUpdatesWidgetSkeleton = exports.FeedUpdatesWidget = exports.FeedSkeleton = exports.FeedObjectSkeleton = exports.FeedObjectMediaPreview = exports.FeedObject = exports.Feed = exports.FACEBOOK_SHARE = exports.EventsSkeleton = exports.EventSkeleton = exports.Events = exports.EventParticipantsButton = exports.EventMembersWidgetSkeleton = exports.EventMembersWidget = exports.EventLocationWidgetSkeleton = exports.EventLocationWidget = exports.EventInviteButton = exports.EventInfoWidget = exports.EventInfoDetails = exports.EventHeaderSkeleton = exports.EventHeader = exports.EventActionsMenu = exports.Event = exports.EmailTextField = exports.EditorSkeleton = exports.Editor = exports.EditGroupButton = exports.EditEventButton = exports.SCGroupEventType = exports.SCTopicType = exports.DefaultHeaderContent = exports.DefaultDrawerContent = exports.DEFAULT_WIDGETS_NUMBER = exports.DEFAULT_PRELOAD_OFFSET_VIEWPORT = exports.DEFAULT_PAGINATION_QUERY_PARAM_NAME = exports.DEFAULT_PAGINATION_OFFSET = exports.DEFAULT_PAGINATION_LIMIT = exports.DEFAULT_FIELDS = exports.CustomAdvSkeleton = exports.CustomAdv = exports.CreateGroupButton = exports.CreateEventWidgetSkeleton = exports.CreateEventWidget = exports.CreateEventButton = exports.ContributionUtils = exports.ConsentSolutionSkeleton = exports.ConsentSolutionButton = exports.ConsentSolution = void 0;
5
+ exports.MEDIA_EMBED_SC_SHARED_OBJECT = exports.MEDIA_EMBED_SC_SHARED_EVENT = exports.MEDIA_EMBED_SC_LINK_TYPE = exports.MAX_PRELOAD_OFFSET_VIEWPORT = exports.LoyaltyProgramWidgetSkeleton = exports.LoyaltyProgramWidget = exports.LogoSelfCommunity = exports.LocationAutocomplete = exports.LINKEDIN_SHARE = exports.Link = exports.Lightbox = exports.LEGAL_POLICIES = exports.LanguageSwitcher = exports.InviteUserEventButton = exports.InlineComposerWidgetSkeleton = exports.InlineComposerWidget = exports.InfiniteScroll = exports.IncubatorSuggestionWidget = exports.IncubatorSubscribeButton = exports.IncubatorListWidget = exports.IncubatorDetail = exports.Incubator = exports.HiddenPlaceholder = exports.GroupSubscribeButton = exports.GroupsSkeleton = exports.GroupSkeleton = exports.GroupSettingsIconButton = exports.Groups = exports.GroupRequestsWidgetSkeleton = exports.GroupRequestsWidget = exports.GroupMembersWidgetSkeleton = exports.GroupMembersWidget = exports.GroupMembersButton = exports.GroupInvitedWidgetSkeleton = exports.GroupInvitedWidget = exports.GroupInviteButton = exports.GroupInfoWidgetSkeleton = exports.GroupInfoWidget = exports.GroupHeaderSkeleton = exports.GroupHeader = exports.GroupForm = exports.GroupActionsMenu = exports.Group = exports.getUnseenNotificationCounter = exports.getUnseenNotification = exports.getRelativeTime = exports.GenericSkeleton = exports.FriendshipUserButton = exports.FooterSkeleton = exports.Footer = void 0;
6
+ exports.RelatedFeedObjectsWidgetSkeleton = exports.RelatedFeedObjectsWidget = exports.RelatedEventsWidgetSkeleton = exports.RelatedEventsWidget = exports.ProgressBar = exports.PrivateMessageThreadSkeleton = exports.PrivateMessageThreadItemSkeleton = exports.PrivateMessageThreadItem = exports.PrivateMessageThread = exports.PrivateMessageSnippetsSkeleton = exports.PrivateMessageSnippets = exports.PrivateMessageSnippetItemSkeleton = exports.PrivateMessageSnippetItem = exports.PrivateMessageSettingsIconButton = exports.PrivateMessageEditorSkeleton = exports.PrivateMessageEditor = exports.PrivateMessageComponentSkeleton = exports.PrivateMessageComponent = exports.PollSuggestionWidget = exports.PlatformWidgetSkeleton = exports.PlatformWidget = exports.PhoneTextField = exports.PasswordTextField = exports.OnBoardingWidgetSkeleton = exports.OnBoardingWidget = exports.NotificationSkeleton = exports.Notification = exports.NavigationToolbarSkeleton = exports.NavigationToolbarMobileSkeleton = exports.NavigationToolbarMobile = exports.NavigationToolbar = exports.NavigationSettingsIconButton = exports.NavigationMenuDrawer = exports.NavigationMenuIconButton = exports.NavigationMenuHeader = exports.NavigationMenuContent = exports.MyEventsWidgetSkeleton = exports.MyEventsWidget = exports.MIN_PRELOAD_OFFSET_VIEWPORT = exports.MetadataField = exports.MessageUploaderUtils = exports.MediaChunkUploader = exports.MEDIA_TYPE_VIDEO = exports.MEDIA_TYPE_URL = exports.MEDIA_TYPE_SHARE = exports.MEDIA_TYPE_LINK = exports.MEDIA_TYPE_IMAGE = exports.MEDIA_TYPE_EVENT = exports.MEDIA_TYPE_EMBED = exports.MEDIA_TYPE_DOCUMENT = void 0;
7
+ exports.UserProfileHeaderSkeleton = exports.UserProfileHeader = exports.UserProfileEditSkeleton = exports.UserProfileEditSectionSettings = exports.UserProfileEditSectionPublicInfo = exports.UserProfileEditSectionAccount = exports.UserProfileEdit = exports.UserProfileBlocked = exports.UsernameTextField = exports.UserInfoSkeleton = exports.UserInfoDialog = exports.UserInfo = exports.UserFollowersWidgetSkeleton = exports.UserFollowersWidget = exports.UserFollowedUsersWidgetSkeleton = exports.UserFollowedUsersWidget = exports.UserFollowedCategoriesWidgetSkeleton = exports.UserFollowedCategoriesWidget = exports.UserDeletedSnackBar = exports.UserCounters = exports.UserConnectionsWidgetSkeleton = exports.UserConnectionsWidget = exports.UserConnectionsRequestsWidgetSkeleton = exports.UserConnectionsRequestsWidget = exports.UserConnectionsRequestsSentWidgetSkeleton = exports.UserConnectionsRequestsSentWidget = exports.UserAvatar = exports.UserActionIconButton = exports.User = exports.UrlTextField = exports.ToastNotificationsSkeleton = exports.ToastNotifications = exports.TagChip = exports.SuggestedEventsWidgetSkeleton = exports.SuggestedEventsWidget = exports.StickyBox = exports.SnippetNotificationsSkeleton = exports.SnippetNotifications = exports.Share = exports.SearchDialog = exports.SearchAutocomplete = exports.SCUserSocialAssociations = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectTemplateType = exports.SCFeedObjectActivitiesType = exports.SCCommentsOrderBy = exports.SCBroadcastMessageTemplateType = exports.ReplyComment = void 0;
8
+ exports.X_SHARE = exports.Widget = exports.SCEventTemplateType = exports.useStickyBox = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = exports.UserSubscribedGroupsWidgetSkeleton = exports.UserSubscribedGroupsWidget = exports.UserSocialAssociation = exports.UserSkeleton = void 0;
9
9
  const tslib_1 = require("tslib");
10
10
  /**
11
11
  * Components
@@ -148,6 +148,8 @@ exports.FriendshipUserButton = FriendshipUserButton_1.default;
148
148
  const Group_1 = tslib_1.__importStar(require("./components/Group"));
149
149
  exports.Group = Group_1.default;
150
150
  Object.defineProperty(exports, "GroupSkeleton", { enumerable: true, get: function () { return Group_1.GroupSkeleton; } });
151
+ const GroupActionsMenu_1 = tslib_1.__importDefault(require("./components/GroupActionsMenu"));
152
+ exports.GroupActionsMenu = GroupActionsMenu_1.default;
151
153
  const GroupForm_1 = tslib_1.__importDefault(require("./components/GroupForm"));
152
154
  exports.GroupForm = GroupForm_1.default;
153
155
  const GroupHeader_1 = tslib_1.__importStar(require("./components/GroupHeader"));
@@ -203,6 +205,7 @@ const NavigationMenuIconButton_1 = tslib_1.__importStar(require("./components/Na
203
205
  exports.NavigationMenuIconButton = NavigationMenuIconButton_1.default;
204
206
  Object.defineProperty(exports, "NavigationMenuContent", { enumerable: true, get: function () { return NavigationMenuIconButton_1.NavigationMenuContent; } });
205
207
  Object.defineProperty(exports, "NavigationMenuHeader", { enumerable: true, get: function () { return NavigationMenuIconButton_1.NavigationMenuHeader; } });
208
+ Object.defineProperty(exports, "NavigationMenuDrawer", { enumerable: true, get: function () { return NavigationMenuIconButton_1.NavigationMenuDrawer; } });
206
209
  const DefaultDrawerContent_1 = tslib_1.__importDefault(require("./components/NavigationMenuIconButton/DefaultDrawerContent"));
207
210
  exports.DefaultDrawerContent = DefaultDrawerContent_1.default;
208
211
  const DefaultHeaderContent_1 = tslib_1.__importDefault(require("./components/NavigationMenuIconButton/DefaultHeaderContent"));
@@ -407,6 +410,9 @@ Object.defineProperty(exports, "LINKEDIN_SHARE", { enumerable: true, get: functi
407
410
  Object.defineProperty(exports, "X_SHARE", { enumerable: true, get: function () { return SocialShare_1.X_SHARE; } });
408
411
  const UserProfile_1 = require("./constants/UserProfile");
409
412
  Object.defineProperty(exports, "DEFAULT_FIELDS", { enumerable: true, get: function () { return UserProfile_1.DEFAULT_FIELDS; } });
413
+ const PubSub_1 = require("./constants/PubSub");
414
+ Object.defineProperty(exports, "SCTopicType", { enumerable: true, get: function () { return PubSub_1.SCTopicType; } });
415
+ Object.defineProperty(exports, "SCGroupEventType", { enumerable: true, get: function () { return PubSub_1.SCGroupEventType; } });
410
416
  /**
411
417
  * Utilities
412
418
  */
@@ -31,18 +31,18 @@ function EventInfoDetails(inProps) {
31
31
  const intl = (0, react_intl_1.useIntl)();
32
32
  const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
33
33
  const privacy = (0, react_1.useMemo)(() => (scEvent && scEvent.privacy === types_1.SCEventPrivacyType.PUBLIC ? 'ui.eventInfoDetails.privacy.public' : 'ui.eventInfoDetails.privacy.private'), [scEvent]);
34
- const location = (0, react_1.useMemo)(() => (scEvent && scEvent.location === types_1.SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson'), [scEvent]);
34
+ const location = (0, react_1.useMemo)(() => scEvent && scEvent.location === types_1.SCEventLocationType.ONLINE ? 'ui.eventInfoDetails.location.virtual' : 'ui.eventInfoDetails.location.inPerson', [scEvent]);
35
35
  if (!scEvent) {
36
36
  return null;
37
37
  }
38
38
  return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [beforeDateInfo, hasDateInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideDateIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: scEvent.active ? 'CalendarIcon' : 'calendar_off' })), (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: !scEvent.active ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.deleted.tooltip", defaultMessage: "ui.eventInfoDetails.deleted.tooltip" })) : null }, { 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.eventInfoDetails.date.startEndTime", defaultMessage: "ui.eventInfoDetails.date.startEndTime", values: {
39
- date: intl.formatDate(scEvent.running ? scEvent.running_start_date : scEvent.next_start_date, {
39
+ date: intl.formatDate(scEvent.running ? scEvent.running_start_date : scEvent.next_start_date ? scEvent.next_start_date : scEvent.start_date, {
40
40
  weekday: 'long',
41
41
  day: 'numeric',
42
42
  year: 'numeric',
43
43
  month: 'long'
44
44
  }),
45
- start: intl.formatDate(scEvent.running ? scEvent.running_start_date : scEvent.next_start_date, { hour: 'numeric', minute: 'numeric' })
45
+ start: intl.formatDate(scEvent.running ? scEvent.running_start_date : scEvent.next_start_date ? scEvent.next_start_date : scEvent.start_date, { hour: 'numeric', minute: 'numeric' })
46
46
  } }) })) })), hasInProgress && scEvent.active && scEvent.running && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.inProgress", defaultMessage: "ui.eventInfoDetails.inProgress" }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, { className: classes.inProgress }) })))] }))), beforeRecurringInfo, hasRecurringInfo && scEvent.recurring !== types_1.SCEventRecurrenceType.NEVER && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideRecurringIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "frequency" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.eventInfoDetails.frequency.${scEvent.recurring}.placeholder`, defaultMessage: `ui.eventInfoDetails.frequency.${scEvent.recurring}.placeholder` }) }))] }))), beforePrivacyInfo, hasPrivacyInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hidePrivacyIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: scEvent.privacy === types_1.SCEventPrivacyType.PUBLIC ? 'public' : 'private' })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: privacy, defaultMessage: privacy }) })), "-", (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: location, defaultMessage: location }) }))] }))), beforeLocationInfo, hasLocationInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.iconTextWrapper }, { children: [!hideLocationIcon && ((0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: scEvent.location === types_1.SCEventLocationType.ONLINE ? 'play_circle_outline' : 'add_location_alt' }))), scEvent.location === types_1.SCEventLocationType.ONLINE ? ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scEvent.link, target: "_blank", className: classes.link }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.url }, { children: scEvent.link })) }))) : ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", className: classes.url }, { children: scEvent.geolocation })))] }))), beforeCreatedInfo, hasCreatedInfo && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.creationWrapper }, { children: [!hideCreatedIcon && (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "create" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventInfoDetails.date.create", defaultMessage: "ui.eventInfoDetails.date.create", values: {
47
47
  date: intl.formatDate(scEvent.created_at, {
48
48
  weekday: 'long',
@@ -225,11 +225,11 @@ class InfiniteScroll extends react_1.Component {
225
225
  // because heighted infiniteScroll visualy breaks
226
226
  // on drag down as overflow becomes visible
227
227
  const outerDivStyle = this.props.pullDownToRefresh && this.props.height ? { overflow: 'auto' } : {};
228
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: outerDivStyle, className: "infinite-scroll-component__outerdiv" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `infinite-scroll-component ${this.props.className || ''}`, ref: (infScroll) => (this._infScroll = infScroll), style: style }, { children: [this.props.header, this.props.pullDownToRefresh && ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: { position: 'relative', marginBottom: 16 }, ref: (pullDown) => (this._pullDown = pullDown) }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: {
228
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: outerDivStyle, className: "infinite-scroll-component__outerdiv" }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: `infinite-scroll-component ${this.props.className || ''}`, ref: (infScroll) => (this._infScroll = infScroll), style: style }, { children: [this.props.header, this.props.pullDownToRefresh && ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: { position: 'relative' }, ref: (pullDown) => (this._pullDown = pullDown) }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ style: {
229
229
  position: 'absolute',
230
- left: 0,
231
- right: 0,
232
- top: -1 * this.maxPullDownDistance
230
+ left: '50%',
231
+ transform: 'translateX(-50%)',
232
+ zIndex: 1
233
233
  } }, { children: this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent })) }))), !this.props.inverse && this.state.showLoaderPrevious && this.props.hasMorePrevious && this.props.loaderPrevious, this.props.children, this.props.inverse && this.state.showLoaderPrevious && this.props.hasMorePrevious && this.props.loaderPrevious, !this.state.showLoaderNext && !hasChildren && this.props.hasMoreNext && this.props.loaderNext, this.state.showLoaderNext && this.props.hasMoreNext && this.props.loaderNext, !this.props.hasMoreNext && this.props.endMessage, this.props.footer] })) })));
234
234
  }
235
235
  }
@@ -49,11 +49,11 @@ exports.default = (props) => {
49
49
  * @param key
50
50
  */
51
51
  const renderPreview = (media, key) => {
52
- if (media.embed.metadata.html) {
53
- return renderHtml(media, key);
54
- }
52
+ // if (media.embed.metadata.html) {
53
+ // return renderHtml(media, key);
54
+ // }
55
55
  const domain = new URL(media.embed.metadata.url).hostname.replace('www.', '');
56
- return ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.displayLink }, { children: [media.embed.metadata.images && media.embed.metadata.images.length > 0 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fullWidth ? ((0, jsx_runtime_1.jsx)(Box_1.default, { className: (0, classnames_1.default)(classes.thumbnailFullWidth, classes.image), style: { background: `url(${media.image})`, paddingBottom: `${100 / media.image_width / media.image_height}%` } })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { className: (0, classnames_1.default)(classes.thumbnail, classes.image), style: { background: `url(${media.image})` } })) })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.snippet }, { children: [(0, jsx_runtime_1.jsx)("b", Object.assign({ className: classes.snippetTitle }, { children: media.embed.metadata.title })), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: classes.snippetDescription }, { children: media.embed.metadata.description })), (0, jsx_runtime_1.jsx)("a", Object.assign({ href: media.embed.metadata.url, target: '_blank', onClick: () => handleLinkClick(media) }, { children: domain }))] })), (0, jsx_runtime_1.jsx)("div", { style: { clear: 'both' } })] })));
56
+ return ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.displayLink }, { children: [media.embed.metadata.images && media.embed.metadata.images.length > 0 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fullWidth ? ((0, jsx_runtime_1.jsx)(Box_1.default, { className: (0, classnames_1.default)(classes.thumbnailFullWidth, classes.image), style: { background: `url(${media.image})`, paddingBottom: `${100 / media.image_width / media.image_height}%` } })) : ((0, jsx_runtime_1.jsx)(Box_1.default, { className: (0, classnames_1.default)(classes.thumbnail, classes.image), style: { background: `url(${media.image})` } })) })), (0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.snippet }, { children: [(0, jsx_runtime_1.jsx)("b", Object.assign({ className: classes.snippetTitle }, { children: media.embed.metadata.title })), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("p", Object.assign({ className: classes.snippetDescription }, { children: media.embed.metadata.description })), (0, jsx_runtime_1.jsx)("a", Object.assign({ href: media.embed.metadata.url, target: '_blank', onClick: () => handleLinkClick(media) }, { children: domain }))] })), (0, jsx_runtime_1.jsx)("div", { style: { clear: 'both' } })] }), key));
57
57
  };
58
58
  /**
59
59
  * Render html embed
@@ -61,7 +61,7 @@ exports.default = (props) => {
61
61
  * @param key
62
62
  */
63
63
  const renderHtml = (media, key) => {
64
- return ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.displayHtmlWrap }, { children: [(0, jsx_runtime_1.jsx)("div", { dangerouslySetInnerHTML: { __html: media.embed.metadata.html }, className: classes.displayHtml }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.displayHtmlPlaceholder, style: { paddingTop: `${(100 * media.embed.metadata.height) / media.embed.metadata.width}%`, maxHeight: media.embed.metadata.height } }, { children: (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20, className: classes.displayHtmlLoading }) }))] })));
64
+ return ((0, jsx_runtime_1.jsxs)(Box_1.default, Object.assign({ className: classes.displayHtmlWrap }, { children: [(0, jsx_runtime_1.jsx)("div", { dangerouslySetInnerHTML: { __html: media.embed.metadata.html }, className: classes.displayHtml }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.displayHtmlPlaceholder, style: { paddingTop: `${(100 * media.embed.metadata.height) / media.embed.metadata.width}%`, maxHeight: media.embed.metadata.height } }, { children: (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20, className: classes.displayHtmlLoading }) }))] }), key));
65
65
  };
66
66
  /**
67
67
  * Renders component
@@ -5,7 +5,7 @@ import { ToggleButton, ToggleButtonGroup } from '@mui/material';
5
5
  import { useCallback, useEffect, useMemo } from 'react';
6
6
  import classNames from 'classnames';
7
7
  import { FormattedMessage } from 'react-intl';
8
- import { SCPreferences, UserUtils, useSCPreferences, useSCUser, } from '@selfcommunity/react-core';
8
+ import { SCPreferences, UserUtils, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
9
9
  import { COMPOSER_TYPE_DISCUSSION, COMPOSER_TYPE_POLL, COMPOSER_TYPE_POST } from '../../../constants/Composer';
10
10
  import { PREFIX } from '../constants';
11
11
  const classes = {
@@ -35,5 +35,5 @@ export default function ComposerTypeButtonGroup(props) {
35
35
  const handleChange = useCallback((event, value) => {
36
36
  onChange && onChange(value);
37
37
  }, [onChange]);
38
- return _jsxs(Root, Object.assign({ className: classNames(classes.root, className), onChange: handleChange, exclusive: true, value: value }, rest, { children: [hasPostType && _jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_POST }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.post", defaultMessage: "ui.composer.typeSwitch.post" }) })), hasDiscussionType && _jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_DISCUSSION }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.discussion", defaultMessage: "ui.composer.typeSwitch.discussion" }) })), hasPollType && _jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_POLL }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.poll", defaultMessage: "ui.composer.typeSwitch.poll" }) }))] }));
38
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className), onChange: handleChange, exclusive: true, value: value }, rest, { children: [hasPostType && (_jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_POST }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.post", defaultMessage: "ui.composer.typeSwitch.post" }) }))), hasDiscussionType && (_jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_DISCUSSION }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.discussion", defaultMessage: "ui.composer.typeSwitch.discussion" }) }))), hasPostType && hasPollType && (_jsx(ToggleButton, Object.assign({ value: COMPOSER_TYPE_POLL }, { children: _jsx(FormattedMessage, { id: "ui.composer.typeSwitch.poll", defaultMessage: "ui.composer.typeSwitch.poll" }) })))] })));
39
39
  }
@@ -5,7 +5,7 @@ import { styled } from '@mui/material/styles';
5
5
  import { useThemeProps } from '@mui/system';
6
6
  import { Endpoints, http } from '@selfcommunity/api-services';
7
7
  import { SCPreferences, SCPreferencesContext, SCUserContext, UserUtils } from '@selfcommunity/react-core';
8
- import { SCEventDateFilterType, SCEventSubscriptionStatusType } from '@selfcommunity/types';
8
+ import { SCEventDateFilterType, SCEventSubscriptionStatusType, SCEventLocationFilterType } from '@selfcommunity/types';
9
9
  import { Logger } from '@selfcommunity/utils';
10
10
  import classNames from 'classnames';
11
11
  import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
@@ -19,6 +19,7 @@ import { PREFIX } from './constants';
19
19
  import PastEventsFilter from './PastEventsFilter';
20
20
  import PubSub from 'pubsub-js';
21
21
  import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
22
+ import LocationEventsFilter from './LocationEventsFilter';
22
23
  const classes = {
23
24
  root: `${PREFIX}-root`,
24
25
  filters: `${PREFIX}-filters`,
@@ -86,6 +87,7 @@ export default function Events(inProps) {
86
87
  const [next, setNext] = useState(null);
87
88
  const [query, setQuery] = useState('');
88
89
  const [dateSearch, setDateSearch] = useState(options[0].value);
90
+ const [location, setLocation] = useState(SCEventLocationFilterType.ANY);
89
91
  const [showFollowed, setShowFollowed] = useState(false);
90
92
  const [showPastEvents, setShowPastEvents] = useState(false);
91
93
  const [showMyEvents, setShowMyEvents] = useState(false);
@@ -125,7 +127,7 @@ export default function Events(inProps) {
125
127
  url: endpoint.url({}),
126
128
  method: endpoint.method,
127
129
  params: Object.assign(Object.assign({}, endpointQueryParams), (general
128
- ? Object.assign(Object.assign(Object.assign(Object.assign({}, (search && { search: query })), (dateSearch !== SCEventDateFilterType.ANY && { date_filter: dateSearch })), (showFollowed && { follows: showFollowed })), (showPastEvents && { date_filter: SCEventDateFilterType.PAST })) : Object.assign(Object.assign({ subscription_status: SCEventSubscriptionStatusType.GOING }, (showPastEvents && { past: showPastEvents })), (showMyEvents && { created_by: authUserId }))))
130
+ ? Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (search && { search: query })), (dateSearch !== SCEventDateFilterType.ANY && { date_filter: dateSearch })), (location !== SCEventLocationFilterType.ANY && { location })), (showFollowed && { follows: showFollowed })), (showPastEvents && { date_filter: SCEventDateFilterType.PAST })) : Object.assign(Object.assign(Object.assign({ subscription_status: SCEventSubscriptionStatusType.GOING }, (location !== SCEventLocationFilterType.ANY && { location })), (showPastEvents && { past: showPastEvents })), (showMyEvents && { created_by: authUserId }))))
129
131
  })
130
132
  .then((res) => {
131
133
  setEvents(res.data.results);
@@ -146,7 +148,7 @@ export default function Events(inProps) {
146
148
  else {
147
149
  query === '' && fetchEvents();
148
150
  }
149
- }, [contentAvailability, dateSearch, showFollowed, showPastEvents, showMyEvents, query]);
151
+ }, [contentAvailability, dateSearch, location, showFollowed, showPastEvents, showMyEvents, query]);
150
152
  /**
151
153
  * Subscriber for pubsub callback
152
154
  */
@@ -199,10 +201,18 @@ export default function Events(inProps) {
199
201
  const handleOnChangeTimeFrame = (event) => {
200
202
  setDateSearch(event.target.value);
201
203
  };
204
+ /**
205
+ * Handle change location
206
+ * @param event
207
+ */
208
+ const handleOnChangeLocation = (event) => {
209
+ setLocation(event.target.value);
210
+ };
202
211
  /**
203
212
  * Renders events list
204
213
  */
205
- const c = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ item: true }, { children: _jsx(PastEventsFilter, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, autoHide: !events.length && !showPastEvents, disabled: loading }) })), (events.length !== 0 || (events.length === 0 && showMyEvents)) && (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(EventsChipRoot
214
+ console.log(location);
215
+ const c = (_jsxs(_Fragment, { children: [showFilters && (_jsx(Grid, Object.assign({ container: true, className: classes.filters, gap: 2 }, { children: filters ? (filters) : !general ? (_jsxs(_Fragment, { children: [(events.length !== 0 || (events.length === 0 && showMyEvents)) && (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(EventsChipRoot
206
216
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
207
217
  // @ts-ignore
208
218
  , {
@@ -214,14 +224,14 @@ export default function Events(inProps) {
214
224
  variant: showMyEvents ? 'filled' : 'outlined', label: _jsx(FormattedMessage, { id: "ui.events.filterByCreatedByMe", defaultMessage: "ui.events.filterByCreatedByMe" }), onClick: () => setShowMyEvents(!showMyEvents),
215
225
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
216
226
  // @ts-ignore
217
- showFollowed: showMyEvents, deleteIcon: showMyEvents ? _jsx(Icon, { children: "close" }) : null, onDelete: showMyEvents ? handleDeleteClick : null, disabled: loading }) })))] })) : (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, md: 4 }, { children: _jsx(TextField, { className: classes.search, size: 'small', fullWidth: true, value: query, label: _jsx(FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading || (!events.length && !query), onKeyUp: (e) => {
227
+ showFollowed: showMyEvents, deleteIcon: showMyEvents ? _jsx(Icon, { children: "close" }) : null, onDelete: showMyEvents ? handleDeleteClick : null, autoHide: !loading && !events.length, disabled: loading }) }))), _jsx(Grid, Object.assign({ item: true }, { children: _jsx(PastEventsFilter, { showPastEvents: showPastEvents, handleClick: handleChipPastClick, handleDeleteClick: handleDeletePastClick, autoHide: !loading && !events.length && !showPastEvents, disabled: loading }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: _jsx(LocationEventsFilter, { value: location, autoHide: !loading && !events.length, disabled: loading || (!events.length && !location), handleOnChange: handleOnChangeLocation }) }))] })) : (_jsxs(_Fragment, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, md: 3 }, { children: _jsx(TextField, { className: classes.search, size: 'small', fullWidth: true, value: query, label: _jsx(FormattedMessage, { id: "ui.events.filterByName", defaultMessage: "ui.events.filterByName" }), variant: "outlined", onChange: handleOnChangeFilterName, disabled: loading || (!events.length && !query), onKeyUp: (e) => {
218
228
  e.preventDefault();
219
229
  if (e.key === 'Enter') {
220
230
  fetchEvents(true);
221
231
  }
222
232
  }, InputProps: {
223
233
  endAdornment: (_jsx(InputAdornment, Object.assign({ position: "end" }, { children: isMobile ? (_jsx(IconButton, Object.assign({ onClick: () => fetchEvents(true), disabled: loading || (!events.length && !query) }, { children: _jsx(Icon, { children: "search" }) }))) : (_jsx(Button, { size: "small", variant: "contained", color: "secondary", onClick: () => fetchEvents(true), endIcon: _jsx(Icon, { children: "search" }), disabled: loading || (!events.length && !query) })) })))
224
- } }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(InputLabel, { children: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), _jsx(Select, Object.assign({ disabled: showPastEvents || loading || (!events.length && dateSearch === SCEventDateFilterType.ANY), size: 'small', label: _jsx(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) => (_jsxs(MenuItem, Object.assign({ value: option.value }, { children: [_jsx(Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), authUserId && (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(EventsChipRoot
234
+ } }) })), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(InputLabel, { children: _jsx(FormattedMessage, { id: "ui.events.filterByDate", defaultMessage: "ui.events.filterByDate" }) }), _jsx(Select, Object.assign({ disabled: showPastEvents || loading || (!events.length && dateSearch === SCEventDateFilterType.ANY), size: 'small', label: _jsx(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) => (_jsxs(MenuItem, Object.assign({ value: option.value }, { children: [_jsx(Radio, { checked: dateSearch === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })) })), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 2 }, { children: _jsx(LocationEventsFilter, { value: location, disabled: loading || (!events.length && !location), handleOnChange: handleOnChangeLocation }) })), authUserId && (_jsx(Grid, Object.assign({ item: true }, { children: _jsx(EventsChipRoot
225
235
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
226
236
  // @ts-ignore
227
237
  , {
@@ -0,0 +1,14 @@
1
+ import { ChipProps } from '@mui/material';
2
+ import { SCEventLocationFilterType } from '@selfcommunity/types';
3
+ export interface LocationEventsFilterProps extends ChipProps {
4
+ /**
5
+ * Overrides or extends the styles applied to the component.
6
+ * @default null
7
+ */
8
+ className?: string;
9
+ value: SCEventLocationFilterType;
10
+ disabled?: boolean;
11
+ autoHide?: boolean;
12
+ handleOnChange: (event: any) => void;
13
+ }
14
+ export default function LocationEventsFilter(inProps: LocationEventsFilterProps): JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FormControl, InputLabel, MenuItem, Radio, Select } from '@mui/material';
3
+ import { FormattedMessage } from 'react-intl';
4
+ import { useThemeProps } from '@mui/system';
5
+ import { PREFIX } from './constants';
6
+ import { styled } from '@mui/material/styles';
7
+ import { SCEventLocationFilterType } from '@selfcommunity/types';
8
+ import classNames from 'classnames';
9
+ const classes = {
10
+ root: `${PREFIX}-root`
11
+ };
12
+ const Root = styled(FormControl, {
13
+ name: PREFIX,
14
+ slot: 'Root'
15
+ })(() => ({}));
16
+ const locationOptions = [
17
+ {
18
+ value: SCEventLocationFilterType.ANY,
19
+ label: _jsx(FormattedMessage, { id: "ui.events.location.select.any", defaultMessage: "ui.events.location.select.any" })
20
+ },
21
+ {
22
+ value: SCEventLocationFilterType.PERSON,
23
+ label: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.location.inPerson", defaultMessage: "ui.eventInfoDetails.location.inPerson" })
24
+ },
25
+ {
26
+ value: SCEventLocationFilterType.ONLINE,
27
+ label: _jsx(FormattedMessage, { id: "ui.eventInfoDetails.location.virtual", defaultMessage: "ui.eventInfoDetails.location.virtual" })
28
+ }
29
+ ];
30
+ export default function LocationEventsFilter(inProps) {
31
+ // PROPS
32
+ const props = useThemeProps({
33
+ props: inProps,
34
+ name: PREFIX
35
+ });
36
+ const { className, value, disabled = false, autoHide = false, handleOnChange } = props;
37
+ if (autoHide) {
38
+ return null;
39
+ }
40
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className), fullWidth: true }, { children: [_jsx(InputLabel, { children: _jsx(FormattedMessage, { id: "ui.events.filterByLocation", defaultMessage: "ui.events.filterByLocation" }) }), _jsx(Select, Object.assign({ disabled: disabled, size: 'small', label: _jsx(FormattedMessage, { id: "ui.events.location", defaultMessage: "ui.events.location" }), value: value, onChange: handleOnChange, renderValue: (selected) => locationOptions.find((option) => option.value === selected).label }, { children: locationOptions.map((option) => (_jsxs(MenuItem, Object.assign({ value: option.value }, { children: [_jsx(Radio, { checked: value === option.value, value: option.value, name: "radio-button-select", inputProps: { 'aria-label': option.label } }), option.label] }), option.value))) }))] })));
41
+ }
@@ -5,7 +5,6 @@ import { FormattedMessage } from 'react-intl';
5
5
  import { useThemeProps } from '@mui/system';
6
6
  import { PREFIX } from './constants';
7
7
  import { EventsChipRoot } from './Events';
8
- import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
9
8
  export default function PastEventsFilter(inProps) {
10
9
  // PROPS
11
10
  const props = useThemeProps({
@@ -14,7 +13,7 @@ export default function PastEventsFilter(inProps) {
14
13
  });
15
14
  const { autoHide = false, showPastEvents, handleClick, handleDeleteClick } = props, rest = __rest(props, ["autoHide", "showPastEvents", "handleClick", "handleDeleteClick"]);
16
15
  if (autoHide) {
17
- return _jsx(HiddenPlaceholder, {});
16
+ return null;
18
17
  }
19
18
  return (_jsx(EventsChipRoot
20
19
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
@@ -3,7 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
4
4
  import { Link, SCCache, SCPreferences, SCPreferencesContext, SCUserContext, useIsComponentMountedRef, usePreviousValue, useSCFetchFeed } from '@selfcommunity/react-core';
5
5
  import { styled, useTheme } from '@mui/material/styles';
6
- import { Box, CardContent, Grid, Hidden, Typography, useMediaQuery } from '@mui/material';
6
+ import { Box, Button, CardContent, Grid, Hidden, Typography, useMediaQuery } from '@mui/material';
7
7
  import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
8
8
  import { GenericSkeleton } from '../Skeleton';
9
9
  import CustomAdv from '../CustomAdv';
@@ -34,6 +34,7 @@ const classes = {
34
34
  left: `${PREFIX}-left`,
35
35
  leftItems: `${PREFIX}-left-items`,
36
36
  start: `${PREFIX}-start`,
37
+ headerItem: `${PREFIX}-header-item`,
37
38
  end: `${PREFIX}-end`,
38
39
  endMessage: `${PREFIX}-end-message`,
39
40
  right: `${PREFIX}-right`,
@@ -290,7 +291,7 @@ const Feed = (inProps, ref) => {
290
291
  const renderHeaderComponent = () => {
291
292
  return (_jsx(Box, Object.assign({ className: classes.start }, { children: !feedDataObject.previous && (_jsxs(_Fragment, { children: [virtualScrollerMountState.current && HeaderComponent, headData.map((item) => {
292
293
  const _itemId = `item_${itemIdGenerator(item)}`;
293
- return (_jsx(ItemComponent, Object.assign({ id: _itemId }, itemPropsGenerator(scUserContext.user, item), ItemProps, { sx: { width: '100%' } }), _itemId));
294
+ return (_jsx(ItemComponent, Object.assign({ className: classes.headerItem, id: _itemId }, itemPropsGenerator(scUserContext.user, item), ItemProps, { sx: { width: '100%' } }), _itemId));
294
295
  })] })) })));
295
296
  };
296
297
  /**
@@ -416,6 +417,6 @@ const Feed = (inProps, ref) => {
416
417
  if (feedDataObject.isLoadingNext && !feedDataLeft.length) {
417
418
  return (_jsx(FeedSkeleton, { children: [...Array(3)].map((v, i) => (_jsx(ItemSkeleton, Object.assign({}, ItemSkeletonProps), i))) }));
418
419
  }
419
- return (_jsxs(Root, Object.assign({ container: true, spacing: 2, id: id, className: classNames(classes.root, className) }, { children: [advEnabled && !hideAdvs && enabledCustomAdvPositions.includes(SCCustomAdvPosition.POSITION_BELOW_TOPBAR) ? (_jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsx(CustomAdv, Object.assign({ position: SCCustomAdvPosition.POSITION_BELOW_TOPBAR }, CustomAdvProps)) }))) : null, _jsx(Grid, Object.assign({ item: true, xs: 12, md: 7 }, { children: _jsxs(InfiniteScroll, Object.assign({ ref: containerRef, className: classes.left, dataLength: feedDataLeft.length, next: getNextPage, previous: getPreviousPage, hasMoreNext: Boolean(feedDataObject.next), hasMorePrevious: Boolean(feedDataObject.previous), header: PreviousPageLink, footer: NextPageLink, loaderNext: _jsx(ItemSkeleton, Object.assign({}, ItemSkeletonProps)), loaderPrevious: _jsx(ItemSkeleton, Object.assign({}, ItemSkeletonProps)), scrollThreshold: '90%', endMessage: _jsxs(Box, Object.assign({ className: classes.end }, { children: [_jsx(Widget, Object.assign({ className: classes.endMessage }, { children: _jsx(CardContent, { children: endMessage }) })), FooterComponent ? _jsx(FooterComponent, Object.assign({}, FooterComponentProps)) : null] })), refreshFunction: refresh, pullDownToRefresh: true, pullDownToRefreshThreshold: 1000, pullDownToRefreshContent: null, releaseToRefreshContent: _jsx(Widget, Object.assign({ variant: "outlined", className: classes.refresh }, { children: _jsx(CardContent, { children: refreshMessage }) })), style: { overflow: 'visible' } }, (scrollableTargetId && { scrollableTarget: scrollableTargetId }), { children: [renderHeaderComponent(), feedDataObject.count === 0 && emptyFeedPlaceholder && emptyFeedPlaceholder, _jsx(VirtualizedScroller, Object.assign({ className: classes.leftItems, items: feedDataLeft, itemComponent: InnerItem, onMount: onScrollerMount, onScrollerStateChange: onScrollerStateChange, getItemId: getScrollItemId, preserveScrollPosition: true, preserveScrollPositionOnPrependItems: true, cacheScrollStateKey: SCCache.getVirtualizedScrollStateCacheKey(id), cacheScrollerPositionKey: SCCache.getFeedSPCacheKey(id), cacheStrategy: cacheStrategy }, (scrollableTargetId && { getScrollableContainer: () => document.getElementById(scrollableTargetId) }), VirtualizedScrollerProps))] })) })), feedDataRight.length > 0 && !hideAdvs && (_jsx(Hidden, Object.assign({ smDown: true }, { children: _jsx(Grid, Object.assign({ item: true, xs: 12, md: 5 }, { children: _jsx(StickyBoxComp, Object.assign({ className: classes.right }, FeedSidebarProps, { children: _jsx(React.Suspense, Object.assign({ fallback: _jsx(GenericSkeleton, {}) }, { children: feedDataRight.map((d, i) => (_jsx(d.component, Object.assign({}, d.componentProps), i))) })) })) })) })))] })));
420
+ return (_jsxs(Root, Object.assign({ container: true, spacing: 2, id: id, className: classNames(classes.root, className) }, { children: [advEnabled && !hideAdvs && enabledCustomAdvPositions.includes(SCCustomAdvPosition.POSITION_BELOW_TOPBAR) ? (_jsx(Grid, Object.assign({ item: true, xs: 12 }, { children: _jsx(CustomAdv, Object.assign({ position: SCCustomAdvPosition.POSITION_BELOW_TOPBAR }, CustomAdvProps)) }))) : null, _jsx(Grid, Object.assign({ item: true, xs: 12, md: 7 }, { children: _jsxs(InfiniteScroll, Object.assign({ ref: containerRef, className: classes.left, dataLength: feedDataLeft.length, next: getNextPage, previous: getPreviousPage, hasMoreNext: Boolean(feedDataObject.next), hasMorePrevious: Boolean(feedDataObject.previous), header: PreviousPageLink, footer: NextPageLink, loaderNext: _jsx(ItemSkeleton, Object.assign({}, ItemSkeletonProps)), loaderPrevious: _jsx(ItemSkeleton, Object.assign({}, ItemSkeletonProps)), scrollThreshold: '90%', endMessage: _jsxs(Box, Object.assign({ className: classes.end }, { children: [_jsx(Widget, Object.assign({ className: classes.endMessage }, { children: _jsx(CardContent, { children: endMessage }) })), FooterComponent ? _jsx(FooterComponent, Object.assign({}, FooterComponentProps)) : null] })), refreshFunction: refresh, pullDownToRefresh: true, pullDownToRefreshThreshold: 1000, pullDownToRefreshContent: null, releaseToRefreshContent: _jsx(Button, Object.assign({ color: "secondary", variant: "contained", className: classes.refresh }, { children: refreshMessage })), style: { overflow: 'visible' } }, (scrollableTargetId && { scrollableTarget: scrollableTargetId }), { children: [renderHeaderComponent(), feedDataObject.count === 0 && emptyFeedPlaceholder && emptyFeedPlaceholder, _jsx(VirtualizedScroller, Object.assign({ className: classes.leftItems, items: feedDataLeft, itemComponent: InnerItem, onMount: onScrollerMount, onScrollerStateChange: onScrollerStateChange, getItemId: getScrollItemId, preserveScrollPosition: true, preserveScrollPositionOnPrependItems: true, cacheScrollStateKey: SCCache.getVirtualizedScrollStateCacheKey(id), cacheScrollerPositionKey: SCCache.getFeedSPCacheKey(id), cacheStrategy: cacheStrategy }, (scrollableTargetId && { getScrollableContainer: () => document.getElementById(scrollableTargetId) }), VirtualizedScrollerProps))] })) })), feedDataRight.length > 0 && !hideAdvs && (_jsx(Hidden, Object.assign({ smDown: true }, { children: _jsx(Grid, Object.assign({ item: true, xs: 12, md: 5 }, { children: _jsx(StickyBoxComp, Object.assign({ className: classes.right }, FeedSidebarProps, { children: _jsx(React.Suspense, Object.assign({ fallback: _jsx(GenericSkeleton, {}) }, { children: feedDataRight.map((d, i) => (_jsx(d.component, Object.assign({}, d.componentProps), i))) })) })) })) })))] })));
420
421
  };
421
422
  export default forwardRef(Feed);
@@ -0,0 +1,57 @@
1
+ import { IconButtonProps } from '@mui/material';
2
+ import { SCGroupType } from '@selfcommunity/types';
3
+ export interface GroupActionsMenuProps extends IconButtonProps {
4
+ /**
5
+ * Overrides or extends the styles applied to the component.
6
+ * @default null
7
+ */
8
+ className?: string;
9
+ /**
10
+ * The group
11
+ */
12
+ group: SCGroupType;
13
+ /**
14
+ * The group id
15
+ */
16
+ groupId?: number;
17
+ /**
18
+ * Handles callback on delete confirm
19
+ */
20
+ onDeleteConfirm?: () => void;
21
+ /**
22
+ * Handles on edit success
23
+ */
24
+ onEditSuccess?: (data: SCGroupType) => any;
25
+ /**
26
+ * Any other properties
27
+ */
28
+ [p: string]: any;
29
+ }
30
+ /**
31
+ * > API documentation for the Community-JS GroupActionsMenu component. Learn about the available props and the CSS API.
32
+
33
+ #### Import
34
+
35
+ ```jsx
36
+ import {GroupActionsMenu} from '@selfcommunity/react-ui';
37
+ ```
38
+
39
+ #### Component Name
40
+
41
+ The name `SCGroupActionsMenu` can be used when providing style overrides in the theme.
42
+
43
+
44
+ #### CSS
45
+
46
+ |Rule Name|Global class|Description|
47
+ |---|---|---|
48
+ |root|.SCGroupActionsMenu-root|Styles applied to the root element.|
49
+ |drawerRoot|.SCGroupActionsMenu-drawer-root|Styles applied to the drawer root element.|
50
+ |menuRoot|.SCGroupActionsMenu-menu-root|Styles applied to the menu root element.|
51
+ |paper|.SCGroupActionsMenu-paper|Styles applied to the paper element.|
52
+ |item|.SCGroupActionsMenu-item|Styles applied to the item element.|
53
+
54
+
55
+ * @param inProps
56
+ */
57
+ export default function GroupActionsMenu(inProps: GroupActionsMenuProps): JSX.Element;
@@ -0,0 +1,154 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useMemo, useState } from 'react';
4
+ import { styled } from '@mui/material/styles';
5
+ import { Divider, IconButton, List, ListItemIcon, Menu, MenuItem, SwipeableDrawer, useMediaQuery, useTheme } from '@mui/material';
6
+ import { FormattedMessage } from 'react-intl';
7
+ import Icon from '@mui/material/Icon';
8
+ import classNames from 'classnames';
9
+ import { useThemeProps } from '@mui/system';
10
+ import { SCRoutes, useSCFetchGroup, useSCRouting, useSCUser } from '@selfcommunity/react-core';
11
+ import ConfirmDialog from '../../shared/ConfirmDialog/ConfirmDialog';
12
+ import { GroupService } from '@selfcommunity/api-services';
13
+ import { copyTextToClipboard } from '@selfcommunity/utils';
14
+ import { enqueueSnackbar } from 'notistack';
15
+ import PubSub from 'pubsub-js';
16
+ import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
17
+ import GroupForm from '../../components/GroupForm';
18
+ import { DELETE_GROUP, GET_GROUP_LINK } from '../../constants/GroupActionsMenu';
19
+ const PREFIX = 'SCGroupActionsMenu';
20
+ const classes = {
21
+ root: `${PREFIX}-root`,
22
+ drawerRoot: `${PREFIX}-drawer-root`,
23
+ menuRoot: `${PREFIX}-menu-root`,
24
+ paper: `${PREFIX}-paper`,
25
+ item: `${PREFIX}-item`
26
+ };
27
+ const Root = styled(IconButton, {
28
+ name: PREFIX,
29
+ slot: 'Root'
30
+ })(() => ({}));
31
+ const SwipeableDrawerRoot = styled(SwipeableDrawer, {
32
+ name: PREFIX,
33
+ slot: 'DrawerRoot'
34
+ })(() => ({}));
35
+ const MenuRoot = styled(Menu, {
36
+ name: PREFIX,
37
+ slot: 'MenuRoot'
38
+ })(() => ({}));
39
+ /**
40
+ * > API documentation for the Community-JS GroupActionsMenu component. Learn about the available props and the CSS API.
41
+
42
+ #### Import
43
+
44
+ ```jsx
45
+ import {GroupActionsMenu} from '@selfcommunity/react-ui';
46
+ ```
47
+
48
+ #### Component Name
49
+
50
+ The name `SCGroupActionsMenu` can be used when providing style overrides in the theme.
51
+
52
+
53
+ #### CSS
54
+
55
+ |Rule Name|Global class|Description|
56
+ |---|---|---|
57
+ |root|.SCGroupActionsMenu-root|Styles applied to the root element.|
58
+ |drawerRoot|.SCGroupActionsMenu-drawer-root|Styles applied to the drawer root element.|
59
+ |menuRoot|.SCGroupActionsMenu-menu-root|Styles applied to the menu root element.|
60
+ |paper|.SCGroupActionsMenu-paper|Styles applied to the paper element.|
61
+ |item|.SCGroupActionsMenu-item|Styles applied to the item element.|
62
+
63
+
64
+ * @param inProps
65
+ */
66
+ export default function GroupActionsMenu(inProps) {
67
+ var _a;
68
+ // PROPS
69
+ const props = useThemeProps({
70
+ props: inProps,
71
+ name: PREFIX
72
+ });
73
+ const { className, group, groupId, onDeleteConfirm, onEditSuccess } = props, rest = __rest(props, ["className", "group", "groupId", "onDeleteConfirm", "onEditSuccess"]);
74
+ // STATE
75
+ const [anchorEl, setAnchorEl] = useState(null);
76
+ const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
77
+ const [openEdit, setOpenEdit] = useState(false);
78
+ // HOOKS
79
+ const theme = useTheme();
80
+ const isMobile = useMediaQuery(theme.breakpoints.down('md'));
81
+ const scRoutingContext = useSCRouting();
82
+ const scUserContext = useSCUser();
83
+ const { scGroup, setSCGroup } = useSCFetchGroup({ id: groupId, group });
84
+ const isGroupAdmin = useMemo(() => { var _a; return scUserContext.user && ((_a = scGroup === null || scGroup === void 0 ? void 0 : scGroup.managed_by) === null || _a === void 0 ? void 0 : _a.id) === scUserContext.user.id; }, [scUserContext.user, (_a = scGroup === null || scGroup === void 0 ? void 0 : scGroup.managed_by) === null || _a === void 0 ? void 0 : _a.id]);
85
+ // HANDLERS
86
+ const handleOpen = (group) => {
87
+ setAnchorEl(group.currentTarget);
88
+ };
89
+ const handleClose = () => {
90
+ setAnchorEl(null);
91
+ };
92
+ const handleEditClick = () => {
93
+ setOpenEdit((o) => !o);
94
+ };
95
+ const handleCloseDialog = () => {
96
+ setOpenConfirmDialog(false);
97
+ setAnchorEl(null);
98
+ };
99
+ const handleEditSuccess = (data) => {
100
+ setSCGroup(data);
101
+ onEditSuccess && onEditSuccess(data);
102
+ };
103
+ /**
104
+ * Handles thread deletion
105
+ */
106
+ function handleDeleteThread() {
107
+ GroupService.deleteGroup(scGroup.id)
108
+ .then(() => {
109
+ onDeleteConfirm();
110
+ handleCloseDialog();
111
+ PubSub.publish(`${SCTopicType.GROUP}.${SCGroupEventType.DELETE}`, scGroup.id);
112
+ })
113
+ .catch((error) => {
114
+ setOpenConfirmDialog(false);
115
+ console.log(error);
116
+ });
117
+ }
118
+ /**
119
+ * Handles actions
120
+ */
121
+ function handleAction(action) {
122
+ if (action === GET_GROUP_LINK) {
123
+ copyTextToClipboard(`${location.protocol}//${location.host}${scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, scGroup)}`).then(() => {
124
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.common.permanentLinkCopied", defaultMessage: "ui.common.permanentLinkCopied" }), {
125
+ variant: 'success',
126
+ autoHideDuration: 3000
127
+ });
128
+ });
129
+ handleClose();
130
+ }
131
+ else if (action === DELETE_GROUP) {
132
+ setOpenConfirmDialog(true);
133
+ handleClose();
134
+ }
135
+ }
136
+ /**
137
+ *
138
+ */
139
+ const renderList = () => {
140
+ return [
141
+ _jsxs(MenuItem, Object.assign({ className: classes.item, onClick: () => handleAction(GET_GROUP_LINK) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "link" }) }), _jsx(FormattedMessage, { id: "ui.groupActionsMenu.item.link", defaultMessage: "ui.groupActionsMenu.item.link" })] }), "link"),
142
+ isGroupAdmin &&
143
+ scGroup.active && [
144
+ _jsx(Divider, {}, "divider"),
145
+ isMobile && (_jsxs(MenuItem, Object.assign({ className: classes.item, onClick: handleEditClick }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "edit" }) }), _jsx(FormattedMessage, { id: "ui.groupActionsMenu.item.edit", defaultMessage: "ui.groupActionsMenu.item.edit" })] }), "edit")),
146
+ _jsxs(MenuItem, Object.assign({ className: classes.item, onClick: () => handleAction(DELETE_GROUP) }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "delete" }) }), _jsx(FormattedMessage, { id: "ui.groupActionsMenu.item.delete", defaultMessage: "ui.groupActionsMenu.item.delete" })] }), "delete")
147
+ ]
148
+ ];
149
+ };
150
+ if (!scGroup) {
151
+ return null;
152
+ }
153
+ return (_jsxs(_Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { onClick: handleOpen }, { children: _jsx(Icon, { children: "more_vert" }) })), isMobile ? (_jsx(SwipeableDrawerRoot, Object.assign({ className: classes.drawerRoot, anchor: "bottom", open: Boolean(anchorEl), onClose: handleClose, onOpen: handleOpen, PaperProps: { className: classes.paper }, disableSwipeToOpen: true }, { children: _jsx(List, { children: renderList() }) }))) : (_jsx(MenuRoot, Object.assign({ className: classes.menuRoot, anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, PaperProps: { className: classes.paper } }, { children: renderList() }))), openConfirmDialog && (_jsx(ConfirmDialog, { open: openConfirmDialog, title: _jsx(FormattedMessage, { id: "ui.groupActionsMenu.dialog.msg", defaultMessage: "ui.groupActionsMenu.dialog.msg" }), btnConfirm: _jsx(FormattedMessage, { id: "ui.groupActionsMenu.dialog.confirm", defaultMessage: "ui.groupActionsMenu.dialog.confirm" }), onConfirm: handleDeleteThread, onClose: handleCloseDialog })), openEdit && _jsx(GroupForm, { onClose: handleEditClick, group: scGroup, onSuccess: handleEditSuccess })] }));
154
+ }
@@ -3,6 +3,7 @@ import { ChangeGroupCoverProps } from '../ChangeGroupCover';
3
3
  import { ChangeGroupPictureProps } from '../ChangeGroupPicture';
4
4
  import { GroupMembersButtonProps } from '../GroupMembersButton';
5
5
  import { GroupSubscribeButtonProps } from '../GroupSubscribeButton';
6
+ import { GroupActionsMenuProps } from '../GroupActionsMenu';
6
7
  export interface GroupHeaderProps {
7
8
  /**
8
9
  * Id of group object
@@ -44,6 +45,11 @@ export interface GroupHeaderProps {
44
45
  * @default {}
45
46
  */
46
47
  GroupMembersButtonProps?: GroupMembersButtonProps;
48
+ /**
49
+ * Props to spread event actions menu
50
+ * @default {}
51
+ */
52
+ GroupActionsProps?: Omit<GroupActionsMenuProps, 'group'>;
47
53
  /**
48
54
  * Any other properties
49
55
  */