@selfcommunity/react-ui 0.7.0-alpha.334 → 0.7.0-alpha.336

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 (320) hide show
  1. package/lib/cjs/components/BottomNavigation/BottomNavigation.js +8 -11
  2. package/lib/cjs/components/BroadcastMessages/Message.js +14 -5
  3. package/lib/cjs/components/CommentsObject/CommentsObject.js +1 -22
  4. package/lib/cjs/components/Composer/Attributes/Attributes.d.ts +22 -0
  5. package/lib/cjs/components/Composer/Attributes/Attributes.js +41 -0
  6. package/lib/cjs/components/Composer/Attributes/index.d.ts +3 -0
  7. package/lib/cjs/components/Composer/{Poll → Attributes}/index.js +2 -2
  8. package/lib/cjs/components/Composer/Composer.d.ts +53 -84
  9. package/lib/cjs/components/Composer/Composer.js +249 -443
  10. package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.d.ts +32 -0
  11. package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +53 -0
  12. package/lib/cjs/components/Composer/Content/ContentDiscussion/index.d.ts +3 -0
  13. package/lib/cjs/components/Composer/Content/ContentDiscussion/index.js +5 -0
  14. package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.d.ts +26 -0
  15. package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +129 -0
  16. package/lib/cjs/components/Composer/Content/ContentPoll/index.d.ts +3 -0
  17. package/lib/cjs/components/Composer/Content/ContentPoll/index.js +5 -0
  18. package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.d.ts +32 -0
  19. package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +51 -0
  20. package/lib/cjs/components/Composer/Content/ContentPost/index.d.ts +3 -0
  21. package/lib/cjs/components/Composer/Content/ContentPost/index.js +5 -0
  22. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +11 -0
  23. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +74 -0
  24. package/lib/cjs/components/Composer/Layer/AudienceLayer/index.d.ts +3 -0
  25. package/lib/cjs/components/Composer/Layer/AudienceLayer/index.js +5 -0
  26. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +9 -0
  27. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +41 -0
  28. package/lib/cjs/components/Composer/Layer/CategoryLayer/index.d.ts +3 -0
  29. package/lib/cjs/components/Composer/Layer/CategoryLayer/index.js +5 -0
  30. package/lib/cjs/components/Composer/Layer/CloseLayer/CloseLayer.d.ts +7 -0
  31. package/lib/cjs/components/Composer/Layer/CloseLayer/CloseLayer.js +41 -0
  32. package/lib/cjs/components/Composer/Layer/CloseLayer/index.d.ts +3 -0
  33. package/lib/cjs/components/Composer/{Audience → Layer/CloseLayer}/index.js +2 -2
  34. package/lib/cjs/components/Composer/Layer/LocationLayer/LocationLayer.d.ts +9 -0
  35. package/lib/cjs/components/Composer/Layer/LocationLayer/LocationLayer.js +41 -0
  36. package/lib/cjs/components/Composer/Layer/LocationLayer/index.d.ts +3 -0
  37. package/lib/cjs/components/Composer/Layer/LocationLayer/index.js +5 -0
  38. package/lib/cjs/components/Composer/Skeleton.d.ts +0 -4
  39. package/lib/cjs/components/Composer/Skeleton.js +10 -72
  40. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.d.ts +6 -0
  41. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +47 -0
  42. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/index.d.ts +3 -0
  43. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/index.js +5 -0
  44. package/lib/cjs/components/Composer/constants.d.ts +1 -0
  45. package/lib/cjs/components/Composer/constants.js +4 -0
  46. package/lib/cjs/components/Composer/index.d.ts +2 -3
  47. package/lib/cjs/components/Composer/index.js +1 -6
  48. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.d.ts +2 -1
  49. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +8 -8
  50. package/lib/cjs/components/Editor/Editor.js +14 -5
  51. package/lib/cjs/components/Feed/prefetchedData.d.ts +2 -368
  52. package/lib/cjs/components/Feed/prefetchedData.js +17 -16
  53. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +2 -2
  54. package/lib/cjs/components/FeedObject/FeedObject.d.ts +2 -2
  55. package/lib/cjs/components/FeedObject/FeedObject.js +8 -7
  56. package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.d.ts +38 -0
  57. package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +66 -0
  58. package/lib/cjs/components/FeedObjectMediaPreview/index.d.ts +3 -0
  59. package/lib/cjs/components/FeedObjectMediaPreview/index.js +5 -0
  60. package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.d.ts +25 -33
  61. package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +34 -67
  62. package/lib/cjs/components/InlineComposerWidget/Skeleton.d.ts +4 -5
  63. package/lib/cjs/components/InlineComposerWidget/Skeleton.js +17 -37
  64. package/lib/cjs/components/InlineComposerWidget/constants.d.ts +1 -0
  65. package/lib/cjs/components/InlineComposerWidget/constants.js +4 -0
  66. package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.d.ts +2 -2
  67. package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.js +4 -2
  68. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +1 -1
  69. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +0 -5
  70. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +19 -30
  71. package/lib/cjs/components/NavigationToolbarMobile/Skeleton.js +5 -6
  72. package/lib/cjs/components/NavigationToolbarMobile/constants.d.ts +1 -0
  73. package/lib/cjs/components/NavigationToolbarMobile/constants.js +4 -0
  74. package/lib/cjs/constants/Composer.d.ts +2 -0
  75. package/lib/cjs/constants/Composer.js +4 -2
  76. package/lib/cjs/index.d.ts +12 -12
  77. package/lib/cjs/index.js +14 -17
  78. package/lib/cjs/shared/Lightbox/Lightbox.js +2 -2
  79. package/lib/{esm/shared/Media/Image/PreviewComponent.d.ts → cjs/shared/Media/File/DisplayComponent.d.ts} +1 -11
  80. package/lib/cjs/shared/Media/{Image/PreviewComponent.js → File/DisplayComponent.js} +55 -145
  81. package/lib/{esm/shared/Media/Image/PreviewImage → cjs/shared/Media/File/Lightbox}/index.d.ts +4 -3
  82. package/lib/cjs/shared/Media/File/Lightbox/index.js +37 -0
  83. package/lib/cjs/shared/Media/File/PreviewComponent.d.ts +9 -0
  84. package/lib/cjs/shared/Media/File/PreviewComponent.js +51 -0
  85. package/lib/cjs/shared/Media/File/TriggerButton.d.ts +12 -0
  86. package/lib/cjs/shared/Media/File/TriggerButton.js +112 -0
  87. package/lib/cjs/shared/Media/File/asUploadButton.d.ts +7 -0
  88. package/lib/cjs/shared/Media/File/asUploadButton.js +30 -0
  89. package/lib/cjs/shared/Media/File/constants.d.ts +1 -0
  90. package/lib/cjs/shared/Media/File/constants.js +4 -0
  91. package/lib/cjs/shared/Media/File/filter.d.ts +3 -0
  92. package/lib/cjs/shared/Media/File/filter.js +4 -0
  93. package/lib/cjs/shared/Media/File/index.d.ts +3 -0
  94. package/lib/cjs/shared/Media/File/index.js +16 -0
  95. package/lib/cjs/shared/Media/Link/DisplayComponent.d.ts +20 -0
  96. package/lib/cjs/shared/Media/Link/DisplayComponent.js +69 -0
  97. package/lib/cjs/shared/Media/Link/LayerComponent.d.ts +9 -0
  98. package/lib/cjs/shared/Media/Link/LayerComponent.js +46 -0
  99. package/lib/cjs/shared/Media/Link/PreviewComponent.d.ts +7 -21
  100. package/lib/cjs/shared/Media/Link/PreviewComponent.js +28 -56
  101. package/lib/cjs/shared/Media/Link/TriggerButton.d.ts +4 -0
  102. package/lib/cjs/shared/Media/Link/TriggerButton.js +21 -0
  103. package/lib/cjs/shared/Media/Link/UrlTextField/index.js +1 -2
  104. package/lib/cjs/shared/Media/Link/constants.d.ts +1 -0
  105. package/lib/cjs/shared/Media/Link/constants.js +4 -0
  106. package/lib/cjs/shared/Media/Link/filter.d.ts +3 -0
  107. package/lib/cjs/shared/Media/Link/filter.js +4 -0
  108. package/lib/cjs/shared/Media/Link/index.js +9 -8
  109. package/lib/cjs/shared/Media/Share/DisplayComponent.d.ts +11 -0
  110. package/lib/cjs/shared/Media/Share/DisplayComponent.js +31 -0
  111. package/lib/cjs/shared/Media/Share/constants.d.ts +1 -0
  112. package/lib/cjs/shared/Media/Share/constants.js +4 -0
  113. package/lib/cjs/shared/Media/Share/filter.d.ts +3 -0
  114. package/lib/cjs/shared/Media/Share/filter.js +4 -0
  115. package/lib/cjs/shared/Media/Share/index.js +7 -7
  116. package/lib/cjs/shared/Media/index.d.ts +2 -4
  117. package/lib/cjs/shared/Media/index.js +3 -7
  118. package/lib/cjs/types/composer.d.ts +15 -0
  119. package/lib/cjs/types/composer.js +2 -0
  120. package/lib/cjs/types/media.d.ts +9 -5
  121. package/lib/esm/components/BottomNavigation/BottomNavigation.js +8 -11
  122. package/lib/esm/components/BroadcastMessages/Message.js +14 -5
  123. package/lib/esm/components/CommentsObject/CommentsObject.js +1 -22
  124. package/lib/esm/components/Composer/Attributes/Attributes.d.ts +22 -0
  125. package/lib/esm/components/Composer/Attributes/Attributes.js +38 -0
  126. package/lib/esm/components/Composer/Attributes/index.d.ts +3 -0
  127. package/lib/esm/components/Composer/Attributes/index.js +2 -0
  128. package/lib/esm/components/Composer/Composer.d.ts +53 -84
  129. package/lib/esm/components/Composer/Composer.js +246 -439
  130. package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.d.ts +32 -0
  131. package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +50 -0
  132. package/lib/esm/components/Composer/Content/ContentDiscussion/index.d.ts +3 -0
  133. package/lib/esm/components/Composer/Content/ContentDiscussion/index.js +2 -0
  134. package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.d.ts +26 -0
  135. package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +127 -0
  136. package/lib/esm/components/Composer/Content/ContentPoll/index.d.ts +3 -0
  137. package/lib/esm/components/Composer/Content/ContentPoll/index.js +2 -0
  138. package/lib/esm/components/Composer/Content/ContentPost/ContentPost.d.ts +32 -0
  139. package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +49 -0
  140. package/lib/esm/components/Composer/Content/ContentPost/index.d.ts +3 -0
  141. package/lib/esm/components/Composer/Content/ContentPost/index.js +2 -0
  142. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +11 -0
  143. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +72 -0
  144. package/lib/esm/components/Composer/Layer/AudienceLayer/index.d.ts +3 -0
  145. package/lib/esm/components/Composer/Layer/AudienceLayer/index.js +2 -0
  146. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +9 -0
  147. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +39 -0
  148. package/lib/esm/components/Composer/Layer/CategoryLayer/index.d.ts +3 -0
  149. package/lib/esm/components/Composer/Layer/CategoryLayer/index.js +2 -0
  150. package/lib/esm/components/Composer/Layer/CloseLayer/CloseLayer.d.ts +7 -0
  151. package/lib/esm/components/Composer/Layer/CloseLayer/CloseLayer.js +39 -0
  152. package/lib/esm/components/Composer/Layer/CloseLayer/index.d.ts +3 -0
  153. package/lib/esm/components/Composer/Layer/CloseLayer/index.js +2 -0
  154. package/lib/esm/components/Composer/Layer/LocationLayer/LocationLayer.d.ts +9 -0
  155. package/lib/esm/components/Composer/Layer/LocationLayer/LocationLayer.js +39 -0
  156. package/lib/esm/components/Composer/Layer/LocationLayer/index.d.ts +3 -0
  157. package/lib/esm/components/Composer/Layer/LocationLayer/index.js +2 -0
  158. package/lib/esm/components/Composer/Skeleton.d.ts +0 -4
  159. package/lib/esm/components/Composer/Skeleton.js +6 -68
  160. package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.d.ts +6 -0
  161. package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +44 -0
  162. package/lib/esm/components/Composer/TypeSwitchButtonGroup/index.d.ts +3 -0
  163. package/lib/esm/components/Composer/TypeSwitchButtonGroup/index.js +2 -0
  164. package/lib/esm/components/Composer/constants.d.ts +1 -0
  165. package/lib/esm/components/Composer/constants.js +1 -0
  166. package/lib/esm/components/Composer/index.d.ts +2 -3
  167. package/lib/esm/components/Composer/index.js +1 -3
  168. package/lib/esm/components/ComposerIconButton/ComposerIconButton.d.ts +2 -1
  169. package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +8 -8
  170. package/lib/esm/components/Editor/Editor.js +16 -7
  171. package/lib/esm/components/Feed/Feed.js +4 -4
  172. package/lib/esm/components/Feed/prefetchedData.d.ts +2 -368
  173. package/lib/esm/components/Feed/prefetchedData.js +17 -16
  174. package/lib/esm/components/FeedObject/Actions/Share/Share.js +4 -4
  175. package/lib/esm/components/FeedObject/FeedObject.d.ts +2 -2
  176. package/lib/esm/components/FeedObject/FeedObject.js +11 -10
  177. package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.d.ts +38 -0
  178. package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +64 -0
  179. package/lib/esm/components/FeedObjectMediaPreview/index.d.ts +3 -0
  180. package/lib/esm/components/FeedObjectMediaPreview/index.js +2 -0
  181. package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.d.ts +25 -33
  182. package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +31 -64
  183. package/lib/esm/components/InlineComposerWidget/Skeleton.d.ts +4 -5
  184. package/lib/esm/components/InlineComposerWidget/Skeleton.js +15 -35
  185. package/lib/esm/components/InlineComposerWidget/constants.d.ts +1 -0
  186. package/lib/esm/components/InlineComposerWidget/constants.js +1 -0
  187. package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.d.ts +2 -2
  188. package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.js +4 -2
  189. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +1 -1
  190. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +1 -1
  191. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +0 -5
  192. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +12 -23
  193. package/lib/esm/components/NavigationToolbarMobile/Skeleton.js +3 -4
  194. package/lib/esm/components/NavigationToolbarMobile/constants.d.ts +1 -0
  195. package/lib/esm/components/NavigationToolbarMobile/constants.js +1 -0
  196. package/lib/esm/constants/Composer.d.ts +2 -0
  197. package/lib/esm/constants/Composer.js +3 -1
  198. package/lib/esm/index.d.ts +12 -12
  199. package/lib/esm/index.js +33 -33
  200. package/lib/esm/shared/Lightbox/Lightbox.js +2 -2
  201. package/lib/{cjs/shared/Media/Image/PreviewComponent.d.ts → esm/shared/Media/File/DisplayComponent.d.ts} +1 -11
  202. package/lib/esm/shared/Media/{Image/PreviewComponent.js → File/DisplayComponent.js} +50 -140
  203. package/lib/{cjs/shared/Media/Image/PreviewImage → esm/shared/Media/File/Lightbox}/index.d.ts +4 -3
  204. package/lib/esm/shared/Media/File/Lightbox/index.js +34 -0
  205. package/lib/esm/shared/Media/File/PreviewComponent.d.ts +9 -0
  206. package/lib/esm/shared/Media/File/PreviewComponent.js +49 -0
  207. package/lib/esm/shared/Media/File/TriggerButton.d.ts +12 -0
  208. package/lib/esm/shared/Media/File/TriggerButton.js +110 -0
  209. package/lib/esm/shared/Media/File/asUploadButton.d.ts +7 -0
  210. package/lib/esm/shared/Media/File/asUploadButton.js +28 -0
  211. package/lib/esm/shared/Media/File/constants.d.ts +1 -0
  212. package/lib/esm/shared/Media/File/constants.js +1 -0
  213. package/lib/esm/shared/Media/File/filter.d.ts +3 -0
  214. package/lib/esm/shared/Media/File/filter.js +2 -0
  215. package/lib/esm/shared/Media/File/index.d.ts +3 -0
  216. package/lib/esm/shared/Media/File/index.js +13 -0
  217. package/lib/esm/shared/Media/Link/DisplayComponent.d.ts +20 -0
  218. package/lib/esm/shared/Media/Link/DisplayComponent.js +67 -0
  219. package/lib/esm/shared/Media/Link/LayerComponent.d.ts +9 -0
  220. package/lib/esm/shared/Media/Link/LayerComponent.js +44 -0
  221. package/lib/esm/shared/Media/Link/PreviewComponent.d.ts +7 -21
  222. package/lib/esm/shared/Media/Link/PreviewComponent.js +27 -54
  223. package/lib/esm/shared/Media/Link/TriggerButton.d.ts +4 -0
  224. package/lib/esm/shared/Media/Link/TriggerButton.js +19 -0
  225. package/lib/esm/shared/Media/Link/UrlTextField/index.js +2 -3
  226. package/lib/esm/shared/Media/Link/constants.d.ts +1 -0
  227. package/lib/esm/shared/Media/Link/constants.js +1 -0
  228. package/lib/esm/shared/Media/Link/filter.d.ts +3 -0
  229. package/lib/esm/shared/Media/Link/filter.js +2 -0
  230. package/lib/esm/shared/Media/Link/index.js +9 -8
  231. package/lib/esm/shared/Media/Share/DisplayComponent.d.ts +11 -0
  232. package/lib/esm/shared/Media/Share/DisplayComponent.js +29 -0
  233. package/lib/esm/shared/Media/Share/constants.d.ts +1 -0
  234. package/lib/esm/shared/Media/Share/constants.js +1 -0
  235. package/lib/esm/shared/Media/Share/filter.d.ts +3 -0
  236. package/lib/esm/shared/Media/Share/filter.js +2 -0
  237. package/lib/esm/shared/Media/Share/index.js +7 -7
  238. package/lib/esm/shared/Media/index.d.ts +2 -4
  239. package/lib/esm/shared/Media/index.js +2 -4
  240. package/lib/esm/types/composer.d.ts +15 -0
  241. package/lib/esm/types/composer.js +1 -0
  242. package/lib/esm/types/media.d.ts +9 -5
  243. package/lib/umd/react-ui.js +1 -1
  244. package/package.json +7 -7
  245. package/lib/cjs/components/Composer/Audience/Audience.d.ts +0 -71
  246. package/lib/cjs/components/Composer/Audience/Audience.js +0 -69
  247. package/lib/cjs/components/Composer/Audience/index.d.ts +0 -3
  248. package/lib/cjs/components/Composer/Poll/Poll.d.ts +0 -31
  249. package/lib/cjs/components/Composer/Poll/Poll.js +0 -151
  250. package/lib/cjs/components/Composer/Poll/index.d.ts +0 -3
  251. package/lib/cjs/shared/Media/Document/EditButton.d.ts +0 -2
  252. package/lib/cjs/shared/Media/Document/EditButton.js +0 -10
  253. package/lib/cjs/shared/Media/Document/EditComponent.d.ts +0 -3
  254. package/lib/cjs/shared/Media/Document/EditComponent.js +0 -103
  255. package/lib/cjs/shared/Media/Document/PreviewComponent.d.ts +0 -3
  256. package/lib/cjs/shared/Media/Document/PreviewComponent.js +0 -43
  257. package/lib/cjs/shared/Media/Document/index.d.ts +0 -3
  258. package/lib/cjs/shared/Media/Document/index.js +0 -16
  259. package/lib/cjs/shared/Media/Image/EditButton.d.ts +0 -2
  260. package/lib/cjs/shared/Media/Image/EditButton.js +0 -10
  261. package/lib/cjs/shared/Media/Image/EditComponent.d.ts +0 -3
  262. package/lib/cjs/shared/Media/Image/EditComponent.js +0 -102
  263. package/lib/cjs/shared/Media/Image/PreviewImage/index.js +0 -41
  264. package/lib/cjs/shared/Media/Image/index.d.ts +0 -3
  265. package/lib/cjs/shared/Media/Image/index.js +0 -16
  266. package/lib/cjs/shared/Media/Link/EditButton.d.ts +0 -2
  267. package/lib/cjs/shared/Media/Link/EditButton.js +0 -10
  268. package/lib/cjs/shared/Media/Link/EditComponent.d.ts +0 -3
  269. package/lib/cjs/shared/Media/Link/EditComponent.js +0 -46
  270. package/lib/cjs/shared/Media/Share/PreviewComponent.d.ts +0 -7
  271. package/lib/cjs/shared/Media/Share/PreviewComponent.js +0 -32
  272. package/lib/cjs/shared/Media/Video/EditButton.d.ts +0 -2
  273. package/lib/cjs/shared/Media/Video/EditButton.js +0 -10
  274. package/lib/cjs/shared/Media/Video/EditComponent.d.ts +0 -3
  275. package/lib/cjs/shared/Media/Video/EditComponent.js +0 -89
  276. package/lib/cjs/shared/Media/Video/PreviewComponent.d.ts +0 -19
  277. package/lib/cjs/shared/Media/Video/PreviewComponent.js +0 -37
  278. package/lib/cjs/shared/Media/Video/index.d.ts +0 -3
  279. package/lib/cjs/shared/Media/Video/index.js +0 -16
  280. package/lib/cjs/shared/MediasPreview/index.d.ts +0 -18
  281. package/lib/cjs/shared/MediasPreview/index.js +0 -44
  282. package/lib/esm/components/Composer/Audience/Audience.d.ts +0 -71
  283. package/lib/esm/components/Composer/Audience/Audience.js +0 -66
  284. package/lib/esm/components/Composer/Audience/index.d.ts +0 -3
  285. package/lib/esm/components/Composer/Audience/index.js +0 -2
  286. package/lib/esm/components/Composer/Poll/Poll.d.ts +0 -31
  287. package/lib/esm/components/Composer/Poll/Poll.js +0 -149
  288. package/lib/esm/components/Composer/Poll/index.d.ts +0 -3
  289. package/lib/esm/components/Composer/Poll/index.js +0 -2
  290. package/lib/esm/shared/Media/Document/EditButton.d.ts +0 -2
  291. package/lib/esm/shared/Media/Document/EditButton.js +0 -7
  292. package/lib/esm/shared/Media/Document/EditComponent.d.ts +0 -3
  293. package/lib/esm/shared/Media/Document/EditComponent.js +0 -101
  294. package/lib/esm/shared/Media/Document/PreviewComponent.d.ts +0 -3
  295. package/lib/esm/shared/Media/Document/PreviewComponent.js +0 -41
  296. package/lib/esm/shared/Media/Document/index.d.ts +0 -3
  297. package/lib/esm/shared/Media/Document/index.js +0 -13
  298. package/lib/esm/shared/Media/Image/EditButton.d.ts +0 -2
  299. package/lib/esm/shared/Media/Image/EditButton.js +0 -7
  300. package/lib/esm/shared/Media/Image/EditComponent.d.ts +0 -3
  301. package/lib/esm/shared/Media/Image/EditComponent.js +0 -100
  302. package/lib/esm/shared/Media/Image/PreviewImage/index.js +0 -38
  303. package/lib/esm/shared/Media/Image/index.d.ts +0 -3
  304. package/lib/esm/shared/Media/Image/index.js +0 -13
  305. package/lib/esm/shared/Media/Link/EditButton.d.ts +0 -2
  306. package/lib/esm/shared/Media/Link/EditButton.js +0 -7
  307. package/lib/esm/shared/Media/Link/EditComponent.d.ts +0 -3
  308. package/lib/esm/shared/Media/Link/EditComponent.js +0 -43
  309. package/lib/esm/shared/Media/Share/PreviewComponent.d.ts +0 -7
  310. package/lib/esm/shared/Media/Share/PreviewComponent.js +0 -29
  311. package/lib/esm/shared/Media/Video/EditButton.d.ts +0 -2
  312. package/lib/esm/shared/Media/Video/EditButton.js +0 -7
  313. package/lib/esm/shared/Media/Video/EditComponent.d.ts +0 -3
  314. package/lib/esm/shared/Media/Video/EditComponent.js +0 -87
  315. package/lib/esm/shared/Media/Video/PreviewComponent.d.ts +0 -19
  316. package/lib/esm/shared/Media/Video/PreviewComponent.js +0 -34
  317. package/lib/esm/shared/Media/Video/index.d.ts +0 -3
  318. package/lib/esm/shared/Media/Video/index.js +0 -13
  319. package/lib/esm/shared/MediasPreview/index.d.ts +0 -18
  320. package/lib/esm/shared/MediasPreview/index.js +0 -42
