@selfcommunity/react-ui 0.11.0-alpha.66 → 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 (641) 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/CommentsFeedObject/CommentsFeedObject.d.ts +1 -1
  40. package/lib/cjs/components/CommentsObject/CommentsObject.d.ts +1 -1
  41. package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.d.ts +8 -0
  42. package/lib/cjs/components/CommunityPaywalls/CommunityPaywalls.js +69 -0
  43. package/lib/cjs/components/CommunityPaywalls/Skeleton.d.ts +27 -0
  44. package/lib/cjs/components/CommunityPaywalls/Skeleton.js +53 -0
  45. package/lib/cjs/components/CommunityPaywalls/constants.d.ts +1 -0
  46. package/lib/cjs/components/CommunityPaywalls/constants.js +4 -0
  47. package/lib/cjs/components/CommunityPaywalls/index.d.ts +4 -0
  48. package/lib/cjs/components/CommunityPaywalls/index.js +8 -0
  49. package/lib/cjs/components/Composer/Composer.d.ts +1 -0
  50. package/lib/cjs/components/Composer/Composer.js +82 -18
  51. package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +2 -2
  52. package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +2 -2
  53. package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +2 -2
  54. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +20 -13
  55. package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.d.ts +9 -0
  56. package/lib/cjs/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +61 -0
  57. package/lib/cjs/components/Composer/Layer/ScheduledLayer/index.d.ts +3 -0
  58. package/lib/cjs/components/Composer/Layer/ScheduledLayer/index.js +5 -0
  59. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +2 -1
  60. package/lib/cjs/components/ConnectionUserButton/ConnectionUserButton.js +6 -0
  61. package/lib/cjs/components/Course/Course.d.ts +5 -0
  62. package/lib/cjs/components/Course/Course.js +3 -3
  63. package/lib/cjs/components/CourseDashboard/Header.d.ts +2 -2
  64. package/lib/cjs/components/CourseDashboard/Header.js +8 -1
  65. package/lib/cjs/components/CourseDashboard/Student.d.ts +2 -2
  66. package/lib/cjs/components/CourseDashboard/Student.js +15 -4
  67. package/lib/cjs/components/CourseForm/CourseForm.d.ts +5 -0
  68. package/lib/cjs/components/CourseForm/CourseForm.js +36 -5
  69. package/lib/cjs/components/CourseJoinButton/CourseJoinButton.d.ts +1 -6
  70. package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +9 -7
  71. package/lib/cjs/components/CreateCourseButton/CreateCourseButton.js +1 -1
  72. package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.d.ts +10 -0
  73. package/lib/cjs/components/CreatePaymentProductForm/CreatePaymentProductForm.js +144 -0
  74. package/lib/cjs/components/CreatePaymentProductForm/constants.d.ts +1 -0
  75. package/lib/cjs/components/CreatePaymentProductForm/constants.js +4 -0
  76. package/lib/cjs/components/CreatePaymentProductForm/index.d.ts +3 -0
  77. package/lib/cjs/components/CreatePaymentProductForm/index.js +5 -0
  78. package/lib/cjs/components/EditEventButton/EditEventButton.js +1 -0
  79. package/lib/cjs/components/Editor/Editor.d.ts +1 -1
  80. package/lib/cjs/components/Editor/nodes/HashtagNode.d.ts +1 -1
  81. package/lib/cjs/components/Editor/nodes/HashtagNode.js +4 -4
  82. package/lib/cjs/components/Editor/nodes/ImageNode.d.ts +1 -1
  83. package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -6
  84. package/lib/cjs/components/Editor/nodes/MentionNode.d.ts +1 -1
  85. package/lib/cjs/components/Editor/nodes/MentionNode.js +4 -4
  86. package/lib/cjs/components/Editor/plugins/ApiPlugin.d.ts +1 -1
  87. package/lib/cjs/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
  88. package/lib/cjs/components/Editor/shared/useDecorators.d.ts +2 -2
  89. package/lib/cjs/components/Event/Event.d.ts +5 -0
  90. package/lib/cjs/components/Event/Event.js +2 -2
  91. package/lib/cjs/components/EventForm/EventForm.js +47 -16
  92. package/lib/cjs/components/EventForm/types.d.ts +8 -5
  93. package/lib/cjs/components/EventFormDialog/EventFormDialog.js +7 -1
  94. package/lib/cjs/components/EventHeader/EventHeader.js +12 -3
  95. package/lib/cjs/components/EventInfoWidget/EventInfoWidget.js +27 -4
  96. package/lib/cjs/components/EventMediaWidget/asUploadButton.d.ts +1 -1
  97. package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +11 -2
  98. package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +23 -13
  99. package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +18 -7
  100. package/lib/cjs/components/Feed/Feed.d.ts +2 -2
  101. package/lib/cjs/components/Feed/Skeleton.d.ts +1 -1
  102. package/lib/cjs/components/FeedObject/Activities/Activities.d.ts +1 -1
  103. package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
  104. package/lib/cjs/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +2 -1
  105. package/lib/cjs/components/FeedObject/FeedObject.d.ts +1 -1
  106. package/lib/cjs/components/FeedObject/FeedObject.js +16 -6
  107. package/lib/cjs/components/FeedObject/Poll/Choice/Choice.js +1 -1
  108. package/lib/cjs/components/FeedObject/Poll/Poll.js +1 -1
  109. package/lib/cjs/components/Group/Group.d.ts +6 -1
  110. package/lib/cjs/components/Group/Group.js +3 -3
  111. package/lib/cjs/components/GroupForm/GroupForm.js +37 -7
  112. package/lib/cjs/components/GroupHeader/GroupHeader.js +10 -2
  113. package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +3 -1
  114. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +7 -2
  115. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +6 -4
  116. package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +4 -2
  117. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -8
  118. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +30 -8
  119. package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +3 -2
  120. package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.d.ts +1 -1
  121. package/lib/cjs/components/LiveStreamForm/types.d.ts +3 -3
  122. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +1 -1
  123. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +1 -1
  124. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +1 -1
  125. package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +2 -2
  126. package/lib/cjs/components/LiveStreamRoom/types.d.ts +1 -1
  127. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.d.ts +1 -0
  128. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +42 -4
  129. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
  130. package/lib/cjs/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
  131. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +6 -0
  132. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +1 -1
  133. package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +28 -5
  134. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +8 -3
  135. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +1 -1
  136. package/lib/cjs/components/Notification/Notification.d.ts +1 -1
  137. package/lib/cjs/components/PaymentDetailDialog/PaymentDetailDialog.d.ts +6 -0
  138. package/lib/cjs/components/PaymentDetailDialog/PaymentDetailDialog.js +40 -0
  139. package/lib/cjs/components/PaymentDetailDialog/index.d.ts +3 -0
  140. package/lib/cjs/components/PaymentDetailDialog/index.js +5 -0
  141. package/lib/cjs/components/PaymentOrder/PaymentOrder.d.ts +10 -0
  142. package/lib/cjs/components/PaymentOrder/PaymentOrder.js +80 -0
  143. package/lib/cjs/components/PaymentOrder/Skeleton.d.ts +30 -0
  144. package/lib/cjs/components/PaymentOrder/Skeleton.js +61 -0
  145. package/lib/cjs/components/PaymentOrder/constants.d.ts +1 -0
  146. package/lib/cjs/components/PaymentOrder/constants.js +4 -0
  147. package/lib/cjs/components/PaymentOrder/index.d.ts +3 -0
  148. package/lib/cjs/components/PaymentOrder/index.js +5 -0
  149. package/lib/cjs/components/PaymentOrderPdfButton/PaymentOrderPdfButton.d.ts +52 -0
  150. package/lib/cjs/components/PaymentOrderPdfButton/PaymentOrderPdfButton.js +74 -0
  151. package/lib/cjs/components/PaymentOrderPdfButton/index.d.ts +3 -0
  152. package/lib/cjs/components/PaymentOrderPdfButton/index.js +5 -0
  153. package/lib/cjs/components/PaymentOrders/PaymentOrders.d.ts +17 -0
  154. package/lib/cjs/components/PaymentOrders/PaymentOrders.js +264 -0
  155. package/lib/cjs/components/PaymentOrders/index.d.ts +3 -0
  156. package/lib/cjs/components/PaymentOrders/index.js +5 -0
  157. package/lib/cjs/components/PaymentProduct/PaymentProduct.d.ts +18 -0
  158. package/lib/cjs/components/PaymentProduct/PaymentProduct.js +48 -0
  159. package/lib/cjs/components/PaymentProduct/Skeleton.d.ts +25 -0
  160. package/lib/cjs/components/PaymentProduct/Skeleton.js +55 -0
  161. package/lib/cjs/components/PaymentProduct/constants.d.ts +1 -0
  162. package/lib/cjs/components/PaymentProduct/constants.js +4 -0
  163. package/lib/cjs/components/PaymentProduct/index.d.ts +3 -0
  164. package/lib/cjs/components/PaymentProduct/index.js +5 -0
  165. package/lib/cjs/components/PaymentProductPrice/PaymentProductPrice.d.ts +15 -0
  166. package/lib/cjs/components/PaymentProductPrice/PaymentProductPrice.js +61 -0
  167. package/lib/cjs/components/PaymentProductPrice/Skeleton.d.ts +21 -0
  168. package/lib/cjs/components/PaymentProductPrice/Skeleton.js +46 -0
  169. package/lib/cjs/components/PaymentProductPrice/constants.d.ts +1 -0
  170. package/lib/cjs/components/PaymentProductPrice/constants.js +4 -0
  171. package/lib/cjs/components/PaymentProductPrice/index.d.ts +3 -0
  172. package/lib/cjs/components/PaymentProductPrice/index.js +5 -0
  173. package/lib/cjs/components/PaymentProducts/PaymentProducts.d.ts +11 -0
  174. package/lib/cjs/components/PaymentProducts/PaymentProducts.js +76 -0
  175. package/lib/cjs/components/PaymentProducts/Skeleton.d.ts +21 -0
  176. package/lib/cjs/components/PaymentProducts/Skeleton.js +46 -0
  177. package/lib/cjs/components/PaymentProducts/constants.d.ts +1 -0
  178. package/lib/cjs/components/PaymentProducts/constants.js +4 -0
  179. package/lib/cjs/components/PaymentProducts/index.d.ts +3 -0
  180. package/lib/cjs/components/PaymentProducts/index.js +5 -0
  181. package/lib/cjs/components/Paywalls/Paywalls.d.ts +10 -0
  182. package/lib/cjs/components/Paywalls/Paywalls.js +94 -0
  183. package/lib/cjs/components/Paywalls/Skeleton.d.ts +21 -0
  184. package/lib/cjs/components/Paywalls/Skeleton.js +46 -0
  185. package/lib/cjs/components/Paywalls/constants.d.ts +1 -0
  186. package/lib/cjs/components/Paywalls/constants.js +4 -0
  187. package/lib/cjs/components/Paywalls/index.d.ts +3 -0
  188. package/lib/cjs/components/Paywalls/index.js +5 -0
  189. package/lib/cjs/components/PaywallsConfigurator/PaywallsConfigurator.d.ts +13 -0
  190. package/lib/cjs/components/PaywallsConfigurator/PaywallsConfigurator.js +252 -0
  191. package/lib/cjs/components/PaywallsConfigurator/Skeleton.d.ts +21 -0
  192. package/lib/cjs/components/PaywallsConfigurator/Skeleton.js +46 -0
  193. package/lib/cjs/components/PaywallsConfigurator/constants.d.ts +5 -0
  194. package/lib/cjs/components/PaywallsConfigurator/constants.js +9 -0
  195. package/lib/cjs/components/PaywallsConfigurator/index.d.ts +4 -0
  196. package/lib/cjs/components/PaywallsConfigurator/index.js +8 -0
  197. package/lib/cjs/components/PaywallsDialog/PaywallsDialog.d.ts +8 -0
  198. package/lib/cjs/components/PaywallsDialog/PaywallsDialog.js +43 -0
  199. package/lib/cjs/components/PaywallsDialog/index.d.ts +3 -0
  200. package/lib/cjs/components/PaywallsDialog/index.js +5 -0
  201. package/lib/cjs/components/PdfPreview/PdfPreview.d.ts +8 -0
  202. package/lib/cjs/components/PdfPreview/PdfPreview.js +92 -0
  203. package/lib/cjs/components/PdfPreview/Skeleton.d.ts +5 -0
  204. package/lib/cjs/components/PdfPreview/Skeleton.js +38 -0
  205. package/lib/cjs/components/PdfPreview/index.d.ts +3 -0
  206. package/lib/cjs/components/PdfPreview/index.js +5 -0
  207. package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.d.ts +11 -0
  208. package/lib/cjs/components/PdfPreviewDialog/PdfPreviewDialog.js +63 -0
  209. package/lib/cjs/components/PdfPreviewDialog/index.d.ts +3 -0
  210. package/lib/cjs/components/PdfPreviewDialog/index.js +5 -0
  211. package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +2 -1
  212. package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
  213. package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +4 -4
  214. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.d.ts +1 -1
  215. package/lib/cjs/components/ToastNotifications/ToastNotifications.js +2 -10
  216. package/lib/cjs/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.d.ts +41 -0
  217. package/lib/cjs/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.js +94 -0
  218. package/lib/cjs/components/UserAddPaymentMethodDialog/constants.d.ts +1 -0
  219. package/lib/cjs/components/UserAddPaymentMethodDialog/constants.js +4 -0
  220. package/lib/cjs/components/UserAddPaymentMethodDialog/index.d.ts +3 -0
  221. package/lib/cjs/components/UserAddPaymentMethodDialog/index.js +5 -0
  222. package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.d.ts +40 -0
  223. package/lib/cjs/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +143 -0
  224. package/lib/cjs/components/UserAddPaymentMethodForm/constants.d.ts +1 -0
  225. package/lib/cjs/components/UserAddPaymentMethodForm/constants.js +4 -0
  226. package/lib/cjs/components/UserAddPaymentMethodForm/index.d.ts +3 -0
  227. package/lib/cjs/components/UserAddPaymentMethodForm/index.js +5 -0
  228. package/lib/cjs/components/UserBillingInfo/Skeleton.d.ts +25 -0
  229. package/lib/cjs/components/UserBillingInfo/Skeleton.js +12 -0
  230. package/lib/cjs/components/UserBillingInfo/UserBillingInfo.d.ts +35 -0
  231. package/lib/cjs/components/UserBillingInfo/UserBillingInfo.js +492 -0
  232. package/lib/cjs/components/UserBillingInfo/constants.d.ts +1 -0
  233. package/lib/cjs/components/UserBillingInfo/constants.js +4 -0
  234. package/lib/cjs/components/UserBillingInfo/index.d.ts +4 -0
  235. package/lib/cjs/components/UserBillingInfo/index.js +8 -0
  236. package/lib/cjs/components/UserBillingInfo/reducer.d.ts +77 -0
  237. package/lib/cjs/components/UserBillingInfo/reducer.js +96 -0
  238. package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.d.ts +44 -0
  239. package/lib/cjs/components/UserChangeAddressDialog/UserChangeAddressDialog.js +85 -0
  240. package/lib/cjs/components/UserChangeAddressDialog/constants.d.ts +1 -0
  241. package/lib/cjs/components/UserChangeAddressDialog/constants.js +4 -0
  242. package/lib/cjs/components/UserChangeAddressDialog/index.d.ts +3 -0
  243. package/lib/cjs/components/UserChangeAddressDialog/index.js +5 -0
  244. package/lib/cjs/components/UserConnectionsRequestsSentWidget/UserConnectionsRequestsSentWidget.js +6 -6
  245. package/lib/cjs/components/UserConnectionsRequestsWidget/UserConnectionsRequestsWidget.js +5 -5
  246. package/lib/cjs/components/UserConnectionsWidget/UserConnectionsWidget.js +8 -5
  247. package/lib/cjs/components/UserCounters/UserCounters.js +20 -17
  248. package/lib/cjs/components/UserFollowedCategoriesWidget/UserFollowedCategoriesWidget.js +9 -6
  249. package/lib/cjs/components/UserPaymentMethods/Skeleton.d.ts +15 -0
  250. package/lib/cjs/components/UserPaymentMethods/Skeleton.js +49 -0
  251. package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.d.ts +19 -0
  252. package/lib/cjs/components/UserPaymentMethods/UserPaymentMethods.js +338 -0
  253. package/lib/cjs/components/UserPaymentMethods/constants.d.ts +1 -0
  254. package/lib/cjs/components/UserPaymentMethods/constants.js +4 -0
  255. package/lib/cjs/components/UserPaymentMethods/index.d.ts +4 -0
  256. package/lib/cjs/components/UserPaymentMethods/index.js +8 -0
  257. package/lib/cjs/components/UserPaymentMethodsPortal/Skeleton.d.ts +22 -0
  258. package/lib/cjs/components/UserPaymentMethodsPortal/Skeleton.js +37 -0
  259. package/lib/cjs/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.d.ts +44 -0
  260. package/lib/cjs/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.js +103 -0
  261. package/lib/cjs/components/UserPaymentMethodsPortal/constants.d.ts +1 -0
  262. package/lib/cjs/components/UserPaymentMethodsPortal/constants.js +4 -0
  263. package/lib/cjs/components/UserPaymentMethodsPortal/index.d.ts +4 -0
  264. package/lib/cjs/components/UserPaymentMethodsPortal/index.js +8 -0
  265. package/lib/cjs/components/UserSuggestionWidget/UserSuggestionWidget.js +7 -5
  266. package/lib/cjs/constants/Billing.d.ts +10 -0
  267. package/lib/cjs/constants/Billing.js +60 -0
  268. package/lib/cjs/constants/ContributionsActionsMenu.d.ts +1 -0
  269. package/lib/cjs/constants/ContributionsActionsMenu.js +2 -1
  270. package/lib/cjs/constants/Country.d.ts +5 -0
  271. package/lib/cjs/constants/Country.js +271 -0
  272. package/lib/cjs/constants/DefaultDrawerContent.d.ts +1 -0
  273. package/lib/cjs/constants/DefaultDrawerContent.js +4 -0
  274. package/lib/cjs/constants/Payments.d.ts +4 -0
  275. package/lib/cjs/constants/Payments.js +7 -0
  276. package/lib/cjs/index.d.ts +23 -1
  277. package/lib/cjs/index.js +54 -2
  278. package/lib/cjs/shared/AutoPlayer/index.d.ts +0 -5
  279. package/lib/cjs/shared/AutoPlayer/index.js +5 -4
  280. package/lib/cjs/shared/ContributionActionsMenu/index.d.ts +4 -0
  281. package/lib/cjs/shared/ContributionActionsMenu/index.js +56 -5
  282. package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.d.ts +1 -1
  283. package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.js +3 -1
  284. package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.d.ts +44 -0
  285. package/lib/cjs/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +53 -0
  286. package/lib/cjs/shared/HiddenPurchasableContent/index.d.ts +3 -0
  287. package/lib/cjs/shared/HiddenPurchasableContent/index.js +5 -0
  288. package/lib/cjs/shared/InfiniteScroll/index.d.ts +1 -1
  289. package/lib/cjs/shared/Media/File/DisplayComponent.d.ts +2 -1
  290. package/lib/cjs/shared/Media/File/DisplayComponent.js +58 -32
  291. package/lib/cjs/shared/Media/File/DocComponent.d.ts +10 -0
  292. package/lib/cjs/shared/Media/File/DocComponent.js +34 -0
  293. package/lib/cjs/shared/Media/File/PreviewComponent.d.ts +2 -2
  294. package/lib/cjs/shared/Media/File/PreviewComponent.js +15 -17
  295. package/lib/cjs/shared/Media/File/TriggerButton.js +14 -1
  296. package/lib/cjs/shared/Media/File/asUploadButton.d.ts +1 -1
  297. package/lib/cjs/shared/Media/File/filter.d.ts +2 -2
  298. package/lib/cjs/shared/Media/File/filter.js +5 -1
  299. package/lib/cjs/shared/Media/File/index.js +2 -2
  300. package/lib/cjs/shared/Media/Link/UrlTextField/index.d.ts +1 -1
  301. package/lib/cjs/shared/MetadataField/MetadataField.d.ts +1 -1
  302. package/lib/cjs/shared/StickyBox/index.d.ts +4 -4
  303. package/lib/cjs/shared/Tags/index.js +7 -3
  304. package/lib/cjs/shared/UsernameTextField/index.d.ts +1 -1
  305. package/lib/cjs/types/composer.d.ts +1 -1
  306. package/lib/cjs/types/index.d.ts +2 -1
  307. package/lib/cjs/types/index.js +5 -1
  308. package/lib/cjs/types/payment.d.ts +25 -0
  309. package/lib/cjs/types/payment.js +29 -0
  310. package/lib/cjs/utils/address.d.ts +10 -0
  311. package/lib/cjs/utils/address.js +24 -0
  312. package/lib/cjs/utils/checkout.d.ts +2 -0
  313. package/lib/cjs/utils/checkout.js +23 -0
  314. package/lib/cjs/utils/payment.d.ts +17 -0
  315. package/lib/cjs/utils/payment.js +69 -0
  316. package/lib/esm/assets/checkout/general.d.ts +2 -0
  317. package/lib/esm/assets/checkout/general.js +1 -0
  318. package/lib/esm/assets/checkout/success.d.ts +2 -0
  319. package/lib/esm/assets/checkout/success.js +1 -0
  320. package/lib/esm/assets/custom/formazione.d.ts +2 -0
  321. package/lib/esm/assets/custom/formazione.js +1 -0
  322. package/lib/esm/components/AcceptRequestUserEventButton/AcceptRequestUserEventButton.js +20 -2
  323. package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.d.ts +61 -0
  324. package/lib/esm/components/AcceptRequestUserGroupButton/AcceptRequestUserGroupButton.js +103 -0
  325. package/lib/esm/components/AcceptRequestUserGroupButton/index.d.ts +3 -0
  326. package/lib/esm/components/AcceptRequestUserGroupButton/index.js +2 -0
  327. package/lib/esm/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  328. package/lib/esm/components/BottomNavigation/BottomNavigation.js +2 -2
  329. package/lib/esm/components/BuyButton/BuyButton.d.ts +73 -0
  330. package/lib/esm/components/BuyButton/BuyButton.js +193 -0
  331. package/lib/esm/components/BuyButton/index.d.ts +3 -0
  332. package/lib/esm/components/BuyButton/index.js +2 -0
  333. package/lib/esm/components/CategoriesSuggestionWidget/CategoriesSuggestionWidget.js +6 -4
  334. package/lib/esm/components/Category/Category.d.ts +5 -0
  335. package/lib/esm/components/Category/Category.js +5 -5
  336. package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.d.ts +4 -0
  337. package/lib/esm/components/CategoryFollowButton/CategoryFollowButton.js +34 -8
  338. package/lib/esm/components/CategoryHeader/CategoryHeader.js +7 -2
  339. package/lib/esm/components/CategoryTrendingUsersWidget/CategoryTrendingUsersWidget.js +9 -2
  340. package/lib/esm/components/Checkout/Checkout.d.ts +14 -0
  341. package/lib/esm/components/Checkout/Checkout.js +128 -0
  342. package/lib/esm/components/Checkout/CheckoutHeaderInfoWidget.d.ts +8 -0
  343. package/lib/esm/components/Checkout/CheckoutHeaderInfoWidget.js +30 -0
  344. package/lib/esm/components/Checkout/Skeleton.d.ts +21 -0
  345. package/lib/esm/components/Checkout/Skeleton.js +84 -0
  346. package/lib/esm/components/Checkout/constants.d.ts +1 -0
  347. package/lib/esm/components/Checkout/constants.js +1 -0
  348. package/lib/esm/components/Checkout/index.d.ts +3 -0
  349. package/lib/esm/components/Checkout/index.js +2 -0
  350. package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.d.ts +10 -0
  351. package/lib/esm/components/CheckoutReturnDialog/CheckoutReturnDialog.js +168 -0
  352. package/lib/esm/components/CheckoutReturnDialog/index.d.ts +3 -0
  353. package/lib/esm/components/CheckoutReturnDialog/index.js +2 -0
  354. package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.d.ts +1 -1
  355. package/lib/esm/components/CommentsObject/CommentsObject.d.ts +1 -1
  356. package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.d.ts +8 -0
  357. package/lib/esm/components/CommunityPaywalls/CommunityPaywalls.js +66 -0
  358. package/lib/esm/components/CommunityPaywalls/Skeleton.d.ts +27 -0
  359. package/lib/esm/components/CommunityPaywalls/Skeleton.js +50 -0
  360. package/lib/esm/components/CommunityPaywalls/constants.d.ts +1 -0
  361. package/lib/esm/components/CommunityPaywalls/constants.js +1 -0
  362. package/lib/esm/components/CommunityPaywalls/index.d.ts +4 -0
  363. package/lib/esm/components/CommunityPaywalls/index.js +4 -0
  364. package/lib/esm/components/Composer/Composer.d.ts +1 -0
  365. package/lib/esm/components/Composer/Composer.js +82 -18
  366. package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +2 -2
  367. package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +2 -2
  368. package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +2 -2
  369. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +20 -13
  370. package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.d.ts +9 -0
  371. package/lib/esm/components/Composer/Layer/ScheduledLayer/ScheduledLayer.js +59 -0
  372. package/lib/esm/components/Composer/Layer/ScheduledLayer/index.d.ts +3 -0
  373. package/lib/esm/components/Composer/Layer/ScheduledLayer/index.js +2 -0
  374. package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +2 -1
  375. package/lib/esm/components/ConnectionUserButton/ConnectionUserButton.js +6 -0
  376. package/lib/esm/components/Course/Course.d.ts +5 -0
  377. package/lib/esm/components/Course/Course.js +3 -3
  378. package/lib/esm/components/CourseDashboard/Header.d.ts +2 -2
  379. package/lib/esm/components/CourseDashboard/Header.js +10 -3
  380. package/lib/esm/components/CourseDashboard/Student.d.ts +2 -2
  381. package/lib/esm/components/CourseDashboard/Student.js +19 -8
  382. package/lib/esm/components/CourseForm/CourseForm.d.ts +5 -0
  383. package/lib/esm/components/CourseForm/CourseForm.js +38 -7
  384. package/lib/esm/components/CourseJoinButton/CourseJoinButton.d.ts +1 -6
  385. package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +9 -7
  386. package/lib/esm/components/CreateCourseButton/CreateCourseButton.js +1 -1
  387. package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.d.ts +10 -0
  388. package/lib/esm/components/CreatePaymentProductForm/CreatePaymentProductForm.js +141 -0
  389. package/lib/esm/components/CreatePaymentProductForm/constants.d.ts +1 -0
  390. package/lib/esm/components/CreatePaymentProductForm/constants.js +1 -0
  391. package/lib/esm/components/CreatePaymentProductForm/index.d.ts +3 -0
  392. package/lib/esm/components/CreatePaymentProductForm/index.js +2 -0
  393. package/lib/esm/components/EditEventButton/EditEventButton.js +1 -0
  394. package/lib/esm/components/Editor/Editor.d.ts +1 -1
  395. package/lib/esm/components/Editor/nodes/HashtagNode.d.ts +1 -1
  396. package/lib/esm/components/Editor/nodes/HashtagNode.js +4 -4
  397. package/lib/esm/components/Editor/nodes/ImageNode.d.ts +1 -1
  398. package/lib/esm/components/Editor/nodes/ImageNode.js +6 -6
  399. package/lib/esm/components/Editor/nodes/MentionNode.d.ts +1 -1
  400. package/lib/esm/components/Editor/nodes/MentionNode.js +4 -4
  401. package/lib/esm/components/Editor/plugins/ApiPlugin.d.ts +1 -1
  402. package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts +2 -2
  403. package/lib/esm/components/Editor/shared/useDecorators.d.ts +2 -2
  404. package/lib/esm/components/Event/Event.d.ts +5 -0
  405. package/lib/esm/components/Event/Event.js +2 -2
  406. package/lib/esm/components/EventForm/EventForm.js +49 -18
  407. package/lib/esm/components/EventForm/types.d.ts +8 -5
  408. package/lib/esm/components/EventFormDialog/EventFormDialog.js +7 -1
  409. package/lib/esm/components/EventHeader/EventHeader.js +14 -5
  410. package/lib/esm/components/EventInfoWidget/EventInfoWidget.js +28 -5
  411. package/lib/esm/components/EventMediaWidget/asUploadButton.d.ts +1 -1
  412. package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +11 -2
  413. package/lib/esm/components/EventMembersWidget/TabContentComponent.js +14 -4
  414. package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +20 -9
  415. package/lib/esm/components/Feed/Feed.d.ts +2 -2
  416. package/lib/esm/components/Feed/Skeleton.d.ts +1 -1
  417. package/lib/esm/components/FeedObject/Activities/Activities.d.ts +1 -1
  418. package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
  419. package/lib/esm/components/FeedObject/Activities/ActivitiesMenu/ActivitiesMenu.js +2 -1
  420. package/lib/esm/components/FeedObject/FeedObject.d.ts +1 -1
  421. package/lib/esm/components/FeedObject/FeedObject.js +17 -7
  422. package/lib/esm/components/FeedObject/Poll/Choice/Choice.js +1 -1
  423. package/lib/esm/components/FeedObject/Poll/Poll.js +1 -1
  424. package/lib/esm/components/Group/Group.d.ts +6 -1
  425. package/lib/esm/components/Group/Group.js +3 -3
  426. package/lib/esm/components/GroupForm/GroupForm.js +39 -9
  427. package/lib/esm/components/GroupHeader/GroupHeader.js +12 -4
  428. package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +3 -1
  429. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +7 -2
  430. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +6 -4
  431. package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +6 -4
  432. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -8
  433. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +32 -10
  434. package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +3 -2
  435. package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.d.ts +1 -1
  436. package/lib/esm/components/LiveStreamForm/types.d.ts +3 -3
  437. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.d.ts +1 -1
  438. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +1 -1
  439. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/SettingsMenuToggle.d.ts +1 -1
  440. package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/utils.d.ts +2 -2
  441. package/lib/esm/components/LiveStreamRoom/types.d.ts +1 -1
  442. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.d.ts +1 -0
  443. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +44 -6
  444. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerSkeleton.d.ts +1 -1
  445. package/lib/esm/components/NavigationMenuIconButton/DefaultHeaderContent.d.ts +1 -1
  446. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +6 -0
  447. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +1 -1
  448. package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +29 -6
  449. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +8 -3
  450. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +1 -1
  451. package/lib/esm/components/Notification/Notification.d.ts +1 -1
  452. package/lib/esm/components/PaymentDetailDialog/PaymentDetailDialog.d.ts +6 -0
  453. package/lib/esm/components/PaymentDetailDialog/PaymentDetailDialog.js +37 -0
  454. package/lib/esm/components/PaymentDetailDialog/index.d.ts +3 -0
  455. package/lib/esm/components/PaymentDetailDialog/index.js +2 -0
  456. package/lib/esm/components/PaymentOrder/PaymentOrder.d.ts +10 -0
  457. package/lib/esm/components/PaymentOrder/PaymentOrder.js +77 -0
  458. package/lib/esm/components/PaymentOrder/Skeleton.d.ts +30 -0
  459. package/lib/esm/components/PaymentOrder/Skeleton.js +58 -0
  460. package/lib/esm/components/PaymentOrder/constants.d.ts +1 -0
  461. package/lib/esm/components/PaymentOrder/constants.js +1 -0
  462. package/lib/esm/components/PaymentOrder/index.d.ts +3 -0
  463. package/lib/esm/components/PaymentOrder/index.js +2 -0
  464. package/lib/esm/components/PaymentOrderPdfButton/PaymentOrderPdfButton.d.ts +52 -0
  465. package/lib/esm/components/PaymentOrderPdfButton/PaymentOrderPdfButton.js +71 -0
  466. package/lib/esm/components/PaymentOrderPdfButton/index.d.ts +3 -0
  467. package/lib/esm/components/PaymentOrderPdfButton/index.js +2 -0
  468. package/lib/esm/components/PaymentOrders/PaymentOrders.d.ts +17 -0
  469. package/lib/esm/components/PaymentOrders/PaymentOrders.js +261 -0
  470. package/lib/esm/components/PaymentOrders/index.d.ts +3 -0
  471. package/lib/esm/components/PaymentOrders/index.js +2 -0
  472. package/lib/esm/components/PaymentProduct/PaymentProduct.d.ts +18 -0
  473. package/lib/esm/components/PaymentProduct/PaymentProduct.js +45 -0
  474. package/lib/esm/components/PaymentProduct/Skeleton.d.ts +25 -0
  475. package/lib/esm/components/PaymentProduct/Skeleton.js +52 -0
  476. package/lib/esm/components/PaymentProduct/constants.d.ts +1 -0
  477. package/lib/esm/components/PaymentProduct/constants.js +1 -0
  478. package/lib/esm/components/PaymentProduct/index.d.ts +3 -0
  479. package/lib/esm/components/PaymentProduct/index.js +2 -0
  480. package/lib/esm/components/PaymentProductPrice/PaymentProductPrice.d.ts +15 -0
  481. package/lib/esm/components/PaymentProductPrice/PaymentProductPrice.js +58 -0
  482. package/lib/esm/components/PaymentProductPrice/Skeleton.d.ts +21 -0
  483. package/lib/esm/components/PaymentProductPrice/Skeleton.js +42 -0
  484. package/lib/esm/components/PaymentProductPrice/constants.d.ts +1 -0
  485. package/lib/esm/components/PaymentProductPrice/constants.js +1 -0
  486. package/lib/esm/components/PaymentProductPrice/index.d.ts +3 -0
  487. package/lib/esm/components/PaymentProductPrice/index.js +2 -0
  488. package/lib/esm/components/PaymentProducts/PaymentProducts.d.ts +11 -0
  489. package/lib/esm/components/PaymentProducts/PaymentProducts.js +73 -0
  490. package/lib/esm/components/PaymentProducts/Skeleton.d.ts +21 -0
  491. package/lib/esm/components/PaymentProducts/Skeleton.js +43 -0
  492. package/lib/esm/components/PaymentProducts/constants.d.ts +1 -0
  493. package/lib/esm/components/PaymentProducts/constants.js +1 -0
  494. package/lib/esm/components/PaymentProducts/index.d.ts +3 -0
  495. package/lib/esm/components/PaymentProducts/index.js +2 -0
  496. package/lib/esm/components/Paywalls/Paywalls.d.ts +10 -0
  497. package/lib/esm/components/Paywalls/Paywalls.js +91 -0
  498. package/lib/esm/components/Paywalls/Skeleton.d.ts +21 -0
  499. package/lib/esm/components/Paywalls/Skeleton.js +43 -0
  500. package/lib/esm/components/Paywalls/constants.d.ts +1 -0
  501. package/lib/esm/components/Paywalls/constants.js +1 -0
  502. package/lib/esm/components/Paywalls/index.d.ts +3 -0
  503. package/lib/esm/components/Paywalls/index.js +2 -0
  504. package/lib/esm/components/PaywallsConfigurator/PaywallsConfigurator.d.ts +13 -0
  505. package/lib/esm/components/PaywallsConfigurator/PaywallsConfigurator.js +249 -0
  506. package/lib/esm/components/PaywallsConfigurator/Skeleton.d.ts +21 -0
  507. package/lib/esm/components/PaywallsConfigurator/Skeleton.js +43 -0
  508. package/lib/esm/components/PaywallsConfigurator/constants.d.ts +5 -0
  509. package/lib/esm/components/PaywallsConfigurator/constants.js +6 -0
  510. package/lib/esm/components/PaywallsConfigurator/index.d.ts +4 -0
  511. package/lib/esm/components/PaywallsConfigurator/index.js +4 -0
  512. package/lib/esm/components/PaywallsDialog/PaywallsDialog.d.ts +8 -0
  513. package/lib/esm/components/PaywallsDialog/PaywallsDialog.js +40 -0
  514. package/lib/esm/components/PaywallsDialog/index.d.ts +3 -0
  515. package/lib/esm/components/PaywallsDialog/index.js +2 -0
  516. package/lib/esm/components/PdfPreview/PdfPreview.d.ts +8 -0
  517. package/lib/esm/components/PdfPreview/PdfPreview.js +88 -0
  518. package/lib/esm/components/PdfPreview/Skeleton.d.ts +5 -0
  519. package/lib/esm/components/PdfPreview/Skeleton.js +35 -0
  520. package/lib/esm/components/PdfPreview/index.d.ts +3 -0
  521. package/lib/esm/components/PdfPreview/index.js +2 -0
  522. package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.d.ts +11 -0
  523. package/lib/esm/components/PdfPreviewDialog/PdfPreviewDialog.js +60 -0
  524. package/lib/esm/components/PdfPreviewDialog/index.d.ts +3 -0
  525. package/lib/esm/components/PdfPreviewDialog/index.js +2 -0
  526. package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +4 -3
  527. package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts +1 -1
  528. package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +4 -4
  529. package/lib/esm/components/SnippetNotifications/SnippetNotifications.d.ts +1 -1
  530. package/lib/esm/components/ToastNotifications/ToastNotifications.js +2 -10
  531. package/lib/esm/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.d.ts +41 -0
  532. package/lib/esm/components/UserAddPaymentMethodDialog/UserAddPaymentMethodDialog.js +91 -0
  533. package/lib/esm/components/UserAddPaymentMethodDialog/constants.d.ts +1 -0
  534. package/lib/esm/components/UserAddPaymentMethodDialog/constants.js +1 -0
  535. package/lib/esm/components/UserAddPaymentMethodDialog/index.d.ts +3 -0
  536. package/lib/esm/components/UserAddPaymentMethodDialog/index.js +2 -0
  537. package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.d.ts +40 -0
  538. package/lib/esm/components/UserAddPaymentMethodForm/UserAddPaymentMethodForm.js +140 -0
  539. package/lib/esm/components/UserAddPaymentMethodForm/constants.d.ts +1 -0
  540. package/lib/esm/components/UserAddPaymentMethodForm/constants.js +1 -0
  541. package/lib/esm/components/UserAddPaymentMethodForm/index.d.ts +3 -0
  542. package/lib/esm/components/UserAddPaymentMethodForm/index.js +2 -0
  543. package/lib/esm/components/UserBillingInfo/Skeleton.d.ts +25 -0
  544. package/lib/esm/components/UserBillingInfo/Skeleton.js +9 -0
  545. package/lib/esm/components/UserBillingInfo/UserBillingInfo.d.ts +35 -0
  546. package/lib/esm/components/UserBillingInfo/UserBillingInfo.js +490 -0
  547. package/lib/esm/components/UserBillingInfo/constants.d.ts +1 -0
  548. package/lib/esm/components/UserBillingInfo/constants.js +1 -0
  549. package/lib/esm/components/UserBillingInfo/index.d.ts +4 -0
  550. package/lib/esm/components/UserBillingInfo/index.js +4 -0
  551. package/lib/esm/components/UserBillingInfo/reducer.d.ts +77 -0
  552. package/lib/esm/components/UserBillingInfo/reducer.js +91 -0
  553. package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.d.ts +44 -0
  554. package/lib/esm/components/UserChangeAddressDialog/UserChangeAddressDialog.js +82 -0
  555. package/lib/esm/components/UserChangeAddressDialog/constants.d.ts +1 -0
  556. package/lib/esm/components/UserChangeAddressDialog/constants.js +1 -0
  557. package/lib/esm/components/UserChangeAddressDialog/index.d.ts +3 -0
  558. package/lib/esm/components/UserChangeAddressDialog/index.js +2 -0
  559. package/lib/esm/components/UserConnectionsRequestsSentWidget/UserConnectionsRequestsSentWidget.js +6 -6
  560. package/lib/esm/components/UserConnectionsRequestsWidget/UserConnectionsRequestsWidget.js +5 -5
  561. package/lib/esm/components/UserConnectionsWidget/UserConnectionsWidget.js +8 -5
  562. package/lib/esm/components/UserCounters/UserCounters.js +20 -17
  563. package/lib/esm/components/UserFollowedCategoriesWidget/UserFollowedCategoriesWidget.js +11 -8
  564. package/lib/esm/components/UserPaymentMethods/Skeleton.d.ts +15 -0
  565. package/lib/esm/components/UserPaymentMethods/Skeleton.js +47 -0
  566. package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.d.ts +19 -0
  567. package/lib/esm/components/UserPaymentMethods/UserPaymentMethods.js +336 -0
  568. package/lib/esm/components/UserPaymentMethods/constants.d.ts +1 -0
  569. package/lib/esm/components/UserPaymentMethods/constants.js +1 -0
  570. package/lib/esm/components/UserPaymentMethods/index.d.ts +4 -0
  571. package/lib/esm/components/UserPaymentMethods/index.js +4 -0
  572. package/lib/esm/components/UserPaymentMethodsPortal/Skeleton.d.ts +22 -0
  573. package/lib/esm/components/UserPaymentMethodsPortal/Skeleton.js +35 -0
  574. package/lib/esm/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.d.ts +44 -0
  575. package/lib/esm/components/UserPaymentMethodsPortal/UserPaymentMethodsPortal.js +100 -0
  576. package/lib/esm/components/UserPaymentMethodsPortal/constants.d.ts +1 -0
  577. package/lib/esm/components/UserPaymentMethodsPortal/constants.js +1 -0
  578. package/lib/esm/components/UserPaymentMethodsPortal/index.d.ts +4 -0
  579. package/lib/esm/components/UserPaymentMethodsPortal/index.js +4 -0
  580. package/lib/esm/components/UserSuggestionWidget/UserSuggestionWidget.js +7 -5
  581. package/lib/esm/constants/Billing.d.ts +10 -0
  582. package/lib/esm/constants/Billing.js +57 -0
  583. package/lib/esm/constants/ContributionsActionsMenu.d.ts +1 -0
  584. package/lib/esm/constants/ContributionsActionsMenu.js +1 -0
  585. package/lib/esm/constants/Country.d.ts +5 -0
  586. package/lib/esm/constants/Country.js +268 -0
  587. package/lib/esm/constants/DefaultDrawerContent.d.ts +1 -0
  588. package/lib/esm/constants/DefaultDrawerContent.js +1 -0
  589. package/lib/esm/constants/Payments.d.ts +4 -0
  590. package/lib/esm/constants/Payments.js +4 -0
  591. package/lib/esm/index.d.ts +23 -1
  592. package/lib/esm/index.js +23 -1
  593. package/lib/esm/shared/AutoPlayer/index.d.ts +0 -5
  594. package/lib/esm/shared/AutoPlayer/index.js +5 -4
  595. package/lib/esm/shared/ContributionActionsMenu/index.d.ts +4 -0
  596. package/lib/esm/shared/ContributionActionsMenu/index.js +58 -7
  597. package/lib/esm/shared/CourseUsersTable/CourseUsersTable.d.ts +1 -1
  598. package/lib/esm/shared/CourseUsersTable/SeeProgressButton.js +5 -3
  599. package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.d.ts +44 -0
  600. package/lib/esm/shared/HiddenPurchasableContent/HiddenPurchasableContent.js +50 -0
  601. package/lib/esm/shared/HiddenPurchasableContent/index.d.ts +3 -0
  602. package/lib/esm/shared/HiddenPurchasableContent/index.js +2 -0
  603. package/lib/esm/shared/InfiniteScroll/index.d.ts +1 -1
  604. package/lib/esm/shared/Media/File/DisplayComponent.d.ts +2 -1
  605. package/lib/esm/shared/Media/File/DisplayComponent.js +60 -33
  606. package/lib/esm/shared/Media/File/DocComponent.d.ts +10 -0
  607. package/lib/esm/shared/Media/File/DocComponent.js +31 -0
  608. package/lib/esm/shared/Media/File/PreviewComponent.d.ts +2 -2
  609. package/lib/esm/shared/Media/File/PreviewComponent.js +17 -19
  610. package/lib/esm/shared/Media/File/TriggerButton.js +14 -1
  611. package/lib/esm/shared/Media/File/asUploadButton.d.ts +1 -1
  612. package/lib/esm/shared/Media/File/filter.d.ts +2 -2
  613. package/lib/esm/shared/Media/File/filter.js +2 -1
  614. package/lib/esm/shared/Media/File/index.js +2 -2
  615. package/lib/esm/shared/Media/Link/UrlTextField/index.d.ts +1 -1
  616. package/lib/esm/shared/MetadataField/MetadataField.d.ts +1 -1
  617. package/lib/esm/shared/StickyBox/index.d.ts +4 -4
  618. package/lib/esm/shared/Tags/index.js +7 -3
  619. package/lib/esm/shared/UsernameTextField/index.d.ts +1 -1
  620. package/lib/esm/types/composer.d.ts +1 -1
  621. package/lib/esm/types/index.d.ts +2 -1
  622. package/lib/esm/types/index.js +2 -1
  623. package/lib/esm/types/payment.d.ts +25 -0
  624. package/lib/esm/types/payment.js +26 -0
  625. package/lib/esm/utils/address.d.ts +10 -0
  626. package/lib/esm/utils/address.js +19 -0
  627. package/lib/esm/utils/checkout.d.ts +2 -0
  628. package/lib/esm/utils/checkout.js +19 -0
  629. package/lib/esm/utils/payment.d.ts +17 -0
  630. package/lib/esm/utils/payment.js +62 -0
  631. package/lib/umd/{c473ce30406a3dad83e1.eot → 30b299174b4fa1fb9ce8.eot} +0 -0
  632. package/lib/umd/362.js +2 -0
  633. package/lib/umd/{ba74e493633796d551d1.ttf → 3b49304a98beb1239bc7.ttf} +0 -0
  634. package/lib/umd/ab247f43e550f5f6d0f8.woff2 +0 -0
  635. package/lib/umd/assets/icons.svg +75 -69
  636. package/lib/umd/{b6dbec3d5816ff8baef1.woff → ce10db0c87e7112cb315.woff} +0 -0
  637. package/lib/umd/react-ui.js +1 -1
  638. package/package.json +15 -8
  639. package/lib/umd/578.js +0 -2
  640. package/lib/umd/60a7fdeaadfe844bc015.woff2 +0 -0
  641. /package/lib/umd/{578.js.LICENSE.txt → 362.js.LICENSE.txt} +0 -0
