@pie-lib/editable-html-tip-tap 1.0.20 → 1.0.21-next.6057

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +7 -73
  2. package/LICENSE.md +5 -0
  3. package/NEXT.CHANGELOG.json +1 -0
  4. package/lib/components/CharacterPicker.js +20 -60
  5. package/lib/components/CharacterPicker.js.map +1 -1
  6. package/lib/components/EditableHtml.js +50 -121
  7. package/lib/components/EditableHtml.js.map +1 -1
  8. package/lib/components/MenuBar.js +96 -128
  9. package/lib/components/MenuBar.js.map +1 -1
  10. package/lib/components/TiptapContainer.js +162 -45
  11. package/lib/components/TiptapContainer.js.map +1 -1
  12. package/lib/components/characters/characterUtils.js +4 -7
  13. package/lib/components/characters/characterUtils.js.map +1 -1
  14. package/lib/components/characters/custom-popper.js +22 -51
  15. package/lib/components/characters/custom-popper.js.map +1 -1
  16. package/lib/components/common/done-button.js +17 -36
  17. package/lib/components/common/done-button.js.map +1 -1
  18. package/lib/components/common/toolbar-buttons.js +57 -107
  19. package/lib/components/common/toolbar-buttons.js.map +1 -1
  20. package/lib/components/icons/CssIcon.js +14 -26
  21. package/lib/components/icons/CssIcon.js.map +1 -1
  22. package/lib/components/icons/RespArea.js +23 -46
  23. package/lib/components/icons/RespArea.js.map +1 -1
  24. package/lib/components/icons/TableIcons.js +20 -36
  25. package/lib/components/icons/TableIcons.js.map +1 -1
  26. package/lib/components/icons/TextAlign.js +16 -53
  27. package/lib/components/icons/TextAlign.js.map +1 -1
  28. package/lib/components/image/AltDialog.js +18 -49
  29. package/lib/components/image/AltDialog.js.map +1 -1
  30. package/lib/components/image/ImageToolbar.js +50 -90
  31. package/lib/components/image/ImageToolbar.js.map +1 -1
  32. package/lib/components/image/InsertImageHandler.js +17 -35
  33. package/lib/components/image/InsertImageHandler.js.map +1 -1
  34. package/lib/components/media/MediaDialog.js +195 -309
  35. package/lib/components/media/MediaDialog.js.map +1 -1
  36. package/lib/components/media/MediaToolbar.js +39 -66
  37. package/lib/components/media/MediaToolbar.js.map +1 -1
  38. package/lib/components/media/MediaWrapper.js +30 -56
  39. package/lib/components/media/MediaWrapper.js.map +1 -1
  40. package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +21 -36
  41. package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +1 -1
  42. package/lib/components/respArea/DragInTheBlank/choice.js +215 -262
  43. package/lib/components/respArea/DragInTheBlank/choice.js.map +1 -1
  44. package/lib/components/respArea/ExplicitConstructedResponse.js +11 -33
  45. package/lib/components/respArea/ExplicitConstructedResponse.js.map +1 -1
  46. package/lib/components/respArea/InlineDropdown.js +19 -41
  47. package/lib/components/respArea/InlineDropdown.js.map +1 -1
  48. package/lib/components/respArea/ToolbarIcon.js +21 -45
  49. package/lib/components/respArea/ToolbarIcon.js.map +1 -1
  50. package/lib/constants.js +3 -5
  51. package/lib/constants.js.map +1 -1
  52. package/lib/extensions/component.js +94 -148
  53. package/lib/extensions/component.js.map +1 -1
  54. package/lib/extensions/css.js +9 -44
  55. package/lib/extensions/css.js.map +1 -1
  56. package/lib/extensions/custom-toolbar-wrapper.js +66 -94
  57. package/lib/extensions/custom-toolbar-wrapper.js.map +1 -1
  58. package/lib/extensions/extended-table.js +2 -6
  59. package/lib/extensions/extended-table.js.map +1 -1
  60. package/lib/extensions/image.js +4 -17
  61. package/lib/extensions/image.js.map +1 -1
  62. package/lib/extensions/index.js +13 -23
  63. package/lib/extensions/index.js.map +1 -1
  64. package/lib/extensions/math.js +45 -96
  65. package/lib/extensions/math.js.map +1 -1
  66. package/lib/extensions/media.js +21 -59
  67. package/lib/extensions/media.js.map +1 -1
  68. package/lib/extensions/responseArea.js +43 -89
  69. package/lib/extensions/responseArea.js.map +1 -1
  70. package/lib/index.js +9 -11
  71. package/lib/index.js.map +1 -1
  72. package/lib/styles/editorContainerStyles.js +2 -7
  73. package/lib/styles/editorContainerStyles.js.map +1 -1
  74. package/lib/theme.js +2 -3
  75. package/lib/theme.js.map +1 -1
  76. package/lib/utils/size.js +2 -10
  77. package/lib/utils/size.js.map +1 -1
  78. package/package.json +15 -13
  79. package/src/components/EditableHtml.jsx +21 -33
  80. package/src/components/MenuBar.jsx +66 -37
  81. package/src/components/TiptapContainer.jsx +133 -34
  82. package/src/components/characters/custom-popper.js +18 -28
  83. package/src/components/common/done-button.jsx +15 -26
  84. package/src/components/common/toolbar-buttons.jsx +28 -44
  85. package/src/components/icons/CssIcon.jsx +11 -13
  86. package/src/components/icons/RespArea.jsx +16 -16
  87. package/src/components/icons/TableIcons.jsx +15 -16
  88. package/src/components/icons/TextAlign.jsx +3 -3
  89. package/src/components/image/AltDialog.jsx +6 -6
  90. package/src/components/image/ImageToolbar.jsx +28 -29
  91. package/src/components/media/MediaDialog.js +61 -78
  92. package/src/components/media/MediaToolbar.jsx +30 -37
  93. package/src/components/media/MediaWrapper.jsx +12 -16
  94. package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +5 -4
  95. package/src/components/respArea/DragInTheBlank/choice.jsx +191 -185
  96. package/src/components/respArea/ToolbarIcon.jsx +13 -15
  97. package/src/extensions/component.jsx +61 -89
  98. package/src/extensions/css.js +6 -5
  99. package/src/extensions/custom-toolbar-wrapper.jsx +61 -81
  100. package/src/extensions/index.js +2 -2
  101. package/src/index.jsx +2 -2
  102. package/lib/__tests__/utils.js +0 -106
  103. package/src/__tests__/utils.js +0 -36