@@ -2,12 +2,11 @@ import { __rest } from "tslib";
2
2
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import { styled } from '@mui/material/styles';
4
4
  import CardContent from '@mui/material/CardContent';
5
- import { Avatar, Box, Button, CardActions, CardHeader, Collapse, Stack, Tooltip, Typography } from '@mui/material';
5
+ import { Avatar, Box, Button, CardActions, CardHeader, Collapse, Stack, Tooltip, Typography, } from '@mui/material';
6
6
  import FeedObjectSkeleton from './Skeleton';
7
7
  import DateTimeAgo from '../../shared/DateTimeAgo';
8
8
  import Bullet from '../../shared/Bullet';
9
9
  import Tags from '../../shared/Tags';
10
- import MediasPreview from '../../shared/MediasPreview';
11
10
  import Actions from './Actions';
12
11
  import Icon from '@mui/material/Icon';
13
12
  import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
@@ -17,7 +16,7 @@ import { SCFeedObjectActivitiesType, SCFeedObjectTemplateType } from '../../type
17
16
  import MarkRead from '../../shared/MarkRead';
18
17
  import classNames from 'classnames';
19
18
  import ContributionActionsMenu from '../../shared/ContributionActionsMenu';
20
- import { getContributionHtml, getContributionRouteName, getContributionSnippet, getRouteData } from '../../utils/contribution';
19
+ import { getContributionHtml, getContributionRouteName, getContributionSnippet, getRouteData, } from '../../utils/contribution';
21
20
  import Follow from './Actions/Follow';
