@bpmnkit/core 0.0.27 → 0.1.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/bpmn/auto-layout.js +39 -126
- package/dist/bpmn/bpmn-builder.d.ts +30 -0
- package/dist/bpmn/bpmn-builder.js +350 -31
- package/dist/bpmn/bpmn-model.d.ts +35 -2
- package/dist/bpmn/bpmn-parser.js +39 -1
- package/dist/bpmn/bpmn-serializer.js +27 -0
- package/dist/bpmn/compact.js +11 -1
- package/dist/bpmn/di-check.d.ts +14 -0
- package/dist/bpmn/di-check.js +51 -0
- package/dist/bpmn/di-planes.d.ts +13 -0
- package/dist/bpmn/di-planes.js +20 -0
- package/dist/bpmn/optimize/tasks.js +1 -0
- package/dist/bpmn/svg.js +36 -4
- package/dist/bpmn/type-guards.d.ts +7 -1
- package/dist/bpmn/type-guards.js +13 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -1
- package/dist/layout/annotations.d.ts +27 -0
- package/dist/layout/annotations.js +251 -0
- package/dist/layout/grid/edge-labels.d.ts +8 -0
- package/dist/layout/grid/edge-labels.js +126 -0
- package/dist/layout/grid/flow-graph.d.ts +25 -0
- package/dist/layout/grid/flow-graph.js +99 -0
- package/dist/layout/grid/grid-engine.d.ts +4 -0
- package/dist/layout/grid/grid-engine.js +214 -0
- package/dist/layout/grid/grid-router.d.ts +36 -0
- package/dist/layout/grid/grid-router.js +190 -0
- package/dist/layout/grid/grid.d.ts +43 -0
- package/dist/layout/grid/grid.js +174 -0
- package/dist/layout/grid/walker.d.ts +11 -0
- package/dist/layout/grid/walker.js +126 -0
- package/dist/layout/index.d.ts +2 -5
- package/dist/layout/index.js +1 -4
- package/dist/layout/layout-engine.d.ts +5 -15
- package/dist/layout/layout-engine.js +8 -486
- package/dist/layout/types.js +4 -0
- package/dist/xml/xml-parser.js +5 -0
- package/package.json +1 -1
- package/dist/layout/astar.d.ts +0 -15
- package/dist/layout/astar.js +0 -191
- package/dist/layout/block-builder.d.ts +0 -37
- package/dist/layout/block-builder.js +0 -154
- package/dist/layout/block-layout.d.ts +0 -9
- package/dist/layout/block-layout.js +0 -163
- package/dist/layout/coordinates.d.ts +0 -85
- package/dist/layout/coordinates.js +0 -1392
- package/dist/layout/crossing.d.ts +0 -8
- package/dist/layout/crossing.js +0 -60
- package/dist/layout/graph.d.ts +0 -28
- package/dist/layout/graph.js +0 -126
- package/dist/layout/layers.d.ts +0 -13
- package/dist/layout/layers.js +0 -49
- package/dist/layout/routing.d.ts +0 -33
- package/dist/layout/routing.js +0 -622
- package/dist/layout/subprocess.d.ts +0 -14
- package/dist/layout/subprocess.js +0 -115
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { BpmnElementType, BpmnFlowElement } from "../bpmn/bpmn-model.js";
|
|
2
|
-
import type { BackEdge, DirectedGraph } from "./graph.js";
|
|
3
|
-
import type { LayoutNode } from "./types.js";
|
|
4
|
-
/** Get the fixed size for a BPMN element type. */
|
|
5
|
-
export declare function getElementSize(type: BpmnElementType): {
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Assign x,y coordinates to all nodes based on a virtual grid.
|
|
11
|
-
* Each grid cell is GRID_CELL_WIDTH × GRID_CELL_HEIGHT.
|
|
12
|
-
* Elements are centered within their grid cell.
|
|
13
|
-
* If an element is larger than a single cell, adjacent cells are merged.
|
|
14
|
-
*/
|
|
15
|
-
export declare function assignCoordinates(orderedLayers: string[][], nodeIndex: Map<string, BpmnFlowElement>): LayoutNode[];
|
|
16
|
-
/**
|
|
17
|
-
* Re-assign x-coordinates after sub-process expansion.
|
|
18
|
-
* Walks layers left-to-right, shifting each layer to avoid overlap with the previous one.
|
|
19
|
-
*/
|
|
20
|
-
export declare function reassignXCoordinates(layoutNodes: LayoutNode[], orderedLayers: string[][]): void;
|
|
21
|
-
/**
|
|
22
|
-
* Align nodes in linear sequences to a common y-baseline.
|
|
23
|
-
* A "linear" node has ≤1 predecessor and ≤1 successor, and is not a gateway.
|
|
24
|
-
* Walks forward from each chain root, setting successors to the same center-y.
|
|
25
|
-
* Crosses split/join gateway pairs to align the full branch spine.
|
|
26
|
-
*/
|
|
27
|
-
export declare function alignBranchBaselines(layoutNodes: LayoutNode[], dag: DirectedGraph): void;
|
|
28
|
-
/**
|
|
29
|
-
* Align split/join gateway pairs to the same y-coordinate.
|
|
30
|
-
* A split gateway fans out to multiple successors; the corresponding join gateway
|
|
31
|
-
* is the nearest downstream gateway where all branches reconverge.
|
|
32
|
-
*/
|
|
33
|
-
export declare function alignSplitJoinPairs(layoutNodes: LayoutNode[], dag: DirectedGraph, backEdges?: BackEdge[]): void;
|
|
34
|
-
/**
|
|
35
|
-
* Ensure early-return branches (shorter paths from split to join) are never on the baseline.
|
|
36
|
-
* The baseline is the split gateway's center-y. If the shortest branch sits on the baseline,
|
|
37
|
-
* swap it with a longer branch.
|
|
38
|
-
*/
|
|
39
|
-
export declare function ensureEarlyReturnOffBaseline(layoutNodes: LayoutNode[], dag: DirectedGraph, backEdges?: BackEdge[]): void;
|
|
40
|
-
/**
|
|
41
|
-
* Find the baseline path — the "spine" of the process that all paths share.
|
|
42
|
-
* At split gateways, jumps directly to the corresponding join gateway.
|
|
43
|
-
* Returns the ordered list of node IDs on the baseline.
|
|
44
|
-
*/
|
|
45
|
-
export declare function findBaselinePath(layoutNodes: LayoutNode[], dag: DirectedGraph, backEdges?: BackEdge[]): string[];
|
|
46
|
-
/**
|
|
47
|
-
* Align all nodes on the baseline path to the same center-Y.
|
|
48
|
-
* Uses the first node's (start event) center-Y as the baseline.
|
|
49
|
-
*/
|
|
50
|
-
export declare function alignBaselinePath(layoutNodes: LayoutNode[], dag: DirectedGraph, backEdges?: BackEdge[]): void;
|
|
51
|
-
/**
|
|
52
|
-
* Distribute branches of split gateways symmetrically around the gateway center Y.
|
|
53
|
-
* Pass 1: multi-branch gateways (2+) — symmetric distribution.
|
|
54
|
-
* Pass 2: single-branch gateways — placed one full grid row away, with peer-aware gap enforcement.
|
|
55
|
-
*/
|
|
56
|
-
export declare function distributeSplitBranches(layoutNodes: LayoutNode[], dag: DirectedGraph, backEdges?: BackEdge[]): void;
|
|
57
|
-
/**
|
|
58
|
-
* Assign integer grid-row indices to all nodes based on their final center-Y positions.
|
|
59
|
-
* Nodes whose center-Y values are within EPSILON pixels are placed in the same row.
|
|
60
|
-
* This eliminates pixel-tolerance guessing in port-side decisions: two nodes with the
|
|
61
|
-
* same gridRow are on the same horizontal row and should connect left-to-right.
|
|
62
|
-
*
|
|
63
|
-
* Called once, after ALL coordinate adjustments, just before edge routing.
|
|
64
|
-
*/
|
|
65
|
-
export declare function assignGridRows(layoutNodes: LayoutNode[]): void;
|
|
66
|
-
/**
|
|
67
|
-
* Snap nodes to common Y rows for matrix-like alignment.
|
|
68
|
-
* Groups nodes that share a CY (from alignment passes), then merges
|
|
69
|
-
* close groups into a single row — moving entire groups as units.
|
|
70
|
-
* Boundary events are excluded (they are repositioned later).
|
|
71
|
-
*/
|
|
72
|
-
export declare function snapToYRows(layoutNodes: LayoutNode[]): void;
|
|
73
|
-
/**
|
|
74
|
-
* Pull each branch subtree toward the baseline, closing unnecessary vertical gaps.
|
|
75
|
-
* Uses per-element 2D collision detection — only actual element-to-element overlaps
|
|
76
|
-
* constrain the movement, not the branch's full bounding box.
|
|
77
|
-
*/
|
|
78
|
-
export declare function compactBranches(layoutNodes: LayoutNode[], dag: DirectedGraph, backEdges?: BackEdge[]): void;
|
|
79
|
-
/**
|
|
80
|
-
* Resolve overlaps within each layer by pushing nodes apart.
|
|
81
|
-
* Sorts nodes by Y within each layer and ensures minimum gap.
|
|
82
|
-
* Also normalizes coordinates so no node has negative Y.
|
|
83
|
-
*/
|
|
84
|
-
export declare function resolveLayerOverlaps(layoutNodes: LayoutNode[]): void;
|
|
85
|
-
//# sourceMappingURL=coordinates.d.ts.map
|