The api I'm using passes me a javascript defined set of blocks. (React application)
So I have to load the javascript via script tag.
The issue is that node-blockly doesn't seem to expose the Blockly.Blocks so when I load the script, I get a undefined "Blockly.Blocks". How can I load it without having to convert the javascript to xml?
The api I'm using passes me a javascript defined set of blocks. (React application) So I have to load the javascript via script tag.
The issue is that node-blockly doesn't seem to expose the Blockly.Blocks so when I load the script, I get a undefined "Blockly.Blocks". How can I load it without having to convert the javascript to xml?
Example:
Blockly.Blocks['or'] = { init: function() { this.jsonInit({ "args0": [ { "check": "Boolean", "name": "op1", "type": "input_value" }, { "check": "Boolean", "name": "op2", "type": "input_value" } ], "colour": 165, "helpUrl": "", "message0": "%1 or %2", "output": "Boolean", "tooltip": "", "type": "or" }); } };