22
21
  import Widget from '../Widget';
23
22
  import { useThemeProps } from '@mui/system';
@@ -30,11 +29,12 @@ import { SCContributionType } from '@selfcommunity/types';
30
29
  import { Endpoints, http } from '@selfcommunity/api-services';
31
30
  import { CacheStrategies, Logger, LRUCache } from '@selfcommunity/utils';
32
31
  import { catchUnauthorizedActionByBlockedUser } from '../../utils/errors';
33
- import { Link, SCCache, SCRoutes, UserUtils, useSCContext, useSCFetchFeedObject, useSCRouting, useSCUser } from '@selfcommunity/react-core';
32
+ import { Link, SCCache, SCRoutes, UserUtils, useSCContext, useSCFetchFeedObject, useSCRouting, useSCUser, } from '@selfcommunity/react-core';
34
33
  import UserDeletedSnackBar from '../../shared/UserDeletedSnackBar';
35
34
  import UserAvatar from '../../shared/UserAvatar';
36
35
  import { MAX_SUMMARY_LENGTH } from '../../constants/Feed';
37
36
  import Composer from '../Composer';
37
+ import FeedObjectMediaPreview from '../FeedObjectMediaPreview';
38
38
  const messages = defineMessages({
39
39
  visibleToAll: {
40
40
  id: 'ui.feedObject.visibleToAll',
@@ -53,6 +53,7 @@ const classes = {
53
53
  tag: `${PREFIX}-tag`,
54
54
  location: `${PREFIX}-location`,
55
55
  content: `${PREFIX}-content`,
56
+ showMore: `${PREFIX}-show-more`,
56
57
  error: `${PREFIX}-error`,
57
58
  titleSection: `${PREFIX}-title-section`,
58
59
  title: `${PREFIX}-title`,
@@ -131,7 +132,7 @@ export default function FeedObject(inProps) {
131
132
  props: inProps,
132
133
  name: PREFIX
133
134
  });
134
- const { id = `feed_object_${props.feedObjectId ? props.feedObjectId : props.feedObject ? props.feedObject.id : ''}`, className = null, feedObjectId = null, feedObject = null, feedObjectType = SCContributionType.DISCUSSION, feedObjectActivities = null, cacheStrategy = CacheStrategies.CACHE_FIRST, markRead = false, template = SCFeedObjectTemplateType.PREVIEW, hideFollowAction = false, summaryExpanded = false, activitiesExpanded = true, activitiesExpandedType, hideParticipantsPreview = false, pollVisible = false, FollowButtonProps = {}, FeedObjectSkeletonProps = { elevation: 0 }, ActionsProps = {}, CommentObjectReplyComponent = CommentObjectReply, CommentObjectReplyComponentProps = { WidgetProps: { variant: 'outlined' } }, CommentComponentProps = { variant: 'outlined' }, CommentObjectSkeletonProps = { elevation: 0, WidgetProps: { variant: 'outlined' } }, ContributionActionsMenuProps = {}, MediasPreviewProps = {}, ActivitiesProps = { cacheStrategy }, PollObjectProps = { elevation: 0 }, ContributorsFeedObjectProps = {}, onReply, onHeightChange, onStateChange } = props, rest = __rest(props, ["id", "className", "feedObjectId", "feedObject", "feedObjectType", "feedObjectActivities", "cacheStrategy", "markRead", "template", "hideFollowAction", "summaryExpanded", "activitiesExpanded", "activitiesExpandedType", "hideParticipantsPreview", "pollVisible", "FollowButtonProps", "FeedObjectSkeletonProps", "ActionsProps", "CommentObjectReplyComponent", "CommentObjectReplyComponentProps", "CommentComponentProps", "CommentObjectSkeletonProps", "ContributionActionsMenuProps", "MediasPreviewProps", "ActivitiesProps", "PollObjectProps", "ContributorsFeedObjectProps", "onReply", "onHeightChange", "onStateChange"]);
135
+ const { id = `feed_object_${props.feedObjectId ? props.feedObjectId : props.feedObject ? props.feedObject.id : ''}`, className = null, feedObjectId = null, feedObject = null, feedObjectType = SCContributionType.DISCUSSION, feedObjectActivities = null, cacheStrategy = CacheStrategies.CACHE_FIRST, markRead = false, template = SCFeedObjectTemplateType.PREVIEW, hideFollowAction = false, summaryExpanded = false, activitiesExpanded = true, activitiesExpandedType, hideParticipantsPreview = false, pollVisible = false, FollowButtonProps = {}, FeedObjectSkeletonProps = { elevation: 0 }, ActionsProps = {}, CommentObjectReplyComponent = CommentObjectReply, CommentObjectReplyComponentProps = { WidgetProps: { variant: 'outlined' } }, CommentComponentProps = { variant: 'outlined' }, CommentObjectSkeletonProps = { elevation: 0, WidgetProps: { variant: 'outlined' } }, ContributionActionsMenuProps = {}, FeedObjectMediaPreviewProps = {}, ActivitiesProps = { cacheStrategy }, PollObjectProps = { elevation: 0 }, ContributorsFeedObjectProps = {}, onReply, onHeightChange, onStateChange } = props, rest = __rest(props, ["id", "className", "feedObjectId", "feedObject", "feedObjectType", "feedObjectActivities", "cacheStrategy", "markRead", "template", "hideFollowAction", "summaryExpanded", "activitiesExpanded", "activitiesExpandedType", "hideParticipantsPreview", "pollVisible", "FollowButtonProps", "FeedObjectSkeletonProps", "ActionsProps", "CommentObjectReplyComponent", "CommentObjectReplyComponentProps", "CommentComponentProps", "CommentObjectSkeletonProps", "ContributionActionsMenuProps", "FeedObjectMediaPreviewProps", "ActivitiesProps", "PollObjectProps", "ContributorsFeedObjectProps", "onReply", "onHeightChange", "onStateChange"]);
135
136
  // CONTEXT
136
137
  const scContext = useSCContext();
137
138
  const scRoutingContext = useSCRouting();
@@ -392,7 +393,7 @@ export default function FeedObject(inProps) {
392
393
  React.createElement(Typography, { component: "div", className: classes.text, variant: "body2", gutterBottom: true, dangerouslySetInnerHTML: {
393
394
  __html: summaryHtml
394
395
  } })),
395
- !expanded && summaryHtmlTruncated && (React.createElement(Button, { size: "small", variant: "text", color: "inherit", onClick: handleToggleSummary },
396
+ !expanded && summaryHtmlTruncated && (React.createElement(Button, { size: "small", variant: "text", color: "inherit", className: classes.showMore, onClick: handleToggleSummary },
396
397
  React.createElement(FormattedMessage, { id: "ui.feedObject.content.showMore", defaultMessage: "ui.feedObject.content.showMore" })))));
397
398
  }
398
399
  else if (template === SCFeedObjectTemplateType.DETAIL) {
@@ -405,7 +406,7 @@ export default function FeedObject(inProps) {
405
406
  React.createElement(Typography, { component: "span", dangerouslySetInnerHTML: {
406
407
  __html: summaryHtml
407
408
  } }),
408
- !expanded && summaryHtmlTruncated && (React.createElement(Button, { size: "small", variant: "text", color: "inherit", onClick: handleToggleSummary },
409
+ !expanded && summaryHtmlTruncated && (React.createElement(Button, { size: "small", variant: "text", color: "inherit", className: classes.showMore, onClick: handleToggleSummary },
409
410
  React.createElement(FormattedMessage, { id: "ui.feedObject.content.showMore", defaultMessage: "ui.feedObject.content.showMore" })))));
410
411
  }
411
412
  }, [obj, template, expanded]);
@@ -444,7 +445,7 @@ export default function FeedObject(inProps) {
444
445
  React.createElement(Typography, { variant: "body1", gutterBottom: true, className: classes.title }, obj.title)))))),
