@selfcommunity/react-ui 0.11.0-alpha.80 → 0.11.0-alpha.82

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 (34) hide show
  1. package/lib/cjs/components/Composer/Attributes/Attributes.d.ts +1 -1
  2. package/lib/cjs/components/Composer/Attributes/Attributes.js +7 -1
  3. package/lib/cjs/components/Composer/Composer.d.ts +1 -0
  4. package/lib/cjs/components/Composer/Composer.js +49 -25
  5. package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +2 -1
  6. package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +1 -0
  7. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +2 -1
  8. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +27 -8
  9. package/lib/cjs/components/Feed/prefetchedData.js +5 -5
  10. package/lib/cjs/components/FeedObject/FeedObject.js +10 -8
  11. package/lib/cjs/components/UserAutocomplete/UserAutocomplete.d.ts +22 -0
  12. package/lib/cjs/components/UserAutocomplete/UserAutocomplete.js +82 -0
  13. package/lib/cjs/components/UserAutocomplete/index.d.ts +3 -0
  14. package/lib/cjs/components/UserAutocomplete/index.js +5 -0
  15. package/lib/cjs/index.d.ts +2 -1
  16. package/lib/cjs/index.js +4 -2
  17. package/lib/esm/components/Composer/Attributes/Attributes.d.ts +1 -1
  18. package/lib/esm/components/Composer/Attributes/Attributes.js +8 -2
  19. package/lib/esm/components/Composer/Composer.d.ts +1 -0
  20. package/lib/esm/components/Composer/Composer.js +49 -25
  21. package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +2 -1
  22. package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +1 -0
  23. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +2 -1
  24. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +27 -8
  25. package/lib/esm/components/Feed/prefetchedData.js +5 -5
  26. package/lib/esm/components/FeedObject/FeedObject.js +11 -9
  27. package/lib/esm/components/UserAutocomplete/UserAutocomplete.d.ts +22 -0
  28. package/lib/esm/components/UserAutocomplete/UserAutocomplete.js +80 -0
  29. package/lib/esm/components/UserAutocomplete/index.d.ts +3 -0
  30. package/lib/esm/components/UserAutocomplete/index.js +2 -0
  31. package/lib/esm/index.d.ts +2 -1
  32. package/lib/esm/index.js +2 -1
  33. package/lib/umd/react-ui.js +1 -1
  34. package/package.json +6 -6
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = tslib_1.__importStar(require("react"));
6
+ const react_intl_1 = require("react-intl");
7
+ const parse_1 = tslib_1.__importDefault(require("autosuggest-highlight/parse"));
8
+ const match_1 = tslib_1.__importDefault(require("autosuggest-highlight/match"));
9
+ const material_1 = require("@mui/material");
10
+ const react_core_1 = require("@selfcommunity/react-core");
11
+ const system_1 = require("@mui/system");
12
+ const PREFIX = 'SCUserAutocomplete';
13
+ const classes = {
14
+ root: `${PREFIX}-root`,
15
+ autocompleteRoot: `${PREFIX}-autocompleteRoot`,
16
+ info: `${PREFIX}-info`
17
+ };
18
+ const Root = (0, material_1.styled)(material_1.Box, {
19
+ name: PREFIX,
20
+ slot: 'Root',
21
+ overridesResolver: (_props, styles) => styles.root
22
+ })(() => ({}));
23
+ const AutocompleteRoot = (0, material_1.styled)(material_1.Autocomplete, {
24
+ name: PREFIX,
25
+ slot: 'AutocompleteRoot',
26
+ overridesResolver: (_props, styles) => styles.autocompleteRoot
27
+ })(() => ({}));
28
+ const UserAutocomplete = (inProps) => {
29
+ const props = (0, system_1.useThemeProps)({
30
+ props: inProps,
31
+ name: PREFIX
32
+ });
33
+ const { onChange, defaultValue = null, disabled = false, TextFieldProps = {
34
+ variant: 'outlined',
35
+ label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userAutocomplete.label", defaultMessage: "ui.userAutocomplete.label" })
36
+ } } = props, rest = tslib_1.__rest(props, ["onChange", "defaultValue", "disabled", "TextFieldProps"]);
37
+ // State
38
+ const [open, setOpen] = (0, react_1.useState)(false);
39
+ // const [value, setValue] = useState<string | SCUserAutocompleteType | (string | SCUserAutocompleteType)[]>(
40
+ // typeof defaultValue === 'string' ? null : defaultValue
41
+ // );
42
+ const [value, setValue] = (0, react_1.useState)(Array.isArray(defaultValue) ? defaultValue : defaultValue ? [defaultValue] : []);
43
+ const [textAreaValue, setTextAreaValue] = (0, react_1.useState)('');
44
+ // Fetch users
45
+ const { users, isLoading } = (0, react_core_1.useSCFetchUsers)();
46
+ (0, react_1.useEffect)(() => {
47
+ if (value === null) {
48
+ return;
49
+ }
50
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
51
+ setTextAreaValue(value.map((u) => u.username).join('\n'));
52
+ }, [value]);
53
+ // Handlers
54
+ const handleOpen = () => {
55
+ setOpen(true);
56
+ };
57
+ const handleClose = () => {
58
+ setOpen(false);
59
+ };
60
+ const handleChange = (_event, newValue) => {
61
+ setValue(newValue);
62
+ };
63
+ const handleTextAreaChange = (e) => {
64
+ const names = e.target.value
65
+ .split(/\s|,|\n/)
66
+ .map((s) => s.trim())
67
+ .filter(Boolean);
68
+ const matched = users.filter((u) => names.includes(u.username));
69
+ setValue(matched);
70
+ setTextAreaValue(e.target.value);
71
+ };
72
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(AutocompleteRoot, Object.assign({ multiple: true, className: classes.autocompleteRoot, open: open, onOpen: handleOpen, onClose: handleClose, options: users || [], getOptionLabel: (option) => option.username || '', value: value, selectOnFocus: true, clearOnBlur: true, blurOnSelect: true, handleHomeEndKeys: true, clearIcon: null, disabled: disabled || isLoading, noOptionsText: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userAutocomplete.empty", defaultMessage: "ui.userAutocomplete.empty" }), onChange: handleChange, isOptionEqualToValue: (option, val) => val.id === option.id, renderTags: (value, getTagProps) => value.map((option, index) => ((0, jsx_runtime_1.jsx)(material_1.Chip, Object.assign({ avatar: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: option.avatar }), label: option.username }, getTagProps({ index })), option.id))), renderOption: (props, option, { inputValue }) => {
73
+ const matches = (0, match_1.default)(option.username, inputValue);
74
+ const parts = (0, parse_1.default)(option.username, matches);
75
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "li" }, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: option.username, src: option.avatar, sx: { marginRight: 1 } }), (0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: parts.map((part, index) => ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ sx: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) })] })));
76
+ }, renderInput: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'off', endAdornment: ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [isLoading ? (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 }) : null, params.InputProps.endAdornment] })) }) }))) }, rest)), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "primary", className: classes.info }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userAutocomplete.textarea.info", defaultMessage: "ui.userAutocomplete.textarea.info", values: {
77
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
78
+ // @ts-ignore
79
+ icon: (...chunks) => (0, jsx_runtime_1.jsx)(material_1.Icon, { children: chunks })
80
+ } }) })), (0, jsx_runtime_1.jsx)(material_1.TextField, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.userAutocomplete.textarea.label", defaultMessage: "ui.userAutocomplete.textarea.label" }), multiline: true, minRows: 4, fullWidth: true, margin: "normal", value: textAreaValue, onChange: handleTextAreaChange })] })));
81
+ };
82
+ exports.default = UserAutocomplete;
@@ -0,0 +1,3 @@
1
+ import UserAutocomplete, { UserAutocompleteProps } from './UserAutocomplete';
2
+ export default UserAutocomplete;
3
+ export { UserAutocompleteProps };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const UserAutocomplete_1 = tslib_1.__importDefault(require("./UserAutocomplete"));
5
+ exports.default = UserAutocomplete_1.default;
@@ -122,6 +122,7 @@ import SuggestedEventsWidget, { SuggestedEventsWidgetProps, SuggestedEventsWidge
122
122
  import TagAutocomplete, { TagAutocompleteProps } from './components/TagAutocomplete';
123
123
  import ToastNotifications, { ToastNotificationsProps, ToastNotificationsSkeleton } from './components/ToastNotifications';
124
124
  import User, { UserProps, UserSkeleton } from './components/User';
125
+ import UserAutocomplete, { UserAutocompleteProps } from './components/UserAutocomplete';
125
126
  import UserActionIconButton, { UserActionIconButtonProps } from './components/UserActionIconButton';
126
127
  import UserConnectionsRequestsSentWidget, { UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton } from './components/UserConnectionsRequestsSentWidget';
127
128
  import UserConnectionsRequestsWidget, { UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton } from './components/UserConnectionsRequestsWidget';
@@ -233,4 +234,4 @@ import DefaultCoverSelfCommunity from './assets/deafultCover';
233
234
  /**
234
235
  * List all exports
235
236
  */
236
- export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, generateRoomId, randomString, decodePassphrase, encodePassphrase, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, SCCourseEditTabType, Course, CourseProps, CourseSkeleton, CourseSkeletonProps, CourseJoinButton, CourseJoinButtonProps, Courses, CoursesProps, CoursesSkeleton, CoursesSkeletonProps, CourseTypePopover, CourseTypePopoverProps, CreateCourseButton, CreateCourseButtonProps, CourseContentMenu, CourseContentMenuProps, CourseDashboard, TeacherCourseDashboardProps, TeacherSkeleton, StudentCourseDashboardProps, StudentSkeleton, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, EventForm, EventFormProps, EventFormDialog, EventFormDialogProps, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, DefaultDrawerSkeleton, DefaultDrawerSkeletonProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, EditCourse, EditCourseProps, EditCourseSkeleton, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, getUrlLesson, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, AccordionLessons, AccordionLessonsProps, AccordionLessonsSkeleton, AddUsersButton, AddUsersButtonProps, CourseUsersTable, CourseUsersTableProps, CourseUsersTableSkeleton, EmptyStatus, EmptyStatusProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, ScrollContainer, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, LessonAppbar, LessonAppbarProps, LessonDrawer, LessonDrawerProps, LessonEditForm, LessonEditFormProps, LessonObject, LessonObjectProps, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, CourseCompletedDialog, CourseCompletedDialogProps, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, DefaultCoverSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, SCCourseFormStepType, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, TagAutocomplete, TagAutocompleteProps, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserCreatedCoursesWidget, UserCreatedCoursesWidgetProps, UserCreatedCoursesWidgetSkeleton, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, UserLiveStreamWidget, UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton, UserPaymentMethodsPortal, UserPaymentMethodsPortalProps, UserPaymentMethodsPortalSkeleton, useStickyBox, UseStickyBoxProps, LiveStream, LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton, LiveStreamInfoDetails, LiveStreamInfoDetailsProps, UpScalingTierBadge, UpScalingTierProps, CreateLiveStreamDialog, CreateLiveStreamDialogProps, CreateLiveStreamButton, CreateLiveStreamButtonProps, LiveStreamForm, LiveStreamFormProps, LiveStreamRoom, LiveStreamRoomProps, LiveStreamVideoConference, LiveStreamVideoConferenceProps, VirtualScrollerItemProps, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, Widget, WidgetProps, X_SHARE, PROVIDER_ICONS_CONTAINED, PROVIDER_ICONS_OUTLINED, getDefaultLocale, getDefaultPaymentMethodConfiguration, getDefaultAppearanceStyle, getConvertedAmount, PaywallsDialog, PaywallsDialogProps, PaywallsConfigurator, PaywallsConfiguratorProps, PaywallsConfiguratorSkeleton, PaymentProducts, PaymentProductsProps, PaymentProduct, PaymentProductProps, PaymentOrder, PaymentOrderProps, PaymentOrderPdfButton, PaymentOrderPdfButtonProps, PaymentDetailDialog, PaymentDetailDialogProps, PaymentOrders, PaymentOrdersProps, PaymentProductPrice, PaymentProductPriceProps, PdfPreviewDialog, PdfPreviewDialogProps, PdfPreview, PdfPreviewProps, UserPaymentMethods, UserPaymentMethodsProps, UserPaymentMethodsSkeleton, UserAddPaymentMethodForm, UserAddPaymentMethodFormProps, UserAddPaymentMethodDialog, UserAddPaymentMethodDialogProps, UserChangeAddressDialog, UserChangeAddressDialogProps, UserBillingInfo, UserBillingInfoProps, UserBillingInfoSkeleton, Checkout, CheckoutProps, CheckoutReturnDialog, CheckoutReturnDialogProps, HiddenPurchasableContent, CommunityPaywalls, CommunityPaywallsProps, CommunityPaywallsSkeleton };
237
+ export { AcceptRequestUserEventButton, AcceptRequestUserEventButtonProps, AccountChangeMailValidation, AccountChangeMailValidationProps, AccountDataPortability, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDataPortabilityProps, AccountDelete, AccountDeleteButton, AccountDeleteButtonProps, AccountDeleteProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AvatarGroupSkeleton, BaseDialog, BaseDialogProps, BaseItem, BaseItemProps, BaseLightbox, BaseLightboxProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, bytesToSize, generateRoomId, randomString, decodePassphrase, encodePassphrase, Calendar, CalendarProps, Categories, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, Category, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowButton, CategoryFollowButtonProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, CategoryProps, CategorySkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingPeopleWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CentralProgress, ChangeCover, ChangeCoverProps, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, ChangePicture, ChangePictureProps, CommentObject, CommentObjectProps, CommentObjectReply, CommentObjectReplyProps, CommentObjectSkeleton, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, CommentsObject, CommentsObjectProps, CommentsObjectSkeleton, Composer, ComposerIconButton, ComposerIconButtonProps, ComposerProps, ConfirmDialog, ConnectionUserButton, ConsentSolution, ConsentSolutionButton, ConsentSolutionButtonProps, ConsentSolutionProps, ConsentSolutionSkeleton, ContributionUtils, SCCourseEditTabType, Course, CourseProps, CourseSkeleton, CourseSkeletonProps, CourseJoinButton, CourseJoinButtonProps, Courses, CoursesProps, CoursesSkeleton, CoursesSkeletonProps, CourseTypePopover, CourseTypePopoverProps, CreateCourseButton, CreateCourseButtonProps, CourseContentMenu, CourseContentMenuProps, CourseDashboard, TeacherCourseDashboardProps, TeacherSkeleton, StudentCourseDashboardProps, StudentSkeleton, CreateEventButton, CreateEventButtonProps, CreateEventWidget, CreateEventWidgetProps, CreateEventWidgetSkeleton, CreateGroupButton, EventForm, EventFormProps, EventFormDialog, EventFormDialogProps, CreateGroupButtonProps, CustomAdv, CustomAdvProps, CustomAdvSkeleton, DEFAULT_FIELDS, DEFAULT_PAGINATION_LIMIT, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PRELOAD_OFFSET_VIEWPORT, DEFAULT_WIDGETS_NUMBER, DefaultDrawerContent, DefaultDrawerContentProps, DefaultHeaderContent, DefaultHeaderContentProps, DefaultDrawerSkeleton, DefaultDrawerSkeletonProps, EditEventButton, EditEventButtonProps, EditGroupButton, EditGroupButtonProps, EditMediaProps, Editor, EditorProps, EditorSkeleton, EmailTextField, EditCourse, EditCourseProps, EditCourseSkeleton, Event, EventActionsMenu, EventActionsMenuProps, EventHeader, EventHeaderProps, EventHeaderSkeleton, EventInfoDetails, EventInfoDetailsProps, EventInfoWidget, EventInfoWidgetProps, EventInviteButton, EventInviteButtonProps, EventLocationWidget, EventLocationWidgetProps, EventLocationWidgetSkeleton, EventMediaWidget, EventMediaWidgetProps, EventMediaWidgetSkeleton, EventMembersWidget, EventMembersWidgetProps, EventMembersWidgetSkeleton, EventParticipantsButton, EventParticipantsButtonProps, EventProps, Events, EventSkeleton, EventSkeletonProps, EventsProps, EventsSkeleton, EventsSkeletonProps, FACEBOOK_SHARE, Feed, FeedObject, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedObjectProps, FeedObjectSkeleton, FeedProps, FeedRef, FeedSidebarProps, FeedSkeleton, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, File, FollowUserButton, FollowUserButtonProps, Footer, FooterProps, FooterSkeleton, FriendshipButtonProps, FriendshipUserButton, GenericSkeleton, getRelativeTime, getUnseenNotification, getUnseenNotificationCounter, getUrlLesson, Group, GroupActionsMenu, GroupActionsMenuProps, GroupForm, GroupFormProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, GroupInviteButton, GroupInviteButtonProps, GroupInvitedWidget, GroupInvitedWidgetProps, GroupInvitedWidgetSkeleton, GroupMembersButton, GroupMembersButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupProps, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupSettingsIconButton, GroupSettingsIconButtonProps, GroupSkeleton, GroupsProps, GroupsSkeleton, GroupSubscribeButton, GroupSubscribeButtonProps, AccordionLessons, AccordionLessonsProps, AccordionLessonsSkeleton, AddUsersButton, AddUsersButtonProps, CourseUsersTable, CourseUsersTableProps, CourseUsersTableSkeleton, EmptyStatus, EmptyStatusProps, HiddenPlaceholder, Incubator, IncubatorDetail, IncubatorDetailProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorProps, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, InfiniteScroll, ScrollContainer, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, InviteUserEventButton, LessonAppbar, LessonAppbarProps, LessonDrawer, LessonDrawerProps, LessonEditForm, LessonEditFormProps, LessonObject, LessonObjectProps, InviteUserEventButtonProps, LanguageSwitcher, LEGAL_POLICIES, CourseCompletedDialog, CourseCompletedDialogProps, Lightbox, LightboxProps, Link, LINKEDIN_SHARE, LocationAutocomplete, LocationAutocompleteProps, LogoSelfCommunity, DefaultCoverSelfCommunity, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, MAX_PRELOAD_OFFSET_VIEWPORT, MEDIA_EMBED_SC_LINK_TYPE, MEDIA_EMBED_SC_SHARED_EVENT, MEDIA_EMBED_SC_SHARED_OBJECT, MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_EMBED, MEDIA_TYPE_EVENT, MEDIA_TYPE_IMAGE, MEDIA_TYPE_LINK, MEDIA_TYPE_SHARE, MEDIA_TYPE_URL, MEDIA_TYPE_VIDEO, SCCourseFormStepType, MediaChunkUploader, MediaChunkUploaderProps, MessageUploaderUtils, MetadataField, MetadataFieldProps, MIN_PRELOAD_OFFSET_VIEWPORT, MyEventsWidget, MyEventsWidgetProps, MyEventsWidgetSkeleton, NavigationMenuContent, NavigationMenuDrawer, NavigationMenuDrawerProps, NavigationMenuHeader, NavigationMenuIconButton, NavigationMenuIconButtonProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbar, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbarProps, NavigationToolbarSkeleton, Notification, NotificationProps, NotificationSkeleton, OnBoardingWidget, OnBoardingWidgetProps, OnBoardingWidgetSkeleton, PasswordTextField, PhoneTextField, PlatformWidget, PlatformWidgetActionType, PlatformWidgetProps, PlatformWidgetSkeleton, PollSuggestionWidget, PollSuggestionWidgetProps, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageThread, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, ProgressBar, ProgressBarProps, RelatedEventsWidget, RelatedEventsWidgetProps, RelatedEventsWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectsWidgetSkeleton, RelatedFeedObjectWidgetProps, ReplyComment, SCBroadcastMessageTemplateType, SCCommentsOrderBy, SCEventMembersEventType, SCEventTemplateType, SCFeedObjectActivitiesType, SCFeedObjectTemplateType, SCFeedWidgetType, SCGroupMembersEventType, SCMediaChunkType, SCMediaObjectType, SCNotificationObjectTemplateType, SCUserProfileFields, SCUserProfileSettings, SCUserSocialAssociations, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Share, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, StickyBox, StickyBoxComponent, StickyBoxProps, SuggestedEventsWidget, TagAutocomplete, TagAutocompleteProps, SuggestedEventsWidgetProps, SuggestedEventsWidgetSkeleton, TagChip, TagChipProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, UrlTextField, User, UserActionIconButton, UserActionIconButtonProps, UserAvatar, UserAvatarProps, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserCounters, UserCountersProps, UserCreatedCoursesWidget, UserCreatedCoursesWidgetProps, UserCreatedCoursesWidgetSkeleton, UserDeletedSnackBar, UserDeletedSnackBarProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserInfo, UserInfoDialog, UserInfoDialogProps, UserInfoProps, UserInfoSkeleton, UsernameTextField, UserProfileBlocked, UserProfileBlockedProps, UserProfileEdit, UserProfileEditProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSkeleton, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserAutocomplete, UserAutocompleteProps, UserProps, UserSkeleton, UserSocialAssociation, UserSocialAssociationProps, UserSubscribedGroupsWidget, UserSubscribedGroupsWidgetProps, UserSubscribedGroupsWidgetSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, UserLiveStreamWidget, UserLiveStreamWidgetProps, UserLiveStreamWidgetSkeleton, UserPaymentMethodsPortal, UserPaymentMethodsPortalProps, UserPaymentMethodsPortalSkeleton, useStickyBox, UseStickyBoxProps, LiveStream, LiveStreamProps, LiveStreamSkeletonProps, LiveStreamSkeleton, LiveStreamInfoDetails, LiveStreamInfoDetailsProps, UpScalingTierBadge, UpScalingTierProps, CreateLiveStreamDialog, CreateLiveStreamDialogProps, CreateLiveStreamButton, CreateLiveStreamButtonProps, LiveStreamForm, LiveStreamFormProps, LiveStreamRoom, LiveStreamRoomProps, LiveStreamVideoConference, LiveStreamVideoConferenceProps, VirtualScrollerItemProps, SCCourseTemplateType, SCLessonActionsType, SCLessonModeType, Widget, WidgetProps, X_SHARE, PROVIDER_ICONS_CONTAINED, PROVIDER_ICONS_OUTLINED, getDefaultLocale, getDefaultPaymentMethodConfiguration, getDefaultAppearanceStyle, getConvertedAmount, PaywallsDialog, PaywallsDialogProps, PaywallsConfigurator, PaywallsConfiguratorProps, PaywallsConfiguratorSkeleton, PaymentProducts, PaymentProductsProps, PaymentProduct, PaymentProductProps, PaymentOrder, PaymentOrderProps, PaymentOrderPdfButton, PaymentOrderPdfButtonProps, PaymentDetailDialog, PaymentDetailDialogProps, PaymentOrders, PaymentOrdersProps, PaymentProductPrice, PaymentProductPriceProps, PdfPreviewDialog, PdfPreviewDialogProps, PdfPreview, PdfPreviewProps, UserPaymentMethods, UserPaymentMethodsProps, UserPaymentMethodsSkeleton, UserAddPaymentMethodForm, UserAddPaymentMethodFormProps, UserAddPaymentMethodDialog, UserAddPaymentMethodDialogProps, UserChangeAddressDialog, UserChangeAddressDialogProps, UserBillingInfo, UserBillingInfoProps, UserBillingInfoSkeleton, Checkout, CheckoutProps, CheckoutReturnDialog, CheckoutReturnDialogProps, HiddenPurchasableContent, CommunityPaywalls, CommunityPaywallsProps, CommunityPaywallsSkeleton };
package/lib/cjs/index.js CHANGED
@@ -5,8 +5,8 @@ exports.EventInfoDetails = exports.EventHeaderSkeleton = exports.EventHeader = e
5
5
  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.getUrlLesson = exports.getUnseenNotificationCounter = exports.getUnseenNotification = exports.getRelativeTime = exports.GenericSkeleton = exports.FriendshipUserButton = 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.EventMediaWidgetSkeleton = exports.EventMediaWidget = exports.EventLocationWidgetSkeleton = exports.EventLocationWidget = exports.EventInviteButton = exports.EventInfoWidget = void 0;
