@selfcommunity/react-ui 0.7.0-alpha.5 → 0.7.0-alpha.50
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.
- package/lib/cjs/components/Categories/Categories.js +2 -2
- package/lib/cjs/components/Categories/Categories.js.map +1 -1
- package/lib/cjs/components/CategoriesFollowed/CategoriesFollowed.d.ts.map +1 -1
- package/lib/cjs/components/CategoriesFollowed/CategoriesFollowed.js +59 -43
- package/lib/cjs/components/CategoriesFollowed/CategoriesFollowed.js.map +1 -1
- package/lib/cjs/components/CategoriesFollowed/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/CategoriesFollowed/Skeleton.js +3 -1
- package/lib/cjs/components/CategoriesFollowed/Skeleton.js.map +1 -1
- package/lib/cjs/components/CategoriesPopular/CategoriesPopular.d.ts.map +1 -1
- package/lib/cjs/components/CategoriesPopular/CategoriesPopular.js +53 -36
- package/lib/cjs/components/CategoriesPopular/CategoriesPopular.js.map +1 -1
- package/lib/cjs/components/CategoriesPopular/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/CategoriesPopular/Skeleton.js +3 -1
- package/lib/cjs/components/CategoriesPopular/Skeleton.js.map +1 -1
- package/lib/cjs/components/CategoriesSuggestion/CategoriesSuggestion.d.ts +6 -0
- package/lib/cjs/components/CategoriesSuggestion/CategoriesSuggestion.d.ts.map +1 -1
- package/lib/cjs/components/CategoriesSuggestion/CategoriesSuggestion.js +54 -40
- package/lib/cjs/components/CategoriesSuggestion/CategoriesSuggestion.js.map +1 -1
- package/lib/cjs/components/CategoriesSuggestion/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/CategoriesSuggestion/Skeleton.js +3 -1
- package/lib/cjs/components/CategoriesSuggestion/Skeleton.js.map +1 -1
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js +1 -1
- package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js.map +1 -1
- package/lib/cjs/components/CustomAdv/CustomAdv.d.ts.map +1 -1
- package/lib/cjs/components/CustomAdv/CustomAdv.js +30 -2
- package/lib/cjs/components/CustomAdv/CustomAdv.js.map +1 -1
- package/lib/cjs/components/Editor/Editor.d.ts.map +1 -1
- package/lib/cjs/components/Editor/Editor.js +14 -14
- package/lib/cjs/components/Editor/Editor.js.map +1 -1
- package/lib/cjs/components/Feed/Feed.d.ts +5 -0
- package/lib/cjs/components/Feed/Feed.d.ts.map +1 -1
- package/lib/cjs/components/Feed/Feed.js +55 -30
- package/lib/cjs/components/Feed/Feed.js.map +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.js +9 -6
- package/lib/cjs/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/cjs/components/Header/Header.js +2 -2
- package/lib/cjs/components/Header/Header.js.map +1 -1
- package/lib/cjs/components/Header/HeaderMenu.d.ts.map +1 -1
- package/lib/cjs/components/Header/HeaderMenu.js +3 -0
- package/lib/cjs/components/Header/HeaderMenu.js.map +1 -1
- package/lib/cjs/components/Header/MobileHeader/MobileHeader.d.ts.map +1 -1
- package/lib/cjs/components/Header/MobileHeader/MobileHeader.js +4 -3
- package/lib/cjs/components/Header/MobileHeader/MobileHeader.js.map +1 -1
- package/lib/cjs/components/Header/SearchBar.d.ts +4 -0
- package/lib/cjs/components/Header/SearchBar.d.ts.map +1 -1
- package/lib/cjs/components/Header/SearchBar.js +83 -35
- package/lib/cjs/components/Header/SearchBar.js.map +1 -1
- package/lib/cjs/components/IncubatorSuggestion/IncubatorSuggestion.d.ts +7 -1
- package/lib/cjs/components/IncubatorSuggestion/IncubatorSuggestion.d.ts.map +1 -1
- package/lib/cjs/components/IncubatorSuggestion/IncubatorSuggestion.js +50 -38
- package/lib/cjs/components/IncubatorSuggestion/IncubatorSuggestion.js.map +1 -1
- package/lib/cjs/components/IncubatorsList/IncubatorsList.d.ts +7 -1
- package/lib/cjs/components/IncubatorsList/IncubatorsList.d.ts.map +1 -1
- package/lib/cjs/components/IncubatorsList/IncubatorsList.js +61 -38
- package/lib/cjs/components/IncubatorsList/IncubatorsList.js.map +1 -1
- package/lib/cjs/components/Message/Message.d.ts +3 -18
- package/lib/cjs/components/Message/Message.d.ts.map +1 -1
- package/lib/cjs/components/Message/Message.js +20 -17
- package/lib/cjs/components/Message/Message.js.map +1 -1
- package/lib/cjs/components/MessageEditor/MessageEditor.d.ts +4 -13
- package/lib/cjs/components/MessageEditor/MessageEditor.d.ts.map +1 -1
- package/lib/cjs/components/MessageEditor/MessageEditor.js +61 -40
- package/lib/cjs/components/MessageEditor/MessageEditor.js.map +1 -1
- package/lib/cjs/components/PeopleSuggestion/PeopleSuggestion.d.ts +6 -0
- package/lib/cjs/components/PeopleSuggestion/PeopleSuggestion.d.ts.map +1 -1
- package/lib/cjs/components/PeopleSuggestion/PeopleSuggestion.js +56 -52
- package/lib/cjs/components/PeopleSuggestion/PeopleSuggestion.js.map +1 -1
- package/lib/cjs/components/Platform/Platform.d.ts +2 -1
- package/lib/cjs/components/Platform/Platform.d.ts.map +1 -1
- package/lib/cjs/components/Platform/Platform.js +1 -1
- package/lib/cjs/components/Platform/Platform.js.map +1 -1
- package/lib/cjs/components/PollSuggestion/PollSuggestion.d.ts +7 -1
- package/lib/cjs/components/PollSuggestion/PollSuggestion.d.ts.map +1 -1
- package/lib/cjs/components/PollSuggestion/PollSuggestion.js +49 -37
- package/lib/cjs/components/PollSuggestion/PollSuggestion.js.map +1 -1
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.d.ts +7 -1
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.js +58 -40
- package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.js.map +1 -1
- package/lib/cjs/components/Snippets/Snippets.d.ts.map +1 -1
- package/lib/cjs/components/Snippets/Snippets.js +5 -3
- package/lib/cjs/components/Snippets/Snippets.js.map +1 -1
- package/lib/cjs/components/Thread/Thread.d.ts.map +1 -1
- package/lib/cjs/components/Thread/Thread.js +18 -34
- package/lib/cjs/components/Thread/Thread.js.map +1 -1
- package/lib/cjs/components/TrendingFeed/TrendingFeed.d.ts +12 -1
- package/lib/cjs/components/TrendingFeed/TrendingFeed.d.ts.map +1 -1
- package/lib/cjs/components/TrendingFeed/TrendingFeed.js +50 -35
- package/lib/cjs/components/TrendingFeed/TrendingFeed.js.map +1 -1
- package/lib/cjs/components/TrendingPeople/TrendingPeople.d.ts +6 -0
- package/lib/cjs/components/TrendingPeople/TrendingPeople.d.ts.map +1 -1
- package/lib/cjs/components/TrendingPeople/TrendingPeople.js +55 -39
- package/lib/cjs/components/TrendingPeople/TrendingPeople.js.map +1 -1
- package/lib/cjs/components/UserFollowers/UserFollowers.d.ts +6 -0
- package/lib/cjs/components/UserFollowers/UserFollowers.d.ts.map +1 -1
- package/lib/cjs/components/UserFollowers/UserFollowers.js +66 -43
- package/lib/cjs/components/UserFollowers/UserFollowers.js.map +1 -1
- package/lib/cjs/components/UserProfileEdit/Section/Account.d.ts +28 -0
- package/lib/cjs/components/UserProfileEdit/Section/Account.d.ts.map +1 -0
- package/lib/cjs/components/UserProfileEdit/Section/Account.js +118 -0
- package/lib/cjs/components/UserProfileEdit/Section/Account.js.map +1 -0
- package/lib/cjs/components/UserProfileEdit/Section/AccountCredentials.d.ts +18 -0
- package/lib/cjs/components/UserProfileEdit/Section/AccountCredentials.d.ts.map +1 -0
- package/lib/cjs/components/UserProfileEdit/Section/AccountCredentials.js +260 -0
- package/lib/cjs/components/UserProfileEdit/Section/AccountCredentials.js.map +1 -0
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.d.ts +1 -1
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.d.ts.map +1 -1
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js +17 -8
- package/lib/cjs/components/UserProfileEdit/Section/PublicInfo.js.map +1 -1
- package/lib/cjs/components/UserProfileEdit/UserProfileEdit.d.ts +6 -0
- package/lib/cjs/components/UserProfileEdit/UserProfileEdit.d.ts.map +1 -1
- package/lib/cjs/components/UserProfileEdit/UserProfileEdit.js +8 -1
- package/lib/cjs/components/UserProfileEdit/UserProfileEdit.js.map +1 -1
- package/lib/cjs/components/UserProfileEdit/index.d.ts +2 -1
- package/lib/cjs/components/UserProfileEdit/index.d.ts.map +1 -1
- package/lib/cjs/components/UserProfileEdit/index.js +3 -1
- package/lib/cjs/components/UserProfileEdit/index.js.map +1 -1
- package/lib/cjs/components/UserProfileInfo/UserProfileInfo.d.ts.map +1 -1
- package/lib/cjs/components/UserProfileInfo/UserProfileInfo.js +56 -2
- package/lib/cjs/components/UserProfileInfo/UserProfileInfo.js.map +1 -1
- package/lib/cjs/components/UserSocialAssociation/UserSocialAssociation.d.ts +70 -0
- package/lib/cjs/components/UserSocialAssociation/UserSocialAssociation.d.ts.map +1 -0
- package/lib/cjs/components/UserSocialAssociation/UserSocialAssociation.js +160 -0
- package/lib/cjs/components/UserSocialAssociation/UserSocialAssociation.js.map +1 -0
- package/lib/cjs/components/UserSocialAssociation/index.d.ts +4 -0
- package/lib/cjs/components/UserSocialAssociation/index.d.ts.map +1 -0
- package/lib/cjs/components/UserSocialAssociation/index.js +8 -0
- package/lib/cjs/components/UserSocialAssociation/index.js.map +1 -0
- package/lib/cjs/components/UsersFollowed/UsersFollowed.d.ts +6 -0
- package/lib/cjs/components/UsersFollowed/UsersFollowed.d.ts.map +1 -1
- package/lib/cjs/components/UsersFollowed/UsersFollowed.js +66 -47
- package/lib/cjs/components/UsersFollowed/UsersFollowed.js.map +1 -1
- package/lib/cjs/constants/Pagination.d.ts +1 -1
- package/lib/cjs/constants/Pagination.d.ts.map +1 -1
- package/lib/cjs/constants/Pagination.js +1 -1
- package/lib/cjs/constants/Pagination.js.map +1 -1
- package/lib/cjs/index.d.ts +6 -3
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +10 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/shared/BaseDrawer/BaseDrawer.d.ts +1 -1
- package/lib/cjs/shared/BaseDrawer/BaseDrawer.d.ts.map +1 -1
- package/lib/cjs/shared/InfiniteScroll/index.js +1 -1
- package/lib/cjs/shared/InfiniteScroll/index.js.map +1 -1
- package/lib/cjs/shared/MetadataField/MetadataField.d.ts.map +1 -1
- package/lib/cjs/shared/MetadataField/MetadataField.js +6 -17
- package/lib/cjs/shared/MetadataField/MetadataField.js.map +1 -1
- package/lib/cjs/shared/PasswordTextField/index.d.ts.map +1 -1
- package/lib/cjs/shared/PasswordTextField/index.js +5 -2
- package/lib/cjs/shared/PasswordTextField/index.js.map +1 -1
- package/lib/cjs/shared/Tags/index.d.ts.map +1 -1
- package/lib/cjs/shared/Tags/index.js +10 -7
- package/lib/cjs/shared/Tags/index.js.map +1 -1
- package/lib/cjs/types/headerMenuUrls.d.ts +4 -0
- package/lib/cjs/types/headerMenuUrls.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +2 -2
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/index.js +2 -1
- package/lib/cjs/types/index.js.map +1 -1
- package/lib/cjs/types/user.d.ts +11 -1
- package/lib/cjs/types/user.d.ts.map +1 -1
- package/lib/cjs/types/user.js +12 -1
- package/lib/cjs/types/user.js.map +1 -1
- package/lib/cjs/utils/tools.d.ts +29 -0
- package/lib/cjs/utils/tools.d.ts.map +1 -0
- package/lib/cjs/utils/tools.js +81 -0
- package/lib/cjs/utils/tools.js.map +1 -0
- package/lib/esm/components/Categories/Categories.js +2 -2
- package/lib/esm/components/Categories/Categories.js.map +1 -1
- package/lib/esm/components/CategoriesFollowed/CategoriesFollowed.d.ts.map +1 -1
- package/lib/esm/components/CategoriesFollowed/CategoriesFollowed.js +64 -48
- package/lib/esm/components/CategoriesFollowed/CategoriesFollowed.js.map +1 -1
- package/lib/esm/components/CategoriesFollowed/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/CategoriesFollowed/Skeleton.js +3 -1
- package/lib/esm/components/CategoriesFollowed/Skeleton.js.map +1 -1
- package/lib/esm/components/CategoriesPopular/CategoriesPopular.d.ts.map +1 -1
- package/lib/esm/components/CategoriesPopular/CategoriesPopular.js +56 -39
- package/lib/esm/components/CategoriesPopular/CategoriesPopular.js.map +1 -1
- package/lib/esm/components/CategoriesPopular/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/CategoriesPopular/Skeleton.js +3 -1
- package/lib/esm/components/CategoriesPopular/Skeleton.js.map +1 -1
- package/lib/esm/components/CategoriesSuggestion/CategoriesSuggestion.d.ts +6 -0
- package/lib/esm/components/CategoriesSuggestion/CategoriesSuggestion.d.ts.map +1 -1
- package/lib/esm/components/CategoriesSuggestion/CategoriesSuggestion.js +58 -44
- package/lib/esm/components/CategoriesSuggestion/CategoriesSuggestion.js.map +1 -1
- package/lib/esm/components/CategoriesSuggestion/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/CategoriesSuggestion/Skeleton.js +3 -1
- package/lib/esm/components/CategoriesSuggestion/Skeleton.js.map +1 -1
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js +1 -1
- package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js.map +1 -1
- package/lib/esm/components/CustomAdv/CustomAdv.d.ts.map +1 -1
- package/lib/esm/components/CustomAdv/CustomAdv.js +7 -2
- package/lib/esm/components/CustomAdv/CustomAdv.js.map +1 -1
- package/lib/esm/components/Editor/Editor.d.ts.map +1 -1
- package/lib/esm/components/Editor/Editor.js +14 -14
- package/lib/esm/components/Editor/Editor.js.map +1 -1
- package/lib/esm/components/Feed/Feed.d.ts +5 -0
- package/lib/esm/components/Feed/Feed.d.ts.map +1 -1
- package/lib/esm/components/Feed/Feed.js +56 -31
- package/lib/esm/components/Feed/Feed.js.map +1 -1
- package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/esm/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.js +9 -6
- package/lib/esm/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/esm/components/Header/Header.js +2 -2
- package/lib/esm/components/Header/Header.js.map +1 -1
- package/lib/esm/components/Header/HeaderMenu.d.ts.map +1 -1
- package/lib/esm/components/Header/HeaderMenu.js +3 -0
- package/lib/esm/components/Header/HeaderMenu.js.map +1 -1
- package/lib/esm/components/Header/MobileHeader/MobileHeader.d.ts.map +1 -1
- package/lib/esm/components/Header/MobileHeader/MobileHeader.js +4 -3
- package/lib/esm/components/Header/MobileHeader/MobileHeader.js.map +1 -1
- package/lib/esm/components/Header/SearchBar.d.ts +4 -0
- package/lib/esm/components/Header/SearchBar.d.ts.map +1 -1
- package/lib/esm/components/Header/SearchBar.js +86 -38
- package/lib/esm/components/Header/SearchBar.js.map +1 -1
- package/lib/esm/components/IncubatorSuggestion/IncubatorSuggestion.d.ts +7 -1
- package/lib/esm/components/IncubatorSuggestion/IncubatorSuggestion.d.ts.map +1 -1
- package/lib/esm/components/IncubatorSuggestion/IncubatorSuggestion.js +53 -41
- package/lib/esm/components/IncubatorSuggestion/IncubatorSuggestion.js.map +1 -1
- package/lib/esm/components/IncubatorsList/IncubatorsList.d.ts +7 -1
- package/lib/esm/components/IncubatorsList/IncubatorsList.d.ts.map +1 -1
- package/lib/esm/components/IncubatorsList/IncubatorsList.js +63 -40
- package/lib/esm/components/IncubatorsList/IncubatorsList.js.map +1 -1
- package/lib/esm/components/Message/Message.d.ts +3 -18
- package/lib/esm/components/Message/Message.d.ts.map +1 -1
- package/lib/esm/components/Message/Message.js +20 -17
- package/lib/esm/components/Message/Message.js.map +1 -1
- package/lib/esm/components/MessageEditor/MessageEditor.d.ts +4 -13
- package/lib/esm/components/MessageEditor/MessageEditor.d.ts.map +1 -1
- package/lib/esm/components/MessageEditor/MessageEditor.js +63 -42
- package/lib/esm/components/MessageEditor/MessageEditor.js.map +1 -1
- package/lib/esm/components/PeopleSuggestion/PeopleSuggestion.d.ts +6 -0
- package/lib/esm/components/PeopleSuggestion/PeopleSuggestion.d.ts.map +1 -1
- package/lib/esm/components/PeopleSuggestion/PeopleSuggestion.js +58 -54
- package/lib/esm/components/PeopleSuggestion/PeopleSuggestion.js.map +1 -1
- package/lib/esm/components/Platform/Platform.d.ts +2 -1
- package/lib/esm/components/Platform/Platform.d.ts.map +1 -1
- package/lib/esm/components/Platform/Platform.js +1 -1
- package/lib/esm/components/Platform/Platform.js.map +1 -1
- package/lib/esm/components/PollSuggestion/PollSuggestion.d.ts +7 -1
- package/lib/esm/components/PollSuggestion/PollSuggestion.d.ts.map +1 -1
- package/lib/esm/components/PollSuggestion/PollSuggestion.js +52 -40
- package/lib/esm/components/PollSuggestion/PollSuggestion.js.map +1 -1
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.d.ts +7 -1
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.js +61 -43
- package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.js.map +1 -1
- package/lib/esm/components/Snippets/Snippets.d.ts.map +1 -1
- package/lib/esm/components/Snippets/Snippets.js +6 -4
- package/lib/esm/components/Snippets/Snippets.js.map +1 -1
- package/lib/esm/components/Thread/Thread.d.ts.map +1 -1
- package/lib/esm/components/Thread/Thread.js +18 -34
- package/lib/esm/components/Thread/Thread.js.map +1 -1
- package/lib/esm/components/TrendingFeed/TrendingFeed.d.ts +12 -1
- package/lib/esm/components/TrendingFeed/TrendingFeed.d.ts.map +1 -1
- package/lib/esm/components/TrendingFeed/TrendingFeed.js +53 -38
- package/lib/esm/components/TrendingFeed/TrendingFeed.js.map +1 -1
- package/lib/esm/components/TrendingPeople/TrendingPeople.d.ts +6 -0
- package/lib/esm/components/TrendingPeople/TrendingPeople.d.ts.map +1 -1
- package/lib/esm/components/TrendingPeople/TrendingPeople.js +57 -41
- package/lib/esm/components/TrendingPeople/TrendingPeople.js.map +1 -1
- package/lib/esm/components/UserFollowers/UserFollowers.d.ts +6 -0
- package/lib/esm/components/UserFollowers/UserFollowers.d.ts.map +1 -1
- package/lib/esm/components/UserFollowers/UserFollowers.js +69 -46
- package/lib/esm/components/UserFollowers/UserFollowers.js.map +1 -1
- package/lib/esm/components/UserProfileEdit/Section/Account.d.ts +28 -0
- package/lib/esm/components/UserProfileEdit/Section/Account.d.ts.map +1 -0
- package/lib/esm/components/UserProfileEdit/Section/Account.js +89 -0
- package/lib/esm/components/UserProfileEdit/Section/Account.js.map +1 -0
- package/lib/esm/components/UserProfileEdit/Section/AccountCredentials.d.ts +18 -0
- package/lib/esm/components/UserProfileEdit/Section/AccountCredentials.d.ts.map +1 -0
- package/lib/esm/components/UserProfileEdit/Section/AccountCredentials.js +231 -0
- package/lib/esm/components/UserProfileEdit/Section/AccountCredentials.js.map +1 -0
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.d.ts +1 -1
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.d.ts.map +1 -1
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js +18 -9
- package/lib/esm/components/UserProfileEdit/Section/PublicInfo.js.map +1 -1
- package/lib/esm/components/UserProfileEdit/UserProfileEdit.d.ts +6 -0
- package/lib/esm/components/UserProfileEdit/UserProfileEdit.d.ts.map +1 -1
- package/lib/esm/components/UserProfileEdit/UserProfileEdit.js +8 -1
- package/lib/esm/components/UserProfileEdit/UserProfileEdit.js.map +1 -1
- package/lib/esm/components/UserProfileEdit/index.d.ts +2 -1
- package/lib/esm/components/UserProfileEdit/index.d.ts.map +1 -1
- package/lib/esm/components/UserProfileEdit/index.js +2 -1
- package/lib/esm/components/UserProfileEdit/index.js.map +1 -1
- package/lib/esm/components/UserProfileInfo/UserProfileInfo.d.ts.map +1 -1
- package/lib/esm/components/UserProfileInfo/UserProfileInfo.js +60 -6
- package/lib/esm/components/UserProfileInfo/UserProfileInfo.js.map +1 -1
- package/lib/esm/components/UserSocialAssociation/UserSocialAssociation.d.ts +70 -0
- package/lib/esm/components/UserSocialAssociation/UserSocialAssociation.d.ts.map +1 -0
- package/lib/esm/components/UserSocialAssociation/UserSocialAssociation.js +131 -0
- package/lib/esm/components/UserSocialAssociation/UserSocialAssociation.js.map +1 -0
- package/lib/esm/components/UserSocialAssociation/index.d.ts +4 -0
- package/lib/esm/components/UserSocialAssociation/index.d.ts.map +1 -0
- package/lib/esm/components/UserSocialAssociation/index.js +3 -0
- package/lib/esm/components/UserSocialAssociation/index.js.map +1 -0
- package/lib/esm/components/UsersFollowed/UsersFollowed.d.ts +6 -0
- package/lib/esm/components/UsersFollowed/UsersFollowed.d.ts.map +1 -1
- package/lib/esm/components/UsersFollowed/UsersFollowed.js +69 -50
- package/lib/esm/components/UsersFollowed/UsersFollowed.js.map +1 -1
- package/lib/esm/constants/Pagination.d.ts +1 -1
- package/lib/esm/constants/Pagination.d.ts.map +1 -1
- package/lib/esm/constants/Pagination.js +1 -1
- package/lib/esm/constants/Pagination.js.map +1 -1
- package/lib/esm/index.d.ts +6 -3
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +8 -5
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/shared/BaseDrawer/BaseDrawer.d.ts +1 -1
- package/lib/esm/shared/BaseDrawer/BaseDrawer.d.ts.map +1 -1
- package/lib/esm/shared/InfiniteScroll/index.js +1 -1
- package/lib/esm/shared/InfiniteScroll/index.js.map +1 -1
- package/lib/esm/shared/MetadataField/MetadataField.d.ts.map +1 -1
- package/lib/esm/shared/MetadataField/MetadataField.js +6 -17
- package/lib/esm/shared/MetadataField/MetadataField.js.map +1 -1
- package/lib/esm/shared/PasswordTextField/index.d.ts.map +1 -1
- package/lib/esm/shared/PasswordTextField/index.js +5 -2
- package/lib/esm/shared/PasswordTextField/index.js.map +1 -1
- package/lib/esm/shared/Tags/index.d.ts.map +1 -1
- package/lib/esm/shared/Tags/index.js +10 -7
- package/lib/esm/shared/Tags/index.js.map +1 -1
- package/lib/esm/types/headerMenuUrls.d.ts +4 -0
- package/lib/esm/types/headerMenuUrls.d.ts.map +1 -1
- package/lib/esm/types/index.d.ts +2 -2
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/index.js +2 -2
- package/lib/esm/types/index.js.map +1 -1
- package/lib/esm/types/user.d.ts +11 -1
- package/lib/esm/types/user.d.ts.map +1 -1
- package/lib/esm/types/user.js +11 -0
- package/lib/esm/types/user.js.map +1 -1
- package/lib/esm/utils/tools.d.ts +29 -0
- package/lib/esm/utils/tools.d.ts.map +1 -0
- package/lib/esm/utils/tools.js +76 -0
- package/lib/esm/utils/tools.js.map +1 -0
- package/lib/umd/react-ui.js +11 -11
- package/lib/umd/react-ui.js.LICENSE.txt +3 -3
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +15 -15
|
@@ -9,13 +9,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import React, { useEffect, useState } from 'react';
|
|
12
|
+
import React, { useEffect, useReducer, useState } from 'react';
|
|
13
13
|
import { styled } from '@mui/material/styles';
|
|
14
14
|
import { Button, List, Typography, ListItem, useMediaQuery, useTheme } from '@mui/material';
|
|
15
15
|
import CardContent from '@mui/material/CardContent';
|
|
16
16
|
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
17
|
-
import { Logger } from '@selfcommunity/utils';
|
|
18
|
-
import { useIsComponentMountedRef, useSCUser } from '@selfcommunity/react-core';
|
|
17
|
+
import { CacheStrategies, Logger } from '@selfcommunity/utils';
|
|
18
|
+
import { SCCache, useIsComponentMountedRef, useSCUser } from '@selfcommunity/react-core';
|
|
19
19
|
import Skeleton from './Skeleton';
|
|
20
20
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
21
21
|
import { FormattedMessage } from 'react-intl';
|
|
@@ -28,6 +28,7 @@ import { useThemeProps } from '@mui/system';
|
|
|
28
28
|
import Widget from '../Widget';
|
|
29
29
|
import IncubatorDetail from '../IncubatorDetail';
|
|
30
30
|
import HiddenPlaceholder from '../../shared/HiddenPlaceholder';
|
|
31
|
+
import { actionToolsTypes, dataToolsReducer, stateToolsInitializer } from '../../utils/tools';
|
|
31
32
|
const PREFIX = 'SCIncubatorSuggestion';
|
|
32
33
|
const classes = {
|
|
33
34
|
root: `${PREFIX}-root`,
|
|
@@ -85,7 +86,7 @@ export default function IncubatorSuggestion(inProps) {
|
|
|
85
86
|
props: inProps,
|
|
86
87
|
name: PREFIX
|
|
87
88
|
});
|
|
88
|
-
const { autoHide = true, className, IncubatorProps = {} } = props, rest = __rest(props, ["autoHide", "className", "IncubatorProps"]);
|
|
89
|
+
const { autoHide = true, className, IncubatorProps = {}, cacheStrategy = CacheStrategies.NETWORK_ONLY, onHeightChange, onStateChange } = props, rest = __rest(props, ["autoHide", "className", "IncubatorProps", "cacheStrategy", "onHeightChange", "onStateChange"]);
|
|
89
90
|
// REFS
|
|
90
91
|
const isMountedRef = useIsComponentMountedRef();
|
|
91
92
|
// CONTEXT
|
|
@@ -94,14 +95,14 @@ export default function IncubatorSuggestion(inProps) {
|
|
|
94
95
|
// STATE
|
|
95
96
|
const theme = useTheme();
|
|
96
97
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
97
|
-
const [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
const [state, dispatch] = useReducer(dataToolsReducer, {
|
|
99
|
+
isLoadingNext: true,
|
|
100
|
+
next: `${Endpoints.GetIncubatorSuggestion.url()}?limit=10`,
|
|
101
|
+
cacheKey: SCCache.getToolsStateCacheKey(SCCache.INCUBATOR_SUGGESTION_TOOLS_STATE_CACHE_PREFIX_KEY),
|
|
102
|
+
cacheStrategy
|
|
103
|
+
}, stateToolsInitializer);
|
|
102
104
|
const [openIncubatorsDialog, setOpenIncubatorsDialog] = useState(false);
|
|
103
105
|
const [openIncubatorDetailDialog, setOpenIncubatorDetailDialog] = useState(false);
|
|
104
|
-
const [next, setNext] = useState(`${Endpoints.GetIncubatorSuggestion.url()}?limit=10`);
|
|
105
106
|
const [detailObj, setDetailObj] = useState(null);
|
|
106
107
|
// HANDLERS
|
|
107
108
|
function handleIncubatorDetailDialogOpening(incubator) {
|
|
@@ -116,42 +117,50 @@ export default function IncubatorSuggestion(inProps) {
|
|
|
116
117
|
* Fetches incubator suggestion list
|
|
117
118
|
*/
|
|
118
119
|
function fetchIncubatorSuggestion() {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
return http.request({
|
|
121
|
+
url: state.next,
|
|
122
|
+
method: Endpoints.GetIncubatorSuggestion.method
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
if (scUserContext.user && cacheStrategy === CacheStrategies.NETWORK_ONLY) {
|
|
127
|
+
onStateChange && onStateChange({ cacheStrategy: CacheStrategies.CACHE_FIRST });
|
|
128
|
+
}
|
|
129
|
+
}, [authUserId]);
|
|
130
|
+
/**
|
|
131
|
+
* On mount, if user is authenticated, fetches suggested incubators list
|
|
132
|
+
*/
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
let ignore = false;
|
|
135
|
+
if (state.next) {
|
|
136
|
+
fetchIncubatorSuggestion()
|
|
125
137
|
.then((res) => {
|
|
126
|
-
if (isMountedRef.current) {
|
|
138
|
+
if (isMountedRef.current && !ignore) {
|
|
127
139
|
const data = res.data;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
140
|
+
dispatch({
|
|
141
|
+
type: actionToolsTypes.LOAD_NEXT_SUCCESS,
|
|
142
|
+
payload: {
|
|
143
|
+
results: data,
|
|
144
|
+
count: data.length
|
|
145
|
+
}
|
|
146
|
+
});
|
|
133
147
|
}
|
|
134
148
|
})
|
|
135
149
|
.catch((error) => {
|
|
136
|
-
|
|
150
|
+
dispatch({ type: actionToolsTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
137
151
|
Logger.error(SCOPE_SC_UI, error);
|
|
138
152
|
});
|
|
153
|
+
return () => {
|
|
154
|
+
ignore = true;
|
|
155
|
+
};
|
|
139
156
|
}
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* On mount, if user is authenticated, fetches suggested incubators list
|
|
143
|
-
*/
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
if (scUserContext.user) {
|
|
146
|
-
fetchIncubatorSuggestion();
|
|
147
|
-
}
|
|
148
|
-
}, [authUserId]);
|
|
157
|
+
}, [state.next]);
|
|
149
158
|
/**
|
|
150
159
|
* Handles subscriptions counter update on subscribe/unsubscribe action.
|
|
151
160
|
* @param incubator
|
|
152
161
|
*/
|
|
153
162
|
function handleSubscriptionsUpdate(incubator) {
|
|
154
|
-
const newIncubators = [...
|
|
163
|
+
const newIncubators = [...state.results];
|
|
155
164
|
const index = newIncubators.findIndex((i) => i.id === incubator.id);
|
|
156
165
|
if (index !== -1) {
|
|
157
166
|
if (incubator.subscribed) {
|
|
@@ -162,34 +171,37 @@ export default function IncubatorSuggestion(inProps) {
|
|
|
162
171
|
newIncubators[index].subscribers_count = incubator.subscribers_count + 1;
|
|
163
172
|
newIncubators[index].subscribed = !incubator.subscribed;
|
|
164
173
|
}
|
|
165
|
-
|
|
174
|
+
dispatch({
|
|
175
|
+
type: actionToolsTypes.SET_RESULTS,
|
|
176
|
+
payload: { results: newIncubators }
|
|
177
|
+
});
|
|
166
178
|
}
|
|
167
179
|
}
|
|
168
180
|
/**
|
|
169
181
|
* Renders suggested incubators list
|
|
170
182
|
*/
|
|
171
|
-
if (
|
|
183
|
+
if (state.isLoadingNext) {
|
|
172
184
|
return React.createElement(Skeleton, null);
|
|
173
185
|
}
|
|
174
186
|
const c = (React.createElement(CardContent, null,
|
|
175
187
|
React.createElement(Typography, { className: classes.title, variant: 'h5' },
|
|
176
188
|
React.createElement(FormattedMessage, { id: "ui.IncubatorSuggestion.title", defaultMessage: "ui.IncubatorSuggestion.title" })),
|
|
177
|
-
!
|
|
189
|
+
!state.count ? (React.createElement(Typography, { className: classes.noResults, variant: "body2" },
|
|
178
190
|
React.createElement(FormattedMessage, { id: "ui.IncubatorSuggestion.noResults", defaultMessage: "ui.IncubatorSuggestion.noResults" }))) : (React.createElement(React.Fragment, null,
|
|
179
|
-
React.createElement(List, null,
|
|
191
|
+
React.createElement(List, null, state.results.slice(0, limit).map((incubator) => (React.createElement(ListItem, { key: incubator.id },
|
|
180
192
|
React.createElement(Incubator, Object.assign({ elevation: 0, incubator: incubator, className: classes.incubatorItem, subscribeButtonProps: { onSubscribe: handleSubscriptionsUpdate }, ButtonProps: { onClick: () => handleIncubatorDetailDialogOpening(incubator) } }, IncubatorProps)))))),
|
|
181
|
-
|
|
193
|
+
limit < state.count && (React.createElement(Button, { className: classes.showMore, size: "small", onClick: () => setOpenIncubatorsDialog(true) },
|
|
182
194
|
React.createElement(FormattedMessage, { id: "ui.IncubatorSuggestion.ShowAll", defaultMessage: "ui.IncubatorSuggestion.ShowAll" }))))),
|
|
183
|
-
openIncubatorsDialog && (React.createElement(BaseDialog, { title: React.createElement(FormattedMessage, { id: "ui.IncubatorSuggestion.title", defaultMessage: "ui.IncubatorSuggestion.title" }), onClose: () => setOpenIncubatorsDialog(false), open: openIncubatorsDialog },
|
|
195
|
+
openIncubatorsDialog && (React.createElement(BaseDialog, { title: React.createElement(FormattedMessage, { id: "ui.IncubatorSuggestion.title", defaultMessage: "ui.IncubatorSuggestion.title" }), onClose: () => setOpenIncubatorsDialog(false), open: openIncubatorsDialog }, state.isLoadingNext ? (React.createElement(CentralProgress, { size: 50 })) : (React.createElement(InfiniteScroll, { dataLength: state.results.length, next: fetchIncubatorSuggestion, hasMoreNext: Boolean(state.next), loaderNext: React.createElement(CentralProgress, { size: 30 }), height: isMobile ? '100vh' : 400, endMessage: React.createElement("p", { style: { textAlign: 'center' } },
|
|
184
196
|
React.createElement("b", null,
|
|
185
197
|
React.createElement(FormattedMessage, { id: "ui.IncubatorSuggestion.noMoreIncubators", defaultMessage: "ui.IncubatorSuggestion.noMoreIncubators" }))) },
|
|
186
|
-
React.createElement(List, null,
|
|
198
|
+
React.createElement(List, null, state.results.map((i) => (React.createElement(ListItem, { key: i.id, sx: { display: 'block', padding: 0 } },
|
|
187
199
|
React.createElement(Incubator, Object.assign({ elevation: 0, incubator: i, className: classes.incubatorItem, subscribeButtonProps: { onSubscribe: handleSubscriptionsUpdate }, ButtonProps: { onClick: () => handleIncubatorDetailDialogOpening(i) } }, IncubatorProps)))))))))),
|
|
188
200
|
openIncubatorDetailDialog && (React.createElement(IncubatorDetail, { open: openIncubatorDetailDialog, onClose: handleIncubatorDetailDialogClose, incubator: detailObj, onSubscriptionsUpdate: handleSubscriptionsUpdate }))));
|
|
189
201
|
/**
|
|
190
202
|
* Renders root object (if results and autoHide prop is set to false, otherwise component is hidden)
|
|
191
203
|
*/
|
|
192
|
-
if (autoHide && !
|
|
204
|
+
if (autoHide && !state.count) {
|
|
193
205
|
return React.createElement(HiddenPlaceholder, null);
|
|
194
206
|
}
|
|
195
207
|
if (scUserContext.user) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncubatorSuggestion.js","sourceRoot":"","sources":["../../../../src/components/IncubatorSuggestion/IncubatorSuggestion.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IncubatorSuggestion.js","sourceRoot":"","sources":["../../../../src/components/IncubatorSuggestion/IncubatorSuggestion.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,M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
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
1
2
|
import { IncubatorProps } from '../Incubator';
|
|
2
|
-
import { VirtualScrollerItemProps } from
|
|
3
|
+
import { VirtualScrollerItemProps } from '../../types/virtualScroller';
|
|
3
4
|
export interface IncubatorsListProps extends VirtualScrollerItemProps {
|
|
4
5
|
/**
|
|
5
6
|
* Hides this component
|
|
@@ -16,6 +17,11 @@ export interface IncubatorsListProps extends VirtualScrollerItemProps {
|
|
|
16
17
|
* @default {}
|
|
17
18
|
*/
|
|
18
19
|
IncubatorProps?: IncubatorProps;
|
|
20
|
+
/**
|
|
21
|
+
* Caching strategies
|
|
22
|
+
* @default CacheStrategies.CACHE_FIRST
|
|
23
|
+
*/
|
|
24
|
+
cacheStrategy?: CacheStrategies;
|
|
19
25
|
/**
|
|
20
26
|
* Other props
|
|
21
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncubatorsList.d.ts","sourceRoot":"","sources":["../../../../src/components/IncubatorsList/IncubatorsList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IncubatorsList.d.ts","sourceRoot":"","sources":["../../../../src/components/IncubatorsList/IncubatorsList.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,eAAe,EAAS,MAAM,sBAAsB,CAAC;AAS7D,OAAkB,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAOvD,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AA0CrE,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB;IACnE;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AACD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAiQhF"}
|
|
@@ -9,12 +9,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import React, { useEffect, useState } from 'react';
|
|
12
|
+
import React, { useEffect, useMemo, useReducer, useState } from 'react';
|
|
13
13
|
import { styled } from '@mui/material/styles';
|
|
14
14
|
import { Button, List, Typography, Box, IconButton, ListItem } from '@mui/material';
|
|
15
15
|
import CardContent from '@mui/material/CardContent';
|
|
16
16
|
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
17
|
-
import { Logger } from '@selfcommunity/utils';
|
|
17
|
+
import { CacheStrategies, Logger } from '@selfcommunity/utils';
|
|
18
18
|
import Skeleton from './Skeleton';
|
|
19
19
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
20
20
|
import { FormattedMessage } from 'react-intl';
|
|
@@ -29,6 +29,8 @@ import { useThemeProps } from '@mui/system';
|
|
|
29
29
|
import Widget from '../Widget';
|
|
30
30
|
import CreateIncubatorDialog from './CreateIncubatorDialog';
|
|
31
31
|
import IncubatorDetail from '../IncubatorDetail';
|
|
32
|
+
import { actionToolsTypes, dataToolsReducer, stateToolsInitializer } from '../../utils/tools';
|
|
33
|
+
import { SCCache, useIsComponentMountedRef } from '@selfcommunity/react-core';
|
|
32
34
|
const PREFIX = 'SCIncubatorsList';
|
|
33
35
|
const classes = {
|
|
34
36
|
root: `${PREFIX}-root`,
|
|
@@ -97,17 +99,19 @@ export default function IncubatorsList(inProps) {
|
|
|
97
99
|
props: inProps,
|
|
98
100
|
name: PREFIX
|
|
99
101
|
});
|
|
100
|
-
const { autoHide = true, className, IncubatorProps = {} } = props, rest = __rest(props, ["autoHide", "className", "IncubatorProps"]);
|
|
102
|
+
const { autoHide = true, className, IncubatorProps = {}, cacheStrategy = CacheStrategies.NETWORK_ONLY, onHeightChange, onStateChange } = props, rest = __rest(props, ["autoHide", "className", "IncubatorProps", "cacheStrategy", "onHeightChange", "onStateChange"]);
|
|
103
|
+
// REFS
|
|
104
|
+
const isMountedRef = useIsComponentMountedRef();
|
|
101
105
|
// STATE
|
|
102
|
-
const [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
const [state, dispatch] = useReducer(dataToolsReducer, {
|
|
107
|
+
isLoadingNext: true,
|
|
108
|
+
next: `${Endpoints.GetAllIncubators.url()}?limit=10`,
|
|
109
|
+
cacheKey: SCCache.getToolsStateCacheKey(SCCache.INCUBATORS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY),
|
|
110
|
+
cacheStrategy
|
|
111
|
+
}, stateToolsInitializer);
|
|
107
112
|
const [openIncubatorsDialog, setOpenIncubatorsDialog] = useState(false);
|
|
108
113
|
const [openCreateIncubatorDialog, setOpenCreateIncubatorDialog] = useState(false);
|
|
109
114
|
const [openIncubatorDetailDialog, setOpenIncubatorDetailDialog] = useState(false);
|
|
110
|
-
const [next, setNext] = useState(`${Endpoints.GetAllIncubators.url()}?limit=10`);
|
|
111
115
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
112
116
|
const isOpen = Boolean(anchorEl);
|
|
113
117
|
const [detailObj, setDetailObj] = useState(null);
|
|
@@ -132,39 +136,52 @@ export default function IncubatorsList(inProps) {
|
|
|
132
136
|
/**
|
|
133
137
|
* Fetches incubators list
|
|
134
138
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
const fetchIncubators = useMemo(() => () => {
|
|
140
|
+
return http.request({
|
|
141
|
+
url: state.next,
|
|
142
|
+
method: Endpoints.GetAllIncubators.method
|
|
143
|
+
});
|
|
144
|
+
}, [dispatch, state.next, state.isLoadingNext]);
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (cacheStrategy === CacheStrategies.NETWORK_ONLY) {
|
|
147
|
+
onStateChange && onStateChange({ cacheStrategy: CacheStrategies.CACHE_FIRST });
|
|
148
|
+
}
|
|
149
|
+
}, []);
|
|
150
|
+
/**
|
|
151
|
+
* On mount, fetches incubators list
|
|
152
|
+
*/
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
let ignore = false;
|
|
155
|
+
if (state.next) {
|
|
156
|
+
fetchIncubators()
|
|
142
157
|
.then((res) => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
158
|
+
if (res.status < 300 && isMountedRef.current && !ignore) {
|
|
159
|
+
const data = res.data;
|
|
160
|
+
dispatch({
|
|
161
|
+
type: actionToolsTypes.LOAD_NEXT_SUCCESS,
|
|
162
|
+
payload: {
|
|
163
|
+
results: data.results,
|
|
164
|
+
count: data.count,
|
|
165
|
+
next: data.next
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
149
169
|
})
|
|
150
170
|
.catch((error) => {
|
|
151
|
-
|
|
171
|
+
dispatch({ type: actionToolsTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
152
172
|
Logger.error(SCOPE_SC_UI, error);
|
|
153
173
|
});
|
|
174
|
+
return () => {
|
|
175
|
+
ignore = true;
|
|
176
|
+
};
|
|
154
177
|
}
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* On mount, fetches incubators list
|
|
158
|
-
*/
|
|
159
|
-
useEffect(() => {
|
|
160
|
-
fetchIncubators();
|
|
161
|
-
}, []);
|
|
178
|
+
}, [state.next]);
|
|
162
179
|
/**
|
|
163
180
|
* Handles subscriptions counter update on subscribe/unsubscribe action.
|
|
164
181
|
* @param incubator
|
|
165
182
|
*/
|
|
166
183
|
function handleSubscriptionsUpdate(incubator) {
|
|
167
|
-
const newIncubators = [...
|
|
184
|
+
const newIncubators = [...state.results];
|
|
168
185
|
const index = newIncubators.findIndex((i) => i.id === incubator.id);
|
|
169
186
|
if (index !== -1) {
|
|
170
187
|
if (incubator.subscribed) {
|
|
@@ -175,13 +192,19 @@ export default function IncubatorsList(inProps) {
|
|
|
175
192
|
newIncubators[index].subscribers_count = incubator.subscribers_count + 1;
|
|
176
193
|
newIncubators[index].subscribed = !incubator.subscribed;
|
|
177
194
|
}
|
|
178
|
-
|
|
195
|
+
dispatch({
|
|
196
|
+
type: actionToolsTypes.SET_RESULTS,
|
|
197
|
+
payload: { results: newIncubators }
|
|
198
|
+
});
|
|
179
199
|
}
|
|
180
200
|
}
|
|
181
201
|
/**
|
|
182
202
|
* Renders incubators list
|
|
183
203
|
*/
|
|
184
|
-
|
|
204
|
+
if (state.isLoadingNext) {
|
|
205
|
+
return React.createElement(Skeleton, { elevation: 0 });
|
|
206
|
+
}
|
|
207
|
+
const c = (React.createElement(CardContent, null,
|
|
185
208
|
React.createElement(Box, { className: classes.header },
|
|
186
209
|
React.createElement(Typography, { className: classes.title, variant: 'h5' },
|
|
187
210
|
React.createElement(FormattedMessage, { id: "ui.incubatorsList.title", defaultMessage: "ui.incubatorsList.title" })),
|
|
@@ -194,26 +217,26 @@ export default function IncubatorsList(inProps) {
|
|
|
194
217
|
React.createElement(Box, { sx: { p: '10px' } },
|
|
195
218
|
React.createElement(Typography, { component: 'span', sx: { whiteSpace: 'pre-line' } },
|
|
196
219
|
React.createElement(FormattedMessage, { id: "ui.incubatorsList.popover", defaultMessage: "ui.incubatorsList.popover" })))))),
|
|
197
|
-
!
|
|
220
|
+
!state.count ? (React.createElement(Typography, { className: classes.noResults, variant: "body2" },
|
|
198
221
|
React.createElement(FormattedMessage, { id: "ui.incubatorsList.noResults", defaultMessage: "ui.incubatorsList.noResults" }))) : (React.createElement(React.Fragment, null,
|
|
199
|
-
React.createElement(List, null,
|
|
222
|
+
React.createElement(List, null, state.results.slice(0, limit).map((incubator) => (React.createElement(ListItem, { key: incubator.id },
|
|
200
223
|
React.createElement(Incubator, Object.assign({ elevation: 0, incubator: incubator, className: classes.incubatorItem, subscribeButtonProps: { onSubscribe: handleSubscriptionsUpdate }, ButtonProps: { onClick: () => handleIncubatorDetailDialogOpening(incubator) } }, IncubatorProps)))))),
|
|
201
224
|
React.createElement(Box, { className: classes.actions },
|
|
202
|
-
|
|
225
|
+
limit < state.count && (React.createElement(Button, { size: "small", onClick: () => setOpenIncubatorsDialog(true) },
|
|
203
226
|
React.createElement(FormattedMessage, { id: "ui.incubatorsList.ShowAll", defaultMessage: "ui.incubatorsList.ShowAll" }))),
|
|
204
227
|
React.createElement(Button, { size: "small", onClick: () => setOpenCreateIncubatorDialog(true) },
|
|
205
228
|
React.createElement(FormattedMessage, { id: "ui.incubatorsList.SuggestNewTopic", defaultMessage: "ui.incubatorsList.SuggestNewTopic" }))))),
|
|
206
|
-
openIncubatorsDialog && (React.createElement(BaseDialog, { title: React.createElement(FormattedMessage, { id: "ui.incubatorsList.title", defaultMessage: "ui.incubatorsList.title" }), onClose: () => setOpenIncubatorsDialog(false), open: openIncubatorsDialog },
|
|
229
|
+
openIncubatorsDialog && (React.createElement(BaseDialog, { title: React.createElement(FormattedMessage, { id: "ui.incubatorsList.title", defaultMessage: "ui.incubatorsList.title" }), onClose: () => setOpenIncubatorsDialog(false), open: openIncubatorsDialog }, state.isLoadingNext ? (React.createElement(CentralProgress, { size: 50 })) : (React.createElement(InfiniteScroll, { dataLength: state.results.length, next: fetchIncubators, hasMoreNext: Boolean(state.next), loaderNext: React.createElement(CentralProgress, { size: 30 }), height: 400, endMessage: React.createElement("p", { style: { textAlign: 'center' } },
|
|
207
230
|
React.createElement("b", null,
|
|
208
231
|
React.createElement(FormattedMessage, { id: "ui.incubatorsList.noMoreIncubators", defaultMessage: "ui.incubatorsList.noMoreIncubators" }))) },
|
|
209
|
-
React.createElement(List, null,
|
|
232
|
+
React.createElement(List, null, state.results.map((i) => (React.createElement(ListItem, { key: i.id, sx: { display: 'block', padding: 0 } },
|
|
210
233
|
React.createElement(Incubator, Object.assign({ elevation: 0, incubator: i, className: classes.incubatorItem, subscribeButtonProps: { onSubscribe: handleSubscriptionsUpdate }, ButtonProps: { onClick: () => handleIncubatorDetailDialogOpening(i) } }, IncubatorProps)))))))))),
|
|
211
234
|
openCreateIncubatorDialog && React.createElement(CreateIncubatorDialog, { open: openCreateIncubatorDialog, onClose: handleCreateIncubatorDialogClose }),
|
|
212
|
-
openIncubatorDetailDialog && (React.createElement(IncubatorDetail, { open: openIncubatorDetailDialog, onClose: handleIncubatorDetailDialogClose, incubator: detailObj, onSubscriptionsUpdate: handleSubscriptionsUpdate }))))
|
|
235
|
+
openIncubatorDetailDialog && (React.createElement(IncubatorDetail, { open: openIncubatorDetailDialog, onClose: handleIncubatorDetailDialogClose, incubator: detailObj, onSubscriptionsUpdate: handleSubscriptionsUpdate }))));
|
|
213
236
|
/**
|
|
214
237
|
* Renders root object (if results and autoHide prop is set to false, otherwise component is hidden)
|
|
215
238
|
*/
|
|
216
|
-
if (autoHide && !
|
|
239
|
+
if (autoHide && !state.count) {
|
|
217
240
|
return null;
|
|
218
241
|
}
|
|
219
242
|
return (React.createElement(Root, Object.assign({ className: classNames(classes.root, className) }, rest), c));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncubatorsList.js","sourceRoot":"","sources":["../../../../src/components/IncubatorsList/IncubatorsList.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IncubatorsList.js","sourceRoot":"","sources":["../../../../src/components/IncubatorsList/IncubatorsList.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACtE,OAAO,EAAC,MAAM,EAAC,MAA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AyB,EAAE,OAAO,EAAE,gCAAgC,GAAI;QAClI,yBAAyB,IAAI,CAC5B,oBAAC,eAAe,IACd,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,gCAAgC,EACzC,SAAS,EAAE,SAAS,EACpB,qBAAqB,EAAE,yBAAyB,GAChD,CACH,CACW,CACf,CAAC;IAEF;;OAEG;IACH,IAAI,QAAQ,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;QAC5B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,oBAAC,IAAI,kBAAC,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,IAAM,IAAI,GAC3D,CAAC,CACG,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { CardProps } from '@mui/material';
|
|
2
2
|
import { SCPrivateMessageType } from '@selfcommunity/types';
|
|
3
3
|
export interface MessageProps extends Pick<CardProps, Exclude<keyof CardProps, 'id'>> {
|
|
4
|
-
/**
|
|
5
|
-
* Id of message object
|
|
6
|
-
* @default null
|
|
7
|
-
*/
|
|
8
|
-
id?: number;
|
|
9
4
|
/**
|
|
10
5
|
* Overrides or extends the styles applied to the component.
|
|
11
6
|
* @default null
|
|
@@ -42,25 +37,15 @@ export interface MessageProps extends Pick<CardProps, Exclude<keyof CardProps, '
|
|
|
42
37
|
*/
|
|
43
38
|
isHovering?: () => void;
|
|
44
39
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @default
|
|
40
|
+
* Delete icon showed only for messages sent by logged user
|
|
41
|
+
* @default false
|
|
47
42
|
*/
|
|
48
|
-
|
|
43
|
+
showDeleteIcon?: boolean;
|
|
49
44
|
/**
|
|
50
45
|
* Action triggered on delete icon click
|
|
51
46
|
* @default null
|
|
52
47
|
*/
|
|
53
48
|
onDeleteIconClick?: () => void;
|
|
54
|
-
/**
|
|
55
|
-
* Callback fired on touch hover
|
|
56
|
-
* @default null
|
|
57
|
-
*/
|
|
58
|
-
onTouchStart?: () => void;
|
|
59
|
-
/**
|
|
60
|
-
* Callback fired on touch leave
|
|
61
|
-
* @default null
|
|
62
|
-
*/
|
|
63
|
-
onTouchEnd?: () => void;
|
|
64
49
|
}
|
|
65
50
|
/**
|
|
66
51
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../../src/components/Message/Message.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiD,SAAS,EAA8B,MAAM,eAAe,CAAC;AAGrH,OAAO,EAAC,oBAAoB,EAAoB,MAAM,sBAAsB,CAAC;AA2D7E,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,SAAS,EAAE,IAAI,CAAC,CAAC;IACnF;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../../src/components/Message/Message.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiD,SAAS,EAA8B,MAAM,eAAe,CAAC;AAGrH,OAAO,EAAC,oBAAoB,EAAoB,MAAM,sBAAsB,CAAC;AA2D7E,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,SAAS,EAAE,IAAI,CAAC,CAAC;IACnF;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO,CA6KlE"}
|
|
@@ -108,7 +108,7 @@ export default function Message(inProps) {
|
|
|
108
108
|
props: inProps,
|
|
109
109
|
name: PREFIX
|
|
110
110
|
});
|
|
111
|
-
const {
|
|
111
|
+
const { autoHide = false, message = null, className = null, snippetType = true, onMouseEnter = null, onMouseLeave = null, isHovering = null, showDeleteIcon = false, onDeleteIconClick = null } = props, rest = __rest(props, ["autoHide", "message", "className", "snippetType", "onMouseEnter", "onMouseLeave", "isHovering", "showDeleteIcon", "onDeleteIconClick"]);
|
|
112
112
|
// INTL
|
|
113
113
|
const intl = useIntl();
|
|
114
114
|
// STATE
|
|
@@ -157,34 +157,37 @@ export default function Message(inProps) {
|
|
|
157
157
|
return React.createElement(React.Fragment, null, section);
|
|
158
158
|
};
|
|
159
159
|
/**
|
|
160
|
-
* Renders
|
|
160
|
+
* Renders thread type message object
|
|
161
161
|
*/
|
|
162
|
-
const
|
|
163
|
-
React.createElement(ListItem,
|
|
164
|
-
|
|
165
|
-
React.createElement(ListItemText, { primary: React.createElement(Box, { className: classes.info },
|
|
166
|
-
scUserContext['user'] && scUserContext['user'].username === message.receiver.username ? (React.createElement(Typography, { component: "span" }, message.sender.username)) : (React.createElement(Typography, { component: "span" }, message.receiver.username)),
|
|
167
|
-
React.createElement(Typography, { component: "span" }, `${intl.formatDate(message.last_message_at, {
|
|
168
|
-
weekday: 'long',
|
|
169
|
-
day: 'numeric'
|
|
170
|
-
})}`)), secondary: React.createElement(Box, { component: "span", className: classes.info },
|
|
171
|
-
React.createElement(Typography, { component: "span", dangerouslySetInnerHTML: { __html: message.headline } }),
|
|
172
|
-
isNew && (React.createElement(Icon, { fontSize: "small", className: classes.unread }, "fiber_manual_record"))) })))) : (React.createElement(LazyLoad, { once: true, offset: DEFAULT_PRELOAD_OFFSET_VIEWPORT },
|
|
173
|
-
React.createElement(ListItem, { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onTouchStart: onTouchStart, onTouchMove: onTouchEnd },
|
|
174
|
-
!snippetType && isHovering && loggedUser === message.sender.id && message.status !== 'hidden' && (React.createElement(React.Fragment, null,
|
|
162
|
+
const threadMessage = (React.createElement(LazyLoad, { once: true, offset: DEFAULT_PRELOAD_OFFSET_VIEWPORT },
|
|
163
|
+
React.createElement(ListItem, { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onTouchStart: onMouseEnter, onTouchMove: onMouseLeave },
|
|
164
|
+
isHovering && showDeleteIcon && message.status !== 'hidden' && (React.createElement(React.Fragment, null,
|
|
175
165
|
React.createElement(IconButton, { sx: { marginBottom: '25px' }, onClick: onDeleteIconClick },
|
|
176
166
|
React.createElement(Icon, { fontSize: "small" }, "delete")))),
|
|
177
167
|
React.createElement(ListItemText, { primary: React.createElement(Box, { className: classes.messageBox }, hasFile ? renderMessageFile(message) : React.createElement(Typography, { component: "span", dangerouslySetInnerHTML: { __html: message.message } })), secondary: React.createElement(Box, { component: "span", className: classes.messageTime },
|
|
178
168
|
React.createElement(Typography, { component: "span" }, `${intl.formatDate(message.created_at, {
|
|
179
169
|
hour: 'numeric',
|
|
180
170
|
minute: 'numeric'
|
|
181
|
-
})}`)) }))))
|
|
171
|
+
})}`)) }))));
|
|
172
|
+
/**
|
|
173
|
+
* Renders snippet type message object
|
|
174
|
+
*/
|
|
175
|
+
const snippetMessage = (React.createElement(ListItem, null,
|
|
176
|
+
React.createElement(ListItemAvatar, null, scUserContext['user'] && scUserContext['user'].username === message.receiver.username ? (React.createElement(Avatar, { alt: message.sender.username, src: message.sender.avatar })) : (React.createElement(Avatar, { alt: message.receiver.username, src: message.receiver.avatar }))),
|
|
177
|
+
React.createElement(ListItemText, { primary: React.createElement(Box, { className: classes.info },
|
|
178
|
+
scUserContext['user'] && scUserContext['user'].username === message.receiver.username ? (React.createElement(Typography, { component: "span" }, message.sender.username)) : (React.createElement(Typography, { component: "span" }, message.receiver.username)),
|
|
179
|
+
React.createElement(Typography, { component: "span" }, `${intl.formatDate(message.last_message_at, {
|
|
180
|
+
weekday: 'long',
|
|
181
|
+
day: 'numeric'
|
|
182
|
+
})}`)), secondary: React.createElement(Box, { component: "span", className: classes.info },
|
|
183
|
+
React.createElement(Typography, { component: "span", dangerouslySetInnerHTML: { __html: message.headline } }),
|
|
184
|
+
isNew && (React.createElement(Icon, { fontSize: "small", className: classes.unread }, "fiber_manual_record"))) })));
|
|
182
185
|
/**
|
|
183
186
|
* Renders root object (if not hidden by autoHide prop)
|
|
184
187
|
*/
|
|
185
188
|
if (!autoHide) {
|
|
186
189
|
return (React.createElement(Root, Object.assign({ className: classNames(classes.root, className) }, rest),
|
|
187
|
-
React.createElement(List, null,
|
|
190
|
+
React.createElement(List, null, snippetType ? snippetMessage : threadMessage)));
|
|
188
191
|
}
|
|
189
192
|
return null;
|
|
190
193
|
}
|