445
446
  React.createElement(Box, { className: classes.textSection }, getContributionSummary(obj, template)),
446
447
  React.createElement(Box, { className: classes.mediasSection },
447
- React.createElement(MediasPreview, Object.assign({ medias: obj.medias }, MediasPreviewProps))),
448
+ React.createElement(FeedObjectMediaPreview, Object.assign({ medias: obj.medias }, FeedObjectMediaPreviewProps))),
448
449
  React.createElement(Box, { className: classes.pollsSection }, obj['poll'] && (React.createElement(PollObject, Object.assign({ visible: pollVisible ||
449
450
  template === SCFeedObjectTemplateType.DETAIL ||
450
451
  Boolean(obj.type !== SCContributionType.DISCUSSION && !obj.html && !obj.medias.length), feedObject: obj, pollObject: obj['poll'], onChange: handleChangePoll, onToggleVisibility: handleTogglePollVisibility }, PollObjectProps)))),
@@ -462,7 +463,7 @@ export default function FeedObject(inProps) {
462
463
  CommentComponentProps: Object.assign({ onDelete: handleDeleteComment, truncateContent: true, CommentsObjectComponentProps: { inPlaceLoadMoreContents: false } }, CommentComponentProps),
463
464
  CommentObjectSkeletonProps: CommentObjectSkeletonProps
464
465
  }, cacheStrategy: cacheStrategy }, ActivitiesProps))))),