6
6
  exports.MyEventsWidget = exports.MIN_PRELOAD_OFFSET_VIEWPORT = exports.MetadataField = exports.MessageUploaderUtils = exports.MediaChunkUploader = exports.SCCourseFormStepType = 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 = 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.DefaultCoverSelfCommunity = exports.LogoSelfCommunity = exports.LocationAutocomplete = exports.LINKEDIN_SHARE = exports.Link = exports.Lightbox = exports.CourseCompletedDialog = exports.LEGAL_POLICIES = exports.LanguageSwitcher = exports.LessonObject = exports.LessonEditForm = exports.LessonDrawer = exports.LessonAppbar = exports.InviteUserEventButton = exports.InlineComposerWidgetSkeleton = exports.InlineComposerWidget = exports.ScrollContainer = exports.InfiniteScroll = exports.IncubatorSuggestionWidget = exports.IncubatorSubscribeButton = exports.IncubatorListWidget = exports.IncubatorDetail = exports.Incubator = exports.HiddenPlaceholder = exports.EmptyStatus = exports.CourseUsersTableSkeleton = exports.CourseUsersTable = exports.AddUsersButton = exports.AccordionLessonsSkeleton = exports.AccordionLessons = void 0;
7
7
  exports.Share = exports.SearchDialog = exports.SearchAutocomplete = exports.SCUserSocialAssociations = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectTemplateType = exports.SCFeedObjectActivitiesType = exports.SCEventTemplateType = 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.NavigationMenuDrawer = exports.NavigationMenuContent = exports.MyEventsWidgetSkeleton = void 0;
