reset Workspace with initial XML-Block

This commit is contained in:
Delucse
2020-08-10 11:54:36 +02:00
parent 08dab82d00
commit fdde372ef3
6 changed files with 29 additions and 17 deletions
+2 -2
View File
@@ -7,6 +7,7 @@ import BlocklyComponent from './';
import * as Blockly from 'blockly/core';
import './blocks/index';
import './generator/index';
import { initialXml } from './initialXml.js';
@@ -53,8 +54,7 @@ class BlocklyWindow extends Component {
drag: true,
wheel: false
}}
initialXml={`<xml xmlns="https://developers.google.com/blockly/xml">
<block type="arduino_functions" id="QWW|$jB8+*EL;}|#uA" x="27" y="16"></block></xml>`}
initialXml={initialXml}
>
</BlocklyComponent >
+3
View File
@@ -0,0 +1,3 @@
export const initialXml = `<xml xmlns="https://developers.google.com/blockly/xml">
<block type="arduino_functions" deletable="false" id="QWW|$jB8+*EL;}|#uA" x="27" y="16"></block></xml>`
// Block is initial Block of the workspace and must always be a part of the workspace
+4 -1
View File
@@ -286,12 +286,15 @@ class Toolbox extends React.Component {
</Value>
</Block>
</Category>
{/* this block is the initial block of the workspace; not necessary
to display, because it can only be used once anyway
<Category name="Procedures" colour={getColour().procedures}>
<Block type="arduino_functions" />
</Category>
*/}
</xml>
);
};
}
export default Toolbox;
export default Toolbox;