@flowgram.ai/document 0.1.0-alpha.12 → 0.1.0-alpha.13

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.d.mts CHANGED
@@ -542,6 +542,7 @@ declare class FlowNodeTransformData extends EntityData<FlowNodeTransformSchema>
542
542
  */
543
543
  get size(): SizeSchema;
544
544
  get position(): PositionSchema;
545
+ set position(position: PositionSchema);
545
546
  set size(size: SizeSchema);
546
547
  get inputPoint(): IPoint;
547
548
  get defaultInputPoint(): IPoint;
package/dist/index.d.ts CHANGED
@@ -542,6 +542,7 @@ declare class FlowNodeTransformData extends EntityData<FlowNodeTransformSchema>
542
542
  */
543
543
  get size(): SizeSchema;
544
544
  get position(): PositionSchema;
545
+ set position(position: PositionSchema);
545
546
  set size(size: SizeSchema);
546
547
  get inputPoint(): IPoint;
547
548
  get defaultInputPoint(): IPoint;
package/dist/index.js CHANGED
@@ -538,6 +538,11 @@ var _FlowNodeTransformData = class _FlowNodeTransformData extends import_core2.E
538
538
  y: position.y
539
539
  };
540
540
  }
541
+ set position(position) {
542
+ this.transform.update({
543
+ position
544
+ });
545
+ }
541
546
  set size(size) {
542
547
  const { width, height } = this.data.size;
543
548
  if (this.isContainer) return;
@@ -2038,6 +2043,11 @@ var FlowDocument = class {
2038
2043
  * 导出数据,可以重载
2039
2044
  */
2040
2045
  toJSON() {
2046
+ if (this.disposed) {
2047
+ throw new Error(
2048
+ "The FlowDocument has been disposed and it is no longer possible to call toJSON."
2049
+ );
2050
+ }
2041
2051
  return {
2042
2052
  nodes: this.root.toJSON().blocks
2043
2053
  };