@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.
- package/CHANGELOG.md +37 -0
- package/lib/block-tags.js +2 -3
- package/lib/block-tags.js.map +1 -1
- package/lib/constants.js +3 -6
- package/lib/constants.js.map +1 -1
- package/lib/editor.js +302 -450
- package/lib/editor.js.map +1 -1
- package/lib/index.js +19 -77
- package/lib/index.js.map +1 -1
- package/lib/parse-html.js +7 -7
- package/lib/parse-html.js.map +1 -1
- package/lib/plugins/characters/custom-popper.js +24 -44
- package/lib/plugins/characters/custom-popper.js.map +1 -1
- package/lib/plugins/characters/index.js +9 -60
- package/lib/plugins/characters/index.js.map +1 -1
- package/lib/plugins/characters/utils.js +3 -6
- package/lib/plugins/characters/utils.js.map +1 -1
- package/lib/plugins/css/icons/index.js +13 -25
- package/lib/plugins/css/icons/index.js.map +1 -1
- package/lib/plugins/css/index.js +22 -88
- package/lib/plugins/css/index.js.map +1 -1
- package/lib/plugins/customPlugin/index.js +10 -26
- package/lib/plugins/customPlugin/index.js.map +1 -1
- package/lib/plugins/html/icons/index.js +14 -26
- package/lib/plugins/html/icons/index.js.map +1 -1
- package/lib/plugins/html/index.js +4 -13
- package/lib/plugins/html/index.js.map +1 -1
- package/lib/plugins/image/alt-dialog.js +20 -49
- package/lib/plugins/image/alt-dialog.js.map +1 -1
- package/lib/plugins/image/component.js +119 -190
- package/lib/plugins/image/component.js.map +1 -1
- package/lib/plugins/image/image-toolbar.js +44 -86
- package/lib/plugins/image/image-toolbar.js.map +1 -1
- package/lib/plugins/image/index.js +6 -46
- package/lib/plugins/image/index.js.map +1 -1
- package/lib/plugins/image/insert-image-handler.js +10 -31
- package/lib/plugins/image/insert-image-handler.js.map +1 -1
- package/lib/plugins/index.js +44 -106
- package/lib/plugins/index.js.map +1 -1
- package/lib/plugins/list/index.js +27 -73
- package/lib/plugins/list/index.js.map +1 -1
- package/lib/plugins/math/index.js +64 -116
- package/lib/plugins/math/index.js.map +1 -1
- package/lib/plugins/media/index.js +23 -81
- package/lib/plugins/media/index.js.map +1 -1
- package/lib/plugins/media/media-dialog.js +192 -307
- package/lib/plugins/media/media-dialog.js.map +1 -1
- package/lib/plugins/media/media-toolbar.js +40 -65
- package/lib/plugins/media/media-toolbar.js.map +1 -1
- package/lib/plugins/media/media-wrapper.js +20 -49
- package/lib/plugins/media/media-wrapper.js.map +1 -1
- package/lib/plugins/rendering/index.js +5 -15
- package/lib/plugins/rendering/index.js.map +1 -1
- package/lib/plugins/respArea/drag-in-the-blank/choice.js +175 -249
- package/lib/plugins/respArea/drag-in-the-blank/choice.js.map +1 -1
- package/lib/plugins/respArea/drag-in-the-blank/index.js +39 -29
- package/lib/plugins/respArea/drag-in-the-blank/index.js.map +1 -1
- package/lib/plugins/respArea/explicit-constructed-response/index.js +3 -10
- package/lib/plugins/respArea/explicit-constructed-response/index.js.map +1 -1
- package/lib/plugins/respArea/icons/index.js +22 -45
- package/lib/plugins/respArea/icons/index.js.map +1 -1
- package/lib/plugins/respArea/index.js +5 -59
- package/lib/plugins/respArea/index.js.map +1 -1
- package/lib/plugins/respArea/inline-dropdown/index.js +2 -10
- package/lib/plugins/respArea/inline-dropdown/index.js.map +1 -1
- package/lib/plugins/respArea/math-templated/index.js +92 -109
- package/lib/plugins/respArea/math-templated/index.js.map +1 -1
- package/lib/plugins/respArea/utils.js +8 -40
- package/lib/plugins/respArea/utils.js.map +1 -1
- package/lib/plugins/table/CustomTablePlugin.js +24 -41
- package/lib/plugins/table/CustomTablePlugin.js.map +1 -1
- package/lib/plugins/table/icons/index.js +19 -35
- package/lib/plugins/table/icons/index.js.map +1 -1
- package/lib/plugins/table/index.js +41 -118
- package/lib/plugins/table/index.js.map +1 -1
- package/lib/plugins/table/table-toolbar.js +37 -87
- package/lib/plugins/table/table-toolbar.js.map +1 -1
- package/lib/plugins/textAlign/icons/index.js +18 -64
- package/lib/plugins/textAlign/icons/index.js.map +1 -1
- package/lib/plugins/textAlign/index.js +1 -6
- package/lib/plugins/textAlign/index.js.map +1 -1
- package/lib/plugins/toolbar/default-toolbar.js +30 -79
- package/lib/plugins/toolbar/default-toolbar.js.map +1 -1
- package/lib/plugins/toolbar/done-button.js +16 -34
- package/lib/plugins/toolbar/done-button.js.map +1 -1
- package/lib/plugins/toolbar/editor-and-toolbar.js +174 -201
- package/lib/plugins/toolbar/editor-and-toolbar.js.map +1 -1
- package/lib/plugins/toolbar/index.js +0 -5
- package/lib/plugins/toolbar/index.js.map +1 -1
- package/lib/plugins/toolbar/toolbar-buttons.js +57 -107
- package/lib/plugins/toolbar/toolbar-buttons.js.map +1 -1
- package/lib/plugins/toolbar/toolbar.js +95 -161
- package/lib/plugins/toolbar/toolbar.js.map +1 -1
- package/lib/plugins/utils.js +5 -25
- package/lib/plugins/utils.js.map +1 -1
- package/lib/serialization.js +44 -150
- package/lib/serialization.js.map +1 -1
- package/lib/shared/alert-dialog.js +23 -42
- package/lib/theme.js +1 -2
- package/lib/theme.js.map +1 -1
- package/package.json +15 -21
- package/src/__tests__/utils.js +1 -1
- package/src/editor.jsx +110 -108
- package/src/plugins/characters/custom-popper.js +20 -25
- package/src/plugins/css/icons/index.jsx +11 -13
- package/src/plugins/css/index.jsx +3 -5
- package/src/plugins/html/icons/index.jsx +12 -14
- package/src/plugins/image/alt-dialog.jsx +9 -8
- package/src/plugins/image/component.jsx +67 -87
- package/src/plugins/image/image-toolbar.jsx +26 -26
- package/src/plugins/image/index.jsx +1 -1
- package/src/plugins/index.jsx +10 -10
- package/src/plugins/math/index.jsx +1 -1
- package/src/plugins/media/index.jsx +2 -2
- package/src/plugins/media/media-dialog.js +65 -76
- package/src/plugins/media/media-toolbar.jsx +32 -33
- package/src/plugins/media/media-wrapper.jsx +10 -13
- package/src/plugins/respArea/drag-in-the-blank/choice.jsx +193 -180
- package/src/plugins/respArea/drag-in-the-blank/index.jsx +58 -22
- package/src/plugins/respArea/icons/index.jsx +16 -16
- package/src/plugins/respArea/math-templated/index.jsx +88 -89
- package/src/plugins/respArea/utils.jsx +1 -1
- package/src/plugins/table/icons/index.jsx +14 -16
- package/src/plugins/table/index.jsx +27 -19
- package/src/plugins/table/table-toolbar.jsx +17 -19
- package/src/plugins/textAlign/icons/index.jsx +3 -3
- package/src/plugins/toolbar/__tests__/default-toolbar.test.jsx +1 -1
- package/src/plugins/toolbar/__tests__/toolbar.test.jsx +1 -1
- package/src/plugins/toolbar/default-toolbar.jsx +18 -21
- package/src/plugins/toolbar/done-button.jsx +16 -22
- package/src/plugins/toolbar/editor-and-toolbar.jsx +134 -157
- package/src/plugins/toolbar/toolbar-buttons.jsx +29 -46
- package/src/plugins/toolbar/toolbar.jsx +60 -78
- package/esm/index.js +0 -111560
- package/esm/index.js.map +0 -1
- 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 {
|
|
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
|
|
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
|
-
|
|
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
|
|
1044
|
+
const wrapperClassNames = classNames(
|
|
1046
1045
|
{
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
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
|
-
<
|
|
1054
|
+
<StyledEditorWrapper
|
|
1056
1055
|
ref={(ref) => (this.wrapperRef = ref)}
|
|
1057
1056
|
style={{ width: sizeStyle.width, minWidth: sizeStyle.minWidth, maxWidth: sizeStyle.maxWidth }}
|
|
1058
|
-
className={
|
|
1057
|
+
className={wrapperClassNames}
|
|
1059
1058
|
id={`editor-${value?.document?.key}`}
|
|
1060
1059
|
>
|
|
1061
|
-
{scheduled && <
|
|
1062
|
-
<
|
|
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
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1064
|
+
noPadding: toolbarOpts?.noPadding,
|
|
1065
|
+
showParagraph: showParagraphs && !showParagraphs.disabled,
|
|
1066
|
+
separateParagraph: separateParagraphs && !separateParagraphs.disabled,
|
|
1099
1067
|
},
|
|
1100
|
-
classes.slateEditor,
|
|
1101
1068
|
)}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
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
|
-
</
|
|
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
|
|
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
|
-
|
|
1138
|
-
|
|
1139
|
-
top: '50%',
|
|
1140
|
-
left: '50%',
|
|
1141
|
-
transform: 'translate(-50%, -50%)',
|
|
1138
|
+
'&.toolbarOnTop': {
|
|
1139
|
+
marginTop: '45px',
|
|
1142
1140
|
},
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1184
|
-
marginTop: '45px',
|
|
1185
|
-
},
|
|
1186
|
-
noPadding: {
|
|
1187
|
+
'&.noPadding': {
|
|
1187
1188
|
padding: '0 !important',
|
|
1188
1189
|
},
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
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
|
|
1199
|
+
export default Editor;
|
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import Popper from '@material
|
|
4
|
-
import Typography from '@material
|
|
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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
19
|
-
fontSize: 50,
|
|
20
|
-
textAlign: 'center',
|
|
21
|
-
},
|
|
22
|
-
});
|
|
16
|
+
}));
|
|
23
17
|
|
|
24
|
-
const
|
|
25
|
-
|
|
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
|
-
<
|
|
45
|
-
</
|
|
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 {
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 = (
|
|
13
|
+
const CssIcon = () => <StyledCssIcon>CSS</StyledCssIcon>;
|
|
16
14
|
|
|
17
|
-
export default
|
|
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
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
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 {
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 = ({
|
|
16
|
-
<
|
|
13
|
+
const HtmlModeIcon = ({ isHtmlMode }) => (
|
|
14
|
+
<StyledHtmlIcon>{isHtmlMode ? 'Exit <HTML> mode' : '<HTML>'}</StyledHtmlIcon>
|
|
17
15
|
);
|
|
18
16
|
|
|
19
|
-
export default
|
|
17
|
+
export default HtmlModeIcon;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import DialogContent from '@material
|
|
3
|
-
import ArrowBackIos from '@
|
|
4
|
-
import TextField from '@material
|
|
5
|
-
import DialogActions from '@material
|
|
6
|
-
import Button from '@material
|
|
7
|
-
import Dialog from '@material
|
|
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
|
-
|
|
58
|
-
|
|
57
|
+
TransitionProps={{
|
|
58
|
+
onEntered: this.handleOverflow
|
|
59
|
+
}}>
|
|
59
60
|
<DialogContent>
|
|
60
61
|
<div style={{ display: 'flex' }}>
|
|
61
62
|
<ArrowBackIos style={{ paddingTop: '6px' }} />
|