8
- exports.UserPaymentMethodsPortal = exports.UserLiveStreamWidgetSkeleton = exports.UserLiveStreamWidget = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = 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.UserCreatedCoursesWidgetSkeleton = exports.UserCreatedCoursesWidget = 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.TagAutocomplete = exports.SuggestedEventsWidget = exports.StickyBox = exports.SnippetNotificationsSkeleton = exports.SnippetNotifications = void 0;
9
- exports.CommunityPaywallsSkeleton = exports.CommunityPaywalls = exports.HiddenPurchasableContent = exports.CheckoutReturnDialog = exports.Checkout = exports.UserBillingInfoSkeleton = exports.UserBillingInfo = exports.UserChangeAddressDialog = exports.UserAddPaymentMethodDialog = exports.UserAddPaymentMethodForm = exports.UserPaymentMethodsSkeleton = exports.UserPaymentMethods = exports.PdfPreview = exports.PdfPreviewDialog = exports.PaymentProductPrice = exports.PaymentOrders = exports.PaymentDetailDialog = exports.PaymentOrderPdfButton = exports.PaymentOrder = exports.PaymentProduct = exports.PaymentProducts = exports.PaywallsConfiguratorSkeleton = exports.PaywallsConfigurator = exports.PaywallsDialog = exports.getConvertedAmount = exports.getDefaultAppearanceStyle = exports.getDefaultPaymentMethodConfiguration = exports.getDefaultLocale = exports.PROVIDER_ICONS_OUTLINED = exports.PROVIDER_ICONS_CONTAINED = exports.X_SHARE = exports.Widget = exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = exports.LiveStreamVideoConference = exports.LiveStreamRoom = exports.LiveStreamForm = exports.CreateLiveStreamButton = exports.CreateLiveStreamDialog = exports.UpScalingTierBadge = exports.LiveStreamInfoDetails = exports.LiveStreamSkeleton = exports.LiveStream = exports.useStickyBox = exports.UserPaymentMethodsPortalSkeleton = void 0;
8
+ exports.UserLiveStreamWidgetSkeleton = exports.UserLiveStreamWidget = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = exports.UserSubscribedGroupsWidgetSkeleton = exports.UserSubscribedGroupsWidget = exports.UserSocialAssociation = exports.UserSkeleton = exports.UserAutocomplete = 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.UserCreatedCoursesWidgetSkeleton = exports.UserCreatedCoursesWidget = 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.TagAutocomplete = exports.SuggestedEventsWidget = exports.StickyBox = exports.SnippetNotificationsSkeleton = exports.SnippetNotifications = void 0;
9
+ exports.CommunityPaywallsSkeleton = exports.CommunityPaywalls = exports.HiddenPurchasableContent = exports.CheckoutReturnDialog = exports.Checkout = exports.UserBillingInfoSkeleton = exports.UserBillingInfo = exports.UserChangeAddressDialog = exports.UserAddPaymentMethodDialog = exports.UserAddPaymentMethodForm = exports.UserPaymentMethodsSkeleton = exports.UserPaymentMethods = exports.PdfPreview = exports.PdfPreviewDialog = exports.PaymentProductPrice = exports.PaymentOrders = exports.PaymentDetailDialog = exports.PaymentOrderPdfButton = exports.PaymentOrder = exports.PaymentProduct = exports.PaymentProducts = exports.PaywallsConfiguratorSkeleton = exports.PaywallsConfigurator = exports.PaywallsDialog = exports.getConvertedAmount = exports.getDefaultAppearanceStyle = exports.getDefaultPaymentMethodConfiguration = exports.getDefaultLocale = exports.PROVIDER_ICONS_OUTLINED = exports.PROVIDER_ICONS_CONTAINED = exports.X_SHARE = exports.Widget = exports.SCLessonModeType = exports.SCLessonActionsType = exports.SCCourseTemplateType = exports.LiveStreamVideoConference = exports.LiveStreamRoom = exports.LiveStreamForm = exports.CreateLiveStreamButton = exports.CreateLiveStreamDialog = exports.UpScalingTierBadge = exports.LiveStreamInfoDetails = exports.LiveStreamSkeleton = exports.LiveStream = exports.useStickyBox = exports.UserPaymentMethodsPortalSkeleton = exports.UserPaymentMethodsPortal = void 0;
10
10
  const tslib_1 = require("tslib");
