@likec4/core 0.51.0 → 0.53.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.
- package/dist/cjs/types/_common.d.ts +1 -1
- package/dist/cjs/types/diagram.d.ts +2 -1
- package/dist/cjs/utils/fqn.d.ts +1 -1
- package/dist/cjs/utils/fqn.js +13 -4
- package/dist/cjs/utils/relations.js +8 -1
- package/dist/esm/types/_common.d.ts +1 -1
- package/dist/esm/types/diagram.d.ts +2 -1
- package/dist/esm/utils/fqn.d.ts +1 -1
- package/dist/esm/utils/fqn.js +10 -4
- package/dist/esm/utils/relations.js +8 -1
- package/dist/types/types/_common.d.ts +1 -1
- package/dist/types/types/diagram.d.ts +2 -1
- package/dist/types/utils/fqn.d.ts +1 -1
- package/package.json +4 -4
|
@@ -24,12 +24,13 @@ export interface DiagramNode extends ComputedNode {
|
|
|
24
24
|
};
|
|
25
25
|
labels: DiagramLabel[];
|
|
26
26
|
position: Point;
|
|
27
|
-
depth?: number;
|
|
28
27
|
}
|
|
29
28
|
export interface DiagramEdge extends ComputedEdge {
|
|
30
29
|
points: NonEmptyArray<Point>;
|
|
31
30
|
headArrow?: NonEmptyArray<Point>;
|
|
31
|
+
headArrowPoint?: Point;
|
|
32
32
|
tailArrow?: NonEmptyArray<Point>;
|
|
33
|
+
tailArrowPoint?: Point;
|
|
33
34
|
labels?: NonEmptyArray<DiagramLabel>;
|
|
34
35
|
labelBBox?: BBox;
|
|
35
36
|
}
|
package/dist/cjs/utils/fqn.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare function ancestorsFqn(fqn: Fqn): Fqn[];
|
|
|
27
27
|
* - Positive number if a is deeper than b.
|
|
28
28
|
* - Negative number if b is deeper than a.
|
|
29
29
|
*/
|
|
30
|
-
export declare function compareFqnHierarchically(a:
|
|
30
|
+
export declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
|
|
31
31
|
export declare function compareByFqnHierarchically<T extends {
|
|
32
32
|
id: Fqn;
|
|
33
33
|
}>(a: T, b: T): number;
|
package/dist/cjs/utils/fqn.js
CHANGED
|
@@ -82,10 +82,19 @@ function ancestorsFqn(fqn) {
|
|
|
82
82
|
function compareFqnHierarchically(a, b) {
|
|
83
83
|
const depthA = a.split(".").length;
|
|
84
84
|
const depthB = b.split(".").length;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
switch (true) {
|
|
86
|
+
case depthA > depthB:
|
|
87
|
+
{
|
|
88
|
+
return 1;
|
|
89
|
+
}
|
|
90
|
+
case depthA < depthB:
|
|
91
|
+
{
|
|
92
|
+
return -1;
|
|
93
|
+
}
|
|
94
|
+
default:
|
|
95
|
+
{
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
89
98
|
}
|
|
90
99
|
}
|
|
91
100
|
function compareByFqnHierarchically(a, b) {
|
|
@@ -16,7 +16,14 @@ const compareRelations = (a, b) => {
|
|
|
16
16
|
return -1;
|
|
17
17
|
}
|
|
18
18
|
const compareParents = parentA && parentB ? (0, _fqn.compareFqnHierarchically)(parentA, parentB) : 0;
|
|
19
|
-
|
|
19
|
+
if (compareParents === 0) {
|
|
20
|
+
const compareSource = (0, _fqn.compareFqnHierarchically)(a.source, b.source);
|
|
21
|
+
if (compareSource !== 0) {
|
|
22
|
+
return compareSource;
|
|
23
|
+
}
|
|
24
|
+
return (0, _fqn.compareFqnHierarchically)(a.target, b.target);
|
|
25
|
+
}
|
|
26
|
+
return compareParents;
|
|
20
27
|
};
|
|
21
28
|
exports.compareRelations = compareRelations;
|
|
22
29
|
const isInside = parent => {
|
|
@@ -24,12 +24,13 @@ export interface DiagramNode extends ComputedNode {
|
|
|
24
24
|
};
|
|
25
25
|
labels: DiagramLabel[];
|
|
26
26
|
position: Point;
|
|
27
|
-
depth?: number;
|
|
28
27
|
}
|
|
29
28
|
export interface DiagramEdge extends ComputedEdge {
|
|
30
29
|
points: NonEmptyArray<Point>;
|
|
31
30
|
headArrow?: NonEmptyArray<Point>;
|
|
31
|
+
headArrowPoint?: Point;
|
|
32
32
|
tailArrow?: NonEmptyArray<Point>;
|
|
33
|
+
tailArrowPoint?: Point;
|
|
33
34
|
labels?: NonEmptyArray<DiagramLabel>;
|
|
34
35
|
labelBBox?: BBox;
|
|
35
36
|
}
|
package/dist/esm/utils/fqn.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare function ancestorsFqn(fqn: Fqn): Fqn[];
|
|
|
27
27
|
* - Positive number if a is deeper than b.
|
|
28
28
|
* - Negative number if b is deeper than a.
|
|
29
29
|
*/
|
|
30
|
-
export declare function compareFqnHierarchically(a:
|
|
30
|
+
export declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
|
|
31
31
|
export declare function compareByFqnHierarchically<T extends {
|
|
32
32
|
id: Fqn;
|
|
33
33
|
}>(a: T, b: T): number;
|
package/dist/esm/utils/fqn.js
CHANGED
|
@@ -67,10 +67,16 @@ export function ancestorsFqn(fqn) {
|
|
|
67
67
|
export function compareFqnHierarchically(a, b) {
|
|
68
68
|
const depthA = a.split(".").length;
|
|
69
69
|
const depthB = b.split(".").length;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
switch (true) {
|
|
71
|
+
case depthA > depthB: {
|
|
72
|
+
return 1;
|
|
73
|
+
}
|
|
74
|
+
case depthA < depthB: {
|
|
75
|
+
return -1;
|
|
76
|
+
}
|
|
77
|
+
default: {
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
74
80
|
}
|
|
75
81
|
}
|
|
76
82
|
export function compareByFqnHierarchically(a, b) {
|
|
@@ -10,7 +10,14 @@ export const compareRelations = (a, b) => {
|
|
|
10
10
|
return -1;
|
|
11
11
|
}
|
|
12
12
|
const compareParents = parentA && parentB ? compareFqnHierarchically(parentA, parentB) : 0;
|
|
13
|
-
|
|
13
|
+
if (compareParents === 0) {
|
|
14
|
+
const compareSource = compareFqnHierarchically(a.source, b.source);
|
|
15
|
+
if (compareSource !== 0) {
|
|
16
|
+
return compareSource;
|
|
17
|
+
}
|
|
18
|
+
return compareFqnHierarchically(a.target, b.target);
|
|
19
|
+
}
|
|
20
|
+
return compareParents;
|
|
14
21
|
};
|
|
15
22
|
const isInside = (parent) => {
|
|
16
23
|
const prefix = parent + ".";
|
|
@@ -24,12 +24,13 @@ export interface DiagramNode extends ComputedNode {
|
|
|
24
24
|
};
|
|
25
25
|
labels: DiagramLabel[];
|
|
26
26
|
position: Point;
|
|
27
|
-
depth?: number;
|
|
28
27
|
}
|
|
29
28
|
export interface DiagramEdge extends ComputedEdge {
|
|
30
29
|
points: NonEmptyArray<Point>;
|
|
31
30
|
headArrow?: NonEmptyArray<Point>;
|
|
31
|
+
headArrowPoint?: Point;
|
|
32
32
|
tailArrow?: NonEmptyArray<Point>;
|
|
33
|
+
tailArrowPoint?: Point;
|
|
33
34
|
labels?: NonEmptyArray<DiagramLabel>;
|
|
34
35
|
labelBBox?: BBox;
|
|
35
36
|
}
|
|
@@ -27,7 +27,7 @@ export declare function ancestorsFqn(fqn: Fqn): Fqn[];
|
|
|
27
27
|
* - Positive number if a is deeper than b.
|
|
28
28
|
* - Negative number if b is deeper than a.
|
|
29
29
|
*/
|
|
30
|
-
export declare function compareFqnHierarchically(a:
|
|
30
|
+
export declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
|
|
31
31
|
export declare function compareByFqnHierarchically<T extends {
|
|
32
32
|
id: Fqn;
|
|
33
33
|
}>(a: T, b: T): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -78,15 +78,15 @@
|
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"rambdax": "^9.1.1",
|
|
81
|
-
"remeda": "^1.
|
|
81
|
+
"remeda": "^1.30.0",
|
|
82
82
|
"safe-stable-stringify": "^2.4.3",
|
|
83
83
|
"ts-custom-error": "^3.3.1"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"execa": "^8.0.1",
|
|
87
|
-
"typescript": "^5.3.
|
|
87
|
+
"typescript": "^5.3.3",
|
|
88
88
|
"unbuild": "^2.0.0",
|
|
89
|
-
"vitest": "^1.
|
|
89
|
+
"vitest": "^1.1.3"
|
|
90
90
|
},
|
|
91
91
|
"packageManager": "yarn@4.0.2",
|
|
92
92
|
"volta": {
|