@@ -3,8 +3,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import { LoadingButton } from '@mui/lab';
4
4
  import { Box, Button, Checkbox, CircularProgress, FormControlLabel, Icon, Menu, MenuItem, SwipeableDrawer, useMediaQuery, useTheme, styled } from '@mui/material';
5
5
  import { useThemeProps } from '@mui/system';
6
- import { useSCContext, useSCFetchEvent, useSCUser } from '@selfcommunity/react-core';
7
- import { SCEventPrivacyType, SCEventSubscriptionStatusType } from '@selfcommunity/types';
6
+ import { useSCContext, useSCFetchEvent, useSCPaymentsEnabled, useSCUser } from '@selfcommunity/react-core';
7
+ import { SCContentType, SCEventPrivacyType, SCEventSubscriptionStatusType } from '@selfcommunity/types';
8
8
  import { CacheStrategies, Logger } from '@selfcommunity/utils';
9
9
  import classNames from 'classnames';
10
10
  import PubSub from 'pubsub-js';
@@ -12,6 +12,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
12
12
  import { FormattedMessage } from 'react-intl';
13
13
  import { SCOPE_SC_UI } from '../../constants/Errors';
14
14
  import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
15
+ import BuyButton from '../BuyButton';
15
16
  const PREFIX = 'SCEventSubscribeButton';