11
11
  /**
12
12
  * Components
@@ -315,6 +315,8 @@ Object.defineProperty(exports, "ToastNotificationsSkeleton", { enumerable: true,
315
315
  const User_1 = tslib_1.__importStar(require("./components/User"));
316
316
  exports.User = User_1.default;
317
317
  Object.defineProperty(exports, "UserSkeleton", { enumerable: true, get: function () { return User_1.UserSkeleton; } });
318
+ const UserAutocomplete_1 = tslib_1.__importDefault(require("./components/UserAutocomplete"));
319
+ exports.UserAutocomplete = UserAutocomplete_1.default;
318
320
  const UserActionIconButton_1 = tslib_1.__importDefault(require("./components/UserActionIconButton"));
319
321
  exports.UserActionIconButton = UserActionIconButton_1.default;
320
322
  const UserConnectionsRequestsSentWidget_1 = tslib_1.__importStar(require("./components/UserConnectionsRequestsSentWidget"));
@@ -16,7 +16,7 @@ export interface AttributesProps extends Omit<BoxProps, 'value' | 'onChange' | '
16
16
  * @param value
17
17
  * @default empty object
18
18
  */
19
- onClick?: (attribute: 'categories' | 'event' | 'group' | 'addressing' | 'location') => void;
19
+ onClick?: (attribute: 'categories' | 'event' | 'group' | 'addressing' | 'location' | 'recipients') => void;
20
20
  }
21
21
  declare const _default: (props: AttributesProps) => JSX.Element;
22
22
  export default _default;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback } from 'react';
3
3
  import { Box, Chip, styled, Icon } from '@mui/material';
4
4
  import classNames from 'classnames';
@@ -46,7 +46,13 @@ export default (props) => {
46
46
  const handleClickLocation = useCallback(() => {
47
47
  onClick && onClick('location');
48
48
  }, [onClick]);
49
+ const handleDeleteRecipient = useCallback((id) => () => {
50
+ onChange && onChange(Object.assign(Object.assign({}, value), { recipients: value.recipients.filter((r) => r.id !== id) }));
51
+ }, [value, onChange]);
52
+ const handleClickRecipient = useCallback(() => {
53
+ onClick && onClick('recipients');
54
+ }, [onClick]);
49
55
  return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [((_a = value === null || value === void 0 ? void 0 : value.categories) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
50
56
  (value === null || value === void 0 ? void 0 : value.categories.map((c) => (_jsx(Chip, { label: c.name, onDelete: handleDeleteCategory(c.id), icon: _jsx(Icon, { children: "category" }), onClick: handleClickCategory }, c.id)))), (value === null || value === void 0 ? void 0 : value.group) && (_jsx(Chip, { label: value === null || value === void 0 ? void 0 : value.group.name, onDelete: handleDeleteGroup, icon: _jsx(Icon, { children: "groups" }), onClick: handleClickGroup, disabled: !((_b = value === null || value === void 0 ? void 0 : value.group) === null || _b === void 0 ? void 0 : _b.subscription_status) }, value === null || value === void 0 ? void 0 : value.group.id)), (value === null || value === void 0 ? void 0 : value.event) && (_jsx(Chip, { label: value === null || value === void 0 ? void 0 : value.event.name, onDelete: handleDeleteEvent, icon: _jsx(Icon, { children: "CalendarIcon" }), onClick: handleClickEvent, disabled: !((_c = value === null || value === void 0 ? void 0 : value.event) === null || _c === void 0 ? void 0 : _c.subscription_status) }, value === null || value === void 0 ? void 0 : value.event.id)), ((_d = value === null || value === void 0 ? void 0 : value.addressing) === null || _d === void 0 ? void 0 : _d.length) > 0 &&
51
- (value === null || value === void 0 ? void 0 : value.addressing.map((t) => (_jsx(TagChip, { tag: t, onDelete: handleDeleteTag(t.id), icon: _jsx(Icon, { children: "label" }), onClick: handleClickTag }, t.id)))), (value === null || value === void 0 ? void 0 : value.location) && (_jsx(Chip, { icon: _jsx(Icon, { children: "add_location_alt" }), label: value === null || value === void 0 ? void 0 : value.location.location, onDelete: handleDeleteLocation, onClick: handleClickLocation }))] })));
57
+ (value === null || value === void 0 ? void 0 : value.addressing.map((t) => (_jsx(TagChip, { tag: t, onDelete: handleDeleteTag(t.id), icon: _jsx(Icon, { children: "label" }), onClick: handleClickTag }, t.id)))), _jsx(_Fragment, { children: (value === null || value === void 0 ? void 0 : value.recipients.length) > 0 && (_jsxs(_Fragment, { children: [value.recipients.slice(0, 3).map((r) => (_jsx(Chip, { label: r.username, icon: _jsx(Icon, { children: "people_alt" }), onClick: handleClickRecipient, onDelete: handleDeleteRecipient(r.id) }, r.id))), value.recipients.length > 3 && _jsx(Chip, { label: `+${value.recipients.length - 3}` })] })) }), (value === null || value === void 0 ? void 0 : value.location) && (_jsx(Chip, { icon: _jsx(Icon, { children: "add_location_alt" }), label: value === null || value === void 0 ? void 0 : value.location.location, onDelete: handleDeleteLocation, onClick: handleClickLocation }))] })));
52
58
  };
