@flowgram.ai/document 0.4.19 → 0.5.1

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
@@ -494,7 +494,7 @@ declare class FlowNodeRenderData extends EntityData<FlowNodeRenderSchema> {
494
494
  }>;
495
495
  get key(): string;
496
496
  getDefaultData(): FlowNodeRenderSchema;
497
- updateExtInfo(info: Record<string, any>): void;
497
+ updateExtInfo(info: Record<string, any>, fullUpdate?: boolean): void;
498
498
  getExtInfo(): Record<string, any> | undefined;
499
499
  constructor(entity: FlowNodeEntity);
500
500
  get addable(): boolean;
@@ -757,7 +757,7 @@ declare class FlowNodeEntity extends Entity<FlowNodeEntityConfig> {
757
757
  * 修改节点扩展信息
758
758
  * @param info
759
759
  */
760
- updateExtInfo<T extends Record<string, any> = Record<string, any>>(extInfo: T): void;
760
+ updateExtInfo<T extends Record<string, any> = Record<string, any>>(extInfo: T, fullUpdate?: boolean): void;
761
761
  /**
762
762
  * 获取节点扩展信息
763
763
  */
package/dist/index.d.ts CHANGED
@@ -494,7 +494,7 @@ declare class FlowNodeRenderData extends EntityData<FlowNodeRenderSchema> {
494
494
  }>;
495
495
  get key(): string;
496
496
  getDefaultData(): FlowNodeRenderSchema;
497
- updateExtInfo(info: Record<string, any>): void;
497
+ updateExtInfo(info: Record<string, any>, fullUpdate?: boolean): void;
498
498
  getExtInfo(): Record<string, any> | undefined;
499
499
  constructor(entity: FlowNodeEntity);
500
500
  get addable(): boolean;
@@ -757,7 +757,7 @@ declare class FlowNodeEntity extends Entity<FlowNodeEntityConfig> {
757
757
  * 修改节点扩展信息
758
758
  * @param info
759
759
  */
760
- updateExtInfo<T extends Record<string, any> = Record<string, any>>(extInfo: T): void;
760
+ updateExtInfo<T extends Record<string, any> = Record<string, any>>(extInfo: T, fullUpdate?: boolean): void;
761
761
  /**
762
762
  * 获取节点扩展信息
763
763
  */
package/dist/index.js CHANGED
@@ -348,13 +348,14 @@ var _FlowNodeRenderData = class _FlowNodeRenderData extends import_core.EntityDa
348
348
  stackIndex: 0
349
349
  };
350
350
  }
351
- updateExtInfo(info) {
352
- if (import_utils.Compare.isChanged(this.data.extInfo, info)) {
353
- const oldInfo = this.data.extInfo;
351
+ updateExtInfo(info, fullUpdate) {
352
+ const oldInfo = this.data.extInfo;
353
+ const newInfo = fullUpdate ? info : { ...oldInfo, ...info };
354
+ if (import_utils.Compare.isChanged(oldInfo, newInfo)) {
354
355
  this.update({
355
- extInfo: info
356
+ extInfo: newInfo
356
357
  });
357
- this.onExtInfoChangeEmitter.fire({ oldInfo, newInfo: info });
358
+ this.onExtInfoChangeEmitter.fire({ oldInfo, newInfo });
358
359
  }
359
360
  }
360
361
  getExtInfo() {
@@ -1100,8 +1101,8 @@ var FlowNodeEntity = class extends import_core4.Entity {
1100
1101
  * 修改节点扩展信息
1101
1102
  * @param info
1102
1103
  */
1103
- updateExtInfo(extInfo) {
1104
- this.getData(FlowNodeRenderData).updateExtInfo(extInfo);
1104
+ updateExtInfo(extInfo, fullUpdate) {
1105
+ this.getData(FlowNodeRenderData).updateExtInfo(extInfo, fullUpdate);
1105
1106
  }
1106
1107
  /**
1107
1108
  * 获取节点扩展信息