16
17
  const classes = {
17
18
  requestRoot: `${PREFIX}-request-root`,
@@ -45,6 +46,10 @@ const SwipeableDrawerRoot = styled(SwipeableDrawer, {
45
46
  name: PREFIX,
46
47
  slot: 'DrawerRoot'
47
48
  })(() => ({}));
49
+ const BuyButtonRoot = styled(BuyButton, {
50
+ name: PREFIX,
51
+ slot: 'BuyButtonRoot'
52
+ })(() => ({}));
48
53
  const MenuRoot = styled(Menu, {
49
54
  name: PREFIX,
50
55
  slot: 'MenuRoot'
@@ -72,7 +77,7 @@ const MenuRoot = styled(Menu, {
72
77
  * @param inProps
73
78
  */
74
79
  export default function EventSubscribeButton(inProps) {
75
- var _a;
80
+ var _a, _b;
76
81
  // PROPS
77
82
  const props = useThemeProps({
78
83
  props: inProps,
@@ -90,6 +95,8 @@ export default function EventSubscribeButton(inProps) {
90
95
  const scEventsManager = scUserContext.managers.events;
91
96
  const theme = useTheme();
92
97
  const isMobile = useMediaQuery(theme.breakpoints.down('md'));
98
+ // PAYMENTS
99
+ const { isPaymentsEnabled } = useSCPaymentsEnabled();
93
100
  // CONST
94
101
  const authUserId = scUserContext.user ? scUserContext.user.id : null;
95
102
  const { scEvent, setSCEvent } = useSCFetchEvent({
@@ -116,10 +123,11 @@ export default function EventSubscribeButton(inProps) {
116
123
  }, [authUserId, scEventsManager === null || scEventsManager === void 0 ? void 0 : scEventsManager.subscriptionStatus, scEvent]);
117
124
  const toggleEventAttendance = useCallback((eventStatus) => {
118
125
  setLoading(true);
126
+ const _event = Object.assign(Object.assign({}, scEvent), { subscription_status: status });
119
127
  const isGoing = eventStatus === SCEventSubscriptionStatusType.GOING ||
120
- !(scEvent === null || scEvent === void 0 ? void 0 : scEvent.subscription_status) ||
121
- (scEvent === null || scEvent === void 0 ? void 0 : scEvent.subscription_status) === SCEventSubscriptionStatusType.INVITED;
122
- const toggleAction = isGoing ? scEventsManager.toggleEventAttendance(scEvent) : scEventsManager.toggleEventNonattendance(scEvent);
128
+ !(_event === null || _event === void 0 ? void 0 : _event.subscription_status) ||
129
+ (_event === null || _event === void 0 ? void 0 : _event.subscription_status) === SCEventSubscriptionStatusType.INVITED;
130
+ const toggleAction = isGoing ? scEventsManager.toggleEventAttendance(_event) : scEventsManager.toggleEventNonattendance(_event);
123
131
  toggleAction
124
132
  .then((data) => {
125
133
  onSubscribe ? onSubscribe(data) : setSCEvent(data);
@@ -129,7 +137,7 @@ export default function EventSubscribeButton(inProps) {
129
137
  .catch((e) => {
130
138
  Logger.error(SCOPE_SC_UI, e);
131
139
  });
132
- }, [scEvent, scEventsManager, onSubscribe, setLoading]);
140
+ }, [scEvent, scEventsManager, status, onSubscribe, setLoading]);
133
141
  const handleToggleAction = useCallback((event) => {
134
142
  setAnchorEl(null);
135
143
  if (!scUserContext.user) {
@@ -171,6 +179,9 @@ export default function EventSubscribeButton(inProps) {
171
179
  if (!scEvent || (isEventAdmin && (user === null || user === void 0 ? void 0 : user.id) === scUserContext.user.id) || (isEventAdmin && !(user === null || user === void 0 ? void 0 : user.id))) {
172
180
  return null;
173
181
  }
174
- return (_jsx(_Fragment, { children: (scEvent === null || scEvent === void 0 ? void 0 : scEvent.privacy) === SCEventPrivacyType.PRIVATE && (!status || status === SCEventSubscriptionStatusType.REQUESTED) ? (_jsx(RequestRoot, Object.assign({ className: classNames(classes.requestRoot, className), variant: "outlined", size: "small", loading: scUserContext.user ? scEventsManager.isLoading(scEvent) : null, onClick: handleToggleAction }, rest, { children: getStatus }))) : (_jsxs(_Fragment, { children: [_jsx(SelectRoot, Object.assign({ className: classNames(classes.selectRoot, className, { [classes.going]: status && status === SCEventSubscriptionStatusType.GOING }, { [classes.notGoing]: status && status === SCEventSubscriptionStatusType.NOT_GOING }), onClick: handleOpen, endIcon: _jsx(Icon, { children: open ? 'expand_less' : 'expand_more' }), startIcon: status &&
175
- status !== SCEventSubscriptionStatusType.SUBSCRIBED && (_jsx(Icon, { children: status === SCEventSubscriptionStatusType.GOING ? 'circle_checked' : 'circle_closed' })) }, rest, { children: getStatus })), open && (_jsx(_Fragment, { children: isMobile ? (_jsx(SwipeableDrawerRoot, Object.assign({ className: classes.drawerRoot, PaperProps: { className: classes.paper }, open: true, onClose: handleClose, onOpen: handleOpen, anchor: "bottom", disableSwipeToOpen: true }, { children: renderMenuItems() }))) : (_jsx(MenuRoot, Object.assign({ className: classes.menuRoot, anchorEl: anchorEl, open: true, onClose: handleClose }, { children: renderMenuItems() }))) }))] })) }));
182
+ return (_jsx(_Fragment, { children: isPaymentsEnabled &&
183
+ ((_b = scEvent.paywalls) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
184
+ (scEvent.privacy === SCEventPrivacyType.PUBLIC ||
185
+ (scEvent.privacy === SCEventPrivacyType.PRIVATE && status && status !== SCEventSubscriptionStatusType.REQUESTED)) ? (_jsx(BuyButtonRoot, { contentType: SCContentType.EVENT, content: scEvent, showTicket: true })) : (_jsx(_Fragment, { children: (scEvent === null || scEvent === void 0 ? void 0 : scEvent.privacy) === SCEventPrivacyType.PRIVATE && (!status || status === SCEventSubscriptionStatusType.REQUESTED) ? (_jsx(RequestRoot, Object.assign({ className: classNames(classes.requestRoot, className), variant: "outlined", size: "small", loading: scUserContext.user ? scEventsManager.isLoading(scEvent) : null, onClick: handleToggleAction }, rest, { children: getStatus }))) : (_jsxs(_Fragment, { children: [_jsx(SelectRoot, Object.assign({ className: classNames(classes.selectRoot, className, { [classes.going]: status && status === SCEventSubscriptionStatusType.GOING }, { [classes.notGoing]: status && status === SCEventSubscriptionStatusType.NOT_GOING }), onClick: handleOpen, endIcon: _jsx(Icon, { children: open ? 'expand_less' : 'expand_more' }), startIcon: status &&
186
+ status !== SCEventSubscriptionStatusType.SUBSCRIBED && (_jsx(Icon, { children: status === SCEventSubscriptionStatusType.GOING ? 'circle_checked' : 'circle_closed' })) }, rest, { children: getStatus })), open && (_jsx(_Fragment, { children: isMobile ? (_jsx(SwipeableDrawerRoot, Object.assign({ className: classes.drawerRoot, PaperProps: { className: classes.paper }, open: true, onClose: handleClose, onOpen: handleOpen, anchor: "bottom", disableSwipeToOpen: true }, { children: renderMenuItems() }))) : (_jsx(MenuRoot, Object.assign({ className: classes.menuRoot, anchorEl: anchorEl, open: true, onClose: handleClose }, { children: renderMenuItems() }))) }))] })) })) }));
176
187
  }
@@ -9,11 +9,11 @@ import { StickyBoxProps } from '../../shared/StickyBox';
9
9
  /**
10
10
  * FeedSidebarProps has the same props as StickyBoxProps type
11
11
  */
12
- export type FeedSidebarProps = StickyBoxProps;
12
+ export declare type FeedSidebarProps = StickyBoxProps;
13
13
  /**
14
14
  * FeedRef props
15
15
  */
16
- export type FeedRef = {
16
+ export declare type FeedRef = {
17
17
  addFeedData: (obj: any, syncPagination?: boolean) => void;
18
18
  refresh: () => void;
19
19
  getCurrentFeedObjectIds: () => number[];
@@ -11,7 +11,7 @@ interface FeedSkeletonMap {
11
11
  */
12
12
  className?: string;
13
13
  }
14
- export type FeedSkeletonProps = React.PropsWithChildren<FeedSkeletonMap>;
14
+ export declare type FeedSkeletonProps = React.PropsWithChildren<FeedSkeletonMap>;
15
15
  /**
16
16
  * > API documentation for the Community-JS Feed Skeleton component. Learn about the available props and the CSS API.
17
17
 
@@ -6,7 +6,7 @@ import { CacheStrategies } from '@selfcommunity/utils';
6
6
  export interface ActivitiesProps {
7
7
  /**
8
8
  * Id of the FeedObjectActivities
9
- * @default `feed_object_activities_<feedObjectId | feedObject.id>`
9
+ * @default `feed_object_activities_feedObjectId`
10
10
  */
11
11
  id?: string;
12
12
  /**
@@ -89,5 +89,5 @@ export default function Activities(props) {
89
89
  (Boolean(commentsObject.feedObject.comment_count) ||
90
90
  (feedObjectActivities && feedObjectActivities.length > 0) ||
91
91
  comments.length > 0 ||
92
- (feedObject && feedObject.comment_count > 0)) ? (_jsxs(Box, Object.assign({ className: classes.activities }, (existFeedObjectActivities ? {} : { style: { minHeight: `${Math.min(skeletonsCount, feedObject.comment_count) * 80}px` } }), { children: [_jsx(ActivitiesMenu, { selectedActivities: selectedActivities, hideRelevantActivitiesItem: !existFeedObjectActivities, onChange: handleSelectActivitiesType }), selectedActivities === SCFeedObjectActivitiesType.RELEVANCE_ACTIVITIES ? renderRelevantActivities() : renderComments()] }))) : null })));
92
+ (feedObject && feedObject.comment_count > 0)) ? (_jsxs(Box, Object.assign({ className: classes.activities }, (existFeedObjectActivities ? {} : { style: { minHeight: `${Math.min(skeletonsCount, feedObject === null || feedObject === void 0 ? void 0 : feedObject.comment_count) * 80}px` } }), { children: [_jsx(ActivitiesMenu, { selectedActivities: selectedActivities, hideRelevantActivitiesItem: !existFeedObjectActivities, onChange: handleSelectActivitiesType }), selectedActivities === SCFeedObjectActivitiesType.RELEVANCE_ACTIVITIES ? renderRelevantActivities() : renderComments()] }))) : null })));
93
93
  }
@@ -49,6 +49,7 @@ export default function ActivitiesMenu(props) {
49
49
  const theme = useTheme();
50
50
  const isMobile = useMediaQuery(theme.breakpoints.down('md'));
51
51
  const followEnabled = scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_FOLLOW_ENABLED].value;
52
+ const connectionEnabled = scPreferencesContext.preferences[SCPreferences.CONFIGURATIONS_CONNECTION_ENABLED].value;
52
53
  const [anchorEl, setAnchorEl] = React.useState(null);
53
54
  const open = Boolean(anchorEl);
54
55
  // INTL
@@ -66,7 +67,7 @@ export default function ActivitiesMenu(props) {
66
67
  };
67
68
  };
68
69
  function renderMenuContent() {
69
- return (_jsxs(Box, { children: [!hideRelevantActivitiesItem && (_jsx(ListItemButton, Object.assign({ selected: selectedActivities === SCFeedObjectActivitiesType.RELEVANCE_ACTIVITIES, onClick: handleChangeActivitiesType(SCFeedObjectActivitiesType.RELEVANCE_ACTIVITIES) }, { children: _jsx(ListItemText, { primary: _jsx("b", { children: intl.formatMessage(messages.relevantActivities) }), secondary: _jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.relevantActivitiesDesc', defaultMessage: 'ui.feedObject.activitiesMenu.relevantActivitiesDesc' }) }) }))), _jsx(ListItemButton, Object.assign({ selected: selectedActivities === SCFeedObjectActivitiesType.RECENT_COMMENTS, onClick: handleChangeActivitiesType(SCFeedObjectActivitiesType.RECENT_COMMENTS) }, { children: _jsx(ListItemText, { primary: _jsx("b", { children: intl.formatMessage(messages.recentComments) }), secondary: _jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.recentCommentsDesc', defaultMessage: 'ui.feedObject.activitiesMenu.recentCommentsDesc' }) }) })), _jsx(ListItemButton, Object.assign({ selected: selectedActivities === SCFeedObjectActivitiesType.FIRST_COMMENTS, onClick: handleChangeActivitiesType(SCFeedObjectActivitiesType.FIRST_COMMENTS) }, { children: _jsx(ListItemText, { primary: _jsx("b", { children: intl.formatMessage(messages.firstComments) }), secondary: _jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.firstCommentsDesc', defaultMessage: 'ui.feedObject.activitiesMenu.firstCommentsDesc' }) }) })), scUserContext.user && (_jsx(ListItemButton, Object.assign({ selected: selectedActivities === SCFeedObjectActivitiesType.CONNECTIONS_COMMENTS, onClick: handleChangeActivitiesType(SCFeedObjectActivitiesType.CONNECTIONS_COMMENTS) }, { children: _jsx(ListItemText, { primary: _jsx("b", { children: followEnabled ? intl.formatMessage(messages.followedComments) : intl.formatMessage(messages.connectionsComments) }), secondary: followEnabled ? (_jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.followedCommentsDesc', defaultMessage: 'ui.feedObject.activitiesMenu.followedCommentsDesc' })) : (_jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.connectionsCommentsDesc', defaultMessage: 'ui.feedObject.activitiesMenu.connectionsCommentsDesc' })) }) })))] }));
70
+ return (_jsxs(Box, { children: [!hideRelevantActivitiesItem && (_jsx(ListItemButton, Object.assign({ selected: selectedActivities === SCFeedObjectActivitiesType.RELEVANCE_ACTIVITIES, onClick: handleChangeActivitiesType(SCFeedObjectActivitiesType.RELEVANCE_ACTIVITIES) }, { children: _jsx(ListItemText, { primary: _jsx("b", { children: intl.formatMessage(messages.relevantActivities) }), secondary: _jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.relevantActivitiesDesc', defaultMessage: 'ui.feedObject.activitiesMenu.relevantActivitiesDesc' }) }) }))), _jsx(ListItemButton, Object.assign({ selected: selectedActivities === SCFeedObjectActivitiesType.RECENT_COMMENTS, onClick: handleChangeActivitiesType(SCFeedObjectActivitiesType.RECENT_COMMENTS) }, { children: _jsx(ListItemText, { primary: _jsx("b", { children: intl.formatMessage(messages.recentComments) }), secondary: _jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.recentCommentsDesc', defaultMessage: 'ui.feedObject.activitiesMenu.recentCommentsDesc' }) }) })), _jsx(ListItemButton, Object.assign({ selected: selectedActivities === SCFeedObjectActivitiesType.FIRST_COMMENTS, onClick: handleChangeActivitiesType(SCFeedObjectActivitiesType.FIRST_COMMENTS) }, { children: _jsx(ListItemText, { primary: _jsx("b", { children: intl.formatMessage(messages.firstComments) }), secondary: _jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.firstCommentsDesc', defaultMessage: 'ui.feedObject.activitiesMenu.firstCommentsDesc' }) }) })), scUserContext.user && (_jsx(ListItemButton, Object.assign({ selected: selectedActivities === SCFeedObjectActivitiesType.CONNECTIONS_COMMENTS, onClick: handleChangeActivitiesType(SCFeedObjectActivitiesType.CONNECTIONS_COMMENTS) }, { children: (followEnabled || connectionEnabled) && (_jsx(ListItemText, { primary: _jsx("b", { children: followEnabled ? intl.formatMessage(messages.followedComments) : intl.formatMessage(messages.connectionsComments) }), secondary: followEnabled ? (_jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.followedCommentsDesc', defaultMessage: 'ui.feedObject.activitiesMenu.followedCommentsDesc' })) : (_jsx(FormattedMessage, { id: 'ui.feedObject.activitiesMenu.connectionsCommentsDesc', defaultMessage: 'ui.feedObject.activitiesMenu.connectionsCommentsDesc' })) })) })))] }));
70
71
  }
71
72
  /**
72
73
  * Renders root object
@@ -16,7 +16,7 @@ import { FeedObjectMediaPreviewProps } from '../FeedObjectMediaPreview';
16
16
  export interface FeedObjectProps extends CardProps, VirtualScrollerItemProps {
17
17
  /**
18
18
  * Id of the feedObject
19
- * @default `feed_object_<feedObjectType>_<feedObjectId | feedObject.id>`
19
+ * @default `feed_object_feedObjectType_feedObjectId`
20
20
  */
21
21
  id?: string;
22
22
  /**
@@ -27,7 +27,7 @@ import { SCContributionType } from '@selfcommunity/types';
27
27
  import { Endpoints, http } from '@selfcommunity/api-services';
28
28
  import { CacheStrategies, Logger, LRUCache } from '@selfcommunity/utils';
29
29
  import { catchUnauthorizedActionByBlockedUser } from '../../utils/errors';
30
- import { Link, SCCache, SCRoutes, UserUtils, useSCContext, useSCFetchFeedObject, useSCRouting, useSCUser } from '@selfcommunity/react-core';
30
+ import { Link, SCCache, SCPreferences, SCRoutes, UserUtils, useSCContext, useSCFetchFeedObject, useSCPreferences, useSCRouting, useSCUser } from '@selfcommunity/react-core';
31
31
  import UserDeletedSnackBar from '../../shared/UserDeletedSnackBar';
32
32
  import UserAvatar from '../../shared/UserAvatar';
33
33
  import { MAX_SUMMARY_LENGTH } from '../../constants/Feed';
@@ -35,6 +35,7 @@ import Composer from '../Composer';
35
35
  import FeedObjectMediaPreview from '../FeedObjectMediaPreview';
36
36
  import { PREFIX } from './constants';
37
37
  import { MEDIA_EMBED_SC_SHARED_EVENT } from '../../constants/Media';
38
+ import Vote from './Actions/Vote';
38
39
  const messages = defineMessages({
39
40
  visibleToAll: {
40
41
  id: 'ui.feedObject.visibleToAll',
@@ -73,7 +74,8 @@ const classes = {
73
74
  replyContent: `${PREFIX}-reply-content`,
74
75
  activitiesSection: `${PREFIX}-activities-section`,
75
76
  activitiesContent: `${PREFIX}-activities-content`,
76
- followButton: `${PREFIX}-follow-button`
77
+ followButton: `${PREFIX}-follow-button`,
78
+ vote: `${PREFIX}-vote`
77
79
  };
78
80
  const Root = styled(Widget, {
79
81
  name: PREFIX,
@@ -132,7 +134,7 @@ const Root = styled(Widget, {
132
134
  * @param inProps
133
135
  */
134
136
  export default function FeedObject(inProps) {
135
- var _a, _b, _c, _d, _f, _g, _h;
137
+ var _a, _b, _c, _d, _f, _g, _h, _j;
136
138
  // PROPS
137
139
  const props = useThemeProps({
138
140
  props: inProps,
@@ -144,6 +146,9 @@ export default function FeedObject(inProps) {
144
146
  const scRoutingContext = useSCRouting();
145
147
  const scUserContext = useSCUser();
146
148
  const { enqueueSnackbar } = useSnackbar();
149
+ const { preferences } = useSCPreferences();
150
+ const allShareEnabled = SCPreferences.ADDONS_SHARE_POST_ENABLED in preferences && preferences[SCPreferences.ADDONS_SHARE_POST_ENABLED].value;
151
+ const commentsEnabled = SCPreferences.CONFIGURATIONS_COMMENTS_ENABLED in preferences && preferences[SCPreferences.CONFIGURATIONS_COMMENTS_ENABLED].value;
147
152
  // OBJECTS
148
153
  const { obj, setObj, error } = useSCFetchFeedObject({ id: feedObjectId, feedObject, feedObjectType, cacheStrategy });
149
154
  const objId = obj ? obj.id : null;
@@ -163,6 +168,7 @@ export default function FeedObject(inProps) {
163
168
  const [expanded, setExpanded] = useState(summaryExpanded);
164
169
  const hasEvent = useMemo(() => { var _a; return (obj === null || obj === void 0 ? void 0 : obj.medias.length) > 0 && ((_a = obj.medias[0].embed) === null || _a === void 0 ? void 0 : _a.embed_type) === MEDIA_EMBED_SC_SHARED_EVENT; }, [obj === null || obj === void 0 ? void 0 : obj.medias]);
165
170
  const _hideFollowAction = useMemo(() => { var _a, _b, _c, _d; return hideFollowAction || (hasEvent && ((_d = (_c = (_b = (_a = obj === null || obj === void 0 ? void 0 : obj.medias) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.embed) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.active) === false); }, [hideFollowAction, hasEvent, obj]);
171
+ const visibleTags = ((_a = obj.addressing) !== null && _a !== void 0 ? _a : []).filter((tag) => tag.visible);
166
172
  // INTL
167
173
  const intl = useIntl();
168
174
  /**
@@ -234,7 +240,7 @@ export default function FeedObject(inProps) {
234
240
  /**
235
241
  * Handle flag obj
236
242
  */
237
- const handleFlag = useCallback((obj, type, flagged) => {
243
+ const handleFlag = useCallback((_obj, _type, flagged) => {
238
244
  enqueueSnackbar(flagged ? (_jsx(FormattedMessage, { id: "ui.feedObject.flagSent", defaultMessage: "ui.feedObject.flagSent" })) : (_jsx(FormattedMessage, { id: "ui.feedObject.flagRemoved", defaultMessage: "ui.feedObject.flagRemoved" })), {
239
245
  autoHideDuration: 3000
240
246
  });
@@ -426,9 +432,13 @@ export default function FeedObject(inProps) {
426
432
  else if (template === SCFeedObjectTemplateType.PREVIEW ||
427
433
  template === SCFeedObjectTemplateType.DETAIL ||
428
434
  template === SCFeedObjectTemplateType.SEARCH) {
429
- objElement = (_jsx(React.Fragment, { children: obj ? (_jsxs(Box, Object.assign({ className: classNames({ [classes.deleted]: obj && obj.deleted }) }, { children: [obj.categories.length > 0 && (_jsxs("div", Object.assign({ className: classes.category }, { children: [_jsxs(_Fragment, { children: [obj.group && (_jsx(Chip, { className: classes.group, color: "secondary", size: "small", icon: _jsx(Icon, { children: "groups" }), component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }, obj.group.id)), obj.event && (_jsx(Chip, { className: classes.event, color: "secondary", size: "small", label: obj.event.name, icon: _jsx(Icon, { children: "CalendarIcon" }), component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, obj.event), clickable: true }, obj.event.id))] }), obj.categories.map((c) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, c) }, { children: _jsx(Typography, Object.assign({ variant: "overline" }, { children: c.name })) }), c.id)))] }))), obj.group && !obj.categories.length && (_jsx("div", Object.assign({ className: classes.group }, { children: _jsx(Chip, { color: "secondary", size: "small", icon: _jsx(Icon, { children: "groups" }), label: obj.group.name, component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }, obj.group.id) }))), obj.event && !obj.categories.length && (_jsx(Chip, { className: classes.event, color: "secondary", size: "small", icon: _jsx(Icon, { children: "CalendarIcon" }), label: obj.event.name, component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, obj.event), clickable: true }, obj.event.id)), _jsx(CardHeader, { className: classes.header, avatar: _jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !obj.author.community_badge }, { children: _jsx(Avatar, Object.assign({ "aria-label": "recipe", src: obj.author.avatar, className: classes.avatar }, { children: obj.author.username })) })) })), title: _jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: obj.author.username })), subheader: _jsxs(_Fragment, { children: [_jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), className: classes.activityAt }, { children: _jsx(DateTimeAgo, { component: 'span', date: obj.added_at }) })), obj.location && (_jsxs(_Fragment, { children: [_jsx(Bullet, {}), _jsxs(Box, Object.assign({ className: classes.location }, { children: [_jsx(Icon, { children: "add_location_alt" }), (_a = obj.location) === null || _a === void 0 ? void 0 : _a.location] }))] })), _jsx(Bullet, {}), _jsx(Box, Object.assign({ className: classes.tag }, { children: obj.addressing.length > 0 ? (_jsx(Tags, { tags: obj.addressing, TagChipProps: { disposable: false, clickable: false } })) : obj.group ? (_jsx(Tooltip, Object.assign({ title: `${intl.formatMessage(messages.visibleToGroup, { group: obj.group.name })}` }, { children: _jsx(Icon, Object.assign({ color: "disabled", fontSize: "small" }, { children: "groups" })) }))) : (_jsx(Tooltip, Object.assign({ title: `${intl.formatMessage(messages.visibleToAll)}` }, { children: _jsx(Icon, Object.assign({ color: "disabled", fontSize: "small" }, { children: "public" })) }))) }))] }), action: renderHeaderAction() }), _jsxs(CardContent, Object.assign({ classes: { root: classes.content } }, { children: [_jsx(Box, Object.assign({ className: classes.titleSection }, { children: 'title' in obj && (_jsx(_Fragment, { children: template === SCFeedObjectTemplateType.DETAIL ? (_jsx(Typography, Object.assign({ variant: "body1", gutterBottom: true, className: classes.title }, { children: obj.title }))) : (_jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)) }, { children: _jsx(Typography, Object.assign({ variant: "body1", gutterBottom: true, className: classes.title }, { children: obj.title })) }))) })) })), _jsx(Box, Object.assign({ className: classes.textSection }, { children: getContributionSummary(obj, template) })), _jsx(Box, Object.assign({ className: classes.mediasSection }, { children: _jsx(FeedObjectMediaPreview, Object.assign({ medias: obj.medias }, FeedObjectMediaPreviewProps)) })), _jsx(Box, Object.assign({ className: classes.pollsSection }, { children: obj['poll'] && (_jsx(PollObject, Object.assign({ visible: pollVisible ||
435
+ objElement = (_jsx(React.Fragment, { children: obj ? (_jsxs(Box, Object.assign({ className: classNames({ [classes.deleted]: obj && obj.deleted }) }, { children: [obj.categories.length > 0 && (_jsxs("div", Object.assign({ className: classes.category }, { children: [_jsxs(_Fragment, { children: [obj.group && (_jsx(Chip, { className: classes.group, color: "secondary", size: "small", icon: _jsx(Icon, { children: "groups" }), component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }, obj.group.id)), obj.event && (_jsx(Chip, { className: classes.event, color: "secondary", size: "small", label: obj.event.name, icon: _jsx(Icon, { children: "CalendarIcon" }), component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, obj.event), clickable: true }, obj.event.id))] }), obj.categories.map((c) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, c) }, { children: _jsx(Typography, Object.assign({ variant: "overline" }, { children: c.name })) }), c.id)))] }))), obj.group && !obj.categories.length && (_jsx("div", Object.assign({ className: classes.group }, { children: _jsx(Chip, { color: "secondary", size: "small", icon: _jsx(Icon, { children: "groups" }), label: obj.group.name, component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }, obj.group.id) }))), obj.event && !obj.categories.length && (_jsx(Chip, { className: classes.event, color: "secondary", size: "small", icon: _jsx(Icon, { children: "CalendarIcon" }), label: obj.event.name, component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, obj.event), clickable: true }, obj.event.id)), _jsx(CardHeader, { className: classes.header, avatar: _jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !obj.author.community_badge }, { children: _jsx(Avatar, Object.assign({ "aria-label": "recipe", src: obj.author.avatar, className: classes.avatar }, { children: obj.author.username })) })) })), title: _jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: obj.author.username })), subheader: _jsxs(_Fragment, { children: [_jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), className: classes.activityAt }, { children: _jsx(DateTimeAgo, { component: 'span', date: obj.added_at }) })), obj.location && (_jsxs(_Fragment, { children: [_jsx(Bullet, {}), _jsxs(Box, Object.assign({ className: classes.location }, { children: [_jsx(Icon, { children: "add_location_alt" }), (_b = obj.location) === null || _b === void 0 ? void 0 : _b.location] }))] })), visibleTags.length > 0 || (obj.group && _jsx(Bullet, {})), _jsx(Box, Object.assign({ className: classes.tag }, { children: obj.addressing.length > 0 ? (_jsx(Tags, { tags: obj.addressing, TagChipProps: { disposable: false, clickable: false } })) : obj.group ? (_jsx(Tooltip, Object.assign({ title: `${intl.formatMessage(messages.visibleToGroup, { group: obj.group.name })}` }, { children: _jsx(Icon, Object.assign({ color: "disabled", fontSize: "small" }, { children: "groups" })) }))) : (_jsxs(_Fragment, { children: [_jsx(Bullet, {}), _jsx(Tooltip, Object.assign({ title: `${intl.formatMessage(messages.visibleToAll)}` }, { children: _jsx(Icon, Object.assign({ color: "disabled", fontSize: "small" }, { children: "public" })) }))] })) }))] }), action: renderHeaderAction() }), _jsxs(CardContent, Object.assign({ classes: { root: classes.content } }, { children: [_jsx(Box, Object.assign({ className: classes.titleSection }, { children: 'title' in obj && (_jsx(_Fragment, { children: template === SCFeedObjectTemplateType.DETAIL ? (_jsx(Typography, Object.assign({ variant: "body1", gutterBottom: true, className: classes.title }, { children: obj.title }))) : (_jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)) }, { children: _jsx(Typography, Object.assign({ variant: "body1", gutterBottom: true, className: classes.title }, { children: obj.title })) }))) })) })), _jsx(Box, Object.assign({ className: classes.textSection }, { children: getContributionSummary(obj, template) })), _jsx(Box, Object.assign({ className: classes.mediasSection }, { children: _jsx(FeedObjectMediaPreview, Object.assign({ medias: obj.medias }, FeedObjectMediaPreviewProps)) })), _jsx(Box, Object.assign({ className: classes.pollsSection }, { children: obj['poll'] && (_jsx(PollObject, Object.assign({ visible: pollVisible ||
430
436
  template === SCFeedObjectTemplateType.DETAIL ||
431
- Boolean(obj.type !== SCContributionType.DISCUSSION && !obj.html && !obj.medias.length), feedObject: obj, pollObject: obj['poll'], onChange: handleChangePoll, onToggleVisibility: handleTogglePollVisibility }, PollObjectProps))) })), _jsx(Box, Object.assign({ className: classes.infoSection }, { children: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [!hideParticipantsPreview && (_jsx(ContributorsFeedObject, Object.assign({ feedObject: obj, feedObjectType: obj.type }, ContributorsFeedObjectProps, { cacheStrategy: cacheStrategy }))), !_hideFollowAction && _jsx(Follow, Object.assign({ feedObject: obj, feedObjectType: obj.type, handleFollow: handleFollow }, FollowButtonProps))] })) }))] })), _jsxs(CardActions, Object.assign({ className: classes.actionsSection }, { children: [_jsx(Actions, Object.assign({ feedObjectId: feedObjectId, feedObjectType: feedObjectType, feedObject: obj, hideCommentAction: template === SCFeedObjectTemplateType.DETAIL || (hasEvent && !((_c = (_b = obj === null || obj === void 0 ? void 0 : obj.medias[0].embed) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.active)), handleExpandActivities: template === SCFeedObjectTemplateType.PREVIEW ? handleExpandActivities : null, VoteActionProps: { onVoteAction: handleVoteSuccess } }, ActionsProps)), ((template === SCFeedObjectTemplateType.DETAIL && (!hasEvent || ((_h = (_g = (_f = (_d = obj === null || obj === void 0 ? void 0 : obj.medias) === null || _d === void 0 ? void 0 : _d[0]) === null || _f === void 0 ? void 0 : _f.embed) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.active))) || expandedActivities) && (_jsx(Box, Object.assign({ className: classes.replyContent }, { children: _jsx(CommentObjectReplyComponent, Object.assign({ id: `reply-feedObject-${obj.id}`, onReply: handleReply, editable: !isReplying || Boolean(obj) }, CommentObjectReplyComponentProps), Number(isReplying)) })))] })), template === SCFeedObjectTemplateType.PREVIEW && (obj.comment_count > 0 || (feedObjectActivities && feedObjectActivities.length > 0)) && (_jsx(Collapse, Object.assign({ in: expandedActivities, timeout: "auto", classes: { root: classes.activitiesSection } }, { children: _jsx(CardContent, Object.assign({ className: classes.activitiesContent }, { children: _jsx(Activities, Object.assign({ feedObject: obj, feedObjectActivities: feedObjectActivities, activitiesType: selectedActivities, onSetSelectedActivities: handleSelectedActivities, comments: comments, CommentsObjectProps: {
437
+ Boolean(obj.type !== SCContributionType.DISCUSSION && !obj.html && !obj.medias.length), feedObject: obj, pollObject: obj['poll'], onChange: handleChangePoll, onToggleVisibility: handleTogglePollVisibility }, PollObjectProps))) })), !obj.draft && (_jsx(Box, Object.assign({ className: classes.infoSection }, { children: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 }, { children: [!commentsEnabled && !allShareEnabled ? (_jsx(Vote, { feedObjectId: feedObjectId || (feedObject === null || feedObject === void 0 ? void 0 : feedObject.id), feedObjectType: feedObjectType, feedObject: obj, inlineAction: true, onVoteAction: handleVoteSuccess, className: classes.vote })) : (!hideParticipantsPreview && (_jsx(ContributorsFeedObject, Object.assign({ feedObject: obj, feedObjectType: obj.type }, ContributorsFeedObjectProps, { cacheStrategy: cacheStrategy })))), !_hideFollowAction && _jsx(Follow, Object.assign({ feedObject: obj, feedObjectType: obj.type, handleFollow: handleFollow }, FollowButtonProps))] })) })))] })), _jsxs(CardActions, Object.assign({ className: classes.actionsSection }, { children: [_jsx(Actions, Object.assign({ feedObjectId: feedObjectId, feedObjectType: feedObjectType, feedObject: obj, hideVoteAction: !allShareEnabled && !commentsEnabled, hideCommentAction: !commentsEnabled || template === SCFeedObjectTemplateType.DETAIL || (hasEvent && !((_d = (_c = obj === null || obj === void 0 ? void 0 : obj.medias[0].embed) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.active)), hideShareAction: !allShareEnabled, handleExpandActivities: template === SCFeedObjectTemplateType.PREVIEW ? handleExpandActivities : null, VoteActionProps: { onVoteAction: handleVoteSuccess } }, ActionsProps)), commentsEnabled &&
438
+ ((template === SCFeedObjectTemplateType.DETAIL && (!hasEvent || ((_j = (_h = (_g = (_f = obj === null || obj === void 0 ? void 0 : obj.medias) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.embed) === null || _h === void 0 ? void 0 : _h.metadata) === null || _j === void 0 ? void 0 : _j.active))) ||
439
+ expandedActivities) && (_jsx(Box, Object.assign({ className: classes.replyContent }, { children: _jsx(CommentObjectReplyComponent, Object.assign({ id: `reply-feedObject-${obj.id}`, onReply: handleReply, editable: !isReplying || Boolean(obj) }, CommentObjectReplyComponentProps), Number(isReplying)) })))] })), commentsEnabled &&
440
+ template === SCFeedObjectTemplateType.PREVIEW &&
441
+ (obj.comment_count > 0 || (feedObjectActivities && feedObjectActivities.length > 0)) && (_jsx(Collapse, Object.assign({ in: expandedActivities, timeout: "auto", classes: { root: classes.activitiesSection } }, { children: _jsx(CardContent, Object.assign({ className: classes.activitiesContent }, { children: _jsx(Activities, Object.assign({ feedObject: obj, feedObjectActivities: feedObjectActivities, activitiesType: selectedActivities, onSetSelectedActivities: handleSelectedActivities, comments: comments, CommentsObjectProps: {
432
442
  CommentComponentProps: Object.assign({ onDelete: handleDeleteComment, truncateContent: true, CommentsObjectComponentProps: { inPlaceLoadMoreContents: false } }, CommentComponentProps),
433
443
  CommentObjectSkeletonProps: CommentObjectSkeletonProps
434
444
  }, cacheStrategy: cacheStrategy }, ActivitiesProps), selectedActivities) })) }))), composerOpen && (_jsx(Composer, { open: composerOpen, feedObject: obj, onClose: handleToggleEdit, onSuccess: handleEditSuccess, maxWidth: "sm", fullWidth: true }))] }))) : (_jsx(FeedObjectSkeleton, Object.assign({ template: template }, FeedObjectSkeletonProps))) }));
