@likec4/core 1.19.1 → 1.20.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.cjs +881 -0
- package/dist/builder/index.d.cts +503 -0
- package/dist/builder/index.d.mts +5 -4
- package/dist/builder/index.d.ts +5 -4
- package/dist/builder/{index.js → index.mjs} +14 -4
- package/dist/compute-view/index.cjs +86 -0
- package/dist/compute-view/index.d.cts +23 -0
- package/dist/compute-view/index.d.mts +3 -2
- package/dist/compute-view/index.d.ts +3 -2
- package/dist/compute-view/{index.js → index.mjs} +6 -5
- package/dist/index.cjs +4320 -0
- package/dist/index.d.cts +270 -0
- package/dist/index.d.mts +130 -4
- package/dist/index.d.ts +130 -4
- package/dist/{index.js → index.mjs} +512 -7
- package/dist/model/index.cjs +40 -0
- package/dist/model/index.d.cts +259 -0
- package/dist/model/index.d.mts +8 -3
- package/dist/model/index.d.ts +8 -3
- package/dist/model/index.mjs +1 -0
- package/dist/shared/core.B2QYWlYe.cjs +435 -0
- package/dist/shared/core.B72vUaNB.d.cts +850 -0
- package/dist/shared/core.BGus30EM.cjs +8027 -0
- package/dist/shared/core.BRuJ3Wzf.d.mts +12 -0
- package/dist/shared/{core.BZ9Msq7w.d.mts → core.BdbFkE_p.d.cts} +14 -4
- package/dist/shared/core.BvdNMbcA.d.cts +12 -0
- package/dist/shared/{object_hash.CE_oF3I3.js → core.BxvDITEI.mjs} +26 -389
- package/dist/shared/core.ByNgh-mC.d.cts +127 -0
- package/dist/shared/core.C9DCnJh8.cjs +908 -0
- package/dist/shared/{index.DafVOuVd.js → core.CqCTxzMY.mjs} +1111 -572
- package/dist/shared/core.D74xkKkG.d.cts +148 -0
- package/dist/shared/{core.C05RDLhi.d.ts → core.D_Gc58Gt.d.ts} +23 -5
- package/dist/shared/core.Damrzla-.d.ts +12 -0
- package/dist/shared/{core.CmYMqgha.d.mts → core.Dfzrh1VA.d.mts} +23 -5
- package/dist/shared/core.DsoCu540.cjs +26 -0
- package/dist/shared/{view.CyZrG8BJ.js → core.DunIMHRf.mjs} +27 -1
- package/dist/shared/{core.BIfgabEw.d.ts → core.ZWiGANIJ.d.ts} +14 -4
- package/dist/shared/core.gv1bMwCC.cjs +39 -0
- package/dist/shared/core.jy6z2iRn.d.mts +729 -0
- package/dist/shared/core.m3rCQAv6.mjs +37 -0
- package/dist/types/index.cjs +107 -0
- package/dist/types/index.d.cts +72 -0
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/{index.js → index.mjs} +1 -1
- package/dist/utils/index.cjs +95 -0
- package/dist/utils/index.d.cts +356 -0
- package/dist/utils/index.d.mts +1 -64
- package/dist/utils/index.d.ts +1 -64
- package/dist/utils/index.mjs +56 -0
- package/package.json +52 -26
- package/src/builder/Builder.view-common.ts +21 -1
- package/src/compute-view/deployment-view/__test__/fixture.ts +31 -3
- package/src/compute-view/deployment-view/_types.ts +2 -1
- package/src/compute-view/deployment-view/compute.ts +4 -36
- package/src/compute-view/deployment-view/predicates/index.ts +8 -0
- package/src/compute-view/deployment-view/predicates/relation-direct.ts +125 -99
- package/src/compute-view/deployment-view/predicates/relation-in-out.ts +16 -8
- package/src/compute-view/deployment-view/predicates/relation-incoming.ts +18 -12
- package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +16 -9
- package/src/compute-view/deployment-view/predicates/relation-where.ts +18 -0
- package/src/compute-view/deployment-view/predicates/utils.ts +214 -0
- package/src/compute-view/element-view/__test__/fixture.ts +17 -4
- package/src/compute-view/element-view/compute.ts +3 -2
- package/src/compute-view/element-view/predicates.ts +520 -0
- package/src/compute-view/element-view/utils.ts +11 -7
- package/src/compute-view/index.ts +1 -0
- package/src/compute-view/relationships-view/_types.ts +16 -0
- package/src/compute-view/relationships-view/compute.ts +74 -0
- package/src/compute-view/relationships-view/layout.ts +357 -0
- package/src/compute-view/relationships-view/utils.ts +40 -0
- package/src/compute-view/utils/relationExpressionToPredicates.ts +11 -4
- package/src/index.ts +16 -0
- package/src/model/DeploymentElementModel.ts +18 -1
- package/src/model/ElementModel.ts +13 -0
- package/src/model/LikeC4Model.ts +2 -2
- package/src/model/RelationModel.ts +9 -0
- package/src/model/connection/deployment/DeploymentConnectionModel.ts +11 -1
- package/src/model/guards.ts +17 -1
- package/src/model/view/LikeC4ViewModel.ts +7 -1
- package/src/model/view/NodeModel.ts +5 -0
- package/src/types/deployments.ts +1 -0
- package/src/types/expression-v2.ts +12 -0
- package/src/types/index.ts +1 -0
- package/src/types/operators.ts +46 -6
- package/src/types/view.ts +2 -2
- package/src/utils/index.ts +0 -5
- package/src/utils/iterable/unique.ts +1 -7
- package/dist/model/index.js +0 -1
- package/dist/utils/index.js +0 -347
- /package/dist/shared/{chunk-RAAYCPUM.M-JWF7SS.js → core.M-JWF7SS.mjs} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { t as toSet, i as ifind } from './core.BxvDITEI.mjs';
|
|
2
|
+
|
|
3
|
+
function computeRelationshipsView(subjectId, likec4model) {
|
|
4
|
+
const subject = likec4model.element(subjectId);
|
|
5
|
+
let relationships = {
|
|
6
|
+
incoming: [...subject.incoming()],
|
|
7
|
+
outgoing: [...subject.outgoing()]
|
|
8
|
+
};
|
|
9
|
+
const subjectSiblings = toSet(subject.ascendingSiblings());
|
|
10
|
+
const isSubjectSibling = (e) => subjectSiblings.has(e);
|
|
11
|
+
const subjects = /* @__PURE__ */ new Set([subject]);
|
|
12
|
+
const incomers = new Set(relationships.incoming.flatMap((r) => {
|
|
13
|
+
subjects.add(r.target);
|
|
14
|
+
if (subjectSiblings.has(r.source)) {
|
|
15
|
+
return [r.source];
|
|
16
|
+
}
|
|
17
|
+
const parent = ifind(r.source.ancestors(), isSubjectSibling);
|
|
18
|
+
return parent ? [r.source, parent] : [r.source];
|
|
19
|
+
}));
|
|
20
|
+
const outgoers = new Set(relationships.outgoing.flatMap((r) => {
|
|
21
|
+
subjects.add(r.source);
|
|
22
|
+
if (subjectSiblings.has(r.target)) {
|
|
23
|
+
return [r.target];
|
|
24
|
+
}
|
|
25
|
+
const parent = ifind(r.target.ancestors(), isSubjectSibling);
|
|
26
|
+
return parent ? [r.target, parent] : [r.target];
|
|
27
|
+
}));
|
|
28
|
+
return {
|
|
29
|
+
incomers,
|
|
30
|
+
incoming: new Set(relationships.incoming),
|
|
31
|
+
subjects,
|
|
32
|
+
outgoing: new Set(relationships.outgoing),
|
|
33
|
+
outgoers
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { computeRelationshipsView as c };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const view = require('../shared/core.B2QYWlYe.cjs');
|
|
4
|
+
|
|
5
|
+
const ThemeColors = [
|
|
6
|
+
"amber",
|
|
7
|
+
"blue",
|
|
8
|
+
"gray",
|
|
9
|
+
"slate",
|
|
10
|
+
"green",
|
|
11
|
+
"indigo",
|
|
12
|
+
"muted",
|
|
13
|
+
"primary",
|
|
14
|
+
"red",
|
|
15
|
+
"secondary",
|
|
16
|
+
"sky"
|
|
17
|
+
];
|
|
18
|
+
function isThemeColor(color) {
|
|
19
|
+
return color in ThemeColors;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.AsFqn = view.AsFqn;
|
|
23
|
+
exports.BorderStyles = view.BorderStyles;
|
|
24
|
+
Object.defineProperty(exports, "ComputedNode", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return view.ComputedNode; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "ComputedView", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return view.ComputedView; }
|
|
31
|
+
});
|
|
32
|
+
exports.DefaultArrowType = view.DefaultArrowType;
|
|
33
|
+
exports.DefaultElementShape = view.DefaultElementShape;
|
|
34
|
+
exports.DefaultLineStyle = view.DefaultLineStyle;
|
|
35
|
+
exports.DefaultRelationshipColor = view.DefaultRelationshipColor;
|
|
36
|
+
exports.DefaultThemeColor = view.DefaultThemeColor;
|
|
37
|
+
Object.defineProperty(exports, "DeploymentElement", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return view.DeploymentElement; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "DiagramNode", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return view.DiagramNode; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "ElementKind", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return view.ElementKind; }
|
|
48
|
+
});
|
|
49
|
+
exports.ElementShapes = view.ElementShapes;
|
|
50
|
+
Object.defineProperty(exports, "ExpressionV2", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () { return view.ExpressionV2; }
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "FqnExpr", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () { return view.FqnExpr; }
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, "FqnRef", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return view.FqnRef; }
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "RelationExpr", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () { return view.RelationExpr; }
|
|
65
|
+
});
|
|
66
|
+
exports.extractStep = view.extractStep;
|
|
67
|
+
exports.getBBoxCenter = view.getBBoxCenter;
|
|
68
|
+
exports.getParallelStepsPrefix = view.getParallelStepsPrefix;
|
|
69
|
+
exports.isAndOperator = view.isAndOperator;
|
|
70
|
+
exports.isAutoLayoutDirection = view.isAutoLayoutDirection;
|
|
71
|
+
exports.isCustomElement = view.isCustomElement;
|
|
72
|
+
exports.isCustomRelationExpr = view.isCustomRelationExpr;
|
|
73
|
+
exports.isDeploymentView = view.isDeploymentView;
|
|
74
|
+
exports.isDynamicView = view.isDynamicView;
|
|
75
|
+
exports.isDynamicViewParallelSteps = view.isDynamicViewParallelSteps;
|
|
76
|
+
exports.isElement = view.isElement;
|
|
77
|
+
exports.isElementKindExpr = view.isElementKindExpr;
|
|
78
|
+
exports.isElementPredicateExpr = view.isElementPredicateExpr;
|
|
79
|
+
exports.isElementRef = view.isElementRef;
|
|
80
|
+
exports.isElementTagExpr = view.isElementTagExpr;
|
|
81
|
+
exports.isElementView = view.isElementView;
|
|
82
|
+
exports.isElementWhere = view.isElementWhere;
|
|
83
|
+
exports.isExpandedElementExpr = view.isExpandedElementExpr;
|
|
84
|
+
exports.isExtendsElementView = view.isExtendsElementView;
|
|
85
|
+
exports.isInOut = view.isInOut;
|
|
86
|
+
exports.isIncoming = view.isIncoming;
|
|
87
|
+
exports.isKindEqual = view.isKindEqual;
|
|
88
|
+
exports.isNotOperator = view.isNotOperator;
|
|
89
|
+
exports.isOrOperator = view.isOrOperator;
|
|
90
|
+
exports.isOutgoing = view.isOutgoing;
|
|
91
|
+
exports.isRelation = view.isRelation;
|
|
92
|
+
exports.isRelationExpression = view.isRelationExpression;
|
|
93
|
+
exports.isRelationPredicateExpr = view.isRelationPredicateExpr;
|
|
94
|
+
exports.isRelationWhere = view.isRelationWhere;
|
|
95
|
+
exports.isScopedElementView = view.isScopedElementView;
|
|
96
|
+
exports.isStepEdgeId = view.isStepEdgeId;
|
|
97
|
+
exports.isTagEqual = view.isTagEqual;
|
|
98
|
+
exports.isViewRuleAutoLayout = view.isViewRuleAutoLayout;
|
|
99
|
+
exports.isViewRuleGlobalPredicateRef = view.isViewRuleGlobalPredicateRef;
|
|
100
|
+
exports.isViewRuleGlobalStyle = view.isViewRuleGlobalStyle;
|
|
101
|
+
exports.isViewRuleGroup = view.isViewRuleGroup;
|
|
102
|
+
exports.isViewRulePredicate = view.isViewRulePredicate;
|
|
103
|
+
exports.isViewRuleStyle = view.isViewRuleStyle;
|
|
104
|
+
exports.isWildcard = view.isWildcard;
|
|
105
|
+
exports.stepEdgeId = view.stepEdgeId;
|
|
106
|
+
exports.whereOperatorAsPredicate = view.whereOperatorAsPredicate;
|
|
107
|
+
exports.isThemeColor = isThemeColor;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { X as XYPoint, N as NonEmptyArray, P as Point, h as BorderStyle, l as ElementShape, x as ThemeColor, F as Fqn } from '../shared/core.D74xkKkG.cjs';
|
|
2
|
+
export { A as AsFqn, B as BorderStyles, s as Color, t as ColorLiteral, C as CustomColor, D as DefaultElementShape, e as DefaultThemeColor, i as Element, f as ElementKind, j as ElementKindSpecification, k as ElementKindSpecificationStyle, g as ElementShapes, m as ElementStyle, v as ElementThemeColorValues, u as ElementThemeColors, E as ExclusiveUnion, H as HexColorLiteral, I as IconUrl, a as IteratorLike, K as KeysOf, L as LikeC4Theme, n as Link, c as NTuple, b as NonEmptyReadonlyArray, d as Predicate, w as RelationshipThemeColorValues, R as RelationshipThemeColors, o as Tag, p as TagSpec, T as ThemeColorValues, q as TypedElement, r as isThemeColor } from '../shared/core.D74xkKkG.cjs';
|
|
3
|
+
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.B72vUaNB.cjs';
|
|
4
|
+
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, a as ComputedLikeC4Model, az as ComputedNode, C as ComputedView, a$ as CustomColorDefinitions, A as CustomElementExpr, B as CustomRelationExpr, ap as DefaultArrowType, aq as DefaultLineStyle, ar as DefaultRelationshipColor, b as DeployedInstance, D as DeploymentElement, c as DeploymentElementStyle, d as DeploymentNode, f as DeploymentNodeKind, g as DeploymentNodeKindSpecification, h as DeploymentRef, i as DeploymentRelation, b0 as DeploymentView, b1 as DeploymentViewRule, b2 as DeploymentViewRulePredicate, b3 as DeploymentViewRuleStyle, b4 as DiagramEdge, aA as DiagramNode, b5 as DiagramView, E as DirectRelationExpr, b6 as DynamicView, b7 as DynamicViewIncludeRule, b8 as DynamicViewParallelSteps, b9 as DynamicViewRule, ba as DynamicViewStep, bb as DynamicViewStepOrParallel, bc as EdgeId, F as ElementExpression, G as ElementKindExpr, bw as ElementNotation, H as ElementPredicateExpression, I as ElementRefExpr, J as ElementTagExpr, bd as ElementView, K as ElementWhereExpr, ah as EqualOperator, M as ExpandedElementExpr, N as Expression, X as ExpressionV2, be as ExtendsElementView, ai as Filterable, Y as FqnExpr, Z as FqnRef, a6 as GenericLikeC4Model, $ as GlobalDynamicPredicates, a0 as GlobalPredicateId, a1 as GlobalPredicates, a2 as GlobalStyleID, a3 as GlobalStyles, Q as InOutExpr, O as IncomingExpr, aj as KindEqual, a7 as LayoutedLikeC4Model, a8 as LikeC4ModelDump, L as LikeC4View, a4 as ModelGlobals, at as ModelRelation, bf as NodeId, R as NonWilcard, ak as NotOperator, al as OperatorPredicate, am as OrOperator, S as OutgoingExpr, a9 as ParsedLikeC4Model, P as PredicateSelector, _ as RelationExpr, T as RelationExpression, au as RelationId, U as RelationPredicateExpression, V as RelationWhereExpr, av as RelationshipArrowType, aw as RelationshipKind, ax as RelationshipKindSpecification, ay as RelationshipLineType, bg as ScopedElementView, bh as StepEdgeId, bi as StepEdgeIdLiteral, an as TagEqual, bj as ViewAutoLayout, bm as ViewRule, bn as ViewRuleAutoLayout, bo as ViewRuleGlobalPredicateRef, bp as ViewRuleGlobalStyle, bq as ViewRuleGroup, br as ViewRulePredicate, bs as ViewRuleStyle, bt as ViewRuleStyleOrGlobalRef, bu as ViewWithHash, bv as ViewWithNotation, ao as WhereOperator, W as WildcardExpr, aB as extractStep, aC as getBBoxCenter, aD as getParallelStepsPrefix, aa as isAndOperator, aE as isAutoLayoutDirection, j as isCustomElement, k as isCustomRelationExpr, aF as isDeploymentView, aG as isDynamicView, aH as isDynamicViewParallelSteps, l as isElement, m as isElementKindExpr, n as isElementPredicateExpr, o as isElementRef, p as isElementTagExpr, aI as isElementView, q as isElementWhere, r as isExpandedElementExpr, aJ as isExtendsElementView, t as isInOut, s as isIncoming, ab as isKindEqual, ac as isNotOperator, ad as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, aK as isScopedElementView, aL as isStepEdgeId, ae as isTagEqual, aM as isViewRuleAutoLayout, aN as isViewRuleGlobalPredicateRef, aO as isViewRuleGlobalStyle, aP as isViewRuleGroup, aQ as isViewRulePredicate, aR as isViewRuleStyle, z as isWildcard, aS as stepEdgeId, af as whereOperatorAsPredicate } from '../shared/core.B72vUaNB.cjs';
|
|
5
|
+
import 'type-fest';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* OverviewGraph is a graph representation of all views in a model
|
|
9
|
+
*/
|
|
10
|
+
declare namespace OverviewGraph {
|
|
11
|
+
type Node = {
|
|
12
|
+
id: string;
|
|
13
|
+
type: 'folder' | 'file';
|
|
14
|
+
path: string;
|
|
15
|
+
label: string;
|
|
16
|
+
parentId: string | null;
|
|
17
|
+
position: XYPoint;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
} | {
|
|
21
|
+
id: string;
|
|
22
|
+
type: 'view';
|
|
23
|
+
viewId: ViewId;
|
|
24
|
+
label: string;
|
|
25
|
+
parentId: string | null;
|
|
26
|
+
position: XYPoint;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Edge represents a navigational link from one view to another
|
|
32
|
+
*/
|
|
33
|
+
type Edge = {
|
|
34
|
+
id: string;
|
|
35
|
+
source: string;
|
|
36
|
+
target: string;
|
|
37
|
+
points: NonEmptyArray<Point>;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
interface OverviewGraph {
|
|
41
|
+
nodes: OverviewGraph.Node[];
|
|
42
|
+
edges: OverviewGraph.Edge[];
|
|
43
|
+
bounds: BBox;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare namespace ViewChange {
|
|
47
|
+
interface ChangeElementStyle {
|
|
48
|
+
op: 'change-element-style';
|
|
49
|
+
style: {
|
|
50
|
+
border?: BorderStyle;
|
|
51
|
+
opacity?: number;
|
|
52
|
+
shape?: ElementShape;
|
|
53
|
+
color?: ThemeColor;
|
|
54
|
+
};
|
|
55
|
+
targets: NonEmptyArray<Fqn>;
|
|
56
|
+
}
|
|
57
|
+
interface SaveManualLayout {
|
|
58
|
+
op: 'save-manual-layout';
|
|
59
|
+
layout: ViewManualLayout;
|
|
60
|
+
}
|
|
61
|
+
interface ChangeAutoLayout {
|
|
62
|
+
op: 'change-autolayout';
|
|
63
|
+
layout: {
|
|
64
|
+
direction: AutoLayoutDirection;
|
|
65
|
+
nodeSep?: number | null;
|
|
66
|
+
rankSep?: number | null;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
|
|
71
|
+
|
|
72
|
+
export { AutoLayoutDirection, BBox, BorderStyle, ElementShape, Fqn, NonEmptyArray, OverviewGraph, Point, ThemeColor, ViewChange, ViewId, ViewManualLayout, XYPoint };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { X as XYPoint, N as NonEmptyArray, P as Point, h as BorderStyle, l as ElementShape, x as ThemeColor, F as Fqn } from '../shared/core.D74xkKkG.mjs';
|
|
2
2
|
export { A as AsFqn, B as BorderStyles, s as Color, t as ColorLiteral, C as CustomColor, D as DefaultElementShape, e as DefaultThemeColor, i as Element, f as ElementKind, j as ElementKindSpecification, k as ElementKindSpecificationStyle, g as ElementShapes, m as ElementStyle, v as ElementThemeColorValues, u as ElementThemeColors, E as ExclusiveUnion, H as HexColorLiteral, I as IconUrl, a as IteratorLike, K as KeysOf, L as LikeC4Theme, n as Link, c as NTuple, b as NonEmptyReadonlyArray, d as Predicate, w as RelationshipThemeColorValues, R as RelationshipThemeColors, o as Tag, p as TagSpec, T as ThemeColorValues, q as TypedElement, r as isThemeColor } from '../shared/core.D74xkKkG.mjs';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
3
|
+
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.Dfzrh1VA.mjs';
|
|
4
|
+
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, a as ComputedLikeC4Model, az as ComputedNode, C as ComputedView, a$ as CustomColorDefinitions, A as CustomElementExpr, B as CustomRelationExpr, ap as DefaultArrowType, aq as DefaultLineStyle, ar as DefaultRelationshipColor, b as DeployedInstance, D as DeploymentElement, c as DeploymentElementStyle, d as DeploymentNode, f as DeploymentNodeKind, g as DeploymentNodeKindSpecification, h as DeploymentRef, i as DeploymentRelation, b0 as DeploymentView, b1 as DeploymentViewRule, b2 as DeploymentViewRulePredicate, b3 as DeploymentViewRuleStyle, b4 as DiagramEdge, aA as DiagramNode, b5 as DiagramView, E as DirectRelationExpr, b6 as DynamicView, b7 as DynamicViewIncludeRule, b8 as DynamicViewParallelSteps, b9 as DynamicViewRule, ba as DynamicViewStep, bb as DynamicViewStepOrParallel, bc as EdgeId, F as ElementExpression, G as ElementKindExpr, bw as ElementNotation, H as ElementPredicateExpression, I as ElementRefExpr, J as ElementTagExpr, bd as ElementView, K as ElementWhereExpr, ah as EqualOperator, M as ExpandedElementExpr, N as Expression, X as ExpressionV2, be as ExtendsElementView, ai as Filterable, Y as FqnExpr, Z as FqnRef, a6 as GenericLikeC4Model, $ as GlobalDynamicPredicates, a0 as GlobalPredicateId, a1 as GlobalPredicates, a2 as GlobalStyleID, a3 as GlobalStyles, Q as InOutExpr, O as IncomingExpr, aj as KindEqual, a7 as LayoutedLikeC4Model, a8 as LikeC4ModelDump, L as LikeC4View, a4 as ModelGlobals, at as ModelRelation, bf as NodeId, R as NonWilcard, ak as NotOperator, al as OperatorPredicate, am as OrOperator, S as OutgoingExpr, a9 as ParsedLikeC4Model, P as PredicateSelector, _ as RelationExpr, T as RelationExpression, au as RelationId, U as RelationPredicateExpression, V as RelationWhereExpr, av as RelationshipArrowType, aw as RelationshipKind, ax as RelationshipKindSpecification, ay as RelationshipLineType, bg as ScopedElementView, bh as StepEdgeId, bi as StepEdgeIdLiteral, an as TagEqual, bj as ViewAutoLayout, bm as ViewRule, bn as ViewRuleAutoLayout, bo as ViewRuleGlobalPredicateRef, bp as ViewRuleGlobalStyle, bq as ViewRuleGroup, br as ViewRulePredicate, bs as ViewRuleStyle, bt as ViewRuleStyleOrGlobalRef, bu as ViewWithHash, bv as ViewWithNotation, ao as WhereOperator, W as WildcardExpr, aB as extractStep, aC as getBBoxCenter, aD as getParallelStepsPrefix, aa as isAndOperator, aE as isAutoLayoutDirection, j as isCustomElement, k as isCustomRelationExpr, aF as isDeploymentView, aG as isDynamicView, aH as isDynamicViewParallelSteps, l as isElement, m as isElementKindExpr, n as isElementPredicateExpr, o as isElementRef, p as isElementTagExpr, aI as isElementView, q as isElementWhere, r as isExpandedElementExpr, aJ as isExtendsElementView, t as isInOut, s as isIncoming, ab as isKindEqual, ac as isNotOperator, ad as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, aK as isScopedElementView, aL as isStepEdgeId, ae as isTagEqual, aM as isViewRuleAutoLayout, aN as isViewRuleGlobalPredicateRef, aO as isViewRuleGlobalStyle, aP as isViewRuleGroup, aQ as isViewRulePredicate, aR as isViewRuleStyle, z as isWildcard, aS as stepEdgeId, af as whereOperatorAsPredicate } from '../shared/core.Dfzrh1VA.mjs';
|
|
5
5
|
import 'type-fest';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { X as XYPoint, N as NonEmptyArray, P as Point, h as BorderStyle, l as ElementShape, x as ThemeColor, F as Fqn } from '../shared/core.D74xkKkG.js';
|
|
2
2
|
export { A as AsFqn, B as BorderStyles, s as Color, t as ColorLiteral, C as CustomColor, D as DefaultElementShape, e as DefaultThemeColor, i as Element, f as ElementKind, j as ElementKindSpecification, k as ElementKindSpecificationStyle, g as ElementShapes, m as ElementStyle, v as ElementThemeColorValues, u as ElementThemeColors, E as ExclusiveUnion, H as HexColorLiteral, I as IconUrl, a as IteratorLike, K as KeysOf, L as LikeC4Theme, n as Link, c as NTuple, b as NonEmptyReadonlyArray, d as Predicate, w as RelationshipThemeColorValues, R as RelationshipThemeColors, o as Tag, p as TagSpec, T as ThemeColorValues, q as TypedElement, r as isThemeColor } from '../shared/core.D74xkKkG.js';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
3
|
+
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.D_Gc58Gt.js';
|
|
4
|
+
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, a as ComputedLikeC4Model, az as ComputedNode, C as ComputedView, a$ as CustomColorDefinitions, A as CustomElementExpr, B as CustomRelationExpr, ap as DefaultArrowType, aq as DefaultLineStyle, ar as DefaultRelationshipColor, b as DeployedInstance, D as DeploymentElement, c as DeploymentElementStyle, d as DeploymentNode, f as DeploymentNodeKind, g as DeploymentNodeKindSpecification, h as DeploymentRef, i as DeploymentRelation, b0 as DeploymentView, b1 as DeploymentViewRule, b2 as DeploymentViewRulePredicate, b3 as DeploymentViewRuleStyle, b4 as DiagramEdge, aA as DiagramNode, b5 as DiagramView, E as DirectRelationExpr, b6 as DynamicView, b7 as DynamicViewIncludeRule, b8 as DynamicViewParallelSteps, b9 as DynamicViewRule, ba as DynamicViewStep, bb as DynamicViewStepOrParallel, bc as EdgeId, F as ElementExpression, G as ElementKindExpr, bw as ElementNotation, H as ElementPredicateExpression, I as ElementRefExpr, J as ElementTagExpr, bd as ElementView, K as ElementWhereExpr, ah as EqualOperator, M as ExpandedElementExpr, N as Expression, X as ExpressionV2, be as ExtendsElementView, ai as Filterable, Y as FqnExpr, Z as FqnRef, a6 as GenericLikeC4Model, $ as GlobalDynamicPredicates, a0 as GlobalPredicateId, a1 as GlobalPredicates, a2 as GlobalStyleID, a3 as GlobalStyles, Q as InOutExpr, O as IncomingExpr, aj as KindEqual, a7 as LayoutedLikeC4Model, a8 as LikeC4ModelDump, L as LikeC4View, a4 as ModelGlobals, at as ModelRelation, bf as NodeId, R as NonWilcard, ak as NotOperator, al as OperatorPredicate, am as OrOperator, S as OutgoingExpr, a9 as ParsedLikeC4Model, P as PredicateSelector, _ as RelationExpr, T as RelationExpression, au as RelationId, U as RelationPredicateExpression, V as RelationWhereExpr, av as RelationshipArrowType, aw as RelationshipKind, ax as RelationshipKindSpecification, ay as RelationshipLineType, bg as ScopedElementView, bh as StepEdgeId, bi as StepEdgeIdLiteral, an as TagEqual, bj as ViewAutoLayout, bm as ViewRule, bn as ViewRuleAutoLayout, bo as ViewRuleGlobalPredicateRef, bp as ViewRuleGlobalStyle, bq as ViewRuleGroup, br as ViewRulePredicate, bs as ViewRuleStyle, bt as ViewRuleStyleOrGlobalRef, bu as ViewWithHash, bv as ViewWithNotation, ao as WhereOperator, W as WildcardExpr, aB as extractStep, aC as getBBoxCenter, aD as getParallelStepsPrefix, aa as isAndOperator, aE as isAutoLayoutDirection, j as isCustomElement, k as isCustomRelationExpr, aF as isDeploymentView, aG as isDynamicView, aH as isDynamicViewParallelSteps, l as isElement, m as isElementKindExpr, n as isElementPredicateExpr, o as isElementRef, p as isElementTagExpr, aI as isElementView, q as isElementWhere, r as isExpandedElementExpr, aJ as isExtendsElementView, t as isInOut, s as isIncoming, ab as isKindEqual, ac as isNotOperator, ad as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, aK as isScopedElementView, aL as isStepEdgeId, ae as isTagEqual, aM as isViewRuleAutoLayout, aN as isViewRuleGlobalPredicateRef, aO as isViewRuleGlobalStyle, aP as isViewRuleGroup, aQ as isViewRulePredicate, aR as isViewRuleStyle, z as isWildcard, aS as stepEdgeId, af as whereOperatorAsPredicate } from '../shared/core.D_Gc58Gt.js';
|
|
5
5
|
import 'type-fest';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AsFqn, B as BorderStyles, Q as ComputedNode, S as ComputedView, N as DefaultArrowType, e as DefaultElementShape, O as DefaultLineStyle, P as DefaultRelationshipColor, d as DefaultThemeColor, D as DeploymentElement, T as DiagramNode, E as ElementKind, g as ElementShapes, C as ExpressionV2, F as FqnExpr, G as FqnRef, R as RelationExpr, U as extractStep, V as getBBoxCenter, W as getParallelStepsPrefix, H as isAndOperator, X as isAutoLayoutDirection, h as isCustomElement, j as isCustomRelationExpr, Y as isDeploymentView, Z as isDynamicView, _ as isDynamicViewParallelSteps, k as isElement, l as isElementKindExpr, b as isElementPredicateExpr, m as isElementRef, p as isElementTagExpr, a as isElementView, q as isElementWhere, r as isExpandedElementExpr, i as isExtendsElementView, t as isInOut, s as isIncoming, I as isKindEqual, J as isNotOperator, K as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, c as isScopedElementView, $ as isStepEdgeId, L as isTagEqual, a0 as isViewRuleAutoLayout, a1 as isViewRuleGlobalPredicateRef, a2 as isViewRuleGlobalStyle, a3 as isViewRuleGroup, a4 as isViewRulePredicate, a5 as isViewRuleStyle, z as isWildcard, a6 as stepEdgeId, M as whereOperatorAsPredicate } from '../shared/
|
|
1
|
+
export { A as AsFqn, B as BorderStyles, Q as ComputedNode, S as ComputedView, N as DefaultArrowType, e as DefaultElementShape, O as DefaultLineStyle, P as DefaultRelationshipColor, d as DefaultThemeColor, D as DeploymentElement, T as DiagramNode, E as ElementKind, g as ElementShapes, C as ExpressionV2, F as FqnExpr, G as FqnRef, R as RelationExpr, U as extractStep, V as getBBoxCenter, W as getParallelStepsPrefix, H as isAndOperator, X as isAutoLayoutDirection, h as isCustomElement, j as isCustomRelationExpr, Y as isDeploymentView, Z as isDynamicView, _ as isDynamicViewParallelSteps, k as isElement, l as isElementKindExpr, b as isElementPredicateExpr, m as isElementRef, p as isElementTagExpr, a as isElementView, q as isElementWhere, r as isExpandedElementExpr, i as isExtendsElementView, t as isInOut, s as isIncoming, I as isKindEqual, J as isNotOperator, K as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, c as isScopedElementView, $ as isStepEdgeId, L as isTagEqual, a0 as isViewRuleAutoLayout, a1 as isViewRuleGlobalPredicateRef, a2 as isViewRuleGlobalStyle, a3 as isViewRuleGroup, a4 as isViewRulePredicate, a5 as isViewRuleStyle, z as isWildcard, a6 as stepEdgeId, M as whereOperatorAsPredicate } from '../shared/core.DunIMHRf.mjs';
|
|
2
2
|
|
|
3
3
|
const ThemeColors = [
|
|
4
4
|
"amber",
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const object_hash = require('../shared/core.C9DCnJh8.cjs');
|
|
4
|
+
const chunkRAAYCPUM = require('../shared/core.DsoCu540.cjs');
|
|
5
|
+
|
|
6
|
+
function o(r,n){let e=Math.ceil(r),t=Math.floor(n);if(t<e)throw new RangeError(`randomInteger: The range [${r.toString()},${n.toString()}] contains no integer`);return Math.floor(Math.random()*(t-e+1)+e)}
|
|
7
|
+
|
|
8
|
+
function ireduce(arg1, arg2, arg3) {
|
|
9
|
+
const reducer = object_hash.n(arg3) ? arg2 : arg1;
|
|
10
|
+
const initialValue = arg3 ?? arg2;
|
|
11
|
+
chunkRAAYCPUM.invariant(object_hash.t$1(reducer));
|
|
12
|
+
function _reduce(iter) {
|
|
13
|
+
let acc = initialValue;
|
|
14
|
+
for (const value of iter) {
|
|
15
|
+
acc = reducer(acc, value);
|
|
16
|
+
}
|
|
17
|
+
return acc;
|
|
18
|
+
}
|
|
19
|
+
return object_hash.n(arg3) ? _reduce(arg1) : _reduce;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const DELAY = "LIKEC4_DELAY";
|
|
23
|
+
function delay(...args) {
|
|
24
|
+
let ms = 100;
|
|
25
|
+
if (args.length === 2) {
|
|
26
|
+
ms = o(args[0], args[1]);
|
|
27
|
+
} else if (args.length === 1) {
|
|
28
|
+
ms = args[0];
|
|
29
|
+
}
|
|
30
|
+
return new Promise((resolve) => {
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
resolve(DELAY);
|
|
33
|
+
}, ms ?? 100);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const compareRelations = (a, b) => {
|
|
38
|
+
const parentA = object_hash.commonAncestor(a.source, a.target);
|
|
39
|
+
const parentB = object_hash.commonAncestor(b.source, b.target);
|
|
40
|
+
if (parentA && !parentB) {
|
|
41
|
+
return 1;
|
|
42
|
+
}
|
|
43
|
+
if (!parentA && parentB) {
|
|
44
|
+
return -1;
|
|
45
|
+
}
|
|
46
|
+
const compareParents = parentA && parentB ? object_hash.compareFqnHierarchically(parentA, parentB) : 0;
|
|
47
|
+
if (compareParents !== 0) {
|
|
48
|
+
return compareParents;
|
|
49
|
+
}
|
|
50
|
+
const compareSource = object_hash.compareFqnHierarchically(a.source, b.source);
|
|
51
|
+
if (compareSource !== 0) {
|
|
52
|
+
return compareSource;
|
|
53
|
+
}
|
|
54
|
+
return object_hash.compareFqnHierarchically(a.target, b.target);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.ancestorsFqn = object_hash.ancestorsFqn;
|
|
58
|
+
exports.commonAncestor = object_hash.commonAncestor;
|
|
59
|
+
exports.commonHead = object_hash.commonHead;
|
|
60
|
+
exports.compareByFqnHierarchically = object_hash.compareByFqnHierarchically;
|
|
61
|
+
exports.compareFqnHierarchically = object_hash.compareFqnHierarchically;
|
|
62
|
+
exports.compareNatural = object_hash.compareNatural;
|
|
63
|
+
exports.difference = object_hash.difference;
|
|
64
|
+
exports.equalsSet = object_hash.equals;
|
|
65
|
+
exports.getOrCreate = object_hash.getOrCreate;
|
|
66
|
+
exports.hasAtLeast = object_hash.i;
|
|
67
|
+
exports.hierarchyDistance = object_hash.hierarchyDistance;
|
|
68
|
+
exports.hierarchyLevel = object_hash.hierarchyLevel;
|
|
69
|
+
exports.ifilter = object_hash.ifilter;
|
|
70
|
+
exports.ifind = object_hash.ifind;
|
|
71
|
+
exports.iflat = object_hash.iflat;
|
|
72
|
+
exports.imap = object_hash.imap;
|
|
73
|
+
exports.intersection = object_hash.intersection;
|
|
74
|
+
exports.isAncestor = object_hash.isAncestor;
|
|
75
|
+
exports.isDescendantOf = object_hash.isDescendantOf;
|
|
76
|
+
exports.isIterable = object_hash.isIterable;
|
|
77
|
+
exports.isNonEmptyArray = object_hash.isNonEmptyArray;
|
|
78
|
+
exports.isSameHierarchy = object_hash.isSameHierarchy;
|
|
79
|
+
exports.isString = object_hash.isString;
|
|
80
|
+
exports.isome = object_hash.isome;
|
|
81
|
+
exports.iunique = object_hash.iunique;
|
|
82
|
+
exports.nameFromFqn = object_hash.nameFromFqn;
|
|
83
|
+
exports.objectHash = object_hash.objectHash;
|
|
84
|
+
exports.parentFqn = object_hash.parentFqn;
|
|
85
|
+
exports.sortByFqnHierarchically = object_hash.sortByFqnHierarchically;
|
|
86
|
+
exports.sortNaturalByFqn = object_hash.sortNaturalByFqn;
|
|
87
|
+
exports.sortParentsFirst = object_hash.sortParentsFirst;
|
|
88
|
+
exports.stringHash = object_hash.stringHash;
|
|
89
|
+
exports.symmetricDifference = object_hash.symmetricDifference;
|
|
90
|
+
exports.toArray = object_hash.toArray;
|
|
91
|
+
exports.toSet = object_hash.toSet;
|
|
92
|
+
exports.union = object_hash.union;
|
|
93
|
+
exports.compareRelations = compareRelations;
|
|
94
|
+
exports.delay = delay;
|
|
95
|
+
exports.ireduce = ireduce;
|