I want to Implement Block Factory in my Angular Project to create blocks that can be used in my work-space. The link for the block factory demo and github repository are below
https://blockly-demo.appspot.com/static/demos/blockfactory/index.html
https://github.com/google/blockly-devtools.
I did not find any reference to implement this feature.
Blockly['JavaScript']['turtle_move_internal'] = function(block) {
// Generate JavaScript for moving forward or backwards.
const value = block.getFieldValue('VALUE');
return 'Turtle.' + block.getFieldValue('DIR') +
'(' + value + ', \'block_id_' + block.id + '\');\n';
};