@selfcommunity/react-ui 0.7.0-alpha.137 → 0.7.0-alpha.139

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 (322) hide show
  1. package/lib/cjs/components/CommentObject/CommentObject.d.ts +5 -5
  2. package/lib/cjs/components/CommentObject/CommentObject.d.ts.map +1 -1
  3. package/lib/cjs/components/CommentObject/CommentObject.js +14 -252
  4. package/lib/cjs/components/CommentObject/CommentObject.js.map +1 -1
  5. package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.d.ts +3 -3
  6. package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.d.ts.map +1 -1
  7. package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js +1 -1
  8. package/lib/cjs/components/CommentsFeedObject/CommentsFeedObject.js.map +1 -1
  9. package/lib/cjs/components/CommentsObject/CommentsObject.d.ts +3 -3
  10. package/lib/cjs/components/CommentsObject/CommentsObject.d.ts.map +1 -1
  11. package/lib/cjs/components/CommentsObject/CommentsObject.js +1 -1
  12. package/lib/cjs/components/CommentsObject/CommentsObject.js.map +1 -1
  13. package/lib/cjs/components/Composer/Composer.d.ts +2 -2
  14. package/lib/cjs/components/Composer/Composer.d.ts.map +1 -1
  15. package/lib/cjs/components/Composer/Composer.js +1 -125
  16. package/lib/cjs/components/Composer/Composer.js.map +1 -1
  17. package/lib/cjs/components/FeedObject/Actions/Actions.d.ts +2 -2
  18. package/lib/cjs/components/FeedObject/Actions/Actions.d.ts.map +1 -1
  19. package/lib/cjs/components/FeedObject/Actions/Actions.js +4 -7
  20. package/lib/cjs/components/FeedObject/Actions/Actions.js.map +1 -1
  21. package/lib/cjs/components/FeedObject/Actions/Comment/Comment.d.ts +2 -2
  22. package/lib/cjs/components/FeedObject/Actions/Comment/Comment.d.ts.map +1 -1
  23. package/lib/cjs/components/FeedObject/Actions/Comment/Comment.js +1 -1
  24. package/lib/cjs/components/FeedObject/Actions/Comment/Comment.js.map +1 -1
  25. package/lib/cjs/components/FeedObject/Actions/Follow/Follow.d.ts +2 -2
  26. package/lib/cjs/components/FeedObject/Actions/Follow/Follow.d.ts.map +1 -1
  27. package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js +1 -1
  28. package/lib/cjs/components/FeedObject/Actions/Follow/Follow.js.map +1 -1
  29. package/lib/cjs/components/FeedObject/Actions/Share/Share.d.ts +2 -2
  30. package/lib/cjs/components/FeedObject/Actions/Share/Share.d.ts.map +1 -1
  31. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +1 -1
  32. package/lib/cjs/components/FeedObject/Actions/Share/Share.js.map +1 -1
  33. package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts +2 -2
  34. package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts.map +1 -1
  35. package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js +1 -1
  36. package/lib/cjs/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js.map +1 -1
  37. package/lib/cjs/components/FeedObject/Actions/Vote/Vote.d.ts +2 -18
  38. package/lib/cjs/components/FeedObject/Actions/Vote/Vote.d.ts.map +1 -1
  39. package/lib/cjs/components/FeedObject/Actions/Vote/Vote.js +10 -277
  40. package/lib/cjs/components/FeedObject/Actions/Vote/Vote.js.map +1 -1
  41. package/lib/cjs/components/FeedObject/Activities/Activities.d.ts +4 -4
  42. package/lib/cjs/components/FeedObject/Activities/Activities.d.ts.map +1 -1
  43. package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
  44. package/lib/cjs/components/FeedObject/Activities/Activities.js.map +1 -1
  45. package/lib/cjs/components/FeedObject/Contributors/Contributors.d.ts +2 -2
  46. package/lib/cjs/components/FeedObject/Contributors/Contributors.d.ts.map +1 -1
  47. package/lib/cjs/components/FeedObject/FeedObject.d.ts +2 -2
  48. package/lib/cjs/components/FeedObject/FeedObject.d.ts.map +1 -1
  49. package/lib/cjs/components/FeedObject/FeedObject.js +8 -9
  50. package/lib/cjs/components/FeedObject/FeedObject.js.map +1 -1
  51. package/lib/cjs/components/FeedObject/Poll/Poll.d.ts.map +1 -1
  52. package/lib/cjs/components/FeedObject/Poll/Poll.js +1 -1
  53. package/lib/cjs/components/FeedObject/Poll/Poll.js.map +1 -1
  54. package/lib/cjs/components/InlineComposer/InlineComposer.d.ts.map +1 -1
  55. package/lib/cjs/components/InlineComposer/InlineComposer.js +1 -20
  56. package/lib/cjs/components/InlineComposer/InlineComposer.js.map +1 -1
  57. package/lib/cjs/components/Notification/Comment/Comment.d.ts +2 -12
  58. package/lib/cjs/components/Notification/Comment/Comment.d.ts.map +1 -1
  59. package/lib/cjs/components/Notification/Comment/Comment.js +7 -12
  60. package/lib/cjs/components/Notification/Comment/Comment.js.map +1 -1
  61. package/lib/cjs/components/Notification/Contribution/Contribution.d.ts +2 -12
  62. package/lib/cjs/components/Notification/Contribution/Contribution.d.ts.map +1 -1
  63. package/lib/cjs/components/Notification/Contribution/Contribution.js +11 -16
  64. package/lib/cjs/components/Notification/Contribution/Contribution.js.map +1 -1
  65. package/lib/cjs/components/Notification/Notification.d.ts.map +1 -1
  66. package/lib/cjs/components/Notification/Notification.js +7 -33
  67. package/lib/cjs/components/Notification/Notification.js.map +1 -1
  68. package/lib/cjs/components/PrivateMessageComponent/Skeleton.d.ts.map +1 -1
  69. package/lib/cjs/components/PrivateMessageComponent/Skeleton.js +4 -2
  70. package/lib/cjs/components/PrivateMessageComponent/Skeleton.js.map +1 -1
  71. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts.map +1 -1
  72. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +0 -1
  73. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js.map +1 -1
  74. package/lib/cjs/components/PrivateMessageThread/Skeleton.js +2 -2
  75. package/lib/cjs/components/PrivateMessageThread/Skeleton.js.map +1 -1
  76. package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.d.ts.map +1 -1
  77. package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.js +2 -4
  78. package/lib/cjs/components/PrivateMessageThreadItem/Skeleton.js.map +1 -1
  79. package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.d.ts +2 -2
  80. package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
  81. package/lib/cjs/components/RelatedFeedObjects/RelatedFeedObjects.js.map +1 -1
  82. package/lib/cjs/components/User/User.d.ts +3 -8
  83. package/lib/cjs/components/User/User.d.ts.map +1 -1
  84. package/lib/cjs/components/User/User.js +6 -28
  85. package/lib/cjs/components/User/User.js.map +1 -1
  86. package/lib/cjs/components/UserInfoDialog/UserInfoDialog.d.ts +1 -1
  87. package/lib/cjs/components/UserInfoDialog/UserInfoDialog.d.ts.map +1 -1
  88. package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts +50 -0
  89. package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.d.ts.map +1 -0
  90. package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +174 -0
  91. package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js.map +1 -0
  92. package/lib/cjs/components/VoteAudienceButton/index.d.ts +4 -0
  93. package/lib/cjs/components/VoteAudienceButton/index.d.ts.map +1 -0
  94. package/lib/cjs/components/{CommentObject/Reactions/ReactionsDialog → VoteAudienceButton}/index.js +2 -2
  95. package/lib/cjs/components/VoteAudienceButton/index.js.map +1 -0
  96. package/lib/cjs/components/VoteButton/VoteButton.d.ts +53 -0
  97. package/lib/cjs/components/VoteButton/VoteButton.d.ts.map +1 -0
  98. package/lib/cjs/components/VoteButton/VoteButton.js +152 -0
  99. package/lib/cjs/components/VoteButton/VoteButton.js.map +1 -0
  100. package/lib/cjs/components/VoteButton/index.d.ts +4 -0
  101. package/lib/cjs/components/VoteButton/index.d.ts.map +1 -0
  102. package/lib/cjs/components/{FeedObject/Actions/Reaction → VoteButton}/index.js +2 -2
  103. package/lib/cjs/components/VoteButton/index.js.map +1 -0
  104. package/lib/cjs/shared/BaseDialog/BaseDialog.d.ts +11 -0
  105. package/lib/cjs/shared/BaseDialog/BaseDialog.d.ts.map +1 -1
  106. package/lib/cjs/shared/BaseDialog/BaseDialog.js +3 -8
  107. package/lib/cjs/shared/BaseDialog/BaseDialog.js.map +1 -1
  108. package/lib/cjs/shared/ContributionActionsMenu/index.d.ts +2 -2
  109. package/lib/cjs/shared/ContributionActionsMenu/index.d.ts.map +1 -1
  110. package/lib/cjs/shared/ContributionActionsMenu/index.js +14 -15
  111. package/lib/cjs/shared/ContributionActionsMenu/index.js.map +1 -1
  112. package/lib/cjs/utils/contribution.d.ts +2 -2
  113. package/lib/cjs/utils/contribution.d.ts.map +1 -1
  114. package/lib/cjs/utils/contribution.js +15 -17
  115. package/lib/cjs/utils/contribution.js.map +1 -1
  116. package/lib/esm/components/CommentObject/CommentObject.d.ts +5 -5
  117. package/lib/esm/components/CommentObject/CommentObject.d.ts.map +1 -1
  118. package/lib/esm/components/CommentObject/CommentObject.js +20 -258
  119. package/lib/esm/components/CommentObject/CommentObject.js.map +1 -1
  120. package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.d.ts +3 -3
  121. package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.d.ts.map +1 -1
  122. package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js +3 -3
  123. package/lib/esm/components/CommentsFeedObject/CommentsFeedObject.js.map +1 -1
  124. package/lib/esm/components/CommentsObject/CommentsObject.d.ts +3 -3
  125. package/lib/esm/components/CommentsObject/CommentsObject.d.ts.map +1 -1
  126. package/lib/esm/components/CommentsObject/CommentsObject.js +2 -2
  127. package/lib/esm/components/CommentsObject/CommentsObject.js.map +1 -1
  128. package/lib/esm/components/Composer/Composer.d.ts +2 -2
  129. package/lib/esm/components/Composer/Composer.d.ts.map +1 -1
  130. package/lib/esm/components/Composer/Composer.js +2 -126
  131. package/lib/esm/components/Composer/Composer.js.map +1 -1
  132. package/lib/esm/components/Editor/plugins/ImagePlugin.js +1 -1
  133. package/lib/esm/components/Editor/plugins/ImagePlugin.js.map +1 -1
  134. package/lib/esm/components/FeedObject/Actions/Actions.d.ts +2 -2
  135. package/lib/esm/components/FeedObject/Actions/Actions.d.ts.map +1 -1
  136. package/lib/esm/components/FeedObject/Actions/Actions.js +6 -9
  137. package/lib/esm/components/FeedObject/Actions/Actions.js.map +1 -1
  138. package/lib/esm/components/FeedObject/Actions/Comment/Comment.d.ts +2 -2
  139. package/lib/esm/components/FeedObject/Actions/Comment/Comment.d.ts.map +1 -1
  140. package/lib/esm/components/FeedObject/Actions/Comment/Comment.js +3 -3
  141. package/lib/esm/components/FeedObject/Actions/Comment/Comment.js.map +1 -1
  142. package/lib/esm/components/FeedObject/Actions/Follow/Follow.d.ts +2 -2
  143. package/lib/esm/components/FeedObject/Actions/Follow/Follow.d.ts.map +1 -1
  144. package/lib/esm/components/FeedObject/Actions/Follow/Follow.js +3 -3
  145. package/lib/esm/components/FeedObject/Actions/Follow/Follow.js.map +1 -1
  146. package/lib/esm/components/FeedObject/Actions/Share/Share.d.ts +2 -2
  147. package/lib/esm/components/FeedObject/Actions/Share/Share.d.ts.map +1 -1
  148. package/lib/esm/components/FeedObject/Actions/Share/Share.js +2 -2
  149. package/lib/esm/components/FeedObject/Actions/Share/Share.js.map +1 -1
  150. package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts +2 -2
  151. package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.d.ts.map +1 -1
  152. package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js +2 -2
  153. package/lib/esm/components/FeedObject/Actions/Share/SharesDialog/SharesDialog.js.map +1 -1
  154. package/lib/esm/components/FeedObject/Actions/Vote/Vote.d.ts +2 -18
  155. package/lib/esm/components/FeedObject/Actions/Vote/Vote.d.ts.map +1 -1
  156. package/lib/esm/components/FeedObject/Actions/Vote/Vote.js +12 -255
  157. package/lib/esm/components/FeedObject/Actions/Vote/Vote.js.map +1 -1
  158. package/lib/esm/components/FeedObject/Activities/Activities.d.ts +4 -4
  159. package/lib/esm/components/FeedObject/Activities/Activities.d.ts.map +1 -1
  160. package/lib/esm/components/FeedObject/Activities/Activities.js +2 -2
  161. package/lib/esm/components/FeedObject/Activities/Activities.js.map +1 -1
  162. package/lib/esm/components/FeedObject/Contributors/Contributors.d.ts +2 -2
  163. package/lib/esm/components/FeedObject/Contributors/Contributors.d.ts.map +1 -1
  164. package/lib/esm/components/FeedObject/FeedObject.d.ts +2 -2
  165. package/lib/esm/components/FeedObject/FeedObject.d.ts.map +1 -1
  166. package/lib/esm/components/FeedObject/FeedObject.js +10 -11
  167. package/lib/esm/components/FeedObject/FeedObject.js.map +1 -1
  168. package/lib/esm/components/FeedObject/Poll/Poll.d.ts.map +1 -1
  169. package/lib/esm/components/FeedObject/Poll/Poll.js +2 -2
  170. package/lib/esm/components/FeedObject/Poll/Poll.js.map +1 -1
  171. package/lib/esm/components/InlineComposer/InlineComposer.d.ts.map +1 -1
  172. package/lib/esm/components/InlineComposer/InlineComposer.js +1 -20
  173. package/lib/esm/components/InlineComposer/InlineComposer.js.map +1 -1
  174. package/lib/esm/components/Notification/Comment/Comment.d.ts +2 -12
  175. package/lib/esm/components/Notification/Comment/Comment.d.ts.map +1 -1
  176. package/lib/esm/components/Notification/Comment/Comment.js +9 -14
  177. package/lib/esm/components/Notification/Comment/Comment.js.map +1 -1
  178. package/lib/esm/components/Notification/Contribution/Contribution.d.ts +2 -12
  179. package/lib/esm/components/Notification/Contribution/Contribution.d.ts.map +1 -1
  180. package/lib/esm/components/Notification/Contribution/Contribution.js +13 -18
  181. package/lib/esm/components/Notification/Contribution/Contribution.js.map +1 -1
  182. package/lib/esm/components/Notification/Notification.d.ts.map +1 -1
  183. package/lib/esm/components/Notification/Notification.js +7 -33
  184. package/lib/esm/components/Notification/Notification.js.map +1 -1
  185. package/lib/esm/components/PrivateMessageComponent/Skeleton.d.ts.map +1 -1
  186. package/lib/esm/components/PrivateMessageComponent/Skeleton.js +5 -3
  187. package/lib/esm/components/PrivateMessageComponent/Skeleton.js.map +1 -1
  188. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts.map +1 -1
  189. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +0 -1
  190. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js.map +1 -1
  191. package/lib/esm/components/PrivateMessageThread/Skeleton.js +2 -2
  192. package/lib/esm/components/PrivateMessageThread/Skeleton.js.map +1 -1
  193. package/lib/esm/components/PrivateMessageThreadItem/Skeleton.d.ts.map +1 -1
  194. package/lib/esm/components/PrivateMessageThreadItem/Skeleton.js +2 -4
  195. package/lib/esm/components/PrivateMessageThreadItem/Skeleton.js.map +1 -1
  196. package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.d.ts +2 -2
  197. package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.d.ts.map +1 -1
  198. package/lib/esm/components/RelatedFeedObjects/RelatedFeedObjects.js.map +1 -1
  199. package/lib/esm/components/User/User.d.ts +3 -8
  200. package/lib/esm/components/User/User.d.ts.map +1 -1
  201. package/lib/esm/components/User/User.js +6 -28
  202. package/lib/esm/components/User/User.js.map +1 -1
  203. package/lib/esm/components/UserInfoDialog/UserInfoDialog.d.ts +1 -1
  204. package/lib/esm/components/UserInfoDialog/UserInfoDialog.d.ts.map +1 -1
  205. package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts +50 -0
  206. package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.d.ts.map +1 -0
  207. package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +145 -0
  208. package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js.map +1 -0
  209. package/lib/esm/components/VoteAudienceButton/index.d.ts +4 -0
  210. package/lib/esm/components/VoteAudienceButton/index.d.ts.map +1 -0
  211. package/lib/esm/components/VoteAudienceButton/index.js +3 -0
  212. package/lib/esm/components/VoteAudienceButton/index.js.map +1 -0
  213. package/lib/esm/components/VoteButton/VoteButton.d.ts +53 -0
  214. package/lib/esm/components/VoteButton/VoteButton.d.ts.map +1 -0
  215. package/lib/esm/components/VoteButton/VoteButton.js +123 -0
  216. package/lib/esm/components/VoteButton/VoteButton.js.map +1 -0
  217. package/lib/esm/components/VoteButton/index.d.ts +4 -0
  218. package/lib/esm/components/VoteButton/index.d.ts.map +1 -0
  219. package/lib/esm/components/VoteButton/index.js +3 -0
  220. package/lib/esm/components/VoteButton/index.js.map +1 -0
  221. package/lib/esm/shared/BaseDialog/BaseDialog.d.ts +11 -0
  222. package/lib/esm/shared/BaseDialog/BaseDialog.d.ts.map +1 -1
  223. package/lib/esm/shared/BaseDialog/BaseDialog.js +3 -8
  224. package/lib/esm/shared/BaseDialog/BaseDialog.js.map +1 -1
  225. package/lib/esm/shared/ContributionActionsMenu/index.d.ts +2 -2
  226. package/lib/esm/shared/ContributionActionsMenu/index.d.ts.map +1 -1
  227. package/lib/esm/shared/ContributionActionsMenu/index.js +12 -13
  228. package/lib/esm/shared/ContributionActionsMenu/index.js.map +1 -1
  229. package/lib/esm/utils/contribution.d.ts +2 -2
  230. package/lib/esm/utils/contribution.d.ts.map +1 -1
  231. package/lib/esm/utils/contribution.js +16 -18
  232. package/lib/esm/utils/contribution.js.map +1 -1
  233. package/lib/umd/react-ui.js +11 -11
  234. package/lib/umd/react-ui.js.LICENSE.txt +1 -1
  235. package/lib/umd/react-ui.js.map +1 -1
  236. package/package.json +6 -6
  237. package/lib/cjs/components/CommentObject/Reactions/Reactions.d.ts +0 -23
  238. package/lib/cjs/components/CommentObject/Reactions/Reactions.d.ts.map +0 -1
  239. package/lib/cjs/components/CommentObject/Reactions/Reactions.js +0 -97
  240. package/lib/cjs/components/CommentObject/Reactions/Reactions.js.map +0 -1
  241. package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts +0 -34
  242. package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts.map +0 -1
  243. package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js +0 -129
  244. package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js.map +0 -1
  245. package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.d.ts +0 -4
  246. package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.d.ts.map +0 -1
  247. package/lib/cjs/components/CommentObject/Reactions/ReactionsDialog/index.js.map +0 -1
  248. package/lib/cjs/components/CommentObject/Reactions/index.d.ts +0 -4
  249. package/lib/cjs/components/CommentObject/Reactions/index.d.ts.map +0 -1
  250. package/lib/cjs/components/CommentObject/Reactions/index.js +0 -8
  251. package/lib/cjs/components/CommentObject/Reactions/index.js.map +0 -1
  252. package/lib/cjs/components/CommentObject/Votes/Votes.d.ts +0 -19
  253. package/lib/cjs/components/CommentObject/Votes/Votes.d.ts.map +0 -1
  254. package/lib/cjs/components/CommentObject/Votes/Votes.js +0 -93
  255. package/lib/cjs/components/CommentObject/Votes/Votes.js.map +0 -1
  256. package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts +0 -24
  257. package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts.map +0 -1
  258. package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.js +0 -95
  259. package/lib/cjs/components/CommentObject/Votes/VotesDialog/VotesDialog.js.map +0 -1
  260. package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.d.ts +0 -4
  261. package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.d.ts.map +0 -1
  262. package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.js +0 -8
  263. package/lib/cjs/components/CommentObject/Votes/VotesDialog/index.js.map +0 -1
  264. package/lib/cjs/components/CommentObject/Votes/index.d.ts +0 -4
  265. package/lib/cjs/components/CommentObject/Votes/index.d.ts.map +0 -1
  266. package/lib/cjs/components/CommentObject/Votes/index.js +0 -8
  267. package/lib/cjs/components/CommentObject/Votes/index.js.map +0 -1
  268. package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.d.ts +0 -34
  269. package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.d.ts.map +0 -1
  270. package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.js +0 -474
  271. package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.js.map +0 -1
  272. package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts +0 -40
  273. package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts.map +0 -1
  274. package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.js +0 -156
  275. package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.js.map +0 -1
  276. package/lib/cjs/components/FeedObject/Actions/Reaction/index.d.ts +0 -3
  277. package/lib/cjs/components/FeedObject/Actions/Reaction/index.d.ts.map +0 -1
  278. package/lib/cjs/components/FeedObject/Actions/Reaction/index.js.map +0 -1
  279. package/lib/esm/components/CommentObject/Reactions/Reactions.d.ts +0 -23
  280. package/lib/esm/components/CommentObject/Reactions/Reactions.d.ts.map +0 -1
  281. package/lib/esm/components/CommentObject/Reactions/Reactions.js +0 -68
  282. package/lib/esm/components/CommentObject/Reactions/Reactions.js.map +0 -1
  283. package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts +0 -34
  284. package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.d.ts.map +0 -1
  285. package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js +0 -100
  286. package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.js.map +0 -1
  287. package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.d.ts +0 -4
  288. package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.d.ts.map +0 -1
  289. package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.js +0 -3
  290. package/lib/esm/components/CommentObject/Reactions/ReactionsDialog/index.js.map +0 -1
  291. package/lib/esm/components/CommentObject/Reactions/index.d.ts +0 -4
  292. package/lib/esm/components/CommentObject/Reactions/index.d.ts.map +0 -1
  293. package/lib/esm/components/CommentObject/Reactions/index.js +0 -3
  294. package/lib/esm/components/CommentObject/Reactions/index.js.map +0 -1
  295. package/lib/esm/components/CommentObject/Votes/Votes.d.ts +0 -19
  296. package/lib/esm/components/CommentObject/Votes/Votes.d.ts.map +0 -1
  297. package/lib/esm/components/CommentObject/Votes/Votes.js +0 -64
  298. package/lib/esm/components/CommentObject/Votes/Votes.js.map +0 -1
  299. package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts +0 -24
  300. package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.d.ts.map +0 -1
  301. package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.js +0 -66
  302. package/lib/esm/components/CommentObject/Votes/VotesDialog/VotesDialog.js.map +0 -1
  303. package/lib/esm/components/CommentObject/Votes/VotesDialog/index.d.ts +0 -4
  304. package/lib/esm/components/CommentObject/Votes/VotesDialog/index.d.ts.map +0 -1
  305. package/lib/esm/components/CommentObject/Votes/VotesDialog/index.js +0 -3
  306. package/lib/esm/components/CommentObject/Votes/VotesDialog/index.js.map +0 -1
  307. package/lib/esm/components/CommentObject/Votes/index.d.ts +0 -4
  308. package/lib/esm/components/CommentObject/Votes/index.d.ts.map +0 -1
  309. package/lib/esm/components/CommentObject/Votes/index.js +0 -3
  310. package/lib/esm/components/CommentObject/Votes/index.js.map +0 -1
  311. package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.d.ts +0 -34
  312. package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.d.ts.map +0 -1
  313. package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.js +0 -444
  314. package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.js.map +0 -1
  315. package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts +0 -40
  316. package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts.map +0 -1
  317. package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.js +0 -127
  318. package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.js.map +0 -1
  319. package/lib/esm/components/FeedObject/Actions/Reaction/index.d.ts +0 -3
  320. package/lib/esm/components/FeedObject/Actions/Reaction/index.d.ts.map +0 -1
  321. package/lib/esm/components/FeedObject/Actions/Reaction/index.js +0 -3
  322. package/lib/esm/components/FeedObject/Actions/Reaction/index.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selfcommunity/react-ui",
