@selfcommunity/react-ui 0.11.0-alpha.2 → 0.11.0-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.
@@ -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, multiline: true, onChange: handleChangeTitle, InputProps: {
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 +1,4 @@
1
1
  export declare const PREFIX = "SCComposer";
2
+ export declare const DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR = 370;
3
+ export declare const DEFAULT_EXTRA_SPACE_CONTENT_EDITOR = 210;
4
+ export declare const DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE = 45;
@@ -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;
@@ -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: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: item.text, defaultMessage: item.text }) })) })] }), i))) }));
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
- // EFFETCS
93
+ // EFFECTS
94
94
  (0, react_1.useEffect)(() => {
95
95
  if (canCreateGroup) {
96
96
  setListItem((prev) => [
@@ -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
  /**
@@ -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
@@ -1,12 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback } from 'react';
3
- import { Box, TextField, Typography } from '@mui/material';
2
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
+ import { Box, TextField, Typography, useMediaQuery, useTheme } from '@mui/material';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import classNames from 'classnames';
6
6
  import Editor from '../../../Editor';
7
7
  import { FormattedMessage, useIntl } from 'react-intl';
8
8
  import { COMPOSER_TITLE_MAX_LENGTH } from '../../../../constants/Composer';
9
- import { PREFIX } from '../../constants';
9
+ import { DEFAULT_EXTRA_SPACE_CONTENT_EDITOR, DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE, DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR, PREFIX } from '../../constants';
10
+ import { PREFIX as SCEDITOR_PREFIX } from '../../../Editor/constants';
11
+ import { iOS } from '@selfcommunity/utils';
10
12
  const classes = {
11
13
  root: `${PREFIX}-content-discussion-root`,
12
14
  generalError: `${PREFIX}-general-error`,
@@ -32,22 +34,52 @@ const DEFAULT_DISCUSSION = {
32
34
  };
33
35
  export default (props) => {
34
36
  // PROPS
35
- const { className = null, value = Object.assign({}, DEFAULT_DISCUSSION), error = {}, disabled = false, onChange, EditorProps = {} } = props;
37
+ const { className = null, value = Object.assign({}, DEFAULT_DISCUSSION), defaultInitialMaxHeightContentEditor = DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR, defaultExtraSpaceContentEditor = DEFAULT_EXTRA_SPACE_CONTENT_EDITOR, isContentSwitchButtonVisible = true, error = {}, disabled = false, onChange, EditorProps = {} } = props;
36
38
  const { titleError = null, error: generalError = null } = Object.assign({}, error);
39
+ const titleRef = useRef(null);
40
+ const [editorMaxHeight, setEditorMaxHeight] = useState(defaultInitialMaxHeightContentEditor + (isContentSwitchButtonVisible ? 0 : DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE));
37
41
  // HOOKS
38
42
  const intl = useIntl();
43
+ const theme = useTheme();
44
+ const isMobile = useMediaQuery(theme.breakpoints.down('md'));
45
+ const isIOS = useMemo(() => iOS(), []);
39
46
  // HANDLERS
40
47
  const handleChangeTitle = useCallback((event) => {
41
48
  onChange(Object.assign(Object.assign({}, value), { title: event.target.value }));
42
49
  }, [value]);
50
+ const handleKeyDownTitle = useCallback((event) => {
51
+ if (event.key === 'Enter') {
52
+ event.preventDefault();
53
+ }
54
+ else if (value.title.length > COMPOSER_TITLE_MAX_LENGTH &&
55
+ ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Delete', 'Backspace', 'Shift', 'Home', 'End'].indexOf(event.key) < 0) {
56
+ event.preventDefault();
57
+ }
58
+ }, [value]);
43
59
  const handleChangeHtml = useCallback((html) => {
44
60
  onChange(Object.assign(Object.assign({}, value), { html }));
45
61
  }, [value]);
62
+ const computeEditorContentHeight = useCallback(() => {
63
+ if (titleRef.current) {
64
+ if (isMobile) {
65
+ // Measure title input height
66
+ const rect = titleRef.current.getBoundingClientRect();
67
+ const _delta = defaultExtraSpaceContentEditor + rect.height + (isIOS ? 30 : 0) - (isContentSwitchButtonVisible ? 0 : DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE);
68
+ setEditorMaxHeight(`calc(100vh - ${_delta}px)`);
69
+ }
70
+ else {
71
+ setEditorMaxHeight(DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR + (isContentSwitchButtonVisible ? 0 : DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE) + 'px');
72
+ }
73
+ }
74
+ }, [isMobile, titleRef.current, setEditorMaxHeight, isIOS, isContentSwitchButtonVisible]);
75
+ useEffect(() => {
76
+ computeEditorContentHeight();
77
+ }, [value, isContentSwitchButtonVisible, computeEditorContentHeight, isMobile]);
46
78
  // RENDER
47
- return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [generalError && (_jsx(Typography, Object.assign({ className: classes.generalError }, { children: _jsx(FormattedMessage, { id: `ui.composer.error.${generalError}`, defaultMessage: `ui.composer.error.${generalError}` }) }))), _jsx(TextField, { className: classes.title, placeholder: intl.formatMessage({
79
+ return (_jsxs(Root, Object.assign({ className: classNames(classes.root, className) }, { children: [generalError && (_jsx(Typography, Object.assign({ className: classes.generalError }, { children: _jsx(FormattedMessage, { id: `ui.composer.error.${generalError}`, defaultMessage: `ui.composer.error.${generalError}` }) }))), _jsx(TextField, { className: classes.title, ref: titleRef, placeholder: intl.formatMessage({
48
80
  id: 'ui.composer.content.discussion.title.label',
49
81
  defaultMessage: 'ui.composer.content.discussion.title.label'
50
- }), autoFocus: true, fullWidth: true, variant: "outlined", value: value.title, multiline: true, onChange: handleChangeTitle, InputProps: {
82
+ }), autoFocus: true, fullWidth: true, variant: "outlined", value: value.title, onChange: handleChangeTitle, onKeyDown: handleKeyDownTitle, multiline: true, InputProps: {
51
83
  endAdornment: _jsx(Typography, Object.assign({ variant: "body2" }, { children: COMPOSER_TITLE_MAX_LENGTH - value.title.length }))
52
- }, error: Boolean(titleError), helperText: titleError, disabled: disabled }), _jsx(Editor, Object.assign({}, EditorProps, { editable: !disabled, className: classes.editor, onChange: handleChangeHtml, defaultValue: value.html }))] })));
84
+ }, error: Boolean(titleError), helperText: titleError, disabled: disabled }), _jsx(Box, Object.assign({ sx: { [`& .${SCEDITOR_PREFIX}-content`]: { maxHeight: `${editorMaxHeight} !important` } } }, { children: _jsx(Editor, Object.assign({}, EditorProps, { editable: !disabled, className: classes.editor, onChange: handleChangeHtml, defaultValue: value.html })) }))] })));
53
85
  };
@@ -1 +1,4 @@
1
1
  export declare const PREFIX = "SCComposer";
2
+ export declare const DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR = 370;
3
+ export declare const DEFAULT_EXTRA_SPACE_CONTENT_EDITOR = 210;
4
+ export declare const DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE = 45;
@@ -1 +1,4 @@
1
1
  export const PREFIX = 'SCComposer';
2
+ export const DEFAULT_INITIAL_MAX_HEIGHT_CONTENT_EDITOR = 370;
3
+ export const DEFAULT_EXTRA_SPACE_CONTENT_EDITOR = 210;
4
+ export const DEFAULT_HEIGHT_SWITCH_CONTENT_TYPE = 45;
@@ -86,9 +86,9 @@ export default React.forwardRef(function ComposerIconButton(inProps, ref) {
86
86
  const canCreateEvent = 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]);
87
87
  const canCreateLiveStream = 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]);
88
88
  const renderContent = useMemo(() => {
89
- return (_jsx(MenuList, { children: listItem.map((item, i) => (_jsxs(MenuItem, Object.assign({ onClick: item.onClick }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, Object.assign({ fontSize: "small" }, { children: item.icon })) }), _jsx(ListItemText, { primary: _jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: item.text, defaultMessage: item.text }) })) })] }), i))) }));
89
+ return (_jsx(MenuList, { children: listItem.map((item, i) => (_jsxs(MenuItem, Object.assign({ onClick: item.onClick }, { children: [_jsx(ListItemIcon, { children: _jsx(Icon, Object.assign({ fontSize: "small" }, { children: item.icon })) }), _jsx(ListItemText, { primary: _jsx(Typography, Object.assign({ variant: "h6" }, { children: _jsx(FormattedMessage, { id: item.text, defaultMessage: item.text }) })) })] }), i))) }));
90
90
  }, [listItem]);
91
- // EFFETCS
91
+ // EFFECTS
92
92
  useEffect(() => {
93
93
  if (canCreateGroup) {
94
94
  setListItem((prev) => [
@@ -20,7 +20,7 @@ export default function AutoPlayer(props) {
20
20
  const [played, setPlayed] = useState(0);
21
21
  useEffect(() => {
22
22
  if (played >= 10 && played <= 11) {
23
- onVideoWatch();
23
+ onVideoWatch === null || onVideoWatch === void 0 ? void 0 : onVideoWatch();
24
24
  }
25
25
  }, [played]);
26
26
  /**