@likec4/core 1.44.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 +15 -13
- package/dist/builder/index.mjs +33 -17
- package/dist/compute-view/index.d.mts +8 -7
- package/dist/compute-view/index.mjs +7 -6
- package/dist/compute-view/relationships-view/index.d.mts +8 -7
- package/dist/compute-view/relationships-view/index.mjs +2 -2
- package/dist/geometry/index.d.mts +109 -0
- package/dist/geometry/index.mjs +328 -0
- package/dist/index.d.mts +29 -7
- package/dist/index.mjs +10 -8
- package/dist/model/connection/deployment/index.d.mts +10 -9
- package/dist/model/connection/deployment/index.mjs +2 -2
- package/dist/model/connection/index.d.mts +11 -10
- package/dist/model/connection/index.mjs +3 -3
- package/dist/model/connection/model/index.d.mts +10 -9
- package/dist/model/connection/model/index.mjs +2 -2
- package/dist/model/index.d.mts +13 -26
- package/dist/model/index.mjs +4 -4
- package/dist/shared/{core.Bv3cd-jC.mjs → core.3ZhnKAlZ.mjs} +9 -5
- package/dist/shared/{core.CKNmSm2W.d.mts → core.5gPDaaG5.d.mts} +9 -15
- package/dist/shared/{core.BnOetIAR.d.mts → core.9U0HL3oG.d.mts} +3 -3
- package/dist/shared/{core.M9ayqQZa.mjs → core.BK-tI3Q3.mjs} +2 -3
- package/dist/shared/{core.DjAM-S6a.d.mts → core.BLG-ADpi.d.mts} +16 -14
- package/dist/shared/core.BPGOjone.d.mts +46 -0
- package/dist/shared/{core.DIE3F6sw.mjs → core.BYdtmqY5.mjs} +1 -2
- package/dist/shared/core.BhNcrwzK.mjs +7 -0
- package/dist/shared/{core.CDOKQTW6.d.mts → core.BkSYCfRg.d.mts} +2 -2
- package/dist/shared/core.BkVA6gjl.mjs +5 -0
- 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.BnDbAOR2.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.bKIs4oDO.mjs → core.CQPEY2wQ.mjs} +5 -4
- package/dist/shared/{core.WwMWeiFL.d.mts → core.CQYL_Z-_.d.mts} +3 -3
- package/dist/shared/{core.6VsRBhGY.mjs → core.CdNCAwq7.mjs} +1 -1
- package/dist/shared/{core.DrUt0Lbi.mjs → core.CmGY9blO.mjs} +198 -291
- package/dist/shared/core.Coi_LOUZ.mjs +7 -0
- package/dist/shared/{core.C_Ni6yHl.mjs → core.D0WZutNd.mjs} +3 -1
- package/dist/shared/{core.DTJYgLXI.d.mts → core.D4Y4U8Lp.d.mts} +3 -3
- package/dist/shared/{core.BMtVqKl7.d.mts → core.DE-g9oFF.d.mts} +22 -46
- package/dist/shared/{core.23WeDKcI.mjs → core.DJpiszim.mjs} +265 -233
- package/dist/shared/{core.h4TqqSC0.mjs → core.DU8pv3Q6.mjs} +71 -1174
- package/dist/shared/{core.CHwVhuc9.mjs → core.DbQpDoJS.mjs} +12 -15
- package/dist/shared/{core.CbsSAn1j.mjs → core.DbfO90vF.mjs} +1 -12
- package/dist/shared/{core.C0Ye2OCr.mjs → core.DqlrMlsf.mjs} +1 -1
- package/dist/shared/core.Qv7vZIwZ.mjs +1282 -0
- package/dist/shared/core.oSV6SRfk.mjs +13 -0
- package/dist/shared/{core.BuQZczj6.mjs → core.om36dXXW.mjs} +5 -2
- package/dist/shared/{core.8mmHFn9g.d.mts → core.or6-EHsb.d.mts} +2 -2
- package/dist/shared/{core.DFCHU59b.mjs → core.xeuDd__E.mjs} +3 -4
- package/dist/styles/index.d.mts +7 -6
- package/dist/styles/index.mjs +4 -4
- 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 -166
- 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 +9 -8
- 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 +20 -12
- package/dist/shared/core.B9BjmjuH.mjs +0 -9
- package/dist/shared/core.BR4zXDH-.mjs +0 -13
- package/dist/shared/core.BdPcbSkN.mjs +0 -118
- package/dist/shared/core.OHD4KXm9.mjs +0 -5
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as t$
|
|
3
|
-
import { t as t$
|
|
4
|
-
import {
|
|
1
|
+
import { n as n$d, b as t$i, d as t$k, e as t$l, f as t$n, g as buildElementNotations, t as t$q } from './core.Qv7vZIwZ.mjs';
|
|
2
|
+
import { t as t$a, a as t$b } from './core.BsSXS-_R.mjs';
|
|
3
|
+
import { t as t$e } from './core.CbT8JVYL.mjs';
|
|
4
|
+
import { a as t$c, t as t$j, i as isElementModel, b as isNestedElementOfDeployedInstanceModel, c as isDeployedInstanceModel, d as isDeploymentNodeModel, e as isDeploymentElementModel, L as LikeC4Model } from './core.DU8pv3Q6.mjs';
|
|
5
|
+
import { c as commonHead, t as t$f, o as objectHash, b as t$m, a as compareRelations, S as Stack } from './core.xeuDd__E.mjs';
|
|
5
6
|
import { a as nonNullable, i as invariant, n as nonexhaustive } from './core.D4npX2q8.mjs';
|
|
6
|
-
import { G as Graph } from './core.
|
|
7
|
-
import { r as requireIterables, e as exact, t as t$o } from './core.
|
|
8
|
-
import {
|
|
7
|
+
import { G as Graph } from './core.CmGY9blO.mjs';
|
|
8
|
+
import { r as requireIterables, e as exact, t as t$o } from './core.BK-tI3Q3.mjs';
|
|
9
|
+
import { b as requireIterator } from './core.CBLX4mT8.mjs';
|
|
9
10
|
import { g as getDefaultExportFromCjs } from './core.B85MJLTf.mjs';
|
|
10
|
-
import { n as n$
|
|
11
|
+
import { n as n$c, t as t$d } from './core.3ZhnKAlZ.mjs';
|
|
11
12
|
import { e as e$4 } from './core.BKlholso.mjs';
|
|
12
|
-
import { f as flattenMarkdownOrString, i as isGroupElementKind, G as GroupElementKind,
|
|
13
|
-
import { b as isDescendantOf, f as sortParentsFirst, i as isAncestor, p as parentFqn, j as compareByFqnHierarchically, c as isNonEmptyArray, n as nameFromFqn, o as sortByFqnHierarchically, g as commonAncestor, a as ancestorsFqn, d as isSameHierarchy } from './core.
|
|
14
|
-
import { d as difference, i as intersection, u as union, h as hasIntersection } from './core.
|
|
15
|
-
import { e as e$8 } from './core.
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
13
|
+
import { f as flattenMarkdownOrString, i as isGroupElementKind, G as GroupElementKind, e as stepEdgeId } from './core.D0WZutNd.mjs';
|
|
14
|
+
import { b as isDescendantOf, f as sortParentsFirst, i as isAncestor, p as parentFqn, j as compareByFqnHierarchically, c as isNonEmptyArray, n as nameFromFqn, o as sortByFqnHierarchically, g as commonAncestor, a as ancestorsFqn, d as isSameHierarchy } from './core.CdNCAwq7.mjs';
|
|
15
|
+
import { d as difference, i as intersection, u as union, h as hasIntersection } from './core.DbfO90vF.mjs';
|
|
16
|
+
import { e as e$8 } from './core.Coi_LOUZ.mjs';
|
|
17
|
+
import { w as whereOperatorAsPredicate, m as isViewRuleStyle, v as t$g, l as isViewRulePredicate, a as _type, _ as _stage, u as e$b, t as isDynamicView, s as isDeploymentView, p as isElementView } from './core.DH7TXqXf.mjs';
|
|
18
|
+
import { n as n$e } from './core.BhNcrwzK.mjs';
|
|
18
19
|
import { e as e$6, a as iunique, i as iflat } from './core.C4x8aaWa.mjs';
|
|
20
|
+
import { e as e$5, d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.DbQpDoJS.mjs';
|
|
19
21
|
import { e as e$7 } from './core.BoYfZOBm.mjs';
|
|
20
22
|
import { ModelFqnExpr, ModelRelationExpr, ModelExpression } from '../types/expression-model.mjs';
|
|
21
23
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
22
24
|
import { preferSummary } from '../types/_aux.mjs';
|
|
23
|
-
import { a as t$
|
|
25
|
+
import { a as t$h } from './core.BspBF3SJ.mjs';
|
|
24
26
|
import { FqnExpr, RelationExpr } from '../types/expression.mjs';
|
|
25
|
-
import { f as findAscendingConnections, m as mergeConnections, d as differenceConnections, j as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, o as findConnectionsBetween$3, p as findConnection$3, n as modelConnection, b as findDescendantConnections, a as findDeepestNestedConnection, i as isAnyInOut, k as isOutgoing, g as isIncoming, C as ConnectionModel } from './core.
|
|
27
|
+
import { f as findAscendingConnections, m as mergeConnections, d as differenceConnections, j as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, o as findConnectionsBetween$3, p as findConnection$3, n as modelConnection, b as findDescendantConnections, a as findDeepestNestedConnection, i as isAnyInOut, k as isOutgoing, g as isIncoming, C as ConnectionModel } from './core.CQPEY2wQ.mjs';
|
|
26
28
|
import { t as toSet, a as toArray, i as imap } from './core.C3JowhaZ.mjs';
|
|
27
29
|
import { D as DefaultMap } from './core.BbE4y-yl.mjs';
|
|
28
30
|
import { i as ifilter } from './core.DRJma0Ol.mjs';
|
|
29
|
-
import { C as Connection, c as customInspectSymbol } from './core.
|
|
31
|
+
import { C as Connection, c as customInspectSymbol } from './core.DqlrMlsf.mjs';
|
|
30
32
|
import { i as isome } from './core.FZ305VYd.mjs';
|
|
31
33
|
import { i as isIterable, e as e$9 } from './core.RfnaEmgA.mjs';
|
|
32
|
-
import {
|
|
34
|
+
import { k as e$a, c as isViewRuleAutoLayout, h as isViewRuleGroup, a as isViewRuleGlobalPredicateRef, i as isViewRuleGlobalStyle, e as isDynamicStepsParallel, f as isDynamicStepsSeries, j as isViewRuleRank } from './core.om36dXXW.mjs';
|
|
33
35
|
import { t as t$p } from './core.q10OP9oJ.mjs';
|
|
34
36
|
|
|
35
37
|
function e$3(e){return ()=>e}
|
|
36
38
|
|
|
37
|
-
function t$
|
|
39
|
+
function t$9(...t){return t$a(n$b,t)}function n$b(e,t){for(let[n,r]of e.entries())if(!t(r,n,e))return e.slice(n);return []}
|
|
38
40
|
|
|
39
41
|
const e$2=e=>Object.assign(e,{single:true});
|
|
40
42
|
|
|
41
|
-
function t$
|
|
43
|
+
function t$8(...t){return t$a(n$a,t)}const n$a=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}};
|
|
42
44
|
|
|
43
|
-
function n$
|
|
45
|
+
function n$9(...n){return t$a(r$3,n,e$2(i$1))}const r$3=([e])=>e,i$1=()=>a,a=e=>({hasNext:true,next:e,done:true});
|
|
44
46
|
|
|
45
|
-
function t$
|
|
47
|
+
function t$7(...t){return t$a(n$8,t,r$2)}function n$8(e,t){return e.forEach(t),e}const r$2=e=>(t,n,r)=>(e(t,n,r),{done:false,hasNext:true,next:t});
|
|
46
48
|
|
|
47
49
|
function e$1(e){return typeof e==`boolean`}
|
|
48
50
|
|
|
49
|
-
function t$
|
|
51
|
+
function t$6(...t){return t$a(n$7,t)}function n$7(e,t){let n={};for(let[r,i]of e.entries()){let[a,o]=t(i,r,e);n[a]=o;}return n}
|
|
50
52
|
|
|
51
|
-
function n$
|
|
53
|
+
function n$6(...t){return t$a(r$1,t)}function r$1(e,n){if(!t$b(n,1))return {...e};if(!t$b(n,2)){let{[n[0]]:t,...r}=e;return r}let r={...e};for(let e of n)delete r[e];return r}
|
|
52
54
|
|
|
53
|
-
function t$
|
|
55
|
+
function t$5(...t){return t$a(n$5,t)}const n$5=e=>e.length===1?e[0]:void 0;
|
|
54
56
|
|
|
55
|
-
function t$
|
|
57
|
+
function t$4(...t){return t$a(n$4,t)}const n$4=(e,t)=>{let n=[[],[]];for(let[r,i]of e.entries())t(i,r,e)?n[0].push(i):n[1].push(i);return n};
|
|
56
58
|
|
|
57
|
-
function t$
|
|
59
|
+
function t$3(...t){return t$a(n$3,t)}function n$3(e,t){let n={};for(let[r,i]of Object.entries(e))t(i,r,e)&&(n[r]=i);return n}
|
|
58
60
|
|
|
59
|
-
function t$
|
|
61
|
+
function t$2(...t){return t$a(n$2,t)}const n$2=(e,t,n)=>e.reduce(t,n);
|
|
60
62
|
|
|
61
|
-
function t$
|
|
63
|
+
function t$1(...t){return t$a(n$1,t)}function n$1(e){return [...e].reverse()}
|
|
62
64
|
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
function n(...t){return t$b(r,t,i)}const r=(e,t)=>t<0?[]:e.slice(0,t);function i(e){if(e<=0)return n$d;let n=e;return e=>(--n,{done:n<=0,hasNext:true,next:e})}
|
|
65
|
+
function n(...t){return t$a(r,t,i)}const r=(e,t)=>t<0?[]:e.slice(0,t);function i(e){if(e<=0)return n$c;let n=e;return e=>(--n,{done:n<=0,hasNext:true,next:e})}
|
|
66
66
|
|
|
67
67
|
function e(...e){return e.length===2?(n,...r)=>t(n,...e,...r):t(...e)}const t=(e,t,n,...r)=>t(e,...r)?typeof n==`function`?n(e,...r):n.onTrue(e,...r):typeof n==`function`?e:n.onFalse(e,...r);
|
|
68
68
|
|
|
@@ -88,7 +88,7 @@ function linkNodesWithEdges(nodesMap, edges) {
|
|
|
88
88
|
const sourceAncestors = ancestorsOfNode(source, nodesMap);
|
|
89
89
|
const targetAncestors = ancestorsOfNode(target, nodesMap);
|
|
90
90
|
const hasAncestors = sourceAncestors.length > 0 && targetAncestors.length > 0;
|
|
91
|
-
const edgeParent = hasAncestors ? t$
|
|
91
|
+
const edgeParent = hasAncestors ? t$c(
|
|
92
92
|
commonHead(
|
|
93
93
|
t$1(sourceAncestors),
|
|
94
94
|
t$1(targetAncestors)
|
|
@@ -793,9 +793,9 @@ function topologicalSort(param) {
|
|
|
793
793
|
allowSelfLoops: true,
|
|
794
794
|
type: "directed"
|
|
795
795
|
});
|
|
796
|
-
const enrichedEdges = t$
|
|
796
|
+
const enrichedEdges = t$d(
|
|
797
797
|
edges,
|
|
798
|
-
t$
|
|
798
|
+
t$e((edge) => {
|
|
799
799
|
const source = getNode(edge.source), target = getNode(edge.target), parent = edge.parent ? getNode(edge.parent) : null;
|
|
800
800
|
return {
|
|
801
801
|
id: edge.id,
|
|
@@ -806,7 +806,7 @@ function topologicalSort(param) {
|
|
|
806
806
|
};
|
|
807
807
|
})
|
|
808
808
|
);
|
|
809
|
-
const [edgesBetweenLeafs, edgesWithCompounds] = t$
|
|
809
|
+
const [edgesBetweenLeafs, edgesWithCompounds] = t$4(
|
|
810
810
|
enrichedEdges,
|
|
811
811
|
({ source, target }) => source.children.length === 0 && target.children.length === 0
|
|
812
812
|
);
|
|
@@ -822,10 +822,10 @@ function topologicalSort(param) {
|
|
|
822
822
|
for (const { edge, source, target } of edgesBetweenLeafs) {
|
|
823
823
|
addEdgeToGraph(edge);
|
|
824
824
|
if (target.parent && target.parent !== edge.parent) {
|
|
825
|
-
t$
|
|
825
|
+
t$d(
|
|
826
826
|
ancestorsOfNode(target, param.nodes),
|
|
827
|
-
t$
|
|
828
|
-
t$
|
|
827
|
+
t$f((ancestor) => ancestor.inEdges.includes(edge.id)),
|
|
828
|
+
t$7((ancestor) => {
|
|
829
829
|
g.mergeNode(ancestor.id);
|
|
830
830
|
if (!willCreateCycle(g, edge.source, ancestor.id)) {
|
|
831
831
|
g.mergeDirectedEdge(edge.source, ancestor.id);
|
|
@@ -888,9 +888,9 @@ function calcViewLayoutHash(view) {
|
|
|
888
888
|
id: view.id,
|
|
889
889
|
__: view._type ?? "element",
|
|
890
890
|
autoLayout: view.autoLayout,
|
|
891
|
-
nodes: t$
|
|
891
|
+
nodes: t$d(
|
|
892
892
|
view.nodes,
|
|
893
|
-
t$
|
|
893
|
+
t$e((n) => ({
|
|
894
894
|
id: n.id,
|
|
895
895
|
icon: e$4(n.icon) && n.icon !== "none" ? "Y" : "N",
|
|
896
896
|
title: n.title,
|
|
@@ -902,11 +902,11 @@ function calcViewLayoutHash(view) {
|
|
|
902
902
|
padding: n.style.padding ?? null,
|
|
903
903
|
children: n.children
|
|
904
904
|
})),
|
|
905
|
-
t$
|
|
905
|
+
t$6(({ id, ...node }) => [id, node])
|
|
906
906
|
),
|
|
907
|
-
edges: t$
|
|
907
|
+
edges: t$d(
|
|
908
908
|
view.edges,
|
|
909
|
-
t$
|
|
909
|
+
t$e((e) => ({
|
|
910
910
|
source: e.source,
|
|
911
911
|
target: e.target,
|
|
912
912
|
label: e.label,
|
|
@@ -917,7 +917,7 @@ function calcViewLayoutHash(view) {
|
|
|
917
917
|
tail: e.tail,
|
|
918
918
|
line: e.line
|
|
919
919
|
})),
|
|
920
|
-
t$
|
|
920
|
+
t$6(({ source, target, ...edge }) => [`${source}:${target}`, edge])
|
|
921
921
|
)
|
|
922
922
|
};
|
|
923
923
|
view.hash = objectHash(tohash);
|
|
@@ -1035,7 +1035,7 @@ class AbstractStageExclude {
|
|
|
1035
1035
|
disconnected,
|
|
1036
1036
|
state.elements
|
|
1037
1037
|
);
|
|
1038
|
-
disconnected = t$
|
|
1038
|
+
disconnected = t$d(
|
|
1039
1039
|
disconnected,
|
|
1040
1040
|
ifilter((el) => {
|
|
1041
1041
|
return state.explicits.has(el) && !isome(state.final, isDescendantOf(el));
|
|
@@ -1243,7 +1243,7 @@ class AbstractStageInclude {
|
|
|
1243
1243
|
let state = this.precommit(this.memory.mutableState());
|
|
1244
1244
|
let fromConnections = /* @__PURE__ */ new Set();
|
|
1245
1245
|
if (this._connections.length > 0) {
|
|
1246
|
-
const [fromKnown, rest] = t$
|
|
1246
|
+
const [fromKnown, rest] = t$4(
|
|
1247
1247
|
this._connections,
|
|
1248
1248
|
(c) => state.final.has(c.source)
|
|
1249
1249
|
);
|
|
@@ -1353,14 +1353,14 @@ function elementExprToPredicate(target) {
|
|
|
1353
1353
|
nonexhaustive(target);
|
|
1354
1354
|
}
|
|
1355
1355
|
|
|
1356
|
-
function applyViewRuleStyle(rule,
|
|
1356
|
+
function applyViewRuleStyle(rule, predicate, nodes) {
|
|
1357
1357
|
const { shape, color, icon, ...rest } = rule.style;
|
|
1358
1358
|
const nonEmptyStyle = !e$5(rest);
|
|
1359
|
-
t$
|
|
1359
|
+
t$d(
|
|
1360
1360
|
nodes,
|
|
1361
|
-
n$
|
|
1362
|
-
n$
|
|
1363
|
-
t$
|
|
1361
|
+
n$d(e$7(isGroupElementKind)),
|
|
1362
|
+
n$d(predicate),
|
|
1363
|
+
t$7((n) => {
|
|
1364
1364
|
n.shape = shape ?? n.shape;
|
|
1365
1365
|
n.color = color ?? n.color;
|
|
1366
1366
|
if (e$6(icon)) {
|
|
@@ -1384,7 +1384,11 @@ function applyViewRuleStyles(rules, nodes) {
|
|
|
1384
1384
|
continue;
|
|
1385
1385
|
}
|
|
1386
1386
|
const predicates = rule.targets.map(elementExprToPredicate);
|
|
1387
|
-
applyViewRuleStyle(
|
|
1387
|
+
applyViewRuleStyle(
|
|
1388
|
+
rule,
|
|
1389
|
+
t$g(predicates),
|
|
1390
|
+
nodes
|
|
1391
|
+
);
|
|
1388
1392
|
}
|
|
1389
1393
|
return nodes;
|
|
1390
1394
|
}
|
|
@@ -1405,7 +1409,7 @@ function elementModelToNodeSource(el) {
|
|
|
1405
1409
|
id,
|
|
1406
1410
|
title,
|
|
1407
1411
|
...rest
|
|
1408
|
-
} = n$
|
|
1412
|
+
} = n$6(el.$element, ["summary", "description", "metadata", "style", "tags"]);
|
|
1409
1413
|
const { color, icon, shape, ...style } = el.style;
|
|
1410
1414
|
return exact({
|
|
1411
1415
|
id,
|
|
@@ -1527,14 +1531,14 @@ function pickRelationshipProps(relation) {
|
|
|
1527
1531
|
};
|
|
1528
1532
|
}
|
|
1529
1533
|
function mergePropsFromRelationships(relations, prefer) {
|
|
1530
|
-
const allprops = t$
|
|
1534
|
+
const allprops = t$d(
|
|
1531
1535
|
relations,
|
|
1532
1536
|
t$2(
|
|
1533
1537
|
(acc, r) => {
|
|
1534
1538
|
if (e$4(r.title) && !acc.title.includes(r.title)) {
|
|
1535
1539
|
acc.title.push(r.title);
|
|
1536
1540
|
}
|
|
1537
|
-
if (e$4(r.description) && !acc.description.some(t$
|
|
1541
|
+
if (e$4(r.description) && !acc.description.some(t$h(r.description))) {
|
|
1538
1542
|
acc.description.push(r.description);
|
|
1539
1543
|
}
|
|
1540
1544
|
if (e$4(r.technology) && !acc.technology.includes(r.technology)) {
|
|
@@ -1577,20 +1581,20 @@ function mergePropsFromRelationships(relations, prefer) {
|
|
|
1577
1581
|
}
|
|
1578
1582
|
)
|
|
1579
1583
|
);
|
|
1580
|
-
let technology = t$
|
|
1581
|
-
let title = t$
|
|
1582
|
-
const tags = n$
|
|
1584
|
+
let technology = t$5(allprops.technology);
|
|
1585
|
+
let title = t$5(allprops.title) ?? (allprops.title.length > 1 ? "[...]" : null);
|
|
1586
|
+
const tags = n$e(allprops.tags);
|
|
1583
1587
|
let merged = exact({
|
|
1584
1588
|
// If there is no title, but there is technology, use technology as title
|
|
1585
1589
|
title: title ?? (technology ? `[${technology}]` : null),
|
|
1586
|
-
description: t$
|
|
1590
|
+
description: t$5(allprops.description),
|
|
1587
1591
|
technology,
|
|
1588
|
-
kind: t$
|
|
1589
|
-
head: t$
|
|
1590
|
-
tail: t$
|
|
1591
|
-
color: t$
|
|
1592
|
-
line: t$
|
|
1593
|
-
navigateTo: t$
|
|
1592
|
+
kind: t$5(allprops.kind),
|
|
1593
|
+
head: t$5(allprops.head),
|
|
1594
|
+
tail: t$5(allprops.tail),
|
|
1595
|
+
color: t$5(allprops.color),
|
|
1596
|
+
line: t$5(allprops.line),
|
|
1597
|
+
navigateTo: t$5(allprops.navigateTo),
|
|
1594
1598
|
...isNonEmptyArray(tags) && { tags }
|
|
1595
1599
|
});
|
|
1596
1600
|
if (prefer) {
|
|
@@ -1721,7 +1725,7 @@ function toNodeSource(el) {
|
|
|
1721
1725
|
let tags = [...el.tags];
|
|
1722
1726
|
summary ??= description2;
|
|
1723
1727
|
if (onlyOneInstance) {
|
|
1724
|
-
tags = n$
|
|
1728
|
+
tags = n$e([...tags, ...onlyOneInstance.tags]);
|
|
1725
1729
|
if (title === nameFromFqn(el.id)) {
|
|
1726
1730
|
title = onlyOneInstance.title;
|
|
1727
1731
|
}
|
|
@@ -1743,7 +1747,7 @@ function toNodeSource(el) {
|
|
|
1743
1747
|
icon: icon2,
|
|
1744
1748
|
description: summary,
|
|
1745
1749
|
tags,
|
|
1746
|
-
style: n$
|
|
1750
|
+
style: n$6(el.style, ["icon", "shape", "color"])
|
|
1747
1751
|
});
|
|
1748
1752
|
}
|
|
1749
1753
|
invariant(el.isInstance(), "Expected Instance");
|
|
@@ -1764,7 +1768,7 @@ function toNodeSource(el) {
|
|
|
1764
1768
|
description,
|
|
1765
1769
|
technology,
|
|
1766
1770
|
tags: [...el.tags],
|
|
1767
|
-
links: t$
|
|
1771
|
+
links: t$b(links, 1) ? links : void 0,
|
|
1768
1772
|
icon,
|
|
1769
1773
|
color,
|
|
1770
1774
|
shape,
|
|
@@ -1780,7 +1784,7 @@ function toComputedEdges$1(connections) {
|
|
|
1780
1784
|
...e.relations.model,
|
|
1781
1785
|
...e.relations.deployment
|
|
1782
1786
|
];
|
|
1783
|
-
invariant(t$
|
|
1787
|
+
invariant(t$b(relations, 1), "Edge must have at least one relation");
|
|
1784
1788
|
const defaults = e.source.$model.$styles.defaults;
|
|
1785
1789
|
const source = e.source.id;
|
|
1786
1790
|
const target = e.target.id;
|
|
@@ -1830,7 +1834,11 @@ function applyDeploymentViewRuleStyles(rules, nodes) {
|
|
|
1830
1834
|
continue;
|
|
1831
1835
|
}
|
|
1832
1836
|
const predicates = rule.targets.map(deploymentExpressionToPredicate);
|
|
1833
|
-
applyViewRuleStyle(
|
|
1837
|
+
applyViewRuleStyle(
|
|
1838
|
+
rule,
|
|
1839
|
+
t$g(predicates),
|
|
1840
|
+
nodes
|
|
1841
|
+
);
|
|
1834
1842
|
}
|
|
1835
1843
|
return nodes;
|
|
1836
1844
|
}
|
|
@@ -1844,28 +1852,28 @@ function findCrossBoundarySameSourceOrTarget(connections) {
|
|
|
1844
1852
|
}
|
|
1845
1853
|
const excludedRelations = new DefaultMap(() => /* @__PURE__ */ new Set());
|
|
1846
1854
|
for (const [relation, sameRelationGroup] of groupedByRelation) {
|
|
1847
|
-
if (!t$
|
|
1855
|
+
if (!t$b(sameRelationGroup, 2)) {
|
|
1848
1856
|
continue;
|
|
1849
1857
|
}
|
|
1850
|
-
t$
|
|
1858
|
+
t$d(
|
|
1851
1859
|
sameRelationGroup,
|
|
1852
|
-
t$
|
|
1860
|
+
t$l((conn) => [
|
|
1853
1861
|
{ group: `$source-${conn.source.id}`, conn },
|
|
1854
1862
|
{ group: `$target-${conn.target.id}`, conn }
|
|
1855
1863
|
]),
|
|
1856
|
-
t$
|
|
1857
|
-
t$
|
|
1858
|
-
n$
|
|
1859
|
-
t$
|
|
1864
|
+
t$k(e$8("group")),
|
|
1865
|
+
t$j(),
|
|
1866
|
+
n$d(t$b(2)),
|
|
1867
|
+
t$7(
|
|
1860
1868
|
// In each group, sort by hierarchy, first are deepest
|
|
1861
|
-
t$
|
|
1862
|
-
t$
|
|
1869
|
+
t$i(
|
|
1870
|
+
t$e(e$8("conn")),
|
|
1863
1871
|
sortConnectionsByBoundaryHierarchy("desc"),
|
|
1864
1872
|
// Drop first, as it is the deepest
|
|
1865
1873
|
// Drop if boundary is same as previous
|
|
1866
|
-
t$
|
|
1874
|
+
t$9((conn, i, all) => i === 0 || conn.boundary === all[i - 1].boundary),
|
|
1867
1875
|
// Drop relations from boundaries above
|
|
1868
|
-
t$
|
|
1876
|
+
t$7((conn) => {
|
|
1869
1877
|
excludedRelations.get(conn).add(relation);
|
|
1870
1878
|
})
|
|
1871
1879
|
)
|
|
@@ -1910,7 +1918,7 @@ function findCrossBoundaryConnections(connections) {
|
|
|
1910
1918
|
}
|
|
1911
1919
|
}
|
|
1912
1920
|
}
|
|
1913
|
-
return t$
|
|
1921
|
+
return t$d(
|
|
1914
1922
|
excludedRelations.entries(),
|
|
1915
1923
|
imap(
|
|
1916
1924
|
([c, excluded]) => c.update({
|
|
@@ -1928,7 +1936,7 @@ function cleanCrossBoundary(connections) {
|
|
|
1928
1936
|
);
|
|
1929
1937
|
}
|
|
1930
1938
|
function findRedundantConnections$1(connections) {
|
|
1931
|
-
return t$
|
|
1939
|
+
return t$d(
|
|
1932
1940
|
connections,
|
|
1933
1941
|
mergeConnections,
|
|
1934
1942
|
t$2((redundants, connection) => {
|
|
@@ -2010,25 +2018,25 @@ let StageInclude$1 = class StageInclude extends AbstractStageInclude {
|
|
|
2010
2018
|
return hasChanged();
|
|
2011
2019
|
}
|
|
2012
2020
|
processConnections(connections) {
|
|
2013
|
-
const clean = t$
|
|
2021
|
+
const clean = t$d(
|
|
2014
2022
|
connections,
|
|
2015
2023
|
cleanCrossBoundary,
|
|
2016
2024
|
cleanRedundantRelationships
|
|
2017
2025
|
);
|
|
2018
|
-
t$
|
|
2026
|
+
t$d(
|
|
2019
2027
|
clean,
|
|
2020
2028
|
// Process only connection from this stage
|
|
2021
2029
|
// filter(c => this._connections.some(c2 => c2.id === c.id)),
|
|
2022
|
-
t$
|
|
2023
|
-
t$
|
|
2024
|
-
t$
|
|
2030
|
+
t$7(({ source, target, boundary }) => {
|
|
2031
|
+
t$d(
|
|
2032
|
+
t$m(
|
|
2025
2033
|
[...toArray(source.ancestors()).reverse(), source],
|
|
2026
2034
|
[...toArray(target.ancestors()).reverse(), target]
|
|
2027
2035
|
),
|
|
2028
2036
|
// Filter out common ancestors
|
|
2029
|
-
t$
|
|
2037
|
+
t$9(([sourceAncestor, targetAncestor]) => sourceAncestor === targetAncestor),
|
|
2030
2038
|
n(1),
|
|
2031
|
-
t$
|
|
2039
|
+
t$7(([sourceAncestor, targetAncestor]) => {
|
|
2032
2040
|
if (source === sourceAncestor && target === targetAncestor) {
|
|
2033
2041
|
this.addImplicit(boundary);
|
|
2034
2042
|
return;
|
|
@@ -2077,7 +2085,7 @@ let Memory$1 = class Memory extends AbstractMemory {
|
|
|
2077
2085
|
});
|
|
2078
2086
|
}
|
|
2079
2087
|
equals(other) {
|
|
2080
|
-
return other instanceof Memory && t$
|
|
2088
|
+
return other instanceof Memory && t$h(this.state, other.state);
|
|
2081
2089
|
}
|
|
2082
2090
|
diff(state) {
|
|
2083
2091
|
return {
|
|
@@ -2154,9 +2162,9 @@ const IncomingRelationPredicate = {
|
|
|
2154
2162
|
return stage;
|
|
2155
2163
|
}
|
|
2156
2164
|
const isIncoming = filterIncomingConnections(resolveElements$1(model, expr.incoming));
|
|
2157
|
-
const toExclude = t$
|
|
2165
|
+
const toExclude = t$d(
|
|
2158
2166
|
memory.connections,
|
|
2159
|
-
n$
|
|
2167
|
+
n$d(isIncoming),
|
|
2160
2168
|
applyPredicate(where)
|
|
2161
2169
|
);
|
|
2162
2170
|
stage.excludeConnections(toExclude);
|
|
@@ -2164,7 +2172,7 @@ const IncomingRelationPredicate = {
|
|
|
2164
2172
|
}
|
|
2165
2173
|
};
|
|
2166
2174
|
function filterIncomingConnections(targets) {
|
|
2167
|
-
return t$
|
|
2175
|
+
return t$g(
|
|
2168
2176
|
targets.map((target) => {
|
|
2169
2177
|
const satisfies = (el) => el === target || isAncestor(target, el);
|
|
2170
2178
|
return (connection) => {
|
|
@@ -2213,9 +2221,9 @@ const OutgoingRelationPredicate = {
|
|
|
2213
2221
|
return stage;
|
|
2214
2222
|
}
|
|
2215
2223
|
const isOutgoing = filterOutgoingConnections(resolveElements$1(model, expr.outgoing));
|
|
2216
|
-
const toExclude = t$
|
|
2224
|
+
const toExclude = t$d(
|
|
2217
2225
|
memory.connections,
|
|
2218
|
-
n$
|
|
2226
|
+
n$d(isOutgoing),
|
|
2219
2227
|
applyPredicate(where)
|
|
2220
2228
|
);
|
|
2221
2229
|
stage.excludeConnections(toExclude);
|
|
@@ -2223,7 +2231,7 @@ const OutgoingRelationPredicate = {
|
|
|
2223
2231
|
}
|
|
2224
2232
|
};
|
|
2225
2233
|
function filterOutgoingConnections(sources) {
|
|
2226
|
-
return t$
|
|
2234
|
+
return t$g(
|
|
2227
2235
|
sources.map((source) => {
|
|
2228
2236
|
const satisfies = (el) => el === source || isAncestor(source, el);
|
|
2229
2237
|
return (connection) => {
|
|
@@ -2261,10 +2269,10 @@ const DirectRelationPredicate = {
|
|
|
2261
2269
|
switch (true) {
|
|
2262
2270
|
// * -> *
|
|
2263
2271
|
case (sourceIsWildcard && targetIsWildcard): {
|
|
2264
|
-
connections = t$
|
|
2272
|
+
connections = t$d(
|
|
2265
2273
|
findConnectionsWithin$1(model.instances()),
|
|
2266
2274
|
applyPredicate(where),
|
|
2267
|
-
t$
|
|
2275
|
+
t$e((c) => {
|
|
2268
2276
|
stage.addImplicit(c.boundary);
|
|
2269
2277
|
return c;
|
|
2270
2278
|
})
|
|
@@ -2280,13 +2288,13 @@ const DirectRelationPredicate = {
|
|
|
2280
2288
|
const isTarget = filterIncomingConnections(sources);
|
|
2281
2289
|
postFilter = (c) => isSource(c) !== isTarget(c);
|
|
2282
2290
|
}
|
|
2283
|
-
connections = t$
|
|
2291
|
+
connections = t$d(
|
|
2284
2292
|
sources,
|
|
2285
|
-
t$
|
|
2293
|
+
t$l((source2) => {
|
|
2286
2294
|
const targets = resolveAscendingSiblings(source2);
|
|
2287
2295
|
return findConnectionsBetween$2(source2, targets, dir);
|
|
2288
2296
|
}),
|
|
2289
|
-
n$
|
|
2297
|
+
n$d(postFilter),
|
|
2290
2298
|
applyPredicate(where)
|
|
2291
2299
|
);
|
|
2292
2300
|
break;
|
|
@@ -2300,13 +2308,13 @@ const DirectRelationPredicate = {
|
|
|
2300
2308
|
const isSource = filterOutgoingConnections(targets);
|
|
2301
2309
|
postFilter = (c) => isSource(c) !== isTarget(c);
|
|
2302
2310
|
}
|
|
2303
|
-
connections = t$
|
|
2311
|
+
connections = t$d(
|
|
2304
2312
|
targets,
|
|
2305
|
-
t$
|
|
2313
|
+
t$l((target2) => {
|
|
2306
2314
|
const sources = resolveAscendingSiblings(target2);
|
|
2307
2315
|
return [...sources].flatMap((source2) => findConnection$2(source2, target2, dir));
|
|
2308
2316
|
}),
|
|
2309
|
-
n$
|
|
2317
|
+
n$d(postFilter),
|
|
2310
2318
|
applyPredicate(where)
|
|
2311
2319
|
);
|
|
2312
2320
|
break;
|
|
@@ -2318,10 +2326,10 @@ const DirectRelationPredicate = {
|
|
|
2318
2326
|
const targets = resolveElements$1(model, target);
|
|
2319
2327
|
const isSource = filterOutgoingConnections(sources);
|
|
2320
2328
|
const isTarget = filterIncomingConnections(targets);
|
|
2321
|
-
connections = t$
|
|
2329
|
+
connections = t$d(
|
|
2322
2330
|
sources,
|
|
2323
|
-
t$
|
|
2324
|
-
n$
|
|
2331
|
+
t$l((s) => findConnectionsBetween$2(s, targets, dir)),
|
|
2332
|
+
n$d((c) => isSource(c) && isTarget(c)),
|
|
2325
2333
|
applyPredicate(where)
|
|
2326
2334
|
);
|
|
2327
2335
|
}
|
|
@@ -2380,9 +2388,9 @@ const DirectRelationPredicate = {
|
|
|
2380
2388
|
const satisfies = (connection) => {
|
|
2381
2389
|
return isSource(connection.source) && isTarget(connection.target) || expr.isBidirectional === true && isSource(connection.target) && isTarget(connection.source);
|
|
2382
2390
|
};
|
|
2383
|
-
const deploymentRelationsToExclude = t$
|
|
2391
|
+
const deploymentRelationsToExclude = t$d(
|
|
2384
2392
|
memory.connections,
|
|
2385
|
-
n$
|
|
2393
|
+
n$d(satisfies),
|
|
2386
2394
|
applyPredicate(where)
|
|
2387
2395
|
);
|
|
2388
2396
|
if (deploymentRelationsToExclude.length === 0) {
|
|
@@ -2449,9 +2457,9 @@ const InOutRelationPredicate$1 = {
|
|
|
2449
2457
|
const elements = resolveElements$1(model, expr.inout);
|
|
2450
2458
|
const isIncoming = filterIncomingConnections(elements);
|
|
2451
2459
|
const isOutgoing = filterOutgoingConnections(elements);
|
|
2452
|
-
const toExclude = t$
|
|
2460
|
+
const toExclude = t$d(
|
|
2453
2461
|
memory.connections,
|
|
2454
|
-
n$
|
|
2462
|
+
n$d((c) => isIncoming(c) !== isOutgoing(c)),
|
|
2455
2463
|
applyPredicate(where)
|
|
2456
2464
|
);
|
|
2457
2465
|
stage.excludeConnections(toExclude);
|
|
@@ -2473,10 +2481,10 @@ const WhereRelationPredicate = {
|
|
|
2473
2481
|
const WildcardPredicate$1 = {
|
|
2474
2482
|
include: ({ model, stage, where }) => {
|
|
2475
2483
|
const children = [];
|
|
2476
|
-
const rootElements = t$
|
|
2484
|
+
const rootElements = t$d(
|
|
2477
2485
|
[...model.roots()],
|
|
2478
2486
|
applyElementPredicate(where),
|
|
2479
|
-
t$
|
|
2487
|
+
t$e((root) => {
|
|
2480
2488
|
if (!root.onlyOneInstance()) {
|
|
2481
2489
|
children.push(...root.children());
|
|
2482
2490
|
}
|
|
@@ -2493,7 +2501,7 @@ const WildcardPredicate$1 = {
|
|
|
2493
2501
|
return stage;
|
|
2494
2502
|
},
|
|
2495
2503
|
exclude: ({ stage, memory, where }) => {
|
|
2496
|
-
const elementsToExclude = t$
|
|
2504
|
+
const elementsToExclude = t$d(
|
|
2497
2505
|
[...memory.elements],
|
|
2498
2506
|
applyElementPredicate(where)
|
|
2499
2507
|
);
|
|
@@ -2535,19 +2543,19 @@ function excludeModelRelations(relationsToExclude, { stage, memory }, where, fil
|
|
|
2535
2543
|
if (relationsToExclude.size === 0) {
|
|
2536
2544
|
return stage;
|
|
2537
2545
|
}
|
|
2538
|
-
const toExclude = t$
|
|
2546
|
+
const toExclude = t$d(
|
|
2539
2547
|
memory.connections,
|
|
2540
|
-
n$
|
|
2548
|
+
n$d((c) => filterConnections(c)),
|
|
2541
2549
|
// Find connections that have at least one relation in common with the excluded relations
|
|
2542
|
-
n$
|
|
2543
|
-
t$
|
|
2550
|
+
n$d((c) => hasIntersection(c.relations.model, relationsToExclude)),
|
|
2551
|
+
t$e(
|
|
2544
2552
|
(c) => c.update({
|
|
2545
2553
|
deployment: null,
|
|
2546
2554
|
model: intersection(c.relations.model, relationsToExclude)
|
|
2547
2555
|
})
|
|
2548
2556
|
),
|
|
2549
2557
|
applyPredicate(where),
|
|
2550
|
-
n$
|
|
2558
|
+
n$d((c) => c.nonEmpty())
|
|
2551
2559
|
);
|
|
2552
2560
|
if (toExclude.length === 0) {
|
|
2553
2561
|
return stage;
|
|
@@ -2587,9 +2595,9 @@ function matchConnections(connections, where) {
|
|
|
2587
2595
|
if (!where) {
|
|
2588
2596
|
return connections;
|
|
2589
2597
|
}
|
|
2590
|
-
return t$
|
|
2598
|
+
return t$d(
|
|
2591
2599
|
connections,
|
|
2592
|
-
n$
|
|
2600
|
+
n$d((c) => matchConnection(c, where))
|
|
2593
2601
|
);
|
|
2594
2602
|
}
|
|
2595
2603
|
function toFilterable(relationEndpoint, connectionEndpoint) {
|
|
@@ -2601,7 +2609,7 @@ function toFilterable(relationEndpoint, connectionEndpoint) {
|
|
|
2601
2609
|
};
|
|
2602
2610
|
}
|
|
2603
2611
|
if (isNestedElementOfDeployedInstanceModel(relationEndpoint)) {
|
|
2604
|
-
return t$
|
|
2612
|
+
return t$n(relationEndpoint.element, ["tags", "kind"]);
|
|
2605
2613
|
}
|
|
2606
2614
|
if (isDeployedInstanceModel(relationEndpoint)) {
|
|
2607
2615
|
return {
|
|
@@ -2610,7 +2618,7 @@ function toFilterable(relationEndpoint, connectionEndpoint) {
|
|
|
2610
2618
|
};
|
|
2611
2619
|
}
|
|
2612
2620
|
if (isDeploymentNodeModel(relationEndpoint)) {
|
|
2613
|
-
return t$
|
|
2621
|
+
return t$n(relationEndpoint, ["tags", "kind"]);
|
|
2614
2622
|
}
|
|
2615
2623
|
nonexhaustive(relationEndpoint);
|
|
2616
2624
|
}
|
|
@@ -2655,9 +2663,9 @@ const DeploymentRefPredicate = {
|
|
|
2655
2663
|
},
|
|
2656
2664
|
exclude: ({ expr, stage, memory, where }) => {
|
|
2657
2665
|
const exprPredicate = deploymentExpressionToPredicate(expr);
|
|
2658
|
-
const toExclude = t$
|
|
2666
|
+
const toExclude = t$d(
|
|
2659
2667
|
[...memory.elements],
|
|
2660
|
-
n$
|
|
2668
|
+
n$d(exprPredicate),
|
|
2661
2669
|
applyElementPredicate(where)
|
|
2662
2670
|
);
|
|
2663
2671
|
stage.exclude(toExclude);
|
|
@@ -2717,14 +2725,14 @@ function includeDeployedNodeDescendants(node, { stage, where }) {
|
|
|
2717
2725
|
}
|
|
2718
2726
|
stage.connectWithExisting(descendants, "out");
|
|
2719
2727
|
const allConnected = findConnectedElements(stage);
|
|
2720
|
-
t$
|
|
2728
|
+
t$d(
|
|
2721
2729
|
descendants,
|
|
2722
|
-
n$
|
|
2723
|
-
t$
|
|
2730
|
+
n$d((desc) => allConnected.has(desc)),
|
|
2731
|
+
t$7((desc) => stage.addExplicit(desc))
|
|
2724
2732
|
);
|
|
2725
2733
|
}
|
|
2726
2734
|
function findConnectedElements(stage) {
|
|
2727
|
-
return t$
|
|
2735
|
+
return t$d(
|
|
2728
2736
|
stage.mergedConnections(),
|
|
2729
2737
|
cleanCrossBoundary,
|
|
2730
2738
|
cleanRedundantRelationships,
|
|
@@ -2747,7 +2755,7 @@ let StageFinal$1 = class StageFinal {
|
|
|
2747
2755
|
if (memory.connections.length < 2) {
|
|
2748
2756
|
return memory;
|
|
2749
2757
|
}
|
|
2750
|
-
const connections = t$
|
|
2758
|
+
const connections = t$d(
|
|
2751
2759
|
memory.connections,
|
|
2752
2760
|
// Keep connections
|
|
2753
2761
|
// - between leafs
|
|
@@ -2799,12 +2807,12 @@ let StageFinal$1 = class StageFinal {
|
|
|
2799
2807
|
}
|
|
2800
2808
|
return false;
|
|
2801
2809
|
};
|
|
2802
|
-
t$
|
|
2810
|
+
t$d(
|
|
2803
2811
|
difference(implicits, snapshot),
|
|
2804
2812
|
ifilter((e) => e.isDeploymentNode()),
|
|
2805
2813
|
toArray(),
|
|
2806
2814
|
sortByFqnHierarchically,
|
|
2807
|
-
t$
|
|
2815
|
+
t$7((el) => {
|
|
2808
2816
|
const childrensToWrap = [...el.children()].filter(isFinalOrHasIncludedDescendant).length;
|
|
2809
2817
|
if (childrensToWrap >= 2) {
|
|
2810
2818
|
final.add(el);
|
|
@@ -2827,12 +2835,12 @@ let StageFinal$1 = class StageFinal {
|
|
|
2827
2835
|
const tree = treeFromMemoryState(memory, "final");
|
|
2828
2836
|
const stage = memory.stageExclude({});
|
|
2829
2837
|
const isRemovable = (el) => !(boundaries.has(el) || memory.explicits.has(el) || tree.hasInOut(el) || tree.root.has(el));
|
|
2830
|
-
const singleRoot = t$
|
|
2838
|
+
const singleRoot = t$5([...tree.root]);
|
|
2831
2839
|
if (singleRoot && !memory.explicits.has(singleRoot)) {
|
|
2832
2840
|
stage.exclude(singleRoot);
|
|
2833
2841
|
}
|
|
2834
2842
|
for (const el of memory.final) {
|
|
2835
|
-
const singleChild = t$
|
|
2843
|
+
const singleChild = t$5(tree.children(el));
|
|
2836
2844
|
if (singleChild && !tree.hasInOut(singleChild) && isRemovable(el)) {
|
|
2837
2845
|
stage.exclude(el);
|
|
2838
2846
|
}
|
|
@@ -2939,7 +2947,7 @@ function computeDeploymentView(likec4model, {
|
|
|
2939
2947
|
rules,
|
|
2940
2948
|
sorted.nodes
|
|
2941
2949
|
);
|
|
2942
|
-
const autoLayoutRule = t$
|
|
2950
|
+
const autoLayoutRule = t$8(rules, isViewRuleAutoLayout);
|
|
2943
2951
|
const elementNotations = buildElementNotations(nodes);
|
|
2944
2952
|
return calcViewLayoutHash({
|
|
2945
2953
|
...view,
|
|
@@ -2951,7 +2959,7 @@ function computeDeploymentView(likec4model, {
|
|
|
2951
2959
|
...autoLayoutRule?.rankSep && { rankSep: autoLayoutRule.rankSep }
|
|
2952
2960
|
},
|
|
2953
2961
|
edges: sorted.edges,
|
|
2954
|
-
nodes: t$
|
|
2962
|
+
nodes: t$e(nodes, (n) => {
|
|
2955
2963
|
if (n.icon === "none") {
|
|
2956
2964
|
delete n.icon;
|
|
2957
2965
|
}
|
|
@@ -3133,7 +3141,7 @@ function elementsFromSteps(model, steps) {
|
|
|
3133
3141
|
actors.push(target);
|
|
3134
3142
|
}
|
|
3135
3143
|
};
|
|
3136
|
-
for (const step of t$
|
|
3144
|
+
for (const step of t$l(steps, flattenSteps)) {
|
|
3137
3145
|
const source = model.element(step.source);
|
|
3138
3146
|
const target = model.element(step.target);
|
|
3139
3147
|
let sourceColumn = actors.indexOf(source);
|
|
@@ -3166,29 +3174,29 @@ function findRelations(source, target, currentViewId) {
|
|
|
3166
3174
|
line: relation2.$relationship.line
|
|
3167
3175
|
});
|
|
3168
3176
|
}
|
|
3169
|
-
const alltags = t$
|
|
3177
|
+
const alltags = t$d(
|
|
3170
3178
|
relationships,
|
|
3171
|
-
t$
|
|
3172
|
-
n$
|
|
3179
|
+
t$l((r) => r.tags),
|
|
3180
|
+
n$e()
|
|
3173
3181
|
);
|
|
3174
|
-
const tags = t$
|
|
3175
|
-
const relations = t$
|
|
3176
|
-
const relation = n$
|
|
3182
|
+
const tags = t$b(alltags, 1) ? alltags : void 0;
|
|
3183
|
+
const relations = t$e(relationships, (r) => r.id);
|
|
3184
|
+
const relation = n$9(relationships);
|
|
3177
3185
|
let navigateTo = relation.$relationship.navigateTo;
|
|
3178
3186
|
if (navigateTo === currentViewId) {
|
|
3179
3187
|
navigateTo = void 0;
|
|
3180
3188
|
}
|
|
3181
3189
|
if (!navigateTo) {
|
|
3182
|
-
navigateTo = t$
|
|
3190
|
+
navigateTo = t$d(
|
|
3183
3191
|
relationships,
|
|
3184
|
-
t$
|
|
3192
|
+
t$l(
|
|
3185
3193
|
(r) => r.$relationship.navigateTo && r.$relationship.navigateTo !== currentViewId ? r.$relationship.navigateTo : []
|
|
3186
3194
|
),
|
|
3187
|
-
n$
|
|
3188
|
-
t$
|
|
3195
|
+
n$e(),
|
|
3196
|
+
t$5()
|
|
3189
3197
|
);
|
|
3190
3198
|
}
|
|
3191
|
-
const commonProperties = t$
|
|
3199
|
+
const commonProperties = t$d(
|
|
3192
3200
|
relationships,
|
|
3193
3201
|
t$2((acc, { title, $relationship: r }) => {
|
|
3194
3202
|
e$4(title) && acc.title.add(title);
|
|
@@ -3207,10 +3215,10 @@ function findRelations(source, target, currentViewId) {
|
|
|
3207
3215
|
tags: tags ?? void 0,
|
|
3208
3216
|
relations,
|
|
3209
3217
|
navigateTo,
|
|
3210
|
-
kind: t$
|
|
3211
|
-
title: t$
|
|
3212
|
-
color: t$
|
|
3213
|
-
line: t$
|
|
3218
|
+
kind: t$5([...commonProperties.kind]),
|
|
3219
|
+
title: t$5([...commonProperties.title]),
|
|
3220
|
+
color: t$5([...commonProperties.color]),
|
|
3221
|
+
line: t$5([...commonProperties.line])
|
|
3214
3222
|
});
|
|
3215
3223
|
}
|
|
3216
3224
|
|
|
@@ -3233,7 +3241,7 @@ class DynamicViewCompute {
|
|
|
3233
3241
|
const rules = resolveGlobalRulesInDynamicView(_rules, this.model.globals);
|
|
3234
3242
|
const explicits = elementsFromIncludeProperties(this.model, rules);
|
|
3235
3243
|
const fromSteps = elementsFromSteps(this.model, viewSteps);
|
|
3236
|
-
const actors = t$
|
|
3244
|
+
const actors = t$d(
|
|
3237
3245
|
union(
|
|
3238
3246
|
// First all actors, that are explicitly included
|
|
3239
3247
|
intersection(explicits, fromSteps),
|
|
@@ -3366,7 +3374,7 @@ class DynamicViewCompute {
|
|
|
3366
3374
|
actors.map((e) => nonNullable(nodesMap.get(e.id)))
|
|
3367
3375
|
)
|
|
3368
3376
|
);
|
|
3369
|
-
const autoLayoutRule = t$
|
|
3377
|
+
const autoLayoutRule = t$8(rules, isViewRuleAutoLayout);
|
|
3370
3378
|
const nodeNotations = buildElementNotations(nodes);
|
|
3371
3379
|
return calcViewLayoutHash({
|
|
3372
3380
|
...view,
|
|
@@ -3378,7 +3386,7 @@ class DynamicViewCompute {
|
|
|
3378
3386
|
...autoLayoutRule?.nodeSep && { nodeSep: autoLayoutRule.nodeSep },
|
|
3379
3387
|
...autoLayoutRule?.rankSep && { rankSep: autoLayoutRule.rankSep }
|
|
3380
3388
|
},
|
|
3381
|
-
nodes: t$
|
|
3389
|
+
nodes: t$e(nodes, (n) => {
|
|
3382
3390
|
if (n.icon === "none") {
|
|
3383
3391
|
delete n.icon;
|
|
3384
3392
|
}
|
|
@@ -3471,7 +3479,7 @@ function applyCustomRelationProperties(_rules, nodes, _edges) {
|
|
|
3471
3479
|
if (!source || !target) {
|
|
3472
3480
|
return;
|
|
3473
3481
|
}
|
|
3474
|
-
if (satisfies({ source, target, ...t$
|
|
3482
|
+
if (satisfies({ source, target, ...t$n(edge, ["kind", "tags"]) })) {
|
|
3475
3483
|
edges[i] = {
|
|
3476
3484
|
...edge,
|
|
3477
3485
|
...props,
|
|
@@ -3512,10 +3520,10 @@ class NodesGroup {
|
|
|
3512
3520
|
|
|
3513
3521
|
class StageExclude extends AbstractStageExclude {
|
|
3514
3522
|
excludeRelations(excluded) {
|
|
3515
|
-
t$
|
|
3523
|
+
t$d(
|
|
3516
3524
|
this.memory.connections,
|
|
3517
|
-
n$
|
|
3518
|
-
t$
|
|
3525
|
+
n$d((c) => hasIntersection(c.relations, excluded)),
|
|
3526
|
+
t$7((c) => {
|
|
3519
3527
|
this.excludeConnections(
|
|
3520
3528
|
c.update(intersection(c.relations, excluded))
|
|
3521
3529
|
);
|
|
@@ -3610,18 +3618,18 @@ class StageInclude extends AbstractStageInclude {
|
|
|
3610
3618
|
if (ModelExpression.isRelationExpr(this.expression)) {
|
|
3611
3619
|
return connections;
|
|
3612
3620
|
}
|
|
3613
|
-
t$
|
|
3621
|
+
t$d(
|
|
3614
3622
|
connections,
|
|
3615
|
-
t$
|
|
3616
|
-
t$
|
|
3617
|
-
t$
|
|
3623
|
+
t$7(({ source, target, boundary }) => {
|
|
3624
|
+
t$d(
|
|
3625
|
+
t$m(
|
|
3618
3626
|
[...toArray(source.ancestors()).reverse(), source],
|
|
3619
3627
|
[...toArray(target.ancestors()).reverse(), target]
|
|
3620
3628
|
),
|
|
3621
3629
|
// Filter out common ancestors
|
|
3622
|
-
t$
|
|
3630
|
+
t$9(([sourceAncestor, targetAncestor]) => sourceAncestor === targetAncestor),
|
|
3623
3631
|
n(1),
|
|
3624
|
-
t$
|
|
3632
|
+
t$7(([sourceAncestor, targetAncestor]) => {
|
|
3625
3633
|
if (sourceAncestor === source && targetAncestor === target) {
|
|
3626
3634
|
this.addImplicitWithinScope(boundary);
|
|
3627
3635
|
return;
|
|
@@ -3773,7 +3781,7 @@ class ActiveGroupMemory extends Memory {
|
|
|
3773
3781
|
}
|
|
3774
3782
|
|
|
3775
3783
|
function findRedundantConnections(connections) {
|
|
3776
|
-
return t$
|
|
3784
|
+
return t$d(
|
|
3777
3785
|
[...connections],
|
|
3778
3786
|
mergeConnections,
|
|
3779
3787
|
t$2((reducedConnections, connection, _, all) => {
|
|
@@ -3853,11 +3861,11 @@ class StageFinal {
|
|
|
3853
3861
|
}
|
|
3854
3862
|
return false;
|
|
3855
3863
|
};
|
|
3856
|
-
t$
|
|
3864
|
+
t$d(
|
|
3857
3865
|
difference(implicits, snapshot),
|
|
3858
3866
|
toArray(),
|
|
3859
3867
|
sortByFqnHierarchically,
|
|
3860
|
-
t$
|
|
3868
|
+
t$7((el) => {
|
|
3861
3869
|
const childrensToWrap = [...el.children()].filter(isFinalOrHasIncludedDescendant).length;
|
|
3862
3870
|
if (childrensToWrap >= 2) {
|
|
3863
3871
|
final.add(el);
|
|
@@ -3880,12 +3888,12 @@ class StageFinal {
|
|
|
3880
3888
|
const tree = treeFromMemoryState(memory, "final");
|
|
3881
3889
|
const stage = memory.stageExclude({});
|
|
3882
3890
|
const isRemovable = (el) => !(boundaries.has(el) || memory.explicits.has(el) || tree.hasInOut(el) || tree.root.has(el));
|
|
3883
|
-
const singleRoot = t$
|
|
3891
|
+
const singleRoot = t$5([...tree.root]);
|
|
3884
3892
|
if (singleRoot && !memory.explicits.has(singleRoot)) {
|
|
3885
3893
|
stage.exclude(singleRoot);
|
|
3886
3894
|
}
|
|
3887
3895
|
for (const el of memory.final) {
|
|
3888
|
-
const singleChild = t$
|
|
3896
|
+
const singleChild = t$5(tree.children(el));
|
|
3889
3897
|
if (singleChild && !tree.hasInOut(singleChild) && isRemovable(el)) {
|
|
3890
3898
|
stage.exclude(el);
|
|
3891
3899
|
}
|
|
@@ -3939,7 +3947,7 @@ function includeDescendantsFromMemory(elements, memory) {
|
|
|
3939
3947
|
if (memory.isEmpty() || elements.length === 0) {
|
|
3940
3948
|
return elements;
|
|
3941
3949
|
}
|
|
3942
|
-
const descedantsOf = t$
|
|
3950
|
+
const descedantsOf = t$g(elements.map((e) => isDescendantOf(e)));
|
|
3943
3951
|
const fromMemory = toArray(
|
|
3944
3952
|
ifilter(
|
|
3945
3953
|
memory.elements,
|
|
@@ -4030,7 +4038,7 @@ function toComputedEdges(connections) {
|
|
|
4030
4038
|
const relations = [
|
|
4031
4039
|
...e.relations
|
|
4032
4040
|
];
|
|
4033
|
-
invariant(t$
|
|
4041
|
+
invariant(t$b(relations, 1), "Edge must have at least one relation");
|
|
4034
4042
|
const $defaults = e.source.$model.$styles.defaults;
|
|
4035
4043
|
const source = e.source.id;
|
|
4036
4044
|
const target = e.target.id;
|
|
@@ -4044,8 +4052,8 @@ function toComputedEdges(connections) {
|
|
|
4044
4052
|
relations.map((r) => r.$relationship),
|
|
4045
4053
|
// Prefer only single relationship
|
|
4046
4054
|
// https://github.com/likec4/likec4/issues/1423
|
|
4047
|
-
t$
|
|
4048
|
-
n$
|
|
4055
|
+
t$5(
|
|
4056
|
+
n$d(relations, (r) => r.source.id === source && r.target.id === target)
|
|
4049
4057
|
)?.$relationship
|
|
4050
4058
|
);
|
|
4051
4059
|
const edge = exact({
|
|
@@ -4083,11 +4091,11 @@ const DirectRelationExprPredicate = {
|
|
|
4083
4091
|
// This is a special case, we look for all relationships that satisfy the where clause
|
|
4084
4092
|
// * -> * ; Empty memory; Where clause
|
|
4085
4093
|
case (sourceIsWildcard && targetIsWildcard && memory.isEmpty() && where !== NoWhere): {
|
|
4086
|
-
const connections2 = t$
|
|
4094
|
+
const connections2 = t$d(
|
|
4087
4095
|
model.relationships(),
|
|
4088
4096
|
ifilter(where),
|
|
4089
4097
|
toArray(),
|
|
4090
|
-
t$
|
|
4098
|
+
t$e((r) => new ConnectionModel(r.source, r.target, /* @__PURE__ */ new Set([r])))
|
|
4091
4099
|
);
|
|
4092
4100
|
stage.addConnections(connections2);
|
|
4093
4101
|
return stage;
|
|
@@ -4111,10 +4119,10 @@ const DirectRelationExprPredicate = {
|
|
|
4111
4119
|
// element -> *; Where clause
|
|
4112
4120
|
case (!sourceIsWildcard && targetIsWildcard && where !== NoWhere): {
|
|
4113
4121
|
const sources = resolveElements(model, source);
|
|
4114
|
-
const connections2 = t$
|
|
4122
|
+
const connections2 = t$d(
|
|
4115
4123
|
sources,
|
|
4116
|
-
t$
|
|
4117
|
-
(source2) => t$
|
|
4124
|
+
t$l(
|
|
4125
|
+
(source2) => t$d(
|
|
4118
4126
|
source2,
|
|
4119
4127
|
e(e$3(isBidirectional === true), {
|
|
4120
4128
|
onTrue: (s) => union(s.allIncoming, s.allOutgoing),
|
|
@@ -4123,12 +4131,12 @@ const DirectRelationExprPredicate = {
|
|
|
4123
4131
|
ifilter(where),
|
|
4124
4132
|
iunique(),
|
|
4125
4133
|
toArray(),
|
|
4126
|
-
t$
|
|
4134
|
+
t$4((r) => r.source === source2),
|
|
4127
4135
|
([outgoing, incoming]) => t$p(
|
|
4128
|
-
t$
|
|
4136
|
+
t$d(
|
|
4129
4137
|
outgoing,
|
|
4130
|
-
n$
|
|
4131
|
-
t$
|
|
4138
|
+
n$d((r) => !isAncestorOrDescendantOf(source2, r.target)),
|
|
4139
|
+
t$e(
|
|
4132
4140
|
(outgoing2) => new ConnectionModel(
|
|
4133
4141
|
source2,
|
|
4134
4142
|
outgoing2.target,
|
|
@@ -4136,10 +4144,10 @@ const DirectRelationExprPredicate = {
|
|
|
4136
4144
|
)
|
|
4137
4145
|
)
|
|
4138
4146
|
),
|
|
4139
|
-
t$
|
|
4147
|
+
t$d(
|
|
4140
4148
|
incoming,
|
|
4141
|
-
n$
|
|
4142
|
-
t$
|
|
4149
|
+
n$d((r) => !isAncestorOrDescendantOf(source2, r.source)),
|
|
4150
|
+
t$e(
|
|
4143
4151
|
(incoming2) => new ConnectionModel(
|
|
4144
4152
|
incoming2.source,
|
|
4145
4153
|
source2,
|
|
@@ -4169,10 +4177,10 @@ const DirectRelationExprPredicate = {
|
|
|
4169
4177
|
// * -> element; Where clause
|
|
4170
4178
|
case (sourceIsWildcard && !targetIsWildcard && where !== NoWhere): {
|
|
4171
4179
|
const targets = resolveElements(model, target);
|
|
4172
|
-
const connections2 = t$
|
|
4180
|
+
const connections2 = t$d(
|
|
4173
4181
|
targets,
|
|
4174
|
-
t$
|
|
4175
|
-
(target2) => t$
|
|
4182
|
+
t$l(
|
|
4183
|
+
(target2) => t$d(
|
|
4176
4184
|
target2,
|
|
4177
4185
|
e(e$3(isBidirectional === true), {
|
|
4178
4186
|
onTrue: (s) => union(s.allIncoming, s.allOutgoing),
|
|
@@ -4180,12 +4188,12 @@ const DirectRelationExprPredicate = {
|
|
|
4180
4188
|
}),
|
|
4181
4189
|
ifilter(where),
|
|
4182
4190
|
toArray(),
|
|
4183
|
-
t$
|
|
4191
|
+
t$4((r) => r.target === target2),
|
|
4184
4192
|
([incoming, outgoing]) => t$p(
|
|
4185
|
-
t$
|
|
4193
|
+
t$d(
|
|
4186
4194
|
outgoing,
|
|
4187
|
-
n$
|
|
4188
|
-
t$
|
|
4195
|
+
n$d((r) => !isAncestorOrDescendantOf(target2, r.target)),
|
|
4196
|
+
t$e(
|
|
4189
4197
|
(outgoing2) => new ConnectionModel(
|
|
4190
4198
|
target2,
|
|
4191
4199
|
outgoing2.target,
|
|
@@ -4193,10 +4201,10 @@ const DirectRelationExprPredicate = {
|
|
|
4193
4201
|
)
|
|
4194
4202
|
)
|
|
4195
4203
|
),
|
|
4196
|
-
t$
|
|
4204
|
+
t$d(
|
|
4197
4205
|
incoming,
|
|
4198
|
-
n$
|
|
4199
|
-
t$
|
|
4206
|
+
n$d((r) => !isAncestorOrDescendantOf(target2, r.source)),
|
|
4207
|
+
t$e(
|
|
4200
4208
|
(incoming2) => new ConnectionModel(
|
|
4201
4209
|
incoming2.source,
|
|
4202
4210
|
target2,
|
|
@@ -4247,9 +4255,9 @@ const DirectRelationExprPredicate = {
|
|
|
4247
4255
|
switch (true) {
|
|
4248
4256
|
// * -> *
|
|
4249
4257
|
case (sourceIsWildcard && targetIsWildcard): {
|
|
4250
|
-
relations = t$
|
|
4258
|
+
relations = t$d(
|
|
4251
4259
|
memory.connections,
|
|
4252
|
-
t$
|
|
4260
|
+
t$l(t$i(
|
|
4253
4261
|
e$8("relations"),
|
|
4254
4262
|
ifilter(where),
|
|
4255
4263
|
toArray()
|
|
@@ -4261,10 +4269,10 @@ const DirectRelationExprPredicate = {
|
|
|
4261
4269
|
// element -> *
|
|
4262
4270
|
case (!sourceIsWildcard && targetIsWildcard): {
|
|
4263
4271
|
const sources = resolveElements(model, source);
|
|
4264
|
-
relations = t$
|
|
4272
|
+
relations = t$d(
|
|
4265
4273
|
sources,
|
|
4266
|
-
t$
|
|
4267
|
-
(source2) => t$
|
|
4274
|
+
t$l(
|
|
4275
|
+
(source2) => t$d(
|
|
4268
4276
|
source2,
|
|
4269
4277
|
e(e$3(isBidirectional === true), {
|
|
4270
4278
|
onTrue: (s) => union(s.allIncoming, s.allOutgoing),
|
|
@@ -4281,10 +4289,10 @@ const DirectRelationExprPredicate = {
|
|
|
4281
4289
|
// * -> element
|
|
4282
4290
|
case (sourceIsWildcard && !targetIsWildcard): {
|
|
4283
4291
|
const targets = resolveElements(model, target);
|
|
4284
|
-
relations = t$
|
|
4292
|
+
relations = t$d(
|
|
4285
4293
|
targets,
|
|
4286
|
-
t$
|
|
4287
|
-
(target2) => t$
|
|
4294
|
+
t$l(
|
|
4295
|
+
(target2) => t$d(
|
|
4288
4296
|
target2,
|
|
4289
4297
|
e(e$3(isBidirectional === true), {
|
|
4290
4298
|
onTrue: (s) => union(s.allIncoming, s.allOutgoing),
|
|
@@ -4325,7 +4333,7 @@ const DirectRelationExprPredicate = {
|
|
|
4325
4333
|
};
|
|
4326
4334
|
function resolveWildcard(nonWildcard, { memory, model }) {
|
|
4327
4335
|
let sources = resolveElements(model, nonWildcard);
|
|
4328
|
-
if (!t$
|
|
4336
|
+
if (!t$b(sources, 1)) {
|
|
4329
4337
|
return [[], []];
|
|
4330
4338
|
}
|
|
4331
4339
|
if (ModelFqnExpr.isModelRef(nonWildcard)) {
|
|
@@ -4336,9 +4344,9 @@ function resolveWildcard(nonWildcard, { memory, model }) {
|
|
|
4336
4344
|
includeDescendantsFromMemory(targets2, memory)
|
|
4337
4345
|
];
|
|
4338
4346
|
}
|
|
4339
|
-
const targets = t$
|
|
4347
|
+
const targets = t$d(
|
|
4340
4348
|
sources,
|
|
4341
|
-
t$
|
|
4349
|
+
t$e((el) => el.ascendingSiblings()),
|
|
4342
4350
|
iflat(),
|
|
4343
4351
|
iunique(),
|
|
4344
4352
|
toArray(),
|
|
@@ -4369,7 +4377,7 @@ const IncomingExprPredicate = {
|
|
|
4369
4377
|
const visibleElements = [...memory.elements];
|
|
4370
4378
|
if (visibleElements.length === 0) {
|
|
4371
4379
|
visibleElements.push(
|
|
4372
|
-
...n$
|
|
4380
|
+
...n$e(
|
|
4373
4381
|
targets.flatMap((el) => [...el.ascendingSiblings()])
|
|
4374
4382
|
)
|
|
4375
4383
|
);
|
|
@@ -4416,7 +4424,7 @@ function incomingConnectionPredicate(model, expr) {
|
|
|
4416
4424
|
}
|
|
4417
4425
|
case (ModelFqnExpr.isModelRef(expr) && expr.selector === "children"): {
|
|
4418
4426
|
const fqn = FqnRef.flatten(expr.ref);
|
|
4419
|
-
return t$
|
|
4427
|
+
return t$g(
|
|
4420
4428
|
[...model.children(fqn)].map(
|
|
4421
4429
|
(el) => Connection.isIncoming(el.id)
|
|
4422
4430
|
)
|
|
@@ -4424,7 +4432,7 @@ function incomingConnectionPredicate(model, expr) {
|
|
|
4424
4432
|
}
|
|
4425
4433
|
case (ModelFqnExpr.isModelRef(expr) && expr.selector === "descendants"): {
|
|
4426
4434
|
const fqn = FqnRef.flatten(expr.ref);
|
|
4427
|
-
return t$
|
|
4435
|
+
return t$g([
|
|
4428
4436
|
Connection.isInside(fqn),
|
|
4429
4437
|
...[...model.children(fqn)].map(
|
|
4430
4438
|
(el) => Connection.isIncoming(el.id)
|
|
@@ -4433,7 +4441,7 @@ function incomingConnectionPredicate(model, expr) {
|
|
|
4433
4441
|
}
|
|
4434
4442
|
case (ModelFqnExpr.isModelRef(expr) && expr.selector === "expanded"): {
|
|
4435
4443
|
const fqn = FqnRef.flatten(expr.ref);
|
|
4436
|
-
return t$
|
|
4444
|
+
return t$g([
|
|
4437
4445
|
Connection.isIncoming(fqn),
|
|
4438
4446
|
Connection.isInside(fqn)
|
|
4439
4447
|
]);
|
|
@@ -4464,7 +4472,7 @@ const InOutRelationPredicate = {
|
|
|
4464
4472
|
const elements = resolveAndIncludeFromMemory(inout, { memory, model });
|
|
4465
4473
|
let visibleElements = [...memory.elements];
|
|
4466
4474
|
if (visibleElements.length === 0) {
|
|
4467
|
-
visibleElements = n$
|
|
4475
|
+
visibleElements = n$e(
|
|
4468
4476
|
elements.flatMap((el) => toArray(el.ascendingSiblings()))
|
|
4469
4477
|
);
|
|
4470
4478
|
}
|
|
@@ -4521,7 +4529,7 @@ const OutgoingExprPredicate = {
|
|
|
4521
4529
|
const visibleElements = [...memory.elements];
|
|
4522
4530
|
if (visibleElements.length === 0) {
|
|
4523
4531
|
visibleElements.push(
|
|
4524
|
-
...n$
|
|
4532
|
+
...n$e(
|
|
4525
4533
|
elements.flatMap((el) => [...el.ascendingSiblings()])
|
|
4526
4534
|
)
|
|
4527
4535
|
);
|
|
@@ -4570,7 +4578,7 @@ function outgoingConnectionPredicate(model, expr) {
|
|
|
4570
4578
|
}
|
|
4571
4579
|
case (ModelFqnExpr.isModelRef(expr) && expr.selector === "children"): {
|
|
4572
4580
|
const fqn = FqnRef.flatten(expr.ref);
|
|
4573
|
-
return t$
|
|
4581
|
+
return t$g(
|
|
4574
4582
|
[...model.children(fqn)].map(
|
|
4575
4583
|
(el) => Connection.isOutgoing(el.id)
|
|
4576
4584
|
)
|
|
@@ -4578,7 +4586,7 @@ function outgoingConnectionPredicate(model, expr) {
|
|
|
4578
4586
|
}
|
|
4579
4587
|
case (ModelFqnExpr.isModelRef(expr) && expr.selector === "descendants"): {
|
|
4580
4588
|
const fqn = FqnRef.flatten(expr.ref);
|
|
4581
|
-
return t$
|
|
4589
|
+
return t$g([
|
|
4582
4590
|
Connection.isInside(fqn),
|
|
4583
4591
|
...[...model.children(fqn)].map(
|
|
4584
4592
|
(el) => Connection.isOutgoing(el.id)
|
|
@@ -4587,7 +4595,7 @@ function outgoingConnectionPredicate(model, expr) {
|
|
|
4587
4595
|
}
|
|
4588
4596
|
case (ModelFqnExpr.isModelRef(expr) && expr.selector === "expanded"): {
|
|
4589
4597
|
const fqn = FqnRef.flatten(expr.ref);
|
|
4590
|
-
return t$
|
|
4598
|
+
return t$g([
|
|
4591
4599
|
Connection.isOutgoing(fqn),
|
|
4592
4600
|
Connection.isInside(fqn)
|
|
4593
4601
|
]);
|
|
@@ -4652,7 +4660,7 @@ const WildcardPredicate = {
|
|
|
4652
4660
|
exclude: ({ scope, memory, stage, where }) => {
|
|
4653
4661
|
if (where !== NoWhere) {
|
|
4654
4662
|
stage.exclude(
|
|
4655
|
-
n$
|
|
4663
|
+
n$d(
|
|
4656
4664
|
[...memory.elements],
|
|
4657
4665
|
where
|
|
4658
4666
|
)
|
|
@@ -4678,7 +4686,7 @@ function processElementPredicate(expr, op, ctx) {
|
|
|
4678
4686
|
case ModelFqnExpr.isWhere(expr): {
|
|
4679
4687
|
const where = whereOperatorAsPredicate(expr.where.condition);
|
|
4680
4688
|
const filterWhere = (elements) => {
|
|
4681
|
-
return n$
|
|
4689
|
+
return n$d(elements, where);
|
|
4682
4690
|
};
|
|
4683
4691
|
return processElementPredicate(expr.where.expr, op, { ...ctx, where, filterWhere });
|
|
4684
4692
|
}
|
|
@@ -4710,13 +4718,13 @@ function processRelationtPredicate(expr, op, ctx) {
|
|
|
4710
4718
|
case ModelRelationExpr.isWhere(expr): {
|
|
4711
4719
|
const where = whereOperatorAsPredicate(expr.where.condition);
|
|
4712
4720
|
const filterRelations = (relations) => {
|
|
4713
|
-
return new Set(n$
|
|
4721
|
+
return new Set(n$d([...relations], where));
|
|
4714
4722
|
};
|
|
4715
4723
|
const filterWhere = (connections) => {
|
|
4716
|
-
return t$
|
|
4724
|
+
return t$d(
|
|
4717
4725
|
connections,
|
|
4718
|
-
t$
|
|
4719
|
-
n$
|
|
4726
|
+
t$e((c) => new ConnectionModel(c.source, c.target, filterRelations(c.relations))),
|
|
4727
|
+
n$d((c) => c.nonEmpty())
|
|
4720
4728
|
);
|
|
4721
4729
|
};
|
|
4722
4730
|
return processRelationtPredicate(expr.where.expr, op, {
|
|
@@ -4822,8 +4830,9 @@ function computeElementView(likec4model, {
|
|
|
4822
4830
|
sorted.nodes
|
|
4823
4831
|
)
|
|
4824
4832
|
);
|
|
4825
|
-
const autoLayoutRule = t$
|
|
4833
|
+
const autoLayoutRule = t$8(rules, isViewRuleAutoLayout);
|
|
4826
4834
|
const nodeNotations = buildElementNotations(nodes);
|
|
4835
|
+
const ranks = collectRankConstraints(rules, nodes);
|
|
4827
4836
|
return calcViewLayoutHash({
|
|
4828
4837
|
...view,
|
|
4829
4838
|
_stage: "computed",
|
|
@@ -4833,7 +4842,7 @@ function computeElementView(likec4model, {
|
|
|
4833
4842
|
...autoLayoutRule?.rankSep && { rankSep: autoLayoutRule.rankSep }
|
|
4834
4843
|
},
|
|
4835
4844
|
edges: applyCustomRelationProperties(rules, nodes, sorted.edges),
|
|
4836
|
-
nodes: t$
|
|
4845
|
+
nodes: t$e(nodes, (n) => {
|
|
4837
4846
|
if (n.icon === "none") {
|
|
4838
4847
|
delete n.icon;
|
|
4839
4848
|
}
|
|
@@ -4843,9 +4852,32 @@ function computeElementView(likec4model, {
|
|
|
4843
4852
|
notation: {
|
|
4844
4853
|
nodes: nodeNotations
|
|
4845
4854
|
}
|
|
4846
|
-
}
|
|
4855
|
+
},
|
|
4856
|
+
...ranks.length > 0 && { ranks }
|
|
4847
4857
|
});
|
|
4848
4858
|
}
|
|
4859
|
+
function collectRankConstraints(rules, nodes) {
|
|
4860
|
+
const constraints = [];
|
|
4861
|
+
for (const rule of rules) {
|
|
4862
|
+
if (!isViewRuleRank(rule) || rule.targets.length === 0) {
|
|
4863
|
+
continue;
|
|
4864
|
+
}
|
|
4865
|
+
const isTargeted = t$g(rule.targets.map(elementExprToPredicate));
|
|
4866
|
+
const nodesInRank = t$d(
|
|
4867
|
+
nodes,
|
|
4868
|
+
n$d(isTargeted),
|
|
4869
|
+
t$e((n) => n.id)
|
|
4870
|
+
);
|
|
4871
|
+
if (!t$b(nodesInRank, 1)) {
|
|
4872
|
+
continue;
|
|
4873
|
+
}
|
|
4874
|
+
constraints.push({
|
|
4875
|
+
type: rule.rank,
|
|
4876
|
+
nodes: nodesInRank
|
|
4877
|
+
});
|
|
4878
|
+
}
|
|
4879
|
+
return constraints;
|
|
4880
|
+
}
|
|
4849
4881
|
function assignElementsToGroups(memory) {
|
|
4850
4882
|
if (memory.groups.length === 0) {
|
|
4851
4883
|
return memory;
|
|
@@ -4874,9 +4906,9 @@ function assignElementsToGroups(memory) {
|
|
|
4874
4906
|
}
|
|
4875
4907
|
return false;
|
|
4876
4908
|
};
|
|
4877
|
-
t$
|
|
4909
|
+
t$d(
|
|
4878
4910
|
sortParentsFirst([...memory.explicitFirstSeenIn.keys()]),
|
|
4879
|
-
t$
|
|
4911
|
+
t$7((el) => {
|
|
4880
4912
|
if (!isAncestorAssigned(el)) {
|
|
4881
4913
|
const groupId = nonNullable(memory.explicitFirstSeenIn.get(el));
|
|
4882
4914
|
assignedTo.set(el, groupId);
|
|
@@ -4884,10 +4916,10 @@ function assignElementsToGroups(memory) {
|
|
|
4884
4916
|
}
|
|
4885
4917
|
})
|
|
4886
4918
|
);
|
|
4887
|
-
t$
|
|
4919
|
+
t$d(
|
|
4888
4920
|
sortParentsFirst([...memory.lastSeenIn.keys()]),
|
|
4889
|
-
n$
|
|
4890
|
-
t$
|
|
4921
|
+
n$d((el) => !assignedTo.has(el)),
|
|
4922
|
+
t$7((el) => {
|
|
4891
4923
|
if (isAncestorAssigned(el)) {
|
|
4892
4924
|
return;
|
|
4893
4925
|
}
|
|
@@ -4956,4 +4988,4 @@ function computeLikeC4Model(parsed) {
|
|
|
4956
4988
|
return LikeC4Model.create(computeParsedModelData(parsed));
|
|
4957
4989
|
}
|
|
4958
4990
|
|
|
4959
|
-
export { t$
|
|
4991
|
+
export { t$6 as a, computeParsedModelData as b, computeLikeC4Model as c, computeView as d, n$6 as n, topologicalSortExports as t, unsafeComputeView as u, willCreateCycle as w };
|