@flowgram.ai/document 0.1.0-alpha.18 → 0.1.0-alpha.19

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
  */
@@ -841,6 +841,8 @@ interface FlowRendererState {
841
841
  nodeDragIds?: string[];
842
842
  nodeDragIdsWithChildren?: string[];
843
843
  dragLabelSide?: LABEL_SIDE_TYPE;
844
+ dragging?: boolean;
845
+ isBranch?: boolean;
844
846
  }
845
847
  /**
846
848
  * 渲染相关的全局状态管理
@@ -851,6 +853,10 @@ declare class FlowRendererStateEntity extends ConfigEntity<FlowRendererState, Fl
851
853
  constructor(conf: FlowRendererStateEntityConfig);
852
854
  getNodeHovered(): FlowNodeEntity | undefined;
853
855
  setNodeHovered(node: FlowNodeEntity | undefined): void;
856
+ get dragging(): boolean | undefined;
857
+ setDragging(dragging: boolean): void;
858
+ get isBranch(): boolean | undefined;
859
+ setIsBranch(isBranch: boolean): void;
854
860
  getDragLabelSide(): LABEL_SIDE_TYPE | undefined;
855
861
  setDragLabelSide(dragLabelSide?: LABEL_SIDE_TYPE): void;
856
862
  getNodeDroppingId(): string | undefined;
@@ -1314,7 +1320,6 @@ declare enum OperationType {
1314
1320
  moveChildNodes = "moveChildNodes",
1315
1321
  addNodes = "addNodes",
1316
1322
  deleteNodes = "deleteNodes",
1317
- changeNode = "changeNode",
1318
1323
  addChildNode = "addChildNode",
1319
1324
  deleteChildNode = "deleteChildNode",
1320
1325
  addNode = "addNode",
@@ -1384,16 +1389,6 @@ interface DeleteNodesOperation {
1384
1389
  type: OperationType.deleteNodes;
1385
1390
  value: AddOrDeleteNodesOperationValue;
1386
1391
  }
1387
- interface ChangeNodeOperationValue {
1388
- id: string;
1389
- path: string;
1390
- oldValue: any;
1391
- value: any;
1392
- }
1393
- interface ChangeNodeOperation {
1394
- type: OperationType.changeNode;
1395
- value: ChangeNodeOperationValue;
1396
- }
1397
1392
  interface MoveChildNodesOperationValue {
1398
1393
  nodeIds: string[];
1399
1394
  fromParentId: string;
@@ -1445,7 +1440,7 @@ interface AddOrDeleteNodeValue {
1445
1440
  index?: number;
1446
1441
  hidden?: boolean;
1447
1442
  }
1448
- type FlowOperation = AddFromNodeOperation | DeleteFromNodeOperation | AddBlockOperation | DeleteBlockOperation | CreateGroupOperation | UngroupOperation | MoveNodesOperation | AddNodesOperation | DeleteNodesOperation | ChangeNodeOperation | MoveBlockOperation | AddChildNodeOperation | DeleteChildNodeOperation | MoveChildNodesOperation | AddNodeOperation | DeleteNodeOperation;
1443
+ type FlowOperation = AddFromNodeOperation | DeleteFromNodeOperation | AddBlockOperation | DeleteBlockOperation | CreateGroupOperation | UngroupOperation | MoveNodesOperation | AddNodesOperation | DeleteNodesOperation | MoveBlockOperation | AddChildNodeOperation | DeleteChildNodeOperation | MoveChildNodesOperation | AddNodeOperation | DeleteNodeOperation;
1449
1444
  type FlowNodeEntityOrId = string | FlowNodeEntity;
1450
1445
  type AddNodeConfig = {
1451
1446
  parent?: FlowNodeEntityOrId;
@@ -1574,10 +1569,12 @@ declare class FlowDragService {
1574
1569
  protected onDropEmitter: Emitter<{
1575
1570
  dropNode: FlowNodeEntity;
1576
1571
  dragNodes: FlowNodeEntity[];
1572
+ dragJSON?: FlowNodeJSON;
1577
1573
  }>;
1578
1574
  readonly onDrop: _flowgram_ai_utils.Event<{
1579
1575
  dropNode: FlowNodeEntity;
1580
1576
  dragNodes: FlowNodeEntity[];
1577
+ dragJSON?: FlowNodeJSON;
1581
1578
  }>;
1582
1579
  get renderState(): FlowRendererStateEntity;
1583
1580
  get dragStartNode(): FlowNodeEntity;
@@ -1591,6 +1588,11 @@ declare class FlowDragService {
1591
1588
  * 放置到目标分支
1592
1589
  */
