@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.
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 +28 -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 +92 -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 +29 -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 +88 -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
@@ -2,24 +2,25 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
6
- // @ts-nocheck
7
5
  const react_1 = require("react");
8
6
  const react_waypoint_1 = require("react-waypoint");
9
7
  const react_player_1 = tslib_1.__importDefault(require("react-player"));
10
8
  const material_1 = require("@mui/material");
9
+ const react_core_1 = require("@selfcommunity/react-core");
11
10
  const PREFIX = 'SCAutoPlayer';
12
11
  const Root = (0, material_1.styled)(react_waypoint_1.Waypoint, {
13
12
  name: PREFIX,
14
13
  slot: 'Root',
15
- overridesResolver: (props, styles) => styles.root
14
+ overridesResolver: (_props, styles) => styles.root
16
15
  })(() => ({}));
17
16
  function AutoPlayer(props) {
18
17
  // PROPS
19
- const { enableAutoplay = true, loop = false, muted = true, playsinline = true, controls = true, stopOnUnmount = true, pip = true, onVideoWatch } = props, rest = tslib_1.__rest(props, ["enableAutoplay", "loop", "muted", "playsinline", "controls", "stopOnUnmount", "pip", "onVideoWatch"]);
18
+ const { loop = false, muted = true, playsinline = true, controls = true, stopOnUnmount = true, pip = true, onVideoWatch } = props, rest = tslib_1.__rest(props, ["loop", "muted", "playsinline", "controls", "stopOnUnmount", "pip", "onVideoWatch"]);
20
19
  // STATE
21
20
  const [shouldPlay, setShouldPlay] = (0, react_1.useState)(false);
22
21
  const [played, setPlayed] = (0, react_1.useState)(0);
22
+ const { preferences } = (0, react_core_1.useSCPreferences)();
23
+ const enableAutoplay = react_core_1.SCPreferences.CONFIGURATIONS_VIDEO_AUTOPLAY_ENABLED in preferences && preferences[react_core_1.SCPreferences.CONFIGURATIONS_VIDEO_AUTOPLAY_ENABLED].value;
23
24
  (0, react_1.useEffect)(() => {
24
25
  if (played >= 10 && played <= 11) {
25
26
  onVideoWatch === null || onVideoWatch === void 0 ? void 0 : onVideoWatch();
@@ -46,6 +46,10 @@ export interface ContributionActionsMenuProps {
46
46
  * Handle restore obj
47
47
  */
48
48
  onRestoreContribution?: (obj: SCCommentType | SCFeedObjectType) => void;
49
+ /**
50
+ * Handle publish obj
51
+ */
52
+ onPublishContribution?: (obj: SCFeedObjectType) => void;
49
53
  /**
50
54
  * Handle flag notification obj
51
55
  */
@@ -75,7 +75,7 @@ const messages = (0, react_intl_1.defineMessages)({
75
75
  });
76
76
  function ContributionActionsMenu(props) {
77
77
  // PROPS
78
- const { className, feedObjectId, feedObject, feedObjectType = types_1.SCContributionType.POST, commentObjectId, commentObject, onFlagContribution, onEditContribution, onHideContribution, onDeleteContribution, onRestoreContribution, onSuspendNotificationContribution, onSuspendNotificationEvent, PopperProps = {} } = props, rest = tslib_1.__rest(props, ["className", "feedObjectId", "feedObject", "feedObjectType", "commentObjectId", "commentObject", "onFlagContribution", "onEditContribution", "onHideContribution", "onDeleteContribution", "onRestoreContribution", "onSuspendNotificationContribution", "onSuspendNotificationEvent", "PopperProps"]);
78
+ const { className, feedObjectId, feedObject, feedObjectType = types_1.SCContributionType.POST, commentObjectId, commentObject, onFlagContribution, onEditContribution, onHideContribution, onDeleteContribution, onRestoreContribution, onPublishContribution, onSuspendNotificationContribution, onSuspendNotificationEvent, PopperProps = {} } = props, rest = tslib_1.__rest(props, ["className", "feedObjectId", "feedObject", "feedObjectType", "commentObjectId", "commentObject", "onFlagContribution", "onEditContribution", "onHideContribution", "onDeleteContribution", "onRestoreContribution", "onPublishContribution", "onSuspendNotificationContribution", "onSuspendNotificationEvent", "PopperProps"]);
79
79
  // INTL
80
80
  const intl = (0, react_intl_1.useIntl)();
81
81
  // CONTEXT
@@ -86,6 +86,7 @@ function ContributionActionsMenu(props) {
86
86
  const scUserId = scUserContext.user ? scUserContext.user.id : null;
87
87
  const scRoutingContext = (0, react_core_1.useSCRouting)();
88
88
  const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
89
+ const { preferences } = (0, react_core_1.useSCPreferences)();
89
90
  // CONTRIBUTION STATE
90
91
  const { obj: feedObj, setObj: setFeedObj } = (0, react_core_1.useSCFetchFeedObject)({ id: feedObjectId, feedObject, feedObjectType });
91
92
  const { obj: commentObj, setObj: setCommentObj } = (0, react_core_1.useSCFetchCommentObject)({ id: commentObjectId, commentObject });
@@ -109,6 +110,9 @@ function ContributionActionsMenu(props) {
109
110
  // CONST
110
111
  const contributionObj = commentObj ? commentObj : feedObj;
111
112
  let popperRef = (0, react_1.useRef)(null);
113
+ const scheduledPostsEnabled = (0, react_1.useMemo)(() => preferences &&
114
+ react_core_1.SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED in preferences &&
115
+ preferences[react_core_1.SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED].value, [preferences]);
112
116
  /**
113
117
  * Intial extra sections to render, in addition to the GENERAL_SECTION
114
118
  * @return {array}
@@ -123,7 +127,7 @@ function ContributionActionsMenu(props) {
123
127
  _extra.push(ContributionsActionsMenu_1.FLAG_CONTRIBUTION_SECTION);
124
128
  }
125
129
  // Enable when backend is ready
126
- if (react_core_1.UserUtils.isStaff(scUserContext.user)) {
130
+ if (react_core_1.UserUtils.isAdmin(scUserContext.user) || react_core_1.UserUtils.isModerator(scUserContext.user)) {
127
131
  // admin or moderator
128
132
  _extra.push(ContributionsActionsMenu_1.HIDE_CONTRIBUTION_SECTION);
129
133
  _extra.push(ContributionsActionsMenu_1.DELETE_CONTRIBUTION_SECTION);
@@ -334,6 +338,22 @@ function ContributionActionsMenu(props) {
334
338
  return Promise.resolve(res.data);
335
339
  });
336
340
  }, [contributionObj]);
341
+ /**
342
+ * Perform publish contribution
343
+ */
344
+ const performPublishContribution = (0, react_1.useMemo)(() => () => {
345
+ return api_services_1.http
346
+ .request({
347
+ url: api_services_1.Endpoints.PublishFeedObject.url({ type: contributionObj.type, id: contributionObj.id }),
348
+ method: api_services_1.Endpoints.PublishFeedObject.method
349
+ })
350
+ .then((res) => {
351
+ if (res.status >= 300) {
352
+ return Promise.reject(res);
353
+ }
354
+ return Promise.resolve(res.data);
355
+ });
356
+ }, [contributionObj]);
337
357
  /**
338
358
  * Fetch initial flag status
339
359
  */
@@ -470,6 +490,11 @@ function ContributionActionsMenu(props) {
470
490
  setOpenConfirmDialog(true);
471
491
  handleClose();
472
492
  }
493
+ else if (action === ContributionsActionsMenu_1.PUBLISH_CONTRIBUTION) {
494
+ setCurrentAction(ContributionsActionsMenu_1.PUBLISH_CONTRIBUTION);
495
+ setOpenConfirmDialog(true);
496
+ handleClose();
497
+ }
473
498
  else if (action === ContributionsActionsMenu_1.RESTORE_CONTRIBUTION) {
474
499
  setCurrentAction(ContributionsActionsMenu_1.RESTORE_CONTRIBUTION);
475
500
  setOpenConfirmDialog(true);
@@ -559,6 +584,19 @@ function ContributionActionsMenu(props) {
559
584
  performPostConfirmAction(false);
560
585
  });
561
586
  }
587
+ else if (currentAction === ContributionsActionsMenu_1.PUBLISH_CONTRIBUTION) {
588
+ setCurrentActionLoading(ContributionsActionsMenu_1.PUBLISH_CONTRIBUTION);
589
+ performPublishContribution()
590
+ .then(() => {
591
+ const _contributionObj = Object.assign({}, contributionObj, { deleted: false });
592
+ onPublishContribution && onPublishContribution(_contributionObj);
593
+ performPostConfirmAction(true);
594
+ })
595
+ .catch((error) => {
596
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
597
+ performPostConfirmAction(false);
598
+ });
599
+ }
562
600
  else if (currentAction === ContributionsActionsMenu_1.MODERATE_CONTRIBUTION_HIDDEN) {
563
601
  setCurrentActionLoading(ContributionsActionsMenu_1.MODERATE_CONTRIBUTION_HIDDEN);
564
602
  performModerationContribution(Flagging_1.MODERATION_TYPE_ACTION_HIDE, hideFlagType)
@@ -682,7 +720,16 @@ function ContributionActionsMenu(props) {
682
720
  * Can authenticated user delete the contribution
683
721
  */
684
722
  function canDeleteContribution() {
685
- return scUserContext.user && scUserContext.user.id === contributionObj.author.id && !deleteType;
723
+ return scUserContext.user && scUserContext.user.id === contributionObj.author.id;
724
+ }
725
+ /**
726
+ * Can authenticated user publish the contribution
727
+ */
728
+ function canPublishContribution() {
729
+ const user = scUserContext.user;
730
+ if (!user || contributionObj.deleted || !scheduledPostsEnabled || !feedObj.draft)
731
+ return false;
732
+ return user.id === contributionObj.author.id || (scheduledPostsEnabled && (react_core_1.UserUtils.isAdmin(user) || react_core_1.UserUtils.isModerator(user)));
686
733
  }
687
734
  /**
688
735
  * Can authenticated user suspend notification for the contribution
@@ -708,7 +755,7 @@ function ContributionActionsMenu(props) {
708
755
  * Renders section general
709
756
  */
710
757
  function renderGeneralSection() {
711
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "link" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.permanentLink", defaultMessage: "ui.contributionActionMenu.permanentLink" }), onClick: () => handleAction(ContributionsActionsMenu_1.GET_CONTRIBUTION_PERMALINK), classes: { root: classes.itemText } })] })), canModifyContribution() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "edit" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.editContribution", defaultMessage: "ui.contributionActionMenu.editContribution" }), onClick: () => handleAction(ContributionsActionsMenu_1.EDIT_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canDeleteContribution() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: currentActionLoading === ContributionsActionsMenu_1.DELETE_CONTRIBUTION || currentActionLoading === ContributionsActionsMenu_1.RESTORE_CONTRIBUTION ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20 })) : ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "delete" })) }), contributionObj.deleted ? ((0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.restoreContribution", defaultMessage: "ui.contributionActionMenu.restoreContribution" }), onClick: () => handleAction(ContributionsActionsMenu_1.RESTORE_CONTRIBUTION), classes: { root: classes.itemText } })) : ((0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.deleteContribution", defaultMessage: "ui.contributionActionMenu.deleteContribution" }), onClick: () => handleAction(ContributionsActionsMenu_1.DELETE_CONTRIBUTION), classes: { root: classes.itemText } }))] }))), canSuspendNotificationContribution() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: currentActionLoading === ContributionsActionsMenu_1.SUSPEND_NOTIFICATION_CONTRIBUTION ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20 })) : contributionObj['suspended'] ? ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "notifications_active" })) : ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "notifications_off" })) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: contributionObj['suspended'] ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(ContributionsActionsMenu_1.SUSPEND_NOTIFICATION_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canSuspendNotificationEvent() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: currentActionLoading === ContributionsActionsMenu_1.SUSPEND_NOTIFICATION_EVENT ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20 })) : contributionObj.event['show_on_feed'] ? ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "notifications_active" })) : ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "notifications_off" })) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: !contributionObj.event['show_on_feed'] ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(ContributionsActionsMenu_1.SUSPEND_NOTIFICATION_EVENT), classes: { root: classes.itemText } })] })))] }, ContributionsActionsMenu_1.GENERAL_SECTION));
758
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "link" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.permanentLink", defaultMessage: "ui.contributionActionMenu.permanentLink" }), onClick: () => handleAction(ContributionsActionsMenu_1.GET_CONTRIBUTION_PERMALINK), classes: { root: classes.itemText } })] })), canModifyContribution() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "edit" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.editContribution", defaultMessage: "ui.contributionActionMenu.editContribution" }), onClick: () => handleAction(ContributionsActionsMenu_1.EDIT_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canDeleteContribution() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: currentActionLoading === ContributionsActionsMenu_1.DELETE_CONTRIBUTION || currentActionLoading === ContributionsActionsMenu_1.RESTORE_CONTRIBUTION ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20 })) : ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "delete" })) }), contributionObj.deleted ? ((0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.restoreContribution", defaultMessage: "ui.contributionActionMenu.restoreContribution" }), onClick: () => handleAction(ContributionsActionsMenu_1.RESTORE_CONTRIBUTION), classes: { root: classes.itemText } })) : ((0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.deleteContribution", defaultMessage: "ui.contributionActionMenu.deleteContribution" }), onClick: () => handleAction(ContributionsActionsMenu_1.DELETE_CONTRIBUTION), classes: { root: classes.itemText } }))] }))), canPublishContribution() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "upload" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.publishContribution", defaultMessage: "ui.contributionActionMenu.publishContribution" }), onClick: () => handleAction(ContributionsActionsMenu_1.PUBLISH_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canSuspendNotificationContribution() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: currentActionLoading === ContributionsActionsMenu_1.SUSPEND_NOTIFICATION_CONTRIBUTION ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20 })) : contributionObj['suspended'] ? ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "notifications_active" })) : ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "notifications_off" })) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: contributionObj['suspended'] ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(ContributionsActionsMenu_1.SUSPEND_NOTIFICATION_CONTRIBUTION), classes: { root: classes.itemText } })] }))), canSuspendNotificationEvent() && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: isFlagging }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: currentActionLoading === ContributionsActionsMenu_1.SUSPEND_NOTIFICATION_EVENT ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20 })) : contributionObj.event['show_on_feed'] ? ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "notifications_active" })) : ((0, jsx_runtime_1.jsx)(material_1.Icon, { children: "notifications_off" })) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: !contributionObj.event['show_on_feed'] ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.enableNotificationContribution", defaultMessage: "ui.contributionActionMenu.enableNotificationContribution" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.suspendNotificationContribution", defaultMessage: "ui.contributionActionMenu.suspendNotificationContribution" })), onClick: () => handleAction(ContributionsActionsMenu_1.SUSPEND_NOTIFICATION_EVENT), classes: { root: classes.itemText } })] })))] }, ContributionsActionsMenu_1.GENERAL_SECTION));
712
759
  }
