@selfcommunity/react-ui 0.11.0-alpha.0 → 0.11.0-alpha.10
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 +1 -0
- package/lib/cjs/components/Composer/Composer.js +4 -4
- package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.d.ts +18 -0
- package/lib/cjs/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +36 -4
- package/lib/cjs/components/Composer/constants.d.ts +3 -0
- package/lib/cjs/components/Composer/constants.js +4 -1
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +6 -6
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +1 -1
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +11 -10
- package/lib/cjs/components/Editor/plugins/ToolbarPlugin.js +1 -1
- package/lib/cjs/components/EventMediaWidget/EventMediaWidget.js +2 -2
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +4 -4
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +2 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +1 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +1 -0
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +1 -2
- package/lib/cjs/shared/AutoPlayer/index.js +1 -1
- package/lib/cjs/utils/contribution.js +1 -2
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +1 -0
- package/lib/esm/components/Composer/Composer.js +4 -4
- package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.d.ts +18 -0
- package/lib/esm/components/Composer/Content/ContentDiscussion/ContentDiscussion.js +39 -7
- package/lib/esm/components/Composer/constants.d.ts +3 -0
- package/lib/esm/components/Composer/constants.js +3 -0
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +7 -7
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +1 -1
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +11 -10
- package/lib/esm/components/Editor/plugins/ToolbarPlugin.js +1 -1
- package/lib/esm/components/EventMediaWidget/EventMediaWidget.js +2 -2
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +1 -1
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +4 -4
- package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +2 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js +1 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +1 -0
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +1 -2
- package/lib/esm/shared/AutoPlayer/index.js +1 -1
- package/lib/esm/utils/contribution.js +1 -2
- package/lib/umd/react-ui.js +1 -1
- package/package.json +5 -5
|
@@ -72,6 +72,7 @@ function BottomNavigation(inProps) {
|
|
|
72
72
|
const eventsEnabled = (0, react_1.useMemo)(() => preferences &&
|
|
73
73
|
features &&
|
|
74
74
|
features.includes(types_1.SCFeatureName.TAGGING) &&
|
|
75
|
+
features.includes(types_1.SCFeatureName.EVENT) &&
|
|
75
76
|
react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in preferences &&
|
|
76
77
|
preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [preferences, features]);
|
|
77
78
|
const exploreStreamEnabled = preferences[react_core_1.SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value;
|
|
@@ -498,8 +498,6 @@ function Composer(inProps) {
|
|
|
498
498
|
}, [scUserContext.user, feedObjectType, id, type, title, html, categories, event, group, addressing, audience, medias, poll, location, hasPoll]);
|
|
499
499
|
//edited here
|
|
500
500
|
const handleClose = (0, react_1.useCallback)((e, reason) => {
|
|
501
|
-
console.log(e);
|
|
502
|
-
console.log(reason);
|
|
503
501
|
if (unloadRef.current) {
|
|
504
502
|
window.onbeforeunload = null;
|
|
505
503
|
}
|
|
@@ -564,7 +562,7 @@ function Composer(inProps) {
|
|
|
564
562
|
case Composer_1.COMPOSER_TYPE_POLL:
|
|
565
563
|
return ((0, jsx_runtime_1.jsx)(ContentPoll_1.default, { onChange: handleChangePoll, value: { html, event, group, addressing, medias, poll, location }, error: pollError, disabled: isSubmitting }, key));
|
|
566
564
|
case types_1.SCContributionType.DISCUSSION:
|
|
567
|
-
return ((0, jsx_runtime_1.jsx)(ContentDiscussion_1.default, { value: { title, html, categories, event, group, addressing, medias, poll, location }, error: { titleError, error }, onChange: handleChangeDiscussion, disabled: isSubmitting, EditorProps: Object.assign({ toolbar: true, uploadImage: true }, EditorProps) }, key));
|
|
565
|
+
return ((0, jsx_runtime_1.jsx)(ContentDiscussion_1.default, { value: { title, html, categories, event, group, addressing, medias, poll, location }, error: { titleError, error }, onChange: handleChangeDiscussion, disabled: isSubmitting, isContentSwitchButtonVisible: !canSubmit && !editMode, EditorProps: Object.assign({ toolbar: true, uploadImage: true }, EditorProps) }, key));
|
|
568
566
|
default:
|
|
569
567
|
return ((0, jsx_runtime_1.jsx)(ContentPost_1.default, { value: { html, categories, event, group, addressing, medias, poll, location }, error: { error }, onChange: handleChangePost, disabled: isSubmitting, EditorProps: Object.assign({ toolbar: false, uploadImage: false }, EditorProps) }, key));
|
|
570
568
|
}
|
|
@@ -584,7 +582,9 @@ function Composer(inProps) {
|
|
|
584
582
|
error,
|
|
585
583
|
handleChangePoll,
|
|
586
584
|
handleChangePost,
|
|
587
|
-
isSubmitting
|
|
585
|
+
isSubmitting,
|
|
586
|
+
canSubmit,
|
|
587
|
+
editMode
|
|
588
588
|
]);
|
|
589
589
|
if (!scUserContext.user && !(scUserContext.loading && open)) {
|
|
590
590
|
return null;
|
|
@@ -22,6 +22,24 @@ export interface ContentDiscussionProps extends Omit<BoxProps, 'value' | 'onChan
|
|
|
22
22
|
* @default empty object
|
|
23
23
|
*/
|
|
24
24
|
onChange: (value: ComposerContentType) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Value indicating the initial height
|
|
27
|
+
* @default 370
|
|
28
|
+
*/
|
|
29
|
+
defaultInitialMaxHeightContentEditor?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Value indicating the amount of space to take into account to dynamically
|
|
32
|
+
* calculate the max-height of the editor content (div.content)
|
|
33
|
+
* Default is :
|
|
34
|
+
* 90 (dialog topbar + bottombar) + 55 (editor toolbar) + 45 (selector content type) + 20 (title padding top/bottom)
|
|
35
|
+
* @default 210
|
|
36
|
+
*/
|
|
37
|
+
defaultExtraSpaceContentEditor?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Props indicate if the content switch button is visible
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
isContentSwitchButtonVisible?: boolean;
|
|
25
43
|
/**
|
|
26
44
|
* Props to spread into the editor object
|
|
27
45
|
* @default empty object
|
|
@@ -10,6 +10,8 @@ const Editor_1 = tslib_1.__importDefault(require("../../../Editor"));
|
|
|
10
10
|
const react_intl_1 = require("react-intl");
|
|
11
11
|
const Composer_1 = require("../../../../constants/Composer");
|
|
12
12
|
const constants_1 = require("../../constants");
|
|
13
|
+
const constants_2 = require("../../../Editor/constants");
|
|
14
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
13
15
|
const classes = {
|
|
14
16
|
root: `${constants_1.PREFIX}-content-discussion-root`,
|
|
15
17
|
generalError: `${constants_1.PREFIX}-general-error`,
|
|
@@ -35,22 +37,52 @@ const DEFAULT_DISCUSSION = {
|
|
|
35
37
|
};
|
|
36
38
|
exports.default = (props) => {
|
|
37
39
|
// PROPS
|
|
38
|
-
const { className = null, value = Object.assign({}, DEFAULT_DISCUSSION), error = {}, disabled = false, onChange, EditorProps = {} } = props;
|
|
40
|
+
const { className = null, value = Object.assign({}, DEFAULT_DISCUSSION), defaultInitialMaxHeightContentEditor = constants_1.DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR, defaultExtraSpaceContentEditor = constants_1.DEFAULT_EXTRA_SPACE_CONTENT_EDITOR, isContentSwitchButtonVisible = true, error = {}, disabled = false, onChange, EditorProps = {} } = props;
|
|
39
41
|
const { titleError = null, error: generalError = null } = Object.assign({}, error);
|
|
42
|
+
const titleRef = (0, react_1.useRef)(null);
|
|
43
|
+
const [editorMaxHeight, setEditorMaxHeight] = (0, react_1.useState)(defaultInitialMaxHeightContentEditor + (isContentSwitchButtonVisible ? 0 : constants_1.DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE));
|
|
40
44
|
// HOOKS
|
|
41
45
|
const intl = (0, react_intl_1.useIntl)();
|
|
46
|
+
const theme = (0, material_1.useTheme)();
|
|
47
|
+
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
48
|
+
const isIOS = (0, react_1.useMemo)(() => (0, utils_1.iOS)(), []);
|
|
42
49
|
// HANDLERS
|
|
43
50
|
const handleChangeTitle = (0, react_1.useCallback)((event) => {
|
|
44
51
|
onChange(Object.assign(Object.assign({}, value), { title: event.target.value }));
|
|
45
52
|
}, [value]);
|
|
53
|
+
const handleKeyDownTitle = (0, react_1.useCallback)((event) => {
|
|
54
|
+
if (event.key === 'Enter') {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
}
|
|
57
|
+
else if (value.title.length > Composer_1.COMPOSER_TITLE_MAX_LENGTH &&
|
|
58
|
+
['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Delete', 'Backspace', 'Shift', 'Home', 'End'].indexOf(event.key) < 0) {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
}
|
|
61
|
+
}, [value]);
|
|
46
62
|
const handleChangeHtml = (0, react_1.useCallback)((html) => {
|
|
47
63
|
onChange(Object.assign(Object.assign({}, value), { html }));
|
|
48
64
|
}, [value]);
|
|
65
|
+
const computeEditorContentHeight = (0, react_1.useCallback)(() => {
|
|
66
|
+
if (titleRef.current) {
|
|
67
|
+
if (isMobile) {
|
|
68
|
+
// Measure title input height
|
|
69
|
+
const rect = titleRef.current.getBoundingClientRect();
|
|
70
|
+
const _delta = defaultExtraSpaceContentEditor + rect.height + (isIOS ? 30 : 0) - (isContentSwitchButtonVisible ? 0 : constants_1.DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE);
|
|
71
|
+
setEditorMaxHeight(`calc(100vh - ${_delta}px)`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
setEditorMaxHeight(constants_1.DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR + (isContentSwitchButtonVisible ? 0 : constants_1.DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE) + 'px');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}, [isMobile, titleRef.current, setEditorMaxHeight, isIOS, isContentSwitchButtonVisible]);
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
79
|
+
computeEditorContentHeight();
|
|
80
|
+
}, [value, isContentSwitchButtonVisible, computeEditorContentHeight, isMobile]);
|
|
49
81
|
// RENDER
|
|
50
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [generalError && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.generalError }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.composer.error.${generalError}`, defaultMessage: `ui.composer.error.${generalError}` }) }))), (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.title, placeholder: intl.formatMessage({
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [generalError && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.generalError }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.composer.error.${generalError}`, defaultMessage: `ui.composer.error.${generalError}` }) }))), (0, jsx_runtime_1.jsx)(material_1.TextField, { className: classes.title, ref: titleRef, placeholder: intl.formatMessage({
|
|
51
83
|
id: 'ui.composer.content.discussion.title.label',
|
|
52
84
|
defaultMessage: 'ui.composer.content.discussion.title.label'
|
|
53
|
-
}), autoFocus: true, fullWidth: true, variant: "outlined", value: value.title,
|
|
85
|
+
}), autoFocus: true, fullWidth: true, variant: "outlined", value: value.title, onChange: handleChangeTitle, onKeyDown: handleKeyDownTitle, multiline: true, InputProps: {
|
|
54
86
|
endAdornment: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2" }, { children: Composer_1.COMPOSER_TITLE_MAX_LENGTH - value.title.length }))
|
|
55
|
-
}, error: Boolean(titleError), helperText: titleError, disabled: disabled }), (0, jsx_runtime_1.jsx)(Editor_1.default, Object.assign({}, EditorProps, { editable: !disabled, className: classes.editor, onChange: handleChangeHtml, defaultValue: value.html }))] })));
|
|
87
|
+
}, error: Boolean(titleError), helperText: titleError, disabled: disabled }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { [`& .${constants_2.PREFIX}-content`]: { maxHeight: `${editorMaxHeight} !important` } } }, { children: (0, jsx_runtime_1.jsx)(Editor_1.default, Object.assign({}, EditorProps, { editable: !disabled, className: classes.editor, onChange: handleChangeHtml, defaultValue: value.html })) }))] })));
|
|
56
88
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PREFIX = void 0;
|
|
3
|
+
exports.DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE = exports.DEFAULT_EXTRA_SPACE_CONTENT_EDITOR = exports.DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR = exports.PREFIX = void 0;
|
|
4
4
|
exports.PREFIX = 'SCComposer';
|
|
5
|
+
exports.DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR = 370;
|
|
6
|
+
exports.DEFAULT_EXTRA_SPACE_CONTENT_EDITOR = 210;
|
|
7
|
+
exports.DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE = 45;
|
|
@@ -16,13 +16,13 @@ const CreateLiveStreamDialog_1 = tslib_1.__importDefault(require("../CreateLiveS
|
|
|
16
16
|
const PREFIX = 'SCComposerIconButton';
|
|
17
17
|
const classes = {
|
|
18
18
|
root: `${PREFIX}-root`,
|
|
19
|
-
|
|
19
|
+
menuRoot: `${PREFIX}-menu-root`
|
|
20
20
|
};
|
|
21
21
|
const Root = (0, material_1.styled)(material_1.IconButton, {
|
|
22
22
|
name: PREFIX,
|
|
23
23
|
slot: 'Root'
|
|
24
24
|
})(() => ({}));
|
|
25
|
-
const
|
|
25
|
+
const MenuRoot = (0, material_1.styled)(material_1.Menu, {
|
|
26
26
|
name: PREFIX,
|
|
27
27
|
slot: 'Root',
|
|
28
28
|
overridesResolver: (_props, styles) => styles.popperRoot
|
|
@@ -88,9 +88,9 @@ exports.default = react_1.default.forwardRef(function ComposerIconButton(inProps
|
|
|
88
88
|
const canCreateEvent = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_event; }, [(_b = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _b === void 0 ? void 0 : _b.permission]);
|
|
89
89
|
const canCreateLiveStream = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _a === void 0 ? void 0 : _a.permission) === null || _b === void 0 ? void 0 : _b.create_live_stream; }, [(_c = scUserContext === null || scUserContext === void 0 ? void 0 : scUserContext.user) === null || _c === void 0 ? void 0 : _c.permission]);
|
|
90
90
|
const renderContent = (0, react_1.useMemo)(() => {
|
|
91
|
-
return ((0, jsx_runtime_1.jsx)(material_1.MenuList, { children: listItem.map((item, i) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ onClick: item.onClick }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: item.icon })) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "
|
|
91
|
+
return ((0, jsx_runtime_1.jsx)(material_1.MenuList, { children: listItem.map((item, i) => ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ onClick: item.onClick }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "small" }, { children: item.icon })) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: item.text, defaultMessage: item.text }) })) })] }), i))) }));
|
|
92
92
|
}, [listItem]);
|
|
93
|
-
//
|
|
93
|
+
// EFFECTS
|
|
94
94
|
(0, react_1.useEffect)(() => {
|
|
95
95
|
if (canCreateGroup) {
|
|
96
96
|
setListItem((prev) => [
|
|
@@ -159,7 +159,7 @@ exports.default = react_1.default.forwardRef(function ComposerIconButton(inProps
|
|
|
159
159
|
setOpenComposer(false);
|
|
160
160
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
161
161
|
}, [setOpenComposer, onClose]);
|
|
162
|
-
const
|
|
162
|
+
const handleCloseMenu = (0, react_1.useCallback)(() => {
|
|
163
163
|
setOpenPopper(false);
|
|
164
164
|
}, [setOpenPopper]);
|
|
165
165
|
const handleCloseCreateGroup = (0, react_1.useCallback)(() => {
|
|
@@ -182,5 +182,5 @@ exports.default = react_1.default.forwardRef(function ComposerIconButton(inProps
|
|
|
182
182
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClick, ref: (innerRef) => {
|
|
183
183
|
popperRef.current = innerRef;
|
|
184
184
|
return ref;
|
|
185
|
-
} }, rest, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "add_circle_outline" }) })), openComposer && (0, jsx_runtime_1.jsx)(Composer_1.default, Object.assign({ open:
|
|
185
|
+
} }, rest, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "add_circle_outline" }) })), openComposer && (0, jsx_runtime_1.jsx)(Composer_1.default, Object.assign({ open: true, fullWidth: true, onClose: handleCloseComposer, onSuccess: handleSuccess }, ComposerProps)), openPopper && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isMobile ? ((0, jsx_runtime_1.jsx)(material_1.SwipeableDrawer, Object.assign({ open: true, onClose: handleCloseMenu, onOpen: () => null, anchor: "bottom", disableSwipeToOpen: true }, { children: renderContent }))) : ((0, jsx_runtime_1.jsx)(MenuRoot, Object.assign({ open: true, anchorEl: popperRef.current, role: undefined, className: classes.menuRoot, onClose: handleCloseMenu }, PopperProps, { children: renderContent }))) })), openCreateGroup && (0, jsx_runtime_1.jsx)(GroupForm_1.default, Object.assign({ open: true, onClose: handleCloseCreateGroup }, GroupFormProps)), openCreateEvent && (0, jsx_runtime_1.jsx)(EventFormDialog_1.default, Object.assign({ open: true, onClose: handleCloseCreateEvent }, EventFormDialogComponentProps)), openCreateLiveStream && (0, jsx_runtime_1.jsx)(CreateLiveStreamDialog_1.default, Object.assign({ open: true, onClose: handleCloseCreateLiveStream }, CreateLiveStreamDialogComponentProps))] }));
|
|
186
186
|
});
|
|
@@ -98,6 +98,6 @@ function CreateLiveStreamDialog(inProps) {
|
|
|
98
98
|
/**
|
|
99
99
|
* Renders root object
|
|
100
100
|
*/
|
|
101
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: 'md', title: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.title, component: 'span' }, { children: [Boolean(step === types_2.CreateLiveStreamStep.CREATE_LIVE && canCreateEvent) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "arrow_back" }) }, { children: "
|
|
101
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ DialogContentProps: { dividers: false }, maxWidth: 'md', title: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.title, component: 'span' }, { children: [Boolean(step === types_2.CreateLiveStreamStep.CREATE_LIVE && canCreateEvent) && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", onClick: handleBack, startIcon: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "arrow_back" }) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createLivestreamDialog.button.back", defaultMessage: "ui.createLivestreamDialog.button.back" }) }))), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: 'span' }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.createLivestreamDialog.title", defaultMessage: "ui.createLivestreamDialog.title" }) }))] })), fullWidth: true, open: open, scroll: "body", onClose: onClose, className: (0, classnames_1.default)(classes.root, className), TransitionComponent: Transition, PaperProps: { elevation: 0 } }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.content }, { children: [step === types_2.CreateLiveStreamStep.SELECT_TYPE && ((0, jsx_runtime_1.jsx)(LiveStreamSelector_1.default, { liveSelected: liveType, onLiveSelected: handleLiveTypeSelected, onNext: handleLiveTypeSelectedNext })), step === types_2.CreateLiveStreamStep.CREATE_LIVE && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: liveType === types_2.LiveStreamType.EVENT_LIVE ? ((0, jsx_runtime_1.jsx)(EventForm_1.default, { EventAddressComponentProps: { locations: [types_1.SCEventLocationType.LIVESTREAM] }, onSuccess: handleSubmit })) : ((0, jsx_runtime_1.jsx)(LiveStreamForm_1.default, { onSuccess: handleSubmit })) }))] })) })));
|
|
102
102
|
}
|
|
103
103
|
exports.default = CreateLiveStreamDialog;
|
|
@@ -6,7 +6,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const styles_1 = require("@mui/material/styles");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
|
-
const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
|
|
10
9
|
const system_1 = require("@mui/system");
|
|
11
10
|
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
12
11
|
const types_1 = require("../types");
|
|
@@ -35,7 +34,12 @@ const OptionCard = (0, styles_1.styled)(material_1.Paper, {
|
|
|
35
34
|
name: exports.PREFIX,
|
|
36
35
|
slot: 'optionCardRoot',
|
|
37
36
|
shouldForwardProp: (prop) => prop !== 'selected'
|
|
38
|
-
})(({ theme, selected }) => ({
|
|
37
|
+
})(({ theme, selected }) => ({
|
|
38
|
+
'& h6': {
|
|
39
|
+
fontWeight: 'bold',
|
|
40
|
+
textTransform: 'uppercase'
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
39
43
|
const FeatureItem = (0, styles_1.styled)(material_1.Box, {
|
|
40
44
|
name: exports.PREFIX,
|
|
41
45
|
slot: 'featureItemRoot'
|
|
@@ -99,8 +103,7 @@ function LiveStreamSelector(inProps) {
|
|
|
99
103
|
id: 'ui.liveStreamForm.selector.scheduleLiveEventItem3',
|
|
100
104
|
defaultMessage: 'ui.liveStreamForm.selector.scheduleLiveEventItem3'
|
|
101
105
|
})
|
|
102
|
-
]
|
|
103
|
-
icons: [(0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" })]
|
|
106
|
+
]
|
|
104
107
|
},
|
|
105
108
|
{
|
|
106
109
|
title: intl.formatMessage({
|
|
@@ -122,8 +125,7 @@ function LiveStreamSelector(inProps) {
|
|
|
122
125
|
id: 'ui.liveStreamForm.selector.scheduleLiveStreamItem3',
|
|
123
126
|
defaultMessage: 'ui.liveStreamForm.selector.scheduleLiveStreamItem3'
|
|
124
127
|
})
|
|
125
|
-
]
|
|
126
|
-
icons: [(0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "chevron_right" })]
|
|
128
|
+
]
|
|
127
129
|
}
|
|
128
130
|
];
|
|
129
131
|
const handleOptionSelect = (type) => {
|
|
@@ -175,14 +177,13 @@ function LiveStreamSelector(inProps) {
|
|
|
175
177
|
}
|
|
176
178
|
return null;
|
|
177
179
|
}, [timeRemaining, isFreeTrialTier]);
|
|
178
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), maxWidth: "lg", sx: { py: 4 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", component: "h1", align: "center", gutterBottom: true, sx: { mb: 4, fontWeight: 500 } }, { children:
|
|
180
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), maxWidth: "lg", sx: { py: 4 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4", component: "h1", align: "center", gutterBottom: true, sx: { mb: 4, fontWeight: 500 } }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.selector.title", defaultMessage: "ui.liveStreamForm.selector.title" }) })), warning, (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.options }, { children: options.map((option, index) => ((0, jsx_runtime_1.jsxs)(OptionCard, Object.assign({ selected: selectedOption === option.type, onClick: () => handleOptionSelect(option.type), elevation: 0, role: "button", tabIndex: 0, onKeyDown: (e) => {
|
|
179
181
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
180
182
|
handleOptionSelect(index);
|
|
181
183
|
e.preventDefault();
|
|
182
184
|
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return ((0, jsx_runtime_1.jsxs)(FeatureItem, Object.assign({ component: "li" }, { children: [_Icon, (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "text.secondary", sx: { flex: 1 } }, { children: feature }))] }), featureIndex));
|
|
185
|
+
} }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6" }, { children: option.title })), (0, jsx_runtime_1.jsx)(material_1.Radio, { checked: selectedOption === option.type })] }), (0, jsx_runtime_1.jsx)("img", { src: option.image, alt: "option-image" }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ component: "ul" }, { children: option.features.map((feature, featureIndex) => {
|
|
186
|
+
return ((0, jsx_runtime_1.jsx)(FeatureItem, Object.assign({ component: "li" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", color: "text.secondary", sx: { flex: 1 } }, { children: feature })) }), featureIndex));
|
|
186
187
|
}) }))] }), index))) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ disabled: !selectedOption || !timeRemaining || isFreeTrialTier, variant: "contained", onClick: handleNext, color: "secondary" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.selector.next", defaultMessage: "ui.liveStreamForm.selector.next" }) })) }))] })));
|
|
187
188
|
}
|
|
188
189
|
exports.default = LiveStreamSelector;
|
|
@@ -158,7 +158,7 @@ function ToolbarPlugin(inProps) {
|
|
|
158
158
|
setFormats(FORMATS.filter((f) => selection.hasFormat(f)));
|
|
159
159
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
160
160
|
// @ts-ignore
|
|
161
|
-
setAlignment(ALIGNMENTS.find((a) => element.getFormatType() === a) || ALIGNMENTS[0]);
|
|
161
|
+
setAlignment(ALIGNMENTS.find((a) => { var _a; return ((_a = element.getFormatType) === null || _a === void 0 ? void 0 : _a.call(element)) === a; }) || ALIGNMENTS[0]);
|
|
162
162
|
// Update links
|
|
163
163
|
const node = (0, editor_1.getSelectedNode)(selection);
|
|
164
164
|
const parent = node.getParent();
|
|
@@ -247,10 +247,10 @@ function EventMediaWidget(inProps) {
|
|
|
247
247
|
}
|
|
248
248
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, rest, { showPadding: hasAllow }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardHeader, { title: (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", justifyContent: "space-between", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.title", defaultMessage: "ui.eventMediaWidget.title" }) })), hasAllow && mediasCount > 0 && (0, jsx_runtime_1.jsx)(TriggerButton_1.default, { size: "small", onAdd: handleAddMedia })] })), className: classes.header }), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsxs)(system_1.Box, Object.assign({ className: classes.grid }, { children: [showSkeleton === 'widget' && (0, jsx_runtime_1.jsx)(Skeleton_1.EventMediaSkeleton, {}), medias.slice(0, MEDIAS_TO_SHOW).map((media, i, array) => ((0, jsx_runtime_1.jsx)(system_1.Box, Object.assign({ onClick: () => handleOpenLightbox(i), sx: {
|
|
249
249
|
background: `url(${media.image}) no-repeat center`
|
|
250
|
-
}, className: classes.media }, { children: medias.length > array.length && i === array.length - 1 && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(system_1.Box, { className: classes.mediaLayer }), (0, jsx_runtime_1.jsx)(system_1.Box, Object.assign({ className: classes.countHiddenMediaWrapper }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.countHiddenMedia }, { children: ["+", countHiddenMedia] })) }))] })) }), media.id))), hasAllow && mediasCount === 0 && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.add", defaultMessage: "ui.eventMediaWidget.add" }) }, { children: (0, jsx_runtime_1.jsx)(TriggerButton_1.default, { size: "large", onAdd: handleAddMedia, isSquare: true }) })))] })), preview !== -1 && (0, jsx_runtime_1.jsx)(Lightbox_1.Lightbox, { onClose: handleCloseLightbox, index: preview, medias: medias, onIndexChange: _fetchNext })] })), hasAllow && mediasCount > 0 && ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.showAll", defaultMessage: "ui.eventMediaWidget.showAll" }) })) })) }))), (0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: intl.formatMessage(messages.title, { user: scEvent.managed_by.username }), onClose: handleToggleDialogOpen, open:
|
|
250
|
+
}, className: classes.media }, { children: medias.length > array.length && i === array.length - 1 && ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(system_1.Box, { className: classes.mediaLayer }), (0, jsx_runtime_1.jsx)(system_1.Box, Object.assign({ className: classes.countHiddenMediaWrapper }, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.countHiddenMedia }, { children: ["+", countHiddenMedia] })) }))] })) }), media.id))), hasAllow && mediasCount === 0 && ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.add", defaultMessage: "ui.eventMediaWidget.add" }) }, { children: (0, jsx_runtime_1.jsx)(TriggerButton_1.default, { size: "large", onAdd: handleAddMedia, isSquare: true }) })))] })), preview !== -1 && (0, jsx_runtime_1.jsx)(Lightbox_1.Lightbox, { onClose: handleCloseLightbox, index: preview, medias: medias, onIndexChange: _fetchNext })] })), hasAllow && mediasCount > 0 && ((0, jsx_runtime_1.jsx)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.showAll", defaultMessage: "ui.eventMediaWidget.showAll" }) })) })) }))), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: intl.formatMessage(messages.title, { user: scEvent.managed_by.username }), onClose: handleToggleDialogOpen, open: true }, dialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: medias.length, height: isMobile ? '100%' : '515px', next: handleNext, hasMoreNext: Boolean(state.next), className: classes.dialogInfiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.noMoreResults", defaultMessage: "ui.eventMediaWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsxs)(system_1.Box, Object.assign({ className: classes.grid }, { children: [medias.map((media) => ((0, jsx_runtime_1.jsx)(system_1.Box, Object.assign({ sx: {
|
|
251
251
|
background: `url(${media.image}) no-repeat center`
|
|
252
252
|
}, className: classes.dialogMediaWrapper }, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.dialogButtonWrapper }, { children: (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ className: classes.dialogLoadingButton, loading: mediaId === media.id, size: "large", onClick: () => handleRemoveMedia(media.id), sx: {
|
|
253
253
|
color: (theme) => (mediaId === media.id ? 'transparent' : theme.palette.common.white)
|
|
254
|
-
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "inherit" }, { children: "delete" })) })) })) }), media.id))), showSkeleton === 'dialog' && Array.from(Array(countHiddenMedia)).map((_, i) => (0, jsx_runtime_1.jsx)(Skeleton_1.EventMediaSkeleton, {}, i))] })) })) })), (0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, { open:
|
|
254
|
+
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ fontSize: "inherit" }, { children: "delete" })) })) })) }), media.id))), showSkeleton === 'dialog' && Array.from(Array(countHiddenMedia)).map((_, i) => (0, jsx_runtime_1.jsx)(Skeleton_1.EventMediaSkeleton, {}, i))] })) })) }))), openDialogConfirm && ((0, jsx_runtime_1.jsx)(ConfirmDialog_1.default, { open: true, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.dialog.title", defaultMessage: "ui.eventMediaWidget.dialog.title" }), content: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.dialog.msg", defaultMessage: "ui.eventMediaWidget.dialog.msg" }), btnConfirm: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMediaWidget.dialog.confirm", defaultMessage: "ui.eventMediaWidget.dialog.confirm" }), isUpdating: loading, onConfirm: handleConfirmAction, onClose: handleCloseAction }))] })));
|
|
255
255
|
}
|
|
256
256
|
exports.default = EventMediaWidget;
|
|
@@ -135,6 +135,6 @@ function TabContentComponent(props) {
|
|
|
135
135
|
else if (tabValue === types_1.TabContentEnum.REQUESTS && (actionProps === null || actionProps === void 0 ? void 0 : actionProps.count) === 0) {
|
|
136
136
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noOtherRequests", defaultMessage: "ui.eventMembersWidget.noOtherRequests" }) })));
|
|
137
137
|
}
|
|
138
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { children: users === null || users === void 0 ? void 0 : users.slice(0, state.visibleItems).map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count > state.visibleItems && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))), (0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventMembersWidget.title", id: "ui.eventMembersWidget.title" }), onClose: handleToggleDialogOpen, open:
|
|
138
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.List, { children: users === null || users === void 0 ? void 0 : users.slice(0, state.visibleItems).map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps, { actions: getActionsComponent(user.id) })) }, user.id))) }), state.count > state.visibleItems && ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: handleToggleDialogOpen, className: classes.actionButton }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.showAll", defaultMessage: "ui.eventMembersWidget.showAll" }) })) }))), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventMembersWidget.title", id: "ui.eventMembersWidget.title" }), onClose: handleToggleDialogOpen, open: true }, dialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: state.results.length, next: handleNext, hasMoreNext: Boolean(state.next), loaderNext: (0, jsx_runtime_1.jsx)(User_1.UserSkeleton, Object.assign({ elevation: 0 }, userProps)), className: classes.infiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventMembersWidget.noMoreResults", defaultMessage: "ui.eventMembersWidget.noMoreResults" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: state.results.map((user) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, Object.assign({ elevation: 0, user: user }, userProps)) }, user.id))) }) })) })))] }));
|
|
139
139
|
}
|
|
140
140
|
exports.default = TabContentComponent;
|
|
@@ -71,7 +71,7 @@ function EventParticipantsButton(inProps) {
|
|
|
71
71
|
const [next, setNext] = (0, react_1.useState)(null);
|
|
72
72
|
const [offset, setOffset] = (0, react_1.useState)(null);
|
|
73
73
|
const [followers, setFollowers] = (0, react_1.useState)([]);
|
|
74
|
-
const [
|
|
74
|
+
const [openDialog, setOpenDialog] = (0, react_1.useState)(false);
|
|
75
75
|
// HOOKS
|
|
76
76
|
const { scEvent } = (0, react_core_1.useSCFetchEvent)({ id: eventId, event, autoSubscribe: false });
|
|
77
77
|
const participantsAvailable = (0, react_1.useMemo)(() => (scEvent === null || scEvent === void 0 ? void 0 : scEvent.privacy) === types_1.SCEventPrivacyType.PUBLIC ||
|
|
@@ -131,10 +131,10 @@ function EventParticipantsButton(inProps) {
|
|
|
131
131
|
* Opens dialog votes
|
|
132
132
|
*/
|
|
133
133
|
const handleToggleDialogOpen = (0, react_1.useCallback)(() => {
|
|
134
|
-
|
|
135
|
-
}, [
|
|
134
|
+
setOpenDialog((prev) => !prev);
|
|
135
|
+
}, [setOpenDialog]);
|
|
136
136
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleToggleDialogOpen, disabled: loading || !scEvent || scEvent.goings_counter === 0,
|
|
137
137
|
// @ts-expect-error this is needed to use followers into SCEventParticipantsButton
|
|
138
|
-
followers: followers }, rest, { children: [!hideCaption && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.participants, variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventParticipantsButton.participants", id: "ui.eventParticipantsButton.participants" }) }))), !followers.length && (loading || !scEvent) ? ((0, jsx_runtime_1.jsx)(AvatarGroupSkeleton_1.default, Object.assign({}, rest, (!participantsAvailable && { skeletonsAnimation: false })))) : ((0, jsx_runtime_1.jsx)(material_1.AvatarGroup, Object.assign({ total: followers.length, renderSurplus: renderSurplus }, { children: followers.map((c) => ((0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: c.username, src: c.avatar }, c.id))) })))] })), (0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventParticipantsButton.dialogTitle", id: "ui.eventParticipantsButton.dialogTitle", values: { total: (scEvent === null || scEvent === void 0 ? void 0 : scEvent.goings_counter) || 0 } }), onClose: handleToggleDialogOpen, open:
|
|
138
|
+
followers: followers }, rest, { children: [!hideCaption && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.participants, variant: "caption" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventParticipantsButton.participants", id: "ui.eventParticipantsButton.participants" }) }))), !followers.length && (loading || !scEvent) ? ((0, jsx_runtime_1.jsx)(AvatarGroupSkeleton_1.default, Object.assign({}, rest, (!participantsAvailable && { skeletonsAnimation: false })))) : ((0, jsx_runtime_1.jsx)(material_1.AvatarGroup, Object.assign({ total: followers.length, renderSurplus: renderSurplus }, { children: followers.map((c) => ((0, jsx_runtime_1.jsx)(material_1.Avatar, { alt: c.username, src: c.avatar }, c.id))) })))] })), openDialog && ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ className: classes.dialogRoot, title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "ui.eventParticipantsButton.dialogTitle", id: "ui.eventParticipantsButton.dialogTitle", values: { total: (scEvent === null || scEvent === void 0 ? void 0 : scEvent.goings_counter) || 0 } }), onClose: handleToggleDialogOpen, open: true }, DialogProps, { children: (0, jsx_runtime_1.jsx)(InfiniteScroll_1.default, Object.assign({ dataLength: followers.length, next: fetchFollowers, hasMoreNext: next !== null || loading, loaderNext: (0, jsx_runtime_1.jsx)(User_1.UserSkeleton, { elevation: 0 }), className: classes.infiniteScroll, endMessage: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.endMessage }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventParticipantsButton.noOtherParticipants", defaultMessage: "ui.eventParticipantsButton.noOtherParticipants" }) })) }, { children: (0, jsx_runtime_1.jsx)(material_1.List, { children: followers.map((follower) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, { children: (0, jsx_runtime_1.jsx)(User_1.default, { elevation: 0, user: follower }) }, follower.id))) }) })) })))] }));
|
|
139
139
|
}
|
|
140
140
|
exports.default = EventParticipantsButton;
|
|
@@ -43,7 +43,7 @@ function Activities(props) {
|
|
|
43
43
|
: comments_1.SCCommentsOrderBy.ADDED_AT_DESC
|
|
44
44
|
});
|
|
45
45
|
const objId = commentsObject.feedObject ? commentsObject.feedObject.id : null;
|
|
46
|
-
const skeletonsCount = Math.min(
|
|
46
|
+
const skeletonsCount = Math.min(2, commentsObject.feedObject ? commentsObject.feedObject.comment_count : 2);
|
|
47
47
|
const existFeedObjectActivities = feedObjectActivities && feedObjectActivities.length > 0;
|
|
48
48
|
/**
|
|
49
49
|
* Sync activities type if prop change
|
|
@@ -24,7 +24,7 @@ const classes = {
|
|
|
24
24
|
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
25
25
|
name: exports.PREFIX,
|
|
26
26
|
slot: 'Root'
|
|
27
|
-
})((
|
|
27
|
+
})(() => ({}));
|
|
28
28
|
/**
|
|
29
29
|
*> API documentation for the Community-JS LiveStreamSettingsForm component. Learn about the available props and the CSS API.
|
|
30
30
|
*
|
|
@@ -75,6 +75,6 @@ function LiveStreamSettingsForm(inProps) {
|
|
|
75
75
|
*/
|
|
76
76
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, rest, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.muteParticipants), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['muteParticipants']: !(settings === null || settings === void 0 ? void 0 : settings.muteParticipants) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.muteParticipants", defaultMessage: "ui.liveStreamForm.muteParticipants" }) }))] })), isEnterpriseFeaturesVisible && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableVideo), disabled: !isEnterpriseTier || !liveStreamEnabled, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableVideo']: !(settings === null || settings === void 0 ? void 0 : settings.disableVideo) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableVideo", defaultMessage: "ui.liveStreamForm.disableVideo" }) })), (0, jsx_runtime_1.jsx)(UpScalingTierBadge_1.default, { desiredTier: types_1.SCCommunitySubscriptionTier.ENTERPRISE })] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen), disabled: !isEnterpriseTier || !liveStreamEnabled, onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableShareScreen']: !(settings === null || settings === void 0 ? void 0 : settings.disableShareScreen) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableShareScreen", defaultMessage: "ui.liveStreamForm.disableShareScreen" }) })), (0, jsx_runtime_1.jsx)(UpScalingTierBadge_1.default, { desiredTier: types_1.SCCommunitySubscriptionTier.ENTERPRISE })] }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.disableChat), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['disableChat']: !(settings === null || settings === void 0 ? void 0 : settings.disableChat) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.disableChat", defaultMessage: "ui.liveStreamForm.disableChat" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['hideParticipantsList']: !(settings === null || settings === void 0 ? void 0 : settings.hideParticipantsList) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.hideParticipantsList", defaultMessage: "ui.liveStreamForm.hideParticipantsList" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['automaticallyNotifyFollowers']: !(settings === null || settings === void 0 ? void 0 : settings.automaticallyNotifyFollowers) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.automaticallyNotifyFollowers", defaultMessage: "ui.liveStreamForm.automaticallyNotifyFollowers" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Switch, { className: classes.switch, disabled: !liveStreamEnabled, checked: Boolean(settings === null || settings === void 0 ? void 0 : settings.showInProfile), onChange: () => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['showInProfile']: !(settings === null || settings === void 0 ? void 0 : settings.showInProfile) })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.switchLabel }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.showInProfile", defaultMessage: "ui.liveStreamForm.showInProfile" }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.FormControl, Object.assign({ className: classes.accessView }, { children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, Object.assign({ id: "viewLabel" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }) })), (0, jsx_runtime_1.jsx)(material_1.Select, Object.assign({ name: "view", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamForm.view.label", defaultMessage: "ui.liveStreamForm.view.label" }), labelId: "viewLabel", disabled: !liveStreamEnabled, fullWidth: true, value: (_a = settings === null || settings === void 0 ? void 0 : settings.view) !== null && _a !== void 0 ? _a : types_1.SCLiveStreamViewType.SPEAKER, onChange: (e) => onChange(Object.assign(Object.assign(Object.assign({}, constants_1.LIVESTREAM_DEFAULT_SETTINGS), settings), { ['view']: e.target.value })), displayEmpty: true, renderValue: (selected) => {
|
|
77
77
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.accessViewIcon }, { children: selected === types_1.SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${selected}`, defaultMessage: `ui.liveStreamForm.view.${selected}` })] }));
|
|
78
|
-
} }, { children: Object.values(types_1.SCLiveStreamViewType).map((f) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: f }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsxs)("b", { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.accessViewIcon }, { children: f === types_1.SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}`, defaultMessage: `ui.liveStreamForm.view.${f}` })] }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}.description`, defaultMessage: `ui.liveStreamForm.view.${f}.description` }) })] }) }), f))) }))] }))] })));
|
|
78
|
+
} }, { children: Object.values(types_1.SCLiveStreamViewType).map((f) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: f }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsxs)("b", { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.accessViewIcon }, { children: f === types_1.SCLiveStreamViewType.SPEAKER ? 'upload' : 'category' })), "\u00A0", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}`, defaultMessage: `ui.liveStreamForm.view.${f}` })] }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ sx: { textWrap: 'auto' } }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.liveStreamForm.view.${f}.description`, defaultMessage: `ui.liveStreamForm.view.${f}.description` }) }))] }) }), f))) }))] }))] })));
|
|
79
79
|
}
|
|
80
80
|
exports.default = LiveStreamSettingsForm;
|
package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTileActions.js
CHANGED
|
@@ -183,7 +183,7 @@ function ContributionActionsMenu(props) {
|
|
|
183
183
|
* Renders section general
|
|
184
184
|
*/
|
|
185
185
|
function renderGeneralSection() {
|
|
186
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { children: canRemoveOrBanUser() && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: currentActionLoading === constants_1.REMOVE_ROOM_USER }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "person" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.participantTileActions.removeRoomUser", defaultMessage: "ui.liveStreamRoom.participantTileActions.removeRoomUser" }),
|
|
186
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { children: canRemoveOrBanUser() && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: currentActionLoading === constants_1.REMOVE_ROOM_USER, onClick: () => handleAction(constants_1.REMOVE_ROOM_USER) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "person" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.participantTileActions.removeRoomUser", defaultMessage: "ui.liveStreamRoom.participantTileActions.removeRoomUser" }), classes: { root: classes.itemText } })] })), (0, jsx_runtime_1.jsxs)(material_1.MenuItem, Object.assign({ className: classes.subItem, disabled: currentActionLoading === constants_1.BAN_ROOM_USER, onClick: () => handleAction(constants_1.BAN_ROOM_USER) }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "error" }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.participantTileActions.banRoomUser", defaultMessage: "ui.liveStreamRoom.participantTileActions.banRoomUser" }), classes: { root: classes.itemText } })] }))] })) }));
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* Renders contribution menu content
|
|
@@ -119,6 +119,7 @@ function NavigationToolbar(inProps) {
|
|
|
119
119
|
const eventsEnabled = (0, react_1.useMemo)(() => scPreferences.preferences &&
|
|
120
120
|
scPreferences.features &&
|
|
121
121
|
scPreferences.features.includes(types_1.SCFeatureName.TAGGING) &&
|
|
122
|
+
scPreferences.features.includes(types_1.SCFeatureName.EVENT) &&
|
|
122
123
|
react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in scPreferences.preferences &&
|
|
123
124
|
scPreferences.preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [scPreferences.preferences, scPreferences.features]);
|
|
124
125
|
const showComposer = (0, react_1.useMemo)(() => {
|
|
@@ -89,6 +89,7 @@ function NavigationToolbarMobile(inProps) {
|
|
|
89
89
|
const eventsEnabled = (0, react_1.useMemo)(() => preferences &&
|
|
90
90
|
features &&
|
|
91
91
|
features.includes(types_1.SCFeatureName.TAGGING) &&
|
|
92
|
+
features.includes(types_1.SCFeatureName.EVENT) &&
|
|
92
93
|
react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in preferences &&
|
|
93
94
|
preferences[react_core_1.SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [preferences, features]);
|
|
94
95
|
const exploreStreamEnabled = preferences[react_core_1.SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value;
|
|
@@ -109,8 +110,6 @@ function NavigationToolbarMobile(inProps) {
|
|
|
109
110
|
[classes.logoFlex]: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL].value
|
|
110
111
|
}) }, { children: !preserveDesktopLogo ? ((0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.LOGO_NAVBAR_LOGO_MOBILE].value, alt: "logo" })) : ((0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.LOGO_NAVBAR_LOGO].value, alt: "logo" })) })), preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_ENABLED].value && ((0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ target: "blank", to: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_URL].value, className: classes.customItem }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.CONFIGURATIONS_CUSTOM_NAVBAR_ITEM_IMAGE].value, alt: "custom_item" }) })))] }));
|
|
111
112
|
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: [_children, startActions, (contentAvailable || scUserContext.user) && !disableSearch && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.search, onClick: handleOpenSearch }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "search" }) })), (0, jsx_runtime_1.jsx)(SearchDialog_1.default, { className: classes.searchDialog, fullScreen: true, open: searchOpen, SearchAutocompleteProps: Object.assign(Object.assign({}, SearchAutocompleteProps), { onClear: handleCloseSearch }) })] })), endActions, (!postOnlyStaffEnabled || (react_core_1.UserUtils.isStaff(scUserContext.user) && postOnlyStaffEnabled)) &&
|
|
112
|
-
groupsEnabled &&
|
|
113
|
-
eventsEnabled &&
|
|
114
113
|
(scUserContext.user || contentAvailable) &&
|
|
115
114
|
exploreStreamEnabled && (0, jsx_runtime_1.jsx)(ComposerIconButton_1.default, Object.assign({}, ComposerIconButtonProps)), scUserContext.user && (groupsEnabled || eventsEnabled) && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: classes.notifications, component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.USER_NOTIFICATIONS_ROUTE_NAME, {}) }, { children: (0, jsx_runtime_1.jsx)(material_1.Badge, Object.assign({ badgeContent: scUserContext.user.unseen_notification_banners_counter + scUserContext.user.unseen_interactions_counter, color: "secondary" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "notifications_active" }) })) }))), scUserContext.user ? ((0, jsx_runtime_1.jsx)(NavigationSettingsIconButtonComponent, { className: classes.settings })) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ className: classes.login, color: "inherit", component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.SIGNIN_ROUTE_NAME, {}) }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.appBar.navigation.login", defaultMessage: "ui.appBar.navigation.login" }) })))] })));
|
|
116
115
|
}
|
|
@@ -22,7 +22,7 @@ function AutoPlayer(props) {
|
|
|
22
22
|
const [played, setPlayed] = (0, react_1.useState)(0);
|
|
23
23
|
(0, react_1.useEffect)(() => {
|
|
24
24
|
if (played >= 10 && played <= 11) {
|
|
25
|
-
onVideoWatch();
|
|
25
|
+
onVideoWatch === null || onVideoWatch === void 0 ? void 0 : onVideoWatch();
|
|
26
26
|
}
|
|
27
27
|
}, [played]);
|
|
28
28
|
/**
|
|
@@ -57,8 +57,7 @@ exports.getContributionSnippet = getContributionSnippet;
|
|
|
57
57
|
* @param handleUrl Func that handle urls
|
|
58
58
|
*/
|
|
59
59
|
function getContributionHtml(html, handleUrl) {
|
|
60
|
-
|
|
61
|
-
return _html.replace(/<mention.*? id="([0-9]+)"{1}.*?>@([a-z\d_-]+)<\/mention>/gi, (match, id, username) => {
|
|
60
|
+
return html.replace(/<mention.*? id="([0-9]+)"{1}.*?>@([a-z\d_-]+)<\/mention>/gi, (match, id, username) => {
|
|
62
61
|
return `<a href='${handleUrl(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, { id, username })}'>@${username}</a>`;
|
|
63
62
|
});
|
|
64
63
|
}
|
|
@@ -70,6 +70,7 @@ export default function BottomNavigation(inProps) {
|
|
|
70
70
|
const eventsEnabled = useMemo(() => preferences &&
|
|
71
71
|
features &&
|
|
72
72
|
features.includes(SCFeatureName.TAGGING) &&
|
|
73
|
+
features.includes(SCFeatureName.EVENT) &&
|
|
73
74
|
SCPreferences.CONFIGURATIONS_EVENTS_ENABLED in preferences &&
|
|
74
75
|
preferences[SCPreferences.CONFIGURATIONS_EVENTS_ENABLED].value, [preferences, features]);
|
|
75
76
|
const exploreStreamEnabled = preferences[SCPreferences.CONFIGURATIONS_EXPLORE_STREAM_ENABLED].value;
|
|
@@ -496,8 +496,6 @@ export default function Composer(inProps) {
|
|
|
496
496
|
}, [scUserContext.user, feedObjectType, id, type, title, html, categories, event, group, addressing, audience, medias, poll, location, hasPoll]);
|
|
497
497
|
//edited here
|
|
498
498
|
const handleClose = useCallback((e, reason) => {
|
|
499
|
-
console.log(e);
|
|
500
|
-
console.log(reason);
|
|
501
499
|
if (unloadRef.current) {
|
|
502
500
|
window.onbeforeunload = null;
|
|
503
501
|
}
|
|
@@ -562,7 +560,7 @@ export default function Composer(inProps) {
|
|
|
562
560
|
case COMPOSER_TYPE_POLL:
|
|
563
561
|
return (_jsx(ContentPoll, { onChange: handleChangePoll, value: { html, event, group, addressing, medias, poll, location }, error: pollError, disabled: isSubmitting }, key));
|
|
564
562
|
case SCContributionType.DISCUSSION:
|
|
565
|
-
return (_jsx(ContentDiscussion, { value: { title, html, categories, event, group, addressing, medias, poll, location }, error: { titleError, error }, onChange: handleChangeDiscussion, disabled: isSubmitting, EditorProps: Object.assign({ toolbar: true, uploadImage: true }, EditorProps) }, key));
|
|
563
|
+
return (_jsx(ContentDiscussion, { value: { title, html, categories, event, group, addressing, medias, poll, location }, error: { titleError, error }, onChange: handleChangeDiscussion, disabled: isSubmitting, isContentSwitchButtonVisible: !canSubmit && !editMode, EditorProps: Object.assign({ toolbar: true, uploadImage: true }, EditorProps) }, key));
|
|
566
564
|
default:
|
|
567
565
|
return (_jsx(ContentPost, { value: { html, categories, event, group, addressing, medias, poll, location }, error: { error }, onChange: handleChangePost, disabled: isSubmitting, EditorProps: Object.assign({ toolbar: false, uploadImage: false }, EditorProps) }, key));
|
|
568
566
|
}
|
|
@@ -582,7 +580,9 @@ export default function Composer(inProps) {
|
|
|
582
580
|
error,
|
|
583
581
|
handleChangePoll,
|
|
584
582
|
handleChangePost,
|
|
585
|
-
isSubmitting
|
|
583
|
+
isSubmitting,
|
|
584
|
+
canSubmit,
|
|
585
|
+
editMode
|
|
586
586
|
]);
|
|
587
587
|
if (!scUserContext.user && !(scUserContext.loading && open)) {
|
|
588
588
|
return null;
|
|
@@ -22,6 +22,24 @@ export interface ContentDiscussionProps extends Omit<BoxProps, 'value' | 'onChan
|
|
|
22
22
|
* @default empty object
|
|
23
23
|
*/
|
|
24
24
|
onChange: (value: ComposerContentType) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Value indicating the initial height
|
|
27
|
+
* @default 370
|
|
28
|
+
*/
|
|
29
|
+
defaultInitialMaxHeightContentEditor?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Value indicating the amount of space to take into account to dynamically
|
|
32
|
+
* calculate the max-height of the editor content (div.content)
|
|
33
|
+
* Default is :
|
|
34
|
+
* 90 (dialog topbar + bottombar) + 55 (editor toolbar) + 45 (selector content type) + 20 (title padding top/bottom)
|
|
35
|
+
* @default 210
|
|
36
|
+
*/
|
|
37
|
+
defaultExtraSpaceContentEditor?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Props indicate if the content switch button is visible
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
isContentSwitchButtonVisible?: boolean;
|
|
25
43
|
/**
|
|
26
44
|
* Props to spread into the editor object
|
|
27
45
|
* @default empty object
|