How can I add a block to workspace by clicking a context menu option?I tried this:Blockly.Blocks['some_block'] = {...customContextMenu(options) {const option = {enabled: true,callback() {Blockly.serialization.blocks.append({'type': 'text','fields': { 'TEXT': 'Now there is a block' }})
},}const name = this.getFieldValue('NAME')option.text = Blockly.Msg.PROCEDURES_CREATE_DO.replace('%1', name)options.push(option)}}But it didn't work.
Actually, by pressing the context menu button I need to add a block for the function with the ability to enter parameters.
In some previous version we used something like goog.dom.createDom('field', null, name)