@html-graph/html-graph 2.1.0 → 2.2.0

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.
@@ -360,6 +360,10 @@ export declare class Graph {
360
360
  getPort(portId: unknown): GraphPort | null;
361
361
  getAllPortIds(): readonly unknown[];
362
362
  getNodePortIds(nodeId: unknown): readonly unknown[] | null;
363
+ /**
364
+ * @deprecated
365
+ * use graph.getPort()?.nodeId ?? null instead
366
+ */
363
367
  getPortNodeId(portId: unknown): unknown | null;
364
368
  getAllEdgeIds(): readonly unknown[];
365
369
  getEdge(edgeId: unknown): GraphEdge | null;
@@ -398,8 +402,6 @@ export declare interface GraphPort {
398
402
  declare class GraphStore {
399
403
  private readonly nodes;
400
404
  private readonly ports;
401
- private readonly nodePorts;
402
- private readonly portNodeId;
403
405
  private readonly edges;
404
406
  private readonly incommingEdges;
405
407
  private readonly outcommingEdges;
@@ -412,7 +414,6 @@ declare class GraphStore {
412
414
  getPort(portId: unknown): PortPayload | undefined;
413
415
  getAllPortIds(): readonly unknown[];
414
416
  getNodePortIds(nodeId: unknown): readonly unknown[] | undefined;
415
- getPortNodeId(portId: unknown): unknown | undefined;
416
417
  removePort(portId: unknown): void;
417
418
  addEdge(request: AddEdgeRequest_2): void;
418
419
  updateEdgeFrom(edgeId: unknown, from: unknown): void;
@@ -502,11 +503,12 @@ export declare interface NodeDragPayload {
502
503
  }
503
504
 
504
505
  declare interface NodePayload {
505
- element: HTMLElement;
506
+ readonly element: HTMLElement;
506
507
  x: number;
507
508
  y: number;
508
509
  centerFn: CenterFn;
509
510
  priority: number;
511
+ readonly ports: Map<unknown, HTMLElement>;
510
512
  }
511
513
 
512
514
  export declare interface PatchMatrixRequest {
@@ -535,6 +537,7 @@ export declare interface Point {
535
537
  declare interface PortPayload {
536
538
  readonly element: HTMLElement;
537
539
  direction: number;
540
+ readonly nodeId: unknown;
538
541
  }
539
542
 
540
543
  declare type Priority = ConstantPriority | IncrementalPriority | CustomPriority;
@@ -731,7 +734,7 @@ declare type VerticalEdgeShapeConfig = {
731
734
  */
732
735
  export declare class Viewport {
733
736
  private readonly transformer;
734
- constructor(transformer: ViewportTransformer);
737
+ constructor(transformer: ViewportStore);
735
738
  getViewportMatrix(): TransformState;
736
739
  getContentMatrix(): TransformState;
737
740
  }
@@ -739,7 +742,7 @@ export declare class Viewport {
739
742
  /**
740
743
  * This entity is responsible for storing viewport transformation
741
744
  */
742
- declare class ViewportTransformer {
745
+ declare class ViewportStore {
743
746
  private viewportMatrix;
744
747
  private contentMatrix;
745
748
  private readonly emitter;