@@ -31,6 +31,7 @@ export interface ComposerProps extends Omit<DialogProps, 'defaultValue' | 'scrol
31
31
  group?: SCGroupType;
32
32
  audience?: string;
33
33
  addressing?: SCTagType[];
34
+ recipients?: any;
34
35
  medias?: SCMediaType[];
35
36
  poll?: SCPollType;
36
37
  location?: string;
@@ -67,6 +67,7 @@ const COMPOSER_INITIAL_STATE = {
67
67
  groupsError: null,
68
68
  addressing: null,
69
69
  addressingError: null,
70
+ recipients: [],
70
71
  medias: [],
71
72
  poll: null,
72
73
  location: null,
@@ -145,7 +146,7 @@ export default function Composer(inProps) {
145
146
  const [isSubmitting, setIsSubmitting] = useState(false);
146
147
  const [layer, setLayer] = useState();
147
148
  const [state, dispatch] = useReducer(reducer, Object.assign(Object.assign(Object.assign({}, COMPOSER_INITIAL_STATE), defaultValue), { key: random() }));
148
- const { key, id, type, title, titleError, html, categories, categoriesError, event, group, addressing, addressingError, audience, medias, poll, pollError, location, scheduled_at, error } = state;
149
+ const { key, id, type, title, titleError, html, categories, categoriesError, event, group, addressing, addressingError, recipients, audience, medias, poll, pollError, location, scheduled_at, error } = state;
149
150
  //MEMO
150
151
  const scheduledPostsEnabled = useMemo(() => preferences &&
151
152
  SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED in preferences &&
@@ -178,6 +179,7 @@ export default function Composer(inProps) {
178
179
  event: _feedObject.event,
179
180
  group: _feedObject.group,
180
181
  addressing: _feedObject.addressing,
182
+ recipients: _feedObject.recipients,
181
183
  medias: _feedObject.medias,
182
184
  poll: _feedObject.poll,
183
185
  location: _feedObject.location,
@@ -210,9 +212,9 @@ export default function Composer(inProps) {
210
212
  ((type === SCContributionType.DISCUSSION && title.length > 0 && title.length < COMPOSER_TITLE_MAX_LENGTH) ||
211
213
  (type === SCContributionType.POST && (stripHtml(html).length > 0 || medias.length > 0 || hasPoll)) ||
212
214
  (type === COMPOSER_TYPE_POLL && hasPoll)) &&
213
- (!addressingRequiredEnabled || (addressing && addressing.length > 0)) &&
215
+ (!addressingRequiredEnabled || (addressing && addressing.length > 0) || (recipients && recipients.length > 0)) &&
214
216
  (!categoryRequiredEnabled || (categories && categories.length > 0)));
215
- }, [isLoading, type, title, html, medias, hasPoll, addressing, addressingRequiredEnabled, categories, categoryRequiredEnabled]);
217
+ }, [isLoading, type, title, html, medias, hasPoll, addressing, recipients, addressingRequiredEnabled, categories, categoryRequiredEnabled]);
216
218
  const isIOS = useMemo(() => iOS(), []);
217
219
  // Load feed object
218
220
  useEffect(() => {
@@ -320,19 +322,22 @@ export default function Composer(inProps) {
320
322
  type: 'multiple',
321
323
  value: Object.assign(Object.assign({}, content), { pollError: content.poll.title.length > COMPOSER_TITLE_MAX_LENGTH
322
324
  ? { titleError: _jsx(FormattedMessage, { id: "ui.composer.title.error.maxlength", defaultMessage: "ui.composer.title.error.maxlength" }) }
323
- : null, addressingError: addressingRequiredEnabled && (!content.addressing || content.addressing.length === 0) ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null })
325
+ : null, addressingError: addressingRequiredEnabled &&
326
+ (!content.addressing || content.addressing.length === 0 || !content.recipients || content.recipients.length === 0) ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null })
324
327
  });
325
328
  }, []);
