@selfcommunity/react-ui 0.7.9-alpha.9 → 0.7.9

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 (181) hide show
  1. package/lib/cjs/components/AccountRecover/AccountRecover.js +6 -1
  2. package/lib/cjs/components/BottomNavigation/BottomNavigation.js +4 -3
  3. package/lib/cjs/components/CategoryHeader/Skeleton.js +3 -2
  4. package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.js +6 -6
  5. package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +19 -16
  6. package/lib/cjs/components/Composer/Attributes/Attributes.js +3 -3
  7. package/lib/cjs/components/Composer/Composer.js +3 -3
  8. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +1 -1
  9. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +9 -19
  10. package/lib/cjs/components/Editor/Editor.js +2 -0
  11. package/lib/cjs/components/Editor/nodes/ImageNode.js +6 -0
  12. package/lib/cjs/components/Editor/plugins/ImagePlugin.js +4 -0
  13. package/lib/cjs/components/Editor/plugins/ToolbarPlugin.js +17 -3
  14. package/lib/cjs/components/FeedObject/Actions/Share/Share.js +18 -16
  15. package/lib/cjs/components/FeedObject/Contributors/Contributors.js +1 -1
  16. package/lib/cjs/components/FeedObject/FeedObject.d.ts +1 -0
  17. package/lib/cjs/components/FeedObject/FeedObject.js +27 -8
  18. package/lib/cjs/components/FeedObject/Poll/Poll.js +20 -20
  19. package/lib/cjs/components/FeedUpdatesWidget/FeedUpdatesWidget.js +1 -1
  20. package/lib/cjs/components/Footer/Footer.js +1 -1
  21. package/lib/cjs/components/Group/Group.d.ts +9 -1
  22. package/lib/cjs/components/Group/Group.js +18 -6
  23. package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.d.ts +0 -1
  24. package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.js +1 -2
  25. package/lib/cjs/components/GroupForm/GroupForm.js +64 -13
  26. package/lib/cjs/components/GroupHeader/GroupHeader.d.ts +2 -3
  27. package/lib/cjs/components/GroupHeader/GroupHeader.js +38 -5
  28. package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +63 -9
  29. package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +29 -7
  30. package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.d.ts +73 -0
  31. package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +220 -0
  32. package/lib/cjs/components/GroupInvitedWidget/Skeleton.d.ts +22 -0
  33. package/lib/cjs/components/GroupInvitedWidget/Skeleton.js +38 -0
  34. package/lib/cjs/components/GroupInvitedWidget/constants.d.ts +1 -0
  35. package/lib/cjs/components/GroupInvitedWidget/constants.js +4 -0
  36. package/lib/cjs/components/GroupInvitedWidget/index.d.ts +4 -0
  37. package/lib/cjs/components/GroupInvitedWidget/index.js +8 -0
  38. package/lib/cjs/components/GroupMembersButton/GroupMembersButton.js +6 -2
  39. package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +21 -6
  40. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +12 -2
  41. package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +13 -12
  42. package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.d.ts +4 -12
  43. package/lib/cjs/components/GroupSettingsIconButton/GroupSettingsIconButton.js +33 -19
  44. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -3
  45. package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +22 -6
  46. package/lib/cjs/components/Groups/Groups.d.ts +15 -8
  47. package/lib/cjs/components/Groups/Groups.js +86 -32
  48. package/lib/cjs/components/Groups/Skeleton.d.ts +4 -0
  49. package/lib/cjs/components/Groups/Skeleton.js +2 -2
  50. package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +7 -0
  51. package/lib/cjs/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +4 -4
  52. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +9 -2
  53. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -0
  54. package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +9 -1
  55. package/lib/cjs/components/Notification/Group/Group.d.ts +15 -0
  56. package/lib/cjs/components/Notification/Group/Group.js +78 -0
  57. package/lib/cjs/components/Notification/Group/index.d.ts +3 -0
  58. package/lib/cjs/components/Notification/Group/index.js +5 -0
  59. package/lib/cjs/components/Notification/Notification.js +31 -1
  60. package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +16 -5
  61. package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +7 -1
  62. package/lib/cjs/components/PrivateMessageComponent/PrivateMessageComponent.js +16 -8
  63. package/lib/cjs/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -1
  64. package/lib/cjs/components/PrivateMessageSnippetItem/PrivateMessageSnippetItem.js +11 -6
  65. package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts +9 -4
  66. package/lib/cjs/components/PrivateMessageSnippets/PrivateMessageSnippets.js +24 -6
  67. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.d.ts +6 -1
  68. package/lib/cjs/components/PrivateMessageThread/PrivateMessageThread.js +46 -20
  69. package/lib/cjs/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +6 -0
  70. package/lib/cjs/components/SearchAutocomplete/SearchAutocomplete.js +22 -5
  71. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +7 -0
  72. package/lib/cjs/components/ToastNotifications/ToastNotifications.js +7 -0
  73. package/lib/cjs/components/User/User.d.ts +6 -1
  74. package/lib/cjs/components/User/User.js +5 -4
  75. package/lib/cjs/components/UserSubscribedGroupsWidget/Skeleton.d.ts +21 -0
  76. package/lib/cjs/components/UserSubscribedGroupsWidget/Skeleton.js +46 -0
  77. package/lib/cjs/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.d.ts +68 -0
  78. package/lib/cjs/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.js +183 -0
  79. package/lib/cjs/components/UserSubscribedGroupsWidget/constants.d.ts +1 -0
  80. package/lib/cjs/components/UserSubscribedGroupsWidget/constants.js +4 -0
  81. package/lib/cjs/components/UserSubscribedGroupsWidget/index.d.ts +4 -0
  82. package/lib/cjs/components/UserSubscribedGroupsWidget/index.js +8 -0
  83. package/lib/cjs/components/VoteAudienceButton/VoteAudienceButton.js +1 -1
  84. package/lib/cjs/constants/PubSub.d.ts +28 -0
  85. package/lib/cjs/constants/PubSub.js +22 -0
  86. package/lib/cjs/index.d.ts +5 -3
  87. package/lib/cjs/index.js +11 -4
  88. package/lib/cjs/types/index.d.ts +2 -1
  89. package/lib/esm/components/AccountRecover/AccountRecover.js +6 -1
  90. package/lib/esm/components/BottomNavigation/BottomNavigation.js +5 -4
  91. package/lib/esm/components/CategoryHeader/Skeleton.js +3 -2
  92. package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.js +6 -6
  93. package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +19 -16
  94. package/lib/esm/components/Composer/Attributes/Attributes.js +3 -3
  95. package/lib/esm/components/Composer/Composer.js +3 -3
  96. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +1 -1
  97. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +9 -19
  98. package/lib/esm/components/Editor/Editor.js +2 -0
  99. package/lib/esm/components/Editor/nodes/ImageNode.js +6 -0
  100. package/lib/esm/components/Editor/plugins/ImagePlugin.js +4 -0
  101. package/lib/esm/components/Editor/plugins/ToolbarPlugin.js +19 -5
  102. package/lib/esm/components/FeedObject/Actions/Share/Share.js +19 -17
  103. package/lib/esm/components/FeedObject/Contributors/Contributors.js +1 -1
  104. package/lib/esm/components/FeedObject/FeedObject.d.ts +1 -0
  105. package/lib/esm/components/FeedObject/FeedObject.js +28 -9
  106. package/lib/esm/components/FeedObject/Poll/Poll.js +20 -20
  107. package/lib/esm/components/FeedUpdatesWidget/FeedUpdatesWidget.js +1 -1
  108. package/lib/esm/components/Footer/Footer.js +2 -2
  109. package/lib/esm/components/Group/Group.d.ts +9 -1
  110. package/lib/esm/components/Group/Group.js +22 -10
  111. package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.d.ts +0 -1
  112. package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.js +1 -2
  113. package/lib/esm/components/GroupForm/GroupForm.js +64 -13
  114. package/lib/esm/components/GroupHeader/GroupHeader.d.ts +2 -3
  115. package/lib/esm/components/GroupHeader/GroupHeader.js +40 -7
  116. package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +63 -9
  117. package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +29 -7
  118. package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.d.ts +73 -0
  119. package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +217 -0
  120. package/lib/esm/components/GroupInvitedWidget/Skeleton.d.ts +22 -0
  121. package/lib/esm/components/GroupInvitedWidget/Skeleton.js +34 -0
  122. package/lib/esm/components/GroupInvitedWidget/constants.d.ts +1 -0
  123. package/lib/esm/components/GroupInvitedWidget/constants.js +1 -0
  124. package/lib/esm/components/GroupInvitedWidget/index.d.ts +4 -0
  125. package/lib/esm/components/GroupInvitedWidget/index.js +4 -0
  126. package/lib/esm/components/GroupMembersButton/GroupMembersButton.js +7 -3
  127. package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +22 -7
  128. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +12 -2
  129. package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +13 -12
  130. package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.d.ts +4 -12
  131. package/lib/esm/components/GroupSettingsIconButton/GroupSettingsIconButton.js +33 -19
  132. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +3 -3
  133. package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +22 -6
  134. package/lib/esm/components/Groups/Groups.d.ts +15 -8
  135. package/lib/esm/components/Groups/Groups.js +91 -37
  136. package/lib/esm/components/Groups/Skeleton.d.ts +4 -0
  137. package/lib/esm/components/Groups/Skeleton.js +2 -2
  138. package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +9 -2
  139. package/lib/esm/components/NavigationSettingsIconButton/NavigationSettingsIconButton.js +4 -4
  140. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +10 -3
  141. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -0
  142. package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +11 -3
  143. package/lib/esm/components/Notification/Group/Group.d.ts +15 -0
  144. package/lib/esm/components/Notification/Group/Group.js +75 -0
  145. package/lib/esm/components/Notification/Group/index.d.ts +3 -0
  146. package/lib/esm/components/Notification/Group/index.js +2 -0
  147. package/lib/esm/components/Notification/Notification.js +31 -1
  148. package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +16 -5
  149. package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.d.ts +7 -1
  150. package/lib/esm/components/PrivateMessageComponent/PrivateMessageComponent.js +17 -9
  151. package/lib/esm/components/PrivateMessageSettingsIconButton/PrivateMessageSettingsIconButton.js +1 -1
  152. package/lib/esm/components/PrivateMessageSnippetItem/PrivateMessageSnippetItem.js +11 -6
  153. package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.d.ts +9 -4
  154. package/lib/esm/components/PrivateMessageSnippets/PrivateMessageSnippets.js +26 -8
  155. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.d.ts +6 -1
  156. package/lib/esm/components/PrivateMessageThread/PrivateMessageThread.js +48 -22
  157. package/lib/esm/components/PrivateMessageThreadItem/PrivateMessageThreadItem.js +7 -1
  158. package/lib/esm/components/SearchAutocomplete/SearchAutocomplete.js +22 -5
  159. package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +7 -0
  160. package/lib/esm/components/ToastNotifications/ToastNotifications.js +7 -0
  161. package/lib/esm/components/User/User.d.ts +6 -1
  162. package/lib/esm/components/User/User.js +5 -4
  163. package/lib/esm/components/UserSubscribedGroupsWidget/Skeleton.d.ts +21 -0
  164. package/lib/esm/components/UserSubscribedGroupsWidget/Skeleton.js +42 -0
  165. package/lib/esm/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.d.ts +68 -0
  166. package/lib/esm/components/UserSubscribedGroupsWidget/UserSubscribedGroupsWidget.js +180 -0
  167. package/lib/esm/components/UserSubscribedGroupsWidget/constants.d.ts +1 -0
  168. package/lib/esm/components/UserSubscribedGroupsWidget/constants.js +1 -0
  169. package/lib/esm/components/UserSubscribedGroupsWidget/index.d.ts +4 -0
  170. package/lib/esm/components/UserSubscribedGroupsWidget/index.js +4 -0
  171. package/lib/esm/components/VoteAudienceButton/VoteAudienceButton.js +1 -1
  172. package/lib/esm/constants/PubSub.d.ts +28 -0
  173. package/lib/esm/constants/PubSub.js +19 -0
  174. package/lib/esm/index.d.ts +5 -3
  175. package/lib/esm/index.js +4 -2
  176. package/lib/esm/types/index.d.ts +2 -1
  177. package/lib/umd/311.js +2 -0
  178. package/lib/umd/react-ui.js +1 -1
  179. package/package.json +10 -10
  180. package/lib/umd/871.js +0 -2
  181. /package/lib/umd/{871.js.LICENSE.txt → 311.js.LICENSE.txt} +0 -0
