@selfcommunity/react-ui 0.11.0-alpha.67 → 0.11.0-alpha.69
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 +36 -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 +94 -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 +37 -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 +90 -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
|
@@ -8,6 +8,7 @@ const material_1 = require("@mui/material");
|
|
|
8
8
|
const FollowUserButton_1 = tslib_1.__importDefault(require("../FollowUserButton"));
|
|
9
9
|
const FriendshipUserButton_1 = tslib_1.__importDefault(require("../FriendshipUserButton"));
|
|
10
10
|
const system_1 = require("@mui/system");
|
|
11
|
+
const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
|
|
11
12
|
const PREFIX = 'SCConnectionUserButton';
|
|
12
13
|
const classes = {
|
|
13
14
|
root: `${PREFIX}-root`
|
|
@@ -48,6 +49,11 @@ function ConnectionUserButton(inProps) {
|
|
|
48
49
|
const scPreferencesContext = (0, react_1.useContext)(react_core_1.SCPreferencesContext);
|
|
49
50
|
const followEnabled = react_core_1.SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED in scPreferencesContext.preferences &&
|
|
50
51
|
scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED].value;
|
|
52
|
+
const connectionEnabled = react_core_1.SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED in scPreferencesContext.preferences &&
|
|
53
|
+
scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED].value;
|
|
54
|
+
if (!followEnabled && !connectionEnabled) {
|
|
55
|
+
return (0, jsx_runtime_1.jsx)(HiddenPlaceholder_1.default, {});
|
|
56
|
+
}
|
|
51
57
|
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: followEnabled ? ((0, jsx_runtime_1.jsx)(FollowUserButton_1.default, Object.assign({ user: user }, followConnectUserButtonProps, rest))) : ((0, jsx_runtime_1.jsx)(FriendshipUserButton_1.default, Object.assign({ user: user }, followConnectUserButtonProps, rest))) }));
|
|
52
58
|
}
|
|
53
59
|
exports.default = ConnectionUserButton;
|
|
@@ -4,6 +4,7 @@ import { SCCourseTemplateType } from '../../types/course';
|
|
|
4
4
|
import { CourseParticipantsButtonProps } from '../CourseParticipantsButton';
|
|
5
5
|
import { WidgetProps } from '../Widget';
|
|
6
6
|
import { CourseSkeletonProps } from './Skeleton';
|
|
7
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
7
8
|
export interface CourseProps extends WidgetProps {
|
|
8
9
|
/**
|
|
9
10
|
* Course Object
|
|
@@ -39,6 +40,10 @@ export interface CourseProps extends WidgetProps {
|
|
|
39
40
|
* @default {}
|
|
40
41
|
*/
|
|
41
42
|
CourseSkeletonComponentProps?: CourseSkeletonProps;
|
|
43
|
+
/**
|
|
44
|
+
* Override default cache strategy on fetch element
|
|
45
|
+
*/
|
|
46
|
+
cacheStrategy?: CacheStrategies;
|
|
42
47
|
/**
|
|
43
48
|
* Any other properties
|
|
44
49
|
*/
|
|
@@ -106,9 +106,9 @@ function Course(inProps) {
|
|
|
106
106
|
props: inProps,
|
|
107
107
|
name: constants_1.PREFIX
|
|
108
108
|
});
|
|
109
|
-
const { id = `course_object_${props.courseId ? props.courseId : props.course ? props.course.id : ''}`, courseId = null, course = null, className = null, template = course_1.SCCourseTemplateType.PREVIEW, actions, CourseParticipantsButtonComponentProps = {}, CourseSkeletonComponentProps = {}, userProfileSnippet } = props, rest = tslib_1.__rest(props, ["id", "courseId", "course", "className", "template", "actions", "CourseParticipantsButtonComponentProps", "CourseSkeletonComponentProps", "userProfileSnippet"]);
|
|
109
|
+
const { id = `course_object_${props.courseId ? props.courseId : props.course ? props.course.id : ''}`, courseId = null, course = null, className = null, template = course_1.SCCourseTemplateType.PREVIEW, actions, CourseParticipantsButtonComponentProps = {}, CourseSkeletonComponentProps = {}, cacheStrategy, userProfileSnippet } = props, rest = tslib_1.__rest(props, ["id", "courseId", "course", "className", "template", "actions", "CourseParticipantsButtonComponentProps", "CourseSkeletonComponentProps", "cacheStrategy", "userProfileSnippet"]);
|
|
110
110
|
// STATE
|
|
111
|
-
const { scCourse } = (0, react_core_1.useSCFetchCourse)({ id: courseId, course });
|
|
111
|
+
const { scCourse } = (0, react_core_1.useSCFetchCourse)(Object.assign({ id: courseId, course }, (cacheStrategy && { cacheStrategy })));
|
|
112
112
|
const theme = (0, material_1.useTheme)();
|
|
113
113
|
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.between('xs', 'md'));
|
|
114
114
|
const MAX_VISIBLE_CATEGORIES = isMobile ? 3 : 1;
|
|
@@ -165,7 +165,7 @@ function Course(inProps) {
|
|
|
165
165
|
}), { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (_e = scCourse.created_by) === null || _e === void 0 ? void 0 : _e.username })) })), (0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.COURSE_ROUTE_NAME, scCourse), className: classes.previewNameWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6", className: classes.previewName }, { children: scCourse.name })) })), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.previewInfo }, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: scCourse.privacy ? `ui.course.privacy.${scCourse.privacy}` : 'ui.course.privacy.draft', defaultMessage: scCourse.privacy ? `ui.course.privacy.${scCourse.privacy}` : 'ui.course.privacy.draft' }), ' - ', (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.course.type.${scCourse.type}`, defaultMessage: `ui.course.type.${scCourse.type}` })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.previewCategory }, { children: [scCourse.categories.slice(0, MAX_VISIBLE_CATEGORIES).map((category) => ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", label: category.name }, category.id))), scCourse.categories.length > MAX_VISIBLE_CATEGORIES && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: scCourse.categories.slice(MAX_VISIBLE_CATEGORIES).map((cat) => ((0, jsx_runtime_1.jsx)(material_1.Box, { children: cat.name }, cat.id))) }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", label: `+${scCourse.categories.length - MAX_VISIBLE_CATEGORIES}`, sx: { cursor: 'pointer' } }) })))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.previewProgress }, { children: renderProgress() }))] })), actions !== null && actions !== void 0 ? actions : ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.previewActions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "outlined", size: "small", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.COURSE_ROUTE_NAME, scCourse) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.course.see", id: "ui.course.see" }) })) })))] })));
|
|
166
166
|
}
|
|
167
167
|
else {
|
|
168
|
-
contentObj = ((0, jsx_runtime_1.jsx)(SnippetRoot, {
|
|
168
|
+
contentObj = ((0, jsx_runtime_1.jsx)(SnippetRoot, { elevation: 0, className: classes.snippetRoot, image: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.snippetImage }, { children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { variant: "square", alt: scCourse.name, src: scCourse.image_medium, className: userProfileSnippet ? classes.snippetAvatarUserProfile : classes.snippetAvatar }), !userProfileSnippet &&
|
|
169
169
|
(isCourseAdmin || (0, course_2.isCourseCompleted)(scCourse) || (0, course_2.isCourseNew)(scCourse) || scCourse.join_status === types_1.SCCourseJoinStatusType.JOINED) && ((0, jsx_runtime_1.jsx)(material_1.Chip, { size: "small", component: "div", color: (0, course_2.isCourseCompleted)(scCourse) || (isCourseAdmin && scCourse.privacy)
|
|
170
170
|
? 'primary'
|
|
171
171
|
: isCourseAdmin && !scCourse.privacy
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { SCCourseType } from '@selfcommunity/types';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
interface HeaderCourseDashboardProps {
|
|
4
4
|
course: SCCourseType;
|
|
5
5
|
hasAction?: boolean;
|
|
6
6
|
}
|
|
7
7
|
declare function HeaderCourseDashboard(props: HeaderCourseDashboardProps): JSX.Element;
|
|
8
|
-
declare const _default:
|
|
8
|
+
declare const _default: React.MemoExoticComponent<typeof HeaderCourseDashboard>;
|
|
9
9
|
export default _default;
|
|
@@ -11,6 +11,7 @@ const react_core_1 = require("@selfcommunity/react-core");
|
|
|
11
11
|
const types_2 = require("../../types");
|
|
12
12
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
13
13
|
const CourseTypePopover_1 = tslib_1.__importDefault(require("../../shared/CourseTypePopover"));
|
|
14
|
+
const BuyButton_1 = tslib_1.__importDefault(require("../BuyButton"));
|
|
14
15
|
const classes = {
|
|
15
16
|
header: `${constants_1.PREFIX}-header`,
|
|
16
17
|
img: `${constants_1.PREFIX}-header-img`,
|
|
@@ -28,17 +29,23 @@ function getUrlEditDashboard(course) {
|
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
function HeaderCourseDashboard(props) {
|
|
32
|
+
var _a;
|
|
31
33
|
// PROPS
|
|
32
34
|
const { course, hasAction = false } = props;
|
|
33
35
|
// CONTEXTS
|
|
34
36
|
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
35
37
|
// INTL
|
|
36
38
|
const intl = (0, react_intl_1.useIntl)();
|
|
39
|
+
// PAYMENTS
|
|
40
|
+
const { isPaymentsEnabled } = (0, react_core_1.useSCPaymentsEnabled)();
|
|
37
41
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.header }, { children: [(0, jsx_runtime_1.jsx)("img", { src: course.image_bigger, alt: course.image_bigger, className: classes.img }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", className: classes.contrastColor }, { children: course.name })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.outerWrapper }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.innerWrapper }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: (0, classnames_1.default)(classes.iconWrapper, classes.contrastColor) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: "public" })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.label", defaultMessage: "ui.course.label", values: {
|
|
38
42
|
privacy: intl.formatMessage({
|
|
39
43
|
id: `ui.course.privacy.${course.privacy === types_1.SCCoursePrivacyType.DRAFT ? 'draft' : course.privacy}`,
|
|
40
44
|
defaultMessage: `ui.course.privacy.${course.privacy === types_1.SCCoursePrivacyType.DRAFT ? 'draft' : course.privacy}`
|
|
41
45
|
})
|
|
42
|
-
} }) }))] })), (0, jsx_runtime_1.jsx)(CourseTypePopover_1.default, { course: course })
|
|
46
|
+
} }) }))] })), (0, jsx_runtime_1.jsx)(CourseTypePopover_1.default, { course: course }), isPaymentsEnabled &&
|
|
47
|
+
((_a = course.paywalls) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
48
|
+
(course.privacy === types_1.SCCoursePrivacyType.OPEN ||
|
|
49
|
+
(course.privacy === types_1.SCCoursePrivacyType.PRIVATE && course.join_status && course.join_status !== types_1.SCCourseJoinStatusType.REQUESTED)) && ((0, jsx_runtime_1.jsx)(BuyButton_1.default, { size: "md", variant: "text", startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "dredit-card" }), contentType: types_1.SCContentType.COURSE, content: course, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.paid", defaultMessage: "ui.course.paid" }) }))] })), hasAction && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.COURSE_EDIT_ROUTE_NAME, getUrlEditDashboard(course)), size: "small", color: "primary", variant: "contained" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.course.dashboard.teacher.btn.label", defaultMessage: "ui.course.dashboard.teacher.btn.label" }) })) })))] }))] })));
|
|
43
50
|
}
|
|
44
51
|
exports.default = (0, react_1.memo)(HeaderCourseDashboard);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
import { SCCourseType } from '@selfcommunity/types';
|
|
3
3
|
export interface StudentCourseDashboardProps {
|
|
4
4
|
courseId?: number;
|
|
@@ -7,5 +7,5 @@ export interface StudentCourseDashboardProps {
|
|
|
7
7
|
[p: string]: any;
|
|
8
8
|
}
|
|
9
9
|
declare function Student(inProps: StudentCourseDashboardProps): JSX.Element;
|
|
10
|
-
declare const _default:
|
|
10
|
+
declare const _default: React.MemoExoticComponent<typeof Student>;
|
|
11
11
|
export default _default;
|
|
@@ -19,6 +19,7 @@ const Errors_1 = require("../../constants/Errors");
|
|
|
19
19
|
const notistack_1 = require("notistack");
|
|
20
20
|
const Skeleton_1 = tslib_1.__importDefault(require("./Student/Skeleton"));
|
|
21
21
|
const UserAvatar_1 = tslib_1.__importDefault(require("../../shared/UserAvatar"));
|
|
22
|
+
const BuyButton_1 = tslib_1.__importDefault(require("../BuyButton"));
|
|
22
23
|
const BUTTON_MESSAGES = {
|
|
23
24
|
dashboard: 'ui.course.dashboard.student.button.dashboard',
|
|
24
25
|
request: 'ui.course.dashboard.student.button.request',
|
|
@@ -111,6 +112,8 @@ function Student(inProps) {
|
|
|
111
112
|
const { scCourse, setSCCourse } = (0, react_core_1.useSCFetchCourse)({ id: courseId, course });
|
|
112
113
|
const intl = (0, react_intl_1.useIntl)();
|
|
113
114
|
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
115
|
+
// PAYMENTS
|
|
116
|
+
const { isPaymentsEnabled } = (0, react_core_1.useSCPaymentsEnabled)();
|
|
114
117
|
// EFFETCS
|
|
115
118
|
(0, react_1.useEffect)(() => {
|
|
116
119
|
if (scCourse) {
|
|
@@ -165,19 +168,27 @@ function Student(inProps) {
|
|
|
165
168
|
}, [scContext.settings.handleAnonymousAction]);
|
|
166
169
|
// MEMOS
|
|
167
170
|
const actionButton = (0, react_1.useMemo)(() => {
|
|
171
|
+
var _a, _b, _c;
|
|
168
172
|
if (!scCourse) {
|
|
169
|
-
return (0, jsx_runtime_1.jsx)(
|
|
173
|
+
return (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rectangular", width: "130px", height: "20px" });
|
|
170
174
|
}
|
|
171
175
|
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.actionsWrapper }, { children: [(scCourse.join_status === types_1.SCCourseJoinStatusType.CREATOR || scCourse.join_status === types_1.SCCourseJoinStatusType.MANAGER) && ((0, jsx_runtime_1.jsx)(ActionButton_1.default, { labelId: BUTTON_MESSAGES.dashboard, to: scRoutingContext.url(react_core_1.SCRoutes.COURSE_DASHBOARD_ROUTE_NAME, scCourse), color: "inherit", variant: "outlined" })), (((scCourse.privacy === types_1.SCCoursePrivacyType.PRIVATE || scCourse.privacy === types_1.SCCoursePrivacyType.SECRET) &&
|
|
172
176
|
(scCourse.join_status === types_1.SCCourseJoinStatusType.MANAGER || scCourse.join_status === types_1.SCCourseJoinStatusType.JOINED)) ||
|
|
173
|
-
(scCourse.privacy === types_1.SCCoursePrivacyType.OPEN && scCourse.join_status !== types_1.SCCourseJoinStatusType.CREATOR)) &&
|
|
177
|
+
(scCourse.privacy === types_1.SCCoursePrivacyType.OPEN && scCourse.join_status !== types_1.SCCourseJoinStatusType.CREATOR)) &&
|
|
178
|
+
(!isPaymentsEnabled ||
|
|
179
|
+
!((_a = scCourse.paywalls) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
180
|
+
(isPaymentsEnabled &&
|
|
181
|
+
((_b = scCourse.paywalls) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
|
182
|
+
(scCourse.join_status === types_1.SCCourseJoinStatusType.JOINED || scCourse.join_status === types_1.SCCourseJoinStatusType.MANAGER))) && ((0, jsx_runtime_1.jsx)(ActionButton_1.default, { labelId: scCourse.join_status === null
|
|
174
183
|
? BUTTON_MESSAGES.signUp
|
|
175
184
|
: scCourse.user_completion_rate === 0
|
|
176
185
|
? BUTTON_MESSAGES.start
|
|
177
186
|
: scCourse.user_completion_rate === 100
|
|
178
187
|
? BUTTON_MESSAGES.review
|
|
179
|
-
: BUTTON_MESSAGES.continue, to: scCourse.join_status !== null ? scRoutingContext.url(react_core_1.SCRoutes.COURSE_LESSON_ROUTE_NAME, getUrlNextLesson(scCourse)) : undefined, disabled: getIsNextLessonLocked(scCourse), color: scCourse.user_completion_rate === 100 ? 'inherit' : undefined, variant: scCourse.user_completion_rate === 100 ? 'outlined' : undefined, loading: scCourse.join_status === null ? loadingRequest : undefined, onClick: !scUserContext.user ? handleAnonymousAction : scCourse.join_status === null ? handleRequest : undefined })), scCourse.privacy === types_1.SCCoursePrivacyType.PRIVATE &&
|
|
180
|
-
(scCourse.join_status === null || scCourse.join_status === types_1.SCCourseJoinStatusType.REQUESTED)
|
|
188
|
+
: BUTTON_MESSAGES.continue, to: scCourse.join_status !== null ? scRoutingContext.url(react_core_1.SCRoutes.COURSE_LESSON_ROUTE_NAME, getUrlNextLesson(scCourse)) : undefined, disabled: scCourse.join_status !== null ? getIsNextLessonLocked(scCourse) : undefined, color: scCourse.user_completion_rate === 100 ? 'inherit' : undefined, variant: scCourse.user_completion_rate === 100 ? 'outlined' : undefined, loading: scCourse.join_status === null ? loadingRequest : undefined, onClick: !scUserContext.user ? handleAnonymousAction : scCourse.join_status === null ? handleRequest : undefined })), scCourse.privacy === types_1.SCCoursePrivacyType.PRIVATE &&
|
|
189
|
+
(scCourse.join_status === null || scCourse.join_status === types_1.SCCourseJoinStatusType.REQUESTED) ? ((0, jsx_runtime_1.jsx)(ActionButton_1.default, { labelId: sentRequest ? BUTTON_MESSAGES.cancel : BUTTON_MESSAGES.request, color: "inherit", variant: "outlined", loading: loadingRequest, onClick: handleRequest })) : (isPaymentsEnabled &&
|
|
190
|
+
((_c = scCourse.paywalls) === null || _c === void 0 ? void 0 : _c.length) > 0 &&
|
|
191
|
+
!(scCourse.join_status === types_1.SCCourseJoinStatusType.CREATOR) && ((0, jsx_runtime_1.jsx)(BuyButton_1.default, { contentType: types_1.SCContentType.COURSE, content: scCourse })))] })));
|
|
181
192
|
}, [scCourse, sentRequest, loadingRequest, handleRequest]);
|
|
182
193
|
if (!scCourse) {
|
|
183
194
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
@@ -21,6 +21,8 @@ const Course_1 = require("../../constants/Course");
|
|
|
21
21
|
const CategoryAutocomplete_1 = tslib_1.__importDefault(require("../CategoryAutocomplete"));
|
|
22
22
|
const Edit_1 = tslib_1.__importDefault(require("./Edit"));
|
|
23
23
|
const Dialog_1 = tslib_1.__importDefault(require("./Dialog"));
|
|
24
|
+
const PaywallsConfigurator_1 = tslib_1.__importDefault(require("../PaywallsConfigurator"));
|
|
25
|
+
const constants_2 = require("../PaywallsConfigurator/constants");
|
|
24
26
|
const messages = (0, react_intl_1.defineMessages)({
|
|
25
27
|
name: {
|
|
26
28
|
id: 'ui.courseForm.name.placeholder',
|
|
@@ -59,7 +61,8 @@ const classes = {
|
|
|
59
61
|
stepCustomization: `${constants_1.PREFIX}-step-customization`,
|
|
60
62
|
cardTitle: `${constants_1.PREFIX}-card-title`,
|
|
61
63
|
title: `${constants_1.PREFIX}-title`,
|
|
62
|
-
contrastColor: `${constants_1.PREFIX}-contrast-color
|
|
64
|
+
contrastColor: `${constants_1.PREFIX}-contrast-color`,
|
|
65
|
+
paywallsConfiguratorWrap: `${constants_1.PREFIX}-paywalls-configurator-wrap`
|
|
63
66
|
};
|
|
64
67
|
const Root = (0, material_1.styled)(material_1.Box, {
|
|
65
68
|
name: constants_1.PREFIX,
|
|
@@ -100,13 +103,13 @@ const Root = (0, material_1.styled)(material_1.Box, {
|
|
|
100
103
|
* @param inProps
|
|
101
104
|
*/
|
|
102
105
|
function CourseForm(inProps) {
|
|
103
|
-
var _a, _b, _c;
|
|
106
|
+
var _a, _b, _c, _d, _e;
|
|
104
107
|
//PROPS
|
|
105
108
|
const props = (0, system_1.useThemeProps)({
|
|
106
109
|
props: inProps,
|
|
107
110
|
name: constants_1.PREFIX
|
|
108
111
|
});
|
|
109
|
-
const { className, onSuccess, onError, course = null, step = Course_1.SCCourseFormStepType.GENERAL, onStepChange } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "course", "step", "onStepChange"]);
|
|
112
|
+
const { className, onSuccess, onError, course = null, step = Course_1.SCCourseFormStepType.GENERAL, hidePaywalls = false, onStepChange } = props, rest = tslib_1.__rest(props, ["className", "onSuccess", "onError", "course", "step", "hidePaywalls", "onStepChange"]);
|
|
110
113
|
// INTL
|
|
111
114
|
const intl = (0, react_intl_1.useIntl)();
|
|
112
115
|
const initialFieldState = {
|
|
@@ -117,6 +120,8 @@ function CourseForm(inProps) {
|
|
|
117
120
|
description: course ? course.description : '',
|
|
118
121
|
categories: course ? course.categories : [],
|
|
119
122
|
privacy: course ? course.privacy : '',
|
|
123
|
+
products: ((_a = course === null || course === void 0 ? void 0 : course.paywalls) === null || _a === void 0 ? void 0 : _a.map((p) => p.id)) || [],
|
|
124
|
+
contentAccessType: ((_b = course === null || course === void 0 ? void 0 : course.paywalls) === null || _b === void 0 ? void 0 : _b.length) ? constants_2.ContentAccessType.PAID : constants_2.ContentAccessType.FREE,
|
|
120
125
|
isSubmitting: false
|
|
121
126
|
};
|
|
122
127
|
// STATE
|
|
@@ -124,8 +129,13 @@ function CourseForm(inProps) {
|
|
|
124
129
|
const [_step, setStep] = (0, react_1.useState)(step);
|
|
125
130
|
const [error, setError] = (0, react_1.useState)({});
|
|
126
131
|
const [openDialog, setOpenDialog] = (0, react_1.useState)(false);
|
|
132
|
+
// CONTEXT
|
|
133
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
127
134
|
// PREFERENCES
|
|
128
135
|
const { preferences } = (0, react_core_1.useSCPreferences)();
|
|
136
|
+
// PAYMENTS
|
|
137
|
+
const { isPaymentsEnabled } = (0, react_core_1.useSCPaymentsEnabled)();
|
|
138
|
+
const isStaff = (0, react_1.useMemo)(() => scUserContext.user && react_core_1.UserUtils.isStaff(scUserContext.user), [scUserContext.user]);
|
|
129
139
|
const courseAdvancedEnabled = (0, react_1.useMemo)(() => preferences[react_core_1.SCPreferences.CONFIGURATIONS_COURSES_ADVANCED_ENABLED].value, [preferences]);
|
|
130
140
|
const _backgroundCover = Object.assign({}, (field.imageOriginal
|
|
131
141
|
? { background: `url('${field.imageOriginal}') center / cover` }
|
|
@@ -186,6 +196,7 @@ function CourseForm(inProps) {
|
|
|
186
196
|
* Handles the form submission for create/update action
|
|
187
197
|
*/
|
|
188
198
|
const handleSubmit = (0, react_1.useCallback)(() => {
|
|
199
|
+
var _a;
|
|
189
200
|
setField((prev) => (Object.assign(Object.assign({}, prev), { isSubmitting: true })));
|
|
190
201
|
const formData = new FormData();
|
|
191
202
|
if (field.imageOriginalFile) {
|
|
@@ -202,6 +213,12 @@ function CourseForm(inProps) {
|
|
|
202
213
|
formData.append(key, field.categories[key]);
|
|
203
214
|
}
|
|
204
215
|
}
|
|
216
|
+
if (field.products.length && field.contentAccessType === constants_2.ContentAccessType.PAID && (isStaff || (course && ((_a = course.paywalls) === null || _a === void 0 ? void 0 : _a.length)))) {
|
|
217
|
+
formData.append(`products`, JSON.stringify(field.products));
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
formData.append(`products`, '[]');
|
|
221
|
+
}
|
|
205
222
|
let courseService;
|
|
206
223
|
if (course) {
|
|
207
224
|
courseService = api_services_1.CourseService.patchCourse(course.id, formData, {
|
|
@@ -243,6 +260,20 @@ function CourseForm(inProps) {
|
|
|
243
260
|
setError(error);
|
|
244
261
|
}
|
|
245
262
|
}, [setField, error]);
|
|
263
|
+
/**
|
|
264
|
+
* Handle change content access tyoe
|
|
265
|
+
* @param type
|
|
266
|
+
*/
|
|
267
|
+
const handleChangeContentAccessType = (type) => {
|
|
268
|
+
setField((prev) => (Object.assign(Object.assign({}, prev), { contentAccessType: type })));
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Handle change payment products
|
|
272
|
+
* @param products
|
|
273
|
+
*/
|
|
274
|
+
const handleChangePaymentsProducts = (products) => {
|
|
275
|
+
setField((prev) => (Object.assign(Object.assign({}, prev), { products: products.map((product) => product.id) })));
|
|
276
|
+
};
|
|
246
277
|
/**
|
|
247
278
|
* Handles for closing confirm dialog
|
|
248
279
|
*/
|
|
@@ -255,8 +286,8 @@ function CourseForm(inProps) {
|
|
|
255
286
|
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: _step === Course_1.SCCourseFormStepType.GENERAL ? classes.stepOne : classes.stepTwo }, { children: [_step === Course_1.SCCourseFormStepType.GENERAL && ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: Object.values(types_1.SCCourseTypologyType).map((option, index) => ((0, jsx_runtime_1.jsx)(material_1.Card, Object.assign({ className: (0, classnames_1.default)(classes.card, { [classes.selected]: option === field.type }, { [classes.disabled]: !courseAdvancedEnabled && option !== types_1.SCCourseTypologyType.SELF }) }, { children: (0, jsx_runtime_1.jsx)(material_1.CardActionArea, Object.assign({ onClick: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['type']: option }))) }, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ variant: "subtitle2", className: classes.cardTitle }, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.courseForm.${option}.title`, defaultMessage: `ui.courseForm.${option}.title` }), !courseAdvancedEnabled && option !== types_1.SCCourseTypologyType.SELF && ((0, jsx_runtime_1.jsx)(material_1.Chip, { variant: "outlined", color: "warning", size: "small", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.comingSoon.chip", defaultMessage: "ui.courseForm.comingSoon.chip" }) }))] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.courseForm.${option}.info`, defaultMessage: `ui.courseForm.${option}.info` }) }))] }) })) }), index))) })), _step === Course_1.SCCourseFormStepType.CUSTOMIZATION && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [course && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5", className: classes.contrastColor }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.edit.title.general", defaultMessage: "ui.courseForm.edit.title.general" }) }))), (0, jsx_runtime_1.jsxs)(material_1.FormGroup, Object.assign({ className: (0, classnames_1.default)(classes.form, _step === Course_1.SCCourseFormStepType.CUSTOMIZATION && course ? classes.stepCustomization : undefined) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: (0, jsx_runtime_1.jsx)(UploadCourseCover_1.default, { isUploading: field.isSubmitting, onChange: handleChangeCover }) })), (0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
|
|
256
287
|
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: Course_1.COURSE_TITLE_MAX_LENGTH - field.name.length }))
|
|
257
288
|
}, error: Boolean((!!course && !field.name) || field.name.length > Course_1.COURSE_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: !!course && !field.name ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.required", defaultMessage: "ui.courseForm.required" })) : field.name.length > Course_1.COURSE_TITLE_MAX_LENGTH ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.name.error.maxLength", defaultMessage: "ui.courseForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
258
|
-
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((
|
|
259
|
-
}, error: Boolean((!!field.privacy && !field.description) || ((
|
|
289
|
+
endAdornment: ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) ? Course_1.COURSE_DESCRIPTION_MAX_LENGTH - field.description.length : Course_1.COURSE_DESCRIPTION_MAX_LENGTH })))
|
|
290
|
+
}, error: Boolean((!!field.privacy && !field.description) || ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > Course_1.COURSE_DESCRIPTION_MAX_LENGTH), helperText: !!field.privacy && !field.description ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.required", defaultMessage: "ui.courseForm.required" })) : (((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > Course_1.COURSE_DESCRIPTION_MAX_LENGTH && ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseForm.description.error.maxLength", defaultMessage: "ui.courseForm.description.error.maxLength" }))) }), (0, jsx_runtime_1.jsx)(CategoryAutocomplete_1.default, { defaultValue: field.categories, TextFieldProps: { label: intl.formatMessage(Object.keys(field.categories).length ? messages.category : messages.categoryEmpty) }, multiple: true, onChange: handleOnChangeCategory }), course && (0, jsx_runtime_1.jsx)(Edit_1.default, { course: course, onPrivacyChange: (privacy) => setField((prev) => (Object.assign(Object.assign({}, prev), { ['privacy']: privacy }))) }), isPaymentsEnabled && isStaff && !hidePaywalls && ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.paywallsConfiguratorWrap }, { children: (0, jsx_runtime_1.jsx)(PaywallsConfigurator_1.default, Object.assign({}, (course && { contentId: course.id }), { contentType: types_1.SCContentType.COURSE, onChangeContentAccessType: handleChangeContentAccessType, onChangePaymentProducts: handleChangePaymentsProducts })) })))] }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: (0, classnames_1.default)(classes.actions, _step === Course_1.SCCourseFormStepType.CUSTOMIZATION && course ? classes.stepCustomization : undefined) }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ size: "small", loading: field.isSubmitting, disabled: _step === Course_1.SCCourseFormStepType.GENERAL
|
|
260
291
|
? !field.type || Object.keys(error).length !== 0
|
|
261
292
|
: _step === Course_1.SCCourseFormStepType.CUSTOMIZATION &&
|
|
262
293
|
(!field.name ||
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SCCourseType
|
|
1
|
+
import { SCCourseType } from '@selfcommunity/types';
|
|
2
2
|
export interface CourseJoinButtonProps {
|
|
3
3
|
/**
|
|
4
4
|
* Overrides or extends the styles applied to the component.
|
|
@@ -15,11 +15,6 @@ export interface CourseJoinButtonProps {
|
|
|
15
15
|
* @default null
|
|
16
16
|
*/
|
|
17
17
|
courseId?: number;
|
|
18
|
-
/**
|
|
19
|
-
* The user to be accepted into the course
|
|
20
|
-
* @default null
|
|
21
|
-
*/
|
|
22
|
-
user?: SCUserType;
|
|
23
18
|
/**
|
|
24
19
|
* onJoin callback
|
|
25
20
|
* @param user
|
|
@@ -51,7 +51,7 @@ function CourseJoinButton(inProps) {
|
|
|
51
51
|
props: inProps,
|
|
52
52
|
name: PREFIX
|
|
53
53
|
});
|
|
54
|
-
const { className, courseId, course,
|
|
54
|
+
const { className, courseId, course, onJoin } = props, rest = tslib_1.__rest(props, ["className", "courseId", "course", "onJoin"]);
|
|
55
55
|
// STATE
|
|
56
56
|
const [status, setStatus] = (0, react_1.useState)(null);
|
|
57
57
|
// CONTEXT
|
|
@@ -85,14 +85,16 @@ function CourseJoinButton(inProps) {
|
|
|
85
85
|
pubsub_js_1.default.publish(`${PubSub_1.SCTopicType.GROUP}.${PubSub_1.SCCourseEventType.ADD_MEMBER}`, { course, user });
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
const join = (
|
|
88
|
+
const join = () => {
|
|
89
89
|
scCoursesManager
|
|
90
|
-
.join(scCourse
|
|
90
|
+
.join(scCourse)
|
|
91
91
|
.then(() => {
|
|
92
92
|
const _status = scCourse.privacy === types_1.SCCoursePrivacyType.PRIVATE && scCourse.join_status !== types_1.SCCourseJoinStatusType.INVITED
|
|
93
93
|
? types_1.SCCourseJoinStatusType.REQUESTED
|
|
94
94
|
: types_1.SCCourseJoinStatusType.JOINED;
|
|
95
|
-
|
|
95
|
+
if (_status === types_1.SCCourseJoinStatusType.JOINED) {
|
|
96
|
+
notifyChanges(scCourse, scUserContext.user);
|
|
97
|
+
}
|
|
96
98
|
onJoin && onJoin(scCourse, _status);
|
|
97
99
|
})
|
|
98
100
|
.catch((e) => {
|
|
@@ -114,7 +116,7 @@ function CourseJoinButton(inProps) {
|
|
|
114
116
|
scContext.settings.handleAnonymousAction();
|
|
115
117
|
}
|
|
116
118
|
else {
|
|
117
|
-
status === types_1.SCCourseJoinStatusType.JOINED
|
|
119
|
+
status === types_1.SCCourseJoinStatusType.JOINED ? leave() : join();
|
|
118
120
|
}
|
|
119
121
|
};
|
|
120
122
|
/**
|
|
@@ -140,9 +142,9 @@ function CourseJoinButton(inProps) {
|
|
|
140
142
|
}
|
|
141
143
|
return _status;
|
|
142
144
|
}, [status, scCourse]);
|
|
143
|
-
if (!scCourse ||
|
|
145
|
+
if (!scCourse || isCourseAdmin) {
|
|
144
146
|
return null;
|
|
145
147
|
}
|
|
146
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ size: "small", variant: "outlined", onClick: handleClick, loading: scUserContext.user ? scCoursesManager.isLoading(scCourse) : null, disabled: status === types_1.SCCourseJoinStatusType.REQUESTED, className: (0, classnames_1.default)(classes.root, className) }, rest, { children:
|
|
148
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ size: "small", variant: "outlined", onClick: handleClick, loading: scUserContext.user ? scCoursesManager.isLoading(scCourse) : null, disabled: status === types_1.SCCourseJoinStatusType.REQUESTED, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: getStatus })));
|
|
147
149
|
}
|
|
148
150
|
exports.default = CourseJoinButton;
|
|
@@ -45,7 +45,7 @@ function CreateCourseButton(inProps) {
|
|
|
45
45
|
props: inProps,
|
|
46
46
|
name: PREFIX
|
|
47
47
|
});
|
|
48
|
-
const { className, CourseFormDialogComponentProps = {}, children } = props, rest = tslib_1.__rest(props, ["className", "CourseFormDialogComponentProps", "children"]);
|
|
48
|
+
const { className, CourseFormDialogComponentProps = { CourseFormComponentProps: { hidePaywalls: true } }, children } = props, rest = tslib_1.__rest(props, ["className", "CourseFormDialogComponentProps", "children"]);
|
|
49
49
|
// CONTEXT
|
|
50
50
|
const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
|
|
51
51
|
// STATE
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
2
|
+
import { SCPaymentProduct } from '@selfcommunity/types';
|
|
3
|
+
export interface CreatePaymentProductFormProps extends BoxProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
onCreate?: (p: SCPaymentProduct) => void;
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
onError?: (e: any) => void;
|
|
8
|
+
onChange?: (p: any) => void;
|
|
9
|
+
}
|
|
10
|
+
export default function CreatePaymentProductForm(inProps: CreatePaymentProductFormProps): JSX.Element;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_number_format_1 = require("react-number-format");
|
|
8
|
+
const system_1 = require("@mui/system");
|
|
9
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
10
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
11
|
+
const constants_1 = require("./constants");
|
|
12
|
+
const lab_1 = require("@mui/lab");
|
|
13
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
14
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
15
|
+
const Errors_1 = require("../../constants/Errors");
|
|
16
|
+
const react_intl_1 = require("react-intl");
|
|
17
|
+
const Payments_1 = require("../../constants/Payments");
|
|
18
|
+
const classes = {
|
|
19
|
+
root: `${constants_1.PREFIX}-root`,
|
|
20
|
+
error: `${constants_1.PREFIX}-root`
|
|
21
|
+
};
|
|
22
|
+
const Root = (0, material_1.styled)(material_1.Box, {
|
|
23
|
+
slot: 'Root',
|
|
24
|
+
name: constants_1.PREFIX
|
|
25
|
+
})(({ theme }) => ({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
justifyContent: 'space-evenly',
|
|
29
|
+
padding: theme.spacing(),
|
|
30
|
+
'& .MuiFormControl-root': {
|
|
31
|
+
marginBottom: theme.spacing(2)
|
|
32
|
+
},
|
|
33
|
+
'& .MuiButton-root': {
|
|
34
|
+
maxWidth: 50
|
|
35
|
+
},
|
|
36
|
+
[`& .${classes.error}`]: {
|
|
37
|
+
color: theme.palette.error.main
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
const NumericFormatCustom = react_1.default.forwardRef(function NumericFormatCustom(props, ref) {
|
|
41
|
+
const { onChange } = props, other = tslib_1.__rest(props, ["onChange"]);
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, Object.assign({}, other, { getInputRef: ref, onValueChange: (values) => {
|
|
43
|
+
onChange({
|
|
44
|
+
target: {
|
|
45
|
+
name: props.name,
|
|
46
|
+
value: values.value
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}, thousandSeparator: true, valueIsNumericString: true })));
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Initial Errors
|
|
53
|
+
*/
|
|
54
|
+
const _initialFieldsError = { name: null, description: null, unitAmount: null };
|
|
55
|
+
function CreatePaymentProductForm(inProps) {
|
|
56
|
+
// PROPS
|
|
57
|
+
const props = (0, system_1.useThemeProps)({
|
|
58
|
+
props: inProps,
|
|
59
|
+
name: constants_1.PREFIX
|
|
60
|
+
});
|
|
61
|
+
const { className, onCreate, onCancel, onError, onChange } = props, rest = tslib_1.__rest(props, ["className", "onCreate", "onCancel", "onError", "onChange"]);
|
|
62
|
+
// STATE
|
|
63
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
64
|
+
const [name, setName] = (0, react_1.useState)('');
|
|
65
|
+
const [description, setDescription] = (0, react_1.useState)('');
|
|
66
|
+
const [unitAmount, setUnitAmount] = (0, react_1.useState)(0.5);
|
|
67
|
+
const [fieldsError, setFieldsError] = (0, react_1.useState)(_initialFieldsError);
|
|
68
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
69
|
+
// HOOKS
|
|
70
|
+
const { isPaymentsEnabled } = (0, react_core_1.useSCPaymentsEnabled)();
|
|
71
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
72
|
+
/**
|
|
73
|
+
* Handle change text
|
|
74
|
+
* @param e
|
|
75
|
+
*/
|
|
76
|
+
const handleChange = (0, react_1.useCallback)((field, e) => {
|
|
77
|
+
switch (field) {
|
|
78
|
+
case 'name':
|
|
79
|
+
setName(e.target.value);
|
|
80
|
+
break;
|
|
81
|
+
case 'description':
|
|
82
|
+
setDescription(e.target.value);
|
|
83
|
+
break;
|
|
84
|
+
case 'unitAmount':
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
setUnitAmount(e.target.value);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({ name, description, unitAmount });
|
|
91
|
+
}, [setName, setDescription, setUnitAmount, onChange]);
|
|
92
|
+
const isValid = (0, react_1.useMemo)(() => () => {
|
|
93
|
+
setFieldsError(_initialFieldsError);
|
|
94
|
+
let _invalid = true;
|
|
95
|
+
if (!name) {
|
|
96
|
+
setFieldsError(Object.assign(Object.assign({}, fieldsError), { name: intl.formatMessage({
|
|
97
|
+
id: 'ui.createPaymentProductForm.error.name.required',
|
|
98
|
+
defaultMessage: 'ui.createPaymentProductForm.error.name.required'
|
|
99
|
+
}) }));
|
|
100
|
+
_invalid = _invalid && false;
|
|
101
|
+
}
|
|
102
|
+
if (!unitAmount || unitAmount < 0.5) {
|
|
103
|
+
setFieldsError(Object.assign(Object.assign({}, fieldsError), { unitAmount: intl.formatMessage({ id: 'ui.createPaymentProductForm.error.price.required', defaultMessage: 'ui.createPaymentProductForm.error.price.required' }, { min: Payments_1.DEFAULT_MIN_PRICE }) }));
|
|
104
|
+
_invalid = _invalid && false;
|
|
105
|
+
}
|
|
106
|
+
return _invalid;
|
|
107
|
+
}, [setFieldsError, name, unitAmount]);
|
|
108
|
+
/**
|
|
109
|
+
* Handle create product
|
|
110
|
+
*/
|
|
111
|
+
const handleCreateProduct = (0, react_1.useCallback)(() => {
|
|
112
|
+
setLoading(true);
|
|
113
|
+
setError(null);
|
|
114
|
+
if (isValid()) {
|
|
115
|
+
api_services_1.PaymentApiClient.createPaymentProduct(Object.assign({ name, unit_amount: unitAmount * 100 }, (description ? { description } : {})))
|
|
116
|
+
.then((p) => {
|
|
117
|
+
setLoading(false);
|
|
118
|
+
onCreate && onCreate(p);
|
|
119
|
+
})
|
|
120
|
+
.catch((error) => {
|
|
121
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
122
|
+
setLoading(false);
|
|
123
|
+
const _e = intl.formatMessage({
|
|
124
|
+
id: 'ui.createPaymentProductForm.title',
|
|
125
|
+
defaultMessage: 'ui.createPaymentProductForm.title'
|
|
126
|
+
});
|
|
127
|
+
onError === null || onError === void 0 ? void 0 : onError(_e);
|
|
128
|
+
setError(_e);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
setLoading(false);
|
|
133
|
+
}
|
|
134
|
+
}, [loading, name, description, unitAmount, error]);
|
|
135
|
+
if (!isPaymentsEnabled) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
console.log(fieldsError);
|
|
139
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ mb: 1 }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createPaymentProductForm.title", defaultMessage: "ui.createPaymentProductForm.title" }) })), (0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({ size: "small", id: "name", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createPaymentProductForm.name", defaultMessage: "ui.createPaymentProductForm.name" }), variant: "outlined", fullWidth: true, value: name, error: Boolean(fieldsError && fieldsError.name) }, (Boolean(fieldsError && fieldsError.name) && { helperText: fieldsError.name }), { onChange: (e) => handleChange('name', e) })), (0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({ size: "small", id: "description", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createPaymentProductForm.description", defaultMessage: "ui.createPaymentProductForm.description" }), variant: "outlined", fullWidth: true, value: description, onChange: (e) => handleChange('description', e), multiline: true, maxRows: 2, error: Boolean(fieldsError && fieldsError.description) }, (Boolean(fieldsError && fieldsError.description) && { helperText: fieldsError.description }))), (0, jsx_runtime_1.jsx)(material_1.TextField, { label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createPaymentProductForm.price", defaultMessage: "ui.createPaymentProductForm.price" }), variant: "outlined", value: unitAmount, onChange: (e) => handleChange('unitAmount', e), name: "unitAmount", id: "unitAmount", helperText: fieldsError && fieldsError.unitAmount ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fieldsError.unitAmount })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: intl.formatMessage({ id: 'ui.createPaymentProductForm.minPrice', defaultMessage: 'ui.createPaymentProductForm.minPrice' }, { min: Payments_1.DEFAULT_MIN_PRICE }) })), InputProps: {
|
|
140
|
+
startAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: "\u20AC" })),
|
|
141
|
+
inputComponent: NumericFormatCustom
|
|
142
|
+
}, fullWidth: true, error: Boolean(fieldsError && fieldsError.unitAmount) }), error && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "div", className: classes.error, variant: "body2" }, { children: error }))), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "flex-end", alignItems: "flex-end", spacing: 1 }, { children: [onCancel && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", color: "inherit", onClick: onCancel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createPaymentProductForm.btn.cancel", defaultMessage: "ui.createPaymentProductForm.btn.cancel" }) }))), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ loading: loading, variant: "contained", size: "small", color: "error", onClick: handleCreateProduct }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createPaymentProductForm.btn.create", defaultMessage: "ui.createPaymentProductForm.btn.create" }) }))] }))] })));
|
|
143
|
+
}
|
|
144
|
+
exports.default = CreatePaymentProductForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCCreatePaymentProductForm";
|
|
@@ -46,6 +46,7 @@ function EditEventButton(inProps) {
|
|
|
46
46
|
const { scEvent, setSCEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event });
|
|
47
47
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
48
48
|
const handleSuccess = (data) => {
|
|
49
|
+
console.log(data);
|
|
49
50
|
setSCEvent(data);
|
|
50
51
|
onEditSuccess && onEditSuccess(data);
|
|
51
52
|
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ToolbarPluginProps } from './plugins/ToolbarPlugin';
|
|
3
3
|
import { MediaPluginProps } from './plugins';
|
|
4
4
|
import { SCMediaType } from '@selfcommunity/types';
|
|
5
|
-
export type EditorRef = {
|
|
5
|
+
export declare type EditorRef = {
|
|
6
6
|
focus: () => void;
|
|
7
7
|
};
|
|
8
8
|
export interface EditorProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedTextNode, Spread, TextNode } from 'lexical';
|
|
2
2
|
import { SCCategoryType } from '@selfcommunity/types';
|
|
3
3
|
import { DOMConversionMap } from 'lexical/LexicalNode';
|
|
4
|
-
export type SerializedHashtagNode = Spread<{
|
|
4
|
+
export declare type SerializedHashtagNode = Spread<{
|
|
5
5
|
category: SCCategoryType;
|
|
6
6
|
type: 'hashtag';
|
|
7
7
|
version: 1;
|