3
- "version": "0.7.0-alpha.137",
3
+ "version": "0.7.0-alpha.139",
4
4
  "description": "React UI Components to integrate a Community created with SelfCommunity.",
5
5
  "author": "SelfCommunity <https://www.selfcommunity.com>",
6
6
  "homepage": "https://www.selfcommunity.com",
@@ -67,10 +67,10 @@
67
67
  "@rpldy/upload-drop-zone": "^1.3.1",
68
68
  "@rpldy/upload-preview": "^1.3.1",
69
69
  "@rpldy/uploady": "^1.3.1",
70
- "@selfcommunity/api-services": "^0.3.6-alpha.20",
71
- "@selfcommunity/react-core": "^0.4.0-alpha.7",
72
- "@selfcommunity/react-i18n": "^0.5.0-alpha.2",
73
- "@selfcommunity/types": "^0.4.1-alpha.9",
70
+ "@selfcommunity/api-services": "^0.3.6-alpha.21",
71
+ "@selfcommunity/react-core": "^0.4.0-alpha.8",
72
+ "@selfcommunity/react-i18n": "^0.5.0-alpha.3",
73
+ "@selfcommunity/types": "^0.4.1-alpha.10",
74
74
  "@selfcommunity/utils": "^0.1.44-alpha.1",
