@selfcommunity/react-ui 0.7.0-alpha.335 → 0.7.0-alpha.337

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 (316) hide show
  1. package/lib/cjs/components/BottomNavigation/BottomNavigation.js +8 -11
  2. package/lib/cjs/components/Composer/Attributes/Attributes.d.ts +22 -0
  3. package/lib/cjs/components/Composer/Attributes/Attributes.js +41 -0
  4. package/lib/cjs/components/Composer/Attributes/index.d.ts +3 -0
  5. package/lib/cjs/components/Composer/{Poll → Attributes}/index.js +2 -2
  6. package/lib/cjs/components/Composer/Composer.d.ts +61 -84
  7. package/lib/cjs/components/Composer/Composer.js +265 -441
  8. package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.d.ts +32 -0
  9. package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +53 -0
  10. package/lib/cjs/components/Composer/Content/ContentDiscussion/index.d.ts +3 -0
  11. package/lib/cjs/components/Composer/Content/ContentDiscussion/index.js +5 -0
  12. package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.d.ts +26 -0
  13. package/lib/cjs/components/Composer/Content/ContentPoll/ContentPoll.js +129 -0
  14. package/lib/cjs/components/Composer/Content/ContentPoll/index.d.ts +3 -0
  15. package/lib/cjs/components/Composer/Content/ContentPoll/index.js +5 -0
  16. package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.d.ts +32 -0
  17. package/lib/cjs/components/Composer/Content/ContentPost/ContentPost.js +51 -0
  18. package/lib/cjs/components/Composer/Content/ContentPost/index.d.ts +3 -0
  19. package/lib/cjs/components/Composer/Content/ContentPost/index.js +5 -0
  20. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +11 -0
  21. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +74 -0
  22. package/lib/cjs/components/Composer/Layer/AudienceLayer/index.d.ts +3 -0
  23. package/lib/cjs/components/Composer/Layer/AudienceLayer/index.js +5 -0
  24. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +9 -0
  25. package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +41 -0
  26. package/lib/cjs/components/Composer/Layer/CategoryLayer/index.d.ts +3 -0
  27. package/lib/cjs/components/Composer/Layer/CategoryLayer/index.js +5 -0
  28. package/lib/cjs/components/Composer/Layer/CloseLayer/CloseLayer.d.ts +7 -0
  29. package/lib/cjs/components/Composer/Layer/CloseLayer/CloseLayer.js +41 -0
  30. package/lib/cjs/components/Composer/Layer/CloseLayer/index.d.ts +3 -0
  31. package/lib/cjs/components/Composer/{Audience → Layer/CloseLayer}/index.js +2 -2
  32. package/lib/cjs/components/Composer/Layer/LocationLayer/LocationLayer.d.ts +9 -0
  33. package/lib/cjs/components/Composer/Layer/LocationLayer/LocationLayer.js +41 -0
  34. package/lib/cjs/components/Composer/Layer/LocationLayer/index.d.ts +3 -0
  35. package/lib/cjs/components/Composer/Layer/LocationLayer/index.js +5 -0
  36. package/lib/cjs/components/Composer/Skeleton.d.ts +0 -4
  37. package/lib/cjs/components/Composer/Skeleton.js +10 -72
  38. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.d.ts +6 -0
  39. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +47 -0
  40. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/index.d.ts +3 -0
  41. package/lib/cjs/components/Composer/TypeSwitchButtonGroup/index.js +5 -0
  42. package/lib/cjs/components/Composer/constants.d.ts +1 -0
  43. package/lib/cjs/components/Composer/constants.js +4 -0
  44. package/lib/cjs/components/Composer/index.d.ts +2 -3
  45. package/lib/cjs/components/Composer/index.js +1 -6
  46. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.d.ts +2 -1
  47. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +8 -8
  48. package/lib/cjs/components/Editor/Editor.js +14 -5
  49. package/lib/cjs/components/Feed/prefetchedData.d.ts +2 -368
  50. package/lib/cjs/components/Feed/prefetchedData.js +17 -16
  51. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +2 -2
  52. package/lib/cjs/components/FeedObject/FeedObject.d.ts +2 -2
  53. package/lib/cjs/components/FeedObject/FeedObject.js +5 -5
  54. package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.d.ts +38 -0
  55. package/lib/cjs/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +66 -0
  56. package/lib/cjs/components/FeedObjectMediaPreview/index.d.ts +3 -0
  57. package/lib/cjs/components/FeedObjectMediaPreview/index.js +5 -0
  58. package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.d.ts +25 -33
  59. package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +34 -67
  60. package/lib/cjs/components/InlineComposerWidget/Skeleton.d.ts +4 -5
  61. package/lib/cjs/components/InlineComposerWidget/Skeleton.js +17 -37
  62. package/lib/cjs/components/InlineComposerWidget/constants.d.ts +1 -0
  63. package/lib/cjs/components/InlineComposerWidget/constants.js +4 -0
  64. package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.d.ts +2 -2
  65. package/lib/cjs/components/LocationAutocomplete/LocationAutocomplete.js +4 -2
  66. package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +1 -1
  67. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +0 -5
  68. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +19 -30
  69. package/lib/cjs/components/NavigationToolbarMobile/Skeleton.js +5 -6
  70. package/lib/cjs/components/NavigationToolbarMobile/constants.d.ts +1 -0
  71. package/lib/cjs/components/NavigationToolbarMobile/constants.js +4 -0
  72. package/lib/cjs/constants/Composer.d.ts +2 -0
  73. package/lib/cjs/constants/Composer.js +4 -2
  74. package/lib/cjs/index.d.ts +12 -12
  75. package/lib/cjs/index.js +14 -17
  76. package/lib/cjs/shared/Lightbox/Lightbox.js +2 -2
  77. package/lib/{esm/shared/Media/Image/PreviewComponent.d.ts → cjs/shared/Media/File/DisplayComponent.d.ts} +1 -11
  78. package/lib/cjs/shared/Media/{Image/PreviewComponent.js → File/DisplayComponent.js} +55 -145
  79. package/lib/{esm/shared/Media/Image/PreviewImage → cjs/shared/Media/File/Lightbox}/index.d.ts +4 -3
  80. package/lib/cjs/shared/Media/File/Lightbox/index.js +37 -0
  81. package/lib/cjs/shared/Media/File/PreviewComponent.d.ts +9 -0
  82. package/lib/cjs/shared/Media/File/PreviewComponent.js +51 -0
  83. package/lib/cjs/shared/Media/File/TriggerButton.d.ts +12 -0
  84. package/lib/cjs/shared/Media/File/TriggerButton.js +112 -0
  85. package/lib/cjs/shared/Media/File/asUploadButton.d.ts +7 -0
  86. package/lib/cjs/shared/Media/File/asUploadButton.js +30 -0
  87. package/lib/cjs/shared/Media/File/constants.d.ts +1 -0
  88. package/lib/cjs/shared/Media/File/constants.js +4 -0
  89. package/lib/cjs/shared/Media/File/filter.d.ts +3 -0
  90. package/lib/cjs/shared/Media/File/filter.js +4 -0
  91. package/lib/cjs/shared/Media/File/index.d.ts +3 -0
  92. package/lib/cjs/shared/Media/File/index.js +16 -0
  93. package/lib/cjs/shared/Media/Link/DisplayComponent.d.ts +20 -0
  94. package/lib/cjs/shared/Media/Link/DisplayComponent.js +69 -0
  95. package/lib/cjs/shared/Media/Link/LayerComponent.d.ts +9 -0
  96. package/lib/cjs/shared/Media/Link/LayerComponent.js +46 -0
  97. package/lib/cjs/shared/Media/Link/PreviewComponent.d.ts +7 -21
  98. package/lib/cjs/shared/Media/Link/PreviewComponent.js +28 -56
  99. package/lib/cjs/shared/Media/Link/TriggerButton.d.ts +4 -0
  100. package/lib/cjs/shared/Media/Link/TriggerButton.js +21 -0
  101. package/lib/cjs/shared/Media/Link/UrlTextField/index.js +1 -2
  102. package/lib/cjs/shared/Media/Link/constants.d.ts +1 -0
  103. package/lib/cjs/shared/Media/Link/constants.js +4 -0
  104. package/lib/cjs/shared/Media/Link/filter.d.ts +3 -0
  105. package/lib/cjs/shared/Media/Link/filter.js +4 -0
  106. package/lib/cjs/shared/Media/Link/index.js +9 -8
  107. package/lib/cjs/shared/Media/Share/DisplayComponent.d.ts +11 -0
  108. package/lib/cjs/shared/Media/Share/DisplayComponent.js +31 -0
  109. package/lib/cjs/shared/Media/Share/constants.d.ts +1 -0
  110. package/lib/cjs/shared/Media/Share/constants.js +4 -0
  111. package/lib/cjs/shared/Media/Share/filter.d.ts +3 -0
  112. package/lib/cjs/shared/Media/Share/filter.js +4 -0
  113. package/lib/cjs/shared/Media/Share/index.js +7 -7
  114. package/lib/cjs/shared/Media/index.d.ts +2 -4
  115. package/lib/cjs/shared/Media/index.js +3 -7
  116. package/lib/cjs/types/composer.d.ts +15 -0
  117. package/lib/cjs/types/composer.js +2 -0
  118. package/lib/cjs/types/media.d.ts +9 -5
  119. package/lib/esm/components/BottomNavigation/BottomNavigation.js +8 -11
  120. package/lib/esm/components/Composer/Attributes/Attributes.d.ts +22 -0
  121. package/lib/esm/components/Composer/Attributes/Attributes.js +38 -0
  122. package/lib/esm/components/Composer/Attributes/index.d.ts +3 -0
  123. package/lib/esm/components/Composer/Attributes/index.js +2 -0
  124. package/lib/esm/components/Composer/Composer.d.ts +61 -84
  125. package/lib/esm/components/Composer/Composer.js +262 -437
  126. package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.d.ts +32 -0
  127. package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +50 -0
  128. package/lib/esm/components/Composer/Content/ContentDiscussion/index.d.ts +3 -0
  129. package/lib/esm/components/Composer/Content/ContentDiscussion/index.js +2 -0
  130. package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.d.ts +26 -0
  131. package/lib/esm/components/Composer/Content/ContentPoll/ContentPoll.js +127 -0
  132. package/lib/esm/components/Composer/Content/ContentPoll/index.d.ts +3 -0
  133. package/lib/esm/components/Composer/Content/ContentPoll/index.js +2 -0
  134. package/lib/esm/components/Composer/Content/ContentPost/ContentPost.d.ts +32 -0
  135. package/lib/esm/components/Composer/Content/ContentPost/ContentPost.js +49 -0
  136. package/lib/esm/components/Composer/Content/ContentPost/index.d.ts +3 -0
  137. package/lib/esm/components/Composer/Content/ContentPost/index.js +2 -0
  138. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +11 -0
  139. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +72 -0
  140. package/lib/esm/components/Composer/Layer/AudienceLayer/index.d.ts +3 -0
  141. package/lib/esm/components/Composer/Layer/AudienceLayer/index.js +2 -0
  142. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +9 -0
  143. package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +39 -0
  144. package/lib/esm/components/Composer/Layer/CategoryLayer/index.d.ts +3 -0
  145. package/lib/esm/components/Composer/Layer/CategoryLayer/index.js +2 -0
  146. package/lib/esm/components/Composer/Layer/CloseLayer/CloseLayer.d.ts +7 -0
  147. package/lib/esm/components/Composer/Layer/CloseLayer/CloseLayer.js +39 -0
  148. package/lib/esm/components/Composer/Layer/CloseLayer/index.d.ts +3 -0
  149. package/lib/esm/components/Composer/Layer/CloseLayer/index.js +2 -0
  150. package/lib/esm/components/Composer/Layer/LocationLayer/LocationLayer.d.ts +9 -0
  151. package/lib/esm/components/Composer/Layer/LocationLayer/LocationLayer.js +39 -0
  152. package/lib/esm/components/Composer/Layer/LocationLayer/index.d.ts +3 -0
  153. package/lib/esm/components/Composer/Layer/LocationLayer/index.js +2 -0
  154. package/lib/esm/components/Composer/Skeleton.d.ts +0 -4
  155. package/lib/esm/components/Composer/Skeleton.js +6 -68
  156. package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.d.ts +6 -0
  157. package/lib/esm/components/Composer/TypeSwitchButtonGroup/TypeSwitchButtonGroup.js +44 -0
  158. package/lib/esm/components/Composer/TypeSwitchButtonGroup/index.d.ts +3 -0
  159. package/lib/esm/components/Composer/TypeSwitchButtonGroup/index.js +2 -0
  160. package/lib/esm/components/Composer/constants.d.ts +1 -0
  161. package/lib/esm/components/Composer/constants.js +1 -0
  162. package/lib/esm/components/Composer/index.d.ts +2 -3
  163. package/lib/esm/components/Composer/index.js +1 -3
  164. package/lib/esm/components/ComposerIconButton/ComposerIconButton.d.ts +2 -1
  165. package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +8 -8
  166. package/lib/esm/components/Editor/Editor.js +16 -7
  167. package/lib/esm/components/Feed/Feed.js +4 -4
  168. package/lib/esm/components/Feed/prefetchedData.d.ts +2 -368
  169. package/lib/esm/components/Feed/prefetchedData.js +17 -16
  170. package/lib/esm/components/FeedObject/Actions/Share/Share.js +4 -4
  171. package/lib/esm/components/FeedObject/FeedObject.d.ts +2 -2
  172. package/lib/esm/components/FeedObject/FeedObject.js +8 -8
  173. package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.d.ts +38 -0
  174. package/lib/esm/components/FeedObjectMediaPreview/FeedObjectMediaPreview.js +64 -0
  175. package/lib/esm/components/FeedObjectMediaPreview/index.d.ts +3 -0
  176. package/lib/esm/components/FeedObjectMediaPreview/index.js +2 -0
  177. package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.d.ts +25 -33
  178. package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +31 -64
  179. package/lib/esm/components/InlineComposerWidget/Skeleton.d.ts +4 -5
  180. package/lib/esm/components/InlineComposerWidget/Skeleton.js +15 -35
  181. package/lib/esm/components/InlineComposerWidget/constants.d.ts +1 -0
  182. package/lib/esm/components/InlineComposerWidget/constants.js +1 -0
  183. package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.d.ts +2 -2
  184. package/lib/esm/components/LocationAutocomplete/LocationAutocomplete.js +4 -2
  185. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.d.ts +1 -1
  186. package/lib/esm/components/NavigationMenuIconButton/NavigationMenuIconButton.js +1 -1
  187. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +0 -5
  188. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +12 -23
  189. package/lib/esm/components/NavigationToolbarMobile/Skeleton.js +3 -4
  190. package/lib/esm/components/NavigationToolbarMobile/constants.d.ts +1 -0
  191. package/lib/esm/components/NavigationToolbarMobile/constants.js +1 -0
  192. package/lib/esm/constants/Composer.d.ts +2 -0
  193. package/lib/esm/constants/Composer.js +3 -1
  194. package/lib/esm/index.d.ts +12 -12
  195. package/lib/esm/index.js +33 -33
  196. package/lib/esm/shared/Lightbox/Lightbox.js +2 -2
  197. package/lib/{cjs/shared/Media/Image/PreviewComponent.d.ts → esm/shared/Media/File/DisplayComponent.d.ts} +1 -11
  198. package/lib/esm/shared/Media/{Image/PreviewComponent.js → File/DisplayComponent.js} +50 -140
  199. package/lib/{cjs/shared/Media/Image/PreviewImage → esm/shared/Media/File/Lightbox}/index.d.ts +4 -3
  200. package/lib/esm/shared/Media/File/Lightbox/index.js +34 -0
  201. package/lib/esm/shared/Media/File/PreviewComponent.d.ts +9 -0
  202. package/lib/esm/shared/Media/File/PreviewComponent.js +49 -0
  203. package/lib/esm/shared/Media/File/TriggerButton.d.ts +12 -0
  204. package/lib/esm/shared/Media/File/TriggerButton.js +110 -0
  205. package/lib/esm/shared/Media/File/asUploadButton.d.ts +7 -0
  206. package/lib/esm/shared/Media/File/asUploadButton.js +28 -0
  207. package/lib/esm/shared/Media/File/constants.d.ts +1 -0
  208. package/lib/esm/shared/Media/File/constants.js +1 -0
  209. package/lib/esm/shared/Media/File/filter.d.ts +3 -0
  210. package/lib/esm/shared/Media/File/filter.js +2 -0
  211. package/lib/esm/shared/Media/File/index.d.ts +3 -0
  212. package/lib/esm/shared/Media/File/index.js +13 -0
  213. package/lib/esm/shared/Media/Link/DisplayComponent.d.ts +20 -0
  214. package/lib/esm/shared/Media/Link/DisplayComponent.js +67 -0
  215. package/lib/esm/shared/Media/Link/LayerComponent.d.ts +9 -0
  216. package/lib/esm/shared/Media/Link/LayerComponent.js +44 -0
  217. package/lib/esm/shared/Media/Link/PreviewComponent.d.ts +7 -21
  218. package/lib/esm/shared/Media/Link/PreviewComponent.js +27 -54
  219. package/lib/esm/shared/Media/Link/TriggerButton.d.ts +4 -0
  220. package/lib/esm/shared/Media/Link/TriggerButton.js +19 -0
  221. package/lib/esm/shared/Media/Link/UrlTextField/index.js +2 -3
  222. package/lib/esm/shared/Media/Link/constants.d.ts +1 -0
  223. package/lib/esm/shared/Media/Link/constants.js +1 -0
  224. package/lib/esm/shared/Media/Link/filter.d.ts +3 -0
  225. package/lib/esm/shared/Media/Link/filter.js +2 -0
  226. package/lib/esm/shared/Media/Link/index.js +9 -8
  227. package/lib/esm/shared/Media/Share/DisplayComponent.d.ts +11 -0
  228. package/lib/esm/shared/Media/Share/DisplayComponent.js +29 -0
  229. package/lib/esm/shared/Media/Share/constants.d.ts +1 -0
  230. package/lib/esm/shared/Media/Share/constants.js +1 -0
  231. package/lib/esm/shared/Media/Share/filter.d.ts +3 -0
  232. package/lib/esm/shared/Media/Share/filter.js +2 -0
  233. package/lib/esm/shared/Media/Share/index.js +7 -7
  234. package/lib/esm/shared/Media/index.d.ts +2 -4
  235. package/lib/esm/shared/Media/index.js +2 -4
  236. package/lib/esm/types/composer.d.ts +15 -0
  237. package/lib/esm/types/composer.js +1 -0
  238. package/lib/esm/types/media.d.ts +9 -5
  239. package/lib/umd/react-ui.js +1 -1
  240. package/package.json +7 -7
  241. package/lib/cjs/components/Composer/Audience/Audience.d.ts +0 -71
  242. package/lib/cjs/components/Composer/Audience/Audience.js +0 -69
  243. package/lib/cjs/components/Composer/Audience/index.d.ts +0 -3
  244. package/lib/cjs/components/Composer/Poll/Poll.d.ts +0 -31
  245. package/lib/cjs/components/Composer/Poll/Poll.js +0 -151
  246. package/lib/cjs/components/Composer/Poll/index.d.ts +0 -3
  247. package/lib/cjs/shared/Media/Document/EditButton.d.ts +0 -2
  248. package/lib/cjs/shared/Media/Document/EditButton.js +0 -10
  249. package/lib/cjs/shared/Media/Document/EditComponent.d.ts +0 -3
  250. package/lib/cjs/shared/Media/Document/EditComponent.js +0 -103
  251. package/lib/cjs/shared/Media/Document/PreviewComponent.d.ts +0 -3
  252. package/lib/cjs/shared/Media/Document/PreviewComponent.js +0 -43
  253. package/lib/cjs/shared/Media/Document/index.d.ts +0 -3
  254. package/lib/cjs/shared/Media/Document/index.js +0 -16
  255. package/lib/cjs/shared/Media/Image/EditButton.d.ts +0 -2
  256. package/lib/cjs/shared/Media/Image/EditButton.js +0 -10
  257. package/lib/cjs/shared/Media/Image/EditComponent.d.ts +0 -3
  258. package/lib/cjs/shared/Media/Image/EditComponent.js +0 -102
  259. package/lib/cjs/shared/Media/Image/PreviewImage/index.js +0 -41
  260. package/lib/cjs/shared/Media/Image/index.d.ts +0 -3
  261. package/lib/cjs/shared/Media/Image/index.js +0 -16
  262. package/lib/cjs/shared/Media/Link/EditButton.d.ts +0 -2
  263. package/lib/cjs/shared/Media/Link/EditButton.js +0 -10
  264. package/lib/cjs/shared/Media/Link/EditComponent.d.ts +0 -3
  265. package/lib/cjs/shared/Media/Link/EditComponent.js +0 -46
  266. package/lib/cjs/shared/Media/Share/PreviewComponent.d.ts +0 -7
  267. package/lib/cjs/shared/Media/Share/PreviewComponent.js +0 -32
  268. package/lib/cjs/shared/Media/Video/EditButton.d.ts +0 -2
  269. package/lib/cjs/shared/Media/Video/EditButton.js +0 -10
  270. package/lib/cjs/shared/Media/Video/EditComponent.d.ts +0 -3
  271. package/lib/cjs/shared/Media/Video/EditComponent.js +0 -89
  272. package/lib/cjs/shared/Media/Video/PreviewComponent.d.ts +0 -19
  273. package/lib/cjs/shared/Media/Video/PreviewComponent.js +0 -37
  274. package/lib/cjs/shared/Media/Video/index.d.ts +0 -3
  275. package/lib/cjs/shared/Media/Video/index.js +0 -16
  276. package/lib/cjs/shared/MediasPreview/index.d.ts +0 -18
  277. package/lib/cjs/shared/MediasPreview/index.js +0 -44
  278. package/lib/esm/components/Composer/Audience/Audience.d.ts +0 -71
  279. package/lib/esm/components/Composer/Audience/Audience.js +0 -66
  280. package/lib/esm/components/Composer/Audience/index.d.ts +0 -3
  281. package/lib/esm/components/Composer/Audience/index.js +0 -2
  282. package/lib/esm/components/Composer/Poll/Poll.d.ts +0 -31
  283. package/lib/esm/components/Composer/Poll/Poll.js +0 -149
  284. package/lib/esm/components/Composer/Poll/index.d.ts +0 -3
  285. package/lib/esm/components/Composer/Poll/index.js +0 -2
  286. package/lib/esm/shared/Media/Document/EditButton.d.ts +0 -2
  287. package/lib/esm/shared/Media/Document/EditButton.js +0 -7
  288. package/lib/esm/shared/Media/Document/EditComponent.d.ts +0 -3
  289. package/lib/esm/shared/Media/Document/EditComponent.js +0 -101
  290. package/lib/esm/shared/Media/Document/PreviewComponent.d.ts +0 -3
  291. package/lib/esm/shared/Media/Document/PreviewComponent.js +0 -41
  292. package/lib/esm/shared/Media/Document/index.d.ts +0 -3
  293. package/lib/esm/shared/Media/Document/index.js +0 -13
  294. package/lib/esm/shared/Media/Image/EditButton.d.ts +0 -2
  295. package/lib/esm/shared/Media/Image/EditButton.js +0 -7
  296. package/lib/esm/shared/Media/Image/EditComponent.d.ts +0 -3
  297. package/lib/esm/shared/Media/Image/EditComponent.js +0 -100
  298. package/lib/esm/shared/Media/Image/PreviewImage/index.js +0 -38
  299. package/lib/esm/shared/Media/Image/index.d.ts +0 -3
  300. package/lib/esm/shared/Media/Image/index.js +0 -13
  301. package/lib/esm/shared/Media/Link/EditButton.d.ts +0 -2
  302. package/lib/esm/shared/Media/Link/EditButton.js +0 -7
  303. package/lib/esm/shared/Media/Link/EditComponent.d.ts +0 -3
  304. package/lib/esm/shared/Media/Link/EditComponent.js +0 -43
  305. package/lib/esm/shared/Media/Share/PreviewComponent.d.ts +0 -7
  306. package/lib/esm/shared/Media/Share/PreviewComponent.js +0 -29
  307. package/lib/esm/shared/Media/Video/EditButton.d.ts +0 -2
  308. package/lib/esm/shared/Media/Video/EditButton.js +0 -7
  309. package/lib/esm/shared/Media/Video/EditComponent.d.ts +0 -3
  310. package/lib/esm/shared/Media/Video/EditComponent.js +0 -87
  311. package/lib/esm/shared/Media/Video/PreviewComponent.d.ts +0 -19
  312. package/lib/esm/shared/Media/Video/PreviewComponent.js +0 -34
  313. package/lib/esm/shared/Media/Video/index.d.ts +0 -3
  314. package/lib/esm/shared/Media/Video/index.js +0 -13
  315. package/lib/esm/shared/MediasPreview/index.d.ts +0 -18
  316. package/lib/esm/shared/MediasPreview/index.js +0 -42