@@ -10,7 +10,7 @@ export declare enum AudienceTypes {
10
10
  AUDIENCE_GROUP = "group"
11
11
  }
12
12
  export interface AudienceLayerProps extends Omit<BoxProps, 'defaultValue'>, ComposerLayerProps {
13
- defaultValue: SCTagType[] | SCGroupType;
13
+ defaultValue: SCTagType[] | SCGroupType | any;
14
14
  TextFieldProps?: TextFieldProps;
15
15
  }
16
16
  declare const AudienceLayer: React.ForwardRefExoticComponent<Pick<AudienceLayerProps, "p" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "marginInline" | "marginInlineStart" | "marginInlineEnd" | "marginBlock" | "marginBlockStart" | "marginBlockEnd" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "paddingInline" | "paddingInlineStart" | "paddingInlineEnd" | "paddingBlock" | "paddingBlockStart" | "paddingBlockEnd" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform" | "component" | "sx" | "classes" | "onClose" | "TextFieldProps" | "onSave"> & React.RefAttributes<unknown>>;
@@ -43,7 +43,7 @@ const AudienceLayer = React.forwardRef((props, ref) => {
43
43
  // @ts-ignore
44
44
  defaultValue === null || defaultValue.length === 0
45
45
  ? AudienceTypes.AUDIENCE_ALL
46
- : typeof defaultValue === 'object'
46
+ : defaultValue && Object.prototype.hasOwnProperty.call(defaultValue, 'managed_by')
47
47
  ? AudienceTypes.AUDIENCE_GROUP
48
48
  : AudienceTypes.AUDIENCE_TAG);
49
49
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -52,15 +52,15 @@ const AudienceLayer = React.forwardRef((props, ref) => {
52
52
  // HOOKS
53
53
  const { scAddressingTags } = useSCFetchAddressingTagList({ fetch: autocompleteOpen });
54
54
  // HANDLERS
55
- const handleSave = useCallback(
56
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
57
- // @ts-ignore
58
- () => (typeof defaultValue === 'object' ? onSave(value) : onSave((value === null || value === void 0 ? void 0 : value.length) && (value === null || value === void 0 ? void 0 : value.length) > 0 ? value : null)), [value, onSave]);
55
+ const handleSave = useCallback(() => {
56
+ audience === AudienceTypes.AUDIENCE_GROUP ? onSave(value) : onSave((value === null || value === void 0 ? void 0 : value.length) && (value === null || value === void 0 ? void 0 : value.length) > 0 ? value : null);
57
+ }, [value, onSave, audience]);
59
58
  const handleChange = useCallback((event, tags) => setValue(tags), []);
60
59
  const handleGroupChange = useCallback((group) => setValue(group), []);
61
60
  const handleChangeAudience = useCallback((event, data) => setAudience(data), []);
62
61
  const handleAutocompleteOpen = useCallback(() => setAutocompleteOpen(true), []);
63
62
  const handleAutocompleteClose = useCallback(() => setAutocompleteOpen(false), []);
63
+ console.log(defaultValue);
64
64
  return (React.createElement(Root, Object.assign({ ref: ref, className: classNames(className, classes.root) }, rest),
65
65
  React.createElement(DialogTitle, { className: classes.title },
66
66
  React.createElement(IconButton, { onClick: onClose },
@@ -72,20 +72,10 @@ const AudienceLayer = React.forwardRef((props, ref) => {
72
72
  React.createElement(DialogContent, { className: classes.content },
73
73
  React.createElement(Tabs, { value: audience, onChange: handleChangeAudience, "aria-label": "audience type" },
74
74
  React.createElement(Tab, { value: AudienceTypes.AUDIENCE_ALL, icon: React.createElement(Icon, null, "public"), label: React.createElement(FormattedMessage, { id: "ui.composer.layer.audience.all", defaultMessage: "ui.composer.layer.audience.all" }) }),
75
- React.createElement(Tab
76
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
77
- // @ts-ignore
78
- , {
79
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
80
- // @ts-ignore
81
- disabled: defaultValue && defaultValue.length !== 0, value: AudienceTypes.AUDIENCE_GROUP, icon: React.createElement(Icon, null, "groups"), label: React.createElement(FormattedMessage, { id: "ui.composer.layer.audience.group", defaultMessage: "ui.composer.layer.audience.group" }) }),
82
- React.createElement(Tab
83
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
84
- // @ts-ignore
85
- , {
86
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
87
- // @ts-ignore
88
- disabled: typeof defaultValue === 'object', value: AudienceTypes.AUDIENCE_TAG, icon: React.createElement(Icon, null, "label"), label: React.createElement(FormattedMessage, { id: "ui.composer.layer.audience.tag", defaultMessage: "ui.composer.layer.audience.tag" }) })),
75
+ React.createElement(Tab, { disabled: (Boolean(value === null || value === void 0 ? void 0 : value.length) && !Object.prototype.hasOwnProperty.call(value, 'managed_by')) ||
76
+ (value !== undefined && Boolean(!(value === null || value === void 0 ? void 0 : value.length)) && audience !== AudienceTypes.AUDIENCE_ALL) ||
77
+ (Boolean((value === null || value === void 0 ? void 0 : value.length) === 0) && audience === AudienceTypes.AUDIENCE_ALL && Boolean((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) !== 0)), value: AudienceTypes.AUDIENCE_GROUP, icon: React.createElement(Icon, null, "groups"), label: React.createElement(FormattedMessage, { id: "ui.composer.layer.audience.group", defaultMessage: "ui.composer.layer.audience.group" }) }),
78
+ React.createElement(Tab, { disabled: value && Object.prototype.hasOwnProperty.call(value, 'managed_by'), value: AudienceTypes.AUDIENCE_TAG, icon: React.createElement(Icon, null, "label"), label: React.createElement(FormattedMessage, { id: "ui.composer.layer.audience.tag", defaultMessage: "ui.composer.layer.audience.tag" }) })),
89
79
  React.createElement(Typography, { className: classes.message },
90
80
  audience === AudienceTypes.AUDIENCE_ALL && (React.createElement(FormattedMessage, { id: "ui.composer.layer.audience.all.message", defaultMessage: "ui.composer.audience.layer.all.message" })),
91
81
  audience === AudienceTypes.AUDIENCE_GROUP && (React.createElement(FormattedMessage, { id: "ui.composer.layer.audience.group.message", defaultMessage: "ui.composer.audience.layer.group.message" })),
@@ -132,6 +132,8 @@ const Editor = (inProps, ref) => {
132
132
  }
133
133
  }));
134
134
  // RENDER
135
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
136
+ // @ts-ignore
135
137
  const initialConfig = useMemo(() => ({
136
138
  namespace: 'LexicalEditor',
137
139
  editable: editable,
@@ -101,6 +101,8 @@ function convertImageElement(domNode) {
101
101
  }
102
102
  return null;
103
103
  }
104
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
105
+ // @ts-ignore
104
106
  export class ImageNode extends DecoratorNode {
105
107
  constructor(src, altText, maxWidth, key) {
106
108
  super(key);
@@ -166,8 +168,12 @@ export class ImageNode extends DecoratorNode {
166
168
  }
167
169
  exportJSON() {
168
170
  return {
171
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
172
+ // @ts-ignore
169
173
  altText: this.getAltText(),
170
174
  maxWidth: this.__maxWidth,
175
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
176
+ // @ts-ignore
171
177
  src: this.getSrc(),
172
178
  type: 'image',
173
179
  version: 1
@@ -76,6 +76,8 @@ const Root = styled(Image, {
76
76
  export default function ImagePlugin() {
77
77
  const [editor] = useLexicalComposerContext();
78
78
  useEffect(() => {
79
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
80
+ // @ts-ignore
79
81
  if (!editor.hasNodes([ImageNode])) {
80
82
  return;
81
83
  }
@@ -92,6 +94,8 @@ export default function ImagePlugin() {
92
94
  return true;
93
95
  }, COMMAND_PRIORITY_EDITOR);
94
96
  }, [editor]);
97
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
98
+ // @ts-ignore
95
99
  if (!editor.hasNodes([ImageNode])) {
96
100
  return null;
97
101
  }
@@ -5,14 +5,14 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { $createParagraphNode, $getSelection, $isRangeSelection, $isRootOrShadowRoot, $isTextNode, COMMAND_PRIORITY_CRITICAL, DEPRECATED_$isGridSelection, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, SELECTION_CHANGE_COMMAND } from 'lexical';
8
+ import { $createParagraphNode, $getSelection, $isRangeSelection, $isRootOrShadowRoot, $isTextNode, COMMAND_PRIORITY_CRITICAL, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, SELECTION_CHANGE_COMMAND } from 'lexical';
9
9
  import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
10
10
  import { $isListNode, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, ListNode, REMOVE_LIST_COMMAND } from '@lexical/list';
11
11
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
12
12
  import { $isDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
13
13
  import { $createHeadingNode, $createQuoteNode, $isHeadingNode, $isQuoteNode } from '@lexical/rich-text';
14
14
  import { $setBlocksType } from '@lexical/selection';
15
- import { $isTableNode } from '@lexical/table';
15
+ import { $isTableNode, $isTableSelection } from '@lexical/table';
16
16
  import { $findMatchingParent, $getNearestBlockElementAncestorOrThrow, $getNearestNodeOfType, mergeRegister } from '@lexical/utils';
17
17
  import * as React from 'react';
18
18
  import { useCallback, useEffect, useState } from 'react';
@@ -47,7 +47,7 @@ function BlockFormatIconButton({ className = '', editor, blockType, disabled = f
47
47
  const formatParagraph = () => {
48
48
  editor.update(() => {
49
49
  const selection = $getSelection();
50
- if ($isRangeSelection(selection) || DEPRECATED_$isGridSelection(selection)) {
50
+ if ($isRangeSelection(selection) || $isTableSelection(selection)) {
51
51
  $setBlocksType(selection, () => $createParagraphNode());
52
52
  }
53
53
  });
@@ -56,7 +56,7 @@ function BlockFormatIconButton({ className = '', editor, blockType, disabled = f
56
56
  if (blockType !== headingSize) {
57
57
  editor.update(() => {
58
58
  const selection = $getSelection();
59
- if ($isRangeSelection(selection) || DEPRECATED_$isGridSelection(selection)) {
59
+ if ($isRangeSelection(selection) || $isTableSelection(selection)) {
60
60
  $setBlocksType(selection, () => $createHeadingNode(headingSize));
61
61
  }
62
62
  });
@@ -82,7 +82,7 @@ function BlockFormatIconButton({ className = '', editor, blockType, disabled = f
82
82
  if (blockType !== 'quote') {
83
83
  editor.update(() => {
84
84
  const selection = $getSelection();
85
- if ($isRangeSelection(selection) || DEPRECATED_$isGridSelection(selection)) {
85
+ if ($isRangeSelection(selection) || $isTableSelection(selection)) {
86
86
  $setBlocksType(selection, () => $createQuoteNode());
87
87
  }
88
88
  });
@@ -166,6 +166,8 @@ export default function ToolbarPlugin(inProps) {
166
166
  const elementDOM = activeEditor.getElementByKey(elementKey);
167
167
  // Update text format
168
168
  setFormats(FORMATS.filter((f) => selection.hasFormat(f)));
169
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
170
+ // @ts-ignore
169
171
  setAlignment(ALIGNMENTS.find((a) => element.getFormatType() === a) || ALIGNMENTS[0]);
170
172
  // Update links
171
173
  const node = getSelectedNode(selection);
@@ -191,6 +193,8 @@ export default function ToolbarPlugin(inProps) {
191
193
  setBlockType(type);
192
194
  }
193
195
  else {
196
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
197
+ // @ts-ignore
194
198
  const type = $isHeadingNode(element) ? element.getTag() : element.getType();
195
199
  if (type in blockTypeToBlockIcon) {
196
200
  setBlockType(type);
@@ -233,12 +237,22 @@ export default function ToolbarPlugin(inProps) {
233
237
  node = node.splitText(anchor.offset)[1] || node;
234
238
  }
235
239
  if (idx === nodes.length - 1) {
240
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
241
+ // @ts-ignore
236
242
  node = node.splitText(focus.offset)[0] || node;
237
243
  }
244
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
245
+ // @ts-ignore
238
246
  if (node.__style !== '') {
247
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
248
+ // @ts-ignore
239
249
  node.setStyle('');
240
250
  }
251
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
252
+ // @ts-ignore
241
253
  if (node.__format !== 0) {
254
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
255
+ // @ts-ignore
242
256
  node.setFormat(0);
243
257
  $getNearestBlockElementAncestorOrThrow(node).setFormat('');
244
258
  }
@@ -13,7 +13,7 @@ import { SCOPE_SC_UI } from '../../../../constants/Errors';
13
13
  import classNames from 'classnames';
14
14
  import { useSnackbar } from 'notistack';
15
15
  import Skeleton from '@mui/material/Skeleton';
16
- import { SCContributionType } from '@selfcommunity/types';
16
+ import { SCContributionType, SCGroupPrivacyType } from '@selfcommunity/types';
17
17
  import { Endpoints, http } from '@selfcommunity/api-services';
18
18
  import { copyTextToClipboard, Logger } from '@selfcommunity/utils';
19
19
  import { SCPreferences, SCPreferencesContext, UserUtils, useSCContext, useSCFetchFeedObject, useSCRouting, useSCUser } from '@selfcommunity/react-core';
@@ -68,6 +68,7 @@ export default function Share(props) {
68
68
  const { enqueueSnackbar } = useSnackbar();
69
69
  const domain = typeof location !== 'undefined' && location.origin ? location.origin : '';
70
70
  const url = domain + scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj));
71
+ const isGroupPublic = useMemo(() => feedObject.group && feedObject.group.privacy === SCGroupPrivacyType.PUBLIC, [feedObject.group]);
71
72
  // INTL
72
73
  const intl = useIntl();
73
74
  // HANDLERS
@@ -186,22 +187,23 @@ export default function Share(props) {
186
187
  }
187
188
  function renderShareMenuItems() {
188
189
  return (React.createElement(Box, null,
189
- React.createElement(MenuItem, { onClick: () => share(false) },
190
- React.createElement(ListItemIcon, null,
191
- React.createElement(Icon, { fontSize: "small" }, "redo")),
192
- React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: "ui.feedObject.share.shareNow", defaultMessage: "ui.feedObject.share.shareNow" }) })),
193
- facebookShareEnabled && (React.createElement(MenuItem, { onClick: () => window.open(FACEBOOK_SHARE + url, 'facebook-share-dialog', 'width=626,height=436') },
194
- React.createElement(ListItemIcon, null,
195
- React.createElement(Icon, { fontSize: "small" }, "facebook")),
196
- React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: "ui.feedObject.share.facebook", defaultMessage: "ui.feedObject.share.facebook" }) }))),
197
- twitterShareEnabled && (React.createElement(MenuItem, { onClick: () => window.open(TWITTER_SHARE + url, 'twitter-share-dialog', 'width=626,height=436') },
198
- React.createElement(ListItemIcon, null,
199
- React.createElement(Icon, { fontSize: "small" }, "twitter")),
200
- React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: "ui.feedObject.share.twitter", defaultMessage: "ui.feedObject.share.twitter" }) }))),
201
- linkedinShareEnabled && (React.createElement(MenuItem, { onClick: () => window.open(LINKEDIN_SHARE + url, 'linkedin-share-dialog', 'width=626,height=436') },
202
- React.createElement(ListItemIcon, null,
203
- React.createElement(Icon, { fontSize: "small" }, "linkedin")),
204
- React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: "ui.feedObject.share.linkedin", defaultMessage: "ui.feedObject.share.linkedin" }) }))),
190
+ (!feedObject.group || isGroupPublic) && (React.createElement(React.Fragment, null,
191
+ React.createElement(MenuItem, { onClick: () => share(false) },
192
+ React.createElement(ListItemIcon, null,
193
+ React.createElement(Icon, { fontSize: "small" }, "redo")),
194
+ React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: "ui.feedObject.share.shareNow", defaultMessage: "ui.feedObject.share.shareNow" }) })),
195
+ facebookShareEnabled && (React.createElement(MenuItem, { onClick: () => window.open(FACEBOOK_SHARE + url, 'facebook-share-dialog', 'width=626,height=436') },
196
+ React.createElement(ListItemIcon, null,
197
+ React.createElement(Icon, { fontSize: "small" }, "facebook")),
198
+ React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: "ui.feedObject.share.facebook", defaultMessage: "ui.feedObject.share.facebook" }) }))),
199
+ twitterShareEnabled && (React.createElement(MenuItem, { onClick: () => window.open(TWITTER_SHARE + url, 'twitter-share-dialog', 'width=626,height=436') },
200
+ React.createElement(ListItemIcon, null,
201
+ React.createElement(Icon, { fontSize: "small" }, "twitter")),
202
+ React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: "ui.feedObject.share.twitter", defaultMessage: "ui.feedObject.share.twitter" }) }))),
203
+ linkedinShareEnabled && (React.createElement(MenuItem, { onClick: () => window.open(LINKEDIN_SHARE + url, 'linkedin-share-dialog', 'width=626,height=436') },
204
+ React.createElement(ListItemIcon, null,
205
+ React.createElement(Icon, { fontSize: "small" }, "linkedin")),
206
+ React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: "ui.feedObject.share.linkedin", defaultMessage: "ui.feedObject.share.linkedin" }) }))))),
205
207
  React.createElement(MenuItem, null,
206
208
  React.createElement(ListItemIcon, null,
207
209
  React.createElement(Icon, { fontSize: "small" }, "link")),
@@ -58,5 +58,5 @@ export default function ContributorsFeedObject(props) {
58
58
  openContributorsDialog && (React.createElement(BaseDialog, { title: React.createElement(FormattedMessage, { defaultMessage: "ui.feedObject.contributors.title", id: "ui.feedObject.contributors.title", values: { total: contributorsObject.total } }), onClose: () => setOpenContributorsDialog(false), open: openContributorsDialog }, contributorsObject.isLoadingNext ? (React.createElement(CentralProgress, { size: 50 })) : (React.createElement(InfiniteScroll, { dataLength: contributorsObject.contributors.length, next: contributorsObject.getNextPage(), hasMoreNext: Boolean(contributorsObject.next), loaderNext: React.createElement(CentralProgress, { size: 30 }), height: 400, endMessage: React.createElement(Typography, { variant: "body2", align: "center", fontWeight: "bold" },
59
59
  React.createElement(FormattedMessage, { id: "ui.feedObject.contributors.noOtherContributors", defaultMessage: "ui.feedObject.contributors.noOtherContributors" })) },
60
60
  React.createElement(List, null, contributorsObject.contributors.map((c, i) => (React.createElement(ListItem, { key: i },
61
- React.createElement(User, { elevation: 0, user: c, key: c.id, sx: { m: 0 } }))))))))))) : null)))));
61
+ React.createElement(User, { elevation: 0, user: c, key: c.id, sx: { m: 0 }, onClick: () => setOpenContributorsDialog(false) }))))))))))) : null)))));
62
62
  }