713
760
  /**
714
761
  * Renders contribution menu content
@@ -731,6 +778,10 @@ function ContributionActionsMenu(props) {
731
778
  ? {
732
779
  content: ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.deleteContributionInfo", defaultMessage: "ui.contributionActionMenu.deleteContributionInfo" }))
733
780
  }
734
- : {}), { onConfirm: handleConfirmedAction, isUpdating: Boolean(currentActionLoading), onClose: () => setOpenConfirmDialog(false) })))] })));
781
+ : currentAction === ContributionsActionsMenu_1.PUBLISH_CONTRIBUTION
782
+ ? {
783
+ content: ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.contributionActionMenu.publishContributionInfo", defaultMessage: "ui.contributionActionMenu.publishContributionInfo" }))
784
+ }
785
+ : {}), { onConfirm: handleConfirmedAction, isUpdating: Boolean(currentActionLoading), onClose: () => setOpenConfirmDialog(false) })))] })));
735
786
  }
736
787
  exports.default = ContributionActionsMenu;
@@ -2,7 +2,7 @@ import { Dispatch } from 'react';
2
2
  import { SCCourseType } from '@selfcommunity/types';
3
3
  import { EndpointType } from '@selfcommunity/api-services';
4
4
  import { SCCourseUsersTableModeType } from '../../types/course';
5
- type HeaderCellsType = {
5
+ declare type HeaderCellsType = {
6
6
  id?: string;
7
7
  };
8
8
  export interface CourseUsersTableProps {
@@ -34,9 +34,11 @@ function SeeProgressButton(props) {
34
34
  const [student, setStudent] = (0, react_1.useState)(null);
35
35
  // CONTEXTS
36
36
  const scRoutingContext = (0, react_core_1.useSCRouting)();
37
+ const { preferences } = (0, react_core_1.useSCPreferences)();
37
38
  // HOOKS
38
39
  const theme = (0, material_1.useTheme)();
39
40
  const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
41
+ const privateMessagingEnabled = (0, react_1.useMemo)(() => react_core_1.SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED in preferences && preferences[react_core_1.SCPreferences.ADDONS_PRIVATE_MESSAGES_ENABLED].value, [preferences]);
40
42
  // EFFECTS
41
43
  (0, react_1.useEffect)(() => {
42
44
  if (open && !student) {
@@ -51,6 +53,6 @@ function SeeProgressButton(props) {
51
53
  }, [setOpen]);
52
54
  return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [isMobile ? ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "small", color: "inherit", onClick: handleToggleOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "chevron_right" }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "outlined", size: "small", color: "inherit", onClick: handleToggleOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.action.btn.label", defaultMessage: "ui.courseUsersTable.action.btn.label" }) })) }))), open && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ DialogContentProps: { dividers: isMobile }, open: true, scroll: "paper", onClose: handleToggleOpen, title: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.dialog.title", defaultMessage: "ui.courseUsersTable.dialog.title" }) })), className: classes.dialogRoot }, { children: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.contentWrapper }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.infoOuterWrapper }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.infoInnerWrapper }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.avatarWrapper }, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({}, (!course.created_by.deleted && {
53
55
  to: scRoutingContext.url(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, course.created_by)
54
- }), { children: (0, jsx_runtime_1.jsx)(UserAvatar_1.default, Object.assign({ hide: !course.created_by.community_badge, smaller: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { className: classes.avatar, src: user.avatar, alt: user.username }) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: user.username }))] })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, user), variant: "outlined", size: "small", color: "inherit" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.dialog.btn.label", defaultMessage: "ui.courseUsersTable.dialog.btn.label" }) })) }))] })), student ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.dialog.info.text1", defaultMessage: "ui.courseUsersTable.dialog.info.text1", values: { lessonsCompleted: student.num_lessons_completed } }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "100px", height: "21px" })), student ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.dialog.info.text2", defaultMessage: "ui.courseUsersTable.dialog.info.text2", values: { courseCompleted: student.user_completion_rate } }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "100px", height: "21px" }))] })), (0, jsx_runtime_1.jsx)(AccordionLessons_1.default, { course: student, viewerJoinStatus: course.join_status })] })) })))] }));
56
+ }), { children: (0, jsx_runtime_1.jsx)(UserAvatar_1.default, Object.assign({ hide: !course.created_by.community_badge, smaller: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { className: classes.avatar, src: user.avatar, alt: user.username }) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: user.username }))] })), privateMessagingEnabled && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, user), variant: "outlined", size: "small", color: "inherit" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.dialog.btn.label", defaultMessage: "ui.courseUsersTable.dialog.btn.label" }) })) })))] })), student ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.dialog.info.text1", defaultMessage: "ui.courseUsersTable.dialog.info.text1", values: { lessonsCompleted: student.num_lessons_completed } }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "100px", height: "21px" })), student ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.courseUsersTable.dialog.info.text2", defaultMessage: "ui.courseUsersTable.dialog.info.text2", values: { courseCompleted: student.user_completion_rate } }) }))) : ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "text", width: "100px", height: "21px" }))] })), (0, jsx_runtime_1.jsx)(AccordionLessons_1.default, { course: student, viewerJoinStatus: course.join_status })] })) })))] }));
55
57
  }
56
58
  exports.default = (0, react_1.memo)(SeeProgressButton);
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { WidgetProps } from '../../components/Widget';
3
+ export interface HiddenPurchasableContentProps extends Pick<WidgetProps, Exclude<keyof WidgetProps, 'id'>> {
4
+ /**
5
+ * Id of user object
6
+ * @default null
7
+ */
8
+ id?: string;
9
+ /**
10
+ * Title
11
+ */
12
+ title?: string;
13
+ /**
14
+ * Content
15
+ */
16
+ content?: React.ReactNode;
17
+ /**
18
+ * Any other properties
19
+ */
20
+ [p: string]: any;
21
+ }
22
+ /**
23
+ * > API documentation for the Community-JS HiddenPurchasableContent component. Learn about the available props and the CSS API.
24
+
25
+ #### Import
26
+
27
+ ```jsx
28
+ import {HiddenPurchasableContent} from '@selfcommunity/react-ui';
29
+ ```
30
+
31
+ #### Component Name
32
+
33
+ The name `HiddenPurchasableContent` can be used when providing style overrides in the theme.
34
+
35
+
36
+ #### CSS
37
+
38
+ |Rule Name|Global class|Description|
39
+ |---|---|---|
40
+ |root|.SCHiddenPurchasableContent-root|Styles applied to the root element.|
41
+
42
+ * @param inProps
43
+ */
44
+ export default function HiddenPurchasableContent(inProps: HiddenPurchasableContentProps): JSX.Element;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const styles_1 = require("@mui/material/styles");
6
+ const material_1 = require("@mui/material");
7
+ const Widget_1 = tslib_1.__importDefault(require("../../components/Widget"));
8
+ const system_1 = require("@mui/system");
9
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
10
+ const react_intl_1 = require("react-intl");
11
+ const PREFIX = 'SCHiddenPurchasableContent';
12
+ const classes = {
13
+ root: `${PREFIX}-root`,
14
+ header: `${PREFIX}-header`
15
+ };
16
+ const Root = (0, styles_1.styled)(Widget_1.default, {
17
+ name: PREFIX,
18
+ slot: 'Root',
19
+ overridesResolver: (props, styles) => styles.root
20
+ })(({ theme }) => ({}));
21
+ /**
22
+ * > API documentation for the Community-JS HiddenPurchasableContent component. Learn about the available props and the CSS API.
23
+
24
+ #### Import
25
+
26
+ ```jsx
27
+ import {HiddenPurchasableContent} from '@selfcommunity/react-ui';
28
+ ```
29
+
30
+ #### Component Name
31
+
32
+ The name `HiddenPurchasableContent` can be used when providing style overrides in the theme.
33
+
34
+
35
+ #### CSS
36
+
37
+ |Rule Name|Global class|Description|
38
+ |---|---|---|
39
+ |root|.SCHiddenPurchasableContent-root|Styles applied to the root element.|
40
+
41
+ * @param inProps
42
+ */
43
+ function HiddenPurchasableContent(inProps) {
44
+ // PROPS
45
+ const props = (0, system_1.useThemeProps)({
46
+ props: inProps,
47
+ name: PREFIX
48
+ });
49
+ const { id = null, className = null, title, content, elevation } = props, rest = tslib_1.__rest(props, ["id", "className", "title", "content", "elevation"]);
50
+ // RENDER
51
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, rest, { elevation: elevation }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h3", gutterBottom: true }, { children: (0, jsx_runtime_1.jsx)("b", { children: title || (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.shared.hiddenPurchasableContent.title", defaultMessage: "ui.shared.hiddenPurchasableContent.title" }) }) })), content || ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ variant: "body1" }, { children: [(0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.shared.hiddenPurchasableContent.content", defaultMessage: "ui.shared.hiddenPurchasableContent.content" }), ' '] })))] })));
52
+ }
53
+ exports.default = HiddenPurchasableContent;
@@ -0,0 +1,3 @@
1
+ import HiddenPurchasableContent, { HiddenPurchasableContentProps } from './HiddenPurchasableContent';
2
+ export default HiddenPurchasableContent;
3
+ export { HiddenPurchasableContentProps };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const HiddenPurchasableContent_1 = tslib_1.__importDefault(require("./HiddenPurchasableContent"));
5
+ exports.default = HiddenPurchasableContent_1.default;
@@ -1,5 +1,5 @@
1
1
  import { Component, ReactNode, CSSProperties } from 'react';
2
- type Fn = () => any;
2
+ declare type Fn = () => any;
3
3
  export interface InfiniteScrollProps {
4
4
  next?: Fn;
5
5
  hasMoreNext?: boolean;
@@ -1,3 +1,4 @@
1
+ import { SCMediaType } from '@selfcommunity/types';
1
2
  export interface ImagePreviewComponentProps {
2
3
  /**
3
4
  * Class name to apply to the root object
@@ -8,7 +9,7 @@ export interface ImagePreviewComponentProps {
8
9
  * Medias objs
9
10
  * @default []
10
11
  */
11
- medias: Array<any>;
12
+ medias: SCMediaType[];
12
13
  /**
13
14
  * Maximum number of visible media
14
15
  * @default 5
@@ -3,14 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
- const react_core_1 = require("@selfcommunity/react-core");
7
6
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
8
- const Media_1 = require("../../../constants/Media");
9
- const react_1 = tslib_1.__importStar(require("react"));
7
+ const react_1 = require("react");
10
8
  const react_intersection_observer_1 = require("react-intersection-observer");
11
9
  const Lightbox_1 = require("../../Lightbox");
12
10
  const constants_1 = require("./constants");
13
- const filter_1 = tslib_1.__importDefault(require("./filter"));
11
+ const DocComponent_1 = tslib_1.__importDefault(require("./DocComponent"));
12
+ const filter_1 = require("./filter");
13
+ const Media_1 = require("../../../constants/Media");
14
+ const api_services_1 = require("@selfcommunity/api-services");
15
+ const utils_1 = require("@selfcommunity/utils");
16
+ const Errors_1 = require("../../../constants/Errors");
14
17
  const classes = {
15
18
  displayRoot: `${constants_1.PREFIX}-display-root`,
16
19
  background: `${constants_1.PREFIX}-background`,
@@ -25,21 +28,24 @@ const classes = {
25
28
  border: `${constants_1.PREFIX}-border`,
26
29
  gallery: `${constants_1.PREFIX}-gallery`,
27
30
  title: `${constants_1.PREFIX}-title`,
28
- iconFile: `${constants_1.PREFIX}-icon-file`
31
+ iconFile: `${constants_1.PREFIX}-icon-file`,
32
+ docsWrapper: `${constants_1.PREFIX}-docs-wrapper`
29
33
  };
30
- const Root = (0, material_1.styled)(material_1.Box, {
34
+ const Root = (0, material_1.styled)(material_1.Stack, {
31
35
  name: constants_1.PREFIX,
32
36
  slot: 'DisplayRoot'
33
- })(({}) => ({}));
37
+ })(() => ({}));
34
38
  exports.default = (props) => {
35
39
  // PROPS
36
40
  const { className = '', medias = [], maxVisible = 5, gallery = true, onMediaClick = null } = props;
37
41
  // STATE
38
42
  const [preview, setPreview] = (0, react_1.useState)(-1);
43
+ const [mediaType, setMediaType] = (0, react_1.useState)(null);
39
44
  const [toolbarButtons, setToolbarButtons] = (0, react_1.useState)(undefined);
40
45
  const { ref, inView } = (0, react_intersection_observer_1.useInView)({ triggerOnce: false });
41
46
  // MEMO
42
- const _medias = (0, react_1.useMemo)(() => medias.filter(filter_1.default), [medias]);
47
+ const images = (0, react_1.useMemo)(() => medias.filter(filter_1.filteredImages), [medias]);
48
+ const docs = (0, react_1.useMemo)(() => medias.filter(filter_1.filteredDocs), [medias]);
43
49
  // HANDLERS
44
50
  const handleClose = () => {
45
51
  setPreview(-1);
@@ -53,14 +59,15 @@ exports.default = (props) => {
53
59
  }
54
60
  return image;
55
61
  };
56
- const openPreviewImage = (0, react_1.useCallback)((index) => {
62
+ const openPreviewImage = (0, react_1.useCallback)((index, type = Media_1.MEDIA_TYPE_IMAGE) => {
57
63
  if (gallery === false) {
58
64
  // Prevent gallery
59
65
  return;
60
66
  }
61
67
  setPreview(index);
62
- onMediaClick(_medias[index]);
63
- }, [_medias]);
68
+ setMediaType(type);
69
+ onMediaClick(type === Media_1.MEDIA_TYPE_IMAGE ? images[index] : docs[index]);
70
+ }, [images, docs]);
64
71
  // RENDERING
65
72
  const renderTitle = (o) => {
66
73
  if (!o) {
@@ -77,27 +84,27 @@ exports.default = (props) => {
77
84
  break;
78
85
  }
79
86
  }
80
- return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: o.title && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.title }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: [startAdornment, " ", o.title] })) }))) }));
87
+ return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: o.title && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.title }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: [startAdornment, " ", o.title] })) }))) }));
81
88
  };
82
89
  const renderOne = () => {
83
- const overlay = _medias.length > maxVisible && maxVisible == 1 ? renderCountOverlay(true) : renderOverlay(0);
84
- const isGif = _medias[0].image_mimetype ? _medias[0].image_mimetype.includes('image/gif') : false;
85
- const isLandscape = _medias[0].image_height < _medias[0].image_width;
86
- return ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, style: Object.assign({}, (_medias[0].image_thumbnail && _medias[0].image_thumbnail.color ? { backgroundColor: _medias[0].image_thumbnail.color } : {})) }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, ref: ref, xs: 12, classes: {
87
- root: (0, classnames_1.default)(classes.border, classes.heightOne, Object.assign(Object.assign({}, (isGif || isLandscape ? { [classes.background]: true } : { [classes.backgroundPortrait]: true })), { [classes.gallery]: gallery, [classes.heightHalfOne]: _medias.length > 1 }))
88
- }, onClick: () => openPreviewImage(0), style: Object.assign({ background: `url(${getImageUrl(_medias[0], inView && isGif)})` }, (isLandscape ? { paddingTop: `${(100 * _medias[0].image_height) / _medias[0].image_width}%` } : {})) }, { children: [overlay, renderTitle(_medias[0])] })) })));
90
+ const overlay = images.length > maxVisible && maxVisible == 1 ? renderCountOverlay(true) : renderOverlay(0);
91
+ const isGif = images[0]['image_mimetype'] ? images[0]['image_mimetype'].includes('image/gif') : false;
92
+ const isLandscape = images[0].image_height < images[0].image_width;
93
+ return ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, style: Object.assign({}, (images[0].image_thumbnail && images[0].image_thumbnail.color ? { backgroundColor: images[0].image_thumbnail.color } : {})) }, { children: (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, ref: ref, xs: 12, classes: {
94
+ root: (0, classnames_1.default)(classes.border, classes.heightOne, Object.assign(Object.assign({}, (isGif || isLandscape ? { [classes.background]: true } : { [classes.backgroundPortrait]: true })), { [classes.gallery]: gallery, [classes.heightHalfOne]: images.length > 1 }))
95
+ }, onClick: () => openPreviewImage(0), style: Object.assign({ background: `url(${getImageUrl(images[0], inView && isGif)})` }, (isLandscape ? { paddingTop: `${(100 * images[0].image_height) / images[0].image_width}%` } : {})) }, { children: [overlay, renderTitle(images[0])] })) })));
89
96
  };
90
97
  const renderTwo = () => {
91
- const overlay = _medias.length > maxVisible && [2, 3].includes(+maxVisible) ? renderCountOverlay(true) : renderOverlay(1);
92
- const conditionalRender = [3, 4].includes(_medias.length) || (_medias.length > +maxVisible && [3, 4].includes(+maxVisible));
93
- return ((0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 6, classes: { root: (0, classnames_1.default)(classes.border, classes.heightTwo, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 1 : 0), style: { background: `url(${getImageUrl(conditionalRender ? _medias[1] : _medias[0])})` } }, { children: [renderOverlay(conditionalRender ? 1 : 0), renderTitle(_medias[0])] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 6, classes: { root: (0, classnames_1.default)(classes.border, classes.heightTwo, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 2 : 1), style: { background: `url(${getImageUrl(conditionalRender ? _medias[2] : _medias[1])})` } }, { children: [overlay, renderTitle(_medias[1])] }))] })));
98
+ const overlay = images.length > maxVisible && [2, 3].includes(+maxVisible) ? renderCountOverlay(true) : renderOverlay(1);
99
+ const conditionalRender = [3, 4].includes(images.length) || (images.length > +maxVisible && [3, 4].includes(+maxVisible));
100
+ return ((0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 6, classes: { root: (0, classnames_1.default)(classes.border, classes.heightTwo, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 1 : 0), style: { background: `url(${getImageUrl(conditionalRender ? images[1] : images[0])})` } }, { children: [renderOverlay(conditionalRender ? 1 : 0), renderTitle(images[0])] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 6, classes: { root: (0, classnames_1.default)(classes.border, classes.heightTwo, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 2 : 1), style: { background: `url(${getImageUrl(conditionalRender ? images[2] : images[1])})` } }, { children: [overlay, renderTitle(images[1])] }))] })));
94
101
  };
95
102
  const renderThree = () => {
96
- const conditionalRender = _medias.length == 4 || (_medias.length > +maxVisible && +maxVisible == 4);
97
- const overlay = !maxVisible || maxVisible > 5 || (_medias.length > maxVisible && [4, 5].includes(+maxVisible))
103
+ const conditionalRender = images.length == 4 || (images.length > +maxVisible && +maxVisible == 4);
104
+ const overlay = !maxVisible || maxVisible > 5 || (images.length > maxVisible && [4, 5].includes(+maxVisible))
98
105
  ? renderCountOverlay(true)
99
106
  : renderOverlay(conditionalRender ? 3 : 4);
100
- return ((0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: (0, classnames_1.default)(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 1 : 2), style: { background: `url(${getImageUrl(conditionalRender ? _medias[1] : _medias[2])})` } }, { children: [renderOverlay(conditionalRender ? 1 : 2), renderTitle(_medias[1])] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: (0, classnames_1.default)(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 2 : 3), style: { background: `url(${getImageUrl(conditionalRender ? _medias[2] : _medias[3])})` } }, { children: [renderOverlay(conditionalRender ? 2 : 3), renderTitle(_medias[2])] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: (0, classnames_1.default)(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 3 : 4), style: { background: `url(${getImageUrl(conditionalRender ? _medias[3] : _medias[4])})` } }, { children: [overlay, renderTitle(_medias[3])] }))] })));
107
+ return ((0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ container: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: (0, classnames_1.default)(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 1 : 2), style: { background: `url(${getImageUrl(conditionalRender ? images[1] : images[2])})` } }, { children: [renderOverlay(conditionalRender ? 1 : 2), renderTitle(images[1])] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: (0, classnames_1.default)(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 2 : 3), style: { background: `url(${getImageUrl(conditionalRender ? images[2] : images[3])})` } }, { children: [renderOverlay(conditionalRender ? 2 : 3), renderTitle(images[2])] })), (0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 4, md: 4, classes: { root: (0, classnames_1.default)(classes.border, classes.heightThree, classes.background, { [classes.gallery]: gallery }) }, onClick: () => openPreviewImage(conditionalRender ? 3 : 4), style: { background: `url(${getImageUrl(conditionalRender ? images[3] : images[4])})` } }, { children: [overlay, renderTitle(images[3])] }))] })));
101
108
  };
102
109
  const renderOverlay = (id) => {
103
110
  if (!gallery) {
@@ -109,31 +116,50 @@ exports.default = (props) => {
109
116
  ];
110
117
  };
111
118
  const renderCountOverlay = (more) => {
112
- const extra = _medias.length - (maxVisible && maxVisible > 5 ? 5 : maxVisible);
119
+ const extra = images.length - (maxVisible && maxVisible > 5 ? 5 : maxVisible);
113
120
  return [
114
121
  more && (0, jsx_runtime_1.jsx)("div", { className: classes.cover }, "count"),
115
122
  more && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes.coverText, style: { fontSize: '200%' } }, { children: (0, jsx_runtime_1.jsxs)("p", { children: ["+", extra] }) }), "count-sub"))
116
123
  ];
117
124
  };
125
+ const handleDownload = (0, react_1.useCallback)((index) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
126
+ try {
127
+ const response = yield api_services_1.http.request({ url: docs[index].url, responseType: 'blob' });
128
+ const blob = new Blob([response.data], { type: 'application/pdf' });
129
+ const url = window.URL.createObjectURL(blob);
130
+ const link = document.createElement('a');
131
+ link.href = url;
132
+ link.download = docs[index].title;
133
+ link.click();
134
+ // Cleanup
135
+ window.URL.revokeObjectURL(url);
136
+ }
137
+ catch (error) {
138
+ utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
139
+ }
140
+ }), []);
118
141
  const handleIndexChange = (0, react_1.useCallback)((index) => {
119
- if (_medias[index].type === Media_1.MEDIA_TYPE_DOCUMENT) {
120
- setToolbarButtons((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ component: react_core_1.Link, to: medias[index].url, target: "_blank", color: "inherit" }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "download" }) })));
142
+ if (mediaType === Media_1.MEDIA_TYPE_DOCUMENT) {
143
+ setToolbarButtons((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => handleDownload(index) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "download" }) })));
121
144
  }
122
145
  else {
123
146
  setToolbarButtons(undefined);
124
147
  }
125
- }, [_medias, setToolbarButtons]);
148
+ }, [mediaType, docs, setToolbarButtons, handleDownload]);
126
149
  (0, react_1.useEffect)(() => {
127
150
  if (preview !== -1) {
128
151
  handleIndexChange(preview);
129
152
  }
153
+ else {
154
+ setMediaType(null);
155
+ }
130
156
  }, [preview]);
131
- const imagesToShow = [..._medias];
132
- if (maxVisible && _medias.length > maxVisible) {
157
+ const imagesToShow = [...images];
158
+ if (maxVisible && images.length > maxVisible) {
133
159
  imagesToShow.length = maxVisible;
134
160
  }
135
- if (_medias.length === 0) {
161
+ if (medias.length === 0) {
136
162
  return null;
137
163
  }
138
- return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.displayRoot, className) }, { children: [[1, 3, 4].includes(imagesToShow.length) && renderOne(), imagesToShow.length >= 2 && imagesToShow.length != 4 && renderTwo(), imagesToShow.length >= 4 && renderThree(), preview !== -1 && ((0, jsx_runtime_1.jsx)(Lightbox_1.Lightbox, { onClose: handleClose, index: preview, medias: _medias, toolbarButtons: toolbarButtons, onIndexChange: handleIndexChange }))] })));
164
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.displayRoot, className) }, { children: [[1, 3, 4].includes(imagesToShow.length) && renderOne(), imagesToShow.length >= 2 && imagesToShow.length < 4 && renderTwo(), imagesToShow.length >= 4 && renderThree(), preview !== -1 && ((0, jsx_runtime_1.jsx)(Lightbox_1.Lightbox, { onClose: handleClose, index: preview, medias: mediaType === Media_1.MEDIA_TYPE_IMAGE ? images : docs, toolbarButtons: toolbarButtons })), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.docsWrapper }, { children: docs.map((doc, i) => ((0, jsx_runtime_1.jsx)(DocComponent_1.default, { doc: doc, index: i, openPreviewImage: openPreviewImage, handleDownload: handleDownload }, doc.id))) }))] })));
139
165
  };
@@ -0,0 +1,10 @@
1
+ import { SCMediaType } from '@selfcommunity/types';
2
+ interface DocComponentProps {
3
+ doc: SCMediaType;
4
+ index?: number;
5
+ onDelete?: (id: number) => void;
6
+ openPreviewImage?: (index: number, type: string) => void;
7
+ handleDownload?: (id: number) => void;
8
+ }
9
+ export default function DocComponent(props: DocComponentProps): JSX.Element;
10
+ export {};
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const material_1 = require("@mui/material");
5
+ const constants_1 = require("./constants");
6
+ const react_core_1 = require("@selfcommunity/react-core");
7
+ const Media_1 = require("../../../constants/Media");
8
+ const classes = {
9
+ docRoot: `${constants_1.PREFIX}-doc-root`,
10
+ image: `${constants_1.PREFIX}-image`,
11
+ textWrapper: `${constants_1.PREFIX}-text-wrapper`,
12
+ title: `${constants_1.PREFIX}-title`,
13
+ subtitle: `${constants_1.PREFIX}-subtitle`,
14
+ actionWrapper: `${constants_1.PREFIX}-action-wrapper`,
15
+ action: `${constants_1.PREFIX}-action`
16
+ };
17
+ const Root = (0, material_1.styled)(material_1.Stack, {
18
+ name: constants_1.PREFIX,
19
+ slot: 'DocRoot'
20
+ })(() => ({}));
21
+ function formatBytes(bytes, decimals = 2) {
22
+ if (!+bytes)
23
+ return '0 Bytes';
24
+ const k = 1024;
25
+ const dm = decimals < 0 ? 0 : decimals;
26
+ const sizes = ['Bytes', 'KB', 'MB'];
27
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
28
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
29
+ }
30
+ function DocComponent(props) {
31
+ const { doc, index, onDelete, openPreviewImage, handleDownload } = props;
32
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.docRoot }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { component: "img", className: classes.image, alt: "pdf preview", src: doc.image_thumbnail ? doc.image_thumbnail.url : doc.image, onClick: () => openPreviewImage === null || openPreviewImage === void 0 ? void 0 : openPreviewImage(index, Media_1.MEDIA_TYPE_DOCUMENT), sx: { cursor: openPreviewImage ? 'pointer' : undefined } }), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.textWrapper }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.title }, { children: doc.title })), doc.size && (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.subtitle }, { children: formatBytes(doc.size) }))] })), (handleDownload || onDelete) && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.actionWrapper }, { children: [onDelete && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.action, onClick: () => onDelete(doc.id) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "delete" }) }))), handleDownload && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.action, component: react_core_1.Link, to: doc.url, target: "_blank" }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "visibility" }) })), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.action, onClick: () => handleDownload(index) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "download" }) }))] }))] })))] })));
33
+ }
34
+ exports.default = DocComponent;