@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/esm/index.js CHANGED
@@ -1125,7 +1125,7 @@ import {
1125
1125
  // src/workflow-lines-manager.ts
1126
1126
  import { last } from "lodash-es";
1127
1127
  import { inject as inject3, injectable as injectable3 } from "inversify";
1128
- import { Disposable as Disposable2, DisposableCollection, Emitter as Emitter3 } from "@flowgram.ai/utils";
1128
+ import { DisposableCollection, Emitter as Emitter3 } from "@flowgram.ai/utils";
1129
1129
  import { FlowNodeRenderData as FlowNodeRenderData2, FlowNodeTransformData as FlowNodeTransformData3 } from "@flowgram.ai/document";
1130
1130
  import { EntityManager as EntityManager2, PlaygroundConfigEntity as PlaygroundConfigEntity2, TransformData as TransformData6 } from "@flowgram.ai/core";
1131
1131
 
@@ -1324,17 +1324,15 @@ var WorkflowLinesManager = class {
1324
1324
  toNode?.removeLine(line);
1325
1325
  line.validate();
1326
1326
  });
1327
- line.toDispose.push(
1328
- Disposable2.create(() => {
1329
- if (available) {
1330
- this.onAvailableLinesChangeEmitter.fire({
1331
- type: "DELETE_LINE" /* DELETE_LINE */,
1332
- toJSON: () => line.toJSON(),
1333
- entity: line
1334
- });
1335
- }
1336
- })
1337
- );
1327
+ line.onDispose(() => {
1328
+ if (available) {
1329
+ this.onAvailableLinesChangeEmitter.fire({
1330
+ type: "DELETE_LINE" /* DELETE_LINE */,
1331
+ toJSON: () => line.toJSON(),
1332
+ entity: line
1333
+ });
1334
+ }
1335
+ });
1338
1336
  if (available) {
1339
1337
  this.onAvailableLinesChangeEmitter.fire({
1340
1338
  type: "ADD_LINE" /* ADD_LINE */,
@@ -1535,7 +1533,7 @@ WorkflowLinesManager = __decorateClass([
1535
1533
  // src/workflow-document.ts
1536
1534
  import { customAlphabet } from "nanoid";
1537
1535
  import { inject as inject5, injectable as injectable5, optional, postConstruct } from "inversify";
1538
- import { Disposable as Disposable3, Emitter as Emitter4 } from "@flowgram.ai/utils";
1536
+ import { Emitter as Emitter4 } from "@flowgram.ai/utils";
1539
1537
  import { NodeEngineContext } from "@flowgram.ai/form-core";
1540
1538
  import { FlowDocument, FlowNodeBaseType, FlowNodeTransformData as FlowNodeTransformData5 } from "@flowgram.ai/document";
1541
1539
  import {
@@ -1827,26 +1825,20 @@ var WorkflowDocument = class extends FlowDocument {
1827
1825
  entity: node,
1828
1826
  toJSON: () => this.toNodeJSON(node)
1829
1827
  });
1830
- node.toDispose.push(
1831
- Disposable3.create(() => {
1832
- this.fireContentChange({
1833
- type: "DELETE_NODE" /* DELETE_NODE */,
1834
- entity: node,
1835
- toJSON: () => this.toNodeJSON(node)
1836
- });
1837
- })
1838
- );
1839
- node.toDispose.push(
1840
- Disposable3.create(() => {
1841
- if (!node.parent || node.parent.flowNodeType === FlowNodeBaseType.ROOT) {
1842
- return;
1843
- }
1844
- const parentTransform = node.parent.getData(FlowNodeTransformData5);
1845
- setTimeout(() => {
1846
- parentTransform.fireChange();
1847
- }, 0);
1848
- })
1849
- );
1828
+ node.onDispose(() => {
1829
+ if (!node.parent || node.parent.flowNodeType === FlowNodeBaseType.ROOT) {
1830
+ return;
1831
+ }
1832
+ const parentTransform = node.parent.getData(FlowNodeTransformData5);
1833
+ parentTransform.fireChange();
1834
+ });
1835
+ node.onDispose(() => {
1836
+ this.fireContentChange({
1837
+ type: "DELETE_NODE" /* DELETE_NODE */,
1838
+ entity: node,
1839
+ toJSON: () => this.toNodeJSON(node)
1840
+ });
1841
+ });
1850
1842
  }
1851
1843
  if (json.blocks) {
1852
1844
  this.renderJSON(