@@ -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.|
@@ -1,7 +1,7 @@
1
1
  import { __rest } from "tslib";
2
2
  import { Button, IconButton, styled, Toolbar } from '@mui/material';
3
- import React, { useMemo, useState } from 'react';
4
- import { Link, SCPreferences, SCRoutes, useSCPreferences, useSCRouting, useSCUser } from '@selfcommunity/react-core';
3
+ import React, { useCallback, useState } from 'react';
4
+ import { Link, SCPreferences, SCRoutes, useSCPreferences, useSCRouting, useSCUser, } from '@selfcommunity/react-core';
5
5
  import Icon from '@mui/material/Icon';
6
6
  import { useThemeProps } from '@mui/system';
7
7
  import classNames from 'classnames';
@@ -9,25 +9,21 @@ import NavigationToolbarMobileSkeleton from './Skeleton';
9
9
  import { FormattedMessage } from 'react-intl';
10
10
  import SearchDialog from '../SearchDialog';
11
11
  import NavigationSettingsIconButton from '../NavigationSettingsIconButton';
12
- import ComposerIconButton from '../ComposerIconButton';
13
12
  import NavigationMenuIconButton from '../NavigationMenuIconButton';
14
- const PREFIX = 'SCNavigationToolbarMobile';
13
+ import { PREFIX } from './constants';
15
14
  const classes = {
16
15
  root: `${PREFIX}-root`,
17
16
  logo: `${PREFIX}-logo`,
18
17
  search: `${PREFIX}-search`,
19
18
  searchDialog: `${PREFIX}-search-dialog`,
20
- composer: `${PREFIX}-composer`,
21
19
  settings: `${PREFIX}-settings`,
22
20
  settingsDialog: `${PREFIX}-settings-dialog`,
23
21
  login: `${PREFIX}-login`
24
22
  };