@@ -437,7 +447,7 @@ export default function FeedObject(inProps) {
437
447
  objElement = (_jsx(React.Fragment, { children: obj ? (_jsxs(React.Fragment, { children: [obj.categories.length > 0 && (_jsxs("div", Object.assign({ className: classes.category }, { children: [_jsxs(_Fragment, { children: [obj.group && (_jsx("div", Object.assign({ className: classes.group }, { children: _jsx(Chip, { color: "secondary", size: "small", icon: _jsx(Icon, { children: "groups" }), component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }, obj.group.id) }))), obj.event && (_jsx(Chip, { className: classes.event, color: "secondary", size: "small", icon: _jsx(Icon, { children: "CalendarIcon" }), component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, obj.event), clickable: true }, obj.event.id))] }), obj.categories.map((c) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, c) }, { children: _jsx(Typography, Object.assign({ variant: "overline" }, { children: c.name })) }), c.id)))] }))), obj.group && !obj.categories.length && (_jsx("div", Object.assign({ className: classes.group }, { children: _jsx(Chip, { color: "secondary", size: "small", icon: _jsx(Icon, { children: "groups" }), label: obj.group.name, component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }, obj.group.id) }))), obj.event && !obj.categories.length && (_jsx("div", Object.assign({ className: classes.event }, { children: _jsx(Chip, { color: "secondary", size: "small", icon: _jsx(Icon, { children: "groups" }), label: obj.event.name, component: Link, to: scRoutingContext.url(SCRoutes.EVENT_ROUTE_NAME, obj.event), clickable: true }, obj.event.id) }))), _jsx(CardHeader, { classes: { root: classes.header }, avatar: _jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: _jsx(UserAvatar, Object.assign({ hide: !obj.author.community_badge }, { children: _jsx(Avatar, Object.assign({ "aria-label": "recipe", src: obj.author.avatar, className: classes.avatar }, { children: obj.author.username })) })) })), title: _jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: obj.author.username })), subheader: _jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), className: classes.activityAt }, { children: _jsx(DateTimeAgo, { date: obj.added_at }) })) }), _jsxs(CardContent, Object.assign({ classes: { root: classes.content } }, { children: [_jsx(Box, Object.assign({ className: classes.titleSection }, { children: 'title' in obj && (_jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)) }, { children: _jsx(Typography, Object.assign({ variant: "body1", gutterBottom: true, className: classes.title }, { children: obj.title })) }))) })), _jsx(Box, Object.assign({ className: classes.textSection }, { children: getContributionSummary(obj, template) })), _jsx(Box, Object.assign({ className: classes.mediasSection }, { children: _jsx(FeedObjectMediaPreview, Object.assign({ medias: obj.medias }, FeedObjectMediaPreviewProps)) })), _jsx(Box, Object.assign({ className: classes.pollsSection }, { children: obj['poll'] && (_jsx(PollObject, Object.assign({ feedObject: obj, pollObject: obj['poll'], onChange: handleChangePoll, visible: Boolean(obj.type !== SCContributionType.DISCUSSION && !obj.html && !obj.medias.length) }, PollObjectProps))) }))] }))] })) : (_jsx(FeedObjectSkeleton, Object.assign({ template: template }, FeedObjectSkeletonProps))) }));