326
329
  const handleChangeDiscussion = useCallback((content) => {
327
330
  dispatch({
328
331
  type: 'multiple',
329
- value: Object.assign(Object.assign({}, content), { titleError: content.title.length > COMPOSER_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.composer.title.error.maxlength", defaultMessage: "ui.composer.title.error.maxlength" })) : null, addressingError: addressingRequiredEnabled && (!content.addressing || content.addressing.length === 0) ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null, categoriesError: categoryRequiredEnabled && content.categories.length === 0 ? (_jsx(FormattedMessage, { id: "ui.composer.categories.error.missing", defaultMessage: "ui.composer.categories.error.missing" })) : null })
332
+ value: Object.assign(Object.assign({}, content), { titleError: content.title.length > COMPOSER_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.composer.title.error.maxlength", defaultMessage: "ui.composer.title.error.maxlength" })) : null, addressingError: addressingRequiredEnabled &&
333
+ (!content.addressing || content.addressing.length === 0 || !content.recipients || content.recipients.length === 0) ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null, categoriesError: categoryRequiredEnabled && content.categories.length === 0 ? (_jsx(FormattedMessage, { id: "ui.composer.categories.error.missing", defaultMessage: "ui.composer.categories.error.missing" })) : null })
330
334
  });
331
335
  }, []);
332
336
  const handleChangePost = useCallback((content) => {
333
337
  dispatch({
334
338
  type: 'multiple',
335
- value: Object.assign(Object.assign({}, content), { addressingError: addressingRequiredEnabled && (!content.addressing || content.addressing.length === 0) ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null, categoriesError: categoryRequiredEnabled && content.categories.length === 0 ? (_jsx(FormattedMessage, { id: "ui.composer.categories.error.missing", defaultMessage: "ui.composer.categories.error.missing" })) : null })
339
+ value: Object.assign(Object.assign({}, content), { addressingError: addressingRequiredEnabled &&
340
+ (!content.addressing || content.addressing.length === 0 || !content.recipients || content.recipients.length === 0) ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null, categoriesError: categoryRequiredEnabled && content.categories.length === 0 ? (_jsx(FormattedMessage, { id: "ui.composer.categories.error.missing", defaultMessage: "ui.composer.categories.error.missing" })) : null })
336
341
  });
337
342
  }, []);
338
343
  const handleChangeCategories = useCallback((value) => {
@@ -361,6 +366,15 @@ export default function Composer(inProps) {
361
366
  else if (event || (value && Object.prototype.hasOwnProperty.call(value, 'recurring'))) {
362
367
  dispatch({ type: 'event', value });
363
368
  }
369
+ else if ((recipients === null || recipients === void 0 ? void 0 : recipients.length) !== 0 || (value && Array.isArray(value) && value.some((obj) => !('color' in obj)))) {
370
+ dispatch({
371
+ type: 'multiple',
372
+ value: {
373
+ recipients: value,
374
+ addressingError: addressingRequiredEnabled && !value ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null
375
+ }
376
+ });
377
+ }
364
378
  else {
365
379
  dispatch({
366
380
  type: 'multiple',
@@ -371,20 +385,24 @@ export default function Composer(inProps) {
371
385
  });
372
386
  }
373
387
  setLayer(null);
374
- }, [group]);
375
- const handleAddAudienceLayer = useCallback(() => handleAddLayer({
376
- name: 'audience',
377
- Component: AudienceLayer,
378
- ComponentProps: {
379
- onClose: handleRemoveLayer,
380
- onSave: handleChangeAudience,
381
- defaultValue: group || (addressing && Object.prototype.hasOwnProperty.call(addressing, 'emotional_image_position'))
382
- ? group
383
- : event || (addressing && Object.prototype.hasOwnProperty.call(addressing, 'recurring'))
384
- ? event
385
- : addressing
386
- }
387
- }), [handleAddLayer, handleRemoveLayer, handleChangeAudience, addressing, event, group]);
388
+ }, [group, event, recipients]);
389
+ const handleAddAudienceLayer = useCallback(() => {
390
+ handleAddLayer({
391
+ name: 'audience',
392
+ Component: AudienceLayer,
393
+ ComponentProps: {
394
+ onClose: handleRemoveLayer,
395
+ onSave: handleChangeAudience,
396
+ defaultValue: group || (addressing && Object.prototype.hasOwnProperty.call(addressing, 'emotional_image_position'))
397
+ ? group
398
+ : event || (addressing && Object.prototype.hasOwnProperty.call(addressing, 'recurring'))
399
+ ? event
400
+ : (recipients === null || recipients === void 0 ? void 0 : recipients.length) && !recipients.some((r) => 'color' in r)
401
+ ? recipients
402
+ : addressing
403
+ }
404
+ });
405
+ }, [handleAddLayer, handleRemoveLayer, handleChangeAudience, addressing, event, group, recipients]);
388
406
  const handleChangeLocation = useCallback((value) => {
389
407
  dispatch({ type: 'location', value });
390
408
  setLayer(null);
@@ -444,7 +462,8 @@ export default function Composer(inProps) {
444
462
  const handleChangeAttributes = useCallback((content) => {
445
463
  dispatch({
446
464
  type: 'multiple',
447
- value: Object.assign(Object.assign({}, content), { addressingError: addressingRequiredEnabled && (!content.addressing || content.addressing.length === 0) ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null, categoriesError: categoryRequiredEnabled && content.categories.length === 0 ? (_jsx(FormattedMessage, { id: "ui.composer.categories.error.missing", defaultMessage: "ui.composer.categories.error.missing" })) : null })
465
+ value: Object.assign(Object.assign({}, content), { addressingError: addressingRequiredEnabled &&
466
+ (!content.addressing || content.addressing.length === 0 || !content.recipients || content.recipients.length === 0) ? (_jsx(FormattedMessage, { id: "ui.composer.addressing.error.missing", defaultMessage: "ui.composer.addressing.error.missing" })) : null, categoriesError: categoryRequiredEnabled && content.categories.length === 0 ? (_jsx(FormattedMessage, { id: "ui.composer.categories.error.missing", defaultMessage: "ui.composer.categories.error.missing" })) : null })
448
467
  });
449
468
  }, []);
450
469
  const handleClickAttributes = useCallback((attr) => {
@@ -497,6 +516,9 @@ export default function Composer(inProps) {
497
516
  if (features.includes(SCFeatureName.TAGGING) && addressing !== null) {
498
517
  data.addressing = addressing.map((t) => t.id);
499
518
  }
519
+ if (features.includes(SCFeatureName.TAGGING) && recipients !== null) {
520
+ data.recipients = recipients.map((r) => r.username);
521
+ }
500
522
  if (features.includes(SCFeatureName.TAGGING) &&
501
523
  features.includes(SCFeatureName.GROUPING) &&
502
524
  preferences[SCPreferences.CONFIGURATIONS_GROUPS_ENABLED].value &&
@@ -553,6 +575,7 @@ export default function Composer(inProps) {
553
575
  event,
554
576
  group,
555
577
  addressing,
578
+ recipients,
556
579
  audience,
557
580
  medias,
558
581
  poll,
@@ -624,11 +647,11 @@ export default function Composer(inProps) {
624
647
  }
625
648
  switch (type) {
626
649
  case COMPOSER_TYPE_POLL:
627
- return (_jsx(ContentPoll, { onChange: handleChangePoll, value: { html, event, group, addressing, medias, poll, location, scheduled_at }, error: { pollError, categoriesError, addressingError }, disabled: isSubmitting }, key));
650
+ return (_jsx(ContentPoll, { onChange: handleChangePoll, value: { html, event, group, addressing, recipients, medias, poll, location, scheduled_at }, error: { pollError, categoriesError, addressingError }, disabled: isSubmitting }, key));
628
651
  case SCContributionType.DISCUSSION:
629
- return (_jsx(ContentDiscussion, { value: { title, html, categories, event, group, addressing, medias, poll, location, scheduled_at }, error: { titleError, categoriesError, addressingError, error }, onChange: handleChangeDiscussion, disabled: isSubmitting, isContentSwitchButtonVisible: !canSubmit && !editMode, EditorProps: Object.assign({ toolbar: true, uploadImage: true }, EditorProps) }, key));
652
+ return (_jsx(ContentDiscussion, { value: { title, html, categories, event, group, addressing, recipients, medias, poll, location, scheduled_at }, error: { titleError, categoriesError, addressingError, error }, onChange: handleChangeDiscussion, disabled: isSubmitting, isContentSwitchButtonVisible: !canSubmit && !editMode, EditorProps: Object.assign({ toolbar: true, uploadImage: true }, EditorProps) }, key));
630
653
  default:
631
- return (_jsx(ContentPost, { value: { html, categories, event, group, addressing, medias, poll, location, scheduled_at }, error: { error, categoriesError, addressingError }, onChange: handleChangePost, disabled: isSubmitting, EditorProps: Object.assign({ toolbar: false, uploadImage: false }, EditorProps) }, key));
654
+ return (_jsx(ContentPost, { value: { html, categories, event, group, addressing, recipients, medias, poll, location, scheduled_at }, error: { error, categoriesError, addressingError }, onChange: handleChangePost, disabled: isSubmitting, EditorProps: Object.assign({ toolbar: false, uploadImage: false }, EditorProps) }, key));
632
655
  }
633
656
  }, [
634
657
  key,
@@ -639,6 +662,7 @@ export default function Composer(inProps) {
639
662
  event,
640
663
  group,
641
664
  addressing,
665
+ recipients,
642
666
  medias,
643
667
  poll,
644
668
  pollError,
@@ -654,7 +678,7 @@ export default function Composer(inProps) {
654
678
  if (!scUserContext.user && !(scUserContext.loading && open)) {
655
679
  return null;
656
680
  }
657
- return (_jsxs(Root, Object.assign({ ref: dialogRef, TransitionComponent: DialogTransition, slots: { backdrop: BackdropScrollDisabled }, onClose: handleClose }, rest, { disableEscapeKeyDown: true, className: classNames(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [_jsxs("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: handleClosePrompt }, { children: _jsx(Icon, { children: "close" }) })), _jsx(LoadingButton, Object.assign({ size: "small", type: "submit", color: "secondary", variant: "contained", disabled: !canSubmit, loading: isSubmitting }, { children: scheduledPostsEnabled && !scheduled_at ? (_jsx(FormattedMessage, { id: "ui.composer.submit.now", defaultMessage: "ui.composer.submit.now" })) : (_jsx(FormattedMessage, { id: "ui.composer.submit", defaultMessage: "ui.composer.submit" })) }))] })), _jsxs(DialogContent, Object.assign({ className: classes.content }, { children: [_jsx(Attributes, { value: { categories, event, group, addressing, location }, className: classes.attributes, onChange: handleChangeAttributes, onClick: handleClickAttributes }), content, medias && medias.length > 0 && (_jsx(Box, Object.assign({ className: classes.medias }, { children: mediaObjectTypes.map((mediaObjectType) => {
681
+ return (_jsxs(Root, Object.assign({ ref: dialogRef, TransitionComponent: DialogTransition, slots: { backdrop: BackdropScrollDisabled }, onClose: handleClose }, rest, { disableEscapeKeyDown: true, className: classNames(classes.root, { [classes.ios]: isIOS }), scroll: "body", fullScreen: fullScreen, tabIndex: -1 }, { children: [_jsxs("form", Object.assign({ onSubmit: handleSubmit, method: "post" }, { children: [_jsxs(DialogTitle, Object.assign({ className: classes.title }, { children: [_jsx(IconButton, Object.assign({ onClick: handleClosePrompt }, { children: _jsx(Icon, { children: "close" }) })), _jsx(LoadingButton, Object.assign({ size: "small", type: "submit", color: "secondary", variant: "contained", disabled: !canSubmit, loading: isSubmitting }, { children: scheduledPostsEnabled && !scheduled_at ? (_jsx(FormattedMessage, { id: "ui.composer.submit.now", defaultMessage: "ui.composer.submit.now" })) : (_jsx(FormattedMessage, { id: "ui.composer.submit", defaultMessage: "ui.composer.submit" })) }))] })), _jsxs(DialogContent, Object.assign({ className: classes.content }, { children: [_jsx(Attributes, { value: { categories, event, group, addressing, recipients, location }, className: classes.attributes, onChange: handleChangeAttributes, onClick: handleClickAttributes }), content, medias && medias.length > 0 && (_jsx(Box, Object.assign({ className: classes.medias }, { children: mediaObjectTypes.map((mediaObjectType) => {
658
682
  if (mediaObjectType.previewComponent) {
659
683
  return _jsx(mediaObjectType.previewComponent, { value: medias, onChange: handleChangeMedias }, mediaObjectType.name);
660
684
  }
@@ -29,7 +29,8 @@ const DEFAULT_DISCUSSION = {
29
29
  event: null,
30
30
  medias: [],
31
31
  html: '',
32
- addressing: []
32
+ addressing: [],
33
+ recipients: []
33
34
  };
34
35
  export default (props) => {
35
36
  // PROPS
@@ -23,6 +23,7 @@ const DEFAULT_POST = {
23
23
  medias: [],
24
24
  html: '',
25
25
  addressing: [],
26
+ recipients: [],
26
27
  event: null,
27
28
  group: null
28
29
  };
@@ -7,7 +7,8 @@ export declare enum AudienceTypes {
7
7
  AUDIENCE_ALL = "all",
8
8
  AUDIENCE_TAG = "tag",
9
9
  AUDIENCE_GROUP = "group",
10
- AUDIENCE_EVENT = "event"
10
+ AUDIENCE_EVENT = "event",
11
+ AUDIENCE_USERS = "users"
11
12
  }
12
13
  export interface AudienceLayerProps extends Omit<BoxProps, 'defaultValue'>, ComposerLayerProps {
13
14
  defaultValue: SCTagType[] | SCGroupType | any;
@@ -12,12 +12,14 @@ import { PREFIX } from '../../constants';
12
12
  import GroupAutocomplete from '../../../GroupAutocomplete';
13
13
  import { SCFeatureName } from '@selfcommunity/types';
14
14
  import EventAutocomplete from '../../../EventAutocomplete';
15
+ import UserAutocomplete from '../../../UserAutocomplete';
15
16
  export var AudienceTypes;
16
17
  (function (AudienceTypes) {
17
18
  AudienceTypes["AUDIENCE_ALL"] = "all";
18
19
  AudienceTypes["AUDIENCE_TAG"] = "tag";
19
20
  AudienceTypes["AUDIENCE_GROUP"] = "group";
20
21
  AudienceTypes["AUDIENCE_EVENT"] = "event";
22
+ AudienceTypes["AUDIENCE_USERS"] = "users";
21
23
  })(AudienceTypes || (AudienceTypes = {}));
22
24
  const classes = {
23
25
  root: `${PREFIX}-layer-audience-root`,
@@ -31,8 +33,9 @@ const Root = styled(Box, {
31
33
  slot: 'LayerAudienceRoot'
32
34
  })(() => ({}));
33
35
  const AudienceLayer = React.forwardRef((props, ref) => {
36
+ var _a;
34
37
  // Props
35
- const { className, onClose, onSave, defaultValue = AudienceTypes.AUDIENCE_TAG ? [] : null, TextFieldProps = {
38
+ const { className, onClose, onSave, defaultValue = AudienceTypes.AUDIENCE_TAG || AudienceTypes.AUDIENCE_USERS ? [] : null, TextFieldProps = {
36
39
  variant: 'outlined',
37
40
  label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tags.label", defaultMessage: "ui.composer.layer.audience.tags.label" })
38
41
  } } = props, rest = __rest(props, ["className", "onClose", "onSave", "defaultValue", "TextFieldProps"]);
@@ -56,6 +59,11 @@ const AudienceLayer = React.forwardRef((props, ref) => {
56
59
  features.includes(SCFeatureName.TAGGING) &&
57
60
  SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in preferences &&
58
61
  preferences[SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [preferences, features]);
62
+ const usersTaggingEnabled = useMemo(() => preferences &&
63
+ features &&
64
+ features.includes(SCFeatureName.TAGGING) &&
65
+ SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED in preferences &&
66
+ preferences[SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED].value, [preferences, features]);
59
67
  const taggingRequiredEnabled = useMemo(() => preferences &&
60
68
  features &&
61
69
  features.includes(SCFeatureName.TAGGING) &&
@@ -72,16 +80,22 @@ const AudienceLayer = React.forwardRef((props, ref) => {
72
80
  ? AudienceTypes.AUDIENCE_EVENT
73
81
  : Object.prototype.hasOwnProperty.call(defaultValue, 'managed_by')
74
82
  ? AudienceTypes.AUDIENCE_GROUP
75
- : AudienceTypes.AUDIENCE_TAG);
83
+ : Array.isArray(defaultValue) && defaultValue.length && ((_a = defaultValue[0]) === null || _a === void 0 ? void 0 : _a.username)
84
+ ? AudienceTypes.AUDIENCE_USERS
85
+ : AudienceTypes.AUDIENCE_TAG);
76
86
  // HANDLERS
77
87
  const handleSave = useCallback(() => {
78
- audience === AudienceTypes.AUDIENCE_GROUP || audience === AudienceTypes.AUDIENCE_EVENT
79
- ? onSave(value)
80
- : onSave((value === null || value === void 0 ? void 0 : value.length) && (value === null || value === void 0 ? void 0 : value.length) > 0 ? value : null);
81
- }, [value, onSave, audience]);
88
+ if (audience === AudienceTypes.AUDIENCE_GROUP || audience === AudienceTypes.AUDIENCE_EVENT) {
89
+ onSave(value);
90
+ }
91
+ else {
92
+ onSave((value === null || value === void 0 ? void 0 : value.length) && (value === null || value === void 0 ? void 0 : value.length) > 0 ? value : null);
93
+ }
94
+ }, [audience, value, onSave]);
82
95
  const handleChange = useCallback((_event, tags) => setValue(tags), []);
83
96
  const handleEventChange = useCallback((event) => setValue(event), []);
84
97
  const handleGroupChange = useCallback((group) => setValue(group), []);
98
+ const handleUsersChange = useCallback((users) => setValue(users), []);
85
99
  const handleChangeAudience = useCallback((_event, data) => setAudience(data), []);
86
100
  const handleAutocompleteOpen = useCallback(() => setAutocompleteOpen(true), []);
87
101
  const handleAutocompleteClose = useCallback(() => setAutocompleteOpen(false), []);
@@ -89,7 +103,12 @@ const AudienceLayer = React.forwardRef((props, ref) => {
89
103
  (value !== undefined && Boolean(!(value === null || value === void 0 ? void 0 : value.length)) && audience !== AudienceTypes.AUDIENCE_ALL) ||
90
104
  (Boolean((value === null || value === void 0 ? void 0 : value.length) === 0) && audience === AudienceTypes.AUDIENCE_ALL && Boolean((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) !== 0)), value: AudienceTypes.AUDIENCE_EVENT, icon: _jsx(Icon, { children: "CalendarIcon" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.event", defaultMessage: "ui.composer.layer.audience.event" }) })), groupsEnabled && (_jsx(Tab, { disabled: (Boolean(value === null || value === void 0 ? void 0 : value.length) && !Object.prototype.hasOwnProperty.call(value, 'managed_by')) ||
91
105
  (value !== undefined && Boolean(!(value === null || value === void 0 ? void 0 : value.length)) && audience !== AudienceTypes.AUDIENCE_ALL) ||
92
- (Boolean((value === null || value === void 0 ? void 0 : value.length) === 0) && audience === AudienceTypes.AUDIENCE_ALL && Boolean((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) !== 0)), value: AudienceTypes.AUDIENCE_GROUP, icon: _jsx(Icon, { children: "groups" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.group", defaultMessage: "ui.composer.layer.audience.group" }) })), _jsx(Tab, { disabled: value && Object.prototype.hasOwnProperty.call(value, 'managed_by'), value: AudienceTypes.AUDIENCE_TAG, icon: _jsx(Icon, { children: "label" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tag", defaultMessage: "ui.composer.layer.audience.tag" }) })] })), _jsxs(Typography, Object.assign({ className: classes.message }, { children: [audience === AudienceTypes.AUDIENCE_ALL && !taggingRequiredEnabled && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.all.message", defaultMessage: "ui.composer.audience.layer.all.message" })), audience === AudienceTypes.AUDIENCE_EVENT && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.event.message", defaultMessage: "ui.composer.audience.layer.event.message" })), audience === AudienceTypes.AUDIENCE_GROUP && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.group.message", defaultMessage: "ui.composer.audience.layer.group.message" })), audience === AudienceTypes.AUDIENCE_TAG && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.tag.message", defaultMessage: "ui.composer.audience.layer.tag.message" }))] })), audience === AudienceTypes.AUDIENCE_TAG && (_jsx(Autocomplete, { className: classes.autocomplete, open: autocompleteOpen, onOpen: handleAutocompleteOpen, onClose: handleAutocompleteClose, multiple: true, options: scAddressingTags || [], getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, handleHomeEndKeys: true, clearIcon: null, noOptionsText: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tags.empty", defaultMessage: "ui.composer.layer.audience.tags.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => value.id === option.id, renderTags: (value, getTagProps) => {
106
+ (Boolean((value === null || value === void 0 ? void 0 : value.length) === 0) && audience === AudienceTypes.AUDIENCE_ALL && Boolean((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) !== 0)), value: AudienceTypes.AUDIENCE_GROUP, icon: _jsx(Icon, { children: "groups" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.group", defaultMessage: "ui.composer.layer.audience.group" }) })), _jsx(Tab, { disabled: value &&
107
+ ((Array.isArray(value) && value.some((v) => v === null || v === void 0 ? void 0 : v.username)) ||
108
+ (!Array.isArray(value) && Object.prototype.hasOwnProperty.call(value, 'managed_by'))), value: AudienceTypes.AUDIENCE_TAG, icon: _jsx(Icon, { children: "label" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tag", defaultMessage: "ui.composer.layer.audience.tag" }) }), usersTaggingEnabled && (_jsx(Tab, { disabled: value &&
109
+ ((Array.isArray(value) && value.length && !value.some((v) => v === null || v === void 0 ? void 0 : v.username)) ||
110
+ (!Array.isArray(value) && Object.keys(value).length && Object.prototype.hasOwnProperty.call(value, 'managed_by')) ||
111
+ (!Array.isArray(value) && Object.keys(value).length && Object.prototype.hasOwnProperty.call(value, 'recurring'))), value: AudienceTypes.AUDIENCE_USERS, icon: _jsx(Icon, { children: "people_alt" }), label: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.users", defaultMessage: "ui.composer.layer.audience.users" }) }))] })), _jsxs(Typography, Object.assign({ className: classes.message }, { children: [audience === AudienceTypes.AUDIENCE_ALL && !taggingRequiredEnabled && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.all.message", defaultMessage: "ui.composer.layer.audience.all.message" })), audience === AudienceTypes.AUDIENCE_EVENT && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.event.message", defaultMessage: "ui.composer.layer.audience.event.message" })), audience === AudienceTypes.AUDIENCE_GROUP && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.group.message", defaultMessage: "ui.composer.layer.audience.group.message" })), audience === AudienceTypes.AUDIENCE_TAG && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.tag.message", defaultMessage: "ui.composer.layer.audience.tag.message" })), audience === AudienceTypes.AUDIENCE_USERS && (_jsx(FormattedMessage, { id: "ui.composer.layer.audience.users.message", defaultMessage: "ui.composer.layer.audience.users.message" }))] })), audience === AudienceTypes.AUDIENCE_TAG && (_jsx(Autocomplete, { className: classes.autocomplete, open: autocompleteOpen, onOpen: handleAutocompleteOpen, onClose: handleAutocompleteClose, multiple: true, options: scAddressingTags || [], getOptionLabel: (option) => option.name || '', value: value, selectOnFocus: true, clearOnBlur: true, handleHomeEndKeys: true, clearIcon: null, noOptionsText: _jsx(FormattedMessage, { id: "ui.composer.layer.audience.tags.empty", defaultMessage: "ui.composer.layer.audience.tags.empty" }), onChange: handleChange, isOptionEqualToValue: (option, value) => value.id === option.id, renderTags: (value, getTagProps) => {
93
112
  return value.map((option, index) => _jsx(TagChip, Object.assign({ tag: option }, getTagProps({ index })), option.id));
94
113
  }, renderOption: (props, option, { selected, inputValue }) => {
95
114
  const matches = match(option.name, inputValue);
@@ -97,6 +116,6 @@ const AudienceLayer = React.forwardRef((props, ref) => {
97
116
  return (_jsx("li", Object.assign({}, props, { children: _jsx(TagChip, { disposable: false, tag: option, label: _jsx(React.Fragment, { children: parts.map((part, index) => (_jsx("span", Object.assign({ style: { fontWeight: part.highlight ? 700 : 400 } }, { children: part.text }), index))) }) }, option.id) })));
98
117
  }, renderInput: (params) => {
99
118
  return (_jsx(TextField, Object.assign({}, params, TextFieldProps, { InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'addressing', endAdornment: _jsx(React.Fragment, { children: params.InputProps.endAdornment }) }) })));
100
- } })), audience === AudienceTypes.AUDIENCE_GROUP && _jsx(GroupAutocomplete, { onChange: handleGroupChange, defaultValue: defaultValue }), audience === AudienceTypes.AUDIENCE_EVENT && _jsx(EventAutocomplete, { onChange: handleEventChange, defaultValue: defaultValue })] }))] })));
119
+ } })), audience === AudienceTypes.AUDIENCE_USERS && _jsx(UserAutocomplete, { onChange: handleUsersChange, defaultValue: defaultValue }), audience === AudienceTypes.AUDIENCE_GROUP && _jsx(GroupAutocomplete, { onChange: handleGroupChange, defaultValue: defaultValue }), audience === AudienceTypes.AUDIENCE_EVENT && _jsx(EventAutocomplete, { onChange: handleEventChange, defaultValue: defaultValue })] }))] })));
101
120
  });
102
121
  export default AudienceLayer;
@@ -80,7 +80,7 @@ const exampleExploreData = {
80
80
  addressing: [],
81
81
  poll: null
82
82
  },
83
- seen_by_id: [40, 7, 1],
83
+ seen: true,
84
84
  has_boost: false
85
85
  },
86
86
  {
@@ -191,7 +191,7 @@ const exampleExploreData = {
191
191
  poll: null,
192
192
  title: "Socioterapeuti dicono che l'Italia ha inglobato secondo un'analisi storica con tanto di bibliografia. Senno' ha a che fare con le pellicce, ovviamente. Ritengo che vedere cio' che si semina.."
193
193
  },
194
- seen_by_id: [345, 299, 7, 54, 1],
194
+ seen: true,
195
195
  has_boost: false
196
196
  },
197
197
  {
@@ -327,7 +327,7 @@ const exampleExploreData = {
327
327
  poll: null,
328
328
  title: "Prima, mentre che io facevo le derapate, popo a sfonna' 'a bariera der sono, co'a machina de mi'fratello su 'a prenestina... aho'... a'n certo punto... nun te vado a sbatte co er Siringa???!! Ve dico... 'na grezza da paura! E allora je strillo \"Vie'"
329
329
  },
330
- seen_by_id: [370, 371, 111, 54, 7, 9],
330
+ seen: true,
331
331
  has_boost: false
332
332
  },
333
333
  {
@@ -412,7 +412,7 @@ const exampleExploreData = {
412
412
  poll: null,
413
413
  title: "Un mattino P'an-shan fece visita a Seng-ts'an e lo preg\u00f2 di mostrargli la strada pi\u00f9 facile per conseguire l'illuminazione. Il maestro indic\u00f2 una consunta statua di platino e disse: \"Se davvero desideri diventare saggio devi riuscire a comprendere la"
414
414
  },
415
- seen_by_id: [80, 381, 7],
415
+ seen: true,
416
416
  has_boost: false
417
417
  },
418
418
  {
@@ -507,7 +507,7 @@ const exampleExploreData = {
507
507
  addressing: [],
508
508
  poll: null
509
509
  },
510
- seen_by_id: [248, 7],
510
+ seen: true,
511
511
  has_boost: false
512
512
  }
513
513
  ]