Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function initialize(container, connOptions = {}, renderOptions = {}) {
const editor = new NodeEditor('retejs@0.1.0', container);
editor.use(ConnectionPlugin, connOptions);
editor.use(VueRenderPlugin, renderOptions);
const engine = new Engine('retejs@0.1.0');
editor.on('process nodecreated noderemoved connectioncreated connectionremoved', async () => {
if(editor.silent) return;
await engine.abort();
await engine.process(editor.toJSON());
});
return {
editor,
engine,
initEditor() {
this.editor = new NodeEditor(ID, this.$refs.area);
this.engine = new Engine(ID);
this.editor.use(VueRenderPlugin);
this.editor.use(ConnectionPlugin);
this.editor.use(AreaPlugin);
this.editor.use(ContextMenuPlugin, {
delay: 100,
allocate(component) {
return component.allocation || [];
}
});
this.editor.use(ModulePlugin, {
engine: this.engine,
modules: this.$refs.modules.list
});