438
448
  }
439
449
  else {
440
- objElement = (_jsx(React.Fragment, { children: obj ? (_jsx(BaseItem, { elevation: 0, className: classes.snippet, image: _jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !obj.author.community_badge }, { children: _jsx(Avatar, { alt: obj.author.username, variant: "circular", src: obj.author.avatar, className: classes.avatar }) })) })), primary: _jsxs(Box, { children: [_jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: obj.author.username })), _jsx(Typography, Object.assign({ variant: "body2", className: classes.snippetContent }, { children: _jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)) }, { children: getContributionSnippet(obj) })) }))] }), disableTypography: true, secondary: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", spacing: 2, alignItems: "center" }, { children: [_jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), className: classes.activityAt }, { children: _jsx(DateTimeAgo, { component: "span", date: obj.added_at }) })), _jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), variant: "text", color: "secondary", size: "small" }, { children: _jsx(FormattedMessage, { id: "ui.feedObject.comment", defaultMessage: "ui.feedObject.comment" }) }))] })) })) : (_jsx(FeedObjectSkeleton, Object.assign({}, FeedObjectSkeletonProps))) }));
450
+ objElement = (_jsx(React.Fragment, { children: obj ? (_jsx(BaseItem, { elevation: 0, className: classes.snippet, image: _jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null }, { children: _jsx(UserAvatar, Object.assign({ hide: !obj.author.community_badge }, { children: _jsx(Avatar, { alt: obj.author.username, variant: "circular", src: obj.author.avatar, className: classes.avatar }) })) })), primary: _jsxs(Box, { children: [_jsx(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }, { children: obj.author.username })), _jsx(Typography, Object.assign({ variant: "body2", className: classes.snippetContent }, { children: _jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)) }, { children: getContributionSnippet(obj) })) }))] }), disableTypography: true, secondary: _jsxs(Stack, Object.assign({ direction: "row", justifyContent: "space-between", spacing: 2, alignItems: "center" }, { children: [_jsx(Link, Object.assign({ to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), className: classes.activityAt }, { children: _jsx(DateTimeAgo, { component: "span", date: obj.added_at }) })), commentsEnabled && (_jsx(Button, Object.assign({ component: Link, to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), variant: "text", color: "secondary", size: "small" }, { children: _jsx(FormattedMessage, { id: "ui.feedObject.comment", defaultMessage: "ui.feedObject.comment" }) })))] })) })) : (_jsx(FeedObjectSkeleton, Object.assign({}, FeedObjectSkeletonProps))) }));
441
451
  }
