@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
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Button, Icon, Stack, Typography } from '@mui/material';
|
|
3
|
-
import { SCCoursePrivacyType } from '@selfcommunity/types';
|
|
3
|
+
import { SCContentType, SCCourseJoinStatusType, SCCoursePrivacyType } from '@selfcommunity/types';
|
|
4
4
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
5
5
|
import { PREFIX } from './constants';
|
|
6
6
|
import { memo } from 'react';
|
|
7
|
-
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
7
|
+
import { Link, SCRoutes, useSCPaymentsEnabled, useSCRouting } from '@selfcommunity/react-core';
|
|
8
8
|
import { SCCourseEditTabType } from '../../types';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import CourseTypePopover from '../../shared/CourseTypePopover';
|
|
11
|
+
import BuyButton from '../BuyButton';
|
|
11
12
|
const classes = {
|
|
12
13
|
header: `${PREFIX}-header`,
|
|
13
14
|
img: `${PREFIX}-header-img`,
|
|
@@ -25,17 +26,23 @@ function getUrlEditDashboard(course) {
|
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
function HeaderCourseDashboard(props) {
|
|
29
|
+
var _a;
|
|
28
30
|
// PROPS
|
|
29
31
|
const { course, hasAction = false } = props;
|
|
30
32
|
// CONTEXTS
|
|
31
33
|
const scRoutingContext = useSCRouting();
|
|
32
34
|
// INTL
|
|
33
35
|
const intl = useIntl();
|
|
36
|
+
// PAYMENTS
|
|
37
|
+
const { isPaymentsEnabled } = useSCPaymentsEnabled();
|
|
34
38
|
return (_jsxs(Box, Object.assign({ className: classes.header }, { children: [_jsx("img", { src: course.image_bigger, alt: course.image_bigger, className: classes.img }), _jsx(Typography, Object.assign({ variant: "h3", className: classes.contrastColor }, { children: course.name })), _jsxs(Stack, Object.assign({ className: classes.outerWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.innerWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classNames(classes.iconWrapper, classes.contrastColor) }, { children: [_jsx(Icon, Object.assign({ fontSize: "small" }, { children: "public" })), _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.course.label", defaultMessage: "ui.course.label", values: {
|
|
35
39
|
privacy: intl.formatMessage({
|
|
36
40
|
id: `ui.course.privacy.${course.privacy === SCCoursePrivacyType.DRAFT ? 'draft' : course.privacy}`,
|
|
37
41
|
defaultMessage: `ui.course.privacy.${course.privacy === SCCoursePrivacyType.DRAFT ? 'draft' : course.privacy}`
|
|
38
42
|
})
|
|
39
|
-
} }) }))] })), _jsx(CourseTypePopover, { course: course })
|
|
43
|
+
} }) }))] })), _jsx(CourseTypePopover, { course: course }), isPaymentsEnabled &&
|
|
44
|
+
((_a = course.paywalls) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
|
|
45
|
+
(course.privacy === SCCoursePrivacyType.OPEN ||
|
|
46
|
+
(course.privacy === SCCoursePrivacyType.PRIVATE && course.join_status && course.join_status !== SCCourseJoinStatusType.REQUESTED)) && (_jsx(BuyButton, { size: "md", variant: "text", startIcon: _jsx(Icon, { children: "dredit-card" }), contentType: SCContentType.COURSE, content: course, label: _jsx(FormattedMessage, { id: "ui.course.paid", defaultMessage: "ui.course.paid" }) }))] })), hasAction && (_jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.COURSE_EDIT_ROUTE_NAME, getUrlEditDashboard(course)), size: "small", color: "primary", variant: "contained" }, { children: _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: "ui.course.dashboard.teacher.btn.label", defaultMessage: "ui.course.dashboard.teacher.btn.label" }) })) })))] }))] })));
|
|
40
47
|
}
|
|
41
48
|
export default 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;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Fragment, memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { PREFIX } from './constants';
|
|
5
|
-
import { Avatar, Box, Divider, LinearProgress, Stack, styled, Typography, useThemeProps } from '@mui/material';
|
|
5
|
+
import { Avatar, Box, Divider, LinearProgress, Skeleton, Stack, styled, Typography, useThemeProps } from '@mui/material';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import HeaderCourseDashboard from './Header';
|
|
8
|
-
import { SCCourseJoinStatusType, SCCourseLessonCompletionStatusType, SCCoursePrivacyType } from '@selfcommunity/types';
|
|
8
|
+
import { SCContentType, SCCourseJoinStatusType, SCCourseLessonCompletionStatusType, SCCoursePrivacyType } from '@selfcommunity/types';
|
|
9
9
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
10
10
|
import ActionButton from './Student/ActionButton';
|
|
11
11
|
import { CLAPPING } from '../../assets/courses/clapping';
|
|
12
|
-
import { SCRoutes, useSCFetchCourse, useSCRouting, Link, useSCUser, useSCContext } from '@selfcommunity/react-core';
|
|
12
|
+
import { SCRoutes, useSCFetchCourse, useSCRouting, Link, useSCUser, useSCContext, useSCPaymentsEnabled } from '@selfcommunity/react-core';
|
|
13
13
|
import AccordionLessons from '../../shared/AccordionLessons';
|
|
14
14
|
import { CourseService } from '@selfcommunity/api-services';
|
|
15
15
|
import { Logger } from '@selfcommunity/utils';
|
|
@@ -17,6 +17,7 @@ import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
|
17
17
|
import { useSnackbar } from 'notistack';
|
|
18
18
|
import StudentSkeleton from './Student/Skeleton';
|
|
19
19
|
import UserAvatar from '../../shared/UserAvatar';
|
|
20
|
+
import BuyButton from '../BuyButton';
|
|
20
21
|
const BUTTON_MESSAGES = {
|
|
21
22
|
dashboard: 'ui.course.dashboard.student.button.dashboard',
|
|
22
23
|
request: 'ui.course.dashboard.student.button.request',
|
|
@@ -109,6 +110,8 @@ function Student(inProps) {
|
|
|
109
110
|
const { scCourse, setSCCourse } = useSCFetchCourse({ id: courseId, course });
|
|
110
111
|
const intl = useIntl();
|
|
111
112
|
const { enqueueSnackbar } = useSnackbar();
|
|
113
|
+
// PAYMENTS
|
|
114
|
+
const { isPaymentsEnabled } = useSCPaymentsEnabled();
|
|
112
115
|
// EFFETCS
|
|
113
116
|
useEffect(() => {
|
|
114
117
|
if (scCourse) {
|
|
@@ -163,19 +166,27 @@ function Student(inProps) {
|
|
|
163
166
|
}, [scContext.settings.handleAnonymousAction]);
|
|
164
167
|
// MEMOS
|
|
165
168
|
const actionButton = useMemo(() => {
|
|
169
|
+
var _a, _b, _c;
|
|
166
170
|
if (!scCourse) {
|
|
167
|
-
return _jsx(
|
|
171
|
+
return _jsx(Skeleton, { animation: "wave", variant: "rectangular", width: "130px", height: "20px" });
|
|
168
172
|
}
|
|
169
173
|
return (_jsxs(Stack, Object.assign({ className: classes.actionsWrapper }, { children: [(scCourse.join_status === SCCourseJoinStatusType.CREATOR || scCourse.join_status === SCCourseJoinStatusType.MANAGER) && (_jsx(ActionButton, { labelId: BUTTON_MESSAGES.dashboard, to: scRoutingContext.url(SCRoutes.COURSE_DASHBOARD_ROUTE_NAME, scCourse), color: "inherit", variant: "outlined" })), (((scCourse.privacy === SCCoursePrivacyType.PRIVATE || scCourse.privacy === SCCoursePrivacyType.SECRET) &&
|
|
170
174
|
(scCourse.join_status === SCCourseJoinStatusType.MANAGER || scCourse.join_status === SCCourseJoinStatusType.JOINED)) ||
|
|
171
|
-
(scCourse.privacy === SCCoursePrivacyType.OPEN && scCourse.join_status !== SCCourseJoinStatusType.CREATOR)) &&
|
|
175
|
+
(scCourse.privacy === SCCoursePrivacyType.OPEN && scCourse.join_status !== SCCourseJoinStatusType.CREATOR)) &&
|
|
176
|
+
(!isPaymentsEnabled ||
|
|
177
|
+
!((_a = scCourse.paywalls) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
178
|
+
(isPaymentsEnabled &&
|
|
179
|
+
((_b = scCourse.paywalls) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
|
180
|
+
(scCourse.join_status === SCCourseJoinStatusType.JOINED || scCourse.join_status === SCCourseJoinStatusType.MANAGER))) && (_jsx(ActionButton, { labelId: scCourse.join_status === null
|
|
172
181
|
? BUTTON_MESSAGES.signUp
|
|
173
182
|
: scCourse.user_completion_rate === 0
|
|
174
183
|
? BUTTON_MESSAGES.start
|
|
175
184
|
: scCourse.user_completion_rate === 100
|
|
176
185
|
? BUTTON_MESSAGES.review
|
|
177
|
-
: BUTTON_MESSAGES.continue, to: scCourse.join_status !== null ? scRoutingContext.url(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 === SCCoursePrivacyType.PRIVATE &&
|
|
178
|
-
(scCourse.join_status === null || scCourse.join_status === SCCourseJoinStatusType.REQUESTED)
|
|
186
|
+
: BUTTON_MESSAGES.continue, to: scCourse.join_status !== null ? scRoutingContext.url(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 === SCCoursePrivacyType.PRIVATE &&
|
|
187
|
+
(scCourse.join_status === null || scCourse.join_status === SCCourseJoinStatusType.REQUESTED) ? (_jsx(ActionButton, { labelId: sentRequest ? BUTTON_MESSAGES.cancel : BUTTON_MESSAGES.request, color: "inherit", variant: "outlined", loading: loadingRequest, onClick: handleRequest })) : (isPaymentsEnabled &&
|
|
188
|
+
((_c = scCourse.paywalls) === null || _c === void 0 ? void 0 : _c.length) > 0 &&
|
|
189
|
+
!(scCourse.join_status === SCCourseJoinStatusType.CREATOR) && (_jsx(BuyButton, { contentType: SCContentType.COURSE, content: scCourse })))] })));
|
|
179
190
|
}, [scCourse, sentRequest, loadingRequest, handleRequest]);
|
|
180
191
|
if (!scCourse) {
|
|
181
192
|
return _jsx(StudentSkeleton, {});
|
|
@@ -4,8 +4,8 @@ import { LoadingButton } from '@mui/lab';
|
|
|
4
4
|
import { Box, CardActionArea, Card, CardContent, FormGroup, Paper, TextField, Typography, Chip, styled } from '@mui/material';
|
|
5
5
|
import { useThemeProps } from '@mui/system';
|
|
6
6
|
import { CourseService, formatHttpErrorCode } from '@selfcommunity/api-services';
|
|
7
|
-
import { SCPreferences, useSCPreferences } from '@selfcommunity/react-core';
|
|
8
|
-
import { SCCoursePrivacyType, SCCourseTypologyType } from '@selfcommunity/types';
|
|
7
|
+
import { SCPreferences, UserUtils, useSCPaymentsEnabled, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
|
|
8
|
+
import { SCContentType, SCCoursePrivacyType, SCCourseTypologyType } from '@selfcommunity/types';
|
|
9
9
|
import { Logger } from '@selfcommunity/utils';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import PubSub from 'pubsub-js';
|
|
@@ -19,6 +19,8 @@ import { COURSE_DESCRIPTION_MAX_LENGTH, COURSE_TITLE_MAX_LENGTH, SCCourseFormSte
|
|
|
19
19
|
import CategoryAutocomplete from '../CategoryAutocomplete';
|
|
20
20
|
import CourseEdit from './Edit';
|
|
21
21
|
import CoursePublicationDialog from './Dialog';
|
|
22
|
+
import PaywallsConfigurator from '../PaywallsConfigurator';
|
|
23
|
+
import { ContentAccessType } from '../PaywallsConfigurator/constants';
|
|
22
24
|
const messages = defineMessages({
|
|
23
25
|
name: {
|
|
24
26
|
id: 'ui.courseForm.name.placeholder',
|
|
@@ -57,7 +59,8 @@ const classes = {
|
|
|
57
59
|
stepCustomization: `${PREFIX}-step-customization`,
|
|
58
60
|
cardTitle: `${PREFIX}-card-title`,
|
|
59
61
|
title: `${PREFIX}-title`,
|
|
60
|
-
contrastColor: `${PREFIX}-contrast-color
|
|
62
|
+
contrastColor: `${PREFIX}-contrast-color`,
|
|
63
|
+
paywallsConfiguratorWrap: `${PREFIX}-paywalls-configurator-wrap`
|
|
61
64
|
};
|
|
62
65
|
const Root = styled(Box, {
|
|
63
66
|
name: PREFIX,
|
|
@@ -98,13 +101,13 @@ const Root = styled(Box, {
|
|
|
98
101
|
* @param inProps
|
|
99
102
|
*/
|
|
100
103
|
export default function CourseForm(inProps) {
|
|
101
|
-
var _a, _b, _c;
|
|
104
|
+
var _a, _b, _c, _d, _e;
|
|
102
105
|
//PROPS
|
|
103
106
|
const props = useThemeProps({
|
|
104
107
|
props: inProps,
|
|
105
108
|
name: PREFIX
|
|
106
109
|
});
|
|
107
|
-
const { className, onSuccess, onError, course = null, step = SCCourseFormStepType.GENERAL, onStepChange } = props, rest = __rest(props, ["className", "onSuccess", "onError", "course", "step", "onStepChange"]);
|
|
110
|
+
const { className, onSuccess, onError, course = null, step = SCCourseFormStepType.GENERAL, hidePaywalls = false, onStepChange } = props, rest = __rest(props, ["className", "onSuccess", "onError", "course", "step", "hidePaywalls", "onStepChange"]);
|
|
108
111
|
// INTL
|
|
109
112
|
const intl = useIntl();
|
|
110
113
|
const initialFieldState = {
|
|
@@ -115,6 +118,8 @@ export default function CourseForm(inProps) {
|
|
|
115
118
|
description: course ? course.description : '',
|
|
116
119
|
categories: course ? course.categories : [],
|
|
117
120
|
privacy: course ? course.privacy : '',
|
|
121
|
+
products: ((_a = course === null || course === void 0 ? void 0 : course.paywalls) === null || _a === void 0 ? void 0 : _a.map((p) => p.id)) || [],
|
|
122
|
+
contentAccessType: ((_b = course === null || course === void 0 ? void 0 : course.paywalls) === null || _b === void 0 ? void 0 : _b.length) ? ContentAccessType.PAID : ContentAccessType.FREE,
|
|
118
123
|
isSubmitting: false
|
|
119
124
|
};
|
|
120
125
|
// STATE
|
|
@@ -122,8 +127,13 @@ export default function CourseForm(inProps) {
|
|
|
122
127
|
const [_step, setStep] = useState(step);
|
|
123
128
|
const [error, setError] = useState({});
|
|
124
129
|
const [openDialog, setOpenDialog] = useState(false);
|
|
130
|
+
// CONTEXT
|
|
131
|
+
const scUserContext = useSCUser();
|
|
125
132
|
// PREFERENCES
|
|
126
133
|
const { preferences } = useSCPreferences();
|
|
134
|
+
// PAYMENTS
|
|
135
|
+
const { isPaymentsEnabled } = useSCPaymentsEnabled();
|
|
136
|
+
const isStaff = useMemo(() => scUserContext.user && UserUtils.isStaff(scUserContext.user), [scUserContext.user]);
|
|
127
137
|
const courseAdvancedEnabled = useMemo(() => preferences[SCPreferences.CONFIGURATIONS_COURSES_ADVANCED_ENABLED].value, [preferences]);
|
|
128
138
|
const _backgroundCover = Object.assign({}, (field.imageOriginal
|
|
129
139
|
? { background: `url('${field.imageOriginal}') center / cover` }
|
|
@@ -184,6 +194,7 @@ export default function CourseForm(inProps) {
|
|
|
184
194
|
* Handles the form submission for create/update action
|
|
185
195
|
*/
|
|
186
196
|
const handleSubmit = useCallback(() => {
|
|
197
|
+
var _a;
|
|
187
198
|
setField((prev) => (Object.assign(Object.assign({}, prev), { isSubmitting: true })));
|
|
188
199
|
const formData = new FormData();
|
|
189
200
|
if (field.imageOriginalFile) {
|
|
@@ -200,6 +211,12 @@ export default function CourseForm(inProps) {
|
|
|
200
211
|
formData.append(key, field.categories[key]);
|
|
201
212
|
}
|
|
202
213
|
}
|
|
214
|
+
if (field.products.length && field.contentAccessType === ContentAccessType.PAID && (isStaff || (course && ((_a = course.paywalls) === null || _a === void 0 ? void 0 : _a.length)))) {
|
|
215
|
+
formData.append(`products`, JSON.stringify(field.products));
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
formData.append(`products`, '[]');
|
|
219
|
+
}
|
|
203
220
|
let courseService;
|
|
204
221
|
if (course) {
|
|
205
222
|
courseService = CourseService.patchCourse(course.id, formData, {
|
|
@@ -241,6 +258,20 @@ export default function CourseForm(inProps) {
|
|
|
241
258
|
setError(error);
|
|
242
259
|
}
|
|
243
260
|
}, [setField, error]);
|
|
261
|
+
/**
|
|
262
|
+
* Handle change content access tyoe
|
|
263
|
+
* @param type
|
|
264
|
+
*/
|
|
265
|
+
const handleChangeContentAccessType = (type) => {
|
|
266
|
+
setField((prev) => (Object.assign(Object.assign({}, prev), { contentAccessType: type })));
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Handle change payment products
|
|
270
|
+
* @param products
|
|
271
|
+
*/
|
|
272
|
+
const handleChangePaymentsProducts = (products) => {
|
|
273
|
+
setField((prev) => (Object.assign(Object.assign({}, prev), { products: products.map((product) => product.id) })));
|
|
274
|
+
};
|
|
244
275
|
/**
|
|
245
276
|
* Handles for closing confirm dialog
|
|
246
277
|
*/
|
|
@@ -253,8 +284,8 @@ export default function CourseForm(inProps) {
|
|
|
253
284
|
return (_jsxs(Fragment, { children: [_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsxs(Box, Object.assign({ className: _step === SCCourseFormStepType.GENERAL ? classes.stepOne : classes.stepTwo }, { children: [_step === SCCourseFormStepType.GENERAL && (_jsx(Fragment, { children: Object.values(SCCourseTypologyType).map((option, index) => (_jsx(Card, Object.assign({ className: classNames(classes.card, { [classes.selected]: option === field.type }, { [classes.disabled]: !courseAdvancedEnabled && option !== SCCourseTypologyType.SELF }) }, { children: _jsx(CardActionArea, Object.assign({ onClick: () => setField((prev) => (Object.assign(Object.assign({}, prev), { ['type']: option }))) }, { children: _jsxs(CardContent, { children: [_jsxs(Typography, Object.assign({ variant: "subtitle2", className: classes.cardTitle }, { children: [_jsx(FormattedMessage, { id: `ui.courseForm.${option}.title`, defaultMessage: `ui.courseForm.${option}.title` }), !courseAdvancedEnabled && option !== SCCourseTypologyType.SELF && (_jsx(Chip, { variant: "outlined", color: "warning", size: "small", label: _jsx(FormattedMessage, { id: "ui.courseForm.comingSoon.chip", defaultMessage: "ui.courseForm.comingSoon.chip" }) }))] })), _jsx(Typography, Object.assign({ variant: "body2" }, { children: _jsx(FormattedMessage, { id: `ui.courseForm.${option}.info`, defaultMessage: `ui.courseForm.${option}.info` }) }))] }) })) }), index))) })), _step === SCCourseFormStepType.CUSTOMIZATION && (_jsxs(Fragment, { children: [course && (_jsx(Typography, Object.assign({ variant: "h5", className: classes.contrastColor }, { children: _jsx(FormattedMessage, { id: "ui.courseForm.edit.title.general", defaultMessage: "ui.courseForm.edit.title.general" }) }))), _jsxs(FormGroup, Object.assign({ className: classNames(classes.form, _step === SCCourseFormStepType.CUSTOMIZATION && course ? classes.stepCustomization : undefined) }, { children: [_jsx(Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: _jsx(UploadCourseCover, { isUploading: field.isSubmitting, onChange: handleChangeCover }) })), _jsx(TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
|
|
254
285
|
endAdornment: _jsx(Typography, Object.assign({ variant: "body2" }, { children: COURSE_TITLE_MAX_LENGTH - field.name.length }))
|
|
255
286
|
}, error: Boolean((!!course && !field.name) || field.name.length > COURSE_TITLE_MAX_LENGTH) || Boolean(error['nameError']), helperText: !!course && !field.name ? (_jsx(FormattedMessage, { id: "ui.courseForm.required", defaultMessage: "ui.courseForm.required" })) : field.name.length > COURSE_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.courseForm.name.error.maxLength", defaultMessage: "ui.courseForm.name.error.maxLength" })) : error['nameError'] ? (error['nameError']) : null }), _jsx(TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
|
|
256
|
-
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((
|
|
257
|
-
}, error: Boolean((!!field.privacy && !field.description) || ((
|
|
287
|
+
endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) ? COURSE_DESCRIPTION_MAX_LENGTH - field.description.length : COURSE_DESCRIPTION_MAX_LENGTH })))
|
|
288
|
+
}, error: Boolean((!!field.privacy && !field.description) || ((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > COURSE_DESCRIPTION_MAX_LENGTH), helperText: !!field.privacy && !field.description ? (_jsx(FormattedMessage, { id: "ui.courseForm.required", defaultMessage: "ui.courseForm.required" })) : (((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > COURSE_DESCRIPTION_MAX_LENGTH && (_jsx(FormattedMessage, { id: "ui.courseForm.description.error.maxLength", defaultMessage: "ui.courseForm.description.error.maxLength" }))) }), _jsx(CategoryAutocomplete, { defaultValue: field.categories, TextFieldProps: { label: intl.formatMessage(Object.keys(field.categories).length ? messages.category : messages.categoryEmpty) }, multiple: true, onChange: handleOnChangeCategory }), course && _jsx(CourseEdit, { course: course, onPrivacyChange: (privacy) => setField((prev) => (Object.assign(Object.assign({}, prev), { ['privacy']: privacy }))) }), isPaymentsEnabled && isStaff && !hidePaywalls && (_jsx(Box, Object.assign({ className: classes.paywallsConfiguratorWrap }, { children: _jsx(PaywallsConfigurator, Object.assign({}, (course && { contentId: course.id }), { contentType: SCContentType.COURSE, onChangeContentAccessType: handleChangeContentAccessType, onChangePaymentProducts: handleChangePaymentsProducts })) })))] }))] })), _jsx(Box, Object.assign({ className: classNames(classes.actions, _step === SCCourseFormStepType.CUSTOMIZATION && course ? classes.stepCustomization : undefined) }, { children: _jsx(LoadingButton, Object.assign({ size: "small", loading: field.isSubmitting, disabled: _step === SCCourseFormStepType.GENERAL
|
|
258
289
|
? !field.type || Object.keys(error).length !== 0
|
|
259
290
|
: _step === SCCourseFormStepType.CUSTOMIZATION &&
|
|
260
291
|
(!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
|
|
@@ -49,7 +49,7 @@ export default function CourseJoinButton(inProps) {
|
|
|
49
49
|
props: inProps,
|
|
50
50
|
name: PREFIX
|
|
51
51
|
});
|
|
52
|
-
const { className, courseId, course,
|
|
52
|
+
const { className, courseId, course, onJoin } = props, rest = __rest(props, ["className", "courseId", "course", "onJoin"]);
|
|
53
53
|
// STATE
|
|
54
54
|
const [status, setStatus] = useState(null);
|
|
55
55
|
// CONTEXT
|
|
@@ -83,14 +83,16 @@ export default function CourseJoinButton(inProps) {
|
|
|
83
83
|
PubSub.publish(`${SCTopicType.GROUP}.${SCCourseEventType.ADD_MEMBER}`, { course, user });
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
const join = (
|
|
86
|
+
const join = () => {
|
|
87
87
|
scCoursesManager
|
|
88
|
-
.join(scCourse
|
|
88
|
+
.join(scCourse)
|
|
89
89
|
.then(() => {
|
|
90
90
|
const _status = scCourse.privacy === SCCoursePrivacyType.PRIVATE && scCourse.join_status !== SCCourseJoinStatusType.INVITED
|
|
91
91
|
? SCCourseJoinStatusType.REQUESTED
|
|
92
92
|
: SCCourseJoinStatusType.JOINED;
|
|
93
|
-
|
|
93
|
+
if (_status === SCCourseJoinStatusType.JOINED) {
|
|
94
|
+
notifyChanges(scCourse, scUserContext.user);
|
|
95
|
+
}
|
|
94
96
|
onJoin && onJoin(scCourse, _status);
|
|
95
97
|
})
|
|
96
98
|
.catch((e) => {
|
|
@@ -112,7 +114,7 @@ export default function CourseJoinButton(inProps) {
|
|
|
112
114
|
scContext.settings.handleAnonymousAction();
|
|
113
115
|
}
|
|
114
116
|
else {
|
|
115
|
-
status === SCCourseJoinStatusType.JOINED
|
|
117
|
+
status === SCCourseJoinStatusType.JOINED ? leave() : join();
|
|
116
118
|
}
|
|
117
119
|
};
|
|
118
120
|
/**
|
|
@@ -138,8 +140,8 @@ export default function CourseJoinButton(inProps) {
|
|
|
138
140
|
}
|
|
139
141
|
return _status;
|
|
140
142
|
}, [status, scCourse]);
|
|
141
|
-
if (!scCourse ||
|
|
143
|
+
if (!scCourse || isCourseAdmin) {
|
|
142
144
|
return null;
|
|
143
145
|
}
|
|
144
|
-
return (_jsx(Root, Object.assign({ size: "small", variant: "outlined", onClick: handleClick, loading: scUserContext.user ? scCoursesManager.isLoading(scCourse) : null, disabled: status === SCCourseJoinStatusType.REQUESTED, className: classNames(classes.root, className) }, rest, { children:
|
|
146
|
+
return (_jsx(Root, Object.assign({ size: "small", variant: "outlined", onClick: handleClick, loading: scUserContext.user ? scCoursesManager.isLoading(scCourse) : null, disabled: status === SCCourseJoinStatusType.REQUESTED, className: classNames(classes.root, className) }, rest, { children: getStatus })));
|
|
145
147
|
}
|
|
@@ -43,7 +43,7 @@ export default function CreateCourseButton(inProps) {
|
|
|
43
43
|
props: inProps,
|
|
44
44
|
name: PREFIX
|
|
45
45
|
});
|
|
46
|
-
const { className, CourseFormDialogComponentProps = {}, children } = props, rest = __rest(props, ["className", "CourseFormDialogComponentProps", "children"]);
|
|
46
|
+
const { className, CourseFormDialogComponentProps = { CourseFormComponentProps: { hidePaywalls: true } }, children } = props, rest = __rest(props, ["className", "CourseFormDialogComponentProps", "children"]);
|
|
47
47
|
// CONTEXT
|
|
48
48
|
const scUserContext = useContext(SCUserContext);
|
|
49
49
|
// 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,141 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
4
|
+
import { Box, Button, InputAdornment, Stack, TextField, Typography, styled } from '@mui/material';
|
|
5
|
+
import { NumericFormat } from 'react-number-format';
|
|
6
|
+
import { useThemeProps } from '@mui/system';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import { useSCPaymentsEnabled } from '@selfcommunity/react-core';
|
|
9
|
+
import { PREFIX } from './constants';
|
|
10
|
+
import { LoadingButton } from '@mui/lab';
|
|
11
|
+
import { PaymentApiClient } from '@selfcommunity/api-services';
|
|
12
|
+
import { Logger } from '@selfcommunity/utils';
|
|
13
|
+
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
14
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
15
|
+
import { DEFAULT_MIN_PRICE } from '../../constants/Payments';
|
|
16
|
+
const classes = {
|
|
17
|
+
root: `${PREFIX}-root`,
|
|
18
|
+
error: `${PREFIX}-root`
|
|
19
|
+
};
|
|
20
|
+
const Root = styled(Box, {
|
|
21
|
+
slot: 'Root',
|
|
22
|
+
name: PREFIX
|
|
23
|
+
})(({ theme }) => ({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
justifyContent: 'space-evenly',
|
|
27
|
+
padding: theme.spacing(),
|
|
28
|
+
'& .MuiFormControl-root': {
|
|
29
|
+
marginBottom: theme.spacing(2)
|
|
30
|
+
},
|
|
31
|
+
'& .MuiButton-root': {
|
|
32
|
+
maxWidth: 50
|
|
33
|
+
},
|
|
34
|
+
[`& .${classes.error}`]: {
|
|
35
|
+
color: theme.palette.error.main
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
const NumericFormatCustom = React.forwardRef(function NumericFormatCustom(props, ref) {
|
|
39
|
+
const { onChange } = props, other = __rest(props, ["onChange"]);
|
|
40
|
+
return (_jsx(NumericFormat, Object.assign({}, other, { getInputRef: ref, onValueChange: (values) => {
|
|
41
|
+
onChange({
|
|
42
|
+
target: {
|
|
43
|
+
name: props.name,
|
|
44
|
+
value: values.value
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}, thousandSeparator: true, valueIsNumericString: true })));
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Initial Errors
|
|
51
|
+
*/
|
|
52
|
+
const _initialFieldsError = { name: null, description: null, unitAmount: null };
|
|
53
|
+
export default function CreatePaymentProductForm(inProps) {
|
|
54
|
+
// PROPS
|
|
55
|
+
const props = useThemeProps({
|
|
56
|
+
props: inProps,
|
|
57
|
+
name: PREFIX
|
|
58
|
+
});
|
|
59
|
+
const { className, onCreate, onCancel, onError, onChange } = props, rest = __rest(props, ["className", "onCreate", "onCancel", "onError", "onChange"]);
|
|
60
|
+
// STATE
|
|
61
|
+
const [loading, setLoading] = useState(false);
|
|
62
|
+
const [name, setName] = useState('');
|
|
63
|
+
const [description, setDescription] = useState('');
|
|
64
|
+
const [unitAmount, setUnitAmount] = useState(0.5);
|
|
65
|
+
const [fieldsError, setFieldsError] = useState(_initialFieldsError);
|
|
66
|
+
const [error, setError] = useState(null);
|
|
67
|
+
// HOOKS
|
|
68
|
+
const { isPaymentsEnabled } = useSCPaymentsEnabled();
|
|
69
|
+
const intl = useIntl();
|
|
70
|
+
/**
|
|
71
|
+
* Handle change text
|
|
72
|
+
* @param e
|
|
73
|
+
*/
|
|
74
|
+
const handleChange = useCallback((field, e) => {
|
|
75
|
+
switch (field) {
|
|
76
|
+
case 'name':
|
|
77
|
+
setName(e.target.value);
|
|
78
|
+
break;
|
|
79
|
+
case 'description':
|
|
80
|
+
setDescription(e.target.value);
|
|
81
|
+
break;
|
|
82
|
+
case 'unitAmount':
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
setUnitAmount(e.target.value);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({ name, description, unitAmount });
|
|
89
|
+
}, [setName, setDescription, setUnitAmount, onChange]);
|
|
90
|
+
const isValid = useMemo(() => () => {
|
|
91
|
+
setFieldsError(_initialFieldsError);
|
|
92
|
+
let _invalid = true;
|
|
93
|
+
if (!name) {
|
|
94
|
+
setFieldsError(Object.assign(Object.assign({}, fieldsError), { name: intl.formatMessage({
|
|
95
|
+
id: 'ui.createPaymentProductForm.error.name.required',
|
|
96
|
+
defaultMessage: 'ui.createPaymentProductForm.error.name.required'
|
|
97
|
+
}) }));
|
|
98
|
+
_invalid = _invalid && false;
|
|
99
|
+
}
|
|
100
|
+
if (!unitAmount || unitAmount < 0.5) {
|
|
101
|
+
setFieldsError(Object.assign(Object.assign({}, fieldsError), { unitAmount: intl.formatMessage({ id: 'ui.createPaymentProductForm.error.price.required', defaultMessage: 'ui.createPaymentProductForm.error.price.required' }, { min: DEFAULT_MIN_PRICE }) }));
|
|
102
|
+
_invalid = _invalid && false;
|
|
103
|
+
}
|
|
104
|
+
return _invalid;
|
|
105
|
+
}, [setFieldsError, name, unitAmount]);
|
|
106
|
+
/**
|
|
107
|
+
* Handle create product
|
|
108
|
+
*/
|
|
109
|
+
const handleCreateProduct = useCallback(() => {
|
|
110
|
+
setLoading(true);
|
|
111
|
+
setError(null);
|
|
112
|
+
if (isValid()) {
|
|
113
|
+
PaymentApiClient.createPaymentProduct(Object.assign({ name, unit_amount: unitAmount * 100 }, (description ? { description } : {})))
|
|
114
|
+
.then((p) => {
|
|
115
|
+
setLoading(false);
|
|
116
|
+
onCreate && onCreate(p);
|
|
117
|
+
})
|
|
118
|
+
.catch((error) => {
|
|
119
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
120
|
+
setLoading(false);
|
|
121
|
+
const _e = intl.formatMessage({
|
|
122
|
+
id: 'ui.createPaymentProductForm.title',
|
|
123
|
+
defaultMessage: 'ui.createPaymentProductForm.title'
|
|
124
|
+
});
|
|
125
|
+
onError === null || onError === void 0 ? void 0 : onError(_e);
|
|
126
|
+
setError(_e);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
setLoading(false);
|
|
131
|
+
}
|
|
132
|
+
}, [loading, name, description, unitAmount, error]);
|
|
133
|
+
if (!isPaymentsEnabled) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
console.log(fieldsError);
|
|
137
|
+
return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Typography, Object.assign({ mb: 1 }, { children: _jsx(FormattedMessage, { id: "ui.createPaymentProductForm.title", defaultMessage: "ui.createPaymentProductForm.title" }) })), _jsx(TextField, Object.assign({ size: "small", id: "name", label: _jsx(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) })), _jsx(TextField, Object.assign({ size: "small", id: "description", label: _jsx(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 }))), _jsx(TextField, { label: _jsx(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 ? (_jsx(_Fragment, { children: fieldsError.unitAmount })) : (_jsx(_Fragment, { children: intl.formatMessage({ id: 'ui.createPaymentProductForm.minPrice', defaultMessage: 'ui.createPaymentProductForm.minPrice' }, { min: DEFAULT_MIN_PRICE }) })), InputProps: {
|
|
138
|
+
startAdornment: _jsx(InputAdornment, Object.assign({ position: "start" }, { children: "\u20AC" })),
|
|
139
|
+
inputComponent: NumericFormatCustom
|
|
140
|
+
}, fullWidth: true, error: Boolean(fieldsError && fieldsError.unitAmount) }), error && (_jsx(Typography, Object.assign({ component: "div", className: classes.error, variant: "body2" }, { children: error }))), _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "flex-end", alignItems: "flex-end", spacing: 1 }, { children: [onCancel && (_jsx(Button, Object.assign({ variant: "text", size: "small", color: "inherit", onClick: onCancel }, { children: _jsx(FormattedMessage, { id: "ui.createPaymentProductForm.btn.cancel", defaultMessage: "ui.createPaymentProductForm.btn.cancel" }) }))), _jsx(LoadingButton, Object.assign({ loading: loading, variant: "contained", size: "small", color: "error", onClick: handleCreateProduct }, { children: _jsx(FormattedMessage, { id: "ui.createPaymentProductForm.btn.create", defaultMessage: "ui.createPaymentProductForm.btn.create" }) }))] }))] })));
|
|
141
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCCreatePaymentProductForm";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PREFIX = 'SCCreatePaymentProductForm';
|
|
@@ -44,6 +44,7 @@ export default function EditEventButton(inProps) {
|
|
|
44
44
|
const { scEvent, setSCEvent } = useSCFetchEvent({ id: eventId, event });
|
|
45
45
|
const scUserContext = useSCUser();
|
|
46
46
|
const handleSuccess = (data) => {
|
|
47
|
+
console.log(data);
|
|
47
48
|
setSCEvent(data);
|
|
48
49
|
onEditSuccess && onEditSuccess(data);
|
|
49
50
|
};
|
|
@@ -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;
|
|
@@ -9,16 +9,16 @@ function convertHashtagElement(domNode) {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export class HashtagNode extends TextNode {
|
|
12
|
+
constructor(category, text, key) {
|
|
13
|
+
super(text !== null && text !== void 0 ? text : `#${category.name}`, key);
|
|
14
|
+
this.__category = category;
|
|
15
|
+
}
|
|
12
16
|
static getType() {
|
|
13
17
|
return 'hashtag';
|
|
14
18
|
}
|
|
15
19
|
static clone(node) {
|
|
16
20
|
return new HashtagNode(node.__category, node.__text, node.__key);
|
|
17
21
|
}
|
|
18
|
-
constructor(category, text, key) {
|
|
19
|
-
super(text !== null && text !== void 0 ? text : `#${category.name}`, key);
|
|
20
|
-
this.__category = category;
|
|
21
|
-
}
|
|
22
22
|
createDOM(config) {
|
|
23
23
|
const tag = 'hashtag';
|
|
24
24
|
const dom = document.createElement(tag);
|
|
@@ -12,7 +12,7 @@ export interface ImagePayload {
|
|
|
12
12
|
declare function convertImageElement(domNode: any): {
|
|
13
13
|
node: ImageNode;
|
|
14
14
|
};
|
|
15
|
-
export type SerializedImageNode = Spread<{
|
|
15
|
+
export declare type SerializedImageNode = Spread<{
|
|
16
16
|
altText: string;
|
|
17
17
|
maxWidth: number | string;
|
|
18
18
|
src: string;
|
|
@@ -104,18 +104,18 @@ function convertImageElement(domNode) {
|
|
|
104
104
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
105
105
|
// @ts-ignore
|
|
106
106
|
export class ImageNode extends DecoratorNode {
|
|
107
|
-
static getType() {
|
|
108
|
-
return 'image';
|
|
109
|
-
}
|
|
110
|
-
static clone(node) {
|
|
111
|
-
return new ImageNode(node.__src, node.__altText, node.__maxWidth, node.__key);
|
|
112
|
-
}
|
|
113
107
|
constructor(src, altText, maxWidth, key) {
|
|
114
108
|
super(key);
|
|
115
109
|
this.__src = src;
|
|
116
110
|
this.__altText = altText;
|
|
117
111
|
this.__maxWidth = maxWidth;
|
|
118
112
|
}
|
|
113
|
+
static getType() {
|
|
114
|
+
return 'image';
|
|
115
|
+
}
|
|
116
|
+
static clone(node) {
|
|
117
|
+
return new ImageNode(node.__src, node.__altText, node.__maxWidth, node.__key);
|
|
118
|
+
}
|
|
119
119
|
setWidthAndHeight(width, height) {
|
|
120
120
|
const writable = this.getWritable();
|
|
121
121
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedTextNode, Spread, TextNode } from 'lexical';
|
|
2
2
|
import { SCUserType } from '@selfcommunity/types';
|
|
3
3
|
import { DOMConversionMap } from 'lexical/LexicalNode';
|
|
4
|
-
export type SerializedMentionNode = Spread<{
|
|
4
|
+
export declare type SerializedMentionNode = Spread<{
|
|
5
5
|
user: SCUserType;
|
|
6
6
|
type: 'mention';
|
|
7
7
|
version: 1;
|