@selfcommunity/react-ui 0.11.0-alpha.67 → 0.11.0-alpha.68
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/assets/checkout/general.d.ts +2 -0
- package/lib/cjs/assets/checkout/general.js +3 -0
- package/lib/cjs/assets/checkout/success.d.ts +2 -0
- package/lib/cjs/assets/checkout/success.js +3 -0
- package/lib/cjs/assets/custom/formazione.d.ts +2 -0
- package/lib/cjs/assets/custom/formazione.js +3 -0
- package/lib/cjs/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +20 -2
- package/lib/cjs/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.d.ts +61 -0
- package/lib/cjs/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +106 -0
- package/lib/cjs/components/AcceptRequestUserGroupButton/index.d.ts +3 -0
- package/lib/cjs/components/AcceptRequestUserGroupButton/index.js +5 -0
- package/lib/cjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/cjs/components/BottomNavigation/BottomNavigation.js +2 -2
- package/lib/cjs/components/BuyButton/BuyButton.d.ts +73 -0
- package/lib/cjs/components/BuyButton/BuyButton.js +196 -0
- package/lib/cjs/components/BuyButton/index.d.ts +3 -0
- package/lib/cjs/components/BuyButton/index.js +5 -0
- package/lib/cjs/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +5 -3
- package/lib/cjs/components/Category/Category.d.ts +5 -0
- package/lib/cjs/components/Category/Category.js +5 -5
- package/lib/cjs/components/CategoryFollowButton/CategoryFollowButton.d.ts +4 -0
- package/lib/cjs/components/CategoryFollowButton/CategoryFollowButton.js +32 -6
- package/lib/cjs/components/CategoryHeader/CategoryHeader.js +6 -1
- package/lib/cjs/components/CategoryTrendingUsersWidget/CategoryTrendingUsersWidget.js +9 -2
- package/lib/cjs/components/Checkout/Checkout.d.ts +14 -0
- package/lib/cjs/components/Checkout/Checkout.js +131 -0
- package/lib/cjs/components/Checkout/CheckoutHeaderInfoWidget.d.ts +8 -0
- package/lib/cjs/components/Checkout/CheckoutHeaderInfoWidget.js +34 -0
- package/lib/cjs/components/Checkout/Skeleton.d.ts +21 -0
- package/lib/cjs/components/Checkout/Skeleton.js +87 -0
- package/lib/cjs/components/Checkout/constants.d.ts +1 -0
- package/lib/cjs/components/Checkout/constants.js +4 -0
- package/lib/cjs/components/Checkout/index.d.ts +3 -0
- package/lib/cjs/components/Checkout/index.js +5 -0
- package/lib/cjs/components/CheckoutReturnDialog/CheckoutReturnDialog.d.ts +10 -0
- package/lib/cjs/components/CheckoutReturnDialog/CheckoutReturnDialog.js +171 -0
- package/lib/cjs/components/CheckoutReturnDialog/index.d.ts +3 -0
- package/lib/cjs/components/CheckoutReturnDialog/index.js +5 -0
- package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.d.ts +8 -0
- package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.js +69 -0
- package/lib/cjs/components/CommunityPaywalls/Skeleton.d.ts +27 -0
- package/lib/cjs/components/CommunityPaywalls/Skeleton.js +53 -0
- package/lib/cjs/components/CommunityPaywalls/constants.d.ts +1 -0
- package/lib/cjs/components/CommunityPaywalls/constants.js +4 -0
- package/lib/cjs/components/CommunityPaywalls/index.d.ts +4 -0
- package/lib/cjs/components/CommunityPaywalls/index.js +8 -0
- package/lib/cjs/components/Composer/Composer.d.ts +1 -0
- package/lib/cjs/components/Composer/Composer.js +82 -18
- package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +2 -2
- package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +2 -2
- package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +2 -2
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +20 -13
- package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.d.ts +9 -0
- package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +61 -0
- package/lib/cjs/components/Composer/Layer/ScheduledLayer/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Layer/ScheduledLayer/index.js +5 -0
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +2 -1
- package/lib/cjs/components/ConnectionUserButton/ConnectionUserButton.js +6 -0
- package/lib/cjs/components/Course/Course.d.ts +5 -0
- package/lib/cjs/components/Course/Course.js +3 -3
- package/lib/cjs/components/CourseDashboard/Header.d.ts +2 -2
- package/lib/cjs/components/CourseDashboard/Header.js +8 -1
- package/lib/cjs/components/CourseDashboard/Student.d.ts +2 -2
- package/lib/cjs/components/CourseDashboard/Student.js +15 -4
- package/lib/cjs/components/CourseForm/CourseForm.d.ts +5 -0
- package/lib/cjs/components/CourseForm/CourseForm.js +36 -5
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.d.ts +1 -6
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +9 -7
- package/lib/cjs/components/CreateCourseButton/CreateCourseButton.js +1 -1
- package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.d.ts +10 -0
- package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.js +144 -0
- package/lib/cjs/components/CreatePaymentProductForm/constants.d.ts +1 -0
- package/lib/cjs/components/CreatePaymentProductForm/constants.js +4 -0
- package/lib/cjs/components/CreatePaymentProductForm/index.d.ts +3 -0
- package/lib/cjs/components/CreatePaymentProductForm/index.js +5 -0
- package/lib/cjs/components/EditEventButton/EditEventButton.js +1 -0
- package/lib/cjs/components/Editor/Editor.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/HashtagNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/HashtagNode.js +4 -4
- package/lib/cjs/components/Editor/nodes/ImageNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -6
- package/lib/cjs/components/Editor/nodes/MentionNode.d.ts +1 -1
- package/lib/cjs/components/Editor/nodes/MentionNode.js +4 -4
- package/lib/cjs/components/Editor/plugins/ApiPlugin.d.ts +1 -1
- package/lib/cjs/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
- package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/cjs/components/Event/Event.d.ts +5 -0
- package/lib/cjs/components/Event/Event.js +2 -2
- package/lib/cjs/components/EventForm/EventForm.js +47 -16
- package/lib/cjs/components/EventForm/types.d.ts +8 -5
- package/lib/cjs/components/EventFormDialog/EventFormDialog.js +7 -1
- package/lib/cjs/components/EventHeader/EventHeader.js +12 -3
- package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +27 -4
- package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +1 -1
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +11 -2
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +23 -13
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +18 -7
- package/lib/cjs/components/Feed/Feed.d.ts +2 -2
- package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +2 -1
- package/lib/cjs/components/FeedObject/FeedObject.js +16 -6
- package/lib/cjs/components/FeedObject/Poll/Choice/Choice.js +1 -1
- package/lib/cjs/components/FeedObject/Poll/Poll.js +1 -1
- package/lib/cjs/components/Group/Group.d.ts +6 -1
- package/lib/cjs/components/Group/Group.js +3 -3
- package/lib/cjs/components/GroupForm/GroupForm.js +37 -7
- package/lib/cjs/components/GroupHeader/GroupHeader.js +10 -2
- package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +3 -1
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +7 -2
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +6 -4
- package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +4 -2
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -8
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +30 -8
- package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +3 -2
- package/lib/cjs/components/LiveStreamForm/types.d.ts +3 -3
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +1 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +1 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +1 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +2 -2
- package/lib/cjs/components/LiveStreamRoom/types.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.d.ts +1 -0
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +42 -4
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +6 -0
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +1 -1
- package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +28 -5
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +8 -3
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +1 -1
- package/lib/cjs/components/PaymentDetailDialog/PaymentDetailDialog.d.ts +6 -0
- package/lib/cjs/components/PaymentDetailDialog/PaymentDetailDialog.js +40 -0
- package/lib/cjs/components/PaymentDetailDialog/index.d.ts +3 -0
- package/lib/cjs/components/PaymentDetailDialog/index.js +5 -0
- package/lib/cjs/components/PaymentOrder/PaymentOrder.d.ts +10 -0
- package/lib/cjs/components/PaymentOrder/PaymentOrder.js +80 -0
- package/lib/cjs/components/PaymentOrder/Skeleton.d.ts +30 -0
- package/lib/cjs/components/PaymentOrder/Skeleton.js +61 -0
- package/lib/cjs/components/PaymentOrder/constants.d.ts +1 -0
- package/lib/cjs/components/PaymentOrder/constants.js +4 -0
- package/lib/cjs/components/PaymentOrder/index.d.ts +3 -0
- package/lib/cjs/components/PaymentOrder/index.js +5 -0
- package/lib/cjs/components/PaymentOrderPdfButton/PaymentOrderPdfButton.d.ts +52 -0
- package/lib/cjs/components/PaymentOrderPdfButton/PaymentOrderPdfButton.js +74 -0
- package/lib/cjs/components/PaymentOrderPdfButton/index.d.ts +3 -0
- package/lib/cjs/components/PaymentOrderPdfButton/index.js +5 -0
- package/lib/cjs/components/PaymentOrders/PaymentOrders.d.ts +17 -0
- package/lib/cjs/components/PaymentOrders/PaymentOrders.js +264 -0
- package/lib/cjs/components/PaymentOrders/index.d.ts +3 -0
- package/lib/cjs/components/PaymentOrders/index.js +5 -0
- package/lib/cjs/components/PaymentProduct/PaymentProduct.d.ts +18 -0
- package/lib/cjs/components/PaymentProduct/PaymentProduct.js +48 -0
- package/lib/cjs/components/PaymentProduct/Skeleton.d.ts +25 -0
- package/lib/cjs/components/PaymentProduct/Skeleton.js +55 -0
- package/lib/cjs/components/PaymentProduct/constants.d.ts +1 -0
- package/lib/cjs/components/PaymentProduct/constants.js +4 -0
- package/lib/cjs/components/PaymentProduct/index.d.ts +3 -0
- package/lib/cjs/components/PaymentProduct/index.js +5 -0
- package/lib/cjs/components/PaymentProductPrice/PaymentProductPrice.d.ts +15 -0
- package/lib/cjs/components/PaymentProductPrice/PaymentProductPrice.js +61 -0
- package/lib/cjs/components/PaymentProductPrice/Skeleton.d.ts +21 -0
- package/lib/cjs/components/PaymentProductPrice/Skeleton.js +46 -0
- package/lib/cjs/components/PaymentProductPrice/constants.d.ts +1 -0
- package/lib/cjs/components/PaymentProductPrice/constants.js +4 -0
- package/lib/cjs/components/PaymentProductPrice/index.d.ts +3 -0
- package/lib/cjs/components/PaymentProductPrice/index.js +5 -0
- package/lib/cjs/components/PaymentProducts/PaymentProducts.d.ts +11 -0
- package/lib/cjs/components/PaymentProducts/PaymentProducts.js +76 -0
- package/lib/cjs/components/PaymentProducts/Skeleton.d.ts +21 -0
- package/lib/cjs/components/PaymentProducts/Skeleton.js +46 -0
- package/lib/cjs/components/PaymentProducts/constants.d.ts +1 -0
- package/lib/cjs/components/PaymentProducts/constants.js +4 -0
- package/lib/cjs/components/PaymentProducts/index.d.ts +3 -0
- package/lib/cjs/components/PaymentProducts/index.js +5 -0
- package/lib/cjs/components/Paywalls/Paywalls.d.ts +10 -0
- package/lib/cjs/components/Paywalls/Paywalls.js +94 -0
- package/lib/cjs/components/Paywalls/Skeleton.d.ts +21 -0
- package/lib/cjs/components/Paywalls/Skeleton.js +46 -0
- package/lib/cjs/components/Paywalls/constants.d.ts +1 -0
- package/lib/cjs/components/Paywalls/constants.js +4 -0
- package/lib/cjs/components/Paywalls/index.d.ts +3 -0
- package/lib/cjs/components/Paywalls/index.js +5 -0
- package/lib/cjs/components/PaywallsConfigurator/PaywallsConfigurator.d.ts +13 -0
- package/lib/cjs/components/PaywallsConfigurator/PaywallsConfigurator.js +252 -0
- package/lib/cjs/components/PaywallsConfigurator/Skeleton.d.ts +21 -0
- package/lib/cjs/components/PaywallsConfigurator/Skeleton.js +46 -0
- package/lib/cjs/components/PaywallsConfigurator/constants.d.ts +5 -0
- package/lib/cjs/components/PaywallsConfigurator/constants.js +9 -0
- package/lib/cjs/components/PaywallsConfigurator/index.d.ts +4 -0
- package/lib/cjs/components/PaywallsConfigurator/index.js +8 -0
- package/lib/cjs/components/PaywallsDialog/PaywallsDialog.d.ts +8 -0
- package/lib/cjs/components/PaywallsDialog/PaywallsDialog.js +43 -0
- package/lib/cjs/components/PaywallsDialog/index.d.ts +3 -0
- package/lib/cjs/components/PaywallsDialog/index.js +5 -0
- package/lib/cjs/components/PdfPreview/PdfPreview.d.ts +8 -0
- package/lib/cjs/components/PdfPreview/PdfPreview.js +92 -0
- package/lib/cjs/components/PdfPreview/Skeleton.d.ts +5 -0
- package/lib/cjs/components/PdfPreview/Skeleton.js +38 -0
- package/lib/cjs/components/PdfPreview/index.d.ts +3 -0
- package/lib/cjs/components/PdfPreview/index.js +5 -0
- package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.d.ts +11 -0
- package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.js +63 -0
- package/lib/cjs/components/PdfPreviewDialog/index.d.ts +3 -0
- package/lib/cjs/components/PdfPreviewDialog/index.js +5 -0
- package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +2 -1
- package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +4 -4
- package/lib/cjs/components/ToastNotifications/ToastNotifications.js +2 -10
- package/lib/cjs/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.d.ts +41 -0
- package/lib/cjs/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.js +94 -0
- package/lib/cjs/components/UserAddPaymentMethodDialog/constants.d.ts +1 -0
- package/lib/cjs/components/UserAddPaymentMethodDialog/constants.js +4 -0
- package/lib/cjs/components/UserAddPaymentMethodDialog/index.d.ts +3 -0
- package/lib/cjs/components/UserAddPaymentMethodDialog/index.js +5 -0
- package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.d.ts +40 -0
- package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +143 -0
- package/lib/cjs/components/UserAddPaymentMethodForm/constants.d.ts +1 -0
- package/lib/cjs/components/UserAddPaymentMethodForm/constants.js +4 -0
- package/lib/cjs/components/UserAddPaymentMethodForm/index.d.ts +3 -0
- package/lib/cjs/components/UserAddPaymentMethodForm/index.js +5 -0
- package/lib/cjs/components/UserBillingInfo/Skeleton.d.ts +25 -0
- package/lib/cjs/components/UserBillingInfo/Skeleton.js +12 -0
- package/lib/cjs/components/UserBillingInfo/UserBillingInfo.d.ts +35 -0
- package/lib/cjs/components/UserBillingInfo/UserBillingInfo.js +492 -0
- package/lib/cjs/components/UserBillingInfo/constants.d.ts +1 -0
- package/lib/cjs/components/UserBillingInfo/constants.js +4 -0
- package/lib/cjs/components/UserBillingInfo/index.d.ts +4 -0
- package/lib/cjs/components/UserBillingInfo/index.js +8 -0
- package/lib/cjs/components/UserBillingInfo/reducer.d.ts +77 -0
- package/lib/cjs/components/UserBillingInfo/reducer.js +96 -0
- package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.d.ts +44 -0
- package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.js +85 -0
- package/lib/cjs/components/UserChangeAddressDialog/constants.d.ts +1 -0
- package/lib/cjs/components/UserChangeAddressDialog/constants.js +4 -0
- package/lib/cjs/components/UserChangeAddressDialog/index.d.ts +3 -0
- package/lib/cjs/components/UserChangeAddressDialog/index.js +5 -0
- package/lib/cjs/components/UserConnectionsRequestsSentWidget/UserConnectionsRequestsSentWidget.js +6 -6
- package/lib/cjs/components/UserConnectionsRequestsWidget/UserConnectionsRequestsWidget.js +5 -5
- package/lib/cjs/components/UserConnectionsWidget/UserConnectionsWidget.js +8 -5
- package/lib/cjs/components/UserCounters/UserCounters.js +20 -17
- package/lib/cjs/components/UserFollowedCategoriesWidget/UserFollowedCategoriesWidget.js +9 -6
- package/lib/cjs/components/UserPaymentMethods/Skeleton.d.ts +15 -0
- package/lib/cjs/components/UserPaymentMethods/Skeleton.js +49 -0
- package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.d.ts +19 -0
- package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.js +338 -0
- package/lib/cjs/components/UserPaymentMethods/constants.d.ts +1 -0
- package/lib/cjs/components/UserPaymentMethods/constants.js +4 -0
- package/lib/cjs/components/UserPaymentMethods/index.d.ts +4 -0
- package/lib/cjs/components/UserPaymentMethods/index.js +8 -0
- package/lib/cjs/components/UserPaymentMethodsPortal/Skeleton.d.ts +22 -0
- package/lib/cjs/components/UserPaymentMethodsPortal/Skeleton.js +37 -0
- package/lib/cjs/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.d.ts +44 -0
- package/lib/cjs/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.js +103 -0
- package/lib/cjs/components/UserPaymentMethodsPortal/constants.d.ts +1 -0
- package/lib/cjs/components/UserPaymentMethodsPortal/constants.js +4 -0
- package/lib/cjs/components/UserPaymentMethodsPortal/index.d.ts +4 -0
- package/lib/cjs/components/UserPaymentMethodsPortal/index.js +8 -0
- package/lib/cjs/components/UserSuggestionWidget/UserSuggestionWidget.js +7 -5
- package/lib/cjs/constants/Billing.d.ts +10 -0
- package/lib/cjs/constants/Billing.js +60 -0
- package/lib/cjs/constants/ContributionsActionsMenu.d.ts +1 -0
- package/lib/cjs/constants/ContributionsActionsMenu.js +2 -1
- package/lib/cjs/constants/Country.d.ts +5 -0
- package/lib/cjs/constants/Country.js +271 -0
- package/lib/cjs/constants/DefaultDrawerContent.d.ts +1 -0
- package/lib/cjs/constants/DefaultDrawerContent.js +4 -0
- package/lib/cjs/constants/Payments.d.ts +4 -0
- package/lib/cjs/constants/Payments.js +7 -0
- package/lib/cjs/index.d.ts +23 -1
- package/lib/cjs/index.js +54 -2
- package/lib/cjs/shared/AutoPlayer/index.d.ts +0 -5
- package/lib/cjs/shared/AutoPlayer/index.js +5 -4
- package/lib/cjs/shared/ContributionActionsMenu/index.d.ts +4 -0
- package/lib/cjs/shared/ContributionActionsMenu/index.js +56 -5
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.d.ts +1 -1
- package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.js +3 -1
- package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.d.ts +44 -0
- package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +53 -0
- package/lib/cjs/shared/HiddenPurchasableContent/index.d.ts +3 -0
- package/lib/cjs/shared/HiddenPurchasableContent/index.js +5 -0
- package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/cjs/shared/Media/File/DisplayComponent.d.ts +2 -1
- package/lib/cjs/shared/Media/File/DisplayComponent.js +58 -32
- package/lib/cjs/shared/Media/File/DocComponent.d.ts +10 -0
- package/lib/cjs/shared/Media/File/DocComponent.js +34 -0
- package/lib/cjs/shared/Media/File/PreviewComponent.d.ts +2 -2
- package/lib/cjs/shared/Media/File/PreviewComponent.js +15 -17
- package/lib/cjs/shared/Media/File/TriggerButton.js +14 -1
- package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/cjs/shared/Media/File/filter.d.ts +2 -2
- package/lib/cjs/shared/Media/File/filter.js +5 -1
- package/lib/cjs/shared/Media/File/index.js +2 -2
- package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
- package/lib/cjs/shared/Tags/index.js +7 -3
- package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/cjs/types/composer.d.ts +1 -1
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/cjs/types/index.js +5 -1
- package/lib/cjs/types/payment.d.ts +25 -0
- package/lib/cjs/types/payment.js +29 -0
- package/lib/cjs/utils/address.d.ts +10 -0
- package/lib/cjs/utils/address.js +24 -0
- package/lib/cjs/utils/checkout.d.ts +2 -0
- package/lib/cjs/utils/checkout.js +23 -0
- package/lib/cjs/utils/payment.d.ts +17 -0
- package/lib/cjs/utils/payment.js +69 -0
- package/lib/esm/assets/checkout/general.d.ts +2 -0
- package/lib/esm/assets/checkout/general.js +1 -0
- package/lib/esm/assets/checkout/success.d.ts +2 -0
- package/lib/esm/assets/checkout/success.js +1 -0
- package/lib/esm/assets/custom/formazione.d.ts +2 -0
- package/lib/esm/assets/custom/formazione.js +1 -0
- package/lib/esm/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +20 -2
- package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.d.ts +61 -0
- package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +103 -0
- package/lib/esm/components/AcceptRequestUserGroupButton/index.d.ts +3 -0
- package/lib/esm/components/AcceptRequestUserGroupButton/index.js +2 -0
- package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +2 -2
- package/lib/esm/components/BuyButton/BuyButton.d.ts +73 -0
- package/lib/esm/components/BuyButton/BuyButton.js +193 -0
- package/lib/esm/components/BuyButton/index.d.ts +3 -0
- package/lib/esm/components/BuyButton/index.js +2 -0
- package/lib/esm/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +6 -4
- package/lib/esm/components/Category/Category.d.ts +5 -0
- package/lib/esm/components/Category/Category.js +5 -5
- package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.d.ts +4 -0
- package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.js +34 -8
- package/lib/esm/components/CategoryHeader/CategoryHeader.js +7 -2
- package/lib/esm/components/CategoryTrendingUsersWidget/CategoryTrendingUsersWidget.js +9 -2
- package/lib/esm/components/Checkout/Checkout.d.ts +14 -0
- package/lib/esm/components/Checkout/Checkout.js +128 -0
- package/lib/esm/components/Checkout/CheckoutHeaderInfoWidget.d.ts +8 -0
- package/lib/esm/components/Checkout/CheckoutHeaderInfoWidget.js +30 -0
- package/lib/esm/components/Checkout/Skeleton.d.ts +21 -0
- package/lib/esm/components/Checkout/Skeleton.js +84 -0
- package/lib/esm/components/Checkout/constants.d.ts +1 -0
- package/lib/esm/components/Checkout/constants.js +1 -0
- package/lib/esm/components/Checkout/index.d.ts +3 -0
- package/lib/esm/components/Checkout/index.js +2 -0
- package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.d.ts +10 -0
- package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.js +168 -0
- package/lib/esm/components/CheckoutReturnDialog/index.d.ts +3 -0
- package/lib/esm/components/CheckoutReturnDialog/index.js +2 -0
- package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.d.ts +8 -0
- package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.js +66 -0
- package/lib/esm/components/CommunityPaywalls/Skeleton.d.ts +27 -0
- package/lib/esm/components/CommunityPaywalls/Skeleton.js +50 -0
- package/lib/esm/components/CommunityPaywalls/constants.d.ts +1 -0
- package/lib/esm/components/CommunityPaywalls/constants.js +1 -0
- package/lib/esm/components/CommunityPaywalls/index.d.ts +4 -0
- package/lib/esm/components/CommunityPaywalls/index.js +4 -0
- package/lib/esm/components/Composer/Composer.d.ts +1 -0
- package/lib/esm/components/Composer/Composer.js +82 -18
- package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +2 -2
- package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +2 -2
- package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +2 -2
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +20 -13
- package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.d.ts +9 -0
- package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +59 -0
- package/lib/esm/components/Composer/Layer/ScheduledLayer/index.d.ts +3 -0
- package/lib/esm/components/Composer/Layer/ScheduledLayer/index.js +2 -0
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +2 -1
- package/lib/esm/components/ConnectionUserButton/ConnectionUserButton.js +6 -0
- package/lib/esm/components/Course/Course.d.ts +5 -0
- package/lib/esm/components/Course/Course.js +3 -3
- package/lib/esm/components/CourseDashboard/Header.d.ts +2 -2
- package/lib/esm/components/CourseDashboard/Header.js +10 -3
- package/lib/esm/components/CourseDashboard/Student.d.ts +2 -2
- package/lib/esm/components/CourseDashboard/Student.js +19 -8
- package/lib/esm/components/CourseForm/CourseForm.d.ts +5 -0
- package/lib/esm/components/CourseForm/CourseForm.js +38 -7
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.d.ts +1 -6
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +9 -7
- package/lib/esm/components/CreateCourseButton/CreateCourseButton.js +1 -1
- package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.d.ts +10 -0
- package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.js +141 -0
- package/lib/esm/components/CreatePaymentProductForm/constants.d.ts +1 -0
- package/lib/esm/components/CreatePaymentProductForm/constants.js +1 -0
- package/lib/esm/components/CreatePaymentProductForm/index.d.ts +3 -0
- package/lib/esm/components/CreatePaymentProductForm/index.js +2 -0
- package/lib/esm/components/EditEventButton/EditEventButton.js +1 -0
- package/lib/esm/components/Editor/Editor.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/HashtagNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/HashtagNode.js +4 -4
- package/lib/esm/components/Editor/nodes/ImageNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/ImageNode.js +6 -6
- package/lib/esm/components/Editor/nodes/MentionNode.d.ts +1 -1
- package/lib/esm/components/Editor/nodes/MentionNode.js +4 -4
- package/lib/esm/components/Editor/plugins/ApiPlugin.d.ts +1 -1
- package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
- package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
- package/lib/esm/components/Event/Event.d.ts +5 -0
- package/lib/esm/components/Event/Event.js +2 -2
- package/lib/esm/components/EventForm/EventForm.js +49 -18
- package/lib/esm/components/EventForm/types.d.ts +8 -5
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +7 -1
- package/lib/esm/components/EventHeader/EventHeader.js +14 -5
- package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +28 -5
- package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +1 -1
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +11 -2
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +14 -4
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +20 -9
- package/lib/esm/components/Feed/Feed.d.ts +2 -2
- package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
- package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/esm/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +2 -1
- package/lib/esm/components/FeedObject/FeedObject.js +17 -7
- package/lib/esm/components/FeedObject/Poll/Choice/Choice.js +1 -1
- package/lib/esm/components/FeedObject/Poll/Poll.js +1 -1
- package/lib/esm/components/Group/Group.d.ts +6 -1
- package/lib/esm/components/Group/Group.js +3 -3
- package/lib/esm/components/GroupForm/GroupForm.js +39 -9
- package/lib/esm/components/GroupHeader/GroupHeader.js +12 -4
- package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +3 -1
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +7 -2
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +6 -4
- package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +6 -4
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -8
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +32 -10
- package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +3 -2
- package/lib/esm/components/LiveStreamForm/types.d.ts +3 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +1 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +1 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +1 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +2 -2
- package/lib/esm/components/LiveStreamRoom/types.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.d.ts +1 -0
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +44 -6
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +6 -0
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +1 -1
- package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +29 -6
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +8 -3
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +1 -1
- package/lib/esm/components/PaymentDetailDialog/PaymentDetailDialog.d.ts +6 -0
- package/lib/esm/components/PaymentDetailDialog/PaymentDetailDialog.js +37 -0
- package/lib/esm/components/PaymentDetailDialog/index.d.ts +3 -0
- package/lib/esm/components/PaymentDetailDialog/index.js +2 -0
- package/lib/esm/components/PaymentOrder/PaymentOrder.d.ts +10 -0
- package/lib/esm/components/PaymentOrder/PaymentOrder.js +77 -0
- package/lib/esm/components/PaymentOrder/Skeleton.d.ts +30 -0
- package/lib/esm/components/PaymentOrder/Skeleton.js +58 -0
- package/lib/esm/components/PaymentOrder/constants.d.ts +1 -0
- package/lib/esm/components/PaymentOrder/constants.js +1 -0
- package/lib/esm/components/PaymentOrder/index.d.ts +3 -0
- package/lib/esm/components/PaymentOrder/index.js +2 -0
- package/lib/esm/components/PaymentOrderPdfButton/PaymentOrderPdfButton.d.ts +52 -0
- package/lib/esm/components/PaymentOrderPdfButton/PaymentOrderPdfButton.js +71 -0
- package/lib/esm/components/PaymentOrderPdfButton/index.d.ts +3 -0
- package/lib/esm/components/PaymentOrderPdfButton/index.js +2 -0
- package/lib/esm/components/PaymentOrders/PaymentOrders.d.ts +17 -0
- package/lib/esm/components/PaymentOrders/PaymentOrders.js +261 -0
- package/lib/esm/components/PaymentOrders/index.d.ts +3 -0
- package/lib/esm/components/PaymentOrders/index.js +2 -0
- package/lib/esm/components/PaymentProduct/PaymentProduct.d.ts +18 -0
- package/lib/esm/components/PaymentProduct/PaymentProduct.js +45 -0
- package/lib/esm/components/PaymentProduct/Skeleton.d.ts +25 -0
- package/lib/esm/components/PaymentProduct/Skeleton.js +52 -0
- package/lib/esm/components/PaymentProduct/constants.d.ts +1 -0
- package/lib/esm/components/PaymentProduct/constants.js +1 -0
- package/lib/esm/components/PaymentProduct/index.d.ts +3 -0
- package/lib/esm/components/PaymentProduct/index.js +2 -0
- package/lib/esm/components/PaymentProductPrice/PaymentProductPrice.d.ts +15 -0
- package/lib/esm/components/PaymentProductPrice/PaymentProductPrice.js +58 -0
- package/lib/esm/components/PaymentProductPrice/Skeleton.d.ts +21 -0
- package/lib/esm/components/PaymentProductPrice/Skeleton.js +42 -0
- package/lib/esm/components/PaymentProductPrice/constants.d.ts +1 -0
- package/lib/esm/components/PaymentProductPrice/constants.js +1 -0
- package/lib/esm/components/PaymentProductPrice/index.d.ts +3 -0
- package/lib/esm/components/PaymentProductPrice/index.js +2 -0
- package/lib/esm/components/PaymentProducts/PaymentProducts.d.ts +11 -0
- package/lib/esm/components/PaymentProducts/PaymentProducts.js +73 -0
- package/lib/esm/components/PaymentProducts/Skeleton.d.ts +21 -0
- package/lib/esm/components/PaymentProducts/Skeleton.js +43 -0
- package/lib/esm/components/PaymentProducts/constants.d.ts +1 -0
- package/lib/esm/components/PaymentProducts/constants.js +1 -0
- package/lib/esm/components/PaymentProducts/index.d.ts +3 -0
- package/lib/esm/components/PaymentProducts/index.js +2 -0
- package/lib/esm/components/Paywalls/Paywalls.d.ts +10 -0
- package/lib/esm/components/Paywalls/Paywalls.js +91 -0
- package/lib/esm/components/Paywalls/Skeleton.d.ts +21 -0
- package/lib/esm/components/Paywalls/Skeleton.js +43 -0
- package/lib/esm/components/Paywalls/constants.d.ts +1 -0
- package/lib/esm/components/Paywalls/constants.js +1 -0
- package/lib/esm/components/Paywalls/index.d.ts +3 -0
- package/lib/esm/components/Paywalls/index.js +2 -0
- package/lib/esm/components/PaywallsConfigurator/PaywallsConfigurator.d.ts +13 -0
- package/lib/esm/components/PaywallsConfigurator/PaywallsConfigurator.js +249 -0
- package/lib/esm/components/PaywallsConfigurator/Skeleton.d.ts +21 -0
- package/lib/esm/components/PaywallsConfigurator/Skeleton.js +43 -0
- package/lib/esm/components/PaywallsConfigurator/constants.d.ts +5 -0
- package/lib/esm/components/PaywallsConfigurator/constants.js +6 -0
- package/lib/esm/components/PaywallsConfigurator/index.d.ts +4 -0
- package/lib/esm/components/PaywallsConfigurator/index.js +4 -0
- package/lib/esm/components/PaywallsDialog/PaywallsDialog.d.ts +8 -0
- package/lib/esm/components/PaywallsDialog/PaywallsDialog.js +40 -0
- package/lib/esm/components/PaywallsDialog/index.d.ts +3 -0
- package/lib/esm/components/PaywallsDialog/index.js +2 -0
- package/lib/esm/components/PdfPreview/PdfPreview.d.ts +8 -0
- package/lib/esm/components/PdfPreview/PdfPreview.js +88 -0
- package/lib/esm/components/PdfPreview/Skeleton.d.ts +5 -0
- package/lib/esm/components/PdfPreview/Skeleton.js +35 -0
- package/lib/esm/components/PdfPreview/index.d.ts +3 -0
- package/lib/esm/components/PdfPreview/index.js +2 -0
- package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.d.ts +11 -0
- package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.js +60 -0
- package/lib/esm/components/PdfPreviewDialog/index.d.ts +3 -0
- package/lib/esm/components/PdfPreviewDialog/index.js +2 -0
- package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +4 -3
- package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
- package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +4 -4
- package/lib/esm/components/ToastNotifications/ToastNotifications.js +2 -10
- package/lib/esm/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.d.ts +41 -0
- package/lib/esm/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.js +91 -0
- package/lib/esm/components/UserAddPaymentMethodDialog/constants.d.ts +1 -0
- package/lib/esm/components/UserAddPaymentMethodDialog/constants.js +1 -0
- package/lib/esm/components/UserAddPaymentMethodDialog/index.d.ts +3 -0
- package/lib/esm/components/UserAddPaymentMethodDialog/index.js +2 -0
- package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.d.ts +40 -0
- package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +140 -0
- package/lib/esm/components/UserAddPaymentMethodForm/constants.d.ts +1 -0
- package/lib/esm/components/UserAddPaymentMethodForm/constants.js +1 -0
- package/lib/esm/components/UserAddPaymentMethodForm/index.d.ts +3 -0
- package/lib/esm/components/UserAddPaymentMethodForm/index.js +2 -0
- package/lib/esm/components/UserBillingInfo/Skeleton.d.ts +25 -0
- package/lib/esm/components/UserBillingInfo/Skeleton.js +9 -0
- package/lib/esm/components/UserBillingInfo/UserBillingInfo.d.ts +35 -0
- package/lib/esm/components/UserBillingInfo/UserBillingInfo.js +490 -0
- package/lib/esm/components/UserBillingInfo/constants.d.ts +1 -0
- package/lib/esm/components/UserBillingInfo/constants.js +1 -0
- package/lib/esm/components/UserBillingInfo/index.d.ts +4 -0
- package/lib/esm/components/UserBillingInfo/index.js +4 -0
- package/lib/esm/components/UserBillingInfo/reducer.d.ts +77 -0
- package/lib/esm/components/UserBillingInfo/reducer.js +91 -0
- package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.d.ts +44 -0
- package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.js +82 -0
- package/lib/esm/components/UserChangeAddressDialog/constants.d.ts +1 -0
- package/lib/esm/components/UserChangeAddressDialog/constants.js +1 -0
- package/lib/esm/components/UserChangeAddressDialog/index.d.ts +3 -0
- package/lib/esm/components/UserChangeAddressDialog/index.js +2 -0
- package/lib/esm/components/UserConnectionsRequestsSentWidget/UserConnectionsRequestsSentWidget.js +6 -6
- package/lib/esm/components/UserConnectionsRequestsWidget/UserConnectionsRequestsWidget.js +5 -5
- package/lib/esm/components/UserConnectionsWidget/UserConnectionsWidget.js +8 -5
- package/lib/esm/components/UserCounters/UserCounters.js +20 -17
- package/lib/esm/components/UserFollowedCategoriesWidget/UserFollowedCategoriesWidget.js +11 -8
- package/lib/esm/components/UserPaymentMethods/Skeleton.d.ts +15 -0
- package/lib/esm/components/UserPaymentMethods/Skeleton.js +47 -0
- package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.d.ts +19 -0
- package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.js +336 -0
- package/lib/esm/components/UserPaymentMethods/constants.d.ts +1 -0
- package/lib/esm/components/UserPaymentMethods/constants.js +1 -0
- package/lib/esm/components/UserPaymentMethods/index.d.ts +4 -0
- package/lib/esm/components/UserPaymentMethods/index.js +4 -0
- package/lib/esm/components/UserPaymentMethodsPortal/Skeleton.d.ts +22 -0
- package/lib/esm/components/UserPaymentMethodsPortal/Skeleton.js +35 -0
- package/lib/esm/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.d.ts +44 -0
- package/lib/esm/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.js +100 -0
- package/lib/esm/components/UserPaymentMethodsPortal/constants.d.ts +1 -0
- package/lib/esm/components/UserPaymentMethodsPortal/constants.js +1 -0
- package/lib/esm/components/UserPaymentMethodsPortal/index.d.ts +4 -0
- package/lib/esm/components/UserPaymentMethodsPortal/index.js +4 -0
- package/lib/esm/components/UserSuggestionWidget/UserSuggestionWidget.js +7 -5
- package/lib/esm/constants/Billing.d.ts +10 -0
- package/lib/esm/constants/Billing.js +57 -0
- package/lib/esm/constants/ContributionsActionsMenu.d.ts +1 -0
- package/lib/esm/constants/ContributionsActionsMenu.js +1 -0
- package/lib/esm/constants/Country.d.ts +5 -0
- package/lib/esm/constants/Country.js +268 -0
- package/lib/esm/constants/DefaultDrawerContent.d.ts +1 -0
- package/lib/esm/constants/DefaultDrawerContent.js +1 -0
- package/lib/esm/constants/Payments.d.ts +4 -0
- package/lib/esm/constants/Payments.js +4 -0
- package/lib/esm/index.d.ts +23 -1
- package/lib/esm/index.js +23 -1
- package/lib/esm/shared/AutoPlayer/index.d.ts +0 -5
- package/lib/esm/shared/AutoPlayer/index.js +5 -4
- package/lib/esm/shared/ContributionActionsMenu/index.d.ts +4 -0
- package/lib/esm/shared/ContributionActionsMenu/index.js +58 -7
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.d.ts +1 -1
- package/lib/esm/shared/CourseUsersTable/SeeProgressButton.js +5 -3
- package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.d.ts +44 -0
- package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +50 -0
- package/lib/esm/shared/HiddenPurchasableContent/index.d.ts +3 -0
- package/lib/esm/shared/HiddenPurchasableContent/index.js +2 -0
- package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
- package/lib/esm/shared/Media/File/DisplayComponent.d.ts +2 -1
- package/lib/esm/shared/Media/File/DisplayComponent.js +60 -33
- package/lib/esm/shared/Media/File/DocComponent.d.ts +10 -0
- package/lib/esm/shared/Media/File/DocComponent.js +31 -0
- package/lib/esm/shared/Media/File/PreviewComponent.d.ts +2 -2
- package/lib/esm/shared/Media/File/PreviewComponent.js +17 -19
- package/lib/esm/shared/Media/File/TriggerButton.js +14 -1
- package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
- package/lib/esm/shared/Media/File/filter.d.ts +2 -2
- package/lib/esm/shared/Media/File/filter.js +2 -1
- package/lib/esm/shared/Media/File/index.js +2 -2
- package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
- package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
- package/lib/esm/shared/StickyBox/index.d.ts +4 -4
- package/lib/esm/shared/Tags/index.js +7 -3
- package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
- package/lib/esm/types/composer.d.ts +1 -1
- package/lib/esm/types/index.d.ts +2 -1
- package/lib/esm/types/index.js +2 -1
- package/lib/esm/types/payment.d.ts +25 -0
- package/lib/esm/types/payment.js +26 -0
- package/lib/esm/utils/address.d.ts +10 -0
- package/lib/esm/utils/address.js +19 -0
- package/lib/esm/utils/checkout.d.ts +2 -0
- package/lib/esm/utils/checkout.js +19 -0
- package/lib/esm/utils/payment.d.ts +17 -0
- package/lib/esm/utils/payment.js +62 -0
- package/lib/umd/{c473ce30406a3dad83e1.eot → 30b299174b4fa1fb9ce8.eot} +0 -0
- package/lib/umd/362.js +2 -0
- package/lib/umd/{ba74e493633796d551d1.ttf → 3b49304a98beb1239bc7.ttf} +0 -0
- package/lib/umd/ab247f43e550f5f6d0f8.woff2 +0 -0
- package/lib/umd/assets/icons.svg +75 -69
- package/lib/umd/{b6dbec3d5816ff8baef1.woff → ce10db0c87e7112cb315.woff} +0 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +15 -8
- package/lib/umd/578.js +0 -2
- package/lib/umd/60a7fdeaadfe844bc015.woff2 +0 -0
- /package/lib/umd/{578.js.LICENSE.txt → 362.js.LICENSE.txt} +0 -0
|
@@ -12,9 +12,9 @@ import ConfirmDialog from '../ConfirmDialog/ConfirmDialog';
|
|
|
12
12
|
import { Badge, Box, CircularProgress, ClickAwayListener, Collapse, Divider, Grow, IconButton, ListItemIcon, ListItemText, MenuItem, MenuList, Paper, SwipeableDrawer, Typography, useMediaQuery, useTheme, styled, Popper, Icon } from '@mui/material';
|
|
13
13
|
import { MODERATION_CONTRIBUTION_STATE_DELETED, MODERATION_CONTRIBUTION_STATE_HIDDEN, MODERATION_TYPE_ACTION_DELETE, MODERATION_TYPE_ACTION_HIDE, REPORT_AGGRESSIVE, REPORT_OFFTOPIC, REPORT_POORCONTENT, REPORT_SPAM, REPORT_VULGAR, REPORTS } from '../../constants/Flagging';
|
|
14
14
|
import { Endpoints, http } from '@selfcommunity/api-services';
|
|
15
|
-
import { SCContext, SCUserContext, UserUtils, useSCFetchCommentObject, useSCFetchFeedObject, useSCRouting } from '@selfcommunity/react-core';
|
|
15
|
+
import { SCContext, SCPreferences, SCUserContext, UserUtils, useSCFetchCommentObject, useSCFetchFeedObject, useSCPreferences, useSCRouting } from '@selfcommunity/react-core';
|
|
16
16
|
import { SCContributionType } from '@selfcommunity/types';
|
|
17
|
-
import { DELETE_CONTRIBUTION, DELETE_CONTRIBUTION_SECTION, EDIT_CONTRIBUTION, FLAG_CONTRIBUTION_SECTION, GENERAL_SECTION, GET_CONTRIBUTION_PERMALINK, HIDE_CONTRIBUTION_SECTION, MODERATE_CONTRIBUTION_DELETED, MODERATE_CONTRIBUTION_HIDDEN, RESTORE_CONTRIBUTION, SUSPEND_NOTIFICATION_CONTRIBUTION, SUSPEND_NOTIFICATION_EVENT } from '../../constants/ContributionsActionsMenu';
|
|
17
|
+
import { DELETE_CONTRIBUTION, DELETE_CONTRIBUTION_SECTION, EDIT_CONTRIBUTION, FLAG_CONTRIBUTION_SECTION, GENERAL_SECTION, GET_CONTRIBUTION_PERMALINK, HIDE_CONTRIBUTION_SECTION, MODERATE_CONTRIBUTION_DELETED, MODERATE_CONTRIBUTION_HIDDEN, PUBLISH_CONTRIBUTION, RESTORE_CONTRIBUTION, SUSPEND_NOTIFICATION_CONTRIBUTION, SUSPEND_NOTIFICATION_EVENT } from '../../constants/ContributionsActionsMenu';
|
|
18
18
|
const PREFIX = 'SCContributionActionsMenu';
|
|
19
19
|
const classes = {
|
|
20
20
|
root: `${PREFIX}-root`,
|
|
@@ -73,7 +73,7 @@ const messages = defineMessages({
|
|
|
73
73
|
});
|
|
74
74
|
export default function ContributionActionsMenu(props) {
|
|
75
75
|
// PROPS
|
|
76
|
-
const { className, feedObjectId, feedObject, feedObjectType = SCContributionType.POST, commentObjectId, commentObject, onFlagContribution, onEditContribution, onHideContribution, onDeleteContribution, onRestoreContribution, onSuspendNotificationContribution, onSuspendNotificationEvent, PopperProps = {} } = props, rest = __rest(props, ["className", "feedObjectId", "feedObject", "feedObjectType", "commentObjectId", "commentObject", "onFlagContribution", "onEditContribution", "onHideContribution", "onDeleteContribution", "onRestoreContribution", "onSuspendNotificationContribution", "onSuspendNotificationEvent", "PopperProps"]);
|
|
76
|
+
const { className, feedObjectId, feedObject, feedObjectType = SCContributionType.POST, commentObjectId, commentObject, onFlagContribution, onEditContribution, onHideContribution, onDeleteContribution, onRestoreContribution, onPublishContribution, onSuspendNotificationContribution, onSuspendNotificationEvent, PopperProps = {} } = props, rest = __rest(props, ["className", "feedObjectId", "feedObject", "feedObjectType", "commentObjectId", "commentObject", "onFlagContribution", "onEditContribution", "onHideContribution", "onDeleteContribution", "onRestoreContribution", "onPublishContribution", "onSuspendNotificationContribution", "onSuspendNotificationEvent", "PopperProps"]);
|
|
77
77
|
// INTL
|
|
78
78
|
const intl = useIntl();
|
|
79
79
|
// CONTEXT
|
|
@@ -84,6 +84,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
84
84
|
const scUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
85
85
|
const scRoutingContext = useSCRouting();
|
|
86
86
|
const { enqueueSnackbar } = useSnackbar();
|
|
87
|
+
const { preferences } = useSCPreferences();
|
|
87
88
|
// CONTRIBUTION STATE
|
|
88
89
|
const { obj: feedObj, setObj: setFeedObj } = useSCFetchFeedObject({ id: feedObjectId, feedObject, feedObjectType });
|
|
89
90
|
const { obj: commentObj, setObj: setCommentObj } = useSCFetchCommentObject({ id: commentObjectId, commentObject });
|
|
@@ -107,6 +108,9 @@ export default function ContributionActionsMenu(props) {
|
|
|
107
108
|
// CONST
|
|
108
109
|
const contributionObj = commentObj ? commentObj : feedObj;
|
|
109
110
|
let popperRef = useRef(null);
|
|
111
|
+
const scheduledPostsEnabled = useMemo(() => preferences &&
|
|
112
|
+
SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED in preferences &&
|
|
113
|
+
preferences[SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED].value, [preferences]);
|
|
110
114
|
/**
|
|
111
115
|
* Intial extra sections to render, in addition to the GENERAL_SECTION
|
|
112
116
|
* @return {array}
|
|
@@ -121,7 +125,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
121
125
|
_extra.push(FLAG_CONTRIBUTION_SECTION);
|
|
122
126
|
}
|
|
123
127
|
// Enable when backend is ready
|
|
124
|
-
if (UserUtils.
|
|
128
|
+
if (UserUtils.isAdmin(scUserContext.user) || UserUtils.isModerator(scUserContext.user)) {
|
|
125
129
|
// admin or moderator
|
|
126
130
|
_extra.push(HIDE_CONTRIBUTION_SECTION);
|
|
127
131
|
_extra.push(DELETE_CONTRIBUTION_SECTION);
|
|
@@ -332,6 +336,22 @@ export default function ContributionActionsMenu(props) {
|
|
|
332
336
|
return Promise.resolve(res.data);
|
|
333
337
|
});
|
|
334
338
|
}, [contributionObj]);
|
|
339
|
+
/**
|
|
340
|
+
* Perform publish contribution
|
|
341
|
+
*/
|
|
342
|
+
const performPublishContribution = useMemo(() => () => {
|
|
343
|
+
return http
|
|
344
|
+
.request({
|
|
345
|
+
url: Endpoints.PublishFeedObject.url({ type: contributionObj.type, id: contributionObj.id }),
|
|
346
|
+
method: Endpoints.PublishFeedObject.method
|
|
347
|
+
})
|
|
348
|
+
.then((res) => {
|
|
349
|
+
if (res.status >= 300) {
|
|
350
|
+
return Promise.reject(res);
|
|
351
|
+
}
|
|
352
|
+
return Promise.resolve(res.data);
|
|
353
|
+
});
|
|
354
|
+
}, [contributionObj]);
|
|
335
355
|
/**
|
|
336
356
|
* Fetch initial flag status
|
|
337
357
|
*/
|
|
@@ -468,6 +488,11 @@ export default function ContributionActionsMenu(props) {
|
|
|
468
488
|
setOpenConfirmDialog(true);
|
|
469
489
|
handleClose();
|
|
470
490
|
}
|
|
491
|
+
else if (action === PUBLISH_CONTRIBUTION) {
|
|
492
|
+
setCurrentAction(PUBLISH_CONTRIBUTION);
|
|
493
|
+
setOpenConfirmDialog(true);
|
|
494
|
+
handleClose();
|
|
495
|
+
}
|
|
471
496
|
else if (action === RESTORE_CONTRIBUTION) {
|
|
472
497
|
setCurrentAction(RESTORE_CONTRIBUTION);
|
|
473
498
|
setOpenConfirmDialog(true);
|
|
@@ -557,6 +582,19 @@ export default function ContributionActionsMenu(props) {
|
|
|
557
582
|
performPostConfirmAction(false);
|
|
558
583
|
});
|
|
559
584
|
}
|
|
585
|
+
else if (currentAction === PUBLISH_CONTRIBUTION) {
|
|
586
|
+
setCurrentActionLoading(PUBLISH_CONTRIBUTION);
|
|
587
|
+
performPublishContribution()
|
|
588
|
+
.then(() => {
|
|
589
|
+
const _contributionObj = Object.assign({}, contributionObj, { deleted: false });
|
|
590
|
+
onPublishContribution && onPublishContribution(_contributionObj);
|
|
591
|
+
performPostConfirmAction(true);
|
|
592
|
+
})
|
|
593
|
+
.catch((error) => {
|
|
594
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
595
|
+
performPostConfirmAction(false);
|
|
596
|
+
});
|
|
597
|
+
}
|
|
560
598
|
else if (currentAction === MODERATE_CONTRIBUTION_HIDDEN) {
|
|
561
599
|
setCurrentActionLoading(MODERATE_CONTRIBUTION_HIDDEN);
|
|
562
600
|
performModerationContribution(MODERATION_TYPE_ACTION_HIDE, hideFlagType)
|
|
@@ -680,7 +718,16 @@ export default function ContributionActionsMenu(props) {
|
|
|
680
718
|
* Can authenticated user delete the contribution
|
|
681
719
|
*/
|
|
682
720
|
function canDeleteContribution() {
|
|
683
|
-
return scUserContext.user && scUserContext.user.id === contributionObj.author.id
|
|
721
|
+
return scUserContext.user && scUserContext.user.id === contributionObj.author.id;
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Can authenticated user publish the contribution
|
|
725
|
+
*/
|
|
726
|
+
function canPublishContribution() {
|
|
727
|
+
const user = scUserContext.user;
|
|
728
|
+
if (!user || contributionObj.deleted || !scheduledPostsEnabled || !feedObj.draft)
|
|
729
|
+
return false;
|
|
730
|
+
return user.id === contributionObj.author.id || (scheduledPostsEnabled && (UserUtils.isAdmin(user) || UserUtils.isModerator(user)));
|
|
684
731
|
}
|
|
685
732
|
/**
|
|
686
733
|
* Can authenticated user suspend notification for the contribution
|
|
@@ -706,7 +753,7 @@ export default function ContributionActionsMenu(props) {
|
|
|
706
753
|
* Renders section general
|
|
707
754
|
*/
|
|
708
755
|
function renderGeneralSection() {
|
|
709
|
-
return (_jsxs(Box, { children: [_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "link" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.permanentLink", defaultMessage: "ui.contributionActionMenu.permanentLink" }), onClick: () => handleAction(GET_CONTRIBUTION_PERMALINK), classes: { root: classes.itemText } })] })), canModifyContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "edit" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.editContribution", defaultMessage: "ui.contributionActionMenu.editContribution" }), onClick: () => handleAction(EDIT_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canDeleteContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === DELETE_CONTRIBUTION || currentActionLoading === RESTORE_CONTRIBUTION ? (_jsx(CircularProgress, { size: 20 })) : (_jsx(Icon, { children: "delete" })) }), contributionObj.deleted ? (_jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.restoreContribution", defaultMessage: "ui.contributionActionMenu.restoreContribution" }), onClick: () => handleAction(RESTORE_CONTRIBUTION), classes: { root: classes.itemText } })) : (_jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.deleteContribution", defaultMessage: "ui.contributionActionMenu.deleteContribution" }), onClick: () => handleAction(DELETE_CONTRIBUTION), classes: { root: classes.itemText } }))] }))), canSuspendNotificationContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === SUSPEND_NOTIFICATION_CONTRIBUTION ? (_jsx(CircularProgress, { size: 20 })) : contributionObj['suspended'] ? (_jsx(Icon, { children: "notifications_active" })) : (_jsx(Icon, { children: "notifications_off" })) }), _jsx(ListItemText, { primary: contributionObj['suspended'] ? (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(SUSPEND_NOTIFICATION_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canSuspendNotificationEvent() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === SUSPEND_NOTIFICATION_EVENT ? (_jsx(CircularProgress, { size: 20 })) : contributionObj.event['show_on_feed'] ? (_jsx(Icon, { children: "notifications_active" })) : (_jsx(Icon, { children: "notifications_off" })) }), _jsx(ListItemText, { primary: !contributionObj.event['show_on_feed'] ? (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(SUSPEND_NOTIFICATION_EVENT), classes: { root: classes.itemText } })] })))] }, GENERAL_SECTION));
|
|
756
|
+
return (_jsxs(Box, { children: [_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "link" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.permanentLink", defaultMessage: "ui.contributionActionMenu.permanentLink" }), onClick: () => handleAction(GET_CONTRIBUTION_PERMALINK), classes: { root: classes.itemText } })] })), canModifyContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "edit" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.editContribution", defaultMessage: "ui.contributionActionMenu.editContribution" }), onClick: () => handleAction(EDIT_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canDeleteContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === DELETE_CONTRIBUTION || currentActionLoading === RESTORE_CONTRIBUTION ? (_jsx(CircularProgress, { size: 20 })) : (_jsx(Icon, { children: "delete" })) }), contributionObj.deleted ? (_jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.restoreContribution", defaultMessage: "ui.contributionActionMenu.restoreContribution" }), onClick: () => handleAction(RESTORE_CONTRIBUTION), classes: { root: classes.itemText } })) : (_jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.deleteContribution", defaultMessage: "ui.contributionActionMenu.deleteContribution" }), onClick: () => handleAction(DELETE_CONTRIBUTION), classes: { root: classes.itemText } }))] }))), canPublishContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, { children: "upload" }) }), _jsx(ListItemText, { primary: _jsx(FormattedMessage, { id: "ui.contributionActionMenu.publishContribution", defaultMessage: "ui.contributionActionMenu.publishContribution" }), onClick: () => handleAction(PUBLISH_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canSuspendNotificationContribution() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === SUSPEND_NOTIFICATION_CONTRIBUTION ? (_jsx(CircularProgress, { size: 20 })) : contributionObj['suspended'] ? (_jsx(Icon, { children: "notifications_active" })) : (_jsx(Icon, { children: "notifications_off" })) }), _jsx(ListItemText, { primary: contributionObj['suspended'] ? (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(SUSPEND_NOTIFICATION_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canSuspendNotificationEvent() && (_jsxs(MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [_jsx(ListItemIcon, { children: currentActionLoading === SUSPEND_NOTIFICATION_EVENT ? (_jsx(CircularProgress, { size: 20 })) : contributionObj.event['show_on_feed'] ? (_jsx(Icon, { children: "notifications_active" })) : (_jsx(Icon, { children: "notifications_off" })) }), _jsx(ListItemText, { primary: !contributionObj.event['show_on_feed'] ? (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(SUSPEND_NOTIFICATION_EVENT), classes: { root: classes.itemText } })] })))] }, GENERAL_SECTION));
|
|
710
757
|
}
|
|
711
758
|
/**
|
|
712
759
|
* Renders contribution menu content
|
|
@@ -729,5 +776,9 @@ export default function ContributionActionsMenu(props) {
|
|
|
729
776
|
? {
|
|
730
777
|
content: (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.deleteContributionInfo", defaultMessage: "ui.contributionActionMenu.deleteContributionInfo" }))
|
|
731
778
|
}
|
|
732
|
-
:
|
|
779
|
+
: currentAction === PUBLISH_CONTRIBUTION
|
|
780
|
+
? {
|
|
781
|
+
content: (_jsx(FormattedMessage, { id: "ui.contributionActionMenu.publishContributionInfo", defaultMessage: "ui.contributionActionMenu.publishContributionInfo" }))
|
|
782
|
+
}
|
|
783
|
+
: {}), { onConfirm: handleConfirmedAction, isUpdating: Boolean(currentActionLoading), onClose: () => setOpenConfirmDialog(false) })))] })));
|
|
733
784
|
}
|
|
@@ -2,7 +2,7 @@ import { Dispatch } from 'react';
|
|
|
2
2
|
import { SCCourseType } from '@selfcommunity/types';
|
|
3
3
|
import { EndpointType } from '@selfcommunity/api-services';
|
|
4
4
|
import { SCCourseUsersTableModeType } from '../../types/course';
|
|
5
|
-
type HeaderCellsType = {
|
|
5
|
+
declare type HeaderCellsType = {
|
|
6
6
|
id?: string;
|
|
7
7
|
};
|
|
8
8
|
export interface CourseUsersTableProps {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Avatar, Button, Icon, IconButton, Skeleton, Stack, styled, Typography, useMediaQuery, useTheme } from '@mui/material';
|
|
3
|
-
import { Fragment, memo, useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { Fragment, memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl';
|
|
5
5
|
import BaseDialog from '../BaseDialog';
|
|
6
|
-
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
6
|
+
import { Link, SCPreferences, SCRoutes, useSCPreferences, useSCRouting } from '@selfcommunity/react-core';
|
|
7
7
|
import { PREFIX } from './constants';
|
|
8
8
|
import AccordionLessons from '../AccordionLessons';
|
|
9
9
|
import { CourseService } from '@selfcommunity/api-services';
|
|
@@ -31,9 +31,11 @@ function SeeProgressButton(props) {
|
|
|
31
31
|
const [student, setStudent] = useState(null);
|
|
32
32
|
// CONTEXTS
|
|
33
33
|
const scRoutingContext = useSCRouting();
|
|
34
|
+
const { preferences } = useSCPreferences();
|
|
34
35
|
// HOOKS
|
|
35
36
|
const theme = useTheme();
|
|
36
37
|
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
38
|
+
const privateMessagingEnabled = useMemo(() => SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED in preferences && preferences[SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED].value, [preferences]);
|
|
37
39
|
// EFFECTS
|
|
38
40
|
useEffect(() => {
|
|
39
41
|
if (open && !student) {
|
|
@@ -48,6 +50,6 @@ function SeeProgressButton(props) {
|
|
|
48
50
|
}, [setOpen]);
|
|
49
51
|
return (_jsxs(Fragment, { children: [isMobile ? (_jsx(IconButton, Object.assign({ size: "small", color: "inherit", onClick: handleToggleOpen }, { children: _jsx(Icon, { children: "chevron_right" }) }))) : (_jsx(Button, Object.assign({ variant: "outlined", size: "small", color: "inherit", onClick: handleToggleOpen }, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.courseUsersTable.action.btn.label", defaultMessage: "ui.courseUsersTable.action.btn.label" }) })) }))), open && (_jsx(DialogRoot, Object.assign({ DialogContentProps: { dividers: isMobile }, open: true, scroll: "paper", onClose: handleToggleOpen, title: _jsx(Typography, Object.assign({ variant: "h3" }, { children: _jsx(FormattedMessage, { id: "ui.courseUsersTable.dialog.title", defaultMessage: "ui.courseUsersTable.dialog.title" }) })), className: classes.dialogRoot }, { children: _jsxs(Stack, Object.assign({ className: classes.contentWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.infoOuterWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.infoInnerWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.avatarWrapper }, { children: [_jsx(Link, Object.assign({}, (!course.created_by.deleted && {
|
|
50
52
|
to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, course.created_by)
|
|
51
|
-
}), { children: _jsx(UserAvatar, Object.assign({ hide: !course.created_by.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, src: user.avatar, alt: user.username }) })) })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: user.username }))] })), _jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, user), variant: "outlined", size: "small", color: "inherit" }, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.courseUsersTable.dialog.btn.label", defaultMessage: "ui.courseUsersTable.dialog.btn.label" }) })) }))] })), student ? (_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.courseUsersTable.dialog.info.text1", defaultMessage: "ui.courseUsersTable.dialog.info.text1", values: { lessonsCompleted: student.num_lessons_completed } }) }))) : (_jsx(Skeleton, { animation: "wave", variant: "text", width: "100px", height: "21px" })), student ? (_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.courseUsersTable.dialog.info.text2", defaultMessage: "ui.courseUsersTable.dialog.info.text2", values: { courseCompleted: student.user_completion_rate } }) }))) : (_jsx(Skeleton, { animation: "wave", variant: "text", width: "100px", height: "21px" }))] })), _jsx(AccordionLessons, { course: student, viewerJoinStatus: course.join_status })] })) })))] }));
|
|
53
|
+
}), { children: _jsx(UserAvatar, Object.assign({ hide: !course.created_by.community_badge, smaller: true }, { children: _jsx(Avatar, { className: classes.avatar, src: user.avatar, alt: user.username }) })) })), _jsx(Typography, Object.assign({ variant: "body1" }, { children: user.username }))] })), privateMessagingEnabled && (_jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, user), variant: "outlined", size: "small", color: "inherit" }, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.courseUsersTable.dialog.btn.label", defaultMessage: "ui.courseUsersTable.dialog.btn.label" }) })) })))] })), student ? (_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.courseUsersTable.dialog.info.text1", defaultMessage: "ui.courseUsersTable.dialog.info.text1", values: { lessonsCompleted: student.num_lessons_completed } }) }))) : (_jsx(Skeleton, { animation: "wave", variant: "text", width: "100px", height: "21px" })), student ? (_jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.courseUsersTable.dialog.info.text2", defaultMessage: "ui.courseUsersTable.dialog.info.text2", values: { courseCompleted: student.user_completion_rate } }) }))) : (_jsx(Skeleton, { animation: "wave", variant: "text", width: "100px", height: "21px" }))] })), _jsx(AccordionLessons, { course: student, viewerJoinStatus: course.join_status })] })) })))] }));
|
|
52
54
|
}
|
|
53
55
|
export default memo(SeeProgressButton);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WidgetProps } from '../../components/Widget';
|
|
3
|
+
export interface HiddenPurchasableContentProps extends Pick<WidgetProps, Exclude<keyof WidgetProps, 'id'>> {
|
|
4
|
+
/**
|
|
5
|
+
* Id of user object
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Title
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Content
|
|
15
|
+
*/
|
|
16
|
+
content?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Any other properties
|
|
19
|
+
*/
|
|
20
|
+
[p: string]: any;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* > API documentation for the Community-JS HiddenPurchasableContent component. Learn about the available props and the CSS API.
|
|
24
|
+
|
|
25
|
+
#### Import
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
import {HiddenPurchasableContent} from '@selfcommunity/react-ui';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Component Name
|
|
32
|
+
|
|
33
|
+
The name `HiddenPurchasableContent` can be used when providing style overrides in the theme.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
#### CSS
|
|
37
|
+
|
|
38
|
+
|Rule Name|Global class|Description|
|
|
39
|
+
|---|---|---|
|
|
40
|
+
|root|.SCHiddenPurchasableContent-root|Styles applied to the root element.|
|
|
41
|
+
|
|
42
|
+
* @param inProps
|
|
43
|
+
*/
|
|
44
|
+
export default function HiddenPurchasableContent(inProps: HiddenPurchasableContentProps): JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { Typography } from '@mui/material';
|
|
5
|
+
import Widget from '../../components/Widget';
|
|
6
|
+
import { useThemeProps } from '@mui/system';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import { FormattedMessage } from 'react-intl';
|
|
9
|
+
const PREFIX = 'SCHiddenPurchasableContent';
|
|
10
|
+
const classes = {
|
|
11
|
+
root: `${PREFIX}-root`,
|
|
12
|
+
header: `${PREFIX}-header`
|
|
13
|
+
};
|
|
14
|
+
const Root = styled(Widget, {
|
|
15
|
+
name: PREFIX,
|
|
16
|
+
slot: 'Root',
|
|
17
|
+
overridesResolver: (props, styles) => styles.root
|
|
18
|
+
})(({ theme }) => ({}));
|
|
19
|
+
/**
|
|
20
|
+
* > API documentation for the Community-JS HiddenPurchasableContent component. Learn about the available props and the CSS API.
|
|
21
|
+
|
|
22
|
+
#### Import
|
|
23
|
+
|
|
24
|
+
```jsx
|
|
25
|
+
import {HiddenPurchasableContent} from '@selfcommunity/react-ui';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### Component Name
|
|
29
|
+
|
|
30
|
+
The name `HiddenPurchasableContent` can be used when providing style overrides in the theme.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#### CSS
|
|
34
|
+
|
|
35
|
+
|Rule Name|Global class|Description|
|
|
36
|
+
|---|---|---|
|
|
37
|
+
|root|.SCHiddenPurchasableContent-root|Styles applied to the root element.|
|
|
38
|
+
|
|
39
|
+
* @param inProps
|
|
40
|
+
*/
|
|
41
|
+
export default function HiddenPurchasableContent(inProps) {
|
|
42
|
+
// PROPS
|
|
43
|
+
const props = useThemeProps({
|
|
44
|
+
props: inProps,
|
|
45
|
+
name: PREFIX
|
|
46
|
+
});
|
|
47
|
+
const { id = null, className = null, title, content, elevation } = props, rest = __rest(props, ["id", "className", "title", "content", "elevation"]);
|
|
48
|
+
// RENDER
|
|
49
|
+
return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest, { elevation: elevation }, { children: [_jsx(Typography, Object.assign({ variant: "h3", gutterBottom: true }, { children: _jsx("b", { children: title || _jsx(FormattedMessage, { id: "ui.shared.hiddenPurchasableContent.title", defaultMessage: "ui.shared.hiddenPurchasableContent.title" }) }) })), content || (_jsxs(Typography, Object.assign({ variant: "body1" }, { children: [_jsx(FormattedMessage, { id: "ui.shared.hiddenPurchasableContent.content", defaultMessage: "ui.shared.hiddenPurchasableContent.content" }), ' '] })))] })));
|
|
50
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SCMediaType } from '@selfcommunity/types';
|
|
1
2
|
export interface ImagePreviewComponentProps {
|
|
2
3
|
/**
|
|
3
4
|
* Class name to apply to the root object
|
|
@@ -8,7 +9,7 @@ export interface ImagePreviewComponentProps {
|
|
|
8
9
|
* Medias objs
|
|
9
10
|
* @default []
|
|
10
11
|
*/
|
|
11
|
-
medias:
|
|
12
|
+
medias: SCMediaType[];
|
|
12
13
|
/**
|
|
13
14
|
* Maximum number of visible media
|
|
14
15
|
* @default 5
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { styled,
|
|
3
|
-
import { Link } from '@selfcommunity/react-core';
|
|
3
|
+
import { styled, Grid, Typography, Icon, Stack, IconButton } from '@mui/material';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import {
|
|
6
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
5
|
+
import { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
|
|
7
6
|
import { useInView } from 'react-intersection-observer';
|
|
8
7
|
import { Lightbox } from '../../Lightbox';
|
|
9
8
|
import { PREFIX } from './constants';
|
|
10
|
-
import
|
|
9
|
+
import DocComponent from './DocComponent';
|
|
10
|
+
import { filteredDocs, filteredImages } from './filter';
|
|
11
|
+
import { MEDIA_TYPE_DOCUMENT, MEDIA_TYPE_IMAGE } from '../../../constants/Media';
|
|
12
|
+
import { http } from '@selfcommunity/api-services';
|
|
13
|
+
import { Logger } from '@selfcommunity/utils';
|
|
14
|
+
import { SCOPE_SC_UI } from '../../../constants/Errors';
|
|
11
15
|
const classes = {
|
|
12
16
|
displayRoot: `${PREFIX}-display-root`,
|
|
13
17
|
background: `${PREFIX}-background`,
|
|
@@ -22,21 +26,24 @@ const classes = {
|
|
|
22
26
|
border: `${PREFIX}-border`,
|
|
23
27
|
gallery: `${PREFIX}-gallery`,
|
|
24
28
|
title: `${PREFIX}-title`,
|
|
25
|
-
iconFile: `${PREFIX}-icon-file
|
|
29
|
+
iconFile: `${PREFIX}-icon-file`,
|
|
30
|
+
docsWrapper: `${PREFIX}-docs-wrapper`
|
|
26
31
|
};
|
|
27
|
-
const Root = styled(
|
|
32
|
+
const Root = styled(Stack, {
|
|
28
33
|
name: PREFIX,
|
|
29
34
|
slot: 'DisplayRoot'
|
|
30
|
-
})((
|
|
35
|
+
})(() => ({}));
|
|
31
36
|
export default (props) => {
|
|
32
37
|
// PROPS
|
|
33
38
|
const { className = '', medias = [], maxVisible = 5, gallery = true, onMediaClick = null } = props;
|
|
34
39
|
// STATE
|
|
35
40
|
const [preview, setPreview] = useState(-1);
|
|
41
|
+
const [mediaType, setMediaType] = useState(null);
|
|
36
42
|
const [toolbarButtons, setToolbarButtons] = useState(undefined);
|
|
37
43
|
const { ref, inView } = useInView({ triggerOnce: false });
|
|
38
44
|
// MEMO
|
|
39
|
-
const
|
|
45
|
+
const images = useMemo(() => medias.filter(filteredImages), [medias]);
|
|
46
|
+
const docs = useMemo(() => medias.filter(filteredDocs), [medias]);
|
|
40
47
|
// HANDLERS
|
|
41
48
|
const handleClose = () => {
|
|
42
49
|
setPreview(-1);
|
|
@@ -50,14 +57,15 @@ export default (props) => {
|
|
|
50
57
|
}
|
|
51
58
|
return image;
|
|
52
59
|
};
|
|
53
|
-
const openPreviewImage = useCallback((index) => {
|
|
60
|
+
const openPreviewImage = useCallback((index, type = MEDIA_TYPE_IMAGE) => {
|
|
54
61
|
if (gallery === false) {
|
|
55
62
|
// Prevent gallery
|
|
56
63
|
return;
|
|
57
64
|
}
|
|
58
65
|
setPreview(index);
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
setMediaType(type);
|
|
67
|
+
onMediaClick(type === MEDIA_TYPE_IMAGE ? images[index] : docs[index]);
|
|
68
|
+
}, [images, docs]);
|
|
61
69
|
// RENDERING
|
|
62
70
|
const renderTitle = (o) => {
|
|
63
71
|
if (!o) {
|
|
@@ -74,27 +82,27 @@ export default (props) => {
|
|
|
74
82
|
break;
|
|
75
83
|
}
|
|
76
84
|
}
|
|
77
|
-
return (_jsx(
|
|
85
|
+
return (_jsx(Fragment, { children: o.title && (_jsx("div", Object.assign({ className: classes.title }, { children: _jsxs(Typography, Object.assign({ variant: "subtitle2" }, { children: [startAdornment, " ", o.title] })) }))) }));
|
|
78
86
|
};
|
|
79
87
|
const renderOne = () => {
|
|
80
|
-
const overlay =
|
|
81
|
-
const isGif =
|
|
82
|
-
const isLandscape =
|
|
83
|
-
return (_jsx(Grid, Object.assign({ container: true, style: Object.assign({}, (
|
|
84
|
-
root: classNames(classes.border, classes.heightOne, Object.assign(Object.assign({}, (isGif || isLandscape ? { [classes.background]: true } : { [classes.backgroundPortrait]: true })), { [classes.gallery]: gallery, [classes.heightHalfOne]:
|
|
85
|
-
}, onClick: () => openPreviewImage(0), style: Object.assign({ background: `url(${getImageUrl(
|
|
88
|
+
const overlay = images.length > maxVisible && maxVisible == 1 ? renderCountOverlay(true) : renderOverlay(0);
|
|
89
|
+
const isGif = images[0]['image_mimetype'] ? images[0]['image_mimetype'].includes('image/gif') : false;
|
|
90
|
+
const isLandscape = images[0].image_height < images[0].image_width;
|
|
91
|
+
return (_jsx(Grid, Object.assign({ container: true, style: Object.assign({}, (images[0].image_thumbnail && images[0].image_thumbnail.color ? { backgroundColor: images[0].image_thumbnail.color } : {})) }, { children: _jsxs(Grid, Object.assign({ item: true, ref: ref, xs: 12, classes: {
|
|
92
|
+
root: classNames(classes.border, classes.heightOne, Object.assign(Object.assign({}, (isGif || isLandscape ? { [classes.background]: true } : { [classes.backgroundPortrait]: true })), { [classes.gallery]: gallery, [classes.heightHalfOne]: images.length > 1 }))
|
|
93
|
+
}, onClick: () => openPreviewImage(0), style: Object.assign({ background: `url(${getImageUrl(images[0], inView && isGif)})` }, (isLandscape ? { paddingTop: `${(100 * images[0].image_height) / images[0].image_width}%` } : {})) }, { children: [overlay, renderTitle(images[0])] })) })));
|
|
86
94
|
};
|
|
87
95
|
const renderTwo = () => {
|
|
88
|
-
const overlay =
|
|
89
|
-
const conditionalRender = [3, 4].includes(
|
|
90
|
-
return (_jsxs(Grid, Object.assign({ container: true }, { children: [_jsxs(Grid, Object.assign({ item: true, xs: 6, classes: { root: classNames(classes.border, classes.heightTwo, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 1 : 0), style: { background: `url(${getImageUrl(conditionalRender ?
|
|
96
|
+
const overlay = images.length > maxVisible && [2, 3].includes(+maxVisible) ? renderCountOverlay(true) : renderOverlay(1);
|
|
97
|
+
const conditionalRender = [3, 4].includes(images.length) || (images.length > +maxVisible && [3, 4].includes(+maxVisible));
|
|
98
|
+
return (_jsxs(Grid, Object.assign({ container: true }, { children: [_jsxs(Grid, Object.assign({ item: true, xs: 6, classes: { root: classNames(classes.border, classes.heightTwo, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 1 : 0), style: { background: `url(${getImageUrl(conditionalRender ? images[1] : images[0])})` } }, { children: [renderOverlay(conditionalRender ? 1 : 0), renderTitle(images[0])] })), _jsxs(Grid, Object.assign({ item: true, xs: 6, classes: { root: classNames(classes.border, classes.heightTwo, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 2 : 1), style: { background: `url(${getImageUrl(conditionalRender ? images[2] : images[1])})` } }, { children: [overlay, renderTitle(images[1])] }))] })));
|
|
91
99
|
};
|
|
92
100
|
const renderThree = () => {
|
|
93
|
-
const conditionalRender =
|
|
94
|
-
const overlay = !maxVisible || maxVisible > 5 || (
|
|
101
|
+
const conditionalRender = images.length == 4 || (images.length > +maxVisible && +maxVisible == 4);
|
|
102
|
+
const overlay = !maxVisible || maxVisible > 5 || (images.length > maxVisible && [4, 5].includes(+maxVisible))
|
|
95
103
|
? renderCountOverlay(true)
|
|
96
104
|
: renderOverlay(conditionalRender ? 3 : 4);
|
|
97
|
-
return (_jsxs(Grid, Object.assign({ container: true }, { children: [_jsxs(Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: classNames(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 1 : 2), style: { background: `url(${getImageUrl(conditionalRender ?
|
|
105
|
+
return (_jsxs(Grid, Object.assign({ container: true }, { children: [_jsxs(Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: classNames(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 1 : 2), style: { background: `url(${getImageUrl(conditionalRender ? images[1] : images[2])})` } }, { children: [renderOverlay(conditionalRender ? 1 : 2), renderTitle(images[1])] })), _jsxs(Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: classNames(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 2 : 3), style: { background: `url(${getImageUrl(conditionalRender ? images[2] : images[3])})` } }, { children: [renderOverlay(conditionalRender ? 2 : 3), renderTitle(images[2])] })), _jsxs(Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: classNames(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 3 : 4), style: { background: `url(${getImageUrl(conditionalRender ? images[3] : images[4])})` } }, { children: [overlay, renderTitle(images[3])] }))] })));
|
|
98
106
|
};
|
|
99
107
|
const renderOverlay = (id) => {
|
|
100
108
|
if (!gallery) {
|
|
@@ -106,31 +114,50 @@ export default (props) => {
|
|
|
106
114
|
];
|
|
107
115
|
};
|
|
108
116
|
const renderCountOverlay = (more) => {
|
|
109
|
-
const extra =
|
|
117
|
+
const extra = images.length - (maxVisible && maxVisible > 5 ? 5 : maxVisible);
|
|
110
118
|
return [
|
|
111
119
|
more && _jsx("div", { className: classes.cover }, "count"),
|
|
112
120
|
more && (_jsx("div", Object.assign({ className: classes.coverText, style: { fontSize: '200%' } }, { children: _jsxs("p", { children: ["+", extra] }) }), "count-sub"))
|
|
113
121
|
];
|
|
114
122
|
};
|
|
123
|
+
const handleDownload = useCallback((index) => __awaiter(void 0, void 0, void 0, function* () {
|
|
124
|
+
try {
|
|
125
|
+
const response = yield http.request({ url: docs[index].url, responseType: 'blob' });
|
|
126
|
+
const blob = new Blob([response.data], { type: 'application/pdf' });
|
|
127
|
+
const url = window.URL.createObjectURL(blob);
|
|
128
|
+
const link = document.createElement('a');
|
|
129
|
+
link.href = url;
|
|
130
|
+
link.download = docs[index].title;
|
|
131
|
+
link.click();
|
|
132
|
+
// Cleanup
|
|
133
|
+
window.URL.revokeObjectURL(url);
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
137
|
+
}
|
|
138
|
+
}), []);
|
|
115
139
|
const handleIndexChange = useCallback((index) => {
|
|
116
|
-
if (
|
|
117
|
-
setToolbarButtons(_jsx(IconButton, Object.assign({
|
|
140
|
+
if (mediaType === MEDIA_TYPE_DOCUMENT) {
|
|
141
|
+
setToolbarButtons(_jsx(IconButton, Object.assign({ onClick: () => handleDownload(index) }, { children: _jsx(Icon, { children: "download" }) })));
|
|
118
142
|
}
|
|
119
143
|
else {
|
|
120
144
|
setToolbarButtons(undefined);
|
|
121
145
|
}
|
|
122
|
-
}, [
|
|
146
|
+
}, [mediaType, docs, setToolbarButtons, handleDownload]);
|
|
123
147
|
useEffect(() => {
|
|
124
148
|
if (preview !== -1) {
|
|
125
149
|
handleIndexChange(preview);
|
|
126
150
|
}
|
|
151
|
+
else {
|
|
152
|
+
setMediaType(null);
|
|
153
|
+
}
|
|
127
154
|
}, [preview]);
|
|
128
|
-
const imagesToShow = [...
|
|
129
|
-
if (maxVisible &&
|
|
155
|
+
const imagesToShow = [...images];
|
|
156
|
+
if (maxVisible && images.length > maxVisible) {
|
|
130
157
|
imagesToShow.length = maxVisible;
|
|
131
158
|
}
|
|
132
|
-
if (
|
|
159
|
+
if (medias.length === 0) {
|
|
133
160
|
return null;
|
|
134
161
|
}
|
|
135
|
-
return (_jsxs(Root, Object.assign({ className: classNames(classes.displayRoot, className) }, { children: [[1, 3, 4].includes(imagesToShow.length) && renderOne(), imagesToShow.length >= 2 && imagesToShow.length
|
|
162
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.displayRoot, className) }, { children: [[1, 3, 4].includes(imagesToShow.length) && renderOne(), imagesToShow.length >= 2 && imagesToShow.length < 4 && renderTwo(), imagesToShow.length >= 4 && renderThree(), preview !== -1 && (_jsx(Lightbox, { onClose: handleClose, index: preview, medias: mediaType === MEDIA_TYPE_IMAGE ? images : docs, toolbarButtons: toolbarButtons })), _jsx(Stack, Object.assign({ className: classes.docsWrapper }, { children: docs.map((doc, i) => (_jsx(DocComponent, { doc: doc, index: i, openPreviewImage: openPreviewImage, handleDownload: handleDownload }, doc.id))) }))] })));
|
|
136
163
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SCMediaType } from '@selfcommunity/types';
|
|
2
|
+
interface DocComponentProps {
|
|
3
|
+
doc: SCMediaType;
|
|
4
|
+
index?: number;
|
|
5
|
+
onDelete?: (id: number) => void;
|
|
6
|
+
openPreviewImage?: (index: number, type: string) => void;
|
|
7
|
+
handleDownload?: (id: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export default function DocComponent(props: DocComponentProps): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Icon, IconButton, Stack, styled, Typography } from '@mui/material';
|
|
3
|
+
import { PREFIX } from './constants';
|
|
4
|
+
import { Link } from '@selfcommunity/react-core';
|
|
5
|
+
import { MEDIA_TYPE_DOCUMENT } from '../../../constants/Media';
|
|
6
|
+
const classes = {
|
|
7
|
+
docRoot: `${PREFIX}-doc-root`,
|
|
8
|
+
image: `${PREFIX}-image`,
|
|
9
|
+
textWrapper: `${PREFIX}-text-wrapper`,
|
|
10
|
+
title: `${PREFIX}-title`,
|
|
11
|
+
subtitle: `${PREFIX}-subtitle`,
|
|
12
|
+
actionWrapper: `${PREFIX}-action-wrapper`,
|
|
13
|
+
action: `${PREFIX}-action`
|
|
14
|
+
};
|
|
15
|
+
const Root = styled(Stack, {
|
|
16
|
+
name: PREFIX,
|
|
17
|
+
slot: 'DocRoot'
|
|
18
|
+
})(() => ({}));
|
|
19
|
+
function formatBytes(bytes, decimals = 2) {
|
|
20
|
+
if (!+bytes)
|
|
21
|
+
return '0 Bytes';
|
|
22
|
+
const k = 1024;
|
|
23
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
24
|
+
const sizes = ['Bytes', 'KB', 'MB'];
|
|
25
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
26
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
|
|
27
|
+
}
|
|
28
|
+
export default function DocComponent(props) {
|
|
29
|
+
const { doc, index, onDelete, openPreviewImage, handleDownload } = props;
|
|
30
|
+
return (_jsxs(Root, Object.assign({ className: classes.docRoot }, { children: [_jsx(Box, { component: "img", className: classes.image, alt: "pdf preview", src: doc.image_thumbnail ? doc.image_thumbnail.url : doc.image, onClick: () => openPreviewImage === null || openPreviewImage === void 0 ? void 0 : openPreviewImage(index, MEDIA_TYPE_DOCUMENT), sx: { cursor: openPreviewImage ? 'pointer' : undefined } }), _jsxs(Stack, Object.assign({ className: classes.textWrapper }, { children: [_jsx(Typography, Object.assign({ className: classes.title }, { children: doc.title })), doc.size && _jsx(Typography, Object.assign({ className: classes.subtitle }, { children: formatBytes(doc.size) }))] })), (handleDownload || onDelete) && (_jsxs(Stack, Object.assign({ className: classes.actionWrapper }, { children: [onDelete && (_jsx(IconButton, Object.assign({ className: classes.action, onClick: () => onDelete(doc.id) }, { children: _jsx(Icon, { children: "delete" }) }))), handleDownload && (_jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ className: classes.action, component: Link, to: doc.url, target: "_blank" }, { children: _jsx(Icon, { children: "visibility" }) })), _jsx(IconButton, Object.assign({ className: classes.action, onClick: () => handleDownload(index) }, { children: _jsx(Icon, { children: "download" }) }))] }))] })))] })));
|
|
31
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { BoxProps } from '@mui/material';
|
|
3
3
|
import { SCMediaType } from '@selfcommunity/types';
|
|
4
4
|
export interface PreviewComponentProps extends Omit<BoxProps, 'value' | 'onChange'> {
|
|
5
5
|
onChange: (value: SCMediaType[]) => void;
|
|
6
6
|
value: SCMediaType[];
|
|
7
7
|
}
|
|
8
|
-
declare const PreviewComponent:
|
|
8
|
+
declare const PreviewComponent: import("react").ForwardRefExoticComponent<Pick<PreviewComponentProps, "id" | "role" | "className" | "style" | "classes" | "p" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "component" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "value"> & import("react").RefAttributes<unknown>>;
|
|
9
9
|
export default PreviewComponent;
|