@likec4/core 1.45.0 → 1.46.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/builder/index.d.mts +8 -7
- package/dist/builder/index.mjs +6 -5
- package/dist/compute-view/index.d.mts +8 -7
- package/dist/compute-view/index.mjs +5 -5
- package/dist/compute-view/relationships-view/index.d.mts +8 -7
- package/dist/geometry/index.d.mts +109 -0
- package/dist/geometry/index.mjs +328 -0
- package/dist/index.d.mts +10 -8
- package/dist/index.mjs +9 -8
- package/dist/model/connection/deployment/index.d.mts +10 -9
- package/dist/model/connection/deployment/index.mjs +1 -1
- package/dist/model/connection/index.d.mts +11 -10
- package/dist/model/connection/index.mjs +1 -1
- package/dist/model/connection/model/index.d.mts +10 -9
- package/dist/model/index.d.mts +12 -11
- package/dist/model/index.mjs +2 -2
- package/dist/shared/{core.DnCLhN8C.d.mts → core.5gPDaaG5.d.mts} +5 -4
- package/dist/shared/{core.0zAQeenX.d.mts → core.9U0HL3oG.d.mts} +2 -2
- package/dist/shared/{core.M9ayqQZa.mjs → core.BK-tI3Q3.mjs} +2 -3
- package/dist/shared/{core.CpURdWRM.d.mts → core.BLG-ADpi.d.mts} +7 -6
- package/dist/shared/core.BPGOjone.d.mts +46 -0
- package/dist/shared/{core.DIE3F6sw.mjs → core.BYdtmqY5.mjs} +1 -2
- package/dist/shared/{core.B73yxfPi.d.mts → core.BkSYCfRg.d.mts} +1 -1
- package/dist/shared/{core.5ZQ-r3Oa.d.mts → core.BqtAzeAh.d.mts} +1 -1
- package/dist/shared/{core.DEieYfbG.mjs → core.BspBF3SJ.mjs} +22 -70
- package/dist/shared/{core.Cog93roC.d.mts → core.Byj60hH6.d.mts} +3 -3
- package/dist/shared/{core.CR3PmPzr.mjs → core.CBLX4mT8.mjs} +3811 -15032
- package/dist/shared/{core.DX-WYEPA.d.mts → core.CDdf8izT.d.mts} +4 -2
- package/dist/shared/core.CLSZtnFh.mjs +69 -0
- package/dist/shared/{core.t3qfsVvn.d.mts → core.CQYL_Z-_.d.mts} +3 -3
- package/dist/shared/{core.DrUt0Lbi.mjs → core.CmGY9blO.mjs} +198 -291
- package/dist/shared/{core.C_Ni6yHl.mjs → core.D0WZutNd.mjs} +3 -1
- package/dist/shared/{core.BGFjN3nv.d.mts → core.D4Y4U8Lp.d.mts} +3 -3
- package/dist/shared/{core.mUnpvHtA.d.mts → core.DE-g9oFF.d.mts} +19 -49
- package/dist/shared/{core.CWwSgOzF.mjs → core.DJpiszim.mjs} +48 -16
- package/dist/shared/{core.CRI1AjFj.mjs → core.DU8pv3Q6.mjs} +21 -19
- package/dist/shared/{core.D_f4F48-.mjs → core.DbQpDoJS.mjs} +2 -2
- package/dist/shared/{core.vzLtp8i3.mjs → core.Qv7vZIwZ.mjs} +1 -1
- package/dist/shared/{core.BuQZczj6.mjs → core.om36dXXW.mjs} +5 -2
- package/dist/shared/{core.Dvh1H0T2.d.mts → core.or6-EHsb.d.mts} +2 -2
- package/dist/shared/{core.DViDmiAu.mjs → core.xeuDd__E.mjs} +1 -2
- package/dist/styles/index.d.mts +7 -6
- package/dist/styles/index.mjs +1 -1
- package/dist/types/_aux.d.mts +2 -2
- package/dist/types/expression-model.d.mts +3 -3
- package/dist/types/expression.d.mts +3 -3
- package/dist/types/fqnRef.d.mts +2 -2
- package/dist/types/fqnRef.mjs +1 -1
- package/dist/types/index.d.mts +11 -9
- package/dist/types/index.mjs +6 -180
- package/dist/types/scalar.d.mts +1 -1
- package/dist/types/scalar.mjs +1 -1
- package/dist/utils/graphology/index.mjs +1 -1
- package/dist/utils/index.d.mts +3 -3
- package/dist/utils/index.mjs +5 -5
- package/dist/utils/iterable/index.d.mts +17 -1
- package/dist/utils/iterable/index.mjs +17 -1
- package/geometry/package.json +4 -0
- package/package.json +19 -11
- package/dist/shared/core.BR4zXDH-.mjs +0 -13
- package/dist/shared/core.BdPcbSkN.mjs +0 -118
package/dist/types/index.mjs
CHANGED
|
@@ -1,191 +1,17 @@
|
|
|
1
|
-
export { R as RichText, e as exact } from '../shared/core.
|
|
1
|
+
export { R as RichText, e as exact } from '../shared/core.BK-tI3Q3.mjs';
|
|
2
2
|
export { preferDescription, preferSummary } from './_aux.mjs';
|
|
3
3
|
export { b as _layout, _ as _stage, a as _type, j as isAndOperator, n as isComputedView, d as isDeployedInstance, c as isDeploymentNode, s as isDeploymentView, o as isDiagramView, t as isDynamicView, p as isElementView, r as isExtendsElementView, f as isKindEqual, o as isLayoutedView, h as isNotOperator, i as isOnStage, k as isOrOperator, g as isParticipantOperator, q as isScopedElementView, e as isTagEqual, l as isViewRulePredicate, m as isViewRuleStyle, w as whereOperatorAsPredicate } from '../shared/core.DH7TXqXf.mjs';
|
|
4
4
|
export { Expression, FqnExpr, RelationExpr } from './expression.mjs';
|
|
5
5
|
export { ModelExpression, ModelFqnExpr, ModelRelationExpr } from './expression-model.mjs';
|
|
6
6
|
export { FqnRef } from './fqnRef.mjs';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { e as
|
|
10
|
-
export {
|
|
11
|
-
export { g as getParallelStepsPrefix, b as isAutoLayoutDirection, d as isDynamicStep, e as isDynamicStepsParallel, f as isDynamicStepsSeries, c as isViewRuleAutoLayout, a as isViewRuleGlobalPredicateRef, i as isViewRuleGlobalStyle, h as isViewRuleGroup } from '../shared/core.BuQZczj6.mjs';
|
|
12
|
-
|
|
13
|
-
var BBox;
|
|
14
|
-
((BBox2) => {
|
|
15
|
-
function center({ x, y, width, height }) {
|
|
16
|
-
return {
|
|
17
|
-
x: x + width / 2,
|
|
18
|
-
y: y + height / 2
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
BBox2.center = center;
|
|
22
|
-
function toPoints({ x, y, width, height }) {
|
|
23
|
-
return [
|
|
24
|
-
{ x, y },
|
|
25
|
-
// Top left
|
|
26
|
-
{ x: x + width, y },
|
|
27
|
-
// Top right
|
|
28
|
-
{ x: x + width, y: y + height },
|
|
29
|
-
// Bottom right
|
|
30
|
-
{ x, y: y + height }
|
|
31
|
-
// Bottom left
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
BBox2.toPoints = toPoints;
|
|
35
|
-
function fromPoints(points) {
|
|
36
|
-
const { x1, y1, x2, y2 } = RectBox.fromPoints(points);
|
|
37
|
-
return {
|
|
38
|
-
x: x1,
|
|
39
|
-
y: y1,
|
|
40
|
-
width: x2 - x1,
|
|
41
|
-
height: y2 - y1
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
BBox2.fromPoints = fromPoints;
|
|
45
|
-
function merge(...boxes) {
|
|
46
|
-
invariant(t(boxes, 1), "No boxes provided");
|
|
47
|
-
if (boxes.length === 1) {
|
|
48
|
-
return boxes[0];
|
|
49
|
-
}
|
|
50
|
-
let minX = boxes[0].x;
|
|
51
|
-
let minY = boxes[0].y;
|
|
52
|
-
let maxX = boxes[0].x + boxes[0].width;
|
|
53
|
-
let maxY = boxes[0].y + boxes[0].height;
|
|
54
|
-
for (let i = 1; i < boxes.length; i++) {
|
|
55
|
-
const box = boxes[i];
|
|
56
|
-
minX = Math.min(minX, box.x);
|
|
57
|
-
minY = Math.min(minY, box.y);
|
|
58
|
-
maxX = Math.max(maxX, box.x + box.width);
|
|
59
|
-
maxY = Math.max(maxY, box.y + box.height);
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
x: Math.floor(minX),
|
|
63
|
-
y: Math.floor(minY),
|
|
64
|
-
width: Math.round(maxX - minX),
|
|
65
|
-
height: Math.round(maxY - minY)
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
BBox2.merge = merge;
|
|
69
|
-
function fromRectBox(rect) {
|
|
70
|
-
return {
|
|
71
|
-
x: Math.min(rect.x1, rect.x2),
|
|
72
|
-
y: Math.min(rect.y1, rect.y2),
|
|
73
|
-
width: Math.abs(rect.x2 - rect.x1),
|
|
74
|
-
height: Math.abs(rect.y2 - rect.y1)
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
BBox2.fromRectBox = fromRectBox;
|
|
78
|
-
function toRectBox(box) {
|
|
79
|
-
return {
|
|
80
|
-
x1: box.x,
|
|
81
|
-
y1: box.y,
|
|
82
|
-
x2: box.x + box.width,
|
|
83
|
-
y2: box.y + box.height
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
BBox2.toRectBox = toRectBox;
|
|
87
|
-
function expand(box, plus) {
|
|
88
|
-
if (plus === 0) {
|
|
89
|
-
return box;
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
x: box.x - plus,
|
|
93
|
-
y: box.y - plus,
|
|
94
|
-
width: box.width + plus * 2,
|
|
95
|
-
height: box.height + plus * 2
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
BBox2.expand = expand;
|
|
99
|
-
function shrink(box, minus) {
|
|
100
|
-
if (minus === 0) {
|
|
101
|
-
return box;
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
x: box.x + minus,
|
|
105
|
-
y: box.y + minus,
|
|
106
|
-
width: box.width - minus * 2,
|
|
107
|
-
height: box.height - minus * 2
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
BBox2.shrink = shrink;
|
|
111
|
-
function includes(a, b) {
|
|
112
|
-
if (a === b) {
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
return a.x <= b.x && a.y <= b.y && a.x + a.width >= b.x + b.width && a.y + a.height >= b.y + b.height;
|
|
116
|
-
}
|
|
117
|
-
BBox2.includes = includes;
|
|
118
|
-
})(BBox || (BBox = {}));
|
|
119
|
-
var RectBox;
|
|
120
|
-
((RectBox2) => {
|
|
121
|
-
function center({ x1, y1, x2, y2 }) {
|
|
122
|
-
return {
|
|
123
|
-
x: (x1 + x2) / 2,
|
|
124
|
-
y: (y1 + y2) / 2
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
RectBox2.center = center;
|
|
128
|
-
function fromPoints(points) {
|
|
129
|
-
invariant(points.length > 0, "At least one point is required");
|
|
130
|
-
let minX = Infinity;
|
|
131
|
-
let minY = Infinity;
|
|
132
|
-
let maxX = -Infinity;
|
|
133
|
-
let maxY = -Infinity;
|
|
134
|
-
for (const [x, y] of points) {
|
|
135
|
-
minX = Math.min(minX, x);
|
|
136
|
-
minY = Math.min(minY, y);
|
|
137
|
-
maxX = Math.max(maxX, x);
|
|
138
|
-
maxY = Math.max(maxY, y);
|
|
139
|
-
}
|
|
140
|
-
return {
|
|
141
|
-
x1: minX,
|
|
142
|
-
y1: minY,
|
|
143
|
-
x2: maxX,
|
|
144
|
-
y2: maxY
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
RectBox2.fromPoints = fromPoints;
|
|
148
|
-
function merge(...boxes) {
|
|
149
|
-
invariant(boxes.length > 0, "No boxes provided");
|
|
150
|
-
let minX = Infinity;
|
|
151
|
-
let minY = Infinity;
|
|
152
|
-
let maxX = -Infinity;
|
|
153
|
-
let maxY = -Infinity;
|
|
154
|
-
for (const box of boxes) {
|
|
155
|
-
minX = Math.min(minX, box.x1);
|
|
156
|
-
minY = Math.min(minY, box.y1);
|
|
157
|
-
maxX = Math.max(maxX, box.x2);
|
|
158
|
-
maxY = Math.max(maxY, box.y2);
|
|
159
|
-
}
|
|
160
|
-
return {
|
|
161
|
-
x1: minX,
|
|
162
|
-
y1: minY,
|
|
163
|
-
x2: maxX,
|
|
164
|
-
y2: maxY
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
RectBox2.merge = merge;
|
|
168
|
-
function toBBox(box) {
|
|
169
|
-
return {
|
|
170
|
-
x: box.x1,
|
|
171
|
-
y: box.y1,
|
|
172
|
-
width: box.x2 - box.x1,
|
|
173
|
-
height: box.y2 - box.y1
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
RectBox2.toBBox = toBBox;
|
|
177
|
-
function includes(a, b) {
|
|
178
|
-
if (a === b) {
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
return a.x1 <= b.x1 && a.y1 <= b.y1 && a.x2 >= b.x2 && a.y2 >= b.y2;
|
|
182
|
-
}
|
|
183
|
-
RectBox2.includes = includes;
|
|
184
|
-
})(RectBox || (RectBox = {}));
|
|
7
|
+
export { e as ensureSizes } from '../shared/core.BspBF3SJ.mjs';
|
|
8
|
+
export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, d as NodeId, N as NoneIcon, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, h as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, g as isStepEdgeId, s as scalar, c as splitGlobalFqn, e as stepEdgeId } from '../shared/core.D0WZutNd.mjs';
|
|
9
|
+
export { g as getParallelStepsPrefix, b as isAutoLayoutDirection, d as isDynamicStep, e as isDynamicStepsParallel, f as isDynamicStepsSeries, c as isViewRuleAutoLayout, a as isViewRuleGlobalPredicateRef, i as isViewRuleGlobalStyle, h as isViewRuleGroup, j as isViewRuleRank } from '../shared/core.om36dXXW.mjs';
|
|
10
|
+
export { BBox, RectBox, Vector, vector } from '../geometry/index.mjs';
|
|
185
11
|
|
|
186
12
|
function isTagColorSpecified(spec) {
|
|
187
13
|
const color = typeof spec === "string" ? spec : spec.color;
|
|
188
14
|
return color.startsWith("#") || color.startsWith("rgb");
|
|
189
15
|
}
|
|
190
16
|
|
|
191
|
-
export {
|
|
17
|
+
export { isTagColorSpecified };
|
package/dist/types/scalar.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'type-fest';
|
|
2
|
-
export { A as AnyFqn, B as BuiltInIcon, D as DeploymentFqn, b as DeploymentKind,
|
|
2
|
+
export { A as AnyFqn, B as BuiltInIcon, D as DeploymentFqn, b as DeploymentKind, k as EdgeId, E as ElementKind, F as Fqn, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, j as NodeId, N as NoneIcon, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, l as StepEdgeId, S as StepEdgeIdLiteral, n as StepEdgeKind, T as Tag, V as ViewId, p as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, o as isStepEdgeId, h as splitGlobalFqn, m as stepEdgeId } from '../shared/core.CDdf8izT.mjs';
|
package/dist/types/scalar.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../shared/core.CqAJJpK_.mjs';
|
|
2
2
|
import '../shared/core.BKlholso.mjs';
|
|
3
3
|
import '../shared/core.D4npX2q8.mjs';
|
|
4
|
-
export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind,
|
|
4
|
+
export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, d as NodeId, N as NoneIcon, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, h as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, g as isStepEdgeId, c as splitGlobalFqn, e as stepEdgeId } from '../shared/core.D0WZutNd.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { G as Graph } from '../../shared/core.
|
|
1
|
+
export { G as Graph } from '../../shared/core.CmGY9blO.mjs';
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { D as DefaultMap } from '../shared/core.CywrQs86.mjs';
|
|
2
|
-
export { B as BiMap, D as DefaultWeakMap, L as LinkedList, M as MultiMap, Q as Queue, a as ancestorsFqn, l as commonAncestor, o as compareByFqnHierarchically, q as compareFqnHierarchically, h as hasProp, r as hierarchyDistance, t as hierarchyLevel, i as invariant, b as isAncestor, v as isAnyOf, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, j as nonNullable, g as nonexhaustive, p as parentFqn, u as sortByFqnHierarchically, s as sortNaturalByFqn, k as sortParentsFirst } from '../shared/core.
|
|
2
|
+
export { B as BiMap, D as DefaultWeakMap, L as LinkedList, M as MultiMap, Q as Queue, a as ancestorsFqn, l as commonAncestor, o as compareByFqnHierarchically, q as compareFqnHierarchically, h as hasProp, r as hierarchyDistance, t as hierarchyLevel, i as invariant, b as isAncestor, v as isAnyOf, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, j as nonNullable, g as nonexhaustive, p as parentFqn, u as sortByFqnHierarchically, s as sortNaturalByFqn, k as sortParentsFirst } from '../shared/core.BqtAzeAh.mjs';
|
|
3
3
|
import { N as NonEmptyArray } from '../shared/core.DB0Ue5Wx.mjs';
|
|
4
|
-
export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isome, iunique, toArray, toSet } from './iterable/index.mjs';
|
|
4
|
+
export { ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, ireduce, isome, iunique, toArray, toSet } from './iterable/index.mjs';
|
|
5
5
|
export { i as isIterable } from '../shared/core.DXhDWKFZ.mjs';
|
|
6
|
-
import '../shared/core.
|
|
6
|
+
import '../shared/core.CDdf8izT.mjs';
|
|
7
7
|
import 'type-fest';
|
|
8
8
|
|
|
9
9
|
/**
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export { i as invariant, a as nonNullable, n as nonexhaustive } from '../shared/core.D4npX2q8.mjs';
|
|
2
|
-
export { S as Stack, c as commonHead, a as compareRelations, o as objectHash } from '../shared/core.
|
|
2
|
+
export { S as Stack, c as commonHead, a as compareRelations, o as objectHash } from '../shared/core.xeuDd__E.mjs';
|
|
3
3
|
export { c as compareNatural, b as compareNaturalHierarchically } from '../shared/core.3ZhnKAlZ.mjs';
|
|
4
4
|
export { a as ancestorsFqn, g as commonAncestor, j as compareByFqnHierarchically, k as compareFqnHierarchically, h as hasProp, l as hierarchyDistance, m as hierarchyLevel, i as isAncestor, q as isAnyOf, b as isDescendantOf, c as isNonEmptyArray, d as isSameHierarchy, e as isString, n as nameFromFqn, p as parentFqn, o as sortByFqnHierarchically, s as sortNaturalByFqn, f as sortParentsFirst } from '../shared/core.CdNCAwq7.mjs';
|
|
5
5
|
export { g as getOrCreate } from '../shared/core.DcS-0zys.mjs';
|
|
6
|
-
export { m as memoizeProp } from '../shared/core.
|
|
6
|
+
export { m as memoizeProp } from '../shared/core.CLSZtnFh.mjs';
|
|
7
7
|
export { d as difference, e as equalsSet, i as intersection, s as symmetricDifference, u as union } from '../shared/core.DbfO90vF.mjs';
|
|
8
8
|
export { s as stringHash } from '../shared/core.oSV6SRfk.mjs';
|
|
9
|
-
export { b as BiMap, d as DefaultWeakMap, l as LinkedList, m as MultiMap, q as Queue } from '../shared/core.
|
|
9
|
+
export { b as BiMap, d as DefaultWeakMap, l as LinkedList, m as MultiMap, q as Queue } from '../shared/core.BYdtmqY5.mjs';
|
|
10
10
|
export { D as DefaultMap } from '../shared/core.BbE4y-yl.mjs';
|
|
11
11
|
export { i as ifilter } from '../shared/core.DRJma0Ol.mjs';
|
|
12
12
|
export { i as ifind } from '../shared/core.CmPXpJ8l.mjs';
|
|
13
|
-
export { ifirst, ireduce } from './iterable/index.mjs';
|
|
13
|
+
export { ifirst, iflatMap, ireduce } from './iterable/index.mjs';
|
|
14
14
|
export { i as iflat, a as iunique } from '../shared/core.C4x8aaWa.mjs';
|
|
15
15
|
export { i as ihead } from '../shared/core.uFk_o9X6.mjs';
|
|
16
16
|
export { i as imap, a as toArray, t as toSet } from '../shared/core.C3JowhaZ.mjs';
|
|
17
17
|
export { i as isIterable } from '../shared/core.RfnaEmgA.mjs';
|
|
18
18
|
export { i as isome } from '../shared/core.FZ305VYd.mjs';
|
|
19
|
-
export { m as markdownToHtml, a as markdownToText } from '../shared/core.
|
|
19
|
+
export { m as markdownToHtml, a as markdownToText } from '../shared/core.CBLX4mT8.mjs';
|
|
20
20
|
|
|
21
21
|
function e(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInteger: The range [${e.toString()},${t.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}
|
|
22
22
|
|
|
@@ -58,6 +58,22 @@ declare function ifirst<T>(iterable: Iterable<T>, count: number): IteratorLike<T
|
|
|
58
58
|
declare function iflat(): <T>(iterable: Iterable<IteratorLike<T>>) => IteratorLike<T>;
|
|
59
59
|
declare function iflat<T>(iterable: Iterable<IteratorLike<T>>): IteratorLike<T>;
|
|
60
60
|
|
|
61
|
+
type FlatMapFunction<T, S> = (item: T) => Iterable<S>;
|
|
62
|
+
/**
|
|
63
|
+
* Maps an iterable using a mapper function and flattens the result by one level.
|
|
64
|
+
* Composable first version of `iflatMap`.
|
|
65
|
+
* @signature
|
|
66
|
+
* iflatMap(mapper)(data)
|
|
67
|
+
*/
|
|
68
|
+
declare function iflatMap<T, S>(mapper: FlatMapFunction<T, S>): (iterable: Iterable<T>) => IteratorLike<S>;
|
|
69
|
+
/**
|
|
70
|
+
* Maps an iterable using a mapper function and flattens the result by one level.
|
|
71
|
+
* Data first version of `iflatMap`.
|
|
72
|
+
* @signature
|
|
73
|
+
* iflatMap(data, mapper)
|
|
74
|
+
*/
|
|
75
|
+
declare function iflatMap<T, S>(iterable: Iterable<T>, mapper: FlatMapFunction<T, S>): IteratorLike<S>;
|
|
76
|
+
|
|
61
77
|
declare function ihead<T>(): (iterable: Iterable<T>) => T | undefined;
|
|
62
78
|
/**
|
|
63
79
|
* Finds the first element in the iterable that satisfies the predicate.
|
|
@@ -113,4 +129,4 @@ declare function toSet<T>(iterable: Iterable<T>): Set<T>;
|
|
|
113
129
|
declare function iunique(): <T>(iterable: Iterable<T>) => IteratorLike<T>;
|
|
114
130
|
declare function iunique<T>(iterable: Iterable<T>): IteratorLike<T>;
|
|
115
131
|
|
|
116
|
-
export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isome, iunique, toArray, toSet };
|
|
132
|
+
export { ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, ireduce, isome, iunique, toArray, toSet };
|
|
@@ -29,6 +29,22 @@ function ifirst(arg1, arg2) {
|
|
|
29
29
|
return _first(arg1);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
function iflatMap(arg1, arg2) {
|
|
33
|
+
const mapper = arg2 ?? arg1;
|
|
34
|
+
invariant(e(mapper));
|
|
35
|
+
function* _flatMap(iter) {
|
|
36
|
+
for (const value of iter) {
|
|
37
|
+
const mapped = mapper(value);
|
|
38
|
+
yield* mapped;
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (!arg2) {
|
|
43
|
+
return _flatMap;
|
|
44
|
+
}
|
|
45
|
+
return _flatMap(arg1);
|
|
46
|
+
}
|
|
47
|
+
|
|
32
48
|
function ireduce(arg1, arg2, arg3) {
|
|
33
49
|
const reducer = e$1(arg3) ? arg2 : arg1;
|
|
34
50
|
const initialValue = arg3 ?? arg2;
|
|
@@ -43,4 +59,4 @@ function ireduce(arg1, arg2, arg3) {
|
|
|
43
59
|
return e$1(arg3) ? _reduce(arg1) : _reduce;
|
|
44
60
|
}
|
|
45
61
|
|
|
46
|
-
export { ifirst, ireduce };
|
|
62
|
+
export { ifirst, iflatMap, ireduce };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.46.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -39,6 +39,14 @@
|
|
|
39
39
|
"default": "./dist/builder/index.mjs"
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
|
+
"./geometry": {
|
|
43
|
+
"sources": "./src/geometry/index.ts",
|
|
44
|
+
"default": {
|
|
45
|
+
"types": "./dist/geometry/index.d.mts",
|
|
46
|
+
"import": "./dist/geometry/index.mjs",
|
|
47
|
+
"default": "./dist/geometry/index.mjs"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
42
50
|
"./compute-view/relationships": {
|
|
43
51
|
"sources": "./src/compute-view/relationships-view/index.ts",
|
|
44
52
|
"default": {
|
|
@@ -105,20 +113,20 @@
|
|
|
105
113
|
"type-fest": "^4.41.0"
|
|
106
114
|
},
|
|
107
115
|
"devDependencies": {
|
|
108
|
-
"@dagrejs/dagre": "1.1.
|
|
116
|
+
"@dagrejs/dagre": "1.1.8",
|
|
109
117
|
"@mantine/colors-generator": "8.3.9",
|
|
110
118
|
"@types/chroma-js": "^3.1.2",
|
|
111
119
|
"@types/extend": "3.0.4",
|
|
112
120
|
"@types/hast": "3.0.4",
|
|
113
121
|
"@types/mdast": "4.0.4",
|
|
114
122
|
"@types/natural-compare-lite": "^1.4.2",
|
|
115
|
-
"@types/node": "~
|
|
123
|
+
"@types/node": "~22.19.1",
|
|
116
124
|
"@types/object-hash": "^3.0.6",
|
|
117
125
|
"@types/unist": "3.0.3",
|
|
118
|
-
"chroma-js": "^3.
|
|
126
|
+
"chroma-js": "^3.2.0",
|
|
119
127
|
"defu": "^6.1.4",
|
|
120
128
|
"fdir": "6.4.0",
|
|
121
|
-
"graphology": "^0.
|
|
129
|
+
"graphology": "^0.26.0",
|
|
122
130
|
"graphology-dag": "^0.4.1",
|
|
123
131
|
"graphology-types": "^0.24.8",
|
|
124
132
|
"immer": "^10.2.0",
|
|
@@ -128,22 +136,22 @@
|
|
|
128
136
|
"natural-compare-lite": "^1.4.0",
|
|
129
137
|
"object-hash": "^3.0.0",
|
|
130
138
|
"obliterator": "^2.0.5",
|
|
131
|
-
"oxlint": "1.
|
|
139
|
+
"oxlint": "1.31.0",
|
|
132
140
|
"rehype-format": "5.0.1",
|
|
133
|
-
"rehype-raw": "7.0.0",
|
|
134
141
|
"rehype-sanitize": "^6.0.0",
|
|
135
142
|
"rehype-stringify": "10.0.1",
|
|
136
143
|
"remark-gfm": "4.0.1",
|
|
144
|
+
"remark-github-blockquote-alert": "^2.0.0",
|
|
137
145
|
"remark-parse": "11.0.0",
|
|
138
146
|
"remark-rehype": "11.1.2",
|
|
139
147
|
"remeda": "^2.32.0",
|
|
140
|
-
"turbo": "2.6.
|
|
148
|
+
"turbo": "2.6.3",
|
|
141
149
|
"typescript": "5.9.3",
|
|
142
150
|
"unbuild": "3.5.0",
|
|
143
151
|
"unified": "11.0.5",
|
|
144
|
-
"vitest": "4.0.
|
|
145
|
-
"@likec4/
|
|
146
|
-
"@likec4/
|
|
152
|
+
"vitest": "4.0.15",
|
|
153
|
+
"@likec4/tsconfig": "1.46.0",
|
|
154
|
+
"@likec4/devops": "1.42.0"
|
|
147
155
|
},
|
|
148
156
|
"scripts": {
|
|
149
157
|
"typecheck": "tsc -b --verbose",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
function memoizeProp(obj, tag, fn) {
|
|
2
|
-
const tagSymbol = typeof tag === "symbol" ? tag : Symbol.for(tag);
|
|
3
|
-
if (!obj.hasOwnProperty(tagSymbol)) {
|
|
4
|
-
Object.defineProperty(obj, tagSymbol, {
|
|
5
|
-
enumerable: false,
|
|
6
|
-
writable: false,
|
|
7
|
-
value: fn()
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
return obj[tagSymbol];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { memoizeProp as m };
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
var support = {};
|
|
2
|
-
|
|
3
|
-
var hasRequiredSupport;
|
|
4
|
-
|
|
5
|
-
function requireSupport () {
|
|
6
|
-
if (hasRequiredSupport) return support;
|
|
7
|
-
hasRequiredSupport = 1;
|
|
8
|
-
support.ARRAY_BUFFER_SUPPORT = typeof ArrayBuffer !== 'undefined';
|
|
9
|
-
support.SYMBOL_SUPPORT = typeof Symbol !== 'undefined';
|
|
10
|
-
return support;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Obliterator Iterator Class
|
|
15
|
-
* ===========================
|
|
16
|
-
*
|
|
17
|
-
* Simple class representing the library's iterators.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
var iterator;
|
|
21
|
-
var hasRequiredIterator;
|
|
22
|
-
|
|
23
|
-
function requireIterator () {
|
|
24
|
-
if (hasRequiredIterator) return iterator;
|
|
25
|
-
hasRequiredIterator = 1;
|
|
26
|
-
/**
|
|
27
|
-
* Iterator class.
|
|
28
|
-
*
|
|
29
|
-
* @constructor
|
|
30
|
-
* @param {function} next - Next function.
|
|
31
|
-
*/
|
|
32
|
-
function Iterator(next) {
|
|
33
|
-
if (typeof next !== 'function')
|
|
34
|
-
throw new Error('obliterator/iterator: expecting a function!');
|
|
35
|
-
|
|
36
|
-
this.next = next;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* If symbols are supported, we add `next` to `Symbol.iterator`.
|
|
41
|
-
*/
|
|
42
|
-
if (typeof Symbol !== 'undefined')
|
|
43
|
-
Iterator.prototype[Symbol.iterator] = function () {
|
|
44
|
-
return this;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Returning an iterator of the given values.
|
|
49
|
-
*
|
|
50
|
-
* @param {any...} values - Values.
|
|
51
|
-
* @return {Iterator}
|
|
52
|
-
*/
|
|
53
|
-
Iterator.of = function () {
|
|
54
|
-
var args = arguments,
|
|
55
|
-
l = args.length,
|
|
56
|
-
i = 0;
|
|
57
|
-
|
|
58
|
-
return new Iterator(function () {
|
|
59
|
-
if (i >= l) return {done: true};
|
|
60
|
-
|
|
61
|
-
return {done: false, value: args[i++]};
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Returning an empty iterator.
|
|
67
|
-
*
|
|
68
|
-
* @return {Iterator}
|
|
69
|
-
*/
|
|
70
|
-
Iterator.empty = function () {
|
|
71
|
-
var iterator = new Iterator(function () {
|
|
72
|
-
return {done: true};
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
return iterator;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Returning an iterator over the given indexed sequence.
|
|
80
|
-
*
|
|
81
|
-
* @param {string|Array} sequence - Target sequence.
|
|
82
|
-
* @return {Iterator}
|
|
83
|
-
*/
|
|
84
|
-
Iterator.fromSequence = function (sequence) {
|
|
85
|
-
var i = 0,
|
|
86
|
-
l = sequence.length;
|
|
87
|
-
|
|
88
|
-
return new Iterator(function () {
|
|
89
|
-
if (i >= l) return {done: true};
|
|
90
|
-
|
|
91
|
-
return {done: false, value: sequence[i++]};
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Returning whether the given value is an iterator.
|
|
97
|
-
*
|
|
98
|
-
* @param {any} value - Value.
|
|
99
|
-
* @return {boolean}
|
|
100
|
-
*/
|
|
101
|
-
Iterator.is = function (value) {
|
|
102
|
-
if (value instanceof Iterator) return true;
|
|
103
|
-
|
|
104
|
-
return (
|
|
105
|
-
typeof value === 'object' &&
|
|
106
|
-
value !== null &&
|
|
107
|
-
typeof value.next === 'function'
|
|
108
|
-
);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Exporting.
|
|
113
|
-
*/
|
|
114
|
-
iterator = Iterator;
|
|
115
|
-
return iterator;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export { requireSupport as a, requireIterator as r };
|