class BlocklyWidget extends Widget {
public div: HTMLElement;
constructor(notebooks: INotebookTracker) {
super();
this.notebooks = notebooks;
this.generator = pythonGenerator;
this.div = document.createElement("div");
this.div.id = "blocklyDivPython";
this.node.appendChild(this.div); // Append div to widget's DOM node
}
onAfterAttach(): void{
const this$: BlocklyWidget = this;
BlocklyWidget__set_workspace(this$, Blockly.inject("blocklyDivPython", {
toolbox: toolbox,
}));
console.log("jupyterlab_blockly_extension_python: blockly palette initialized");
}
}
export function BlocklyWidget__set_workspace(__: BlocklyWidget, v: Blockly.Workspace): void {
__["workspace@"] = v;
}
// ... other helper functions and plugin definition
export default pluginPython;