ui: remove blockly

This commit is contained in:
undefined committed 2021-10-10 19:29:24 +08:00
1 parent 00438b69b5
commit fb8eb1d3ab
4 files changed
+1 -372

No files matched your search

@@ -22,22 +22,9 @@ const mapDispatchToProps = (dispatch) => ({
export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor extends React.PureComponent {
disposable = [];
blockly = false;
componentDidMount() {
const value = this.props.value || '';
const { language, theme } = this.props;
if (this.props.language === 'blockly') {
if (!this.blockly) {
import('./blockly').then(({ default: Blockly }) => {
if (!this.blockly) return;
Blockly.inject(this.containerElement, {
});
});
}
this.blockly = true;
return;
}
this.model = monaco.editor.createModel(value, language, monaco.Uri.parse('file://model'));
if (this.containerElement) {
/** @type {monaco.editor.IStandaloneEditorConstructionOptions} */
@@ -67,19 +54,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
}
componentDidUpdate(prevProps) {
if (this.props.language === 'blockly') {
if (!this.blockly) {
this.editor.dispose();
import('./blockly').then(({ default: Blockly, toolbox }) => {
if (!this.blockly) return;
Blockly.inject(this.containerElement, {
toolbox,
});
});
}
this.blockly = true;
return;
}
const {
value, language, theme, mainSize, recordSize, pretestSize,
} = this.props;