465
- composerOpen && (React.createElement(Composer, { open: composerOpen, feedObject: obj, onClose: handleToggleEdit, onSuccess: handleEditSuccess, maxWidth: "sm", fullWidth: true, scroll: "body" })))) : (React.createElement(FeedObjectSkeleton, Object.assign({ template: template }, FeedObjectSkeletonProps)))));
466
+ composerOpen && (React.createElement(Composer, { open: composerOpen, feedObject: obj, onClose: handleToggleEdit, onSuccess: handleEditSuccess, maxWidth: "sm", fullWidth: true })))) : (React.createElement(FeedObjectSkeleton, Object.assign({ template: template }, FeedObjectSkeletonProps)))));
466
467
  }
467
468
  else if (template === SCFeedObjectTemplateType.SHARE) {
468
469
  objElement = (React.createElement(React.Fragment, null, obj ? (React.createElement(React.Fragment, null,
@@ -477,7 +478,7 @@ export default function FeedObject(inProps) {
477
478
  React.createElement(Typography, { variant: "body1", gutterBottom: true, className: classes.title }, obj.title)))),
478
479
  React.createElement(Box, { className: classes.textSection }, getContributionSummary(obj, template)),
479
480
  React.createElement(Box, { className: classes.mediasSection },
480
- React.createElement(MediasPreview, Object.assign({ medias: obj.medias }, MediasPreviewProps))),
481
+ React.createElement(FeedObjectMediaPreview, Object.assign({ medias: obj.medias }, FeedObjectMediaPreviewProps))),
481
482
  React.createElement(Box, { className: classes.pollsSection }, obj['poll'] && (React.createElement(PollObject, Object.assign({ feedObject: obj, pollObject: obj['poll'], onChange: handleChangePoll, visible: Boolean(obj.type !== SCContributionType.DISCUSSION && !obj.html && !obj.medias.length) }, PollObjectProps))))))) : (React.createElement(FeedObjectSkeleton, Object.assign({ template: template }, FeedObjectSkeletonProps)))));
482
483
  }
