@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.
Files changed (627) hide show
  1. package/lib/cjs/assets/checkout/general.d.ts +2 -0
  2. package/lib/cjs/assets/checkout/general.js +3 -0
  3. package/lib/cjs/assets/checkout/success.d.ts +2 -0
  4. package/lib/cjs/assets/checkout/success.js +3 -0
  5. package/lib/cjs/assets/custom/formazione.d.ts +2 -0
  6. package/lib/cjs/assets/custom/formazione.js +3 -0
  7. package/lib/cjs/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +20 -2
  8. package/lib/cjs/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.d.ts +61 -0
  9. package/lib/cjs/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +106 -0
  10. package/lib/cjs/components/AcceptRequestUserGroupButton/index.d.ts +3 -0
  11. package/lib/cjs/components/AcceptRequestUserGroupButton/index.js +5 -0
  12. package/lib/cjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  13. package/lib/cjs/components/BottomNavigation/BottomNavigation.js +2 -2
  14. package/lib/cjs/components/BuyButton/BuyButton.d.ts +73 -0
  15. package/lib/cjs/components/BuyButton/BuyButton.js +196 -0
  16. package/lib/cjs/components/BuyButton/index.d.ts +3 -0
  17. package/lib/cjs/components/BuyButton/index.js +5 -0
  18. package/lib/cjs/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +5 -3
  19. package/lib/cjs/components/Category/Category.d.ts +5 -0
  20. package/lib/cjs/components/Category/Category.js +5 -5
  21. package/lib/cjs/components/CategoryFollowButton/CategoryFollowButton.d.ts +4 -0
  22. package/lib/cjs/components/CategoryFollowButton/CategoryFollowButton.js +32 -6
  23. package/lib/cjs/components/CategoryHeader/CategoryHeader.js +6 -1
  24. package/lib/cjs/components/CategoryTrendingUsersWidget/CategoryTrendingUsersWidget.js +9 -2
  25. package/lib/cjs/components/Checkout/Checkout.d.ts +14 -0
  26. package/lib/cjs/components/Checkout/Checkout.js +131 -0
  27. package/lib/cjs/components/Checkout/CheckoutHeaderInfoWidget.d.ts +8 -0
  28. package/lib/cjs/components/Checkout/CheckoutHeaderInfoWidget.js +34 -0
  29. package/lib/cjs/components/Checkout/Skeleton.d.ts +21 -0
  30. package/lib/cjs/components/Checkout/Skeleton.js +87 -0
  31. package/lib/cjs/components/Checkout/constants.d.ts +1 -0
  32. package/lib/cjs/components/Checkout/constants.js +4 -0
  33. package/lib/cjs/components/Checkout/index.d.ts +3 -0
  34. package/lib/cjs/components/Checkout/index.js +5 -0
  35. package/lib/cjs/components/CheckoutReturnDialog/CheckoutReturnDialog.d.ts +10 -0
  36. package/lib/cjs/components/CheckoutReturnDialog/CheckoutReturnDialog.js +171 -0
  37. package/lib/cjs/components/CheckoutReturnDialog/index.d.ts +3 -0
  38. package/lib/cjs/components/CheckoutReturnDialog/index.js +5 -0
  39. package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.d.ts +8 -0
  40. package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.js +69 -0
  41. package/lib/cjs/components/CommunityPaywalls/Skeleton.d.ts +27 -0
  42. package/lib/cjs/components/CommunityPaywalls/Skeleton.js +53 -0
  43. package/lib/cjs/components/CommunityPaywalls/constants.d.ts +1 -0
  44. package/lib/cjs/components/CommunityPaywalls/constants.js +4 -0
  45. package/lib/cjs/components/CommunityPaywalls/index.d.ts +4 -0
  46. package/lib/cjs/components/CommunityPaywalls/index.js +8 -0
  47. package/lib/cjs/components/Composer/Composer.d.ts +1 -0
  48. package/lib/cjs/components/Composer/Composer.js +82 -18
  49. package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +2 -2
  50. package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +2 -2
  51. package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +2 -2
  52. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +20 -13
  53. package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.d.ts +9 -0
  54. package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +61 -0
  55. package/lib/cjs/components/Composer/Layer/ScheduledLayer/index.d.ts +3 -0
  56. package/lib/cjs/components/Composer/Layer/ScheduledLayer/index.js +5 -0
  57. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +2 -1
  58. package/lib/cjs/components/ConnectionUserButton/ConnectionUserButton.js +6 -0
  59. package/lib/cjs/components/Course/Course.d.ts +5 -0
  60. package/lib/cjs/components/Course/Course.js +3 -3
  61. package/lib/cjs/components/CourseDashboard/Header.d.ts +2 -2
  62. package/lib/cjs/components/CourseDashboard/Header.js +8 -1
  63. package/lib/cjs/components/CourseDashboard/Student.d.ts +2 -2
  64. package/lib/cjs/components/CourseDashboard/Student.js +15 -4
  65. package/lib/cjs/components/CourseForm/CourseForm.d.ts +5 -0
  66. package/lib/cjs/components/CourseForm/CourseForm.js +36 -5
  67. package/lib/cjs/components/CourseJoinButton/CourseJoinButton.d.ts +1 -6
  68. package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +9 -7
  69. package/lib/cjs/components/CreateCourseButton/CreateCourseButton.js +1 -1
  70. package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.d.ts +10 -0
  71. package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.js +144 -0
  72. package/lib/cjs/components/CreatePaymentProductForm/constants.d.ts +1 -0
  73. package/lib/cjs/components/CreatePaymentProductForm/constants.js +4 -0
  74. package/lib/cjs/components/CreatePaymentProductForm/index.d.ts +3 -0
  75. package/lib/cjs/components/CreatePaymentProductForm/index.js +5 -0
  76. package/lib/cjs/components/EditEventButton/EditEventButton.js +1 -0
  77. package/lib/cjs/components/Editor/Editor.d.ts +1 -1
  78. package/lib/cjs/components/Editor/nodes/HashtagNode.d.ts +1 -1
  79. package/lib/cjs/components/Editor/nodes/HashtagNode.js +4 -4
  80. package/lib/cjs/components/Editor/nodes/ImageNode.d.ts +1 -1
  81. package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -6
  82. package/lib/cjs/components/Editor/nodes/MentionNode.d.ts +1 -1
  83. package/lib/cjs/components/Editor/nodes/MentionNode.js +4 -4
  84. package/lib/cjs/components/Editor/plugins/ApiPlugin.d.ts +1 -1
  85. package/lib/cjs/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
  86. package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
  87. package/lib/cjs/components/Event/Event.d.ts +5 -0
  88. package/lib/cjs/components/Event/Event.js +2 -2
  89. package/lib/cjs/components/EventForm/EventForm.js +47 -16
  90. package/lib/cjs/components/EventForm/types.d.ts +8 -5
  91. package/lib/cjs/components/EventFormDialog/EventFormDialog.js +7 -1
  92. package/lib/cjs/components/EventHeader/EventHeader.js +12 -3
  93. package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +27 -4
  94. package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +1 -1
  95. package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +11 -2
  96. package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +23 -13
  97. package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +18 -7
  98. package/lib/cjs/components/Feed/Feed.d.ts +2 -2
  99. package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
  100. package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
  101. package/lib/cjs/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +2 -1
  102. package/lib/cjs/components/FeedObject/FeedObject.js +16 -6
  103. package/lib/cjs/components/FeedObject/Poll/Choice/Choice.js +1 -1
  104. package/lib/cjs/components/FeedObject/Poll/Poll.js +1 -1
  105. package/lib/cjs/components/Group/Group.d.ts +6 -1
  106. package/lib/cjs/components/Group/Group.js +3 -3
  107. package/lib/cjs/components/GroupForm/GroupForm.js +37 -7
  108. package/lib/cjs/components/GroupHeader/GroupHeader.js +10 -2
  109. package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +3 -1
  110. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +7 -2
  111. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +6 -4
  112. package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +4 -2
  113. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -8
  114. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +30 -8
  115. package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +3 -2
  116. package/lib/cjs/components/LiveStreamForm/types.d.ts +3 -3
  117. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +1 -1
  118. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +1 -1
  119. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +1 -1
  120. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +2 -2
  121. package/lib/cjs/components/LiveStreamRoom/types.d.ts +1 -1
  122. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.d.ts +1 -0
  123. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +42 -4
  124. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
  125. package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
  126. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +6 -0
  127. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +1 -1
  128. package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +36 -5
  129. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +8 -3
  130. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +1 -1
  131. package/lib/cjs/components/PaymentDetailDialog/PaymentDetailDialog.d.ts +6 -0
  132. package/lib/cjs/components/PaymentDetailDialog/PaymentDetailDialog.js +40 -0
  133. package/lib/cjs/components/PaymentDetailDialog/index.d.ts +3 -0
  134. package/lib/cjs/components/PaymentDetailDialog/index.js +5 -0
  135. package/lib/cjs/components/PaymentOrder/PaymentOrder.d.ts +10 -0
  136. package/lib/cjs/components/PaymentOrder/PaymentOrder.js +80 -0
  137. package/lib/cjs/components/PaymentOrder/Skeleton.d.ts +30 -0
  138. package/lib/cjs/components/PaymentOrder/Skeleton.js +61 -0
  139. package/lib/cjs/components/PaymentOrder/constants.d.ts +1 -0
  140. package/lib/cjs/components/PaymentOrder/constants.js +4 -0
  141. package/lib/cjs/components/PaymentOrder/index.d.ts +3 -0
  142. package/lib/cjs/components/PaymentOrder/index.js +5 -0
  143. package/lib/cjs/components/PaymentOrderPdfButton/PaymentOrderPdfButton.d.ts +52 -0
  144. package/lib/cjs/components/PaymentOrderPdfButton/PaymentOrderPdfButton.js +74 -0
  145. package/lib/cjs/components/PaymentOrderPdfButton/index.d.ts +3 -0
  146. package/lib/cjs/components/PaymentOrderPdfButton/index.js +5 -0
  147. package/lib/cjs/components/PaymentOrders/PaymentOrders.d.ts +17 -0
  148. package/lib/cjs/components/PaymentOrders/PaymentOrders.js +264 -0
  149. package/lib/cjs/components/PaymentOrders/index.d.ts +3 -0
  150. package/lib/cjs/components/PaymentOrders/index.js +5 -0
  151. package/lib/cjs/components/PaymentProduct/PaymentProduct.d.ts +18 -0
  152. package/lib/cjs/components/PaymentProduct/PaymentProduct.js +48 -0
  153. package/lib/cjs/components/PaymentProduct/Skeleton.d.ts +25 -0
  154. package/lib/cjs/components/PaymentProduct/Skeleton.js +55 -0
  155. package/lib/cjs/components/PaymentProduct/constants.d.ts +1 -0
  156. package/lib/cjs/components/PaymentProduct/constants.js +4 -0
  157. package/lib/cjs/components/PaymentProduct/index.d.ts +3 -0
  158. package/lib/cjs/components/PaymentProduct/index.js +5 -0
  159. package/lib/cjs/components/PaymentProductPrice/PaymentProductPrice.d.ts +15 -0
  160. package/lib/cjs/components/PaymentProductPrice/PaymentProductPrice.js +61 -0
  161. package/lib/cjs/components/PaymentProductPrice/Skeleton.d.ts +21 -0
  162. package/lib/cjs/components/PaymentProductPrice/Skeleton.js +46 -0
  163. package/lib/cjs/components/PaymentProductPrice/constants.d.ts +1 -0
  164. package/lib/cjs/components/PaymentProductPrice/constants.js +4 -0
  165. package/lib/cjs/components/PaymentProductPrice/index.d.ts +3 -0
  166. package/lib/cjs/components/PaymentProductPrice/index.js +5 -0
  167. package/lib/cjs/components/PaymentProducts/PaymentProducts.d.ts +11 -0
  168. package/lib/cjs/components/PaymentProducts/PaymentProducts.js +76 -0
  169. package/lib/cjs/components/PaymentProducts/Skeleton.d.ts +21 -0
  170. package/lib/cjs/components/PaymentProducts/Skeleton.js +46 -0
  171. package/lib/cjs/components/PaymentProducts/constants.d.ts +1 -0
  172. package/lib/cjs/components/PaymentProducts/constants.js +4 -0
  173. package/lib/cjs/components/PaymentProducts/index.d.ts +3 -0
  174. package/lib/cjs/components/PaymentProducts/index.js +5 -0
  175. package/lib/cjs/components/Paywalls/Paywalls.d.ts +10 -0
  176. package/lib/cjs/components/Paywalls/Paywalls.js +94 -0
  177. package/lib/cjs/components/Paywalls/Skeleton.d.ts +21 -0
  178. package/lib/cjs/components/Paywalls/Skeleton.js +46 -0
  179. package/lib/cjs/components/Paywalls/constants.d.ts +1 -0
  180. package/lib/cjs/components/Paywalls/constants.js +4 -0
  181. package/lib/cjs/components/Paywalls/index.d.ts +3 -0
  182. package/lib/cjs/components/Paywalls/index.js +5 -0
  183. package/lib/cjs/components/PaywallsConfigurator/PaywallsConfigurator.d.ts +13 -0
  184. package/lib/cjs/components/PaywallsConfigurator/PaywallsConfigurator.js +252 -0
  185. package/lib/cjs/components/PaywallsConfigurator/Skeleton.d.ts +21 -0
  186. package/lib/cjs/components/PaywallsConfigurator/Skeleton.js +46 -0
  187. package/lib/cjs/components/PaywallsConfigurator/constants.d.ts +5 -0
  188. package/lib/cjs/components/PaywallsConfigurator/constants.js +9 -0
  189. package/lib/cjs/components/PaywallsConfigurator/index.d.ts +4 -0
  190. package/lib/cjs/components/PaywallsConfigurator/index.js +8 -0
  191. package/lib/cjs/components/PaywallsDialog/PaywallsDialog.d.ts +8 -0
  192. package/lib/cjs/components/PaywallsDialog/PaywallsDialog.js +43 -0
  193. package/lib/cjs/components/PaywallsDialog/index.d.ts +3 -0
  194. package/lib/cjs/components/PaywallsDialog/index.js +5 -0
  195. package/lib/cjs/components/PdfPreview/PdfPreview.d.ts +8 -0
  196. package/lib/cjs/components/PdfPreview/PdfPreview.js +94 -0
  197. package/lib/cjs/components/PdfPreview/Skeleton.d.ts +5 -0
  198. package/lib/cjs/components/PdfPreview/Skeleton.js +38 -0
  199. package/lib/cjs/components/PdfPreview/index.d.ts +3 -0
  200. package/lib/cjs/components/PdfPreview/index.js +5 -0
  201. package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.d.ts +11 -0
  202. package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.js +63 -0
  203. package/lib/cjs/components/PdfPreviewDialog/index.d.ts +3 -0
  204. package/lib/cjs/components/PdfPreviewDialog/index.js +5 -0
  205. package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +2 -1
  206. package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
  207. package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +4 -4
  208. package/lib/cjs/components/ToastNotifications/ToastNotifications.js +2 -10
  209. package/lib/cjs/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.d.ts +41 -0
  210. package/lib/cjs/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.js +94 -0
  211. package/lib/cjs/components/UserAddPaymentMethodDialog/constants.d.ts +1 -0
  212. package/lib/cjs/components/UserAddPaymentMethodDialog/constants.js +4 -0
  213. package/lib/cjs/components/UserAddPaymentMethodDialog/index.d.ts +3 -0
  214. package/lib/cjs/components/UserAddPaymentMethodDialog/index.js +5 -0
  215. package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.d.ts +40 -0
  216. package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +143 -0
  217. package/lib/cjs/components/UserAddPaymentMethodForm/constants.d.ts +1 -0
  218. package/lib/cjs/components/UserAddPaymentMethodForm/constants.js +4 -0
  219. package/lib/cjs/components/UserAddPaymentMethodForm/index.d.ts +3 -0
  220. package/lib/cjs/components/UserAddPaymentMethodForm/index.js +5 -0
  221. package/lib/cjs/components/UserBillingInfo/Skeleton.d.ts +25 -0
  222. package/lib/cjs/components/UserBillingInfo/Skeleton.js +12 -0
  223. package/lib/cjs/components/UserBillingInfo/UserBillingInfo.d.ts +35 -0
  224. package/lib/cjs/components/UserBillingInfo/UserBillingInfo.js +492 -0
  225. package/lib/cjs/components/UserBillingInfo/constants.d.ts +1 -0
  226. package/lib/cjs/components/UserBillingInfo/constants.js +4 -0
  227. package/lib/cjs/components/UserBillingInfo/index.d.ts +4 -0
  228. package/lib/cjs/components/UserBillingInfo/index.js +8 -0
  229. package/lib/cjs/components/UserBillingInfo/reducer.d.ts +77 -0
  230. package/lib/cjs/components/UserBillingInfo/reducer.js +96 -0
  231. package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.d.ts +44 -0
  232. package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.js +85 -0
  233. package/lib/cjs/components/UserChangeAddressDialog/constants.d.ts +1 -0
  234. package/lib/cjs/components/UserChangeAddressDialog/constants.js +4 -0
  235. package/lib/cjs/components/UserChangeAddressDialog/index.d.ts +3 -0
  236. package/lib/cjs/components/UserChangeAddressDialog/index.js +5 -0
  237. package/lib/cjs/components/UserConnectionsRequestsSentWidget/UserConnectionsRequestsSentWidget.js +6 -6
  238. package/lib/cjs/components/UserConnectionsRequestsWidget/UserConnectionsRequestsWidget.js +5 -5
  239. package/lib/cjs/components/UserConnectionsWidget/UserConnectionsWidget.js +8 -5
  240. package/lib/cjs/components/UserCounters/UserCounters.js +20 -17
  241. package/lib/cjs/components/UserFollowedCategoriesWidget/UserFollowedCategoriesWidget.js +9 -6
  242. package/lib/cjs/components/UserPaymentMethods/Skeleton.d.ts +15 -0
  243. package/lib/cjs/components/UserPaymentMethods/Skeleton.js +49 -0
  244. package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.d.ts +19 -0
  245. package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.js +338 -0
  246. package/lib/cjs/components/UserPaymentMethods/constants.d.ts +1 -0
  247. package/lib/cjs/components/UserPaymentMethods/constants.js +4 -0
  248. package/lib/cjs/components/UserPaymentMethods/index.d.ts +4 -0
  249. package/lib/cjs/components/UserPaymentMethods/index.js +8 -0
  250. package/lib/cjs/components/UserPaymentMethodsPortal/Skeleton.d.ts +22 -0
  251. package/lib/cjs/components/UserPaymentMethodsPortal/Skeleton.js +37 -0
  252. package/lib/cjs/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.d.ts +44 -0
  253. package/lib/cjs/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.js +103 -0
  254. package/lib/cjs/components/UserPaymentMethodsPortal/constants.d.ts +1 -0
  255. package/lib/cjs/components/UserPaymentMethodsPortal/constants.js +4 -0
  256. package/lib/cjs/components/UserPaymentMethodsPortal/index.d.ts +4 -0
  257. package/lib/cjs/components/UserPaymentMethodsPortal/index.js +8 -0
  258. package/lib/cjs/components/UserSuggestionWidget/UserSuggestionWidget.js +7 -5
  259. package/lib/cjs/constants/Billing.d.ts +10 -0
  260. package/lib/cjs/constants/Billing.js +60 -0
  261. package/lib/cjs/constants/ContributionsActionsMenu.d.ts +1 -0
  262. package/lib/cjs/constants/ContributionsActionsMenu.js +2 -1
  263. package/lib/cjs/constants/Country.d.ts +5 -0
  264. package/lib/cjs/constants/Country.js +271 -0
  265. package/lib/cjs/constants/DefaultDrawerContent.d.ts +1 -0
  266. package/lib/cjs/constants/DefaultDrawerContent.js +4 -0
  267. package/lib/cjs/constants/Payments.d.ts +4 -0
  268. package/lib/cjs/constants/Payments.js +7 -0
  269. package/lib/cjs/index.d.ts +23 -1
  270. package/lib/cjs/index.js +54 -2
  271. package/lib/cjs/shared/AutoPlayer/index.d.ts +0 -5
  272. package/lib/cjs/shared/AutoPlayer/index.js +5 -4
  273. package/lib/cjs/shared/ContributionActionsMenu/index.d.ts +4 -0
  274. package/lib/cjs/shared/ContributionActionsMenu/index.js +56 -5
  275. package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.d.ts +1 -1
  276. package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.js +3 -1
  277. package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.d.ts +44 -0
  278. package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +53 -0
  279. package/lib/cjs/shared/HiddenPurchasableContent/index.d.ts +3 -0
  280. package/lib/cjs/shared/HiddenPurchasableContent/index.js +5 -0
  281. package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
  282. package/lib/cjs/shared/Media/File/DisplayComponent.d.ts +2 -1
  283. package/lib/cjs/shared/Media/File/DisplayComponent.js +58 -32
  284. package/lib/cjs/shared/Media/File/DocComponent.d.ts +10 -0
  285. package/lib/cjs/shared/Media/File/DocComponent.js +34 -0
  286. package/lib/cjs/shared/Media/File/PreviewComponent.d.ts +2 -2
  287. package/lib/cjs/shared/Media/File/PreviewComponent.js +15 -17
  288. package/lib/cjs/shared/Media/File/TriggerButton.js +14 -1
  289. package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
  290. package/lib/cjs/shared/Media/File/filter.d.ts +2 -2
  291. package/lib/cjs/shared/Media/File/filter.js +5 -1
  292. package/lib/cjs/shared/Media/File/index.js +2 -2
  293. package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
  294. package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
  295. package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
  296. package/lib/cjs/shared/Tags/index.js +7 -3
  297. package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
  298. package/lib/cjs/types/composer.d.ts +1 -1
  299. package/lib/cjs/types/index.d.ts +2 -1
  300. package/lib/cjs/types/index.js +5 -1
  301. package/lib/cjs/types/payment.d.ts +25 -0
  302. package/lib/cjs/types/payment.js +29 -0
  303. package/lib/cjs/utils/address.d.ts +10 -0
  304. package/lib/cjs/utils/address.js +24 -0
  305. package/lib/cjs/utils/checkout.d.ts +2 -0
  306. package/lib/cjs/utils/checkout.js +23 -0
  307. package/lib/cjs/utils/payment.d.ts +17 -0
  308. package/lib/cjs/utils/payment.js +69 -0
  309. package/lib/esm/assets/checkout/general.d.ts +2 -0
  310. package/lib/esm/assets/checkout/general.js +1 -0
  311. package/lib/esm/assets/checkout/success.d.ts +2 -0
  312. package/lib/esm/assets/checkout/success.js +1 -0
  313. package/lib/esm/assets/custom/formazione.d.ts +2 -0
  314. package/lib/esm/assets/custom/formazione.js +1 -0
  315. package/lib/esm/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +20 -2
  316. package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.d.ts +61 -0
  317. package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +103 -0
  318. package/lib/esm/components/AcceptRequestUserGroupButton/index.d.ts +3 -0
  319. package/lib/esm/components/AcceptRequestUserGroupButton/index.js +2 -0
  320. package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  321. package/lib/esm/components/BottomNavigation/BottomNavigation.js +2 -2
  322. package/lib/esm/components/BuyButton/BuyButton.d.ts +73 -0
  323. package/lib/esm/components/BuyButton/BuyButton.js +193 -0
  324. package/lib/esm/components/BuyButton/index.d.ts +3 -0
  325. package/lib/esm/components/BuyButton/index.js +2 -0
  326. package/lib/esm/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +6 -4
  327. package/lib/esm/components/Category/Category.d.ts +5 -0
  328. package/lib/esm/components/Category/Category.js +5 -5
  329. package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.d.ts +4 -0
  330. package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.js +34 -8
  331. package/lib/esm/components/CategoryHeader/CategoryHeader.js +7 -2
  332. package/lib/esm/components/CategoryTrendingUsersWidget/CategoryTrendingUsersWidget.js +9 -2
  333. package/lib/esm/components/Checkout/Checkout.d.ts +14 -0
  334. package/lib/esm/components/Checkout/Checkout.js +128 -0
  335. package/lib/esm/components/Checkout/CheckoutHeaderInfoWidget.d.ts +8 -0
  336. package/lib/esm/components/Checkout/CheckoutHeaderInfoWidget.js +30 -0
  337. package/lib/esm/components/Checkout/Skeleton.d.ts +21 -0
  338. package/lib/esm/components/Checkout/Skeleton.js +84 -0
  339. package/lib/esm/components/Checkout/constants.d.ts +1 -0
  340. package/lib/esm/components/Checkout/constants.js +1 -0
  341. package/lib/esm/components/Checkout/index.d.ts +3 -0
  342. package/lib/esm/components/Checkout/index.js +2 -0
  343. package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.d.ts +10 -0
  344. package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.js +168 -0
  345. package/lib/esm/components/CheckoutReturnDialog/index.d.ts +3 -0
  346. package/lib/esm/components/CheckoutReturnDialog/index.js +2 -0
  347. package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.d.ts +8 -0
  348. package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.js +66 -0
  349. package/lib/esm/components/CommunityPaywalls/Skeleton.d.ts +27 -0
  350. package/lib/esm/components/CommunityPaywalls/Skeleton.js +50 -0
  351. package/lib/esm/components/CommunityPaywalls/constants.d.ts +1 -0
  352. package/lib/esm/components/CommunityPaywalls/constants.js +1 -0
  353. package/lib/esm/components/CommunityPaywalls/index.d.ts +4 -0
  354. package/lib/esm/components/CommunityPaywalls/index.js +4 -0
  355. package/lib/esm/components/Composer/Composer.d.ts +1 -0
  356. package/lib/esm/components/Composer/Composer.js +82 -18
  357. package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +2 -2
  358. package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +2 -2
  359. package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +2 -2
  360. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +20 -13
  361. package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.d.ts +9 -0
  362. package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +59 -0
  363. package/lib/esm/components/Composer/Layer/ScheduledLayer/index.d.ts +3 -0
  364. package/lib/esm/components/Composer/Layer/ScheduledLayer/index.js +2 -0
  365. package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +2 -1
  366. package/lib/esm/components/ConnectionUserButton/ConnectionUserButton.js +6 -0
  367. package/lib/esm/components/Course/Course.d.ts +5 -0
  368. package/lib/esm/components/Course/Course.js +3 -3
  369. package/lib/esm/components/CourseDashboard/Header.d.ts +2 -2
  370. package/lib/esm/components/CourseDashboard/Header.js +10 -3
  371. package/lib/esm/components/CourseDashboard/Student.d.ts +2 -2
  372. package/lib/esm/components/CourseDashboard/Student.js +19 -8
  373. package/lib/esm/components/CourseForm/CourseForm.d.ts +5 -0
  374. package/lib/esm/components/CourseForm/CourseForm.js +38 -7
  375. package/lib/esm/components/CourseJoinButton/CourseJoinButton.d.ts +1 -6
  376. package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +9 -7
  377. package/lib/esm/components/CreateCourseButton/CreateCourseButton.js +1 -1
  378. package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.d.ts +10 -0
  379. package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.js +141 -0
  380. package/lib/esm/components/CreatePaymentProductForm/constants.d.ts +1 -0
  381. package/lib/esm/components/CreatePaymentProductForm/constants.js +1 -0
  382. package/lib/esm/components/CreatePaymentProductForm/index.d.ts +3 -0
  383. package/lib/esm/components/CreatePaymentProductForm/index.js +2 -0
  384. package/lib/esm/components/EditEventButton/EditEventButton.js +1 -0
  385. package/lib/esm/components/Editor/Editor.d.ts +1 -1
  386. package/lib/esm/components/Editor/nodes/HashtagNode.d.ts +1 -1
  387. package/lib/esm/components/Editor/nodes/HashtagNode.js +4 -4
  388. package/lib/esm/components/Editor/nodes/ImageNode.d.ts +1 -1
  389. package/lib/esm/components/Editor/nodes/ImageNode.js +6 -6
  390. package/lib/esm/components/Editor/nodes/MentionNode.d.ts +1 -1
  391. package/lib/esm/components/Editor/nodes/MentionNode.js +4 -4
  392. package/lib/esm/components/Editor/plugins/ApiPlugin.d.ts +1 -1
  393. package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
  394. package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
  395. package/lib/esm/components/Event/Event.d.ts +5 -0
  396. package/lib/esm/components/Event/Event.js +2 -2
  397. package/lib/esm/components/EventForm/EventForm.js +49 -18
  398. package/lib/esm/components/EventForm/types.d.ts +8 -5
  399. package/lib/esm/components/EventFormDialog/EventFormDialog.js +7 -1
  400. package/lib/esm/components/EventHeader/EventHeader.js +14 -5
  401. package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +28 -5
  402. package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +1 -1
  403. package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +11 -2
  404. package/lib/esm/components/EventMembersWidget/TabContentComponent.js +14 -4
  405. package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +20 -9
  406. package/lib/esm/components/Feed/Feed.d.ts +2 -2
  407. package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
  408. package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
  409. package/lib/esm/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +2 -1
  410. package/lib/esm/components/FeedObject/FeedObject.js +17 -7
  411. package/lib/esm/components/FeedObject/Poll/Choice/Choice.js +1 -1
  412. package/lib/esm/components/FeedObject/Poll/Poll.js +1 -1
  413. package/lib/esm/components/Group/Group.d.ts +6 -1
  414. package/lib/esm/components/Group/Group.js +3 -3
  415. package/lib/esm/components/GroupForm/GroupForm.js +39 -9
  416. package/lib/esm/components/GroupHeader/GroupHeader.js +12 -4
  417. package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +3 -1
  418. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +7 -2
  419. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +6 -4
  420. package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +6 -4
  421. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -8
  422. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +32 -10
  423. package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +3 -2
  424. package/lib/esm/components/LiveStreamForm/types.d.ts +3 -3
  425. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +1 -1
  426. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +1 -1
  427. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +1 -1
  428. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +2 -2
  429. package/lib/esm/components/LiveStreamRoom/types.d.ts +1 -1
  430. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.d.ts +1 -0
  431. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +44 -6
  432. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
  433. package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
  434. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +6 -0
  435. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +1 -1
  436. package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +37 -6
  437. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +8 -3
  438. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +1 -1
  439. package/lib/esm/components/PaymentDetailDialog/PaymentDetailDialog.d.ts +6 -0
  440. package/lib/esm/components/PaymentDetailDialog/PaymentDetailDialog.js +37 -0
  441. package/lib/esm/components/PaymentDetailDialog/index.d.ts +3 -0
  442. package/lib/esm/components/PaymentDetailDialog/index.js +2 -0
  443. package/lib/esm/components/PaymentOrder/PaymentOrder.d.ts +10 -0
  444. package/lib/esm/components/PaymentOrder/PaymentOrder.js +77 -0
  445. package/lib/esm/components/PaymentOrder/Skeleton.d.ts +30 -0
  446. package/lib/esm/components/PaymentOrder/Skeleton.js +58 -0
  447. package/lib/esm/components/PaymentOrder/constants.d.ts +1 -0
  448. package/lib/esm/components/PaymentOrder/constants.js +1 -0
  449. package/lib/esm/components/PaymentOrder/index.d.ts +3 -0
  450. package/lib/esm/components/PaymentOrder/index.js +2 -0
  451. package/lib/esm/components/PaymentOrderPdfButton/PaymentOrderPdfButton.d.ts +52 -0
  452. package/lib/esm/components/PaymentOrderPdfButton/PaymentOrderPdfButton.js +71 -0
  453. package/lib/esm/components/PaymentOrderPdfButton/index.d.ts +3 -0
  454. package/lib/esm/components/PaymentOrderPdfButton/index.js +2 -0
  455. package/lib/esm/components/PaymentOrders/PaymentOrders.d.ts +17 -0
  456. package/lib/esm/components/PaymentOrders/PaymentOrders.js +261 -0
  457. package/lib/esm/components/PaymentOrders/index.d.ts +3 -0
  458. package/lib/esm/components/PaymentOrders/index.js +2 -0
  459. package/lib/esm/components/PaymentProduct/PaymentProduct.d.ts +18 -0
  460. package/lib/esm/components/PaymentProduct/PaymentProduct.js +45 -0
  461. package/lib/esm/components/PaymentProduct/Skeleton.d.ts +25 -0
  462. package/lib/esm/components/PaymentProduct/Skeleton.js +52 -0
  463. package/lib/esm/components/PaymentProduct/constants.d.ts +1 -0
  464. package/lib/esm/components/PaymentProduct/constants.js +1 -0
  465. package/lib/esm/components/PaymentProduct/index.d.ts +3 -0
  466. package/lib/esm/components/PaymentProduct/index.js +2 -0
  467. package/lib/esm/components/PaymentProductPrice/PaymentProductPrice.d.ts +15 -0
  468. package/lib/esm/components/PaymentProductPrice/PaymentProductPrice.js +58 -0
  469. package/lib/esm/components/PaymentProductPrice/Skeleton.d.ts +21 -0
  470. package/lib/esm/components/PaymentProductPrice/Skeleton.js +42 -0
  471. package/lib/esm/components/PaymentProductPrice/constants.d.ts +1 -0
  472. package/lib/esm/components/PaymentProductPrice/constants.js +1 -0
  473. package/lib/esm/components/PaymentProductPrice/index.d.ts +3 -0
  474. package/lib/esm/components/PaymentProductPrice/index.js +2 -0
  475. package/lib/esm/components/PaymentProducts/PaymentProducts.d.ts +11 -0
  476. package/lib/esm/components/PaymentProducts/PaymentProducts.js +73 -0
  477. package/lib/esm/components/PaymentProducts/Skeleton.d.ts +21 -0
  478. package/lib/esm/components/PaymentProducts/Skeleton.js +43 -0
  479. package/lib/esm/components/PaymentProducts/constants.d.ts +1 -0
  480. package/lib/esm/components/PaymentProducts/constants.js +1 -0
  481. package/lib/esm/components/PaymentProducts/index.d.ts +3 -0
  482. package/lib/esm/components/PaymentProducts/index.js +2 -0
  483. package/lib/esm/components/Paywalls/Paywalls.d.ts +10 -0
  484. package/lib/esm/components/Paywalls/Paywalls.js +91 -0
  485. package/lib/esm/components/Paywalls/Skeleton.d.ts +21 -0
  486. package/lib/esm/components/Paywalls/Skeleton.js +43 -0
  487. package/lib/esm/components/Paywalls/constants.d.ts +1 -0
  488. package/lib/esm/components/Paywalls/constants.js +1 -0
  489. package/lib/esm/components/Paywalls/index.d.ts +3 -0
  490. package/lib/esm/components/Paywalls/index.js +2 -0
  491. package/lib/esm/components/PaywallsConfigurator/PaywallsConfigurator.d.ts +13 -0
  492. package/lib/esm/components/PaywallsConfigurator/PaywallsConfigurator.js +249 -0
  493. package/lib/esm/components/PaywallsConfigurator/Skeleton.d.ts +21 -0
  494. package/lib/esm/components/PaywallsConfigurator/Skeleton.js +43 -0
  495. package/lib/esm/components/PaywallsConfigurator/constants.d.ts +5 -0
  496. package/lib/esm/components/PaywallsConfigurator/constants.js +6 -0
  497. package/lib/esm/components/PaywallsConfigurator/index.d.ts +4 -0
  498. package/lib/esm/components/PaywallsConfigurator/index.js +4 -0
  499. package/lib/esm/components/PaywallsDialog/PaywallsDialog.d.ts +8 -0
  500. package/lib/esm/components/PaywallsDialog/PaywallsDialog.js +40 -0
  501. package/lib/esm/components/PaywallsDialog/index.d.ts +3 -0
  502. package/lib/esm/components/PaywallsDialog/index.js +2 -0
  503. package/lib/esm/components/PdfPreview/PdfPreview.d.ts +8 -0
  504. package/lib/esm/components/PdfPreview/PdfPreview.js +90 -0
  505. package/lib/esm/components/PdfPreview/Skeleton.d.ts +5 -0
  506. package/lib/esm/components/PdfPreview/Skeleton.js +35 -0
  507. package/lib/esm/components/PdfPreview/index.d.ts +3 -0
  508. package/lib/esm/components/PdfPreview/index.js +2 -0
  509. package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.d.ts +11 -0
  510. package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.js +60 -0
  511. package/lib/esm/components/PdfPreviewDialog/index.d.ts +3 -0
  512. package/lib/esm/components/PdfPreviewDialog/index.js +2 -0
  513. package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +4 -3
  514. package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
  515. package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +4 -4
  516. package/lib/esm/components/ToastNotifications/ToastNotifications.js +2 -10
  517. package/lib/esm/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.d.ts +41 -0
  518. package/lib/esm/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.js +91 -0
  519. package/lib/esm/components/UserAddPaymentMethodDialog/constants.d.ts +1 -0
  520. package/lib/esm/components/UserAddPaymentMethodDialog/constants.js +1 -0
  521. package/lib/esm/components/UserAddPaymentMethodDialog/index.d.ts +3 -0
  522. package/lib/esm/components/UserAddPaymentMethodDialog/index.js +2 -0
  523. package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.d.ts +40 -0
  524. package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +140 -0
  525. package/lib/esm/components/UserAddPaymentMethodForm/constants.d.ts +1 -0
  526. package/lib/esm/components/UserAddPaymentMethodForm/constants.js +1 -0
  527. package/lib/esm/components/UserAddPaymentMethodForm/index.d.ts +3 -0
  528. package/lib/esm/components/UserAddPaymentMethodForm/index.js +2 -0
  529. package/lib/esm/components/UserBillingInfo/Skeleton.d.ts +25 -0
  530. package/lib/esm/components/UserBillingInfo/Skeleton.js +9 -0
  531. package/lib/esm/components/UserBillingInfo/UserBillingInfo.d.ts +35 -0
  532. package/lib/esm/components/UserBillingInfo/UserBillingInfo.js +490 -0
  533. package/lib/esm/components/UserBillingInfo/constants.d.ts +1 -0
  534. package/lib/esm/components/UserBillingInfo/constants.js +1 -0
  535. package/lib/esm/components/UserBillingInfo/index.d.ts +4 -0
  536. package/lib/esm/components/UserBillingInfo/index.js +4 -0
  537. package/lib/esm/components/UserBillingInfo/reducer.d.ts +77 -0
  538. package/lib/esm/components/UserBillingInfo/reducer.js +91 -0
  539. package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.d.ts +44 -0
  540. package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.js +82 -0
  541. package/lib/esm/components/UserChangeAddressDialog/constants.d.ts +1 -0
  542. package/lib/esm/components/UserChangeAddressDialog/constants.js +1 -0
  543. package/lib/esm/components/UserChangeAddressDialog/index.d.ts +3 -0
  544. package/lib/esm/components/UserChangeAddressDialog/index.js +2 -0
  545. package/lib/esm/components/UserConnectionsRequestsSentWidget/UserConnectionsRequestsSentWidget.js +6 -6
  546. package/lib/esm/components/UserConnectionsRequestsWidget/UserConnectionsRequestsWidget.js +5 -5
  547. package/lib/esm/components/UserConnectionsWidget/UserConnectionsWidget.js +8 -5
  548. package/lib/esm/components/UserCounters/UserCounters.js +20 -17
  549. package/lib/esm/components/UserFollowedCategoriesWidget/UserFollowedCategoriesWidget.js +11 -8
  550. package/lib/esm/components/UserPaymentMethods/Skeleton.d.ts +15 -0
  551. package/lib/esm/components/UserPaymentMethods/Skeleton.js +47 -0
  552. package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.d.ts +19 -0
  553. package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.js +336 -0
  554. package/lib/esm/components/UserPaymentMethods/constants.d.ts +1 -0
  555. package/lib/esm/components/UserPaymentMethods/constants.js +1 -0
  556. package/lib/esm/components/UserPaymentMethods/index.d.ts +4 -0
  557. package/lib/esm/components/UserPaymentMethods/index.js +4 -0
  558. package/lib/esm/components/UserPaymentMethodsPortal/Skeleton.d.ts +22 -0
  559. package/lib/esm/components/UserPaymentMethodsPortal/Skeleton.js +35 -0
  560. package/lib/esm/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.d.ts +44 -0
  561. package/lib/esm/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.js +100 -0
  562. package/lib/esm/components/UserPaymentMethodsPortal/constants.d.ts +1 -0
  563. package/lib/esm/components/UserPaymentMethodsPortal/constants.js +1 -0
  564. package/lib/esm/components/UserPaymentMethodsPortal/index.d.ts +4 -0
  565. package/lib/esm/components/UserPaymentMethodsPortal/index.js +4 -0
  566. package/lib/esm/components/UserSuggestionWidget/UserSuggestionWidget.js +7 -5
  567. package/lib/esm/constants/Billing.d.ts +10 -0
  568. package/lib/esm/constants/Billing.js +57 -0
  569. package/lib/esm/constants/ContributionsActionsMenu.d.ts +1 -0
  570. package/lib/esm/constants/ContributionsActionsMenu.js +1 -0
  571. package/lib/esm/constants/Country.d.ts +5 -0
  572. package/lib/esm/constants/Country.js +268 -0
  573. package/lib/esm/constants/DefaultDrawerContent.d.ts +1 -0
  574. package/lib/esm/constants/DefaultDrawerContent.js +1 -0
  575. package/lib/esm/constants/Payments.d.ts +4 -0
  576. package/lib/esm/constants/Payments.js +4 -0
  577. package/lib/esm/index.d.ts +23 -1
  578. package/lib/esm/index.js +23 -1
  579. package/lib/esm/shared/AutoPlayer/index.d.ts +0 -5
  580. package/lib/esm/shared/AutoPlayer/index.js +5 -4
  581. package/lib/esm/shared/ContributionActionsMenu/index.d.ts +4 -0
  582. package/lib/esm/shared/ContributionActionsMenu/index.js +58 -7
  583. package/lib/esm/shared/CourseUsersTable/CourseUsersTable.d.ts +1 -1
  584. package/lib/esm/shared/CourseUsersTable/SeeProgressButton.js +5 -3
  585. package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.d.ts +44 -0
  586. package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +50 -0
  587. package/lib/esm/shared/HiddenPurchasableContent/index.d.ts +3 -0
  588. package/lib/esm/shared/HiddenPurchasableContent/index.js +2 -0
  589. package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
  590. package/lib/esm/shared/Media/File/DisplayComponent.d.ts +2 -1
  591. package/lib/esm/shared/Media/File/DisplayComponent.js +60 -33
  592. package/lib/esm/shared/Media/File/DocComponent.d.ts +10 -0
  593. package/lib/esm/shared/Media/File/DocComponent.js +31 -0
  594. package/lib/esm/shared/Media/File/PreviewComponent.d.ts +2 -2
  595. package/lib/esm/shared/Media/File/PreviewComponent.js +17 -19
  596. package/lib/esm/shared/Media/File/TriggerButton.js +14 -1
  597. package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
  598. package/lib/esm/shared/Media/File/filter.d.ts +2 -2
  599. package/lib/esm/shared/Media/File/filter.js +2 -1
  600. package/lib/esm/shared/Media/File/index.js +2 -2
  601. package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
  602. package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
  603. package/lib/esm/shared/StickyBox/index.d.ts +4 -4
  604. package/lib/esm/shared/Tags/index.js +7 -3
  605. package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
  606. package/lib/esm/types/composer.d.ts +1 -1
  607. package/lib/esm/types/index.d.ts +2 -1
  608. package/lib/esm/types/index.js +2 -1
  609. package/lib/esm/types/payment.d.ts +25 -0
  610. package/lib/esm/types/payment.js +26 -0
  611. package/lib/esm/utils/address.d.ts +10 -0
  612. package/lib/esm/utils/address.js +19 -0
  613. package/lib/esm/utils/checkout.d.ts +2 -0
  614. package/lib/esm/utils/checkout.js +19 -0
  615. package/lib/esm/utils/payment.d.ts +17 -0
  616. package/lib/esm/utils/payment.js +62 -0
  617. package/lib/umd/{c473ce30406a3dad83e1.eot → 30b299174b4fa1fb9ce8.eot} +0 -0
  618. package/lib/umd/362.js +2 -0
  619. package/lib/umd/{ba74e493633796d551d1.ttf → 3b49304a98beb1239bc7.ttf} +0 -0
  620. package/lib/umd/ab247f43e550f5f6d0f8.woff2 +0 -0
  621. package/lib/umd/assets/icons.svg +75 -69
  622. package/lib/umd/{b6dbec3d5816ff8baef1.woff → ce10db0c87e7112cb315.woff} +0 -0
  623. package/lib/umd/react-ui.js +1 -1
  624. package/package.json +15 -8
  625. package/lib/umd/578.js +0 -2
  626. package/lib/umd/60a7fdeaadfe844bc015.woff2 +0 -0
  627. /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 })] })), 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" }) })) })))] }))] })));
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: import("react").MemoExoticComponent<typeof Student>;
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
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(_Fragment, {});
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)) && (_jsx(ActionButton, { labelId: scCourse.join_status === null
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) && (_jsx(ActionButton, { labelId: sentRequest ? BUTTON_MESSAGES.cancel : BUTTON_MESSAGES.request, color: "inherit", variant: "outlined", loading: loadingRequest, onClick: handleRequest }))] })));
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, {});
@@ -32,6 +32,11 @@ export interface CourseFormProps extends BoxProps {
32
32
  * @default null
33
33
  */
34
34
  onError?: (error: any) => void;
35
+ /**
36
+ * Hide paywalls configuration
37
+ * @default false
38
+ */
39
+ hidePaywalls?: boolean;
35
40
  /**
36
41
  * Any other properties
37
42
  */
@@ -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: ((_a = field.description) === null || _a === void 0 ? void 0 : _a.length) ? COURSE_DESCRIPTION_MAX_LENGTH - field.description.length : COURSE_DESCRIPTION_MAX_LENGTH })))
257
- }, error: Boolean((!!field.privacy && !field.description) || ((_b = field.description) === null || _b === void 0 ? void 0 : _b.length) > COURSE_DESCRIPTION_MAX_LENGTH), helperText: !!field.privacy && !field.description ? (_jsx(FormattedMessage, { id: "ui.courseForm.required", defaultMessage: "ui.courseForm.required" })) : (((_c = field.description) === null || _c === void 0 ? void 0 : _c.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 }))) })] }))] })), _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
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, SCUserType } from '@selfcommunity/types';
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, user, onJoin } = props, rest = __rest(props, ["className", "courseId", "course", "user", "onJoin"]);
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 = (user) => {
86
+ const join = () => {
87
87
  scCoursesManager
88
- .join(scCourse, user === null || user === void 0 ? void 0 : user.id)
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
- notifyChanges(scCourse, user);
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 && !(user === null || user === void 0 ? void 0 : user.id) ? leave() : (user === null || user === void 0 ? void 0 : user.id) ? join(user) : join();
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 || (isCourseAdmin && (user === null || user === void 0 ? void 0 : user.id) === scUserContext.user.id) || (isCourseAdmin && !(user === null || user === void 0 ? void 0 : user.id))) {
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: isCourseAdmin ? _jsx(FormattedMessage, { defaultMessage: "ui.courseJoinButton.accept", id: "ui.courseJoinButton.accept" }) : getStatus })));
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';
@@ -0,0 +1,3 @@
1
+ import CreatePaymentProductForm, { CreatePaymentProductFormProps } from './CreatePaymentProductForm';
2
+ export default CreatePaymentProductForm;
3
+ export { CreatePaymentProductFormProps };
@@ -0,0 +1,2 @@
1
+ import CreatePaymentProductForm from './CreatePaymentProductForm';
2
+ export default CreatePaymentProductForm;
@@ -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;