1593
1590
  dropBranch(): void;
1591
+ /**
1592
+ * 移动并且创建节点
1593
+ * Move and create node
1594
+ */
1595
+ dropCreateNode(json: FlowNodeJSON, onCreateNode?: (json: FlowNodeJSON, dropEntity: FlowNodeEntity) => Promise<FlowNodeEntity>): Promise<void>;
1594
1596
  /**
1595
1597
  * 移动到目标节点
1596
1598
  */
@@ -1717,4 +1719,4 @@ declare class FlowGroupService {
1717
1719
  */
1718
1720
  declare const getDefaultSpacing: (node: FlowNodeEntity, key: string, defaultSpacing?: number) => any;
1719
1721
 
1720
- export { type AddBlockConfig, type AddBlockOperation, type AddChildNodeOperation, type AddFromNodeOperation, type AddNodeConfig, type AddNodeData, type AddNodeOperation, type AddNodesOperation, type AddOrDeleteBlockValue, type AddOrDeleteChildNodeValue, type AddOrDeleteFromNodeOperationValue, type AddOrDeleteNodeOperationValue, type AddOrDeleteNodeValue, type AddOrDeleteNodesOperationValue, type AdderProps, type ChangeNodeOperation, type ChangeNodeOperationValue, type CollapseAdderProps, type CollapseProps, ConstantKeys, type CreateGroupOperation, type CustomLabelProps, DEFAULT_FLOW_NODE_META, DEFAULT_SIZE, DEFAULT_SPACING, DRAGGING_TYPE, DefaultSpacingKey, type DeleteBlockOperation, type DeleteChildNodeOperation, type DeleteFromNodeOperation, type DeleteNodeOperation, type DeleteNodesOperation, type DragNodeProps, FLOW_DEFAULT_HIDDEN_TYPES, FlowDocument, FlowDocumentConfig, FlowDocumentConfigDefaultData, FlowDocumentConfigEnum, FlowDocumentContainerModule, FlowDocumentContribution, type FlowDocumentJSON, FlowDocumentOptions, FlowDocumentOptionsDefault, FlowDocumentProvider, FlowDocumentTransformerEntity, FlowDragService, FlowGroupController, type FlowGroupJSON, FlowGroupService, FlowLayout, FlowLayoutContribution, FlowLayoutDefault, FlowNodeBaseType, FlowNodeEntity, type FlowNodeEntityConfig, type FlowNodeEntityOrId, type FlowNodeInitData, type FlowNodeJSON, type FlowNodeMeta, FlowNodeRegistry, FlowNodeRenderData, type FlowNodeRenderSchema, FlowNodeSplitType, FlowNodeTransformData, type FlowNodeTransformSchema, FlowNodeTransitionData, type FlowNodeTransitionSchema, type FlowNodeType, type FlowOperation, FlowOperationBaseService, FlowOperationBaseServiceImpl, FlowRendererStateEntity, type FlowTransitionLabel, FlowTransitionLabelEnum, type FlowTransitionLine, FlowTransitionLineEnum, FlowVirtualTree, LABEL_SIDE_TYPE, type MoveBlockOperation, type MoveBlockOperationValue, type MoveChildNodesOperation, type MoveChildNodesOperationValue, type MoveNodeConfig, type MoveNodesOperation, type MoveNodesOperationValue, type OnNodeAddEvent, type OnNodeMoveEvent, OperationType, type UngroupOperation, type Vertex, type createOrUngroupValue, drawLineToBottom, drawLineToNext, getDefaultSpacing };
1722
+ export { type AddBlockConfig, type AddBlockOperation, type AddChildNodeOperation, type AddFromNodeOperation, type AddNodeConfig, type AddNodeData, type AddNodeOperation, type AddNodesOperation, type AddOrDeleteBlockValue, type AddOrDeleteChildNodeValue, type AddOrDeleteFromNodeOperationValue, type AddOrDeleteNodeOperationValue, type AddOrDeleteNodeValue, type AddOrDeleteNodesOperationValue, type AdderProps, type CollapseAdderProps, type CollapseProps, ConstantKeys, type CreateGroupOperation, type CustomLabelProps, DEFAULT_FLOW_NODE_META, DEFAULT_SIZE, DEFAULT_SPACING, DRAGGING_TYPE, DefaultSpacingKey, type DeleteBlockOperation, type DeleteChildNodeOperation, type DeleteFromNodeOperation, type DeleteNodeOperation, type DeleteNodesOperation, type DragNodeProps, FLOW_DEFAULT_HIDDEN_TYPES, FlowDocument, FlowDocumentConfig, FlowDocumentConfigDefaultData, FlowDocumentConfigEnum, FlowDocumentContainerModule, FlowDocumentContribution, type FlowDocumentJSON, FlowDocumentOptions, FlowDocumentOptionsDefault, FlowDocumentProvider, FlowDocumentTransformerEntity, FlowDragService, FlowGroupController, type FlowGroupJSON, FlowGroupService, FlowLayout, FlowLayoutContribution, FlowLayoutDefault, FlowNodeBaseType, FlowNodeEntity, type FlowNodeEntityConfig, type FlowNodeEntityOrId, type FlowNodeInitData, type FlowNodeJSON, type FlowNodeMeta, FlowNodeRegistry, FlowNodeRenderData, type FlowNodeRenderSchema, FlowNodeSplitType, FlowNodeTransformData, type FlowNodeTransformSchema, FlowNodeTransitionData, type FlowNodeTransitionSchema, type FlowNodeType, type FlowOperation, FlowOperationBaseService, FlowOperationBaseServiceImpl, FlowRendererStateEntity, type FlowTransitionLabel, FlowTransitionLabelEnum, type FlowTransitionLine, FlowTransitionLineEnum, FlowVirtualTree, LABEL_SIDE_TYPE, type MoveBlockOperation, type MoveBlockOperationValue, type MoveChildNodesOperation, type MoveChildNodesOperationValue, type MoveNodeConfig, type MoveNodesOperation, type MoveNodesOperationValue, type OnNodeAddEvent, type OnNodeMoveEvent, OperationType, type UngroupOperation, type Vertex, type createOrUngroupValue, drawLineToBottom, drawLineToNext, getDefaultSpacing };
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
  */
@@ -841,6 +841,8 @@ interface FlowRendererState {
841
841
  nodeDragIds?: string[];
842
842
  nodeDragIdsWithChildren?: string[];
843
843
  dragLabelSide?: LABEL_SIDE_TYPE;
844
+ dragging?: boolean;
845
+ isBranch?: boolean;
844
846
  }
845
847
  /**
846
848
  * 渲染相关的全局状态管理
@@ -851,6 +853,10 @@ declare class FlowRendererStateEntity extends ConfigEntity<FlowRendererState, Fl
851
853
  constructor(conf: FlowRendererStateEntityConfig);
852
854
  getNodeHovered(): FlowNodeEntity | undefined;
853
855
  setNodeHovered(node: FlowNodeEntity | undefined): void;
856
+ get dragging(): boolean | undefined;
857
+ setDragging(dragging: boolean): void;
858
+ get isBranch(): boolean | undefined;
859
+ setIsBranch(isBranch: boolean): void;
854
860
  getDragLabelSide(): LABEL_SIDE_TYPE | undefined;
855
861
  setDragLabelSide(dragLabelSide?: LABEL_SIDE_TYPE): void;
856
862
  getNodeDroppingId(): string | undefined;
@@ -1314,7 +1320,6 @@ declare enum OperationType {
1314
1320
  moveChildNodes = "moveChildNodes",
1315
1321
  addNodes = "addNodes",
1316
1322
  deleteNodes = "deleteNodes",
1317
- changeNode = "changeNode",
1318
1323
  addChildNode = "addChildNode",
1319
1324
  deleteChildNode = "deleteChildNode",
1320
1325
  addNode = "addNode",
@@ -1384,16 +1389,6 @@ interface DeleteNodesOperation {
1384
1389
  type: OperationType.deleteNodes;
1385
1390
  value: AddOrDeleteNodesOperationValue;
1386
1391
  }
1387
- interface ChangeNodeOperationValue {
1388
- id: string;
1389
- path: string;
1390
- oldValue: any;
1391
- value: any;
1392
- }
1393
- interface ChangeNodeOperation {
1394
- type: OperationType.changeNode;
1395
- value: ChangeNodeOperationValue;
1396
- }
1397
1392
  interface MoveChildNodesOperationValue {
1398
1393
  nodeIds: string[];
1399
1394
  fromParentId: string;
@@ -1445,7 +1440,7 @@ interface AddOrDeleteNodeValue {
1445
1440
  index?: number;
1446
1441
  hidden?: boolean;
1447
1442
  }
1448
- type FlowOperation = AddFromNodeOperation | DeleteFromNodeOperation | AddBlockOperation | DeleteBlockOperation | CreateGroupOperation | UngroupOperation | MoveNodesOperation | AddNodesOperation | DeleteNodesOperation | ChangeNodeOperation | MoveBlockOperation | AddChildNodeOperation | DeleteChildNodeOperation | MoveChildNodesOperation | AddNodeOperation | DeleteNodeOperation;
1443
+ type FlowOperation = AddFromNodeOperation | DeleteFromNodeOperation | AddBlockOperation | DeleteBlockOperation | CreateGroupOperation | UngroupOperation | MoveNodesOperation | AddNodesOperation | DeleteNodesOperation | MoveBlockOperation | AddChildNodeOperation | DeleteChildNodeOperation | MoveChildNodesOperation | AddNodeOperation | DeleteNodeOperation;
1449
1444
  type FlowNodeEntityOrId = string | FlowNodeEntity;
1450
1445
  type AddNodeConfig = {
1451
1446
  parent?: FlowNodeEntityOrId;
@@ -1574,10 +1569,12 @@ declare class FlowDragService {
1574
1569
  protected onDropEmitter: Emitter<{
1575
1570
  dropNode: FlowNodeEntity;
1576
1571
  dragNodes: FlowNodeEntity[];
1572
+ dragJSON?: FlowNodeJSON;
1577
1573
  }>;
1578
1574
  readonly onDrop: _flowgram_ai_utils.Event<{
1579
1575
  dropNode: FlowNodeEntity;
1580
1576
  dragNodes: FlowNodeEntity[];
1577
+ dragJSON?: FlowNodeJSON;
1581
1578
  }>;
1582
1579
  get renderState(): FlowRendererStateEntity;
1583
1580
  get dragStartNode(): FlowNodeEntity;
@@ -1591,6 +1588,11 @@ declare class FlowDragService {
1591
1588
  * 放置到目标分支
1592
1589
  */
1593
1590
  dropBranch(): void;
1591
+ /**
1592
+ * 移动并且创建节点
1593
+ * Move and create node
1594
+ */
1595
+ dropCreateNode(json: FlowNodeJSON, onCreateNode?: (json: FlowNodeJSON, dropEntity: FlowNodeEntity) => Promise<FlowNodeEntity>): Promise<void>;
1594
1596
  /**
1595
1597
  * 移动到目标节点
1596
1598
  */
@@ -1717,4 +1719,4 @@ declare class FlowGroupService {
1717
1719
  */
1718
1720
  declare const getDefaultSpacing: (node: FlowNodeEntity, key: string, defaultSpacing?: number) => any;
1719
1721
 
1720
- export { type AddBlockConfig, type AddBlockOperation, type AddChildNodeOperation, type AddFromNodeOperation, type AddNodeConfig, type AddNodeData, type AddNodeOperation, type AddNodesOperation, type AddOrDeleteBlockValue, type AddOrDeleteChildNodeValue, type AddOrDeleteFromNodeOperationValue, type AddOrDeleteNodeOperationValue, type AddOrDeleteNodeValue, type AddOrDeleteNodesOperationValue, type AdderProps, type ChangeNodeOperation, type ChangeNodeOperationValue, type CollapseAdderProps, type CollapseProps, ConstantKeys, type CreateGroupOperation, type CustomLabelProps, DEFAULT_FLOW_NODE_META, DEFAULT_SIZE, DEFAULT_SPACING, DRAGGING_TYPE, DefaultSpacingKey, type DeleteBlockOperation, type DeleteChildNodeOperation, type DeleteFromNodeOperation, type DeleteNodeOperation, type DeleteNodesOperation, type DragNodeProps, FLOW_DEFAULT_HIDDEN_TYPES, FlowDocument, FlowDocumentConfig, FlowDocumentConfigDefaultData, FlowDocumentConfigEnum, FlowDocumentContainerModule, FlowDocumentContribution, type FlowDocumentJSON, FlowDocumentOptions, FlowDocumentOptionsDefault, FlowDocumentProvider, FlowDocumentTransformerEntity, FlowDragService, FlowGroupController, type FlowGroupJSON, FlowGroupService, FlowLayout, FlowLayoutContribution, FlowLayoutDefault, FlowNodeBaseType, FlowNodeEntity, type FlowNodeEntityConfig, type FlowNodeEntityOrId, type FlowNodeInitData, type FlowNodeJSON, type FlowNodeMeta, FlowNodeRegistry, FlowNodeRenderData, type FlowNodeRenderSchema, FlowNodeSplitType, FlowNodeTransformData, type FlowNodeTransformSchema, FlowNodeTransitionData, type FlowNodeTransitionSchema, type FlowNodeType, type FlowOperation, FlowOperationBaseService, FlowOperationBaseServiceImpl, FlowRendererStateEntity, type FlowTransitionLabel, FlowTransitionLabelEnum, type FlowTransitionLine, FlowTransitionLineEnum, FlowVirtualTree, LABEL_SIDE_TYPE, type MoveBlockOperation, type MoveBlockOperationValue, type MoveChildNodesOperation, type MoveChildNodesOperationValue, type MoveNodeConfig, type MoveNodesOperation, type MoveNodesOperationValue, type OnNodeAddEvent, type OnNodeMoveEvent, OperationType, type UngroupOperation, type Vertex, type createOrUngroupValue, drawLineToBottom, drawLineToNext, getDefaultSpacing };
1722
+ export { type AddBlockConfig, type AddBlockOperation, type AddChildNodeOperation, type AddFromNodeOperation, type AddNodeConfig, type AddNodeData, type AddNodeOperation, type AddNodesOperation, type AddOrDeleteBlockValue, type AddOrDeleteChildNodeValue, type AddOrDeleteFromNodeOperationValue, type AddOrDeleteNodeOperationValue, type AddOrDeleteNodeValue, type AddOrDeleteNodesOperationValue, type AdderProps, type CollapseAdderProps, type CollapseProps, ConstantKeys, type CreateGroupOperation, type CustomLabelProps, DEFAULT_FLOW_NODE_META, DEFAULT_SIZE, DEFAULT_SPACING, DRAGGING_TYPE, DefaultSpacingKey, type DeleteBlockOperation, type DeleteChildNodeOperation, type DeleteFromNodeOperation, type DeleteNodeOperation, type DeleteNodesOperation, type DragNodeProps, FLOW_DEFAULT_HIDDEN_TYPES, FlowDocument, FlowDocumentConfig, FlowDocumentConfigDefaultData, FlowDocumentConfigEnum, FlowDocumentContainerModule, FlowDocumentContribution, type FlowDocumentJSON, FlowDocumentOptions, FlowDocumentOptionsDefault, FlowDocumentProvider, FlowDocumentTransformerEntity, FlowDragService, FlowGroupController, type FlowGroupJSON, FlowGroupService, FlowLayout, FlowLayoutContribution, FlowLayoutDefault, FlowNodeBaseType, FlowNodeEntity, type FlowNodeEntityConfig, type FlowNodeEntityOrId, type FlowNodeInitData, type FlowNodeJSON, type FlowNodeMeta, FlowNodeRegistry, FlowNodeRenderData, type FlowNodeRenderSchema, FlowNodeSplitType, FlowNodeTransformData, type FlowNodeTransformSchema, FlowNodeTransitionData, type FlowNodeTransitionSchema, type FlowNodeType, type FlowOperation, FlowOperationBaseService, FlowOperationBaseServiceImpl, FlowRendererStateEntity, type FlowTransitionLabel, FlowTransitionLabelEnum, type FlowTransitionLine, FlowTransitionLineEnum, FlowVirtualTree, LABEL_SIDE_TYPE, type MoveBlockOperation, type MoveBlockOperationValue, type MoveChildNodesOperation, type MoveChildNodesOperationValue, type MoveNodeConfig, type MoveNodesOperation, type MoveNodesOperationValue, type OnNodeAddEvent, type OnNodeMoveEvent, OperationType, type UngroupOperation, type Vertex, type createOrUngroupValue, drawLineToBottom, drawLineToNext, getDefaultSpacing };
package/dist/index.js CHANGED
@@ -303,7 +303,6 @@ var OperationType = /* @__PURE__ */ ((OperationType2) => {
303
303
  OperationType2["moveChildNodes"] = "moveChildNodes";
304
304
  OperationType2["addNodes"] = "addNodes";
305
305
  OperationType2["deleteNodes"] = "deleteNodes";
306
- OperationType2["changeNode"] = "changeNode";
307
306
  OperationType2["addChildNode"] = "addChildNode";
308
307
  OperationType2["deleteChildNode"] = "deleteChildNode";
309
308
  OperationType2["addNode"] = "addNode";
@@ -348,13 +347,14 @@ var _FlowNodeRenderData = class _FlowNodeRenderData extends import_core.EntityDa
348
347
  stackIndex: 0
349
348
  };
350
349
  }
351
- updateExtInfo(info) {
352
- if (import_utils.Compare.isChanged(this.data.extInfo, info)) {
353
- const oldInfo = this.data.extInfo;
350
+ updateExtInfo(info, fullUpdate) {
351
+ const oldInfo = this.data.extInfo;
352
+ const newInfo = fullUpdate ? info : { ...oldInfo, ...info };
353
+ if (import_utils.Compare.isChanged(oldInfo, newInfo)) {
354
354
  this.update({
355
- extInfo: info
355
+ extInfo: newInfo
356
356
  });
357
- this.onExtInfoChangeEmitter.fire({ oldInfo, newInfo: info });
357
+ this.onExtInfoChangeEmitter.fire({ oldInfo, newInfo });
358
358
  }
359
359
  }
360
360
  getExtInfo() {
@@ -1100,8 +1100,8 @@ var FlowNodeEntity = class extends import_core4.Entity {
1100
1100
  * 修改节点扩展信息
1101
1101
  * @param info
1102
1102
  */
1103
- updateExtInfo(extInfo) {
1104
- this.getData(FlowNodeRenderData).updateExtInfo(extInfo);
1103
+ updateExtInfo(extInfo, fullUpdate) {
1104
+ this.getData(FlowNodeRenderData).updateExtInfo(extInfo, fullUpdate);
1105
1105
  }
1106
1106
  /**
1107
1107
  * 获取节点扩展信息
@@ -1253,6 +1253,22 @@ var FlowRendererStateEntity = class extends import_core6.ConfigEntity {
1253
1253
  nodeHoveredId: node?.id
1254
1254
  });
1255
1255
  }
1256
+ get dragging() {
1257
+ return this.config.dragging;
1258
+ }
1259
+ setDragging(dragging) {
1260
+ this.updateConfig({
1261
+ dragging
1262
+ });
1263
+ }
1264
+ get isBranch() {
1265
+ return this.config.isBranch;
1266
+ }
1267
+ setIsBranch(isBranch) {
1268
+ this.updateConfig({
1269
+ isBranch
1270
+ });
1271
+ }
1256
1272
  getDragLabelSide() {
1257
1273
  return this.config.dragLabelSide;
1258
1274
  }
@@ -2509,15 +2525,14 @@ var FlowDragService = class {
2509
2525
  }
2510
2526
  // 是否在拖拽分支
2511
2527
  get isDragBranch() {
2512
- return this.dragStartNode?.isInlineBlock;
2528
+ return this.renderState.isBranch || this.dragStartNode?.isInlineBlock;
2513
2529
  }
2514
2530
  // 拖拽的所有节点及其自节点
2515
2531
  get nodeDragIdsWithChildren() {
2516
2532
  return this.renderState.config.nodeDragIdsWithChildren || [];
2517
2533
  }
2518
2534
  get dragging() {
2519
- const renderData = this.dragStartNode?.getData(FlowNodeRenderData);
2520
- return !!renderData?.dragging;
2535
+ return !!this.renderState.dragging;
2521
2536
  }
2522
2537
  get labelSide() {
2523
2538
  return this.renderState.config.dragLabelSide;
@@ -2528,6 +2543,24 @@ var FlowDragService = class {
2528
2543
  dropBranch() {
2529
2544
  this.dropNode();
2530
2545
  }
2546
+ /**
2547
+ * 移动并且创建节点
2548
+ * Move and create node
2549
+ */
2550
+ async dropCreateNode(json, onCreateNode) {
2551
+ const dropEntity = this.document.getNode(this.dropNodeId);
2552
+ if (!dropEntity) {
2553
+ return;
2554
+ }
2555
+ if (json) {
2556
+ const dragNodes = await onCreateNode?.(json, dropEntity);
2557
+ this.onDropEmitter.fire({
2558
+ dropNode: dropEntity,
2559
+ dragNodes: dragNodes ? [dragNodes] : [],
2560
+ dragJSON: json
2561
+ });
2562
+ }
2563
+ }
2531
2564
  /**
2532
2565
  * 移动到目标节点
2533
2566
  */
@@ -2583,6 +2616,9 @@ var FlowDragService = class {
2583
2616
  * @param side 分支的前面还是后面
2584
2617
  */
2585
2618
  isDroppableBranch(node, side = "normal_branch" /* NORMAL_BRANCH */) {
2619
+ if (this.renderState.isBranch) {
2620
+ return true;
2621
+ }
2586
2622
  if (this.isDragBranch) {
2587
2623
  if (
2588
2624
  // 拖拽到分支