483
484
  else {
@@ -0,0 +1,38 @@
1
+ import { SCMediaObjectType } from '../../types/media';
2
+ import { BoxProps } from '@mui/material';
3
+ import { SCMediaType } from '@selfcommunity/types';
4
+ export interface FeedObjectMediaPreviewProps extends BoxProps {
5
+ /**
6
+ * Medias preview array
7
+ */
8
+ medias: SCMediaType[];
9
+ /**
10
+ * Media types
11
+ * @default 'image', 'document', 'link', 'share'
12
+ */
13
+ mediaObjectTypes?: SCMediaObjectType[];
14
+ }
15
+ /**
16
+ * > API documentation for the Community-JS FeedObjectMediaPreview component. Learn about the available props and the CSS API.
17
+ *
18
+ *
19
+ * The FeedObjectMediaPreview component render the list of medias in a feed object thanks to given configurations.
20
+
21
+ #### Import
22
+ ```jsx
23
+ import {FeedObjectMediaPreview} from '@selfcommunity/react-ui';
24
+ ```
25
+ #### Component Name
26
+ The name `SCFeedObjectMediaPreview` can be used when providing style overrides in the theme.
27
+
28
+ #### CSS
29
+
30
+ |Rule Name|Global class|Description|
31
+ |---|---|---|
32
+ |root|.SCFeedObjectMediaPreview-root|Styles applied to the root element.|
33
+
34
+
35
+ * @param inProps
36
+ */
37
+ declare const _default: (inProps: FeedObjectMediaPreviewProps) => JSX.Element;
38
+ export default _default;
@@ -0,0 +1,64 @@
1
+ import { __rest } from "tslib";
2
+ import React from 'react';
3
+ import { styled } from '@mui/material/styles';
4
+ import Box from '@mui/material/Box';
5
+ import { useSCMediaClick } from '@selfcommunity/react-core';
6
+ import { useThemeProps } from '@mui/system';
7
+ import { File, Link, Share } from '../../shared/Media';
8
+ import classNames from 'classnames';
9
+ const PREFIX = 'SCFeedObjectMediaPreview';
10
+ const classes = {
11
+ root: `${PREFIX}-root`
12
+ };
13
+ const Root = styled(Box, {
14
+ name: PREFIX,
15
+ slot: 'Root'
16
+ })(({ theme }) => ({}));
17
+ /**
18
+ * > API documentation for the Community-JS FeedObjectMediaPreview component. Learn about the available props and the CSS API.
19
+ *
20
+ *
21
+ * The FeedObjectMediaPreview component render the list of medias in a feed object thanks to given configurations.
22
+
23
+ #### Import
24
+ ```jsx
25
+ import {FeedObjectMediaPreview} from '@selfcommunity/react-ui';
26
+ ```
27
+ #### Component Name
28
+ The name `SCFeedObjectMediaPreview` can be used when providing style overrides in the theme.
29
+
30
+ #### CSS
31
+
32
+ |Rule Name|Global class|Description|
33
+ |---|---|---|
34
+ |root|.SCFeedObjectMediaPreview-root|Styles applied to the root element.|
35
+
36
+
37
+ * @param inProps
38
+ */
39
+ export default (inProps) => {
40
+ //PROPS
41
+ const props = useThemeProps({
42
+ props: inProps,
43
+ name: PREFIX
44
+ });
45
+ const { className, medias, mediaObjectTypes = [File, Link, Share] } = props, rest = __rest(props, ["className", "medias", "mediaObjectTypes"]);
46
+ const { handleMediaClick } = useSCMediaClick();
47
+ if (!medias.length) {
48
+ /**
49
+ * Feed without any medias:
50
+ * don't render anything
51
+ */
52
+ return null;
53
+ }
54
+ /**
55
+ * Renders list of media preview
56
+ * The adornment prop is used to insert the controls
57
+ * for re-editing the media at the top of the group of elements
58
+ */
59
+ return (React.createElement(Root, Object.assign({ className: classNames(className, classes.root) }, rest), mediaObjectTypes.map((mediaObject) => {
60
+ const { displayProps = {} } = mediaObject;
61
+ return (React.createElement("div", { key: mediaObject.name },
62
+ React.createElement(mediaObject.displayComponent, Object.assign({ medias: medias }, displayProps, { onMediaClick: handleMediaClick }))));
63
+ })));
64
+ };
@@ -0,0 +1,3 @@
1
+ import FeedObjectMediaPreview, { FeedObjectMediaPreviewProps } from './FeedObjectMediaPreview';
2
+ export default FeedObjectMediaPreview;
3
+ export { FeedObjectMediaPreviewProps };
@@ -0,0 +1,2 @@
1
+ import FeedObjectMediaPreview from './FeedObjectMediaPreview';
2
+ export default FeedObjectMediaPreview;
@@ -1,39 +1,32 @@
1
- import React from 'react';
2
1
  import { SCCategoryType, SCMediaType, SCPollType, SCTagType } from '@selfcommunity/types';
3
- import { CardProps } from '@mui/material';
4
2
  import { SCMediaObjectType } from '../../types/media';
5
- import { DistributiveOmit } from '@mui/types';
6
- import { OverrideProps } from '@mui/material/OverridableComponent';
7
- export interface InlineComposerTypeMap<P = {}, D extends React.ElementType = 'div'> {
8
- props: P & DistributiveOmit<CardProps, 'defaultValue'> & {
9
- /**
10
- * Media objects available
11
- * @default Image, Document, Link
12
- */
13
- mediaObjectTypes?: SCMediaObjectType[];
14
- /**
15
- * Initialization Data for the Composer, this is a hook to generate custom posts
16
- * @default null
17
- */
18
- defaultValue?: {
19
- title?: string;
20
- text?: string;
21
- categories?: SCCategoryType[];
22
- audience?: string;
23
- addressing?: SCTagType[];
24
- medias?: SCMediaType[];
25
- poll?: SCPollType;
26
- location?: string;
27
- };
28
- /**
29
- * Callback triggered on success contribution creation
30
- * @default null
31
- */
32
- onSuccess?: (res: any) => void;
3
+ import { WidgetProps } from '../Widget';
4
+ export interface InlineComposerWidgetProps extends Omit<WidgetProps, 'defaultValue'> {
5
+ /**
6
+ * Media objects available
7
+ * @default Image, Document, Link
8
+ */
9
+ mediaObjectTypes?: SCMediaObjectType[];
10
+ /**
11
+ * Initialization Data for the Composer, this is a hook to generate custom posts
12
+ * @default null
13
+ */
14
+ defaultValue?: {
15
+ title?: string;
16
+ text?: string;
17
+ categories?: SCCategoryType[];
18
+ audience?: string;
19
+ addressing?: SCTagType[];
20
+ medias?: SCMediaType[];
21
+ poll?: SCPollType;
22
+ location?: string;
33
23
  };
34
- defaultComponent: D;
24
+ /**
25
+ * Callback triggered on success contribution creation
26
+ * @default null
27
+ */
28
+ onSuccess?: (res: any) => void;
35
29
  }
36
- export declare type InlineComposerWidgetProps<D extends React.ElementType = InlineComposerTypeMap['defaultComponent'], P = {}> = OverrideProps<InlineComposerTypeMap<P, D>, D>;
37
30
  /**
38
31
  * > API documentation for the Community-JS Inline Composer component. Learn about the available props and the CSS API.
39
32
  *
@@ -55,7 +48,6 @@ export declare type InlineComposerWidgetProps<D extends React.ElementType = Inli
55
48
  |root|.SCInlineComposerWidget-root|Styles applied to the root element.|
56
49
  |content|.SCInlineComposerWidget-content|Styles applied to the content element.|
57
50
  |input|.SCInlineComposerWidget-input|Styles applied to the input element.|
58
- |actions|.SCInlineComposerWidget-actions|Styles applied to the actions section.|
59
51
  |avatar|.SCInlineComposerWidget-avatar|Styles applied to the avatar element.|
60
52
 
61
53
 
@@ -1,39 +1,25 @@
1
1
  import { __rest } from "tslib";
2
- import React, { useContext, useMemo, useState } from 'react';
3
- import { SCContext, SCPreferences, SCPreferencesContext, SCRoutes, SCUserContext, UserUtils, useSCRouting, Link } from '@selfcommunity/react-core';
4
- import { Avatar, Box, Button, IconButton, CardContent } from '@mui/material';
2
+ import React, { useCallback, useState } from 'react';
3
+ import { Link, SCRoutes, UserUtils, useSCContext, useSCRouting, useSCUser, } from '@selfcommunity/react-core';
4
+ import { Avatar, Box, Button, CardContent } from '@mui/material';
5
5
  import { styled } from '@mui/material/styles';
6
- import { Document, Image, Link as MediaLink } from '../../shared/Media';
7
- import Composer, { MAIN_VIEW, POLL_VIEW } from '../Composer';
8
- import Icon from '@mui/material/Icon';
9
6
  import { FormattedMessage } from 'react-intl';
10
7
  import { useSnackbar } from 'notistack';
11
8
  import Widget from '../Widget';
12
9
  import { useThemeProps } from '@mui/system';
13
- const PREFIX = 'SCInlineComposerWidget';
10
+ import Composer from '../Composer';
11
+ import { File, Link as MediaLink } from '../../shared/Media';
12
+ import { PREFIX } from './constants';
14
13
  const classes = {
15
14
  root: `${PREFIX}-root`,
16
15
  content: `${PREFIX}-content`,
17
16
  input: `${PREFIX}-input`,
18
- actions: `${PREFIX}-actions`,
19
17
  avatar: `${PREFIX}-avatar`
20
18
  };
21
19
  const Root = styled(Widget, {
22
20
  name: PREFIX,
23
- slot: 'Root',
24
- overridesResolver: (props, styles) => styles.root
25
- })(({ theme }) => ({}));
26
- const PREFERENCES = [
27
- SCPreferences.CONFIGURATIONS_POST_TYPE_ENABLED,
28
- SCPreferences.CONFIGURATIONS_DISCUSSION_TYPE_ENABLED,
29
- SCPreferences.ADDONS_POST_GEOLOCATION_ENABLED,
30
- SCPreferences.ADDONS_POLLS_ENABLED,
31
- SCPreferences.ADDONS_VIDEO_UPLOAD_ENABLED
32
- ];
33
- const INITIAL_STATE = {
34
- open: false,
35
- view: null
36
- };
21
+ slot: 'Root'
22
+ })(() => ({}));
37
23
  /**
38
24
  * > API documentation for the Community-JS Inline Composer component. Learn about the available props and the CSS API.
39
25
  *
@@ -55,7 +41,6 @@ const INITIAL_STATE = {
55
41
  |root|.SCInlineComposerWidget-root|Styles applied to the root element.|
56
42
  |content|.SCInlineComposerWidget-content|Styles applied to the content element.|
57
43
  |input|.SCInlineComposerWidget-input|Styles applied to the input element.|
58
- |actions|.SCInlineComposerWidget-actions|Styles applied to the actions section.|
59
44
  |avatar|.SCInlineComposerWidget-avatar|Styles applied to the avatar element.|
60
45
 
61
46
 
@@ -67,46 +52,34 @@ export default function InlineComposerWidget(inProps) {
67
52
  props: inProps,
68
53
  name: PREFIX
69
54
  });
70
- const { mediaObjectTypes = [Image, Document, MediaLink], defaultValue, onSuccess = null } = props, rest = __rest(props, ["mediaObjectTypes", "defaultValue", "onSuccess"]);
55
+ const { mediaObjectTypes = [File, MediaLink], defaultValue, onSuccess = null } = props, rest = __rest(props, ["mediaObjectTypes", "defaultValue", "onSuccess"]);
71
56
  // Context
72
- const scContext = useContext(SCContext);
73
- const scPreferencesContext = useContext(SCPreferencesContext);
74
- const scUserContext = useContext(SCUserContext);
57
+ const scContext = useSCContext();
58
+ const scUserContext = useSCUser();
75
59
  const scRoutingContext = useSCRouting();
76
60
  const { enqueueSnackbar } = useSnackbar();
77
61
  // State variables
78
- const [state, setState] = useState(Object.assign({}, INITIAL_STATE));
79
- const { open, view } = state;
80
- /*
81
- * Compute preferences
82
- */
83
- const preferences = useMemo(() => {
84
- const _preferences = {};
85
- PREFERENCES.map((p) => (_preferences[p] = p in scPreferencesContext.preferences ? scPreferencesContext.preferences[p].value : null));
86
- return _preferences;
87
- }, [scPreferencesContext.preferences]);
62
+ const [open, setOpen] = useState(false);
88
63
  // Handlers
89
- const handleOpen = (view) => {
90
- return () => {
91
- if (scUserContext.user) {
92
- if (UserUtils.isBlocked(scUserContext.user)) {
93
- enqueueSnackbar(React.createElement(FormattedMessage, { id: "ui.common.userBlocked", defaultMessage: "ui.common.userBlocked" }), {
94
- variant: 'warning',
95
- autoHideDuration: 3000
96
- });
97
- }
98
- else {
99
- setState({ view, open: true });
100
- }
64
+ const handleOpen = useCallback(() => {
65
+ if (scUserContext.user) {
66
+ if (UserUtils.isBlocked(scUserContext.user)) {
67
+ enqueueSnackbar(React.createElement(FormattedMessage, { id: "ui.common.userBlocked", defaultMessage: "ui.common.userBlocked" }), {
68
+ variant: 'warning',
69
+ autoHideDuration: 3000
70
+ });
101
71
  }
102
72
  else {
103
- scContext.settings.handleAnonymousAction();
73
+ setOpen(true);
104
74
  }
105
- };
106
- };
107
- const handleClose = () => {
108
- setState(Object.assign({}, INITIAL_STATE));
109
- };
75
+ }
76
+ else {
77
+ scContext.settings.handleAnonymousAction();
78
+ }
79
+ }, [scUserContext.user, scContext.settings]);
80
+ const handleClose = useCallback(() => {
81
+ setOpen(false);
82
+ }, []);
110
83
  const handleSuccess = (feedObject) => {
111
84
  if (onSuccess) {
112
85
  onSuccess(feedObject);
@@ -117,21 +90,15 @@ export default function InlineComposerWidget(inProps) {
117
90
  autoHideDuration: 3000
118
91
  });
119
92
  }
120
- setState(Object.assign({}, INITIAL_STATE));
93
+ setOpen(false);
121
94
  };
122
95
  return (React.createElement(React.Fragment, null,
123
96
  React.createElement(Root, Object.assign({ className: classes.root }, rest),
124
97
  React.createElement(CardContent, { className: classes.content },
125
98
  React.createElement(Box, { className: classes.input },
126
- React.createElement(Button, { variant: "text", disableFocusRipple: true, disableRipple: true, disableElevation: true, onClick: handleOpen(MAIN_VIEW), fullWidth: true, color: "inherit" },
99
+ React.createElement(Button, { variant: "text", disableFocusRipple: true, disableRipple: true, disableElevation: true, onClick: handleOpen, fullWidth: true, color: "inherit" },
127
100
  React.createElement(FormattedMessage, { id: "ui.inlineComposerWidget.label", defaultMessage: "ui.inlineComposerWidget.label" }))),
128
- React.createElement(Box, { className: classes.actions },
129
- mediaObjectTypes
130
- .filter((mediaObjectType) => mediaObjectType.editButton !== null)
131
- .map((mediaObjectType) => (React.createElement(mediaObjectType.editButton, { key: mediaObjectType.name, onClick: handleOpen(mediaObjectType.name) }))),
132
- preferences[SCPreferences.ADDONS_POLLS_ENABLED] && (React.createElement(IconButton, { onClick: handleOpen(POLL_VIEW) },
133
- React.createElement(Icon, null, "bar_chart")))),
134
101
  React.createElement(Box, { className: classes.avatar }, !scUserContext.user ? (React.createElement(Avatar, { variant: "circular" })) : (React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUserContext.user) },
135
102
  React.createElement(Avatar, { alt: scUserContext.user.username, variant: "circular", src: scUserContext.user.avatar })))))),
136
- React.createElement(Composer, { open: open, view: view, mediaObjectTypes: mediaObjectTypes, defaultValue: defaultValue, fullWidth: true, scroll: "body", onClose: handleClose, onSuccess: handleSuccess })));
103
+ React.createElement(Composer, { open: open, mediaObjectTypes: mediaObjectTypes, defaultValue: defaultValue, fullWidth: true, onClose: handleClose, onSuccess: handleSuccess })));
137
104
  }