75
75
  "@types/classnames": "^2.3.1",
76
76
  "autosuggest-highlight": "^3.1.1",
@@ -158,5 +158,5 @@
158
158
  "bugs": {
159
159
  "url": "https://github.com/selfcommunity/community-js/issues"
160
160
  },
161
- "gitHead": "bf427ce02c96095a1a5b6024bee73a5cc8644f03"
161
+ "gitHead": "5936692d015f2f66f34a02e51c1012dde10f7fbf"
162
162
  }
@@ -1,23 +0,0 @@
1
- import { SCCommentType, SCReactionType } from '@selfcommunity/types';
2
- export interface ReactionsProps {
3
- /**
4
- * Id of the comment object
5
- * @default null
6
- */
7
- commentObjectId?: number;
8
- /**
9
- * Comment object
10
- * @default null
11
- */
12
- commentObject?: SCCommentType;
13
- /**
14
- * The reactions added to the comment
15
- */
16
- reactionsList: SCReactionType[];
17
- /**
18
- * Other props
19
- */
20
- [p: string]: any;
21
- }
22
- export default function Reactions(inProps: ReactionsProps): JSX.Element;
23
- //# sourceMappingURL=Reactions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Reactions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CommentObject/Reactions/Reactions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAwBnE,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;OAEG;IACH,aAAa,EAAE,cAAc,EAAE,CAAC;IAChC;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAiEtE"}
@@ -1,97 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const material_1 = require("@mui/material");
42
- const react_core_1 = require("@selfcommunity/react-core");
43
- const styles_1 = require("@mui/material/styles");
44
- const Icon_1 = __importDefault(require("@mui/material/Icon"));
45
- const ReactionsDialog_1 = __importDefault(require("./ReactionsDialog"));
46
- const system_1 = require("@mui/system");
47
- const classnames_1 = __importDefault(require("classnames"));
48
- const PREFIX = 'SCCommentObjectReactions';
49
- const classes = {
50
- root: `${PREFIX}-root`,
51
- btnViewVotes: `${PREFIX}-btnViewVotes`,
52
- votes: `${PREFIX}-votes`,
53
- groupedReactions: `${PREFIX}-grouped-reactions`,
54
- reactionAvatar: `${PREFIX}-reaction-avatar`,
55
- reactionIcon: `${PREFIX}-reaction-icon`
56
- };
57
- const Root = (0, styles_1.styled)(material_1.Box, {
58
- name: PREFIX,
59
- slot: 'Root',
60
- overridesResolver: (props, styles) => styles.root
61
- })(({ theme }) => ({}));
62
- function Reactions(inProps) {
63
- // PROPS
64
- const props = (0, system_1.useThemeProps)({
65
- props: inProps,
66
- name: PREFIX
67
- });
68
- const { className = '', commentObjectId, commentObject, reactionsList = [] } = props, rest = __rest(props, ["className", "commentObjectId", "commentObject", "reactionsList"]);
69
- // RETRIEVE OBJECTS
70
- const { obj, setObj } = (0, react_core_1.useSCFetchCommentObject)({ id: commentObjectId, commentObject });
71
- // STATE
72
- const [openVotesDialog, setOpenVotesDialog] = (0, react_1.useState)(false);
73
- /**
74
- * Open/Close dialog shares
75
- */
76
- function handleToggleReactionsDialog() {
77
- setOpenVotesDialog(!openVotesDialog);
78
- }
79
- /**
80
- * Render votes
81
- * @return {JSX.Element}
82
- */
83
- function renderReactions() {
84
- if (!reactionsList || !obj) {
85
- return null;
86
- }
87
- return (react_1.default.createElement(react_1.default.Fragment, null,
88
- react_1.default.createElement(material_1.Button, { variant: "text", size: "small", onClick: handleToggleReactionsDialog, disabled: obj.vote_count === 0, className: classes.btnViewVotes },
89
- react_1.default.createElement(react_1.default.Fragment, null, obj.vote_count <= 0 ? (react_1.default.createElement(Icon_1.default, { fontSize: "medium", sx: { marginTop: '-1px' } }, "thumb_up_off_alt")) : (react_1.default.createElement(material_1.AvatarGroup, { className: classes.groupedReactions, max: 3 },
90
- reactionsList.map((r, i) => (react_1.default.createElement(material_1.Avatar, { alt: r.reaction.label, src: r.reaction.image, key: i, className: classes.reactionAvatar }))),
91
- react_1.default.createElement(material_1.Typography, { component: 'span' }, obj.vote_count))))),
92
- openVotesDialog && obj.vote_count > 0 && (react_1.default.createElement(ReactionsDialog_1.default, { reactionsList: reactionsList, commentObject: obj, open: openVotesDialog, onClose: handleToggleReactionsDialog }))));
93
- }
94
- return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest), renderReactions()));
95
- }
96
- exports.default = Reactions;
97
- //# sourceMappingURL=Reactions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Reactions.js","sourceRoot":"","sources":["../../../../../src/components/CommentObject/Reactions/Reactions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsC;AACtC,4CAA2E;AAC3E,0DAAkE;AAElE,iDAA4C;AAC5C,8DAAsC;AACtC,wEAA6D;AAC7D,wCAA0C;AAC1C,4DAAoC;AAEpC,MAAM,MAAM,GAAG,0BAA0B,CAAC;AAE1C,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,YAAY,EAAE,GAAG,MAAM,eAAe;IACtC,KAAK,EAAE,GAAG,MAAM,QAAQ;IACxB,gBAAgB,EAAE,GAAG,MAAM,oBAAoB;IAC/C,cAAc,EAAE,GAAG,MAAM,kBAAkB;IAC3C,YAAY,EAAE,GAAG,MAAM,gBAAgB;CACxC,CAAC;AAEF,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,cAAG,EAAE;IACvB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI;CAClD,CAAC,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAyBtB,SAAwB,SAAS,CAAC,OAAuB;IACvD,QAAQ;IACR,MAAM,KAAK,GAAmB,IAAA,sBAAa,EAAC;QAC1C,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,MAAM;KACb,CAAC,CAAC;IAEH,MAAM,EAAC,SAAS,GAAG,EAAE,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,GAAG,EAAE,KAAa,KAAK,EAAb,IAAI,UAAI,KAAK,EAArF,kEAA6E,CAAQ,CAAC;IAE5F,mBAAmB;IACnB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAC,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CAAC,UAAU,GAAG,CAAC,IAAI,CACxC,8BAAC,yBAA4B,IAC3B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,GAAG,EAClB,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,2BAA2B,GACpC,CACH,CACA,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,CACL,8BAAC,IAAI,kBAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,IAAM,IAAI,GAC3D,eAAe,EAAE,CACb,CACR,CAAC;AACJ,CAAC;AAjED,4BAiEC"}
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import { SCCommentType, SCReactionType } from '@selfcommunity/types';
3
- export interface CommentObjectReactionsDialogProps {
4
- /**
5
- * Id of the comment object
6
- * @default null
7
- */
8
- commentObjectId?: number;
9
- /**
10
- * Comment object
11
- * @default null
12
- */
13
- commentObject?: SCCommentType;
14
- /**
15
- * open/close the dialog
16
- * @default false
17
- */
18
- open?: boolean;
19
- /**
20
- * Callback invoked when dialog close
21
- */
22
- onClose?: () => any;
23
- /**
24
- * The reactions added to the comment
25
- */
26
- reactionsList: SCReactionType[];
27
- }
28
- export interface TabPanelProps {
29
- children?: React.ReactNode;
30
- index: string;
31
- value: string | any;
32
- }
33
- export default function CommentObjectReactionsDialog(inProps: CommentObjectReactionsDialogProps): JSX.Element;
34
- //# sourceMappingURL=ReactionsDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactionsDialog.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CommentObject/Reactions/ReactionsDialog/ReactionsDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAC,aAAa,EAAyB,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAsB1F,MAAM,WAAW,iCAAiC;IAChD;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,cAAc,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;CACrB;AAWD,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,OAAO,EAAE,iCAAiC,GAAG,GAAG,CAAC,OAAO,CAyI5G"}
@@ -1,129 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const react_intl_1 = require("react-intl");
42
- const material_1 = require("@mui/material");
43
- const InfiniteScroll_1 = __importDefault(require("../../../../shared/InfiniteScroll"));
44
- const api_services_1 = require("@selfcommunity/api-services");
45
- const utils_1 = require("@selfcommunity/utils");
46
- const react_core_1 = require("@selfcommunity/react-core");
47
- const types_1 = require("@selfcommunity/types");
48
- const Errors_1 = require("../../../../constants/Errors");
49
- const BaseDialog_1 = __importDefault(require("../../../../shared/BaseDialog"));
50
- const CentralProgress_1 = __importDefault(require("../../../../shared/CentralProgress"));
51
- const User_1 = __importDefault(require("../../../User"));
52
- const styles_1 = require("@mui/material/styles");
53
- const system_1 = require("@mui/system");
54
- const Icon_1 = __importDefault(require("@mui/material/Icon"));
55
- const lodash_1 = __importDefault(require("lodash"));
56
- const PREFIX = 'SCCommentObjectReactionsDialog';
57
- const classes = {
58
- root: `${PREFIX}-root`
59
- };
60
- const Root = (0, styles_1.styled)(material_1.Box, {
61
- name: PREFIX,
62
- slot: 'Root',
63
- overridesResolver: (props, styles) => styles.root
64
- })({});
65
- function TabPanel(props) {
66
- const { children, value, index } = props, other = __rest(props, ["children", "value", "index"]);
67
- return (react_1.default.createElement("div", Object.assign({ hidden: value !== index, id: `tab-panel-${index}` }, other), value === index && react_1.default.createElement(react_1.default.Fragment, null, children)));
68
- }
69
- function CommentObjectReactionsDialog(inProps) {
70
- // PROPS
71
- const props = (0, system_1.useThemeProps)({
72
- props: inProps,
73
- name: PREFIX
74
- });
75
- const { commentObjectId, commentObject, open = false, onClose, reactionsList = [] } = props;
76
- // RETRIEVE OBJECTS
77
- const { obj, setObj } = (0, react_core_1.useSCFetchCommentObject)({ id: commentObjectId, commentObject });
78
- // STATE
79
- const [isLoading, setIsLoading] = (0, react_1.useState)(true);
80
- const [votes, setVotes] = (0, react_1.useState)([]);
81
- const [next, setNext] = (0, react_1.useState)(null);
82
- const [tabIndex, setTabIndex] = (0, react_1.useState)('all');
83
- const filteredVotes = lodash_1.default.groupBy(votes, (v) => v.reaction.label);
84
- // HANDLERS
85
- const handleChange = (event, newValue) => {
86
- setTabIndex(newValue);
87
- };
88
- (0, react_1.useEffect)(() => {
89
- if (obj) {
90
- fetchVotes();
91
- }
92
- }, [obj.id]);
93
- function fetchVotes() {
94
- setIsLoading(true);
95
- api_services_1.http
96
- .request({
97
- url: next ? next : `${api_services_1.Endpoints.VotesList.url({ type: types_1.SCCommentTypologyType, id: obj.id })}`,
98
- method: api_services_1.Endpoints.VotesList.method
99
- })
100
- .then((res) => {
101
- const data = res.data;
102
- setVotes([...data.results, ...votes]);
103
- setIsLoading(false);
104
- setNext(data.next !== null ? data.next : null);
105
- })
106
- .catch((error) => {
107
- utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
108
- });
109
- }
110
- return (react_1.default.createElement(BaseDialog_1.default, { title: react_1.default.createElement(material_1.Tabs, { value: tabIndex, onChange: handleChange, variant: "scrollable", scrollButtons: true, allowScrollButtonsMobile: true },
111
- react_1.default.createElement(material_1.Tab, { value: 'all', label: react_1.default.createElement(react_intl_1.FormattedMessage, { defaultMessage: "ui.commentObjectReactionsDialog.title", id: "ui.commentObjectReactionsDialog.title" }) }),
112
- reactionsList.map((r, index) => (react_1.default.createElement(material_1.Tab, { icon: react_1.default.createElement(Icon_1.default, null,
113
- react_1.default.createElement("img", { alt: r.reaction.label, src: r.reaction.image, width: 20, height: 20 })), iconPosition: "start", label: r.count, key: index, value: r.reaction.label })))), onClose: onClose, open: open }, isLoading ? (react_1.default.createElement(CentralProgress_1.default, { size: 50 })) : (react_1.default.createElement(react_1.default.Fragment, null,
114
- react_1.default.createElement(TabPanel, { value: 'all', index: tabIndex },
115
- react_1.default.createElement(InfiniteScroll_1.default, { dataLength: votes.length, next: fetchVotes, hasMoreNext: Boolean(next), loaderNext: react_1.default.createElement(CentralProgress_1.default, { size: 30 }), height: 400, endMessage: react_1.default.createElement("p", { style: { textAlign: 'center' } },
116
- react_1.default.createElement("b", null,
117
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.commentObjectReactionsDialog.noOtherLikes", defaultMessage: "ui.commentObjectReactionsDialog.noOtherLikes" }))) },
118
- react_1.default.createElement(material_1.List, null, votes.map((vote, index) => (react_1.default.createElement(material_1.ListItem, { key: index },
119
- react_1.default.createElement(User_1.default, { elevation: 0, user: vote.user, key: index, sx: { m: 0 }, showReaction: true, reaction: vote.reaction }))))))),
120
- Object.keys(filteredVotes).map((key, index) => (react_1.default.createElement(react_1.default.Fragment, { key: index },
121
- react_1.default.createElement(TabPanel, { value: key, index: tabIndex },
122
- react_1.default.createElement(InfiniteScroll_1.default, { dataLength: votes.length, next: fetchVotes, hasMoreNext: Boolean(next), loaderNext: react_1.default.createElement(CentralProgress_1.default, { size: 30 }), height: 400, endMessage: react_1.default.createElement("p", { style: { textAlign: 'center' } },
123
- react_1.default.createElement("b", null,
124
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.commentObjectReactionsDialog.noOtherLikes", defaultMessage: "ui.commentObjectReactionsDialog.noOtherLikes" }))) },
125
- react_1.default.createElement(material_1.List, null, filteredVotes[key].map((vote, index) => (react_1.default.createElement(material_1.ListItem, { key: index },
126
- react_1.default.createElement(User_1.default, { elevation: 0, user: vote.user, key: index, sx: { m: 0 }, showReaction: true, reaction: vote.reaction }))))))))))))));
127
- }
128
- exports.default = CommentObjectReactionsDialog;
129
- //# sourceMappingURL=ReactionsDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactionsDialog.js","sourceRoot":"","sources":["../../../../../../src/components/CommentObject/Reactions/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AAE,GAAG,EAAE,KAAK,EAAE,QAAQ;gBACnC,8BAAC,wBAAc,IACb,UAAU,EAAE,KAAK,CAAC,MAAM,EACxB,IAAI,EAAE,UAAU,EAChB,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,EAC1B,UAAU,EAAE,8BAAC,yBAAe,IAAC,IAAI,EAAE,EAAE,GAAI,EACzC,MAAM,EAAE,GAAG,EACX,UAAU,EACR,qCAAG,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC;wBAC7B;4BACE,8BAAC,6BAAgB,IACf,EAAE,EAAC,8CAA8C,EACjD,cAAc,EAAC,8CAA8C,GAC7D,CACA,CACF;oBAEN,8BAAC,eAAI,QACF,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACvC,8BAAC,mBAAQ,IAAC,GAAG,EAAE,KAAK;wBAClB,8BAAC,cAAI,IAAC,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,CACnG,CACZ,CAAC,CACG,CACQ,CACR,CACI,CAClB,CAAC,CACD,CACJ,CACU,CACd,CAAC;AACJ,CAAC;AAzID,+CAyIC"}
@@ -1,4 +0,0 @@
1
- import CommentObjectReactionsDialog, { CommentObjectReactionsDialogProps } from './ReactionsDialog';
2
- export default CommentObjectReactionsDialog;
3
- export { CommentObjectReactionsDialogProps };
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CommentObject/Reactions/ReactionsDialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,EAAE,EAAC,iCAAiC,EAAC,MAAM,mBAAmB,CAAC;AAClG,eAAe,4BAA4B,CAAC;AAC5C,OAAO,EAAC,iCAAiC,EAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/CommentObject/Reactions/ReactionsDialog/index.tsx"],"names":[],"mappings":";;;;;AAAA,wEAAkG;AAClG,kBAAe,yBAA4B,CAAC"}
@@ -1,4 +0,0 @@
1
- import Reactions, { ReactionsProps } from './Reactions';
2
- export default Reactions;
3
- export { ReactionsProps };
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CommentObject/Reactions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AACtD,eAAe,SAAS,CAAC;AACzB,OAAO,EAAC,cAAc,EAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Reactions_1 = __importDefault(require("./Reactions"));
7
- exports.default = Reactions_1.default;
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/CommentObject/Reactions/index.tsx"],"names":[],"mappings":";;;;;AAAA,4DAAsD;AACtD,kBAAe,mBAAS,CAAC"}
@@ -1,19 +0,0 @@
1
- import { SCCommentType } from '@selfcommunity/types';
2
- export interface VotesProps {
3
- /**
4
- * Id of the comment object
5
- * @default null
6
- */
7
- commentObjectId?: number;
8
- /**
9
- * Comment object
10
- * @default null
11
- */
12
- commentObject?: SCCommentType;
13
- /**
14
- * Other props
15
- */
16
- [p: string]: any;
17
- }
18
- export default function Votes(inProps: VotesProps): JSX.Element;
19
- //# sourceMappingURL=Votes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Votes.d.ts","sourceRoot":"","sources":["../../../../../src/components/CommentObject/Votes/Votes.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAqBnD,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CA0D9D"}
@@ -1,93 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
- var __importDefault = (this && this.__importDefault) || function (mod) {
37
- return (mod && mod.__esModule) ? mod : { "default": mod };
38
- };
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- const react_1 = __importStar(require("react"));
41
- const material_1 = require("@mui/material");
42
- const react_core_1 = require("@selfcommunity/react-core");
43
- const styles_1 = require("@mui/material/styles");
44
- const Icon_1 = __importDefault(require("@mui/material/Icon"));
45
- const VotesDialog_1 = __importDefault(require("./VotesDialog"));
46
- const system_1 = require("@mui/system");
47
- const classnames_1 = __importDefault(require("classnames"));
48
- const PREFIX = 'SCCommentObjectVotes';
49
- const classes = {
50
- root: `${PREFIX}-root`,
51
- btnViewVotes: `${PREFIX}-btnViewVotes`,
52
- votes: `${PREFIX}-votes`
53
- };
54
- const Root = (0, styles_1.styled)(material_1.Box, {
55
- name: PREFIX,
56
- slot: 'Root',
57
- overridesResolver: (props, styles) => styles.root
58
- })(({ theme }) => ({}));
59
- function Votes(inProps) {
60
- // PROPS
61
- const props = (0, system_1.useThemeProps)({
62
- props: inProps,
63
- name: PREFIX
64
- });
65
- const { className = '', commentObjectId, commentObject } = props, rest = __rest(props, ["className", "commentObjectId", "commentObject"]);
66
- // RETRIEVE OBJECTS
67
- const { obj, setObj } = (0, react_core_1.useSCFetchCommentObject)({ id: commentObjectId, commentObject });
68
- // STATE
69
- const [openVotesDialog, setOpenVotesDialog] = (0, react_1.useState)(false);
70
- /**
71
- * Open/Close dialog shares
72
- */
73
- function handleToggleSharesDialog() {
74
- setOpenVotesDialog(!openVotesDialog);
75
- }
76
- /**
77
- * Render votes
78
- * @return {JSX.Element}
79
- */
80
- function renderVotes() {
81
- if (!obj) {
82
- return null;
83
- }
84
- return (react_1.default.createElement(react_1.default.Fragment, null,
85
- react_1.default.createElement(material_1.Button, { variant: "text", size: "small", disabled: obj.vote_count <= 0, className: classes.btnViewVotes, onClick: handleToggleSharesDialog },
86
- obj.voted ? (react_1.default.createElement(Icon_1.default, { fontSize: "medium", color: "primary", className: classes.votes }, "thumb_up_alt")) : (react_1.default.createElement(Icon_1.default, { fontSize: "medium", sx: { marginTop: '-1px' } }, "thumb_up_off_alt")),
87
- react_1.default.createElement(material_1.Typography, { variant: 'body2', sx: { marginLeft: '5px' } }, obj.vote_count)),
88
- openVotesDialog && obj.vote_count > 0 && (react_1.default.createElement(VotesDialog_1.default, { commentObject: obj, open: openVotesDialog, onClose: handleToggleSharesDialog }))));
89
- }
90
- return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest), renderVotes()));
91
- }
92
- exports.default = Votes;
93
- //# sourceMappingURL=Votes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Votes.js","sourceRoot":"","sources":["../../../../../src/components/CommentObject/Votes/Votes.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsC;AACtC,4CAAsD;AACtD,0DAAkE;AAElE,iDAA4C;AAC5C,8DAAsC;AACtC,gEAAqD;AACrD,wCAA0C;AAC1C,4DAAoC;AAEpC,MAAM,MAAM,GAAG,sBAAsB,CAAC;AAEtC,MAAM,OAAO,GAAG;IACd,IAAI,EAAE,GAAG,MAAM,OAAO;IACtB,YAAY,EAAE,GAAG,MAAM,eAAe;IACtC,KAAK,EAAE,GAAG,MAAM,QAAQ;CACzB,CAAC;AAEF,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,cAAG,EAAE;IACvB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI;CAClD,CAAC,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC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AE,EAAE,EAAC,UAAU,EAAE,KAAK,EAAC,IAClD,GAAG,CAAC,UAAU,CACJ,CACN;YACR,eAAe,IAAI,GAAG,CAAC,UAAU,GAAG,CAAC,IAAI,CACxC,8BAAC,qBAAwB,IAAC,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,wBAAwB,GAAI,CAC3G,CACA,CACJ,CAAC;IACJ,CAAC;IAED,OAAO,CACL,8BAAC,IAAI,kBAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,IAAM,IAAI,GAC3D,WAAW,EAAE,CACT,CACR,CAAC;AACJ,CAAC;AA1DD,wBA0DC"}
@@ -1,24 +0,0 @@
1
- import { SCCommentType } from '@selfcommunity/types';
2
- export interface CommentObjectVotesDialogProps {
3
- /**
4
- * Id of the comment object
5
- * @default null
6
- */
7
- commentObjectId?: number;
8
- /**
9
- * Comment object
10
- * @default null
11
- */
12
- commentObject?: SCCommentType;
13
- /**
14
- * open/close the dialog
15
- * @default false
16
- */
17
- open?: boolean;
18
- /**
19
- * Callback invoked when dialog close
20
- */
21
- onClose?: () => any;
22
- }
23
- export default function CommentObjectVotesDialog(inProps: CommentObjectVotesDialogProps): JSX.Element;
24
- //# sourceMappingURL=VotesDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VotesDialog.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CommentObject/Votes/VotesDialog/VotesDialog.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAC,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAoB1E,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,OAAO,EAAE,6BAA6B,GAAG,GAAG,CAAC,OAAO,CAyEpG"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- const react_1 = __importStar(require("react"));
30
- const react_intl_1 = require("react-intl");
31
- const material_1 = require("@mui/material");
32
- const InfiniteScroll_1 = __importDefault(require("../../../../shared/InfiniteScroll"));
33
- const Typography_1 = __importDefault(require("@mui/material/Typography"));
34
- const api_services_1 = require("@selfcommunity/api-services");
35
- const utils_1 = require("@selfcommunity/utils");
36
- const react_core_1 = require("@selfcommunity/react-core");
37
- const types_1 = require("@selfcommunity/types");
38
- const Errors_1 = require("../../../../constants/Errors");
39
- const BaseDialog_1 = __importDefault(require("../../../../shared/BaseDialog"));
40
- const CentralProgress_1 = __importDefault(require("../../../../shared/CentralProgress"));
41
- const User_1 = __importDefault(require("../../../User"));
42
- const styles_1 = require("@mui/material/styles");
43
- const system_1 = require("@mui/system");
44
- const PREFIX = 'SCCommentObjectVotesDialog';
45
- const classes = {
46
- root: `${PREFIX}-root`
47
- };
48
- const Root = (0, styles_1.styled)(material_1.Box, {
49
- name: PREFIX,
50
- slot: 'Root',
51
- overridesResolver: (props, styles) => styles.root
52
- })({});
53
- function CommentObjectVotesDialog(inProps) {
54
- // PROPS
55
- const props = (0, system_1.useThemeProps)({
56
- props: inProps,
57
- name: PREFIX
58
- });
59
- const { commentObjectId, commentObject, open = false, onClose } = props;
60
- // RETRIEVE OBJECTS
61
- const { obj, setObj } = (0, react_core_1.useSCFetchCommentObject)({ id: commentObjectId, commentObject });
62
- // STATE
63
- const [isLoading, setIsLoading] = (0, react_1.useState)(true);
64
- const [votes, setVotes] = (0, react_1.useState)([]);
65
- const [next, setNext] = (0, react_1.useState)(null);
66
- (0, react_1.useEffect)(() => {
67
- if (obj) {
68
- fetchVotes();
69
- }
70
- }, [obj.id]);
71
- function fetchVotes() {
72
- setIsLoading(true);
73
- api_services_1.http
74
- .request({
75
- url: next ? next : `${api_services_1.Endpoints.VotesList.url({ type: types_1.SCCommentTypologyType, id: obj.id })}`,
76
- method: api_services_1.Endpoints.VotesList.method
77
- })
78
- .then((res) => {
79
- const data = res.data;
80
- setVotes([...data.results, ...votes]);
81
- setIsLoading(false);
82
- setNext(data.next !== null ? data.next : null);
83
- })
84
- .catch((error) => {
85
- utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
86
- });
87
- }
88
- return (react_1.default.createElement(BaseDialog_1.default, { title: react_1.default.createElement(react_intl_1.FormattedMessage, { defaultMessage: "ui.commentObjectVotesDialog.title", id: "ui.commentObjectVotesDialog.title" }), onClose: onClose, open: open }, isLoading ? (react_1.default.createElement(CentralProgress_1.default, { size: 50 })) : (react_1.default.createElement(InfiniteScroll_1.default, { dataLength: votes.length, next: fetchVotes, hasMoreNext: next !== null, loaderNext: react_1.default.createElement(CentralProgress_1.default, { size: 30 }), height: 400, endMessage: react_1.default.createElement(Typography_1.default, { variant: "body2", align: "center" },
89
- react_1.default.createElement("b", null,
90
- react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.commentObjectVotesDialog.noOtherVotes", defaultMessage: "ui.commentObjectVotesDialog.noOtherVotes" }))) },
91
- react_1.default.createElement(material_1.List, null, votes.slice(0, 4).map((like, index) => (react_1.default.createElement(material_1.ListItem, { key: index },
92
- react_1.default.createElement(User_1.default, { elevation: 0, user: like.user, key: index })))))))));
93
- }
94
- exports.default = CommentObjectVotesDialog;
95
- //# sourceMappingURL=VotesDialog.js.map