442
452
  /**
443
453
  * Renders root object
@@ -47,5 +47,5 @@ export default function Choice(props) {
47
47
  /**
48
48
  * Renders root element
49
49
  */
50
- return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Typography, Object.assign({ className: classes.label }, { children: choiceObj.choice })), _jsx(LinearProgressWithLabel, { className: classes.progress, value: renderVotes(choiceObj.vote_count, votes) }), _jsx(LoadingButton, Object.assign({ loading: isVoting === choiceObj.id, variant: choiceObj.voted ? 'contained' : 'outlined', size: "small", disabled: disabled || isVoting !== null || votable, className: classes.vote, onClick: handleVoteAction }, { children: choiceObj.voted ? (_jsx(Icon, { children: "check" })) : (_jsx(FormattedMessage, { id: "ui.feedObject.poll.choice.vote", defaultMessage: "ui.feedObject.poll.choice.vote" })) }))] })));
50
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: [_jsx(Typography, Object.assign({ className: classes.label }, { children: choiceObj.choice })), _jsx(LinearProgressWithLabel, { className: classes.progress, value: renderVotes(choiceObj.vote_count, votes) }), _jsx(LoadingButton, Object.assign({ loading: isVoting === choiceObj.id, variant: choiceObj.voted ? 'contained' : 'outlined', size: "small", disabled: disabled || isVoting !== null || votable || feedObject.draft, className: classes.vote, onClick: handleVoteAction }, { children: choiceObj.voted ? (_jsx(Icon, { children: "check" })) : (_jsx(FormattedMessage, { id: "ui.feedObject.poll.choice.vote", defaultMessage: "ui.feedObject.poll.choice.vote" })) }))] })));
51
51
  }
