@selfcommunity/react-ui 0.7.9-alpha.2 → 0.7.9-alpha.4
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.
- package/lib/cjs/components/BottomNavigation/BottomNavigation.js +3 -1
- package/lib/cjs/components/Composer/Attributes/Attributes.d.ts +1 -1
- package/lib/cjs/components/Composer/Attributes/Attributes.js +7 -0
- package/lib/cjs/components/Composer/Composer.d.ts +2 -1
- package/lib/cjs/components/Composer/Composer.js +40 -11
- package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +7 -3
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +9 -2
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +35 -13
- package/lib/cjs/components/CreateGroupButton/CreateGroupButton.d.ts +2 -2
- package/lib/cjs/components/CreateGroupButton/CreateGroupButton.js +5 -6
- package/lib/cjs/components/CustomAdv/CustomAdv.d.ts +4 -0
- package/lib/cjs/components/{CreateGroup/CreateGroup.d.ts → EditGroupButton/EditGroupButton.d.ts} +11 -16
- package/lib/cjs/components/EditGroupButton/EditGroupButton.js +57 -0
- package/lib/cjs/components/EditGroupButton/index.d.ts +3 -0
- package/lib/cjs/components/EditGroupButton/index.js +5 -0
- package/lib/cjs/components/Group/Group.d.ts +4 -3
- package/lib/cjs/components/Group/Group.js +2 -2
- package/lib/cjs/components/Group/Skeleton.js +1 -1
- package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.d.ts +49 -0
- package/lib/cjs/components/GroupAutocomplete/GroupAutocomplete.js +101 -0
- package/lib/cjs/components/GroupAutocomplete/index.d.ts +3 -0
- package/lib/cjs/components/GroupAutocomplete/index.js +5 -0
- package/lib/cjs/components/GroupForm/GroupForm.d.ts +70 -0
- package/lib/cjs/components/GroupForm/GroupForm.js +239 -0
- package/lib/cjs/components/GroupForm/constants.d.ts +1 -0
- package/lib/cjs/components/{CreateGroup → GroupForm}/constants.js +1 -1
- package/lib/cjs/components/GroupForm/index.d.ts +3 -0
- package/lib/cjs/components/GroupForm/index.js +5 -0
- package/lib/cjs/components/GroupHeader/GroupHeader.js +4 -2
- package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +8 -8
- package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +6 -4
- package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +19 -14
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +11 -1
- package/lib/cjs/components/Groups/Groups.d.ts +65 -0
- package/lib/cjs/components/Groups/Groups.js +181 -0
- package/lib/cjs/components/Groups/Skeleton.d.ts +34 -0
- package/lib/cjs/components/Groups/Skeleton.js +45 -0
- package/lib/cjs/components/Groups/constants.d.ts +1 -0
- package/lib/cjs/components/Groups/constants.js +4 -0
- package/lib/cjs/components/Groups/index.d.ts +4 -0
- package/lib/cjs/components/Groups/index.js +8 -0
- package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.d.ts +2 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +5 -1
- package/lib/cjs/index.d.ts +5 -3
- package/lib/cjs/index.js +10 -4
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +3 -1
- package/lib/esm/components/Composer/Attributes/Attributes.d.ts +1 -1
- package/lib/esm/components/Composer/Attributes/Attributes.js +7 -0
- package/lib/esm/components/Composer/Composer.d.ts +2 -1
- package/lib/esm/components/Composer/Composer.js +40 -11
- package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +7 -3
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.d.ts +9 -2
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +34 -13
- package/lib/esm/components/CreateGroupButton/CreateGroupButton.d.ts +2 -2
- package/lib/esm/components/CreateGroupButton/CreateGroupButton.js +5 -6
- package/lib/esm/components/CustomAdv/CustomAdv.d.ts +4 -0
- package/lib/esm/components/{CreateGroup/CreateGroup.d.ts → EditGroupButton/EditGroupButton.d.ts} +11 -16
- package/lib/esm/components/EditGroupButton/EditGroupButton.js +54 -0
- package/lib/esm/components/EditGroupButton/index.d.ts +3 -0
- package/lib/esm/components/EditGroupButton/index.js +2 -0
- package/lib/esm/components/Group/Group.d.ts +4 -3
- package/lib/esm/components/Group/Group.js +2 -2
- package/lib/esm/components/Group/Skeleton.js +1 -1
- package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.d.ts +49 -0
- package/lib/esm/components/GroupAutocomplete/GroupAutocomplete.js +99 -0
- package/lib/esm/components/GroupAutocomplete/index.d.ts +3 -0
- package/lib/esm/components/GroupAutocomplete/index.js +2 -0
- package/lib/esm/components/GroupForm/GroupForm.d.ts +70 -0
- package/lib/esm/components/GroupForm/GroupForm.js +236 -0
- package/lib/esm/components/GroupForm/constants.d.ts +1 -0
- package/lib/esm/components/GroupForm/constants.js +1 -0
- package/lib/esm/components/GroupForm/index.d.ts +3 -0
- package/lib/esm/components/GroupForm/index.js +2 -0
- package/lib/esm/components/GroupHeader/GroupHeader.js +4 -2
- package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +8 -8
- package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +6 -4
- package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +20 -15
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +11 -1
- package/lib/esm/components/Groups/Groups.d.ts +65 -0
- package/lib/esm/components/Groups/Groups.js +178 -0
- package/lib/esm/components/Groups/Skeleton.d.ts +34 -0
- package/lib/esm/components/Groups/Skeleton.js +42 -0
- package/lib/esm/components/Groups/constants.d.ts +1 -0
- package/lib/esm/components/Groups/constants.js +1 -0
- package/lib/esm/components/Groups/index.d.ts +4 -0
- package/lib/esm/components/Groups/index.js +4 -0
- package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.d.ts +2 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +5 -1
- package/lib/esm/index.d.ts +5 -3
- package/lib/esm/index.js +4 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +6 -6
- package/lib/cjs/components/CreateGroup/CreateGroup.js +0 -187
- package/lib/cjs/components/CreateGroup/constants.d.ts +0 -1
- package/lib/cjs/components/CreateGroup/index.d.ts +0 -3
- package/lib/cjs/components/CreateGroup/index.js +0 -5
- package/lib/esm/components/CreateGroup/CreateGroup.js +0 -184
- package/lib/esm/components/CreateGroup/constants.d.ts +0 -1
- package/lib/esm/components/CreateGroup/constants.js +0 -1
- package/lib/esm/components/CreateGroup/index.d.ts +0 -3
- package/lib/esm/components/CreateGroup/index.js +0 -2
|
@@ -20,9 +20,11 @@ const system_1 = require("@mui/system");
|
|
|
20
20
|
const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
|
|
21
21
|
const constants_1 = require("./constants");
|
|
22
22
|
const User_1 = tslib_1.__importStar(require("../User"));
|
|
23
|
+
const GroupInviteButton_1 = tslib_1.__importDefault(require("../GroupInviteButton"));
|
|
23
24
|
const classes = {
|
|
24
25
|
root: `${constants_1.PREFIX}-root`,
|
|
25
26
|
title: `${constants_1.PREFIX}-title`,
|
|
27
|
+
actions: `${constants_1.PREFIX}-actions`,
|
|
26
28
|
noResults: `${constants_1.PREFIX}-no-results`,
|
|
27
29
|
showMore: `${constants_1.PREFIX}-show-more`,
|
|
28
30
|
dialogRoot: `${constants_1.PREFIX}-dialog-root`,
|
|
@@ -175,20 +177,23 @@ function GroupMembersWidget(inProps) {
|
|
|
175
177
|
if (!state.initialized) {
|
|
176
178
|
return react_1.default.createElement(Skeleton_1.default, null);
|
|
177
179
|
}
|
|
178
|
-
const content = (react_1.default.createElement(
|
|
179
|
-
react_1.default.createElement(material_1.
|
|
180
|
-
react_1.default.createElement(
|
|
181
|
-
|
|
182
|
-
react_1.default.createElement(
|
|
183
|
-
|
|
184
|
-
react_1.default.createElement(
|
|
185
|
-
|
|
186
|
-
react_1.default.createElement(
|
|
187
|
-
|
|
188
|
-
react_1.default.createElement(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
react_1.default.createElement(
|
|
180
|
+
const content = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
181
|
+
react_1.default.createElement(material_1.CardContent, null,
|
|
182
|
+
react_1.default.createElement(material_1.Typography, { className: classes.title, variant: "h5" },
|
|
183
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupMembersWidget.title", defaultMessage: "ui.groupMembersWidget.title" })),
|
|
184
|
+
!state.count ? (react_1.default.createElement(material_1.Typography, { className: classes.noResults, variant: "body2" },
|
|
185
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupMembersWidget.subtitle.noResults", defaultMessage: "" }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
186
|
+
react_1.default.createElement(List_1.default, null, state.results.slice(0, state.visibleItems).map((user) => (react_1.default.createElement(material_1.ListItem, { key: user.id },
|
|
187
|
+
react_1.default.createElement(User_1.default, { elevation: 0, actions: react_1.default.createElement(react_1.default.Fragment, null), user: user, userId: user.id, buttonProps: { onClick: () => console.log(user) } }))))),
|
|
188
|
+
state.count > state.visibleItems && (react_1.default.createElement(material_1.Button, { className: classes.showMore, onClick: handleToggleDialogOpen },
|
|
189
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupMembersWidget.button.showMore", defaultMessage: "ui.groupMembersWidget.button.showMore" }))))),
|
|
190
|
+
openDialog && (react_1.default.createElement(DialogRoot, Object.assign({ className: classes.dialogRoot, title: react_1.default.createElement(react_intl_1.FormattedMessage, { defaultMessage: "ui.groupMembersWidget.dialogTitle", id: "ui.groupMembersWidget.dialogTitle", values: { total: scGroup.subscribers_counter } }), onClose: handleToggleDialogOpen, open: openDialog }, DialogProps),
|
|
191
|
+
react_1.default.createElement(InfiniteScroll_1.default, { dataLength: state.results.length, next: handleNext, hasMoreNext: Boolean(state.next), loaderNext: react_1.default.createElement(User_1.UserSkeleton, Object.assign({ elevation: 0 }, UserProps)), height: isMobile ? '100%' : 400, endMessage: react_1.default.createElement(material_1.Typography, { className: classes.endMessage },
|
|
192
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupMembersWidget.noMoreResults", defaultMessage: "ui.groupMembersWidget.noMoreResults" })) },
|
|
193
|
+
react_1.default.createElement(List_1.default, null, state.results.map((user) => (react_1.default.createElement(material_1.ListItem, { key: user.id },
|
|
194
|
+
react_1.default.createElement(User_1.default, { elevation: 0, actions: react_1.default.createElement(react_1.default.Fragment, null), user: user, userId: user.id, buttonProps: { onClick: () => console.log(user) } }))))))))),
|
|
195
|
+
react_1.default.createElement(material_1.CardActions, { className: classes.actions },
|
|
196
|
+
react_1.default.createElement(GroupInviteButton_1.default, { groupId: scGroup === null || scGroup === void 0 ? void 0 : scGroup.id, group: scGroup }))));
|
|
192
197
|
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest), content));
|
|
193
198
|
}
|
|
194
199
|
exports.default = GroupMembersWidget;
|
|
@@ -81,12 +81,22 @@ function GroupSubscribeButton(inProps) {
|
|
|
81
81
|
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
|
+
const unsubscribe = () => {
|
|
85
|
+
scGroupsManager
|
|
86
|
+
.unsubscribe(scGroup)
|
|
87
|
+
.then(() => {
|
|
88
|
+
// onJoin && onJoin(scGroup, !joined);
|
|
89
|
+
})
|
|
90
|
+
.catch((e) => {
|
|
91
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, e);
|
|
92
|
+
});
|
|
93
|
+
};
|
|
84
94
|
const handleSubscribeAction = () => {
|
|
85
95
|
if (!scUserContext.user) {
|
|
86
96
|
scContext.settings.handleAnonymousAction();
|
|
87
97
|
}
|
|
88
98
|
else {
|
|
89
|
-
subscribe();
|
|
99
|
+
types_1.SCGroupSubscriptionStatusType.SUBSCRIBED ? unsubscribe() : subscribe();
|
|
90
100
|
}
|
|
91
101
|
};
|
|
92
102
|
/**
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { EndpointType } from '@selfcommunity/api-services';
|
|
2
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
3
|
+
import { GroupProps } from '../Group';
|
|
4
|
+
export interface GroupsProps {
|
|
5
|
+
/**
|
|
6
|
+
* Endpoint to call
|
|
7
|
+
*/
|
|
8
|
+
endpoint: EndpointType;
|
|
9
|
+
/**
|
|
10
|
+
* Hides this component
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
autoHide?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Limit the number of users to show
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
limit?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Caching strategies
|
|
21
|
+
* @default CacheStrategies.CACHE_FIRST
|
|
22
|
+
*/
|
|
23
|
+
cacheStrategy?: CacheStrategies;
|
|
24
|
+
/**
|
|
25
|
+
* Props to spread to single group object
|
|
26
|
+
* @default empty object
|
|
27
|
+
*/
|
|
28
|
+
GroupProps?: GroupProps;
|
|
29
|
+
/**
|
|
30
|
+
* Other props
|
|
31
|
+
*/
|
|
32
|
+
[p: string]: any;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* > API documentation for the Community-JS Groups component. Learn about the available props and the CSS API.
|
|
36
|
+
*
|
|
37
|
+
*
|
|
38
|
+
* This component renders the list of the follows of the given group.
|
|
39
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/Groups)
|
|
40
|
+
|
|
41
|
+
#### Import
|
|
42
|
+
|
|
43
|
+
```jsx
|
|
44
|
+
import {Groups} from '@selfcommunity/react-ui';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### Component Name
|
|
48
|
+
|
|
49
|
+
The name `SCGroups` can be used when providing style overrides in the theme.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
#### CSS
|
|
53
|
+
|
|
54
|
+
|Rule Name|Global class|Description|
|
|
55
|
+
|---|---|---|
|
|
56
|
+
|root|.SCGroups-root|Styles applied to the root element.|
|
|
57
|
+
|title|.SCGroups-title|Styles applied to the title element.|
|
|
58
|
+
|noResults|.SCGroups-no-results|Styles applied to no results section.|
|
|
59
|
+
|showMore|.SCGroups-show-more|Styles applied to show more button element.|
|
|
60
|
+
|dialogRoot|.SCGroups-dialog-root|Styles applied to the dialog root element.|
|
|
61
|
+
|endMessage|.SCGroups-end-message|Styles applied to the end message element.|
|
|
62
|
+
|
|
63
|
+
* @param inProps
|
|
64
|
+
*/
|
|
65
|
+
export default function Groups(inProps: GroupsProps): JSX.Element;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
8
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
9
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
10
|
+
const widget_1 = require("../../utils/widget");
|
|
11
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
12
|
+
const react_intl_1 = require("react-intl");
|
|
13
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
14
|
+
const Errors_1 = require("../../constants/Errors");
|
|
15
|
+
const system_1 = require("@mui/system");
|
|
16
|
+
const HiddenPlaceholder_1 = tslib_1.__importDefault(require("../../shared/HiddenPlaceholder"));
|
|
17
|
+
const constants_1 = require("./constants");
|
|
18
|
+
const Group_1 = tslib_1.__importDefault(require("../Group"));
|
|
19
|
+
const classes = {
|
|
20
|
+
root: `${constants_1.PREFIX}-root`,
|
|
21
|
+
groups: `${constants_1.PREFIX}-groups`,
|
|
22
|
+
item: `${constants_1.PREFIX}-item`,
|
|
23
|
+
noResults: `${constants_1.PREFIX}-no-results`,
|
|
24
|
+
showMore: `${constants_1.PREFIX}-show-more`,
|
|
25
|
+
endMessage: `${constants_1.PREFIX}-end-message`
|
|
26
|
+
};
|
|
27
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
28
|
+
name: constants_1.PREFIX,
|
|
29
|
+
slot: 'Root'
|
|
30
|
+
})(() => ({}));
|
|
31
|
+
/**
|
|
32
|
+
* > API documentation for the Community-JS Groups component. Learn about the available props and the CSS API.
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
* This component renders the list of the follows of the given group.
|
|
36
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/Groups)
|
|
37
|
+
|
|
38
|
+
#### Import
|
|
39
|
+
|
|
40
|
+
```jsx
|
|
41
|
+
import {Groups} from '@selfcommunity/react-ui';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
#### Component Name
|
|
45
|
+
|
|
46
|
+
The name `SCGroups` can be used when providing style overrides in the theme.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
#### CSS
|
|
50
|
+
|
|
51
|
+
|Rule Name|Global class|Description|
|
|
52
|
+
|---|---|---|
|
|
53
|
+
|root|.SCGroups-root|Styles applied to the root element.|
|
|
54
|
+
|title|.SCGroups-title|Styles applied to the title element.|
|
|
55
|
+
|noResults|.SCGroups-no-results|Styles applied to no results section.|
|
|
56
|
+
|showMore|.SCGroups-show-more|Styles applied to show more button element.|
|
|
57
|
+
|dialogRoot|.SCGroups-dialog-root|Styles applied to the dialog root element.|
|
|
58
|
+
|endMessage|.SCGroups-end-message|Styles applied to the end message element.|
|
|
59
|
+
|
|
60
|
+
* @param inProps
|
|
61
|
+
*/
|
|
62
|
+
function Groups(inProps) {
|
|
63
|
+
// PROPS
|
|
64
|
+
const props = (0, system_1.useThemeProps)({
|
|
65
|
+
props: inProps,
|
|
66
|
+
name: constants_1.PREFIX
|
|
67
|
+
});
|
|
68
|
+
const { endpoint, autoHide = false, limit = 6, className, cacheStrategy = utils_1.CacheStrategies.NETWORK_ONLY, onHeightChange, onStateChange, GroupProps = { variant: 'outlined', ButtonBaseProps: { disableRipple: true, component: material_1.Box } } } = props, rest = tslib_1.__rest(props, ["endpoint", "autoHide", "limit", "className", "cacheStrategy", "onHeightChange", "onStateChange", "GroupProps"]);
|
|
69
|
+
// STATE
|
|
70
|
+
const [state, dispatch] = (0, react_1.useReducer)(widget_1.dataWidgetReducer, {
|
|
71
|
+
isLoadingNext: false,
|
|
72
|
+
next: null,
|
|
73
|
+
cacheKey: react_core_1.SCCache.getWidgetStateCacheKey(react_core_1.SCCache.GROUPS_LIST_TOOLS_STATE_CACHE_PREFIX_KEY),
|
|
74
|
+
cacheStrategy,
|
|
75
|
+
visibleItems: limit
|
|
76
|
+
}, widget_1.stateWidgetInitializer);
|
|
77
|
+
// CONTEXT
|
|
78
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
79
|
+
const scPreferencesContext = (0, react_core_1.useSCPreferences)();
|
|
80
|
+
// MEMO
|
|
81
|
+
const contentAvailability = (0, react_1.useMemo)(() => react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY in scPreferencesContext.preferences &&
|
|
82
|
+
scPreferencesContext.preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value, [scPreferencesContext.preferences]);
|
|
83
|
+
// HOOKS
|
|
84
|
+
// const theme = useTheme<SCThemeType>();
|
|
85
|
+
// const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
86
|
+
/**
|
|
87
|
+
* Initialize component
|
|
88
|
+
* Fetch data only if the component is not initialized, and it is not loading data
|
|
89
|
+
*/
|
|
90
|
+
const _initComponent = (0, react_1.useMemo)(() => () => {
|
|
91
|
+
if (!state.initialized && !state.isLoadingNext) {
|
|
92
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
93
|
+
api_services_1.http
|
|
94
|
+
.request({
|
|
95
|
+
url: endpoint.url({ limit }),
|
|
96
|
+
method: endpoint.method
|
|
97
|
+
})
|
|
98
|
+
.then((payload) => {
|
|
99
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload.data), { initialized: true }) });
|
|
100
|
+
})
|
|
101
|
+
.catch((error) => {
|
|
102
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
103
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}, [state.isLoadingNext, state.initialized, endpoint, limit, dispatch]);
|
|
107
|
+
// EFFECTS
|
|
108
|
+
(0, react_1.useEffect)(() => {
|
|
109
|
+
var _a;
|
|
110
|
+
let _t;
|
|
111
|
+
if ((contentAvailability || (!contentAvailability && ((_a = scUserContext.user) === null || _a === void 0 ? void 0 : _a.id))) && scUserContext.user !== undefined) {
|
|
112
|
+
_t = setTimeout(_initComponent);
|
|
113
|
+
return () => {
|
|
114
|
+
_t && clearTimeout(_t);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}, [scUserContext.user, contentAvailability]);
|
|
118
|
+
(0, react_1.useEffect)(() => {
|
|
119
|
+
if (state.next && state.results.length === limit && state.initialized) {
|
|
120
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
121
|
+
api_services_1.http
|
|
122
|
+
.request({
|
|
123
|
+
url: endpoint.url({ offset: limit, limit: 10 }),
|
|
124
|
+
method: endpoint.method
|
|
125
|
+
})
|
|
126
|
+
.then((payload) => {
|
|
127
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: payload.data });
|
|
128
|
+
})
|
|
129
|
+
.catch((error) => {
|
|
130
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
|
|
131
|
+
utils_1.Logger.error(Errors_1.SCOPE_SC_UI, error);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}, [state.next, state.results.length, state.initialized, limit]);
|
|
135
|
+
/**
|
|
136
|
+
* Virtual feed update
|
|
137
|
+
*/
|
|
138
|
+
(0, react_1.useEffect)(() => {
|
|
139
|
+
onHeightChange && onHeightChange();
|
|
140
|
+
}, [state.results]);
|
|
141
|
+
(0, react_1.useEffect)(() => {
|
|
142
|
+
if (!endpoint || (!contentAvailability && !scUserContext.user)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
else if (cacheStrategy === utils_1.CacheStrategies.NETWORK_ONLY) {
|
|
146
|
+
onStateChange && onStateChange({ cacheStrategy: utils_1.CacheStrategies.CACHE_FIRST });
|
|
147
|
+
}
|
|
148
|
+
}, [scUserContext.user, endpoint, contentAvailability]);
|
|
149
|
+
(0, react_1.useEffect)(() => {
|
|
150
|
+
if (!endpoint || !scUserContext.user || !state.initialized) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
}, []);
|
|
154
|
+
// HANDLERS
|
|
155
|
+
const handleNext = (0, react_1.useMemo)(() => () => {
|
|
156
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOADING_NEXT });
|
|
157
|
+
api_services_1.http
|
|
158
|
+
.request({
|
|
159
|
+
url: state.next,
|
|
160
|
+
method: endpoint.method
|
|
161
|
+
})
|
|
162
|
+
.then((res) => {
|
|
163
|
+
dispatch({ type: widget_1.actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: res.data });
|
|
164
|
+
});
|
|
165
|
+
}, [dispatch, state.next, state.isLoadingNext, state.initialized, endpoint.method]);
|
|
166
|
+
// RENDER
|
|
167
|
+
if ((autoHide && !state.count && state.initialized) || (!contentAvailability && !scUserContext.user) || !endpoint) {
|
|
168
|
+
return react_1.default.createElement(HiddenPlaceholder_1.default, null);
|
|
169
|
+
}
|
|
170
|
+
if (!state.initialized) {
|
|
171
|
+
return react_1.default.createElement(Skeleton_1.default, null);
|
|
172
|
+
}
|
|
173
|
+
const content = (react_1.default.createElement(react_1.default.Fragment, null, !state.count ? (react_1.default.createElement(material_1.Typography, { className: classes.noResults, variant: "body2" },
|
|
174
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupRequestsWidget.subtitle.noResults", defaultMessage: "" }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
175
|
+
react_1.default.createElement(material_1.Grid, { container: true, spacing: { xs: 3 }, className: classes.groups }, state.results.slice(0, state.visibleItems).map((group) => (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, sm: 8, md: 6, key: group.id, className: classes.item },
|
|
176
|
+
react_1.default.createElement(Group_1.default, Object.assign({ actions: react_1.default.createElement(react_1.default.Fragment, null), group: group, groupId: group.id, buttonProps: { onClick: () => console.log(group) } }, GroupProps)))))),
|
|
177
|
+
state.count > state.visibleItems && (react_1.default.createElement(material_1.Button, { className: classes.showMore, onClick: handleNext },
|
|
178
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupRequestsWidget.button.showMore", defaultMessage: "ui.groupRequestsWidget.button.showMore" })))))));
|
|
179
|
+
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest), content));
|
|
180
|
+
}
|
|
181
|
+
exports.default = Groups;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface GroupsSkeletonProps {
|
|
2
|
+
/**
|
|
3
|
+
* Overrides or extends the styles applied to the component.
|
|
4
|
+
* @default null
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Overrides or extends the styles applied to the component.
|
|
9
|
+
* @default null
|
|
10
|
+
*/
|
|
11
|
+
GroupSkeletonProps?: any;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* > API documentation for the Community-JS Groups Skeleton component. Learn about the available props and the CSS API.
|
|
15
|
+
|
|
16
|
+
#### Import
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
import {GroupsSkeleton} from '@selfcommunity/react-ui';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
#### Component Name
|
|
23
|
+
|
|
24
|
+
The name `SCGroups-skeleton-root` can be used when providing style overrides in the theme.
|
|
25
|
+
|
|
26
|
+
#### CSS
|
|
27
|
+
|
|
28
|
+
|Rule Name|Global class|Description|
|
|
29
|
+
|---|---|---|
|
|
30
|
+
|root|.SCGroups-skeleton-root|Styles applied to the root element.|
|
|
31
|
+
|groups|.SCGroups-skeleton-groups|Styles applied to the group elements.|
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export default function GroupsSkeleton(inProps: GroupsSkeletonProps): JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
9
|
+
const Group_1 = require("../Group");
|
|
10
|
+
const classes = {
|
|
11
|
+
root: `${constants_1.PREFIX}-skeleton-root`,
|
|
12
|
+
groups: `${constants_1.PREFIX}-groups`
|
|
13
|
+
};
|
|
14
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
15
|
+
name: constants_1.PREFIX,
|
|
16
|
+
slot: 'SkeletonRoot'
|
|
17
|
+
})(() => ({}));
|
|
18
|
+
/**
|
|
19
|
+
* > API documentation for the Community-JS Groups Skeleton component. Learn about the available props and the CSS API.
|
|
20
|
+
|
|
21
|
+
#### Import
|
|
22
|
+
|
|
23
|
+
```jsx
|
|
24
|
+
import {GroupsSkeleton} from '@selfcommunity/react-ui';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### Component Name
|
|
28
|
+
|
|
29
|
+
The name `SCGroups-skeleton-root` can be used when providing style overrides in the theme.
|
|
30
|
+
|
|
31
|
+
#### CSS
|
|
32
|
+
|
|
33
|
+
|Rule Name|Global class|Description|
|
|
34
|
+
|---|---|---|
|
|
35
|
+
|root|.SCGroups-skeleton-root|Styles applied to the root element.|
|
|
36
|
+
|groups|.SCGroups-skeleton-groups|Styles applied to the group elements.|
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
function GroupsSkeleton(inProps) {
|
|
40
|
+
const { className, GroupSkeletonProps = {} } = inProps, rest = tslib_1.__rest(inProps, ["className", "GroupSkeletonProps"]);
|
|
41
|
+
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest),
|
|
42
|
+
react_1.default.createElement(material_1.Grid, { container: true, spacing: { xs: 3 }, className: classes.groups }, [...Array(15)].map((category, index) => (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, sm: 8, md: 6, key: index },
|
|
43
|
+
react_1.default.createElement(Group_1.GroupSkeleton, Object.assign({ elevation: 0, variant: 'outlined' }, GroupSkeletonProps))))))));
|
|
44
|
+
}
|
|
45
|
+
exports.default = GroupsSkeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCGroups";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupsSkeleton = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Groups_1 = tslib_1.__importDefault(require("./Groups"));
|
|
6
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
7
|
+
exports.GroupsSkeleton = Skeleton_1.default;
|
|
8
|
+
exports.default = Groups_1.default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SCCategoryType, SCMediaType, SCPollType, SCTagType } from '@selfcommunity/types';
|
|
1
|
+
import { SCCategoryType, SCGroupType, SCMediaType, SCPollType, SCTagType } from '@selfcommunity/types';
|
|
2
2
|
import { SCMediaObjectType } from '../../types/media';
|
|
3
3
|
import { WidgetProps } from '../Widget';
|
|
4
4
|
export interface InlineComposerWidgetProps extends Omit<WidgetProps, 'defaultValue'> {
|
|
@@ -15,6 +15,7 @@ export interface InlineComposerWidgetProps extends Omit<WidgetProps, 'defaultVal
|
|
|
15
15
|
title?: string;
|
|
16
16
|
text?: string;
|
|
17
17
|
categories?: SCCategoryType[];
|
|
18
|
+
group?: SCGroupType;
|
|
18
19
|
audience?: string;
|
|
19
20
|
addressing?: SCTagType[];
|
|
20
21
|
medias?: SCMediaType[];
|
|
@@ -23,6 +23,7 @@ const classes = {
|
|
|
23
23
|
navigation: `${constants_1.PREFIX}-navigation`,
|
|
24
24
|
home: `${constants_1.PREFIX}-home`,
|
|
25
25
|
explore: `${constants_1.PREFIX}-explore`,
|
|
26
|
+
groups: `${constants_1.PREFIX}-groups`,
|
|
26
27
|
search: `${constants_1.PREFIX}-search`,
|
|
27
28
|
composer: `${constants_1.PREFIX}-composer`,
|
|
28
29
|
profile: `${constants_1.PREFIX}-profile`,
|
|
@@ -100,6 +101,7 @@ function NavigationToolbar(inProps) {
|
|
|
100
101
|
return _preferences;
|
|
101
102
|
}, [scPreferences.preferences]);
|
|
102
103
|
const privateMessagingEnabled = (0, react_1.useMemo)(() => scPreferences.features.includes(types_1.SCFeatureName.PRIVATE_MESSAGING), [scPreferences.features]);
|
|
104
|
+
const groupsEnabled = (0, react_1.useMemo)(() => scPreferences.features.includes(types_1.SCFeatureName.GROUPING), [scPreferences.features]);
|
|
103
105
|
// STATE
|
|
104
106
|
const [anchorNotification, setAnchorNotification] = react_1.default.useState(null);
|
|
105
107
|
// HANDLERS
|
|
@@ -120,7 +122,9 @@ function NavigationToolbar(inProps) {
|
|
|
120
122
|
react_1.default.createElement(Icon_1.default, null, "home"))),
|
|
121
123
|
preferences[react_core_1.SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED] &&
|
|
122
124
|
(preferences[react_core_1.SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY] || scUserContext.user) && (react_1.default.createElement(material_1.IconButton, { className: (0, classnames_1.default)(classes.explore, { [classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.EXPLORE_ROUTE_NAME, {})) }), "aria-label": "Explore", to: scRoutingContext.url(react_core_1.SCRoutes.EXPLORE_ROUTE_NAME, {}), component: react_core_1.Link },
|
|
123
|
-
react_1.default.createElement(Icon_1.default, null, "explore")))
|
|
125
|
+
react_1.default.createElement(Icon_1.default, null, "explore"))),
|
|
126
|
+
groupsEnabled && scUserContext.user && (react_1.default.createElement(material_1.IconButton, { className: (0, classnames_1.default)(classes.groups, { [classes.active]: value.startsWith(scRoutingContext.url(react_core_1.SCRoutes.GROUPS_ROUTE_NAME, {})) }), "aria-label": "Groups", to: scRoutingContext.url(react_core_1.SCRoutes.GROUPS_ROUTE_NAME, {}), component: react_core_1.Link },
|
|
127
|
+
react_1.default.createElement(Icon_1.default, null, "groups")))));
|
|
124
128
|
return (react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest),
|
|
125
129
|
react_1.default.createElement(NavigationMenuIconButtonComponent, null),
|
|
126
130
|
react_1.default.createElement(react_core_1.Link, { to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo },
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -108,14 +108,16 @@ import ChangeGroupCover, { ChangeGroupCoverProps } from './components/ChangeGrou
|
|
|
108
108
|
import ChangeGroupPicture, { ChangeGroupPictureProps } from './components/ChangeGroupPicture';
|
|
109
109
|
import GroupHeader, { GroupHeaderProps, GroupHeaderSkeleton } from './components/GroupHeader';
|
|
110
110
|
import GroupMembersButton, { GroupMembersButtonProps } from './components/GroupMembersButton';
|
|
111
|
-
import CreateGroupButton from './components/CreateGroupButton';
|
|
112
|
-
import
|
|
111
|
+
import CreateGroupButton, { CreateGroupButtonProps } from './components/CreateGroupButton';
|
|
112
|
+
import EditGroupButton, { EditGroupButtonProps } from './components/EditGroupButton';
|
|
113
113
|
import GroupInviteButton, { GroupInviteButtonProps } from './components/GroupInviteButton';
|
|
114
114
|
import GroupInfoWidget, { GroupInfoWidgetProps, GroupInfoWidgetSkeleton } from './components/GroupInfoWidget';
|
|
115
115
|
import Group, { GroupProps } from './components/Group';
|
|
116
116
|
import GroupSubscribeButton, { GroupSubscribeButtonProps } from './components/GroupSubscribeButton';
|
|
117
117
|
import GroupMembersWidget, { GroupMembersWidgetProps, GroupMembersWidgetSkeleton } from './components/GroupMembersWidget';
|
|
118
118
|
import GroupRequestsWidget, { GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton } from './components/GroupRequestsWidget';
|
|
119
|
+
import Groups, { GroupsProps, GroupsSkeleton } from './components/Groups';
|
|
120
|
+
import GroupForm, { GroupFormProps } from './components/GroupForm';
|
|
119
121
|
/**
|
|
120
122
|
* Constants
|
|
121
123
|
*/
|
|
@@ -140,4 +142,4 @@ import FeedObjectMediaPreview, { FeedObjectMediaPreviewProps } from './component
|
|
|
140
142
|
/**
|
|
141
143
|
* List all exports
|
|
142
144
|
*/
|
|
143
|
-
export { AccountDataPortability, AccountDataPortabilityProps, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDelete, AccountDeleteProps, AccountDeleteButton, AccountDeleteButtonProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AccountChangeMailValidation, AccountChangeMailValidationProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbar, NavigationToolbarProps, NavigationToolbarSkeleton, NavigationMenuIconButton, NavigationMenuContent, NavigationMenuIconButtonProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, Category, CategoryProps, CategorySkeleton, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, Categories, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, ChangeCover, ChangePicture, ChangePictureProps, ChangeCoverProps, Composer, ComposerProps, ComposerIconButton, ComposerIconButtonProps, Editor, EditorProps, EditorSkeleton, FriendshipUserButton, FriendshipButtonProps, Feed, FeedRef, FeedProps, FeedSidebarProps, FeedSkeleton, CategoryFollowButton, CategoryFollowButtonProps, FollowUserButton, FollowUserButtonProps, ConnectionUserButton, FeedObject, FeedObjectProps, FeedObjectSkeleton, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, GenericSkeleton, AvatarGroupSkeleton, CommentObject, CommentsObject, CommentsObjectProps, CommentObjectProps, CommentsObjectSkeleton, CommentObjectSkeleton, CommentObjectReply, CommentObjectReplyProps, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, ReplyComment, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, Notification, NotificationProps, NotificationSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, PlatformWidget, PlatformWidgetProps, PlatformWidgetSkeleton, LocationAutocomplete, LocationAutocompleteProps, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CategoryTrendingPeopleWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectWidgetProps, RelatedFeedObjectsWidgetSkeleton, UserActionIconButton, UserActionIconButtonProps, UserCounters, UserCountersProps, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserInfoDialog, UserInfoDialogProps, UserInfo, UserInfoProps, UserInfoSkeleton, UserProfileBlocked, UserProfileBlockedProps, SCUserProfileFields, SCUserProfileSettings, UserProfileEdit, UserProfileEditProps, UserProfileEditSkeleton, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserSocialAssociation, UserSocialAssociationProps, SCUserSocialAssociations, CustomAdv, CustomAdvProps, CustomAdvSkeleton, User, UserProps, UserSkeleton, PrivateMessageThread, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Widget, WidgetProps, SCFeedWidgetType, SCFeedObjectTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCMediaObjectType, SCMediaChunkType, SCNotificationObjectTemplateType, SCBroadcastMessageTemplateType, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupMembersButton, GroupMembersButtonProps, CreateGroupButton,
|
|
145
|
+
export { AccountDataPortability, AccountDataPortabilityProps, AccountDataPortabilityButton, AccountDataPortabilityButtonProps, AccountDelete, AccountDeleteProps, AccountDeleteButton, AccountDeleteButtonProps, AccountRecover, AccountRecoverProps, AccountReset, AccountResetProps, AccountVerify, AccountVerifyProps, AccountChangeMailValidation, AccountChangeMailValidationProps, NavigationSettingsIconButton, NavigationSettingsIconButtonProps, NavigationSettingsItem, NavigationToolbarMobile, NavigationToolbarMobileProps, NavigationToolbarMobileSkeleton, NavigationToolbar, NavigationToolbarProps, NavigationToolbarSkeleton, NavigationMenuIconButton, NavigationMenuContent, NavigationMenuIconButtonProps, BottomNavigation, BottomNavigationProps, BroadcastMessages, BroadcastMessagesProps, BroadcastMessagesSkeleton, Category, CategoryProps, CategorySkeleton, CategoryAutocomplete, CategoryAutocompleteProps, CategoryFollowersButton, CategoryFollowersButtonProps, CategoryHeader, CategoryHeaderProps, CategoryHeaderSkeleton, Categories, CategoriesProps, CategoriesSkeleton, CategoriesSkeletonProps, UserFollowedCategoriesWidget, UserFollowedCategoriesWidgetProps, UserFollowedCategoriesWidgetSkeleton, CategoriesPopularWidget, CategoriesPopularWidgetSkeleton, CategoriesSuggestionWidget, CategoriesSuggestionWidgetProps, CategoriesSuggestionWidgetSkeleton, ChangeCover, ChangePicture, ChangePictureProps, ChangeCoverProps, Composer, ComposerProps, ComposerIconButton, ComposerIconButtonProps, Editor, EditorProps, EditorSkeleton, FriendshipUserButton, FriendshipButtonProps, Feed, FeedRef, FeedProps, FeedSidebarProps, FeedSkeleton, CategoryFollowButton, CategoryFollowButtonProps, FollowUserButton, FollowUserButtonProps, ConnectionUserButton, FeedObject, FeedObjectProps, FeedObjectSkeleton, FeedObjectMediaPreview, FeedObjectMediaPreviewProps, FeedUpdatesWidget, FeedUpdatesWidgetProps, FeedUpdatesWidgetSkeleton, GenericSkeleton, AvatarGroupSkeleton, CommentObject, CommentsObject, CommentsObjectProps, CommentObjectProps, CommentsObjectSkeleton, CommentObjectSkeleton, CommentObjectReply, CommentObjectReplyProps, CommentsFeedObject, CommentsFeedObjectProps, CommentsFeedObjectSkeleton, ReplyComment, InlineComposerWidget, InlineComposerWidgetProps, InlineComposerWidgetSkeleton, Notification, NotificationProps, NotificationSkeleton, UserSuggestionWidget, UserSuggestionWidgetProps, UserSuggestionWidgetSkeleton, PlatformWidget, PlatformWidgetProps, PlatformWidgetSkeleton, LocationAutocomplete, LocationAutocompleteProps, LoyaltyProgramWidget, LoyaltyProgramWidgetProps, LoyaltyProgramWidgetSkeleton, CategoryTrendingFeedWidget, CategoryTrendingFeedWidgetProps, CategoryTrendingFeedWidgetSkeleton, CategoryTrendingUsersWidget, CategoryTrendingUsersWidgetProps, CategoryTrendingPeopleWidgetSkeleton, RelatedFeedObjectsWidget, RelatedFeedObjectWidgetProps, RelatedFeedObjectsWidgetSkeleton, UserActionIconButton, UserActionIconButtonProps, UserCounters, UserCountersProps, UserProfileHeader, UserProfileHeaderProps, UserProfileHeaderSkeleton, UserInfoDialog, UserInfoDialogProps, UserInfo, UserInfoProps, UserInfoSkeleton, UserProfileBlocked, UserProfileBlockedProps, SCUserProfileFields, SCUserProfileSettings, UserProfileEdit, UserProfileEditProps, UserProfileEditSkeleton, UserProfileEditSectionPublicInfo, UserProfileEditSectionPublicInfoProps, UserProfileEditSectionSettings, UserProfileEditSectionSettingsProps, UserProfileEditSectionAccount, UserProfileEditSectionAccountProps, UserFollowedUsersWidget, UserFollowedUsersWidgetProps, UserFollowedUsersWidgetSkeleton, UserFollowersWidget, UserFollowersWidgetProps, UserFollowersWidgetSkeleton, UserConnectionsWidget, UserConnectionsWidgetProps, UserConnectionsWidgetSkeleton, UserConnectionsRequestsWidget, UserConnectionsRequestsWidgetProps, UserConnectionsRequestsWidgetSkeleton, UserConnectionsRequestsSentWidget, UserConnectionsRequestsSentWidgetProps, UserConnectionsRequestsSentWidgetSkeleton, UserSocialAssociation, UserSocialAssociationProps, SCUserSocialAssociations, CustomAdv, CustomAdvProps, CustomAdvSkeleton, User, UserProps, UserSkeleton, PrivateMessageThread, PrivateMessageThreadProps, PrivateMessageThreadSkeleton, PrivateMessageThreadItem, PrivateMessageThreadItemProps, PrivateMessageThreadItemSkeleton, PrivateMessageSnippetItem, PrivateMessageSnippetItemProps, PrivateMessageSnippetItemSkeleton, PrivateMessageEditor, PrivateMessageEditorProps, PrivateMessageEditorSkeleton, PrivateMessageSnippets, PrivateMessageSnippetsProps, PrivateMessageSnippetsSkeleton, PrivateMessageComponent, PrivateMessageComponentProps, PrivateMessageComponentSkeleton, PrivateMessageSettingsIconButton, PrivateMessageSettingsIconButtonProps, ToastNotifications, ToastNotificationsProps, ToastNotificationsSkeleton, SnippetNotifications, SnippetNotificationsProps, SnippetNotificationsSkeleton, SearchAutocomplete, SearchAutocompleteProps, SearchDialog, SearchDialogProps, Widget, WidgetProps, SCFeedWidgetType, SCFeedObjectTemplateType, SCCommentsOrderBy, SCFeedObjectActivitiesType, SCMediaObjectType, SCMediaChunkType, SCNotificationObjectTemplateType, SCBroadcastMessageTemplateType, ChangeGroupCover, ChangeGroupCoverProps, ChangeGroupPicture, ChangeGroupPictureProps, GroupHeader, GroupHeaderProps, GroupHeaderSkeleton, GroupMembersButton, GroupMembersButtonProps, CreateGroupButton, CreateGroupButtonProps, EditGroupButton, EditGroupButtonProps, GroupInviteButton, GroupInviteButtonProps, GroupInfoWidget, GroupInfoWidgetProps, GroupInfoWidgetSkeleton, Group, GroupProps, GroupSubscribeButton, GroupSubscribeButtonProps, GroupMembersWidget, GroupMembersWidgetProps, GroupMembersWidgetSkeleton, GroupRequestsWidget, GroupRequestsWidgetProps, GroupRequestsWidgetSkeleton, Groups, GroupsProps, GroupsSkeleton, GroupForm, GroupFormProps, UrlTextField, UsernameTextField, EmailTextField, PasswordTextField, PhoneTextField, MetadataField, InfiniteScroll, StickyBox, useStickyBox, StickyBoxProps, StickyBoxComponent, UseStickyBoxProps, TagChip, TagChipProps, UserDeletedSnackBar, UserDeletedSnackBarProps, UserAvatar, UserAvatarProps, Lightbox, CentralProgress, ConfirmDialog, LanguageSwitcher, MediaChunkUploader, MediaChunkUploaderProps, File, Link, Share, EditMediaProps, MEDIA_TYPE_EMBED, FACEBOOK_SHARE, TWITTER_SHARE, LINKEDIN_SHARE, DEFAULT_PRELOAD_OFFSET_VIEWPORT, MIN_PRELOAD_OFFSET_VIEWPORT, MAX_PRELOAD_OFFSET_VIEWPORT, ConsentSolution, ConsentSolutionProps, ConsentSolutionSkeleton, ConsentSolutionButton, ConsentSolutionButtonProps, LEGAL_POLICIES, DEFAULT_FIELDS, DEFAULT_PAGINATION_QUERY_PARAM_NAME, DEFAULT_PAGINATION_OFFSET, DEFAULT_PAGINATION_LIMIT, DEFAULT_WIDGETS_NUMBER, PollSuggestionWidget, PollSuggestionWidgetProps, Incubator, IncubatorSubscribeButton, IncubatorSubscribeButtonProps, IncubatorProps, IncubatorListWidget, IncubatorListWidgetProps, IncubatorDetail, IncubatorDetailProps, IncubatorSuggestionWidget, IncubatorSuggestionWidgetProps, ContributionUtils, bytesToSize, getUnseenNotification, getUnseenNotificationCounter, MessageUploaderUtils, getRelativeTime, Footer, FooterProps, FooterSkeleton, BaseItem, BaseItemProps, BaseDialog, BaseDialogProps };
|
package/lib/cjs/index.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GenericSkeleton = exports.FeedUpdatesWidgetSkeleton = exports.FeedUpdatesWidget = exports.FeedObjectMediaPreview = exports.FeedObjectSkeleton = exports.FeedObject = exports.ConnectionUserButton = exports.FollowUserButton = exports.CategoryFollowButton = exports.FeedSkeleton = exports.Feed = exports.FriendshipUserButton = exports.EditorSkeleton = exports.Editor = exports.ComposerIconButton = exports.Composer = exports.ChangePicture = exports.ChangeCover = exports.CategoriesSuggestionWidgetSkeleton = exports.CategoriesSuggestionWidget = exports.CategoriesPopularWidgetSkeleton = exports.CategoriesPopularWidget = exports.UserFollowedCategoriesWidgetSkeleton = exports.UserFollowedCategoriesWidget = exports.CategoriesSkeleton = exports.Categories = exports.CategoryHeaderSkeleton = exports.CategoryHeader = exports.CategoryFollowersButton = exports.CategoryAutocomplete = exports.CategorySkeleton = exports.Category = exports.BroadcastMessagesSkeleton = exports.BroadcastMessages = exports.BottomNavigation = exports.NavigationMenuContent = exports.NavigationMenuIconButton = exports.NavigationToolbarSkeleton = exports.NavigationToolbar = exports.NavigationToolbarMobileSkeleton = exports.NavigationToolbarMobile = exports.NavigationSettingsIconButton = exports.AccountChangeMailValidation = exports.AccountVerify = exports.AccountReset = exports.AccountRecover = exports.AccountDeleteButton = exports.AccountDelete = exports.AccountDataPortabilityButton = exports.AccountDataPortability = void 0;
|
|
4
4
|
exports.UserConnectionsRequestsSentWidget = exports.UserConnectionsRequestsWidgetSkeleton = exports.UserConnectionsRequestsWidget = exports.UserConnectionsWidgetSkeleton = exports.UserConnectionsWidget = exports.UserFollowersWidgetSkeleton = exports.UserFollowersWidget = exports.UserFollowedUsersWidgetSkeleton = exports.UserFollowedUsersWidget = exports.UserProfileEditSectionAccount = exports.UserProfileEditSectionSettings = exports.UserProfileEditSectionPublicInfo = exports.UserProfileEditSkeleton = exports.UserProfileEdit = exports.SCUserProfileSettings = exports.SCUserProfileFields = exports.UserProfileBlocked = exports.UserInfoSkeleton = exports.UserInfo = exports.UserInfoDialog = exports.UserProfileHeaderSkeleton = exports.UserProfileHeader = exports.UserCounters = exports.UserActionIconButton = exports.RelatedFeedObjectsWidgetSkeleton = exports.RelatedFeedObjectsWidget = exports.CategoryTrendingPeopleWidgetSkeleton = exports.CategoryTrendingUsersWidget = exports.CategoryTrendingFeedWidgetSkeleton = exports.CategoryTrendingFeedWidget = exports.LoyaltyProgramWidgetSkeleton = exports.LoyaltyProgramWidget = exports.LocationAutocomplete = exports.PlatformWidgetSkeleton = exports.PlatformWidget = exports.UserSuggestionWidgetSkeleton = exports.UserSuggestionWidget = exports.NotificationSkeleton = exports.Notification = exports.InlineComposerWidgetSkeleton = exports.InlineComposerWidget = exports.ReplyComment = exports.CommentsFeedObjectSkeleton = exports.CommentsFeedObject = exports.CommentObjectReply = exports.CommentObjectSkeleton = exports.CommentsObjectSkeleton = exports.CommentsObject = exports.CommentObject = exports.AvatarGroupSkeleton = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
5
|
+
exports.GroupsSkeleton = exports.Groups = exports.GroupRequestsWidgetSkeleton = exports.GroupRequestsWidget = exports.GroupMembersWidgetSkeleton = exports.GroupMembersWidget = exports.GroupSubscribeButton = exports.Group = exports.GroupInfoWidgetSkeleton = exports.GroupInfoWidget = exports.GroupInviteButton = exports.EditGroupButton = exports.CreateGroupButton = exports.GroupMembersButton = exports.GroupHeaderSkeleton = exports.GroupHeader = exports.ChangeGroupPicture = exports.ChangeGroupCover = exports.SCBroadcastMessageTemplateType = exports.SCNotificationObjectTemplateType = exports.SCFeedObjectActivitiesType = exports.SCCommentsOrderBy = exports.SCFeedObjectTemplateType = exports.Widget = exports.SearchDialog = exports.SearchAutocomplete = exports.SnippetNotificationsSkeleton = exports.SnippetNotifications = exports.ToastNotificationsSkeleton = exports.ToastNotifications = exports.PrivateMessageSettingsIconButton = exports.PrivateMessageComponentSkeleton = exports.PrivateMessageComponent = exports.PrivateMessageSnippetsSkeleton = exports.PrivateMessageSnippets = exports.PrivateMessageEditorSkeleton = exports.PrivateMessageEditor = exports.PrivateMessageSnippetItemSkeleton = exports.PrivateMessageSnippetItem = exports.PrivateMessageThreadItemSkeleton = exports.PrivateMessageThreadItem = exports.PrivateMessageThreadSkeleton = exports.PrivateMessageThread = exports.UserSkeleton = exports.User = exports.CustomAdvSkeleton = exports.CustomAdv = exports.SCUserSocialAssociations = exports.UserSocialAssociation = exports.UserConnectionsRequestsSentWidgetSkeleton = void 0;
|
|
6
|
+
exports.Footer = exports.getRelativeTime = exports.MessageUploaderUtils = exports.getUnseenNotificationCounter = exports.getUnseenNotification = exports.bytesToSize = exports.ContributionUtils = exports.IncubatorSuggestionWidget = exports.IncubatorDetail = exports.IncubatorListWidget = exports.IncubatorSubscribeButton = exports.Incubator = exports.PollSuggestionWidget = exports.DEFAULT_WIDGETS_NUMBER = exports.DEFAULT_PAGINATION_LIMIT = exports.DEFAULT_PAGINATION_OFFSET = exports.DEFAULT_PAGINATION_QUERY_PARAM_NAME = exports.DEFAULT_FIELDS = exports.LEGAL_POLICIES = exports.ConsentSolutionButton = exports.ConsentSolutionSkeleton = exports.ConsentSolution = exports.MAX_PRELOAD_OFFSET_VIEWPORT = exports.MIN_PRELOAD_OFFSET_VIEWPORT = exports.DEFAULT_PRELOAD_OFFSET_VIEWPORT = exports.LINKEDIN_SHARE = exports.TWITTER_SHARE = exports.FACEBOOK_SHARE = exports.MEDIA_TYPE_EMBED = exports.Share = exports.Link = exports.File = exports.MediaChunkUploader = exports.LanguageSwitcher = exports.ConfirmDialog = exports.CentralProgress = exports.Lightbox = exports.UserAvatar = exports.UserDeletedSnackBar = exports.TagChip = exports.useStickyBox = exports.StickyBox = exports.InfiniteScroll = exports.MetadataField = exports.PhoneTextField = exports.PasswordTextField = exports.EmailTextField = exports.UsernameTextField = exports.UrlTextField = exports.GroupForm = void 0;
|
|
7
|
+
exports.BaseDialog = exports.BaseItem = exports.FooterSkeleton = void 0;
|
|
7
8
|
const tslib_1 = require("tslib");
|
|
8
9
|
/**
|
|
9
10
|
* Components
|
|
@@ -284,8 +285,8 @@ const GroupMembersButton_1 = tslib_1.__importDefault(require("./components/Group
|
|
|
284
285
|
exports.GroupMembersButton = GroupMembersButton_1.default;
|
|
285
286
|
const CreateGroupButton_1 = tslib_1.__importDefault(require("./components/CreateGroupButton"));
|
|
286
287
|
exports.CreateGroupButton = CreateGroupButton_1.default;
|
|
287
|
-
const
|
|
288
|
-
exports.
|
|
288
|
+
const EditGroupButton_1 = tslib_1.__importDefault(require("./components/EditGroupButton"));
|
|
289
|
+
exports.EditGroupButton = EditGroupButton_1.default;
|
|
289
290
|
const GroupInviteButton_1 = tslib_1.__importDefault(require("./components/GroupInviteButton"));
|
|
290
291
|
exports.GroupInviteButton = GroupInviteButton_1.default;
|
|
291
292
|
const GroupInfoWidget_1 = tslib_1.__importStar(require("./components/GroupInfoWidget"));
|
|
@@ -301,6 +302,11 @@ Object.defineProperty(exports, "GroupMembersWidgetSkeleton", { enumerable: true,
|
|
|
301
302
|
const GroupRequestsWidget_1 = tslib_1.__importStar(require("./components/GroupRequestsWidget"));
|
|
302
303
|
exports.GroupRequestsWidget = GroupRequestsWidget_1.default;
|
|
303
304
|
Object.defineProperty(exports, "GroupRequestsWidgetSkeleton", { enumerable: true, get: function () { return GroupRequestsWidget_1.GroupRequestsWidgetSkeleton; } });
|
|
305
|
+
const Groups_1 = tslib_1.__importStar(require("./components/Groups"));
|
|
306
|
+
exports.Groups = Groups_1.default;
|
|
307
|
+
Object.defineProperty(exports, "GroupsSkeleton", { enumerable: true, get: function () { return Groups_1.GroupsSkeleton; } });
|
|
308
|
+
const GroupForm_1 = tslib_1.__importDefault(require("./components/GroupForm"));
|
|
309
|
+
exports.GroupForm = GroupForm_1.default;
|
|
304
310
|
/**
|
|
305
311
|
* Constants
|
|
306
312
|
*/
|
|
@@ -12,7 +12,7 @@ const classes = {
|
|
|
12
12
|
root: `${PREFIX}-root`,
|
|
13
13
|
ios: `${PREFIX}-ios`,
|
|
14
14
|
action: `${PREFIX}-action`,
|
|
15
|
-
composer: `${PREFIX}-composer
|
|
15
|
+
composer: `${PREFIX}-composer`
|
|
16
16
|
};
|
|
17
17
|
const Root = styled(MuiBottomNavigation, {
|
|
18
18
|
name: PREFIX,
|
|
@@ -60,6 +60,7 @@ export default function BottomNavigation(inProps) {
|
|
|
60
60
|
const { preferences, features } = useSCPreferences();
|
|
61
61
|
// MEMO
|
|
62
62
|
const privateMessagingEnabled = useMemo(() => features.includes(SCFeatureName.PRIVATE_MESSAGING), [features]);
|
|
63
|
+
const groupsEnabled = useMemo(() => features.includes(SCFeatureName.GROUPING), [features]);
|
|
63
64
|
const isIOS = useMemo(() => iOS(), []);
|
|
64
65
|
// RENDER
|
|
65
66
|
return (React.createElement(Root, Object.assign({ className: classNames(className, classes.root, { [classes.ios]: isIOS }) }, rest), children
|
|
@@ -69,6 +70,7 @@ export default function BottomNavigation(inProps) {
|
|
|
69
70
|
(scUserContext.user || preferences[SCPreferences.CONFIGURATIONS_CONTENT_AVAILABILITY].value) &&
|
|
70
71
|
preferences[SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value ? (React.createElement(BottomNavigationAction, { key: "explore", className: classes.action, component: Link, to: scRoutingContext.url(SCRoutes.EXPLORE_ROUTE_NAME, {}), value: scRoutingContext.url(SCRoutes.EXPLORE_ROUTE_NAME, {}), icon: React.createElement(Icon, null, "explore") })) : null,
|
|
71
72
|
React.createElement(BottomNavigationAction, { key: "composer", className: classNames(classes.composer, classes.action), component: ComposerIconButton, disableRipple: true }),
|
|
73
|
+
groupsEnabled && scUserContext.user ? (React.createElement(BottomNavigationAction, { key: "groups", className: classes.action, component: Link, to: scRoutingContext.url(SCRoutes.GROUPS_ROUTE_NAME, {}), value: scRoutingContext.url(SCRoutes.GROUPS_ROUTE_NAME, {}), icon: React.createElement(Icon, null, "groups") })) : null,
|
|
72
74
|
scUserContext.user ? (React.createElement(BottomNavigationAction, { key: "notifications", className: classes.action, component: Link, to: scRoutingContext.url(SCRoutes.USER_NOTIFICATIONS_ROUTE_NAME, {}), value: scRoutingContext.url(SCRoutes.USER_NOTIFICATIONS_ROUTE_NAME, {}), icon: React.createElement(Badge, { badgeContent: scUserContext.user.unseen_notification_banners_counter + scUserContext.user.unseen_interactions_counter, color: "secondary" },
|
|
73
75
|
React.createElement(Icon, null, "notifications_active")) })) : null,
|
|
74
76
|
privateMessagingEnabled && scUserContext.user ? (React.createElement(BottomNavigationAction, { key: "messages", className: classes.action, component: Link, to: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, {}), value: scRoutingContext.url(SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, {}), icon: React.createElement(Badge, { badgeContent: 0, color: "secondary" },
|
|
@@ -16,7 +16,7 @@ export interface AttributesProps extends Omit<BoxProps, 'value' | 'onChange' | '
|
|
|
16
16
|
* @param value
|
|
17
17
|
* @default empty object
|
|
18
18
|
*/
|
|
19
|
-
onClick?: (attribute: 'categories' | 'addressing' | 'location') => void;
|
|
19
|
+
onClick?: (attribute: 'categories' | 'group' | 'addressing' | 'location') => void;
|
|
20
20
|
}
|
|
21
21
|
declare const _default: (props: AttributesProps) => JSX.Element;
|
|
22
22
|
export default _default;
|