@pie-lib/editable-html 11.18.6-esmbeta.0 → 11.19.0-mui-update.0

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 (136) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/lib/block-tags.js +2 -3
  3. package/lib/block-tags.js.map +1 -1
  4. package/lib/constants.js +3 -6
  5. package/lib/constants.js.map +1 -1
  6. package/lib/editor.js +302 -450
  7. package/lib/editor.js.map +1 -1
  8. package/lib/index.js +19 -77
  9. package/lib/index.js.map +1 -1
  10. package/lib/parse-html.js +7 -7
  11. package/lib/parse-html.js.map +1 -1
  12. package/lib/plugins/characters/custom-popper.js +24 -44
  13. package/lib/plugins/characters/custom-popper.js.map +1 -1
  14. package/lib/plugins/characters/index.js +9 -60
  15. package/lib/plugins/characters/index.js.map +1 -1
  16. package/lib/plugins/characters/utils.js +3 -6
  17. package/lib/plugins/characters/utils.js.map +1 -1
  18. package/lib/plugins/css/icons/index.js +13 -25
  19. package/lib/plugins/css/icons/index.js.map +1 -1
  20. package/lib/plugins/css/index.js +22 -88
  21. package/lib/plugins/css/index.js.map +1 -1
  22. package/lib/plugins/customPlugin/index.js +10 -26
  23. package/lib/plugins/customPlugin/index.js.map +1 -1
  24. package/lib/plugins/html/icons/index.js +14 -26
  25. package/lib/plugins/html/icons/index.js.map +1 -1
  26. package/lib/plugins/html/index.js +4 -13
  27. package/lib/plugins/html/index.js.map +1 -1
  28. package/lib/plugins/image/alt-dialog.js +20 -49
  29. package/lib/plugins/image/alt-dialog.js.map +1 -1
  30. package/lib/plugins/image/component.js +119 -190
  31. package/lib/plugins/image/component.js.map +1 -1
  32. package/lib/plugins/image/image-toolbar.js +44 -86
  33. package/lib/plugins/image/image-toolbar.js.map +1 -1
  34. package/lib/plugins/image/index.js +6 -46
  35. package/lib/plugins/image/index.js.map +1 -1
  36. package/lib/plugins/image/insert-image-handler.js +10 -31
  37. package/lib/plugins/image/insert-image-handler.js.map +1 -1
  38. package/lib/plugins/index.js +44 -106
  39. package/lib/plugins/index.js.map +1 -1
  40. package/lib/plugins/list/index.js +27 -73
  41. package/lib/plugins/list/index.js.map +1 -1
  42. package/lib/plugins/math/index.js +64 -116
  43. package/lib/plugins/math/index.js.map +1 -1
  44. package/lib/plugins/media/index.js +23 -81
  45. package/lib/plugins/media/index.js.map +1 -1
  46. package/lib/plugins/media/media-dialog.js +192 -307
  47. package/lib/plugins/media/media-dialog.js.map +1 -1
  48. package/lib/plugins/media/media-toolbar.js +40 -65
  49. package/lib/plugins/media/media-toolbar.js.map +1 -1
  50. package/lib/plugins/media/media-wrapper.js +20 -49
  51. package/lib/plugins/media/media-wrapper.js.map +1 -1
  52. package/lib/plugins/rendering/index.js +5 -15
  53. package/lib/plugins/rendering/index.js.map +1 -1
  54. package/lib/plugins/respArea/drag-in-the-blank/choice.js +175 -249
  55. package/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -1
  56. package/lib/plugins/respArea/drag-in-the-blank/index.js +39 -29
  57. package/lib/plugins/respArea/drag-in-the-blank/index.js.map +1 -1
  58. package/lib/plugins/respArea/explicit-constructed-response/index.js +3 -10
  59. package/lib/plugins/respArea/explicit-constructed-response/index.js.map +1 -1
  60. package/lib/plugins/respArea/icons/index.js +22 -45
  61. package/lib/plugins/respArea/icons/index.js.map +1 -1
  62. package/lib/plugins/respArea/index.js +5 -59
  63. package/lib/plugins/respArea/index.js.map +1 -1
  64. package/lib/plugins/respArea/inline-dropdown/index.js +2 -10
  65. package/lib/plugins/respArea/inline-dropdown/index.js.map +1 -1
  66. package/lib/plugins/respArea/math-templated/index.js +92 -109
  67. package/lib/plugins/respArea/math-templated/index.js.map +1 -1
  68. package/lib/plugins/respArea/utils.js +8 -40
  69. package/lib/plugins/respArea/utils.js.map +1 -1
  70. package/lib/plugins/table/CustomTablePlugin.js +24 -41
  71. package/lib/plugins/table/CustomTablePlugin.js.map +1 -1
  72. package/lib/plugins/table/icons/index.js +19 -35
  73. package/lib/plugins/table/icons/index.js.map +1 -1
  74. package/lib/plugins/table/index.js +41 -118
  75. package/lib/plugins/table/index.js.map +1 -1
  76. package/lib/plugins/table/table-toolbar.js +37 -87
  77. package/lib/plugins/table/table-toolbar.js.map +1 -1
  78. package/lib/plugins/textAlign/icons/index.js +18 -64
  79. package/lib/plugins/textAlign/icons/index.js.map +1 -1
  80. package/lib/plugins/textAlign/index.js +1 -6
  81. package/lib/plugins/textAlign/index.js.map +1 -1
  82. package/lib/plugins/toolbar/default-toolbar.js +30 -79
  83. package/lib/plugins/toolbar/default-toolbar.js.map +1 -1
  84. package/lib/plugins/toolbar/done-button.js +16 -34
  85. package/lib/plugins/toolbar/done-button.js.map +1 -1
  86. package/lib/plugins/toolbar/editor-and-toolbar.js +174 -201
  87. package/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -1
  88. package/lib/plugins/toolbar/index.js +0 -5
  89. package/lib/plugins/toolbar/index.js.map +1 -1
  90. package/lib/plugins/toolbar/toolbar-buttons.js +57 -107
  91. package/lib/plugins/toolbar/toolbar-buttons.js.map +1 -1
  92. package/lib/plugins/toolbar/toolbar.js +95 -161
  93. package/lib/plugins/toolbar/toolbar.js.map +1 -1
  94. package/lib/plugins/utils.js +5 -25
  95. package/lib/plugins/utils.js.map +1 -1
  96. package/lib/serialization.js +44 -150
  97. package/lib/serialization.js.map +1 -1
  98. package/lib/shared/alert-dialog.js +23 -42
  99. package/lib/theme.js +1 -2
  100. package/lib/theme.js.map +1 -1
  101. package/package.json +15 -21
  102. package/src/__tests__/utils.js +1 -1
  103. package/src/editor.jsx +110 -108
  104. package/src/plugins/characters/custom-popper.js +20 -25
  105. package/src/plugins/css/icons/index.jsx +11 -13
  106. package/src/plugins/css/index.jsx +3 -5
  107. package/src/plugins/html/icons/index.jsx +12 -14
  108. package/src/plugins/image/alt-dialog.jsx +9 -8
  109. package/src/plugins/image/component.jsx +67 -87
  110. package/src/plugins/image/image-toolbar.jsx +26 -26
  111. package/src/plugins/image/index.jsx +1 -1
  112. package/src/plugins/index.jsx +10 -10
  113. package/src/plugins/math/index.jsx +1 -1
  114. package/src/plugins/media/index.jsx +2 -2
  115. package/src/plugins/media/media-dialog.js +65 -76
  116. package/src/plugins/media/media-toolbar.jsx +32 -33
  117. package/src/plugins/media/media-wrapper.jsx +10 -13
  118. package/src/plugins/respArea/drag-in-the-blank/choice.jsx +193 -180
  119. package/src/plugins/respArea/drag-in-the-blank/index.jsx +58 -22
  120. package/src/plugins/respArea/icons/index.jsx +16 -16
  121. package/src/plugins/respArea/math-templated/index.jsx +88 -89
  122. package/src/plugins/respArea/utils.jsx +1 -1
  123. package/src/plugins/table/icons/index.jsx +14 -16
  124. package/src/plugins/table/index.jsx +27 -19
  125. package/src/plugins/table/table-toolbar.jsx +17 -19
  126. package/src/plugins/textAlign/icons/index.jsx +3 -3
  127. package/src/plugins/toolbar/__tests__/default-toolbar.test.jsx +1 -1
  128. package/src/plugins/toolbar/__tests__/toolbar.test.jsx +1 -1
  129. package/src/plugins/toolbar/default-toolbar.jsx +18 -21
  130. package/src/plugins/toolbar/done-button.jsx +16 -22
  131. package/src/plugins/toolbar/editor-and-toolbar.jsx +134 -157
  132. package/src/plugins/toolbar/toolbar-buttons.jsx +29 -46
  133. package/src/plugins/toolbar/toolbar.jsx +60 -78
  134. package/esm/index.js +0 -111560
  135. package/esm/index.js.map +0 -1
  136. package/esm/package.json +0 -1