@@ -146,7 +146,7 @@ export default function PollObject(props) {
146
146
  */
147
147
  let objElement = _jsx(_Fragment, {});
148
148
  if (pollObject) {
149
- objElement = (_jsxs(_Fragment, { children: [_jsx(CardHeader, { title: _jsx(_Fragment, { children: _jsx(Button, Object.assign({ className: classes.toggleButton, onClick: handleToggleCollapsedClick, "aria-expanded": collapsed, endIcon: _jsx(Icon, Object.assign({ className: classNames(classes.expandIcon, { [classes.collapsedIcon]: collapsed }) }, { children: "arrow_upward" })) }, { children: collapsed ? intl.formatMessage(messages.showPoll) : intl.formatMessage(messages.hidePoll) })) }) }), _jsx(Collapse, Object.assign({ in: !collapsed, timeout: "auto", unmountOnExit: true }, { children: _jsxs(CardContent, { children: [_jsx(Typography, Object.assign({ variant: "body1", className: classes.title }, { children: obj.title })), obj.expiration_at && Date.parse(obj.expiration_at) >= new Date().getTime() && (_jsxs(Typography, Object.assign({ variant: "body2", className: classes.expiration }, { children: [`${intl.formatMessage(messages.expDate)}`, `${intl.formatDate(Date.parse(obj.expiration_at), { year: 'numeric', month: 'numeric', day: 'numeric' })}`] }))), obj.closed && (_jsx(Typography, Object.assign({ variant: "body2", className: classes.closed }, { children: _jsx(FormattedMessage, { id: "ui.feedObject.poll.closed", defaultMessage: "ui.feedObject.poll.closed" }) }))), _jsx(List, { children: choices.map((choice, index) => (_jsx(ListItem, { children: _jsx(Choice, { elevation: 0, choiceObj: choice, feedObject: disabled ? null : feedObject, votes: votes, vote: vote, isVoting: isVoting, votable: votable }) }, index))) }), multipleChoices ? (_jsxs("div", Object.assign({ className: classes.votes }, { children: [_jsx(Icon, { children: "list" }), _jsx(Typography, { children: `${intl.formatMessage(messages.votes, { total: votes })}` })] }))) : (_jsxs("div", Object.assign({ className: classes.voters }, { children: [_jsx(Icon, { children: "people_alt" }), _jsx(Typography, { children: `${intl.formatMessage(messages.voters, { total: votes })}` })] })))] }) }))] }));
149
+ objElement = (_jsxs(_Fragment, { children: [_jsx(CardHeader, { title: _jsx(_Fragment, { children: _jsx(Button, Object.assign({ className: classes.toggleButton, onClick: handleToggleCollapsedClick, "aria-expanded": collapsed, endIcon: _jsx(Icon, Object.assign({ className: classNames(classes.expandIcon, { [classes.collapsedIcon]: collapsed }) }, { children: "arrow_upward" })) }, { children: collapsed ? intl.formatMessage(messages.showPoll) : intl.formatMessage(messages.hidePoll) })) }) }), _jsx(Collapse, Object.assign({ in: !collapsed, timeout: "auto", unmountOnExit: true }, { children: _jsxs(CardContent, { children: [_jsx(Typography, Object.assign({ variant: "body1", className: classes.title }, { children: obj.title })), obj.expiration_at && Date.parse(obj.expiration_at) >= new Date().getTime() && (_jsxs(Typography, Object.assign({ variant: "body2", className: classes.expiration }, { children: [`${intl.formatMessage(messages.expDate)}`, `${intl.formatDate(Date.parse(obj.expiration_at), { year: 'numeric', month: 'numeric', day: 'numeric' })}`] }))), obj.closed && (_jsx(Typography, Object.assign({ variant: "body2", className: classes.closed }, { children: _jsx(FormattedMessage, { id: "ui.feedObject.poll.closed", defaultMessage: "ui.feedObject.poll.closed" }) }))), _jsx(List, { children: choices.map((choice, index) => (_jsx(ListItem, { children: _jsx(Choice, { elevation: 0, choiceObj: choice, feedObject: disabled ? null : feedObject, votes: votes, vote: vote, isVoting: isVoting, votable: votable }) }, index))) }), !feedObject.draft && (_jsx(_Fragment, { children: multipleChoices ? (_jsxs("div", Object.assign({ className: classes.votes }, { children: [_jsx(Icon, { children: "list" }), _jsx(Typography, { children: `${intl.formatMessage(messages.votes, { total: votes })}` })] }))) : (_jsxs("div", Object.assign({ className: classes.voters }, { children: [_jsx(Icon, { children: "people_alt" }), _jsx(Typography, { children: `${intl.formatMessage(messages.voters, { total: votes })}` })] }))) }))] }) }))] }));
150
150
  }
151
151
  useEffect(() => {
152
152
  setChoices(pollObject.choices);
@@ -1,5 +1,6 @@
1
1
  import { ButtonBaseProps } from '@mui/material';
2
2
  import { SCGroupType } from '@selfcommunity/types';
3
+ import { CacheStrategies } from '@selfcommunity/utils/src/utils/cache';
3
4
  import { WidgetProps } from '../Widget';
4
5
  import { GroupSubscribeButtonProps } from '../GroupSubscribeButton';
5
6
  export interface GroupProps extends WidgetProps {
@@ -17,7 +18,7 @@ export interface GroupProps extends WidgetProps {
17
18
  * Props to spread to group subscribe/unsubscribe button
18
19
  * @default {}
19
20
  */
20
- groupSubscribeButtonProps?: GroupSubscribeButtonProps;
21
+ GroupSubscribeButtonComponentProps?: GroupSubscribeButtonProps;
21
22
  /**
22
23
  * Badge content to show as group avatar badge if show reaction is true.
23
24
  */
@@ -37,6 +38,10 @@ export interface GroupProps extends WidgetProps {
37
38
  * @default {}
38
39
  */
39
40
  buttonProps?: ButtonBaseProps;
41
+ /**
42
+ * Override default cache strategy on fetch element
43
+ */
44
+ cacheStrategy?: CacheStrategies;
40
45
  /**
41
46
  * Any other properties
42
47
  */
@@ -69,9 +69,9 @@ export default function Group(inProps) {
69
69
  props: inProps,
70
70
  name: PREFIX
71
71
  });
72
- const { groupId = null, group = null, className = null, elevation, hideActions = false, actionRedirect = false, groupSubscribeButtonProps = {} } = props, rest = __rest(props, ["groupId", "group", "className", "elevation", "hideActions", "actionRedirect", "groupSubscribeButtonProps"]);
72
+ const { groupId = null, group = null, className = null, elevation, hideActions = false, actionRedirect = false, GroupSubscribeButtonComponentProps = {}, cacheStrategy } = props, rest = __rest(props, ["groupId", "group", "className", "elevation", "hideActions", "actionRedirect", "GroupSubscribeButtonComponentProps", "cacheStrategy"]);
73
73
  // STATE
74
- const { scGroup } = useSCFetchGroup({ id: groupId, group });
74
+ const { scGroup } = useSCFetchGroup(Object.assign({ id: groupId, group }, (cacheStrategy && { cacheStrategy })));
75
75
  // CONTEXT
76
76
  const scRoutingContext = useSCRouting();
77
77
  const scUserContext = useSCUser();
@@ -87,7 +87,7 @@ export default function Group(inProps) {
87
87
  * @return {JSX.Element}
88
88
  */
89
89
  function renderAuthenticatedActions() {
90
- return (_jsxs(Stack, Object.assign({ className: classes.actions, direction: "row", alignItems: "center", justifyContent: "center", spacing: 2 }, { children: [isGroupAdmin && _jsx(Icon, { children: "face" }), actionRedirect ? (_jsx(Button, Object.assign({ size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, scGroup) }, { children: scGroup.subscription_status === SCGroupSubscriptionStatusType.SUBSCRIBED ? (_jsx(FormattedMessage, { defaultMessage: "ui.group.status.enter", id: "ui.group.status.enter" })) : (_jsx(FormattedMessage, { defaultMessage: "ui.group.status.discover", id: "ui.group.status.discover" })) }))) : (_jsx(GroupSubscribeButton, Object.assign({ group: group, groupId: groupId }, groupSubscribeButtonProps)))] })));
90
+ return (_jsxs(Stack, Object.assign({ className: classes.actions, direction: "row", alignItems: "center", justifyContent: "center", spacing: 2 }, { children: [isGroupAdmin && _jsx(Icon, { children: "face" }), actionRedirect ? (_jsx(Button, Object.assign({ size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, scGroup) }, { children: scGroup.subscription_status === SCGroupSubscriptionStatusType.SUBSCRIBED ? (_jsx(FormattedMessage, { defaultMessage: "ui.group.status.enter", id: "ui.group.status.enter" })) : (_jsx(FormattedMessage, { defaultMessage: "ui.group.status.discover", id: "ui.group.status.discover" })) }))) : (_jsx(GroupSubscribeButton, Object.assign({ group: group, groupId: groupId }, GroupSubscribeButtonComponentProps)))] })));
91
91
  }
92
92
  /**
93
93
  * Renders group object
@@ -4,7 +4,7 @@ import { useMemo, useState } from 'react';
4
4
  import { useThemeProps } from '@mui/system';
5
5
  import { Avatar, Box, Divider, FormGroup, Icon, Paper, Stack, Switch, TextField, Typography, styled } from '@mui/material';
6
6
  import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
7
- import { SCPreferences, useSCPreferences } from '@selfcommunity/react-core';
7
+ import { SCPreferences, UserUtils, useSCPaymentsEnabled, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
8
8
  import classNames from 'classnames';
9
9
  import { PREFIX } from './constants';
10
10
  import BaseDialog from '../../shared/BaseDialog';
@@ -14,11 +14,13 @@ import ChangeGroupCover from '../ChangeGroupCover';
14
14
  import { GROUP_DESCRIPTION_MAX_LENGTH, GROUP_TITLE_MAX_LENGTH } from '../../constants/Group';
15
15
  import GroupInviteButton from '../GroupInviteButton';
16
16
  import PubSub from 'pubsub-js';
17
- import { SCGroupPrivacyType } from '@selfcommunity/types';
17
+ import { SCContentType, SCGroupPrivacyType } from '@selfcommunity/types';
18
18
  import { SCOPE_SC_UI } from '../../constants/Errors';
19
19
  import { formatHttpErrorCode, GroupService } from '@selfcommunity/api-services';
20
20
  import { Logger } from '@selfcommunity/utils';
21
21
  import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
22
+ import PaywallsConfigurator from '../PaywallsConfigurator';
23
+ import { ContentAccessType } from '../PaywallsConfigurator/constants';
22
24
  const messages = defineMessages({
23
25
  name: {
24
26
  id: 'ui.groupForm.name.placeholder',
@@ -46,6 +48,7 @@ const classes = {
46
48
  privacySectionInfo: `${PREFIX}-privacy-section-info`,
47
49
  visibilitySection: `${PREFIX}-visibility-section`,
48
50
  visibilitySectionInfo: `${PREFIX}-visibility-section-info`,
51
+ paywallsConfiguratorWrap: `${PREFIX}-paywalls-configurator-wrap`,
49
52
  inviteSection: `${PREFIX}-invite-section`,
50
53
  error: `${PREFIX}-error`
51
54
  };
@@ -90,7 +93,7 @@ const Root = styled(BaseDialog, {
90
93
  * @param inProps
91
94
  */
92
95
  export default function GroupForm(inProps) {
93
- var _a, _b, _c, _d, _e;
96
+ var _a, _b, _c, _d, _e, _f, _g;
94
97
  //PROPS
95
98
  const props = useThemeProps({
96
99
  props: inProps,
@@ -107,17 +110,25 @@ export default function GroupForm(inProps) {
107
110
  isPublic: group && group.privacy === SCGroupPrivacyType.PUBLIC,
108
111
  isVisible: group ? group.visible : true,
109
112
  invitedUsers: null,
110
- isSubmitting: false
113
+ isSubmitting: false,
114
+ products: ((_a = group === null || group === void 0 ? void 0 : group.paywalls) === null || _a === void 0 ? void 0 : _a.map((p) => p.id)) || [],
115
+ contentAccessType: ((_b = group === null || group === void 0 ? void 0 : group.paywalls) === null || _b === void 0 ? void 0 : _b.length) ? ContentAccessType.PAID : ContentAccessType.FREE
111
116
  };
117
+ // CONTEXT
118
+ const scUserContext = useSCUser();
112
119
  // STATE
113
120
  const [field, setField] = useState(initialFieldState);
114
121
  const [error, setError] = useState({});
115
122
  // INTL
116
123
  const intl = useIntl();
124
+ // CONST
125
+ const isStaff = useMemo(() => scUserContext.user && UserUtils.isStaff(scUserContext.user), [scUserContext.user]);
117
126
  // PREFERENCES
118
127
  const scPreferences = useSCPreferences();
119
128
  const visibilityEnabled = useMemo(() => scPreferences.preferences[SCPreferences.CONFIGURATIONS_GROUPS_VISIBILITY_ENABLED].value, [scPreferences.preferences]);
120
129
  const privateEnabled = useMemo(() => scPreferences.preferences[SCPreferences.CONFIGURATIONS_GROUPS_PRIVATE_ENABLED].value, [scPreferences.preferences]);
130
+ // PAYMENTS
131
+ const { isPaymentsEnabled } = useSCPaymentsEnabled();
121
132
  const _backgroundCover = Object.assign({}, (field.emotionalImageOriginal
122
133
  ? { background: `url('${field.emotionalImageOriginal}') center / cover` }
123
134
  : { background: `url('${scPreferences.preferences[SCPreferences.IMAGES_USER_DEFAULT_COVER].value}') center / cover` }));
@@ -162,6 +173,7 @@ export default function GroupForm(inProps) {
162
173
  }
163
174
  }
164
175
  const handleSubmit = () => {
176
+ var _a;
165
177
  setField((prev) => (Object.assign(Object.assign({}, prev), { ['isSubmitting']: true })));
166
178
  const formData = new FormData();
167
179
  formData.append('name', field.name);
@@ -178,6 +190,12 @@ export default function GroupForm(inProps) {
178
190
  if (field.emotionalImageOriginalFile) {
179
191
  formData.append('emotional_image_original', field.emotionalImageOriginalFile);
180
192
  }
193
+ if (field.products.length && field.contentAccessType === ContentAccessType.PAID && (isStaff || (group && ((_a = group.paywalls) === null || _a === void 0 ? void 0 : _a.length)))) {
194
+ formData.append(`products`, JSON.stringify(field.products));
195
+ }
196
+ else {
197
+ formData.append(`products`, '[]');
198
+ }
181
199
  if (!group) {
182
200
  for (const key in field.invitedUsers) {
183
201
  formData.append(key, field.invitedUsers[key]);
@@ -214,17 +232,29 @@ export default function GroupForm(inProps) {
214
232
  setError(error);
215
233
  }
216
234
  };
235
+ const handleChangeContentAccessType = (type) => {
236
+ setField((prev) => (Object.assign(Object.assign({}, prev), { contentAccessType: type })));
237
+ };
238
+ const handleChangePaymentsProducts = (products) => {
239
+ setField((prev) => (Object.assign(Object.assign({}, prev), { products: products.map((product) => product.id) })));
240
+ };
241
+ const handleClose = (_event, reason) => {
242
+ if (reason === 'backdropClick' || reason === 'escapeKeyDown') {
243
+ return;
244
+ }
245
+ onClose === null || onClose === void 0 ? void 0 : onClose();
246
+ };
217
247
  /**
218
248
  * Renders root object
219
249
  */
220
- return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, title: group ? (_jsx(FormattedMessage, { id: "ui.groupForm.title.edit", defaultMessage: "ui.groupForm.title.edit" })) : (_jsx(FormattedMessage, { id: "ui.groupForm.title", defaultMessage: "ui.groupForm.title" })), open: open, onClose: onClose, className: classNames(classes.root, className), actions: _jsx(LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
250
+ return (_jsx(Root, Object.assign({ DialogContentProps: { dividers: false }, title: group ? (_jsx(FormattedMessage, { id: "ui.groupForm.title.edit", defaultMessage: "ui.groupForm.title.edit" })) : (_jsx(FormattedMessage, { id: "ui.groupForm.title", defaultMessage: "ui.groupForm.title" })), open: open, disableEscapeKeyDown: true, onClose: handleClose, className: classNames(classes.root, className), actions: _jsx(LoadingButton, Object.assign({ loading: field.isSubmitting, disabled: !field.name ||
221
251
  Object.keys(error).length !== 0 ||
222
252
  field.name.length > GROUP_TITLE_MAX_LENGTH ||
223
253
  field.name.description > GROUP_DESCRIPTION_MAX_LENGTH, variant: "contained", onClick: handleSubmit, color: "secondary" }, { children: group ? (_jsx(FormattedMessage, { id: "ui.groupForm.button.edit", defaultMessage: "ui.groupForm.button.edit" })) : (_jsx(FormattedMessage, { id: "ui.groupForm.button.create", defaultMessage: "ui.groupForm.button.create" })) })) }, rest, { children: _jsxs(_Fragment, { children: [_jsxs(_Fragment, { children: [_jsxs(Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: [_jsx(Box, Object.assign({ className: classes.avatar }, { children: _jsx(Avatar, { children: field.imageOriginal ? _jsx("img", { src: field.imageOriginal, alt: "avatar" }) : _jsx(Icon, { children: "icon_image" }) }) })), _jsxs(_Fragment, { children: [_jsx(ChangeGroupPicture, { isCreationMode: true, onChange: handleChangeAvatar }), _jsx(ChangeGroupCover, { isCreationMode: true, onChange: handleChangeCover })] })] })), _jsx(Typography, Object.assign({ className: classNames(classes.header, { [classes.error]: error.emotionalImageOriginalError || error.imageOriginalError }), align: "center" }, { children: error.emotionalImageOriginalError || error.imageOriginalError ? (_jsx(FormattedMessage, { id: "ui.groupForm.header.error", defaultMessage: "ui.groupForm.header.error" })) : (_jsx(FormattedMessage, { id: "ui.groupForm.header", defaultMessage: "ui.groupForm.header" })) }))] }), _jsxs(FormGroup, Object.assign({ className: classes.form }, { children: [_jsx(TextField, { required: true, className: classes.name, placeholder: `${intl.formatMessage(messages.name)}`, margin: "normal", value: field.name, name: "name", onChange: handleChange, InputProps: {
224
254
  endAdornment: _jsx(Typography, Object.assign({ variant: "body2" }, { children: GROUP_TITLE_MAX_LENGTH - field.name.length }))
225
- }, error: Boolean(((_a = field === null || field === void 0 ? void 0 : field.name) === null || _a === void 0 ? void 0 : _a.length) > GROUP_TITLE_MAX_LENGTH), helperText: ((_b = field === null || field === void 0 ? void 0 : field.name) === null || _b === void 0 ? void 0 : _b.length) > GROUP_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.groupForm.name.error.maxLength", defaultMessage: "ui.groupForm.name.error.maxLength" })) : null }), _jsx(TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
226
- endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_c = field.description) === null || _c === void 0 ? void 0 : _c.length) ? GROUP_DESCRIPTION_MAX_LENGTH - field.description.length : GROUP_DESCRIPTION_MAX_LENGTH })))
227
- }, error: Boolean(((_d = field.description) === null || _d === void 0 ? void 0 : _d.length) > GROUP_DESCRIPTION_MAX_LENGTH), helperText: ((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) > GROUP_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.groupForm.description.error.maxLength", defaultMessage: "ui.groupForm.description.error.maxLength" })) : null }), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.privacySection }, { children: [_jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.groupForm.privacy.title", defaultMessage: "ui.groupForm.privacy.title", values: {
255
+ }, error: Boolean(((_c = field === null || field === void 0 ? void 0 : field.name) === null || _c === void 0 ? void 0 : _c.length) > GROUP_TITLE_MAX_LENGTH), helperText: ((_d = field === null || field === void 0 ? void 0 : field.name) === null || _d === void 0 ? void 0 : _d.length) > GROUP_TITLE_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.groupForm.name.error.maxLength", defaultMessage: "ui.groupForm.name.error.maxLength" })) : null }), _jsx(TextField, { multiline: true, className: classes.description, placeholder: `${intl.formatMessage(messages.description)}`, margin: "normal", value: field.description, name: "description", onChange: handleChange, InputProps: {
256
+ endAdornment: (_jsx(Typography, Object.assign({ variant: "body2" }, { children: ((_e = field.description) === null || _e === void 0 ? void 0 : _e.length) ? GROUP_DESCRIPTION_MAX_LENGTH - field.description.length : GROUP_DESCRIPTION_MAX_LENGTH })))
257
+ }, error: Boolean(((_f = field.description) === null || _f === void 0 ? void 0 : _f.length) > GROUP_DESCRIPTION_MAX_LENGTH), helperText: ((_g = field.description) === null || _g === void 0 ? void 0 : _g.length) > GROUP_DESCRIPTION_MAX_LENGTH ? (_jsx(FormattedMessage, { id: "ui.groupForm.description.error.maxLength", defaultMessage: "ui.groupForm.description.error.maxLength" })) : null }), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.privacySection }, { children: [_jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.groupForm.privacy.title", defaultMessage: "ui.groupForm.privacy.title", values: {
228
258
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
229
259
  // @ts-ignore
230
260
  b: (chunks) => _jsx("strong", { children: chunks })
@@ -252,5 +282,5 @@ export default function GroupForm(inProps) {
252
282
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
253
283
  // @ts-ignore
254
284
  b: (chunks) => _jsx("strong", { children: chunks })
255
- } })) }))] })) })))] })), !group && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(Box, Object.assign({ className: classes.inviteSection }, { children: _jsx(GroupInviteButton, { handleInvitations: handleInviteSection }) }))] }))] }) })));
285
+ } })) }))] })) })))] })), isPaymentsEnabled && isStaff && (_jsx(Box, Object.assign({ className: classes.paywallsConfiguratorWrap }, { children: _jsx(PaywallsConfigurator, Object.assign({}, (group && { contentId: group.id }), { contentType: SCContentType.GROUP, onChangeContentAccessType: handleChangeContentAccessType, onChangePaymentProducts: handleChangePaymentsProducts })) }))), !group && (_jsxs(_Fragment, { children: [_jsx(Divider, {}), _jsx(Box, Object.assign({ className: classes.inviteSection }, { children: _jsx(GroupInviteButton, { handleInvitations: handleInviteSection }) }))] }))] }) })));
256
286
  }