@@ -1,17 +1,136 @@
1
1
  import React, { useEffect, useMemo } from 'react';
2
- import classNames from 'classnames';
3
- import { withStyles } from '@material-ui/core/styles';
4
-
5
- import styles from '../styles/editorContainerStyles';
2
+ import { styled } from '@mui/material/styles';
3
+ import { color } from '@pie-lib/render-ui';
6
4
  import { valueToSize } from '../utils/size';
7
5
 
8
6
  import StyledMenuBar from './MenuBar';
9
7
 
8
+ const StyledRoot = styled('div', {
9
+ shouldForwardProp: (prop) => !['noBorder', 'error'].includes(prop),
10
+ })(({ theme, noBorder, error }) => ({
11
+ position: 'relative',
12
+ padding: '0px',
13
+ border: noBorder ? 'none' : '1px solid #ccc',
14
+ borderRadius: '4px',
15
+ cursor: 'text',
16
+ '& [data-slate-editor="true"]': {
17
+ wordBreak: 'break-word',
18
+ overflow: 'visible',
19
+ maxHeight: '500px',
20
+ padding: '5px',
21
+ },
22
+ '&:first-child': {
23
+ marginTop: 0,
24
+ },
25
+ '& ul, & ol': {
26
+ padding: '0 1rem',
27
+ margin: '1.25rem 1rem 1.25rem 0.4rem',
28
+ },
29
+ '& ul li p, & ol li p': {
30
+ marginTop: '0.25em',
31
+ marginBottom: '0.25em',
32
+ },
33
+ '& h1, & h2, & h3, & h4, & h5, & h6': {
34
+ lineHeight: 1.1,
35
+ marginTop: '2.5rem',
36
+ textWrap: 'pretty',
37
+ },
38
+ '& h1, & h2': {
39
+ marginTop: '3.5rem',
40
+ marginBottom: '1.5rem',
41
+ },
42
+ '& h1': {
43
+ fontSize: '1.4rem',
44
+ },
45
+ '& h2': {
46
+ fontSize: '1.2rem',
47
+ },
48
+ '& h3': {
49
+ fontSize: '1.1rem',
50
+ },
51
+ '& h4, & h5, & h6': {
52
+ fontSize: '1rem',
53
+ },
54
+ '& code': {
55
+ backgroundColor: 'var(--purple-light)',
56
+ borderRadius: '0.4rem',
57
+ color: 'var(--black)',
58
+ fontSize: '0.85rem',
59
+ padding: '0.25em 0.3em',
60
+ },
61
+ '& pre': {
62
+ background: 'var(--black)',
63
+ borderRadius: '0.5rem',
64
+ color: 'var(--white)',
65
+ fontFamily: '\'JetBrainsMono\', monospace',
66
+ margin: '1.5rem 0',
67
+ padding: '0.75rem 1rem',
68
+ '& code': {
69
+ background: 'none',
70
+ color: 'inherit',
71
+ fontSize: '0.8rem',
72
+ padding: 0,
73
+ },
74
+ },
75
+ '& blockquote': {
76
+ borderLeft: '3px solid var(--gray-3)',
77
+ margin: '1.5rem 0',
78
+ paddingLeft: '1rem',
79
+ },
80
+ '& hr': {
81
+ border: 'none',
82
+ borderTop: '1px solid var(--gray-2)',
83
+ margin: '2rem 0',
84
+ },
85
+ '& table': {
86
+ tableLayout: 'fixed',
87
+ width: '100%',
88
+ borderCollapse: 'collapse',
89
+ color: color.text(),
90
+ backgroundColor: color.background(),
91
+ },
92
+ '& table:not([border="1"]) tr': {
93
+ borderTop: '1px solid #dfe2e5',
94
+ },
95
+ '& td, th': {
96
+ padding: '.6em 1em',
97
+ textAlign: 'center',
98
+ },
99
+ '& table:not([border="1"]) td, th': {
100
+ border: '1px solid #dfe2e5',
101
+ },
102
+ ...(error && {
103
+ border: `2px solid ${theme.palette.error.main} !important`,
104
+ }),
105
+ }));
106
+
107
+ const StyledEditorHolder = styled('div', {
108
+ shouldForwardProp: (prop) => prop !== 'disableScrollbar',
109
+ })(({ disableScrollbar }) => ({
110
+ position: 'relative',
111
+ padding: '0px',
112
+ overflowY: 'auto',
113
+ color: color.text(),
114
+ backgroundColor: color.background(),
115
+ ...(disableScrollbar && {
116
+ '&::-webkit-scrollbar': {
117
+ display: 'none',
118
+ },
119
+ scrollbarWidth: 'none',
120
+ '-ms-overflow-style': 'none',
121
+ }),
122
+ }));
123
+
124
+ const StyledChildren = styled('div', {
125
+ shouldForwardProp: (prop) => prop !== 'noPadding',
126
+ })(({ noPadding }) => ({
127
+ padding: noPadding ? 0 : '10px 16px',
128
+ }));
129
+
10
130
  function TiptapContainer(props) {
11
131
  const {
12
132
  editor,
13
133
  disabled,
14
- classes,
15
134
  children,
16
135
  disableScrollbar,
17
136
  activePlugins,
@@ -26,10 +145,6 @@ function TiptapContainer(props) {
26
145
  maxHeight,
27
146
  } = props;
28
147
 
29
- const holderNames = classNames(classes.editorHolder, {
30
- [classes.disabledScrollbar]: disableScrollbar,
31
- });
32
-
33
148
  useEffect(() => {
34
149
  if (editor && autoFocus) {
35
150
  Promise.resolve().then(() => {
@@ -51,29 +166,15 @@ function TiptapContainer(props) {
51
166
  );
52
167
 
53
168
  return (
54
- <div
55
- className={classNames(
56
- {
57
- [classes.noBorder]: toolbarOpts && toolbarOpts.noBorder,
58
- [classes.error]: toolbarOpts && toolbarOpts.error,
59
- },
60
- classes.root,
61
- props.className,
62
- )}
169
+ <StyledRoot
170
+ noBorder={toolbarOpts && toolbarOpts.noBorder}
171
+ error={toolbarOpts && toolbarOpts.error}
172
+ className={props.className}
63
173
  style={{ width: sizeStyle.width, minWidth: sizeStyle.minWidth, maxWidth: sizeStyle.maxWidth }}
64
174
  >
65
- <div className={holderNames}>
66
- <div
67
- className={classNames(
68
- {
69
- [classes.noPadding]: toolbarOpts && toolbarOpts.noPadding,
70
- },
71
- classes.children,
72
- )}
73
- >
74
- {children}
75
- </div>
76
- </div>
175
+ <StyledEditorHolder disableScrollbar={disableScrollbar}>
176
+ <StyledChildren noPadding={toolbarOpts && toolbarOpts.noPadding}>{children}</StyledChildren>
177
+ </StyledEditorHolder>
77
178
 
78
179
  {editor && (
79
180
  <StyledMenuBar
@@ -84,10 +185,8 @@ function TiptapContainer(props) {
84
185
  onChange={props.onChange}
85
186
  />
86
187
  )}
87
- </div>
188
+ </StyledRoot>
88
189
  );
89
190
  }
90
191
 
91
- const EditorContainer = withStyles(styles)(TiptapContainer);
92
-
93
- export default EditorContainer;
192
+ export default TiptapContainer;
@@ -1,34 +1,24 @@
1
1
  import React from 'react';
2
- import { withStyles } from '@material-ui/core/styles';
3
- import Popper from '@material-ui/core/Popper';
4
- import Typography from '@material-ui/core/Typography';
2
+ import { styled } from '@mui/material/styles';
3
+ import Popper from '@mui/material/Popper';
4
+ import Typography from '@mui/material/Typography';
5
5
 
6
- const styles = () => ({
7
- popover: {
8
- background: '#fff',
9
- padding: '10px',
10
- pointerEvents: 'none',
11
- zIndex: 99999,
12
- },
13
- paper: {
14
- padding: 20,
15
- height: 'auto',
16
- width: 'auto',
17
- },
18
- typography: {
19
- fontSize: 50,
20
- textAlign: 'center',
21
- },
6
+ const StyledPopper = styled(Popper)({
7
+ background: '#fff',
8
+ padding: '10px',
9
+ pointerEvents: 'none',
10
+ zIndex: 99999,
22
11
  });
23
12
 
24
- const CustomPopper = withStyles(styles)(({ classes, children, ...props }) => (
25
- <Popper
13
+ const StyledTypography = styled(Typography)({
14
+ fontSize: 50,
15
+ textAlign: 'center',
16
+ });
17
+
18
+ const CustomPopper = ({ children, ...props }) => (
19
+ <StyledPopper
26
20
  id="mouse-over-popover"
27
21
  open
28
- className={classes.popover}
29
- classes={{
30
- paper: classes.paper,
31
- }}
32
22
  anchorOrigin={{
33
23
  vertical: 'bottom',
34
24
  horizontal: 'left',
@@ -41,8 +31,8 @@ const CustomPopper = withStyles(styles)(({ classes, children, ...props }) => (
41
31
  disableAutoFocus
42
32
  {...props}
43
33
  >
44
- <Typography classes={{ root: classes.typography }}>{children}</Typography>
45
- </Popper>
46
- ));
34
+ <StyledTypography>{children}</StyledTypography>
35
+ </StyledPopper>
36
+ );
47
37
 
48
38
  export default CustomPopper;
@@ -1,38 +1,27 @@
1
1
  import React from 'react';
2
2
 
3
- import IconButton from '@material-ui/core/IconButton';
4
- import Check from '@material-ui/icons/Check';
5
- import { withStyles } from '@material-ui/core/styles';
3
+ import IconButton from '@mui/material/IconButton';
4
+ import Check from '@mui/icons-material/Check';
5
+ import { styled } from '@mui/material/styles';
6
6
  import PropTypes from 'prop-types';
7
7
 
8
- export const RawDoneButton = ({ classes, onClick, doneButtonRef }) => (
9
- <IconButton
10
- aria-label="Done"
11
- className={classes.iconRoot}
12
- buttonRef={doneButtonRef}
13
- onClick={onClick}
14
- classes={{
15
- label: classes.label,
16
- root: classes.iconRoot,
17
- }}
18
- >
8
+ const StyledIconButton = styled(IconButton)({
9
+ verticalAlign: 'top',
10
+ width: '28px',
11
+ height: '28px',
12
+ color: 'var(--editable-html-toolbar-check, #00bb00)',
13
+ padding: '4px',
14
+ });
15
+
16
+ export const RawDoneButton = ({ onClick, doneButtonRef }) => (
17
+ <StyledIconButton aria-label="Done" buttonRef={doneButtonRef} onClick={onClick}>
19
18
  <Check />
20
- </IconButton>
19
+ </StyledIconButton>
21
20
  );
22
21
 
23
22
  RawDoneButton.propTypes = {
24
- classes: PropTypes.object.isRequired,
25
23
  onClick: PropTypes.func,
26
24
  doneButtonRef: PropTypes.func,
27
25
  };
28
26
 
29
- const styles = {
30
- iconRoot: {
31
- verticalAlign: 'top',
32
- width: '28px',
33
- height: '28px',
34
- color: 'var(--editable-html-toolbar-check, #00bb00)',
35
- padding: '4px',
36
- },
37
- };
38
- export const DoneButton = withStyles(styles)(RawDoneButton);
27
+ export const DoneButton = RawDoneButton;
@@ -1,42 +1,33 @@
1
1
  import React from 'react';
2
2
  import debug from 'debug';
3
- import { withStyles } from '@material-ui/core/styles';
4
- import classNames from 'classnames';
3
+ import { styled } from '@mui/material/styles';
5
4
  import PropTypes from 'prop-types';
6
5
 
7
- const styles = (theme) => ({
8
- button: {
9
- color: 'grey',
10
- display: 'inline-flex',
11
- padding: '2px',
12
- background: 'none',
13
- border: 'none',
14
- cursor: 'pointer',
15
- '&:hover': {
16
- color: 'black',
17
- },
18
- '&:focus': {
19
- outline: `2px solid ${theme.palette.grey[700]}`,
20
- },
6
+ const StyledButton = styled('button', {
7
+ shouldForwardProp: (prop) => !['active', 'disabled', 'extraStyles'].includes(prop),
8
+ })(({ theme, active, disabled }) => ({
9
+ color: active ? 'black' : 'grey',
10
+ display: 'inline-flex',
11
+ padding: '2px',
12
+ background: 'none',
13
+ border: 'none',
14
+ cursor: disabled ? 'not-allowed' : 'pointer',
15
+ '&:hover': {
16
+ color: disabled ? 'grey' : 'black',
21
17
  },
22
- active: {
23
- color: 'black',
18
+ '&:focus': {
19
+ outline: `2px solid ${theme.palette.grey[700]}`,
24
20
  },
25
- disabled: {
21
+ ...(disabled && {
26
22
  opacity: 0.7,
27
- cursor: 'not-allowed',
28
- '& :hover': {
29
- color: 'grey',
30
- },
31
- },
32
- });
23
+ }),
24
+ }));
33
25
 
34
26
  const log = debug('pie-elements:editable-html:raw-button');
35
27
 
36
28
  export class RawButton extends React.Component {
37
29
  static propTypes = {
38
30
  onClick: PropTypes.func.isRequired,
39
- classes: PropTypes.object.isRequired,
40
31
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
41
32
  active: PropTypes.bool,
42
33
  disabled: PropTypes.bool,
@@ -64,31 +55,26 @@ export class RawButton extends React.Component {
64
55
  };
65
56
 
66
57
  render() {
67
- const { active, classes, children, disabled, extraStyles, ariaLabel } = this.props;
68
-
69
- const names = classNames(classes.button, {
70
- [classes.active]: active,
71
- [classes.disabled]: disabled,
72
- });
58
+ const { active, children, disabled, extraStyles, ariaLabel } = this.props;
73
59
 
74
60
  return (
75
- <button
61
+ <StyledButton
76
62
  style={extraStyles}
77
- className={names}
63
+ active={active}
64
+ disabled={disabled}
78
65
  onMouseDown={this.onClick}
79
66
  onKeyDown={this.onKeyDown}
80
- disabled={disabled}
81
67
  aria-label={ariaLabel}
82
68
  aria-pressed={active}
83
69
  tabIndex={0}
84
70
  >
85
71
  {children}
86
- </button>
72
+ </StyledButton>
87
73
  );
88
74
  }
89
75
  }
90
76
 
91
- export const Button = withStyles(styles)(RawButton);
77
+ export const Button = RawButton;
92
78
 
93
79
  export class RawMarkButton extends React.Component {
94
80
  static propTypes = {
@@ -96,7 +82,6 @@ export class RawMarkButton extends React.Component {
96
82
  mark: PropTypes.string,
97
83
  label: PropTypes.string.isRequired,
98
84
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
99
- classes: PropTypes.object.isRequired,
100
85
  active: PropTypes.bool,
101
86
  };
102
87
 
@@ -117,12 +102,11 @@ export class RawMarkButton extends React.Component {
117
102
  };
118
103
 
119
104
  render() {
120
- const { classes, children, active, label } = this.props;
105
+ const { children, active, label } = this.props;
121
106
 
122
- const names = classNames(classes.button, active && classes.active);
123
107
  return (
124
- <button
125
- className={names}
108
+ <StyledButton
109
+ active={active}
126
110
  onMouseDown={this.onToggle}
127
111
  aria-pressed={active}
128
112
  onKeyDown={this.onKeyDown}
@@ -130,9 +114,9 @@ export class RawMarkButton extends React.Component {
130
114
  tabIndex={0}
131
115
  >
132
116
  {children}
133
- </button>
117
+ </StyledButton>
134
118
  );
135
119
  }
136
120
  }
137
121
 
138
- export const MarkButton = withStyles(styles)(RawMarkButton);
122
+ export const MarkButton = RawMarkButton;
@@ -1,17 +1,15 @@
1
1
  import React from 'react';
2
- import { withStyles } from '@material-ui/core/styles';
2
+ import { styled } from '@mui/material/styles';
3
3
 
4
- const styles = (theme) => ({
5
- icon: {
6
- fontFamily: 'Cerebri Sans, Arial, sans-serif',
7
- fontSize: theme.typography.fontSize,
8
- fontWeight: 'bold',
9
- lineHeight: '14px',
10
- position: 'relative',
11
- whiteSpace: 'nowrap',
12
- },
13
- });
4
+ const StyledCssIcon = styled('div')(({ theme }) => ({
5
+ fontFamily: 'Cerebri Sans, Arial, sans-serif',
6
+ fontSize: theme.typography.fontSize,
7
+ fontWeight: 'bold',
8
+ lineHeight: '14px',
9
+ position: 'relative',
10
+ whiteSpace: 'nowrap',
11
+ }));
14
12
 
15
- const CssIcon = ({ classes }) => <div className={classes.icon}>CSS</div>;
13
+ const CssIcon = () => <StyledCssIcon>CSS</StyledCssIcon>;
16
14
 
17
- export default withStyles(styles)(CssIcon);
15
+ export default CssIcon;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import ChevronRight from '@material-ui/icons/ChevronRight';
4
- import MoreVert from '@material-ui/icons/MoreVert';
5
- import { withStyles } from '@material-ui/core/styles';
3
+ import ChevronRight from '@mui/icons-material/ChevronRight';
4
+ import MoreVert from '@mui/icons-material/MoreVert';
5
+ import { styled } from '@mui/material/styles';
6
6
 
7
7
  const getRotate = (direction) => {
8
8
  switch (direction) {
@@ -56,16 +56,16 @@ GripIcon.propTypes = {
56
56
  style: PropTypes.object,
57
57
  };
58
58
 
59
- export const ToolbarIcon = withStyles((theme) => ({
60
- icon: {
61
- fontFamily: 'Cerebri Sans !important',
62
- fontSize: theme.typography.fontSize,
63
- fontWeight: 'bold',
64
- lineHeight: '14px',
65
- position: 'relative',
66
- top: '7px',
67
- width: '110px',
68
- height: '28px',
69
- whiteSpace: 'nowrap',
70
- },
71
- }))(({ classes }) => <div className={classes.icon}>+ Response Area</div>);
59
+ const StyledToolbarIcon = styled('div')(({ theme }) => ({
60
+ fontFamily: 'Cerebri Sans !important',
61
+ fontSize: theme.typography.fontSize,
62
+ fontWeight: 'bold',
63
+ lineHeight: '14px',
64
+ position: 'relative',
65
+ top: '7px',
66
+ width: '110px',
67
+ height: '28px',
68
+ whiteSpace: 'nowrap',
69
+ }));
70
+
71
+ export const ToolbarIcon = () => <StyledToolbarIcon>+ Response Area</StyledToolbarIcon>;
@@ -1,52 +1,51 @@
1
1
  import React from 'react';
2
- import { withStyles } from '@material-ui/core/styles';
2
+ import { styled } from '@mui/material/styles';
3
3
 
4
- const styles = {
5
- icon: {
6
- fill: 'grey',
7
- '&:hover': {
8
- fill: 'black',
9
- },
4
+ const StyledPath = styled('path')({
5
+ fill: 'grey',
6
+ '&:hover': {
7
+ fill: 'black',
10
8
  },
11
- };
9
+ });
12
10
 
13
11
  const SvgIcon = (Component) => {
14
- return withStyles(styles)((props) => (
12
+ return (props) => (
15
13
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 24 24">
16
- <Component className={props.classes.icon} />
14
+ <Component {...props} />
17
15
  </svg>
18
- ));
16
+ );
19
17
  };
18
+
20
19
  export const AddRow = SvgIcon((props) => (
21
- <path
20
+ <StyledPath
22
21
  {...props}
23
22
  d="M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z"
24
23
  />
25
24
  ));
26
25
 
27
26
  export const RemoveRow = SvgIcon((props) => (
28
- <path
27
+ <StyledPath
29
28
  {...props}
30
29
  d="M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z"
31
30
  />
32
31
  ));
33
32
 
34
33
  export const AddColumn = SvgIcon((props) => (
35
- <path
34
+ <StyledPath
36
35
  {...props}
37
36
  d="M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z"
38
37
  />
39
38
  ));
40
39
 
41
40
  export const RemoveColumn = SvgIcon((props) => (
42
- <path
41
+ <StyledPath
43
42
  {...props}
44
43
  d="M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z"
45
44
  />
46
45
  ));
47
46
 
48
47
  export const RemoveTable = SvgIcon((props) => (
49
- <path
48
+ <StyledPath
50
49
  {...props}
51
50
  d="M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z"
52
51
  />
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react';
2
- import Collapse from '@material-ui/core/Collapse';
3
- import List from '@material-ui/core/List';
4
- import ListItem from '@material-ui/core/ListItem';
2
+ import Collapse from '@mui/material/Collapse';
3
+ import List from '@mui/material/List';
4
+ import ListItem from '@mui/material/ListItem';
5
5
 
6
6
  export const AlignLeft = () => (
7
7
  <svg width="20" height="20" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import DialogContent from '@material-ui/core/DialogContent';
3
- import ArrowBackIos from '@material-ui/icons/ArrowBackIos';
4
- import TextField from '@material-ui/core/TextField';
5
- import DialogActions from '@material-ui/core/DialogActions';
6
- import Button from '@material-ui/core/Button';
7
- import Dialog from '@material-ui/core/Dialog';
2
+ import DialogContent from '@mui/material/DialogContent';
3
+ import ArrowBackIos from '@mui/icons-material/ArrowBackIos';
4
+ import TextField from '@mui/material/TextField';
5
+ import DialogActions from '@mui/material/DialogActions';
6
+ import Button from '@mui/material/Button';
7
+ import Dialog from '@mui/material/Dialog';
8
8
  import PropTypes from 'prop-types';
9
9
 
10
10
  export class AltDialog extends React.Component {