@selfcommunity/react-ui 0.11.0-alpha.53 → 0.11.0-alpha.55

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.
@@ -161,7 +161,7 @@ function EventForm(inProps) {
161
161
  link: (event === null || event === void 0 ? void 0 : event.link) || '',
162
162
  liveStreamSettings: (event === null || event === void 0 ? void 0 : event.live_stream) ? event === null || event === void 0 ? void 0 : event.live_stream.settings : null,
163
163
  recurring: (event === null || event === void 0 ? void 0 : event.recurring) || types_1.SCEventRecurrenceType.NEVER,
164
- isPublic: (event === null || event === void 0 ? void 0 : event.privacy) === types_1.SCEventPrivacyType.PUBLIC || true,
164
+ isPublic: (event === null || event === void 0 ? void 0 : event.privacy) ? event.privacy === types_1.SCEventPrivacyType.PUBLIC : true,
165
165
  isSubmitting: false
166
166
  };
167
167
  // STATE
@@ -354,7 +354,10 @@ function EventForm(inProps) {
354
354
  // @ts-ignore
355
355
  toolbarTitle: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.date.title", defaultMessage: "ui.eventForm.date.title" })
356
356
  }
357
- }, onChange: (value) => handleChangeDateTime(value, 'startDate') }), (0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileTimePicker, { className: classes.picker, disablePast: disablePastStartTime, label: field.startTime && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.placeholder", defaultMessage: "ui.eventForm.time.placeholder" }), value: field.startTime, slots: {
357
+ }, onChange: (value) => {
358
+ handleChangeDateTime(value, 'startDate');
359
+ handleChangeDateTime(value, 'startTime');
360
+ } }), (0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileTimePicker, { className: classes.picker, disablePast: disablePastStartTime, label: field.startTime && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.placeholder", defaultMessage: "ui.eventForm.time.placeholder" }), value: field.startTime, slots: {
358
361
  textField: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.startTime)}`, startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "access_time" }) }) }))) }) })))
359
362
  }, slotProps: {
360
363
  toolbar: {
@@ -377,11 +380,11 @@ function EventForm(inProps) {
377
380
  // @ts-ignore
378
381
  toolbarTitle: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.date.title", defaultMessage: "ui.eventForm.date.title" })
379
382
  }
380
- }, onChange: (value) => handleChangeDateTime(value, 'endDate'), shouldDisableDate: shouldDisableDate }), (0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileTimePicker, { className: classes.picker, disablePast: disablePastEndTime, label: field.endTime && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.end.placeholder", defaultMessage: "ui.eventForm.time.end.placeholder" }), value: field.endTime, slots: {
381
- textField: (params) => {
382
- var _a;
383
- return ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "access_time" }) }) }))) }), error: Boolean(error['endDateError']), helperText: ((_a = error['endDateError']) === null || _a === void 0 ? void 0 : _a.error) ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.end.error.invalid", defaultMessage: "ui.eventForm.time.end.error.invalid" })) : null })));
384
- }
383
+ }, onChange: (value) => {
384
+ handleChangeDateTime(value, 'endDate');
385
+ handleChangeDateTime(value, 'endTime');
386
+ }, shouldDisableDate: shouldDisableDate }), (0, jsx_runtime_1.jsx)(x_date_pickers_1.MobileTimePicker, { className: classes.picker, disablePast: disablePastEndTime, label: field.endTime && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.time.end.placeholder", defaultMessage: "ui.eventForm.time.end.placeholder" }), value: field.endTime, slots: {
387
+ textField: (params) => ((0, jsx_runtime_1.jsx)(material_1.TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "start" }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "access_time" }) }) }))) }) })))
385
388
  }, slotProps: {
386
389
  toolbar: {
387
390
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
@@ -39,7 +39,7 @@ function EventMembersWidget(inProps) {
39
39
  props: inProps,
40
40
  name: constants_1.PREFIX
41
41
  });
42
- const { event, eventId, userProps = {}, endpointQueryParams = { limit: 5, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, cacheStrategy, dialogProps, limit = 5 } = props, rest = tslib_1.__rest(props, ["event", "eventId", "userProps", "endpointQueryParams", "cacheStrategy", "dialogProps", "limit"]);
42
+ const { event, eventId, userProps = {}, endpointQueryParams = { limit: 5, offset: Pagination_1.DEFAULT_PAGINATION_OFFSET }, cacheStrategy = utils_1.CacheStrategies.NETWORK_ONLY, dialogProps, limit = 5 } = props, rest = tslib_1.__rest(props, ["event", "eventId", "userProps", "endpointQueryParams", "cacheStrategy", "dialogProps", "limit"]);
43
43
  // STATE
44
44
  const [participants, dispatchParticipants] = (0, react_1.useReducer)(widget_1.dataWidgetReducer, {
45
45
  isLoadingNext: false,
@@ -22,7 +22,7 @@ const classes = {
22
22
  const Root = (0, styles_1.styled)(material_1.Box, {
23
23
  name: constants_1.PREFIX,
24
24
  slot: 'Root'
25
- })(({ theme }) => ({}));
25
+ })(() => ({}));
26
26
  /**
27
27
  * > API documentation for the Community-JS Footer component. Learn about the available props and the CSS API.
28
28
  *
@@ -57,12 +57,13 @@ function Footer(inProps) {
57
57
  });
58
58
  const { className, menu = null, startActions = null, endActions = null } = props, rest = tslib_1.__rest(props, ["className", "menu", "startActions", "endActions"]);
59
59
  // PREFERENCES
60
- const scPreferences = (0, react_core_1.useSCPreferences)();
60
+ const { preferences } = (0, react_core_1.useSCPreferences)();
61
61
  const copyright = (0, react_1.useMemo)(() => {
62
- return scPreferences.preferences && react_core_1.SCPreferences.TEXT_APPLICATION_COPYRIGHT in scPreferences.preferences
63
- ? scPreferences.preferences[react_core_1.SCPreferences.TEXT_APPLICATION_COPYRIGHT].value.replace('$year', new Date().getFullYear())
62
+ return preferences && react_core_1.SCPreferences.TEXT_APPLICATION_COPYRIGHT in preferences
63
+ ? preferences[react_core_1.SCPreferences.TEXT_APPLICATION_COPYRIGHT].value.replace('$year', new Date().getFullYear())
64
64
  : null;
65
- }, [scPreferences.preferences]);
65
+ }, [preferences]);
66
+ const exploreStreamEnabled = preferences[react_core_1.SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value;
66
67
  // STATE
67
68
  const [_menu, setMenu] = (0, react_1.useState)(menu);
68
69
  const [loading, setLoading] = (0, react_1.useState)(!menu);
@@ -95,6 +96,8 @@ function Footer(inProps) {
95
96
  if (loading) {
96
97
  return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
97
98
  }
98
- return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({}, rest, { className: (0, classnames_1.default)(classes.root, className) }, { children: [startActions, (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.itemList }, { children: (0, utils_1.sortByAttr)(_menu.items, 'order').map((item, index) => ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, className: classes.item, to: item.url, variant: "text" }, { children: item.label }), item.id))) })), endActions, (0, jsx_runtime_1.jsx)(material_1.Typography, { textAlign: "center", className: classes.copyright, variant: "body2", dangerouslySetInnerHTML: { __html: copyright } })] })));
99
+ return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({}, rest, { className: (0, classnames_1.default)(classes.root, className) }, { children: [startActions, (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.itemList }, { children: (0, utils_1.sortByAttr)(_menu.items, 'order')
100
+ .filter((item) => exploreStreamEnabled || item.url !== constants_1.EXPLORE_MENU_ITEM)
101
+ .map((item, index) => ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ component: react_core_1.Link, className: classes.item, to: item.url, variant: "text" }, { children: item.label }), item.id))) })), endActions, (0, jsx_runtime_1.jsx)(material_1.Typography, { textAlign: "center", className: classes.copyright, variant: "body2", dangerouslySetInnerHTML: { __html: copyright } })] })));
99
102
  }
100
103
  exports.default = Footer;
@@ -1 +1,2 @@
1
1
  export declare const PREFIX = "SCFooter";
2
+ export declare const EXPLORE_MENU_ITEM = "/explore/";
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PREFIX = void 0;
3
+ exports.EXPLORE_MENU_ITEM = exports.PREFIX = void 0;
4
4
  exports.PREFIX = 'SCFooter';
5
+ exports.EXPLORE_MENU_ITEM = '/explore/';
@@ -159,7 +159,7 @@ export default function EventForm(inProps) {
159
159
  link: (event === null || event === void 0 ? void 0 : event.link) || '',
160
160
  liveStreamSettings: (event === null || event === void 0 ? void 0 : event.live_stream) ? event === null || event === void 0 ? void 0 : event.live_stream.settings : null,
161
161
  recurring: (event === null || event === void 0 ? void 0 : event.recurring) || SCEventRecurrenceType.NEVER,
162
- isPublic: (event === null || event === void 0 ? void 0 : event.privacy) === SCEventPrivacyType.PUBLIC || true,
162
+ isPublic: (event === null || event === void 0 ? void 0 : event.privacy) ? event.privacy === SCEventPrivacyType.PUBLIC : true,
163
163
  isSubmitting: false
164
164
  };
165
165
  // STATE
@@ -352,7 +352,10 @@ export default function EventForm(inProps) {
352
352
  // @ts-ignore
353
353
  toolbarTitle: _jsx(FormattedMessage, { id: "ui.eventForm.date.title", defaultMessage: "ui.eventForm.date.title" })
354
354
  }
355
- }, onChange: (value) => handleChangeDateTime(value, 'startDate') }), _jsx(MobileTimePicker, { className: classes.picker, disablePast: disablePastStartTime, label: field.startTime && _jsx(FormattedMessage, { id: "ui.eventForm.time.placeholder", defaultMessage: "ui.eventForm.time.placeholder" }), value: field.startTime, slots: {
355
+ }, onChange: (value) => {
356
+ handleChangeDateTime(value, 'startDate');
357
+ handleChangeDateTime(value, 'startTime');
358
+ } }), _jsx(MobileTimePicker, { className: classes.picker, disablePast: disablePastStartTime, label: field.startTime && _jsx(FormattedMessage, { id: "ui.eventForm.time.placeholder", defaultMessage: "ui.eventForm.time.placeholder" }), value: field.startTime, slots: {
356
359
  textField: (params) => (_jsx(TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.startTime)}`, startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "access_time" }) }) }))) }) })))