@@ -2,8 +2,8 @@ import { __rest } from "tslib";
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useCallback, useEffect, useMemo, useRef } from 'react';
4
4
  import { Avatar, Box, Icon, Paper, Typography, useMediaQuery, useTheme, styled } from '@mui/material';
5
- import { SCGroupPrivacyType, SCGroupSubscriptionStatusType } from '@selfcommunity/types';
6
- import { SCPreferences, useSCFetchGroup, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
5
+ import { SCContentType, SCGroupPrivacyType, SCGroupSubscriptionStatusType } from '@selfcommunity/types';
6
+ import { SCPreferences, useSCFetchGroup, useSCPaymentsEnabled, useSCPreferences, useSCUser } from '@selfcommunity/react-core';
7
7
  import GroupHeaderSkeleton from './Skeleton';
8
8
  import classNames from 'classnames';
9
9
  import { useThemeProps } from '@mui/system';
@@ -19,6 +19,7 @@ import GroupInviteButton from '../GroupInviteButton';
19
19
  import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
20
20
  import PubSub from 'pubsub-js';
21
21
  import GroupActionsMenu from '../GroupActionsMenu';
22
+ import BuyButton from '../BuyButton';
22
23
  const classes = {
23
24
  root: `${PREFIX}-root`,
24
25
  cover: `${PREFIX}-cover`,
@@ -69,7 +70,7 @@ const Root = styled(Box, {
69
70
  * @param inProps
70
71
  */
71
72
  export default function GroupHeader(inProps) {
72
- var _a;
73
+ var _a, _b;
73
74
  // PROPS
74
75
  const props = useThemeProps({
75
76
  props: inProps,
@@ -86,6 +87,8 @@ export default function GroupHeader(inProps) {
86
87
  const { scGroup, setSCGroup } = useSCFetchGroup({ id: groupId, group });
87
88
  const theme = useTheme();
88
89
  const isMobile = useMediaQuery(theme.breakpoints.down('md'));
90
+ // PAYMENTS
91
+ const { isPaymentsEnabled } = useSCPaymentsEnabled();
89
92
  // REFS
90
93
  const updatesSubscription = useRef(null);
91
94
  // CONST
@@ -148,7 +151,12 @@ export default function GroupHeader(inProps) {
148
151
  const _backgroundCover = Object.assign({}, (scGroup.emotional_image
149
152
  ? { background: `url('${scGroup.emotional_image}') center / cover` }
150
153
  : { background: `url('${scPreferences.preferences[SCPreferences.IMAGES_USER_DEFAULT_COVER].value}') center / cover` }));
151
- return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest, { children: [_jsxs(Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: [_jsx(Box, Object.assign({ className: classes.avatar }, { children: _jsx(Avatar, { children: _jsx("img", { alt: "group", src: scGroup.image_big ? scGroup.image_big : '' }) }) })), isGroupAdmin && (_jsxs(_Fragment, { children: [_jsx(ChangeGroupPicture, Object.assign({ groupId: scGroup.id, onChange: handleChangeAvatar, className: classes.changePicture }, ChangePictureProps)), _jsx("div", Object.assign({ className: classes.changeCover }, { children: _jsx(ChangeGroupCover, Object.assign({ groupId: scGroup.id, onChange: handleChangeCover }, ChangeCoverProps)) }))] }))] })), _jsxs(Box, Object.assign({ className: classes.info }, { children: [isGroupAdmin && !isMobile && (_jsxs(Box, Object.assign({ className: classes.multiActions }, { children: [_jsx(EditGroupButton, { group: scGroup, groupId: scGroup.id, onEditSuccess: (data) => setSCGroup(data) }), _jsx(GroupActionsMenu, Object.assign({ group: scGroup, onEditSuccess: (data) => setSCGroup(data) }, GroupActionsProps))] }))), _jsx(Typography, Object.assign({ variant: "h5", className: classes.name }, { children: scGroup.name })), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.visibility }, { children: [privateEnabled && (_jsx(_Fragment, { children: scGroup.privacy === SCGroupPrivacyType.PUBLIC ? (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.groupHeader.visibility.public", defaultMessage: "ui.groupHeader.visibility.public" })] }))) : (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.groupHeader.visibility.private", defaultMessage: "ui.groupHeader.visibility.private" })] }))) })), visibilityEnabled && (_jsxs(_Fragment, { children: [privateEnabled && _jsx(Bullet, {}), scGroup.visible ? (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "visibility" }), _jsx(FormattedMessage, { id: "ui.groupHeader.visibility.visible", defaultMessage: "ui.groupHeader.visibility.visible" })] }))) : (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "visibility_off" }), _jsx(FormattedMessage, { id: "ui.groupHeader.visibility.hidden", defaultMessage: "ui.groupHeader.visibility.hidden" })] })))] }))] }))), _jsx(_Fragment, { children: ((scGroup && scGroup.privacy === SCGroupPrivacyType.PUBLIC) ||
154
+ return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest, { children: [_jsxs(Paper, Object.assign({ style: _backgroundCover, classes: { root: classes.cover } }, { children: [_jsx(Box, Object.assign({ className: classes.avatar }, { children: _jsx(Avatar, { children: _jsx("img", { alt: "group", src: scGroup.image_big ? scGroup.image_big : '' }) }) })), isGroupAdmin && (_jsxs(_Fragment, { children: [_jsx(ChangeGroupPicture, Object.assign({ groupId: scGroup.id, onChange: handleChangeAvatar, className: classes.changePicture }, ChangePictureProps)), _jsx("div", Object.assign({ className: classes.changeCover }, { children: _jsx(ChangeGroupCover, Object.assign({ groupId: scGroup.id, onChange: handleChangeCover }, ChangeCoverProps)) }))] }))] })), _jsxs(Box, Object.assign({ className: classes.info }, { children: [isGroupAdmin && !isMobile && (_jsxs(Box, Object.assign({ className: classes.multiActions }, { children: [_jsx(EditGroupButton, { group: scGroup, groupId: scGroup.id, onEditSuccess: (data) => setSCGroup(data) }), _jsx(GroupActionsMenu, Object.assign({ group: scGroup, onEditSuccess: (data) => setSCGroup(data) }, GroupActionsProps))] }))), _jsx(Typography, Object.assign({ variant: "h5", className: classes.name }, { children: scGroup.name })), privateEnabled && (_jsxs(Box, Object.assign({ className: classes.visibility }, { children: [privateEnabled && (_jsx(_Fragment, { children: scGroup.privacy === SCGroupPrivacyType.PUBLIC ? (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "public" }), _jsx(FormattedMessage, { id: "ui.groupHeader.visibility.public", defaultMessage: "ui.groupHeader.visibility.public" })] }))) : (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "private" }), _jsx(FormattedMessage, { id: "ui.groupHeader.visibility.private", defaultMessage: "ui.groupHeader.visibility.private" })] }))) })), visibilityEnabled && (_jsxs(_Fragment, { children: [privateEnabled && _jsx(Bullet, {}), scGroup.visible ? (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "visibility" }), _jsx(FormattedMessage, { id: "ui.groupHeader.visibility.visible", defaultMessage: "ui.groupHeader.visibility.visible" })] }))) : (_jsxs(Typography, Object.assign({ className: classes.visibilityItem }, { children: [_jsx(Icon, { children: "visibility_off" }), _jsx(FormattedMessage, { id: "ui.groupHeader.visibility.hidden", defaultMessage: "ui.groupHeader.visibility.hidden" })] })))] })), isPaymentsEnabled &&
155
+ ((_b = scGroup.paywalls) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
156
+ (scGroup.privacy === SCGroupPrivacyType.PUBLIC ||
157
+ (scGroup.privacy === SCGroupPrivacyType.PRIVATE &&
158
+ scGroup.subscription_status &&
159
+ scGroup.subscription_status !== SCGroupSubscriptionStatusType.REQUESTED)) && (_jsx(BuyButton, { size: "md", variant: "text", startIcon: _jsx(Icon, { children: "dredit-card" }), contentType: SCContentType.GROUP, content: scGroup, label: _jsx(FormattedMessage, { id: "ui.groupHeader.paid", defaultMessage: "ui.groupHeader.paid" }) }))] }))), _jsx(_Fragment, { children: ((scGroup && scGroup.privacy === SCGroupPrivacyType.PUBLIC) ||
152
160
  scGroup.subscription_status === SCGroupSubscriptionStatusType.SUBSCRIBED ||
153
161
  isGroupAdmin) && (_jsxs(Box, Object.assign({ className: classes.members }, { children: [_jsx(Typography, Object.assign({ className: classes.membersCounter, component: "div" }, { children: _jsx(FormattedMessage, { id: "ui.groupHeader.members", defaultMessage: "ui.groupHeader.members", values: { total: scGroup.subscribers_counter } }) })), _jsx(GroupMembersButton, Object.assign({ groupId: scGroup === null || scGroup === void 0 ? void 0 : scGroup.id, group: scGroup, autoHide: !isGroupAdmin }, GroupMembersButtonProps), scGroup.subscribers_counter)] }))) }), isGroupAdmin ? (_jsxs(Box, { children: [_jsx(GroupInviteButton, { group: scGroup, groupId: scGroup.id }), isMobile && _jsx(GroupActionsMenu, Object.assign({ group: scGroup, onEditSuccess: (data) => setSCGroup(data) }, GroupActionsProps))] })) : (_jsx(GroupSubscribeButton, Object.assign({ group: scGroup, onSubscribe: handleSubscribe }, GroupSubscribeButtonProps)))] }))] })));
154
162
  }