25
23
  const Root = styled(Toolbar, {
26
24
  name: PREFIX,
27
- slot: 'Root',
28
- overridesResolver: (props, styles) => styles.root
25
+ slot: 'Root'
29
26
  })(() => ({}));
30
- const PREFERENCES = [SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY, SCPreferences.LOGO_NAVBAR_LOGO_MOBILE];
31
27
  /**
32
28
  * > API documentation for the Community-JS Navigation Toolbar Mobile component. Learn about the available props and the CSS API.
33
29
  *
@@ -54,7 +50,6 @@ const PREFERENCES = [SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY, SCPrefer
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.|
@@ -67,26 +62,21 @@ export default function NavigationToolbarMobile(inProps) {
67
62
  props: inProps,
68
63
  name: PREFIX
69
64
  });
70
- const { className = '', disableSearch = false, disableComposer = false, SearchAutocompleteProps = {}, children = null, startActions = null, endActions = null, NavigationSettingsIconButtonComponent = NavigationSettingsIconButton } = props, rest = __rest(props, ["className", "disableSearch", "disableComposer", "SearchAutocompleteProps", "children", "startActions", "endActions", "NavigationSettingsIconButtonComponent"]);
65
+ const { className = '', disableSearch = false, SearchAutocompleteProps = {}, children = null, startActions = null, endActions = null, NavigationSettingsIconButtonComponent = NavigationSettingsIconButton } = props, rest = __rest(props, ["className", "disableSearch", "SearchAutocompleteProps", "children", "startActions", "endActions", "NavigationSettingsIconButtonComponent"]);
71
66
  // CONTEXT
72
67
  const scUserContext = useSCUser();
73
68
  const scRoutingContext = useSCRouting();
74
69
  // PREFERENCES
75
- const scPreferences = useSCPreferences();
76
- const preferences = useMemo(() => {
77
- const _preferences = {};
78
- PREFERENCES.map((p) => (_preferences[p] = p in scPreferences.preferences ? scPreferences.preferences[p].value : null));
79
- return _preferences;
80
- }, [scPreferences.preferences]);
70
+ const { preferences } = useSCPreferences();
81
71
  // STATE
82
72
  const [searchOpen, setSearchOpen] = useState(false);
83
73
  // HANDLERS
84
- const handleOpenSearch = () => {
74
+ const handleOpenSearch = useCallback(() => {
85
75
  setSearchOpen(true);
86
- };
87
- const handleCloseSearch = () => {
76
+ }, []);
77
+ const handleCloseSearch = useCallback(() => {
88
78
  setSearchOpen(false);
89
- };
79
+ }, []);
90
80
  // RENDER
91
81
  if (scUserContext.loading) {
92
82
  return React.createElement(NavigationToolbarMobileSkeleton, null);
@@ -94,15 +84,14 @@ export default function NavigationToolbarMobile(inProps) {
94
84
  const _children = children || (React.createElement(React.Fragment, null,
95
85
  React.createElement(NavigationMenuIconButton, null),
96
86
  React.createElement(Link, { to: scRoutingContext.url(SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo },
97
- React.createElement("img", { src: preferences[SCPreferences.LOGO_NAVBAR_LOGO_MOBILE], alt: "logo" }))));
87
+ React.createElement("img", { src: preferences[SCPreferences.LOGO_NAVBAR_LOGO_MOBILE].value, alt: "logo" }))));
98
88
  return (React.createElement(Root, Object.assign({ className: classNames(className, classes.root) }, rest),
99
89
  _children,
100
90
  startActions,
101
- (preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && !disableSearch && (React.createElement(React.Fragment, null,
91
+ (preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value || scUserContext.user) && !disableSearch && (React.createElement(React.Fragment, null,
102
92
  React.createElement(IconButton, { className: classes.search, onClick: handleOpenSearch },
103
93
  React.createElement(Icon, null, "search")),
104
94
  React.createElement(SearchDialog, { className: classes.searchDialog, fullScreen: true, open: searchOpen, SearchAutocompleteProps: Object.assign(Object.assign({}, SearchAutocompleteProps), { onClear: handleCloseSearch }) }))),
105
- scUserContext.user && !disableComposer && React.createElement(ComposerIconButton, { className: classes.composer }),
106
95
  endActions,
107
96
  scUserContext.user ? (React.createElement(NavigationSettingsIconButtonComponent, { className: classes.settings })) : (React.createElement(Button, { className: classes.login, color: "inherit", component: Link, to: scRoutingContext.url(SCRoutes.SIGNIN_ROUTE_NAME, {}) },
108
97
  React.createElement(FormattedMessage, { id: "ui.appBar.navigation.login", defaultMessage: "ui.appBar.navigation.login" })))));
@@ -2,15 +2,14 @@ import React from 'react';
2
2
  import { Toolbar } from '@mui/material';
3
3
  import { styled } from '@mui/material/styles';
4
4
  import Skeleton from '@mui/material/Skeleton';
5
- const PREFIX = 'SCNavigationToolbarMobileSkeleton';
5
+ import { PREFIX } from './constants';
6
6
  const classes = {
7
- root: `${PREFIX}-root`,
7
+ root: `${PREFIX}-skeleton-root`,
8
8
  logo: `${PREFIX}-logo`
9
9
  };
10
10
  const Root = styled(Toolbar, {
11
11
  name: PREFIX,
12
- slot: 'Root',
13
- overridesResolver: (props, styles) => styles.root
12
+ slot: 'SkeletonRoot'
14
13
  })(() => ({}));
15
14
  /**
16
15
  * > API documentation for the Community-JS Navigation Toolbar Mobile Skeleton component. Learn about the available props and the CSS API.
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCNavigationToolbarMobile";
@@ -0,0 +1 @@
1
+ export const PREFIX = 'SCNavigationToolbarMobile';
@@ -1,8 +1,10 @@
1
1
  export declare const COMPOSER_TYPE_DISCUSSION = "discussion";
2
2
  export declare const COMPOSER_TYPE_POST = "post";
3
+ export declare const COMPOSER_TYPE_POLL = "poll";
3
4
  export declare const COMPOSER_TYPES: {
4
5
  discussion: string;
5
6
  post: string;
7
+ poll: string;
6
8
  };
7
9
  export declare const COMPOSER_TITLE_MAX_LENGTH = 160;
8
10
  export declare const COMPOSER_POLL_TITLE_MAX_LENGTH = 160;