357
360
  }, slotProps: {
358
361
  toolbar: {
@@ -375,11 +378,11 @@ export default function EventForm(inProps) {
375
378
  // @ts-ignore
376
379
  toolbarTitle: _jsx(FormattedMessage, { id: "ui.eventForm.date.title", defaultMessage: "ui.eventForm.date.title" })
377
380
  }
378
- }, onChange: (value) => handleChangeDateTime(value, 'endDate'), shouldDisableDate: shouldDisableDate }), _jsx(MobileTimePicker, { className: classes.picker, disablePast: disablePastEndTime, label: field.endTime && _jsx(FormattedMessage, { id: "ui.eventForm.time.end.placeholder", defaultMessage: "ui.eventForm.time.end.placeholder" }), value: field.endTime, slots: {
379
- textField: (params) => {
380
- var _a;
381
- return (_jsx(TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "access_time" }) }) }))) }), error: Boolean(error['endDateError']), helperText: ((_a = error['endDateError']) === null || _a === void 0 ? void 0 : _a.error) ? (_jsx(FormattedMessage, { id: "ui.eventForm.time.end.error.invalid", defaultMessage: "ui.eventForm.time.end.error.invalid" })) : null })));
382
- }
381
+ }, onChange: (value) => {
382
+ handleChangeDateTime(value, 'endDate');
383
+ handleChangeDateTime(value, 'endTime');
384
+ }, shouldDisableDate: shouldDisableDate }), _jsx(MobileTimePicker, { className: classes.picker, disablePast: disablePastEndTime, label: field.endTime && _jsx(FormattedMessage, { id: "ui.eventForm.time.end.placeholder", defaultMessage: "ui.eventForm.time.end.placeholder" }), value: field.endTime, slots: {
385
+ textField: (params) => (_jsx(TextField, Object.assign({}, params, { InputProps: Object.assign(Object.assign({}, params.InputProps), { placeholder: `${intl.formatMessage(messages.endTime)}`, startAdornment: (_jsx(InputAdornment, Object.assign({ position: "start" }, { children: _jsx(IconButton, { children: _jsx(Icon, { children: "access_time" }) }) }))) }) })))
383
386
  }, slotProps: {
384
387
  toolbar: {
385
388
  // eslint-disable-next-line @typescript-eslint/ban-ts-ignore,@typescript-eslint/ban-ts-comment
@@ -5,7 +5,7 @@ import { CardContent, Stack, Tab, Typography, useThemeProps } from '@mui/materia
5
5
  import { styled } from '@mui/system';
6
6
  import { EventService } from '@selfcommunity/api-services';
7
7
  import { SCCache, useSCFetchEvent, useSCUser } from '@selfcommunity/react-core';
8
- import { Logger } from '@selfcommunity/utils';
8
+ import { CacheStrategies, Logger } from '@selfcommunity/utils';
9
9
  import { useCallback, useEffect, useMemo, useReducer, useState } from 'react';
10
10
  import { FormattedMessage } from 'react-intl';
11
11
  import 'swiper/css';
@@ -37,7 +37,7 @@ export default function EventMembersWidget(inProps) {
37
37
  props: inProps,
38
38
  name: PREFIX
39
39
  });
40
- const { event, eventId, userProps = {}, endpointQueryParams = { limit: 5, offset: DEFAULT_PAGINATION_OFFSET }, cacheStrategy, dialogProps, limit = 5 } = props, rest = __rest(props, ["event", "eventId", "userProps", "endpointQueryParams", "cacheStrategy", "dialogProps", "limit"]);
40
+ const { event, eventId, userProps = {}, endpointQueryParams = { limit: 5, offset: DEFAULT_PAGINATION_OFFSET }, cacheStrategy = CacheStrategies.NETWORK_ONLY, dialogProps, limit = 5 } = props, rest = __rest(props, ["event", "eventId", "userProps", "endpointQueryParams", "cacheStrategy", "dialogProps", "limit"]);
41
41
  // STATE
42
42
  const [participants, dispatchParticipants] = useReducer(dataWidgetReducer, {
43
43
  isLoadingNext: false,
@@ -10,7 +10,7 @@ import { Logger, sortByAttr } from '@selfcommunity/utils';
10
10
  import { Link, SCPreferences, useSCPreferences } from '@selfcommunity/react-core';
11
11
  import { SCOPE_SC_UI } from '../../constants/Errors';
12
12
  import FooterSkeleton from './Skeleton';
13
- import { PREFIX } from './constants';
13
+ import { PREFIX, EXPLORE_MENU_ITEM } from './constants';
14
14
  const classes = {
15
15
  root: `${PREFIX}-root`,
16
16
  itemList: `${PREFIX}-item-list`,
@@ -20,7 +20,7 @@ const classes = {
20
20
  const Root = styled(Box, {
21
21
  name: PREFIX,
22
22
  slot: 'Root'
23
- })(({ theme }) => ({}));
23
+ })(() => ({}));
24
24
  /**
25
25
  * > API documentation for the Community-JS Footer component. Learn about the available props and the CSS API.
26
26
  *
@@ -55,12 +55,13 @@ export default function Footer(inProps) {
55
55
  });
56
56
  const { className, menu = null, startActions = null, endActions = null } = props, rest = __rest(props, ["className", "menu", "startActions", "endActions"]);
57
57
  // PREFERENCES
58
- const scPreferences = useSCPreferences();
58
+ const { preferences } = useSCPreferences();
59
59
  const copyright = useMemo(() => {
60
- return scPreferences.preferences && SCPreferences.TEXT_APPLICATION_COPYRIGHT in scPreferences.preferences
61
- ? scPreferences.preferences[SCPreferences.TEXT_APPLICATION_COPYRIGHT].value.replace('$year', new Date().getFullYear())
60
+ return preferences && SCPreferences.TEXT_APPLICATION_COPYRIGHT in preferences
61
+ ? preferences[SCPreferences.TEXT_APPLICATION_COPYRIGHT].value.replace('$year', new Date().getFullYear())
62
62
  : null;
63
- }, [scPreferences.preferences]);
63
+ }, [preferences]);
64
+ const exploreStreamEnabled = preferences[SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value;
64
65
  // STATE
65
66
  const [_menu, setMenu] = useState(menu);
66
67
  const [loading, setLoading] = useState(!menu);
@@ -93,5 +94,7 @@ export default function Footer(inProps) {
93
94
  if (loading) {
94
95
  return _jsx(FooterSkeleton, {});
95
96
  }
96
- return (_jsxs(Root, Object.assign({}, rest, { className: classNames(classes.root, className) }, { children: [startActions, _jsx(Box, Object.assign({ className: classes.itemList }, { children: sortByAttr(_menu.items, 'order').map((item, index) => (_jsx(Button, Object.assign({ component: Link, className: classes.item, to: item.url, variant: "text" }, { children: item.label }), item.id))) })), endActions, _jsx(Typography, { textAlign: "center", className: classes.copyright, variant: "body2", dangerouslySetInnerHTML: { __html: copyright } })] })));
97
+ return (_jsxs(Root, Object.assign({}, rest, { className: classNames(classes.root, className) }, { children: [startActions, _jsx(Box, Object.assign({ className: classes.itemList }, { children: sortByAttr(_menu.items, 'order')
98
+ .filter((item) => exploreStreamEnabled || item.url !== EXPLORE_MENU_ITEM)
99
+ .map((item, index) => (_jsx(Button, Object.assign({ component: Link, className: classes.item, to: item.url, variant: "text" }, { children: item.label }), item.id))) })), endActions, _jsx(Typography, { textAlign: "center", className: classes.copyright, variant: "body2", dangerouslySetInnerHTML: { __html: copyright } })] })));
97
100
  }
@@ -1 +1,2 @@
1
1
  export declare const PREFIX = "SCFooter";
2
+ export declare const EXPLORE_MENU_ITEM = "/explore/";
@@ -1 +1,2 @@
1
1
  export const PREFIX = 'SCFooter';
2
+ export const EXPLORE_MENU_ITEM = '/explore/';