@@ -15,11 +15,10 @@
15
15
 
16
16
  |Rule Name|Global class|Description|
17
17
  |---|---|---|
18
- |root|.SCInlineComposerWidgetSkeleton-root|Styles applied to the root element.|
19
- |input|.SCInlineComposerWidgetSkeleton-input|Styles applied to the input element.|
20
- |actions|.SCInlineComposerWidgetSkeleton-actions|Styles applied to the actions section.|
21
- |action|.SCInlineComposerWidgetSkeleton-action|Styles applied to the action section.|
22
- |avatar|.SCInlineComposerWidgetSkeleton-avatar|Styles applied to the avatar element.|
18
+ |root|.SCInlineComposerWidget-skeleton-root|Styles applied to the root element.|
19
+ |content|.SCInlineComposerWidget-content|Styles applied to the content element.|
20
+ |input|.SCInlineComposerWidget-input|Styles applied to the input element.|
21
+ |avatar|.SCInlineComposerWidget-avatar|Styles applied to the avatar element.|
23
22
  *
24
23
  */
25
24
  export default function InlineComposerWidgetSkeleton(): JSX.Element;
@@ -1,34 +1,19 @@
1
1
  import React from 'react';
2
2
  import { styled } from '@mui/material/styles';
3
3
  import Skeleton from '@mui/material/Skeleton';
4
- import { Box, Stack } from '@mui/material';
4
+ import { Box, CardContent } from '@mui/material';
5
5
  import Widget from '../Widget';
6
- const PREFIX = 'SCInlineComposerWidgetSkeleton';
6
+ import { PREFIX } from './constants';
7
7
  const classes = {
8
- root: `${PREFIX}-root`,
8
+ root: `${PREFIX}-skeleton-root`,
9
+ content: `${PREFIX}-content`,
9
10
  input: `${PREFIX}-input`,
10
- actions: `${PREFIX}-actions`,
11
- action: `${PREFIX}-action`,
12
11
  avatar: `${PREFIX}-avatar`
13
12
  };
14
13
  const Root = styled(Widget, {
15
14
  name: PREFIX,
16
- slot: 'Root',
17
- overridesResolver: (props, styles) => styles.root
18
- })(({ theme }) => ({
19
- padding: theme.spacing(),
20
- display: 'flex',
21
- flexDirection: 'row',
22
- justifyContent: 'space-between',
23
- marginBottom: theme.spacing(2),
24
- [`& .${classes.input}`]: {
25
- flexGrow: 2
26
- },
27
- [`& .${classes.actions}`]: {
28
- marginLeft: 15,
29
- marginRight: 15
30
- }
31
- }));
15
+ slot: 'SkeletonRoot'
16
+ })(() => ({}));
32
17
  /**
33
18
  * > API documentation for the Community-JS Inline Composer Skeleton component. Learn about the available props and the CSS API.
34
19
 
@@ -46,22 +31,17 @@ const Root = styled(Widget, {
46
31
 
47
32
  |Rule Name|Global class|Description|
48
33
  |---|---|---|
49
- |root|.SCInlineComposerWidgetSkeleton-root|Styles applied to the root element.|
50
- |input|.SCInlineComposerWidgetSkeleton-input|Styles applied to the input element.|
51
- |actions|.SCInlineComposerWidgetSkeleton-actions|Styles applied to the actions section.|
52
- |action|.SCInlineComposerWidgetSkeleton-action|Styles applied to the action section.|
53
- |avatar|.SCInlineComposerWidgetSkeleton-avatar|Styles applied to the avatar element.|
34
+ |root|.SCInlineComposerWidget-skeleton-root|Styles applied to the root element.|
35
+ |content|.SCInlineComposerWidget-content|Styles applied to the content element.|
36
+ |input|.SCInlineComposerWidget-input|Styles applied to the input element.|
37
+ |avatar|.SCInlineComposerWidget-avatar|Styles applied to the avatar element.|
54
38
  *
55
39
  */