@@ -188,6 +188,7 @@ export interface FeedObjectProps extends CardProps, VirtualScrollerItemProps {
188
188
  |deleted|.SCFeedObject-deleted|Styles applied to the feed obj when is deleted (visible only for admin and moderator).|
189
189
  |header|.SCFeedObject-header|Styles applied to the header of the card.|
190
190
  |category|.SCFeedObject-category|Styles applied to the category element.|
191
+ |group|.SCFeedObject-group|Styles applied to the group element.|
191
192
  |avatar|.SCFeedObject-avatar|Styles applied to the avatar element.|
192
193
  |username|.SCFeedObject-username|Styles applied to the username element.|
193
194
  |activityAt|.SCFeedObject-activity-at|Styles applied to the activity at section.|
@@ -2,7 +2,7 @@ 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, Chip, 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';
@@ -40,6 +40,10 @@ const messages = defineMessages({
40
40
  visibleToAll: {
41
41
  id: 'ui.feedObject.visibleToAll',
42
42
  defaultMessage: 'ui.feedObject.visibleToAll'
43
+ },
44
+ visibleToGroup: {
45
+ id: 'ui.feedObject.visibleToGroup',
46
+ defaultMessage: 'ui.feedObject.visibleToGroup'
43
47
  }
44
48
  });
45
49
  const classes = {
@@ -47,6 +51,7 @@ const classes = {
47
51
  deleted: `${PREFIX}-deleted`,
48
52
  header: `${PREFIX}-header`,
49
53
  category: `${PREFIX}-category`,
54
+ group: `${PREFIX}-group`,
50
55
  avatar: `${PREFIX}-avatar`,
51
56
  username: `${PREFIX}-username`,
52
57
  activityAt: `${PREFIX}-activity-at`,
@@ -100,6 +105,7 @@ const Root = styled(Widget, {
100
105
  |deleted|.SCFeedObject-deleted|Styles applied to the feed obj when is deleted (visible only for admin and moderator).|
101
106
  |header|.SCFeedObject-header|Styles applied to the header of the card.|
102
107
  |category|.SCFeedObject-category|Styles applied to the category element.|
108
+ |group|.SCFeedObject-group|Styles applied to the group element.|
103
109
  |avatar|.SCFeedObject-avatar|Styles applied to the avatar element.|
104
110
  |username|.SCFeedObject-username|Styles applied to the username element.|
105
111
  |activityAt|.SCFeedObject-activity-at|Styles applied to the activity at section.|
@@ -167,7 +173,7 @@ export default function FeedObject(inProps) {
167
173
  }, [onStateChange, onHeightChange]);
168
174
  /**
169
175
  * Update state object
170
- * @param obj
176
+ * @param newObj
171
177
  */
172
178
  const updateObject = (newObj) => {
173
179
  setObj(newObj);
@@ -196,8 +202,10 @@ export default function FeedObject(inProps) {
196
202
  /**
197
203
  * Handle change/update poll: votes
198
204
  */
199
- const handleChangePoll = useCallback((pollObject) => {
200
- updateObject(Object.assign({}, obj, { poll: pollObject }));
205
+ const handleChangePoll = useCallback((pollChoices) => {
206
+ if ('poll' in obj) {
207
+ updateObject(Object.assign({}, obj, { poll: Object.assign(Object.assign({}, obj.poll), { choices: pollChoices }) }));
208
+ }
201
209
  }, [obj]);
202
210
  /**
203
211
  * Handle change poll visibility
@@ -424,8 +432,13 @@ export default function FeedObject(inProps) {
424
432
  template === SCFeedObjectTemplateType.DETAIL ||
425
433
  template === SCFeedObjectTemplateType.SEARCH) {
426
434
  objElement = (React.createElement(React.Fragment, null, obj ? (React.createElement(Box, { className: classNames({ [classes.deleted]: obj && obj.deleted }) },
427
- obj.categories.length > 0 && (React.createElement("div", { className: classes.category }, obj.categories.map((c) => (React.createElement(Link, { to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, c), key: c.id },
428
- React.createElement(Typography, { variant: "overline" }, c.name)))))),
435
+ obj.categories.length > 0 && (React.createElement("div", { className: classes.category },
436
+ React.createElement(React.Fragment, null, obj.group && (React.createElement("div", { className: classes.group },
437
+ React.createElement(Chip, { color: "secondary", size: "small", key: obj.group.id, icon: React.createElement(Icon, null, "groups"), component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true })))),
438
+ obj.categories.map((c) => (React.createElement(Link, { to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, c), key: c.id },
439
+ React.createElement(Typography, { variant: "overline" }, c.name)))))),
440
+ obj.group && !obj.categories.length && (React.createElement("div", { className: classes.group },
441
+ React.createElement(Chip, { color: "secondary", size: "small", key: obj.group.id, icon: React.createElement(Icon, null, "groups"), label: obj.group.name, component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }))),
429
442
  React.createElement(CardHeader, { className: classes.header, avatar: React.createElement(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null }),
430
443
  React.createElement(UserAvatar, { hide: !obj.author.community_badge },
431
444
  React.createElement(Avatar, { "aria-label": "recipe", src: obj.author.avatar, className: classes.avatar }, obj.author.username))), title: React.createElement(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }), obj.author.username), subheader: React.createElement(React.Fragment, null,
@@ -437,7 +450,8 @@ export default function FeedObject(inProps) {
437
450
  React.createElement(Icon, null, "add_location_alt"), (_a = obj.location) === null || _a === void 0 ? void 0 :
438
451
  _a.location))),
439
452
  React.createElement(Bullet, null),
440
- React.createElement(Box, { className: classes.tag }, obj.addressing.length > 0 ? (React.createElement(Tags, { tags: obj.addressing, TagChipProps: { disposable: false, clickable: false } })) : (React.createElement(Tooltip, { title: `${intl.formatMessage(messages.visibleToAll)}` },
453
+ React.createElement(Box, { className: classes.tag }, obj.addressing.length > 0 ? (React.createElement(Tags, { tags: obj.addressing, TagChipProps: { disposable: false, clickable: false } })) : obj.group ? (React.createElement(Tooltip, { title: `${intl.formatMessage(messages.visibleToGroup, { group: obj.group.name })}` },
454
+ React.createElement(Icon, { color: "disabled", fontSize: "small" }, "groups"))) : (React.createElement(Tooltip, { title: `${intl.formatMessage(messages.visibleToAll)}` },
441
455
  React.createElement(Icon, { color: "disabled", fontSize: "small" }, "public"))))), action: renderHeaderAction() }),
442
456
  React.createElement(CardContent, { classes: { root: classes.content } },
443
457
  React.createElement(Box, { className: classes.titleSection }, 'title' in obj && (React.createElement(React.Fragment, null, template === SCFeedObjectTemplateType.DETAIL ? (React.createElement(Typography, { variant: "body1", gutterBottom: true, className: classes.title }, obj.title)) : (React.createElement(Link, { to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)) },
@@ -466,8 +480,13 @@ export default function FeedObject(inProps) {
466
480
  }
467
481
  else if (template === SCFeedObjectTemplateType.SHARE) {
468
482
  objElement = (React.createElement(React.Fragment, null, obj ? (React.createElement(React.Fragment, null,
469
- obj.categories.length > 0 && (React.createElement("div", { className: classes.category }, obj.categories.map((c) => (React.createElement(Link, { to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, c), key: c.id },
470
- React.createElement(Typography, { variant: "overline" }, c.name)))))),
483
+ obj.categories.length > 0 && (React.createElement("div", { className: classes.category },
484
+ React.createElement(React.Fragment, null, obj.group && (React.createElement("div", { className: classes.group },
485
+ React.createElement(Chip, { color: "secondary", size: "small", key: obj.group.id, icon: React.createElement(Icon, null, "groups"), component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true })))),
486
+ obj.categories.map((c) => (React.createElement(Link, { to: scRoutingContext.url(SCRoutes.CATEGORY_ROUTE_NAME, c), key: c.id },
487
+ React.createElement(Typography, { variant: "overline" }, c.name)))))),
488
+ obj.group && !obj.categories.length && (React.createElement("div", { className: classes.group },
489
+ React.createElement(Chip, { color: "secondary", size: "small", key: obj.group.id, icon: React.createElement(Icon, null, "groups"), label: obj.group.name, component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, obj.group), clickable: true }))),
471
490
  React.createElement(CardHeader, { classes: { root: classes.header }, avatar: React.createElement(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }),
472
491
  React.createElement(UserAvatar, { hide: !obj.author.community_badge },
473
492
  React.createElement(Avatar, { "aria-label": "recipe", src: obj.author.avatar, className: classes.avatar }, obj.author.username))), title: React.createElement(Link, Object.assign({}, (!obj.author.deleted && { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, obj.author) }), { onClick: obj.author.deleted ? () => setOpenAlert(true) : null, className: classes.username }), obj.author.username), subheader: React.createElement(Link, { to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), className: classes.activityAt },
@@ -67,36 +67,36 @@ export default function PollObject(props) {
67
67
  * Handles choice upvote
68
68
  */
69
69
  const handleVote = (id) => {
70
+ const prevChoices = [...choices];
71
+ let updatedChoices;
70
72
  if (multipleChoices) {
71
- setChoices((prevChoices) => {
72
- return prevChoices.map((choice) => Object.assign({}, choice, {
73
- voted: choice.id === id ? true : choice.voted,
74
- vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count
75
- }));
76
- });
73
+ updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
74
+ voted: choice.id === id ? true : choice.voted,
75
+ vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count
76
+ }));
77
77
  setVotes((prevVotes) => prevVotes + 1);
78
78
  }
79
79
  else {
80
- setChoices((prevChoices) => {
81
- const updatedChoices = prevChoices.map((choice) => {
82
- return Object.assign(Object.assign({}, choice), { voted: choice.id === id, vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count > 0 && choice.voted ? choice.vote_count - 1 : choice.vote_count });
83
- });
84
- const newVotes = updatedChoices.reduce((totalVotes, choice) => totalVotes + choice.vote_count, 0);
85
- setVotes(newVotes);
86
- return updatedChoices;
87
- });
80
+ updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
81
+ voted: choice.id === id,
82
+ vote_count: choice.id === id ? choice.vote_count + 1 : choice.vote_count > 0 && choice.voted ? choice.vote_count - 1 : choice.vote_count
83
+ }));
84
+ setVotes(updatedChoices.reduce((totalVotes, choice) => totalVotes + choice.vote_count, 0));
88
85
  }
86
+ setChoices(updatedChoices);
87
+ onChange(updatedChoices);
89
88
  };
90
89
  /**
91
90
  * Handles choice unvote
92
91
  */
93
92
  const handleUnVote = (id) => {
94
- setChoices((prevChoices) => {
95
- return prevChoices.map((choice) => Object.assign({}, choice, {
96
- voted: choice.id === id ? false : choice.voted,
97
- vote_count: choice.id === id && choice.vote_count > 0 ? choice.vote_count - 1 : choice.vote_count
98
- }));
99
- });
93
+ const prevChoices = [...choices];
94
+ const updatedChoices = prevChoices.map((choice) => Object.assign({}, choice, {
95
+ voted: choice.id === id ? false : choice.voted,
96
+ vote_count: choice.id === id && choice.vote_count > 0 ? choice.vote_count - 1 : choice.vote_count
97
+ }));
98
+ setChoices(updatedChoices);
99
+ onChange(updatedChoices);
100
100
  setVotes((prevVotes) => prevVotes - 1);
101
101
  };
102
102
  /**
@@ -55,7 +55,7 @@ export default function FeedUpdatesWidget(inProps) {
55
55
  const [updates, setUpdates] = useState(false);
56
56
  // REFS
57
57
  const updatesSubscription = useRef(null);
58
- // Subscripber for pubsub callback
58
+ // Subscriber for pubsub callback
59
59
  const subscriber = (msg, data) => {
60
60
  if (subscriptionChannelUpdatesCallback(msg, data)) {
61
61
  setUpdates(true);
@@ -5,7 +5,7 @@ import { styled } from '@mui/material/styles';
5
5
  import { Box, Button, Typography } from '@mui/material';
6
6
  import classNames from 'classnames';
7
7
  import { CustomMenuService } from '@selfcommunity/api-services';
8
- import { Logger } from '@selfcommunity/utils';
8
+ import { Logger, sortByAttr } from '@selfcommunity/utils';
9
9
  import { Link, SCPreferences, useSCPreferences } from '@selfcommunity/react-core';
10
10
  import { SCOPE_SC_UI } from '../../constants/Errors';
11
11
  import FooterSkeleton from './Skeleton';
@@ -94,7 +94,7 @@ export default function Footer(inProps) {
94
94
  }
95
95
  return (React.createElement(Root, Object.assign({}, rest, { className: classNames(classes.root, className) }),
96
96
  startActions,
97
- React.createElement(Box, { className: classes.itemList }, _menu.items.map((item, index) => (React.createElement(Button, { component: Link, key: item.id, className: classes.item, to: item.url, variant: "text" }, item.label)))),
97
+ React.createElement(Box, { className: classes.itemList }, sortByAttr(_menu.items, 'order').map((item, index) => (React.createElement(Button, { component: Link, key: item.id, className: classes.item, to: item.url, variant: "text" }, item.label)))),
98
98
  endActions,
99
99
  React.createElement(Typography, { textAlign: "center", className: classes.copyright, variant: "body2", dangerouslySetInnerHTML: { __html: copyright } })));
100
100
  }
@@ -27,6 +27,11 @@ export interface GroupProps extends WidgetProps {
27
27
  * @default false
28
28
  */
29
29
  hideActions?: boolean;
30
+ /**
31
+ * Prop to redirect the user to the group page
32
+ * @default false
33
+ */
34
+ actionRedirect?: boolean;
30
35
  /**
31
36
  * Props to spread to the button
32
37
  * @default {}
@@ -42,7 +47,7 @@ export interface GroupProps extends WidgetProps {
42
47
  *
43
48
  *
44
49
  * This component renders a group item.
45
- * Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/User)
50
+ * Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/Group)
46
51
 
47
52
  #### Import
48
53
 
@@ -61,6 +66,9 @@ export interface GroupProps extends WidgetProps {
61
66
  |---|---|---|
62
67
  |root|.SCGroup-root|Styles applied to the root element.|
63
68
  |avatar|.SCGroup-avatar|Styles applied to the avatar element.|
69
+ |actions|.SCGroup-actions|Styles applied to the actions section.|
70
+ |icon|.SCGroup-icon|Styles applied to the group privacy icon element.|
71
+
64
72
 
65
73
  *
66
74
  * @param inProps
@@ -1,9 +1,10 @@
1
1
  import { __rest } from "tslib";
2
- import React, { useState } from 'react';
2
+ import React, { useMemo, useState } from 'react';
3
3
  import { styled } from '@mui/material/styles';
4
- import { Avatar, Icon, Stack } from '@mui/material';
5
- import { Link, SCRoutes, useSCFetchGroup, useSCRouting } from '@selfcommunity/react-core';
6
- import { defineMessages, useIntl } from 'react-intl';
4
+ import { Avatar, Button, Icon, Stack } from '@mui/material';
5
+ import { SCGroupPrivacyType, SCGroupSubscriptionStatusType } from '@selfcommunity/types';
6
+ import { Link, SCRoutes, useSCFetchGroup, useSCRouting, useSCUser } from '@selfcommunity/react-core';
7
+ import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
7
8
  import classNames from 'classnames';
8
9
  import { useThemeProps } from '@mui/system';
9
10
  import BaseItemButton from '../../shared/BaseItemButton';
@@ -20,7 +21,8 @@ const messages = defineMessages({
20
21
  const classes = {
21
22
  root: `${PREFIX}-root`,
22
23
  avatar: `${PREFIX}-avatar`,
23
- actions: `${PREFIX}-actions`
24
+ actions: `${PREFIX}-actions`,
25
+ icon: `${PREFIX}-icon`
24
26
  };
25
27
  const Root = styled(BaseItemButton, {
26
28
  name: PREFIX,
@@ -32,7 +34,7 @@ const Root = styled(BaseItemButton, {
32
34
  *
33
35
  *
34
36
  * This component renders a group item.
35
- * Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/User)
37
+ * Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/Group)
36
38
 
37
39
  #### Import
38
40
 
@@ -51,21 +53,28 @@ const Root = styled(BaseItemButton, {
51
53
  |---|---|---|
52
54
  |root|.SCGroup-root|Styles applied to the root element.|
53
55
  |avatar|.SCGroup-avatar|Styles applied to the avatar element.|
56
+ |actions|.SCGroup-actions|Styles applied to the actions section.|
57
+ |icon|.SCGroup-icon|Styles applied to the group privacy icon element.|
58
+
54
59
 
55
60
  *
56
61
  * @param inProps
57
62
  */
58
63
  export default function Group(inProps) {
64
+ var _a;
59
65
  // PROPS
60
66
  const props = useThemeProps({
61
67
  props: inProps,
62
68
  name: PREFIX
63
69
  });
64
- const { groupId = null, group = null, className = null, elevation, hideActions = false, groupSubscribeButtonProps = {}, visible = true } = props, rest = __rest(props, ["groupId", "group", "className", "elevation", "hideActions", "groupSubscribeButtonProps", "visible"]);
70
+ const { groupId = null, group = null, className = null, elevation, hideActions = false, actionRedirect = false, groupSubscribeButtonProps = {} } = props, rest = __rest(props, ["groupId", "group", "className", "elevation", "hideActions", "actionRedirect", "groupSubscribeButtonProps"]);
65
71
  // STATE
66
72
  const { scGroup } = useSCFetchGroup({ id: groupId, group });
67
73
  // CONTEXT
68
74
  const scRoutingContext = useSCRouting();
75
+ const scUserContext = useSCUser();
76
+ // CONST
77
+ const isGroupAdmin = useMemo(() => { var _a; return scUserContext.user && ((_a = scGroup === null || scGroup === void 0 ? void 0 : scGroup.managed_by) === null || _a === void 0 ? void 0 : _a.id) === scUserContext.user.id; }, [scUserContext.user, (_a = scGroup === null || scGroup === void 0 ? void 0 : scGroup.managed_by) === null || _a === void 0 ? void 0 : _a.id]);
69
78
  const [openAlert, setOpenAlert] = useState(false);
70
79
  // INTL
71
80
  const intl = useIntl();
@@ -75,8 +84,8 @@ export default function Group(inProps) {
75
84
  */
76
85
  function renderAuthenticatedActions() {
77
86
  return (React.createElement(Stack, { className: classes.actions, direction: "row", alignItems: "center", justifyContent: "center", spacing: 2 },
78
- React.createElement(Icon, null, !visible ? 'private' : 'public'),
79
- React.createElement(GroupSubscribeButton, Object.assign({ group: group, groupId: groupId }, groupSubscribeButtonProps))));
87
+ isGroupAdmin && React.createElement(Icon, null, "face"),
88
+ actionRedirect ? (React.createElement(Button, { size: "small", variant: "outlined", component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, scGroup) }, scGroup.subscription_status === SCGroupSubscriptionStatusType.SUBSCRIBED ? (React.createElement(FormattedMessage, { defaultMessage: "ui.group.status.enter", id: "ui.group.status.enter" })) : (React.createElement(FormattedMessage, { defaultMessage: "ui.group.status.discover", id: "ui.group.status.discover" })))) : (React.createElement(GroupSubscribeButton, Object.assign({ group: group, groupId: groupId }, groupSubscribeButtonProps)))));
80
89
  }
81
90
  /**
82
91
  * Renders group object
@@ -88,6 +97,9 @@ export default function Group(inProps) {
88
97
  * Renders root object
89
98
  */
90
99
  return (React.createElement(React.Fragment, null,
91
- React.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: classNames(classes.root, className), ButtonBaseProps: { component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, scGroup) }, image: React.createElement(Avatar, { alt: scGroup.name, src: scGroup.image_medium, className: classes.avatar }), primary: scGroup.name, secondary: `${intl.formatMessage(messages.groupMembers, { total: scGroup.subscribers_counter })}`, actions: hideActions ? null : renderAuthenticatedActions() })),
100
+ React.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: classNames(classes.root, className), ButtonBaseProps: { component: Link, to: scRoutingContext.url(SCRoutes.GROUP_ROUTE_NAME, scGroup) }, image: React.createElement(Avatar, { alt: scGroup.name, src: scGroup.image_medium, className: classes.avatar }), primary: React.createElement(React.Fragment, null,
101
+ scGroup.name,
102
+ " ",
103
+ React.createElement(Icon, { className: classes.icon }, (group === null || group === void 0 ? void 0 : group.privacy) === SCGroupPrivacyType.PRIVATE ? 'private' : 'public')), secondary: `${intl.formatMessage(messages.groupMembers, { total: scGroup.subscribers_counter })}`, actions: hideActions ? null : renderAuthenticatedActions() })),
92
104
  openAlert && React.createElement(UserDeletedSnackBar, { open: openAlert, handleClose: () => setOpenAlert(false) })));
93
105
  }