reset Workspace with initial XML-Block
This commit is contained in:
@@ -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 >
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user