@flowgram.ai/free-layout-core 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1390,17 +1390,15 @@ var WorkflowLinesManager = class {
1390
1390
  toNode?.removeLine(line);
1391
1391
  line.validate();
1392
1392
  });
1393
- line.toDispose.push(
1394
- import_utils12.Disposable.create(() => {
1395
- if (available) {
1396
- this.onAvailableLinesChangeEmitter.fire({
1397
- type: "DELETE_LINE" /* DELETE_LINE */,
1398
- toJSON: () => line.toJSON(),
1399
- entity: line
1400
- });
1401
- }
1402
- })
1403
- );
1393
+ line.onDispose(() => {
1394
+ if (available) {
1395
+ this.onAvailableLinesChangeEmitter.fire({
1396
+ type: "DELETE_LINE" /* DELETE_LINE */,
1397
+ toJSON: () => line.toJSON(),
1398
+ entity: line
1399
+ });
1400
+ }
1401
+ });
1404
1402
  if (available) {
1405
1403
  this.onAvailableLinesChangeEmitter.fire({
1406
1404
  type: "ADD_LINE" /* ADD_LINE */,
@@ -1881,26 +1879,20 @@ var WorkflowDocument = class extends import_document7.FlowDocument {
1881
1879
  entity: node,
1882
1880
  toJSON: () => this.toNodeJSON(node)
1883
1881
  });
1884
- node.toDispose.push(
1885
- import_utils14.Disposable.create(() => {
1886
- this.fireContentChange({
1887
- type: "DELETE_NODE" /* DELETE_NODE */,
1888
- entity: node,
1889
- toJSON: () => this.toNodeJSON(node)
1890
- });
1891
- })
1892
- );
1893
- node.toDispose.push(
1894
- import_utils14.Disposable.create(() => {
1895
- if (!node.parent || node.parent.flowNodeType === import_document7.FlowNodeBaseType.ROOT) {
1896
- return;
1897
- }
1898
- const parentTransform = node.parent.getData(import_document7.FlowNodeTransformData);
1899
- setTimeout(() => {
1900
- parentTransform.fireChange();
1901
- }, 0);
1902
- })
1903
- );
1882
+ node.onDispose(() => {
1883
+ if (!node.parent || node.parent.flowNodeType === import_document7.FlowNodeBaseType.ROOT) {
1884
+ return;
1885
+ }
1886
+ const parentTransform = node.parent.getData(import_document7.FlowNodeTransformData);
1887
+ parentTransform.fireChange();
1888
+ });
1889
+ node.onDispose(() => {
1890
+ this.fireContentChange({
1891
+ type: "DELETE_NODE" /* DELETE_NODE */,
1892
+ entity: node,
1893
+ toJSON: () => this.toNodeJSON(node)
1894
+ });
1895
+ });
1904
1896
  }
1905
1897
  if (json.blocks) {
1906
1898
  this.renderJSON(