diff --git a/src/index.css b/src/index.css index 4a05dbf..dfc55f4 100644 --- a/src/index.css +++ b/src/index.css @@ -20,6 +20,12 @@ pre, code { min-width: 600px; } +#blocklyDiv2 { + flex-basis: 100%; + height: 100%; + min-width: 600px; +} + #outputPane { display: flex; flex-direction: column; diff --git a/src/index.html b/src/index.html index fa24967..f84003f 100644 --- a/src/index.html +++ b/src/index.html @@ -11,6 +11,7 @@
+
diff --git a/src/index.js b/src/index.js index 0ee963d..59de7b6 100644 --- a/src/index.js +++ b/src/index.js @@ -25,7 +25,14 @@ const codeDiv = document.getElementById('generatedCode').firstChild; const outputDiv = document.getElementById('output'); const blocklyDiv = document.getElementById('blocklyDiv'); const ws = Blockly.inject(blocklyDiv, {toolbox}); - +const blockOut = Blockly.inject(document.getElementById('blocklyDiv2'), {toolbox}); +blockOut.addChangeListener(function addBlock(addNewBlockEvent){ + addNewBlockEvent.run(true); +}); +new Blockly.Events.BlockCreate(blockOut.newBlock("letting_be_expr")); +//blockOut.addTopBlock(blocks["letting_be_expr"]); +//console.log(blockOut.getTopBlocks()); +//blockOut.cleanUp(); //variable category using https://www.npmjs.com/package/@blockly/plugin-typed-variable-modal. // much of the code below is from the usage instructions