diff --git a/package.json b/package.json index ea1d8857..3844c208 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rete", - "version": "1.4.1-rc.2", + "version": "1.4.1", "description": "JavaScript framework", "main": "build/rete.common.js", "module": "build/rete.esm.js", diff --git a/src/editor.ts b/src/editor.ts index f1573b95..dca16044 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -109,6 +109,7 @@ export class NodeEditor extends Context { clear() { [...this.nodes].forEach(node => this.removeNode(node)); + this.trigger('clear'); } toJSON() { diff --git a/src/events.ts b/src/events.ts index 27e869b7..5f96486c 100644 --- a/src/events.ts +++ b/src/events.ts @@ -46,7 +46,8 @@ export class EditorEvents extends Events { contextmenu: [], import: [], export: [], - process: [] + process: [], + clear: [] }); } } @@ -132,4 +133,5 @@ export interface EventsTypes extends DefaultEventsTypes { import: Data; export: Data; process: void; + clear: void; } \ No newline at end of file