package/src/editor.jsx CHANGED
@@ -8,7 +8,7 @@ import debounce from 'lodash/debounce';
8
8
  import isEqual from 'lodash/isEqual';
9
9
  import classNames from 'classnames';
10
10
  import debug from 'debug';
11
- import { withStyles } from '@material-ui/core/styles';
11
+ import { styled } from '@mui/material/styles';
12
12
 
13
13
  import { color } from '@pie-lib/render-ui';
14
14
  import AlertDialog from '../../config-ui/src/alert-dialog';
@@ -83,7 +83,6 @@ export class Editor extends React.Component {
83
83
  height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
84
84
  minHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
85
85
  maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
86
- classes: PropTypes.object.isRequired,
87
86
  highlightShape: PropTypes.bool,
88
87
  disabled: PropTypes.bool,
89
88
  spellCheck: PropTypes.bool,
@@ -410,7 +409,7 @@ export class Editor extends React.Component {
410
409
  };
411
410
 
412
411
  componentDidMount() {
413
- // onRef is needed to get the ref of the component because we export it using withStyles
412
+ // onRef is needed to get the ref of the component
414
413
  this.props.onRef(this);
415
414
 
416
415
  window.addEventListener('resize', this.onResize);
@@ -554,11 +553,13 @@ export class Editor extends React.Component {
554
553
  * This content includes the edited HTML and a prompt for the user.
555
554
  */
556
555
  renderHtmlPreviewContent = () => {
557
- const { classes } = this.props;
558
556
  return (
559
557
  <div ref={(ref) => (this.elementRef = ref)}>
560
558
  <div>Preview of Edited Html:</div>
561
- <PreviewPrompt defaultClassName={classes.previewText} prompt={this.state.value.document.text} />
559
+ {/* TODO: check if this works and we don't need to send style over to preview prompt */}
560
+ <StyledPreviewText>
561
+ <PreviewPrompt prompt={this.state.value.document.text} />
562
+ </StyledPreviewText>
562
563
  <div>Would you like to save these changes ?</div>
563
564
  </div>
564
565
  );
@@ -1025,9 +1026,7 @@ export class Editor extends React.Component {
1025
1026
  disabled,
1026
1027
  spellCheck,
1027
1028
  highlightShape,
1028
- classes,
1029
1029
  className,
1030
- isEditor,
1031
1030
  placeholder,
1032
1031
  pluginProps,
1033
1032
  onKeyDown,
@@ -1042,74 +1041,76 @@ export class Editor extends React.Component {
1042
1041
 
1043
1042
  log('[render] value: ', value);
1044
1043
  const sizeStyle = this.buildSizeStyle();
1045
- const names = classNames(
1044
+ const wrapperClassNames = classNames(
1046
1045
  {
1047
- [classes.withBg]: highlightShape,
1048
- [classes.toolbarOnTop]: toolbarOpts.alwaysVisible && toolbarOpts.position === 'top',
1049
- [classes.scheduled]: scheduled,
1046
+ withBg: highlightShape,
1047
+ toolbarOnTop: toolbarOpts.alwaysVisible && toolbarOpts.position === 'top',
1048
+ scheduled: scheduled,
1050
1049
  },
1051
1050
  className,
1052
1051
  );
1053
1052
 
1054
1053
  return (
1055
- <div
1054
+ <StyledEditorWrapper
1056
1055
  ref={(ref) => (this.wrapperRef = ref)}
1057
1056
  style={{ width: sizeStyle.width, minWidth: sizeStyle.minWidth, maxWidth: sizeStyle.maxWidth }}
1058
- className={names}
1057
+ className={wrapperClassNames}
1059
1058
  id={`editor-${value?.document?.key}`}
1060
1059
  >
1061
- {scheduled && <div className={classes.uploading}>Uploading image and then saving...</div>}
1062
- <SlateEditor
1063
- plugins={this.plugins}
1064
- innerRef={(r) => {
1065
- if (r) {
1066
- this.slateEditor = r;
1067
- }
1068
- }}
1069
- ref={(r) => (this.editor = r && this.props.editorRef(r))}
1070
- toolbarRef={(r) => {
1071
- if (r) {
1072
- this.toolbarRef = r;
1073
- }
1074
- }}
1075
- doneButtonRef={this.doneButtonRef}
1076
- value={value}
1077
- focusToolbar={this.state.focusToolbar}
1078
- onToolbarFocus={this.handleToolbarFocus}
1079
- onToolbarBlur={this.handleToolbarBlur}
1080
- focus={this.focus}
1081
- onKeyDown={onKeyDown}
1082
- onChange={this.onChange}
1083
- getFocusedValue={this.getFocusedValue}
1084
- onBlur={this.onBlur}
1085
- onDrop={(event, editor) => this.onDropPaste(event, editor, true)}
1086
- onPaste={(event, editor) => this.onDropPaste(event, editor)}
1087
- onFocus={this.onFocus}
1088
- onEditingDone={this.onEditingDone}
1089
- focusedNode={focusedNode}
1090
- normalize={this.normalize}
1091
- readOnly={disabled}
1092
- spellCheck={spellCheck}
1093
- autoCorrect={spellCheck}
1060
+ {scheduled && <StyledUploadingMessage>Uploading image and then saving...</StyledUploadingMessage>}
1061
+ <StyledSlateEditor
1094
1062
  className={classNames(
1095
1063
  {
1096
- [classes.noPadding]: toolbarOpts?.noPadding,
1097
- [classes.showParagraph]: showParagraphs && !showParagraphs.disabled,
1098
- [classes.separateParagraph]: separateParagraphs && !separateParagraphs.disabled,
1064
+ noPadding: toolbarOpts?.noPadding,
1065
+ showParagraph: showParagraphs && !showParagraphs.disabled,
1066
+ separateParagraph: separateParagraphs && !separateParagraphs.disabled,
1099
1067
  },
1100
- classes.slateEditor,
1101
1068
  )}
1102
- style={{
1103
- minHeight: sizeStyle.minHeight,
1104
- height: sizeStyle.height,
1105
- maxHeight: sizeStyle.maxHeight,
1106
- }}
1107
- pluginProps={otherPluginProps}
1108
- toolbarOpts={toolbarOpts}
1109
- placeholder={placeholder}
1110
- renderPlaceholder={this.renderPlaceholder}
1111
- onDataChange={this.changeData}
1112
- />
1069
+ >
1070
+ <SlateEditor
1071
+ plugins={this.plugins}
1072
+ innerRef={(r) => {
1073
+ if (r) {
1074
+ this.slateEditor = r;
1075
+ }
1076
+ }}
1077
+ ref={(r) => (this.editor = r && this.props.editorRef(r))}
1078
+ toolbarRef={(r) => {
1079
+ if (r) {
1080
+ this.toolbarRef = r;
1081
+ }
1082
+ }}
1083
+ doneButtonRef={this.doneButtonRef}
1084
+ value={value}
1085
+ focusToolbar={this.state.focusToolbar}
1086
+ onToolbarFocus={this.handleToolbarFocus}
1087
+ onToolbarBlur={this.handleToolbarBlur}
1088
+ focus={this.focus}
1089
+ onKeyDown={onKeyDown}
1090
+ onChange={this.onChange}
1091
+ getFocusedValue={this.getFocusedValue}
1092
+ onBlur={this.onBlur}
1093
+ onDrop={(event, editor) => this.onDropPaste(event, editor, true)}
1094
+ onPaste={(event, editor) => this.onDropPaste(event, editor)}
1095
+ onFocus={this.onFocus}
1096
+ onEditingDone={this.onEditingDone}
1097
+ focusedNode={focusedNode}
1098
+ normalize={this.normalize}
1099
+ readOnly={disabled}
1100
+ spellCheck={spellCheck}
1101
+ autoCorrect={spellCheck}
1102
+ style={{
1103
+ minHeight: sizeStyle.minHeight,
1104
+ height: sizeStyle.height,
1105
+ maxHeight: sizeStyle.maxHeight,
1106
+ }}
1107
+ pluginProps={otherPluginProps}
1108
+ toolbarOpts={toolbarOpts}
1109
+ placeholder={placeholder}
1110
+ renderPlaceholder={this.renderPlaceholder}
1111
+ onDataChange={this.changeData}
1112
+ />
1113
+ </StyledSlateEditor>
1113
1114
  <AlertDialog
1114
1115
  open={dialog.open}
1115
1116
  title={dialog.title}
@@ -1119,53 +1120,56 @@ export class Editor extends React.Component {
1119
1120
  onConfirmText={dialog.onConfirmText}
1120
1121
  onCloseText={dialog.onCloseText}
1121
1122
  />
1122
- </div>
1123
+ </StyledEditorWrapper>
1123
1124
  );
1124
1125
  }
1125
1126
  }
1126
1127
 
1127
1128
  // TODO color - hardcoded gray background and keypad colors will need to change too
1128
- const styles = {
1129
- withBg: {
1129
+ const StyledEditorWrapper = styled('div')(({ theme, scheduled }) => ({
1130
+ '&.withBg': {
1130
1131
  backgroundColor: 'rgba(0,0,0,0.06)',
1131
1132
  },
1132
- scheduled: {
1133
+ '&.scheduled': {
1133
1134
  opacity: 0.5,
1134
1135
  pointerEvents: 'none',
1135
1136
  position: 'relative',
1136
1137
  },
1137
- uploading: {
1138
- position: 'absolute',
1139
- top: '50%',
1140
- left: '50%',
1141
- transform: 'translate(-50%, -50%)',
1138
+ '&.toolbarOnTop': {
1139
+ marginTop: '45px',
1142
1140
  },
1143
- slateEditor: {
1144
- fontFamily: 'Roboto, sans-serif',
1145
-
1146
- '& table': {
1147
- tableLayout: 'fixed',
1148
- width: '100%',
1149
- borderCollapse: 'collapse',
1150
- color: color.text(),
1151
- backgroundColor: color.background(),
1152
- },
1153
- '& table:not([border="1"]) tr': {
1154
- borderTop: '1px solid #dfe2e5',
1155
- // TODO perhaps secondary color for background, for now disable
1156
- // '&:nth-child(2n)': {
1157
- // backgroundColor: '#f6f8fa'
1158
- // }
1159
- },
1160
- '& td, th': {
1161
- padding: '.6em 1em',
1162
- textAlign: 'center',
1163
- },
1164
- '& table:not([border="1"]) td, th': {
1165
- border: '1px solid #dfe2e5',
1166
- },
1141
+ }));
1142
+
1143
+ const StyledUploadingMessage = styled('div')({
1144
+ position: 'absolute',
1145
+ top: '50%',
1146
+ left: '50%',
1147
+ transform: 'translate(-50%, -50%)',
1148
+ });
1149
+
1150
+ const StyledSlateEditor = styled('div')(() => ({
1151
+ '& table': {
1152
+ tableLayout: 'fixed',
1153
+ width: '100%',
1154
+ borderCollapse: 'collapse',
1155
+ color: color.text(),
1156
+ backgroundColor: color.background(),
1167
1157
  },
1168
- showParagraph: {
1158
+ '& table:not([border="1"]) tr': {
1159
+ borderTop: '1px solid #dfe2e5',
1160
+ // TODO perhaps secondary color for background, for now disable
1161
+ // '&:nth-child(2n)': {
1162
+ // backgroundColor: '#f6f8fa'
1163
+ // }
1164
+ },
1165
+ '& td, th': {
1166
+ padding: '.6em 1em',
1167
+ textAlign: 'center',
1168
+ },
1169
+ '& table:not([border="1"]) td, th': {
1170
+ border: '1px solid #dfe2e5',
1171
+ },
1172
+ '&.showParagraph': {
1169
1173
  // a div that has a div after it
1170
1174
  '& > div:has(+ div)::after': {
1171
1175
  display: 'block',
@@ -1174,24 +1178,22 @@ const styles = {
1174
1178
  color: '#146EB3',
1175
1179
  },
1176
1180
  },
1177
- separateParagraph: {
1181
+ '&.separateParagraph': {
1178
1182
  // a div that has a div after it
1179
1183
  '& > div:has(+ div)': {
1180
1184
  marginBottom: '1em',
1181
1185
  },
1182
1186
  },
1183
- toolbarOnTop: {
1184
- marginTop: '45px',
1185
- },
1186
- noPadding: {
1187
+ '&.noPadding': {
1187
1188
  padding: '0 !important',
1188
1189
  },
1189
- previewText: {
1190
- marginBottom: '36px',
1191
- marginTop: '6px',
1192
- padding: '20px',
1193
- backgroundColor: 'rgba(0,0,0,0.06)',
1194
- },
1195
- };
1190
+ }));
1191
+
1192
+ const StyledPreviewText = styled('div')({
1193
+ marginBottom: '36px',
1194
+ marginTop: '6px',
1195
+ padding: '20px',
1196
+ backgroundColor: 'rgba(0,0,0,0.06)',
1197
+ });
1196
1198
 
1197
- export default withStyles(styles)(Editor);
1199
+ export default Editor;
@@ -1,34 +1,29 @@
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: {
6
+ const StyledPopper = styled(Popper)(() => ({
7
+ background: '#fff',
8
+ padding: '10px',
9
+ pointerEvents: 'none',
10
+ zIndex: 99999,
11
+ '& .MuiPaper-root': {
14
12
  padding: 20,
15
13
  height: 'auto',
16
14
  width: 'auto',
17
15
  },
18
- typography: {
19
- fontSize: 50,
20
- textAlign: 'center',
21
- },
22
- });
16
+ }));
23
17
 
24
- const CustomPopper = withStyles(styles)(({ classes, children, ...props }) => (
25
- <Popper
18
+ const StyledTypography = styled(Typography)(() => ({
19
+ fontSize: 50,
20
+ textAlign: 'center',
21
+ }));
22
+
23
+ const CustomPopper = ({ children, ...props }) => (
24
+ <StyledPopper
26
25
  id="mouse-over-popover"
27
26
  open
28
- className={classes.popover}
29
- classes={{
30
- paper: classes.paper,
31
- }}
32
27
  anchorOrigin={{
33
28
  vertical: 'bottom',
34
29
  horizontal: 'left',
@@ -41,8 +36,8 @@ const CustomPopper = withStyles(styles)(({ classes, children, ...props }) => (
41
36
  disableAutoFocus
42
37
  {...props}
43
38
  >
44
- <Typography classes={{ root: classes.typography }}>{children}</Typography>
45
- </Popper>
46
- ));
39
+ <StyledTypography>{children}</StyledTypography>
40
+ </StyledPopper>
41
+ );
47
42
 
48
43
  export default CustomPopper;
@@ -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,10 +1,8 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
- import List from '@material-ui/core/List';
4
- import { Leaf, Mark } from 'slate';
5
- import Immutable from 'immutable';
6
- import ListItem from '@material-ui/core/ListItem';
7
- import isEmpty from 'lodash/isEmpty';
3
+ import List from '@mui/material/List';
4
+ import { Mark } from 'slate';
5
+ import ListItem from '@mui/material/ListItem';
8
6
  import debug from 'debug';
9
7
  import CssIcon from './icons';
10
8
 
@@ -1,19 +1,17 @@
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 StyledHtmlIcon = 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 HtmlModeIcon = ({ classes, isHtmlMode }) => (
16
- <div className={classes.icon}>{isHtmlMode ? 'Exit <HTML> mode' : '<HTML>'}</div>
13
+ const HtmlModeIcon = ({ isHtmlMode }) => (
14
+ <StyledHtmlIcon>{isHtmlMode ? 'Exit <HTML> mode' : '<HTML>'}</StyledHtmlIcon>
17
15
  );
18
16
 
19
- export default withStyles(styles)(HtmlModeIcon);
17
+ export default HtmlModeIcon;
@@ -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 {
@@ -54,8 +54,9 @@ export class AltDialog extends React.Component {
54
54
  id="text-dialog"
55
55
  hideBackdrop
56
56
  disableScrollLock
57
- onEntered={this.handleOverflow}
58
- >
57
+ TransitionProps={{
58
+ onEntered: this.handleOverflow
59
+ }}>
59
60
  <DialogContent>
60
61
  <div style={{ display: 'flex' }}>
61
62
  <ArrowBackIos style={{ paddingTop: '6px' }} />