56
40
  export default function InlineComposerWidgetSkeleton() {
57
41
  return (React.createElement(Root, { className: classes.root },
58
- React.createElement(Box, { className: classes.input },
59
- React.createElement(Skeleton, { sx: { height: 40 }, animation: "wave", variant: "text" })),
60
- React.createElement(Stack, { className: classes.actions, direction: "row", justifyContent: "center", alignItems: "center", spacing: 2 },
61
- React.createElement(Skeleton, { className: classes.action, animation: "wave", variant: "circular", width: 27, height: 27 }),
62
- React.createElement(Skeleton, { className: classes.action, animation: "wave", variant: "circular", width: 27, height: 27 }),
63
- React.createElement(Skeleton, { className: classes.action, animation: "wave", variant: "circular", width: 27, height: 27 }),
64
- React.createElement(Skeleton, { className: classes.action, animation: "wave", variant: "circular", width: 27, height: 27 })),
65
- React.createElement(Box, { className: classes.avatar },
66
- React.createElement(Skeleton, { className: classes.avatar, animation: "wave", variant: "circular", width: 40, height: 40 }))));
42
+ React.createElement(CardContent, { className: classes.content },
43
+ React.createElement(Box, { className: classes.input },
44
+ React.createElement(Skeleton, { animation: "wave", variant: "text" })),
45
+ React.createElement(Box, { className: classes.avatar },
46
+ React.createElement(Skeleton, { className: classes.avatar, animation: "wave", variant: "circular" })))));
67
47
  }
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCInlineComposerWidget";
@@ -0,0 +1 @@
1
+ export const PREFIX = 'SCInlineComposerWidget';
@@ -1,7 +1,7 @@
1
1
  import { TextFieldProps } from '@mui/material/TextField';
2
2
  import { AutocompleteProps } from '@mui/material';
3
- import { SCLocalityType } from '@selfcommunity/types/src/index';
4
- export interface LocationAutocompleteProps extends Pick<AutocompleteProps<SCLocalityType, false, false, true>, Exclude<keyof AutocompleteProps<SCLocalityType, false, false, true>, 'options' | 'getOptionLabel' | 'filterOptions' | 'autoComplete' | 'includeInputInList' | 'filterSelectedOptions' | 'value' | 'selectOnFocus' | 'handleHomeEndKeys' | 'noOptionsText' | 'onChange' | 'onInputChange' | 'isOptionEqualToValue' | 'renderInput' | 'renderOption'>> {
3
+ import { SCContributionLocation } from '@selfcommunity/types/src/index';
4
+ export interface LocationAutocompleteProps extends Pick<AutocompleteProps<SCContributionLocation, false, false, true>, Exclude<keyof AutocompleteProps<SCContributionLocation, false, false, true>, 'options' | 'getOptionLabel' | 'filterOptions' | 'autoComplete' | 'includeInputInList' | 'filterSelectedOptions' | 'value' | 'selectOnFocus' | 'handleHomeEndKeys' | 'noOptionsText' | 'onChange' | 'onInputChange' | 'isOptionEqualToValue' | 'renderInput' | 'renderOption'>> {
5
5
  /**
6
6
  * The props applied to the text field.
7
7
  * @default {variant: 'outlined, label: location_label}
@@ -86,14 +86,16 @@ export default function LocationAutocomplete(inProps) {
86
86
  }, [value]);
87
87
  // Handlers
88
88
  const handleChange = (event, value) => {
89
- setValue(value);
89
+ setValue({ location: value.full_address, lat: value.lat, lon: value.lng });
90
90
  onChange && onChange(value);
91
91
  };
92
92
  const handleSearch = (event, _search) => {
93
93
  setSearch(_search);
94
94
  };
95
95
  // Render
96
- return (React.createElement(Root, Object.assign({ className: classes.root, options: locations || [], getOptionLabel: (option) => option.full_address || '', filterOptions: (x) => x, autoComplete: true, includeInputInList: true, filterSelectedOptions: true, value: value, selectOnFocus: true, handleHomeEndKeys: true, disabled: disabled, noOptionsText: React.createElement(FormattedMessage, { id: "ui.locationAutocomplete.empty", defaultMessage: "ui.locationAutocomplete.empty" }), onChange: handleChange, onInputChange: handleSearch, isOptionEqualToValue: (option, value) => value.lat === option.lat && value.lng === option.lng, renderInput: (params) => {
96
+ return (React.createElement(Root, Object.assign({ className: classes.root, options: locations || [],
97
+ // @ts-ignore
98
+ getOptionLabel: (option) => (option === null || option === void 0 ? void 0 : option.full_address) || (option === null || option === void 0 ? void 0 : option.location) || '', filterOptions: (x) => x, autoComplete: true, includeInputInList: true, filterSelectedOptions: true, value: value, selectOnFocus: true, handleHomeEndKeys: true, disabled: disabled, noOptionsText: React.createElement(FormattedMessage, { id: "ui.locationAutocomplete.empty", defaultMessage: "ui.locationAutocomplete.empty" }), onChange: handleChange, onInputChange: handleSearch, isOptionEqualToValue: (option, value) => value.lat === option.lat && value.lon === option.lng, renderInput: (params) => {
97
99
  return (React.createElement(TextField, Object.assign({}, params, TextFieldProps, { margin: "dense", InputProps: Object.assign(Object.assign({}, params.InputProps), { autoComplete: 'location', endAdornment: (React.createElement(React.Fragment, null,
98
100
  isLoading ? React.createElement(CircularProgress, { color: "inherit", size: 20 }) : null,
99
101
  params.InputProps.endAdornment)) }) })));
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IconButtonProps, DrawerProps } from '@mui/material';
2
+ import { DrawerProps, IconButtonProps } from '@mui/material';
3
3
  export interface NavigationMenuIconButtonProps extends IconButtonProps {
4
4
  /**
5
5
  * Props to spread to drawer element
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import React, { useState } from 'react';
3
3
  import { styled } from '@mui/material/styles';
4
- import { Box, Divider, Icon, IconButton, Drawer, List } from '@mui/material';
4
+ import { Box, Divider, Drawer, Icon, IconButton, List } from '@mui/material';
5
5
  import classNames from 'classnames';
6
6
  import { useThemeProps } from '@mui/system';
7
7
  import ScrollContainer from '../../shared/ScrollContainer';
@@ -7,10 +7,6 @@ export interface NavigationToolbarMobileProps extends ToolbarProps {
7
7
  * Disable search action if possible
8
8
  */
9
9
  disableSearch?: boolean;
10
- /**
11
- * Disable composer action if possible
12
- */
13
- disableComposer?: boolean;
14
10
  /**
15
11
  * Props spread to SearchAutocomplete component
16
12
  */
@@ -54,7 +50,6 @@ export interface NavigationToolbarMobileProps extends ToolbarProps {
54
50
  |logo|.SCNavigationToolbarMobile-logo|Styles applied to the logo element.|
55
51
  |search|.SCNavigationToolbarMobile-search|Styles applied to the search button element|
56
52
  |searchDialog|.SCNavigationToolbarMobile-search-dialog|Styles applied to the search dialog element|
57
- |composer|.SCNavigationToolbarMobile-composer|Styles applied to the composer component|
58
53
  |settings|.SCNavigationToolbarMobile-settings|Styles applied to the settings button element|
59
54
  |settingsDialog|.SCNavigationToolbarMobile-settingsDialog|Styles applied to the settings dialog elements|
60
55
  |login|.SCNavigationToolbarMobile-login|Styles applied to the login element.|