@likec4/core 1.17.1 → 1.19.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/LICENSE +1 -1
- package/dist/builder/index.d.mts +502 -0
- package/dist/builder/index.d.ts +502 -0
- package/dist/builder/index.js +871 -0
- package/dist/compute-view/index.d.mts +22 -0
- package/dist/compute-view/index.d.ts +22 -0
- package/dist/compute-view/index.js +78 -0
- package/dist/index.d.mts +10 -919
- package/dist/index.d.ts +10 -919
- package/dist/{index.mjs → index.js} +7 -1688
- package/dist/model/index.d.mts +254 -0
- package/dist/model/index.d.ts +254 -0
- package/dist/model/index.js +1 -0
- package/dist/shared/chunk-RAAYCPUM.M-JWF7SS.js +21 -0
- package/dist/shared/core.BIfgabEw.d.ts +719 -0
- package/dist/shared/core.BZ9Msq7w.d.mts +719 -0
- package/dist/shared/{core.CoLQkcYL.d.cts → core.C05RDLhi.d.ts} +460 -362
- package/dist/shared/{core.CoLQkcYL.d.mts → core.CmYMqgha.d.mts} +460 -362
- package/dist/shared/core.D6-fWbM3.d.ts +127 -0
- package/dist/shared/core.D74xkKkG.d.mts +148 -0
- package/dist/shared/core.D74xkKkG.d.ts +148 -0
- package/dist/shared/core.sLaWHBjR.d.mts +127 -0
- package/dist/shared/index.-BdzdI2C.js +7443 -0
- package/dist/shared/object_hash.CE_oF3I3.js +1222 -0
- package/dist/shared/{core.BXTs-8n7.mjs → view.CyZrG8BJ.js} +108 -47
- package/dist/types/index.d.mts +71 -1
- package/dist/types/index.d.ts +71 -1
- package/dist/types/index.js +20 -0
- package/dist/utils/index.d.mts +404 -0
- package/dist/utils/index.d.ts +404 -0
- package/dist/utils/index.js +330 -0
- package/package.json +59 -47
- package/src/builder/Builder-style1.test-d.ts +190 -0
- package/src/builder/Builder-style2.test-d.ts +175 -0
- package/src/builder/Builder.deployment.ts +224 -0
- package/src/builder/Builder.deploymentModel.ts +385 -0
- package/src/builder/Builder.element.ts +19 -19
- package/src/builder/Builder.model.ts +67 -42
- package/src/builder/Builder.ts +533 -367
- package/src/builder/Builder.view-common.ts +234 -0
- package/src/builder/Builder.view-deployment.ts +135 -0
- package/src/builder/Builder.view-element.ts +189 -0
- package/src/builder/Builder.views.ts +109 -33
- package/src/builder/Builder.with.ts +475 -0
- package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +374 -0
- package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +183 -0
- package/src/builder/__snapshots__/Builder.spec.ts.snap +374 -0
- package/src/builder/_types.ts +113 -18
- package/src/builder/index.ts +10 -4
- package/src/colors/index.ts +2 -2
- package/src/compute-view/compute-view.ts +83 -0
- package/src/compute-view/deployment-view/__test__/TestHelper.ts +236 -0
- package/src/compute-view/deployment-view/__test__/fixture.ts +198 -0
- package/src/compute-view/deployment-view/_types.ts +37 -0
- package/src/compute-view/deployment-view/clean-connections.ts +238 -0
- package/src/compute-view/deployment-view/compute.ts +125 -0
- package/src/compute-view/deployment-view/memory/index.ts +9 -0
- package/src/compute-view/deployment-view/memory/memory.ts +97 -0
- package/src/compute-view/deployment-view/predicates/elements.ts +144 -0
- package/src/compute-view/deployment-view/predicates/relation-direct.ts +237 -0
- package/src/compute-view/deployment-view/predicates/relation-in-out.ts +61 -0
- package/src/compute-view/deployment-view/predicates/relation-incoming.ts +95 -0
- package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +88 -0
- package/src/compute-view/deployment-view/predicates/wildcard.ts +29 -0
- package/src/compute-view/deployment-view/stages/stage-exclude.ts +5 -0
- package/src/compute-view/deployment-view/stages/stage-final.ts +245 -0
- package/src/compute-view/deployment-view/stages/stage-include.ts +95 -0
- package/src/compute-view/deployment-view/utils.ts +276 -0
- package/src/compute-view/dynamic-view/__test__/fixture.ts +58 -0
- package/src/compute-view/dynamic-view/compute.ts +324 -0
- package/src/compute-view/element-view/__test__/TestHelper.ts +258 -0
- package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +458 -0
- package/src/compute-view/element-view/__test__/fixture.ts +675 -0
- package/src/compute-view/element-view/_types.ts +48 -0
- package/src/compute-view/element-view/clean-connections.ts +113 -0
- package/src/compute-view/element-view/compute.ts +315 -0
- package/src/compute-view/element-view/memory/NodeGroup.ts +31 -0
- package/src/compute-view/element-view/memory/index.ts +10 -0
- package/src/compute-view/element-view/memory/memory.ts +177 -0
- package/src/compute-view/element-view/memory/stage-exclude.ts +59 -0
- package/src/compute-view/element-view/memory/stage-final.ts +129 -0
- package/src/compute-view/element-view/memory/stage-include.ts +128 -0
- package/src/compute-view/element-view/predicates/_utils.ts +86 -0
- package/src/compute-view/element-view/predicates/element-expand.ts +33 -0
- package/src/compute-view/element-view/predicates/element-kind-tag.ts +26 -0
- package/src/compute-view/element-view/predicates/element-ref.ts +37 -0
- package/src/compute-view/element-view/predicates/relation-direct.ts +309 -0
- package/src/compute-view/element-view/predicates/relation-in-out.ts +66 -0
- package/src/compute-view/element-view/predicates/relation-in.ts +118 -0
- package/src/compute-view/element-view/predicates/relation-out.ts +116 -0
- package/src/compute-view/element-view/predicates/wildcard.ts +88 -0
- package/src/compute-view/element-view/utils.ts +59 -0
- package/src/compute-view/index.ts +4 -0
- package/src/compute-view/memory/AbstractMemory.ts +45 -0
- package/src/compute-view/memory/AbstractStageExclude.ts +216 -0
- package/src/compute-view/memory/AbstractStageInclude.ts +200 -0
- package/src/compute-view/memory/_types.ts +147 -0
- package/src/compute-view/memory/index.ts +5 -0
- package/src/compute-view/memory/ops.ts +43 -0
- package/src/compute-view/utils/__snapshots__/sortNodes.spec.ts.snap +113 -0
- package/src/compute-view/utils/ancestorsOfNode.ts +19 -0
- package/src/compute-view/utils/applyCustomElementProperties.ts +66 -0
- package/src/compute-view/utils/applyCustomRelationProperties.ts +41 -0
- package/src/compute-view/utils/applyViewRuleStyles.ts +53 -0
- package/src/compute-view/utils/buildComputedNodes.ts +148 -0
- package/src/compute-view/utils/buildElementNotations.ts +63 -0
- package/src/compute-view/utils/elementExpressionToPredicate.ts +50 -0
- package/src/compute-view/utils/link-nodes-with-edges.ts +54 -0
- package/src/compute-view/utils/merge-props-from-relationships.ts +128 -0
- package/src/compute-view/utils/relationExpressionToPredicates.ts +55 -0
- package/src/compute-view/utils/resolve-extended-views.ts +69 -0
- package/src/compute-view/utils/resolve-global-rules.ts +83 -0
- package/src/compute-view/utils/topological-sort.ts +256 -0
- package/src/compute-view/utils/uniqueTags.test.ts +42 -0
- package/src/compute-view/utils/uniqueTags.ts +21 -0
- package/src/compute-view/utils/view-hash.ts +27 -0
- package/src/compute-view/utils/with-readable-edges.ts +36 -0
- package/src/index.ts +22 -12
- package/src/model/DeploymentElementModel.ts +599 -0
- package/src/model/DeploymentModel.ts +370 -0
- package/src/model/ElementModel.ts +221 -0
- package/src/model/LikeC4Model.test-d.ts +152 -0
- package/src/model/LikeC4Model.ts +336 -457
- package/src/model/RelationModel.ts +85 -0
- package/src/model/__test__/fixture.ts +149 -338
- package/src/model/connection/Connection.ts +72 -0
- package/src/model/connection/deployment/DeploymentConnectionModel.ts +178 -0
- package/src/model/connection/deployment/find.ts +120 -0
- package/src/model/connection/deployment/index.ts +8 -0
- package/src/model/connection/index.ts +22 -0
- package/src/model/connection/model/ConnectionModel.ts +157 -0
- package/src/model/connection/model/find.ts +117 -0
- package/src/model/connection/model/index.ts +8 -0
- package/src/model/connection/ops.ts +274 -0
- package/src/model/guards.ts +9 -0
- package/src/model/index.ts +46 -2
- package/src/model/types.ts +112 -15
- package/src/model/view/EdgeModel.ts +103 -0
- package/src/model/view/LikeC4ViewModel.ts +226 -0
- package/src/model/view/NodeModel.ts +229 -0
- package/src/types/_common.ts +55 -1
- package/src/types/deployments.ts +169 -0
- package/src/types/element.ts +9 -5
- package/src/types/expression-v2.ts +172 -0
- package/src/types/expression.ts +17 -11
- package/src/types/global.ts +3 -3
- package/src/types/index.ts +220 -12
- package/src/types/model.ts +75 -12
- package/src/types/operators.ts +1 -1
- package/src/types/overview-graph.ts +2 -2
- package/src/types/relation.ts +18 -14
- package/src/types/theme.ts +0 -1
- package/src/types/view-notation.ts +2 -2
- package/src/types/view.ts +117 -41
- package/src/utils/{commonHead.ts → common-head.ts} +2 -0
- package/src/utils/const.ts +1 -0
- package/src/utils/fqn.ts +203 -56
- package/src/utils/getOrCreate.ts +42 -0
- package/src/utils/graphlib.ts +10 -0
- package/src/utils/index.ts +74 -6
- package/src/utils/iterable/_types.ts +5 -0
- package/src/utils/iterable/filter.ts +55 -0
- package/src/utils/iterable/flat.ts +17 -0
- package/src/utils/iterable/index.ts +12 -0
- package/src/utils/iterable/map.ts +40 -0
- package/src/utils/iterable/reduce.ts +24 -0
- package/src/utils/iterable/some.ts +36 -0
- package/src/utils/iterable/to.ts +19 -0
- package/src/utils/iterable/unique.ts +29 -0
- package/src/utils/object-hash.ts +3 -0
- package/src/utils/relations.ts +3 -64
- package/src/utils/set.ts +78 -0
- package/src/utils/string-hash.ts +16 -0
- package/dist/index.cjs +0 -5452
- package/dist/index.d.cts +0 -1053
- package/dist/shared/core.CoLQkcYL.d.ts +0 -734
- package/dist/shared/core.DIYZvpVg.cjs +0 -353
- package/dist/types/index.cjs +0 -70
- package/dist/types/index.d.cts +0 -2
- package/dist/types/index.mjs +0 -1
- package/src/builder/Builder.test-d.ts +0 -69
- package/src/builder/Builder.view.ts +0 -358
- package/src/model/LikeC4DiagramModel.ts +0 -338
- package/src/model/LikeC4ViewModel.ts +0 -320
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function u(r,n,a){let o=r.length-n.length;if(o===0)return r(...n);if(o===1)return u$1(r,n,a);throw new Error("Wrong number of arguments")}
|
|
1
|
+
import { u, i as invariant, n as nonexhaustive } from './chunk-RAAYCPUM.M-JWF7SS.js';
|
|
4
2
|
|
|
5
3
|
function o$1(a){return t=>!a(t)}
|
|
6
4
|
|
|
@@ -12,21 +10,15 @@ function t(...a){return u(e,a)}var e=(a,o)=>o.every(l=>l(a));
|
|
|
12
10
|
|
|
13
11
|
function y(...a){return u(r,a)}var r=(a,o)=>o.some(e=>e(a));
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
throw new Error(message ?? "Invariant failed");
|
|
26
|
-
}
|
|
27
|
-
function nonexhaustive(value) {
|
|
28
|
-
throw new Error(`NonExhaustive value: ${value}`);
|
|
29
|
-
}
|
|
13
|
+
var DeploymentElement;
|
|
14
|
+
((DeploymentElement2) => {
|
|
15
|
+
DeploymentElement2.isDeploymentNode = (el) => {
|
|
16
|
+
return "kind" in el && !("element" in el);
|
|
17
|
+
};
|
|
18
|
+
DeploymentElement2.isInstance = (el) => {
|
|
19
|
+
return "element" in el && !("kind" in el);
|
|
20
|
+
};
|
|
21
|
+
})(DeploymentElement || (DeploymentElement = {}));
|
|
30
22
|
|
|
31
23
|
function AsFqn(name, parent) {
|
|
32
24
|
return parent ? parent + "." + name : name;
|
|
@@ -121,6 +113,67 @@ const expression = {
|
|
|
121
113
|
isWildcard: isWildcard
|
|
122
114
|
};
|
|
123
115
|
|
|
116
|
+
var FqnRef;
|
|
117
|
+
((FqnRef2) => {
|
|
118
|
+
FqnRef2.isInsideInstanceRef = (ref) => {
|
|
119
|
+
return "deployment" in ref && "element" in ref;
|
|
120
|
+
};
|
|
121
|
+
FqnRef2.isDeploymentElementRef = (ref) => {
|
|
122
|
+
return "deployment" in ref && !("element" in ref);
|
|
123
|
+
};
|
|
124
|
+
FqnRef2.isDeploymentRef = (ref) => {
|
|
125
|
+
return !(0, FqnRef2.isModelRef)(ref);
|
|
126
|
+
};
|
|
127
|
+
FqnRef2.isModelRef = (ref) => {
|
|
128
|
+
return "model" in ref;
|
|
129
|
+
};
|
|
130
|
+
FqnRef2.toDeploymentRef = (ref) => {
|
|
131
|
+
invariant((0, FqnRef2.isDeploymentRef)(ref), "Expected DeploymentRef");
|
|
132
|
+
return (0, FqnRef2.isInsideInstanceRef)(ref) ? {
|
|
133
|
+
id: ref.deployment,
|
|
134
|
+
element: ref.element
|
|
135
|
+
} : {
|
|
136
|
+
id: ref.deployment
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
})(FqnRef || (FqnRef = {}));
|
|
140
|
+
var FqnExpr;
|
|
141
|
+
((FqnExpr2) => {
|
|
142
|
+
FqnExpr2.isWildcard = (expr) => {
|
|
143
|
+
return "wildcard" in expr && expr.wildcard === true;
|
|
144
|
+
};
|
|
145
|
+
FqnExpr2.isModelRef = (ref) => {
|
|
146
|
+
return "ref" in ref && FqnRef.isModelRef(ref.ref);
|
|
147
|
+
};
|
|
148
|
+
FqnExpr2.isDeploymentRef = (ref) => {
|
|
149
|
+
return "ref" in ref && FqnRef.isDeploymentRef(ref.ref);
|
|
150
|
+
};
|
|
151
|
+
})(FqnExpr || (FqnExpr = {}));
|
|
152
|
+
var RelationExpr;
|
|
153
|
+
((RelationExpr2) => {
|
|
154
|
+
RelationExpr2.isDirect = (expr) => {
|
|
155
|
+
return "source" in expr && "target" in expr;
|
|
156
|
+
};
|
|
157
|
+
RelationExpr2.isIncoming = (expr) => {
|
|
158
|
+
return "incoming" in expr;
|
|
159
|
+
};
|
|
160
|
+
RelationExpr2.isOutgoing = (expr) => {
|
|
161
|
+
return "outgoing" in expr;
|
|
162
|
+
};
|
|
163
|
+
RelationExpr2.isInOut = (expr) => {
|
|
164
|
+
return "inout" in expr;
|
|
165
|
+
};
|
|
166
|
+
})(RelationExpr || (RelationExpr = {}));
|
|
167
|
+
var ExpressionV2;
|
|
168
|
+
((ExpressionV22) => {
|
|
169
|
+
ExpressionV22.isFqnExpr = (expr) => {
|
|
170
|
+
return FqnExpr.isWildcard(expr) || FqnExpr.isModelRef(expr) || FqnExpr.isDeploymentRef(expr);
|
|
171
|
+
};
|
|
172
|
+
ExpressionV22.isRelation = (expr) => {
|
|
173
|
+
return RelationExpr.isDirect(expr) || RelationExpr.isIncoming(expr) || RelationExpr.isOutgoing(expr) || RelationExpr.isInOut(expr);
|
|
174
|
+
};
|
|
175
|
+
})(ExpressionV2 || (ExpressionV2 = {}));
|
|
176
|
+
|
|
124
177
|
const isTagEqual = (operator) => {
|
|
125
178
|
return "tag" in operator;
|
|
126
179
|
};
|
|
@@ -183,23 +236,6 @@ const DefaultLineStyle = "dashed";
|
|
|
183
236
|
const DefaultArrowType = "normal";
|
|
184
237
|
const DefaultRelationshipColor = "gray";
|
|
185
238
|
|
|
186
|
-
const ThemeColors = [
|
|
187
|
-
"amber",
|
|
188
|
-
"blue",
|
|
189
|
-
"gray",
|
|
190
|
-
"slate",
|
|
191
|
-
"green",
|
|
192
|
-
"indigo",
|
|
193
|
-
"muted",
|
|
194
|
-
"primary",
|
|
195
|
-
"red",
|
|
196
|
-
"secondary",
|
|
197
|
-
"sky"
|
|
198
|
-
];
|
|
199
|
-
function isThemeColor(color) {
|
|
200
|
-
return color in ThemeColors;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
239
|
function isViewRulePredicate(rule) {
|
|
204
240
|
return "include" in rule && Array.isArray(rule.include) || "exclude" in rule && Array.isArray(rule.exclude);
|
|
205
241
|
}
|
|
@@ -207,7 +243,7 @@ function isViewRuleGlobalPredicateRef(rule) {
|
|
|
207
243
|
return "predicateId" in rule;
|
|
208
244
|
}
|
|
209
245
|
function isViewRuleStyle(rule) {
|
|
210
|
-
return "style" in rule && "targets" in rule;
|
|
246
|
+
return "style" in rule && "targets" in rule && Array.isArray(rule.targets);
|
|
211
247
|
}
|
|
212
248
|
function isViewRuleGlobalStyle(rule) {
|
|
213
249
|
return "styleId" in rule;
|
|
@@ -221,12 +257,12 @@ function isViewRuleAutoLayout(rule) {
|
|
|
221
257
|
function isViewRuleGroup(rule) {
|
|
222
258
|
return "title" in rule && "groupRules" in rule && Array.isArray(rule.groupRules);
|
|
223
259
|
}
|
|
224
|
-
function isDynamicViewIncludeRule(rule) {
|
|
225
|
-
return "include" in rule && Array.isArray(rule.include);
|
|
226
|
-
}
|
|
227
260
|
function isDynamicViewParallelSteps(step) {
|
|
228
261
|
return "__parallel" in step && o(step.__parallel);
|
|
229
262
|
}
|
|
263
|
+
function isDeploymentView(view) {
|
|
264
|
+
return view.__ === "deployment";
|
|
265
|
+
}
|
|
230
266
|
function isDynamicView(view) {
|
|
231
267
|
return view.__ === "dynamic";
|
|
232
268
|
}
|
|
@@ -239,7 +275,7 @@ function isExtendsElementView(view) {
|
|
|
239
275
|
function isScopedElementView(view) {
|
|
240
276
|
return isElementView(view) && "viewOf" in view;
|
|
241
277
|
}
|
|
242
|
-
function
|
|
278
|
+
function stepEdgeId(step, parallelStep) {
|
|
243
279
|
const id = `step-${String(step).padStart(2, "0")}`;
|
|
244
280
|
return parallelStep ? `${id}.${parallelStep}` : id;
|
|
245
281
|
}
|
|
@@ -260,17 +296,34 @@ function getParallelStepsPrefix(id) {
|
|
|
260
296
|
}
|
|
261
297
|
var ComputedNode;
|
|
262
298
|
((ComputedNode2) => {
|
|
299
|
+
function modelRef(node) {
|
|
300
|
+
return node.modelRef === 1 ? node.id : node.modelRef ?? null;
|
|
301
|
+
}
|
|
302
|
+
ComputedNode2.modelRef = modelRef;
|
|
303
|
+
function deploymentRef(node) {
|
|
304
|
+
return node.deploymentRef === 1 ? node.id : node.deploymentRef ?? null;
|
|
305
|
+
}
|
|
306
|
+
ComputedNode2.deploymentRef = deploymentRef;
|
|
263
307
|
function isNodesGroup(node) {
|
|
264
308
|
return node.kind === ElementKind.Group;
|
|
265
309
|
}
|
|
266
310
|
ComputedNode2.isNodesGroup = isNodesGroup;
|
|
267
311
|
})(ComputedNode || (ComputedNode = {}));
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
312
|
+
var ComputedView;
|
|
313
|
+
((ComputedView2) => {
|
|
314
|
+
function isDeployment(view) {
|
|
315
|
+
return view.__ === "deployment";
|
|
316
|
+
}
|
|
317
|
+
ComputedView2.isDeployment = isDeployment;
|
|
318
|
+
function isDynamic(view) {
|
|
319
|
+
return view.__ === "dynamic";
|
|
320
|
+
}
|
|
321
|
+
ComputedView2.isDynamic = isDynamic;
|
|
322
|
+
function isElement(view) {
|
|
323
|
+
return n(view.__) || view.__ === "element";
|
|
324
|
+
}
|
|
325
|
+
ComputedView2.isElement = isElement;
|
|
326
|
+
})(ComputedView || (ComputedView = {}));
|
|
274
327
|
function getBBoxCenter({
|
|
275
328
|
x,
|
|
276
329
|
y,
|
|
@@ -284,10 +337,18 @@ function getBBoxCenter({
|
|
|
284
337
|
}
|
|
285
338
|
var DiagramNode;
|
|
286
339
|
((DiagramNode2) => {
|
|
340
|
+
function modelRef(node) {
|
|
341
|
+
return node.modelRef === 1 ? node.id : node.modelRef ?? null;
|
|
342
|
+
}
|
|
343
|
+
DiagramNode2.modelRef = modelRef;
|
|
344
|
+
function deploymentRef(node) {
|
|
345
|
+
return node.deploymentRef === 1 ? node.id : node.deploymentRef ?? null;
|
|
346
|
+
}
|
|
347
|
+
DiagramNode2.deploymentRef = deploymentRef;
|
|
287
348
|
function isNodesGroup(node) {
|
|
288
349
|
return node.kind === ElementKind.Group;
|
|
289
350
|
}
|
|
290
351
|
DiagramNode2.isNodesGroup = isNodesGroup;
|
|
291
352
|
})(DiagramNode || (DiagramNode = {}));
|
|
292
353
|
|
|
293
|
-
export {
|
|
354
|
+
export { isStepEdgeId as $, AsFqn as A, BorderStyles as B, ExpressionV2 as C, DeploymentElement as D, ElementKind as E, FqnExpr as F, FqnRef as G, isAndOperator as H, isKindEqual as I, isNotOperator as J, isOrOperator as K, isTagEqual as L, whereOperatorAsPredicate as M, DefaultArrowType as N, DefaultLineStyle as O, DefaultRelationshipColor as P, ComputedNode as Q, RelationExpr as R, ComputedView as S, DiagramNode as T, extractStep as U, getBBoxCenter as V, getParallelStepsPrefix as W, isAutoLayoutDirection as X, isDeploymentView as Y, isDynamicView as Z, isDynamicViewParallelSteps as _, isElementView as a, isViewRuleAutoLayout as a0, isViewRuleGlobalPredicateRef as a1, isViewRuleGlobalStyle as a2, isViewRuleGroup as a3, isViewRulePredicate as a4, isViewRuleStyle as a5, stepEdgeId as a6, o$1 as a7, y as a8, isElementPredicateExpr as b, isScopedElementView as c, DefaultThemeColor as d, DefaultElementShape as e, expression as f, ElementShapes as g, isCustomElement as h, isExtendsElementView as i, isCustomRelationExpr as j, isElement as k, isElementKindExpr as l, isElementRef as m, n, o, isElementTagExpr as p, isElementWhere as q, isExpandedElementExpr as r, isIncoming as s, isInOut as t, isOutgoing as u, isRelation as v, isRelationExpression as w, isRelationPredicateExpr as x, isRelationWhere as y, isWildcard as z };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,72 @@
|
|
|
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
|
+
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 { bj as ViewId, aV as BBox, bk as ViewManualLayout, aS as AutoLayoutDirection } from '../shared/core.CmYMqgha.mjs';
|
|
4
|
+
export { ar as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aT as BasicElementView, aU as BasicView, aW as ComputedDeploymentView, aX as ComputedDynamicView, aY as ComputedEdge, aZ as ComputedElementView, a as ComputedLikeC4Model, ay as ComputedNode, C as ComputedView, a_ as CustomColorDefinitions, A as CustomElementExpr, B as CustomRelationExpr, ao as DefaultArrowType, ap as DefaultLineStyle, aq 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, a$ as DeploymentView, b0 as DeploymentViewRule, b1 as DeploymentViewRulePredicate, b2 as DeploymentViewRuleStyle, b3 as DiagramEdge, az as DiagramNode, b4 as DiagramView, E as DirectRelationExpr, b5 as DynamicView, b6 as DynamicViewIncludeRule, b7 as DynamicViewParallelSteps, b8 as DynamicViewRule, b9 as DynamicViewStep, ba as DynamicViewStepOrParallel, bb as EdgeId, F as ElementExpression, G as ElementKindExpr, bv as ElementNotation, H as ElementPredicateExpression, I as ElementRefExpr, J as ElementTagExpr, bc as ElementView, K as ElementWhereExpr, ah as EqualOperator, M as ExpandedElementExpr, N as Expression, X as ExpressionV2, bd 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, as as ModelRelation, be as NodeId, R as NonWilcard, ak as NotOperator, al as OrOperator, S as OutgoingExpr, a9 as ParsedLikeC4Model, P as PredicateSelector, _ as RelationExpr, T as RelationExpression, at as RelationId, U as RelationPredicateExpression, V as RelationWhereExpr, au as RelationshipArrowType, av as RelationshipKind, aw as RelationshipKindSpecification, ax as RelationshipLineType, bf as ScopedElementView, bg as StepEdgeId, bh as StepEdgeIdLiteral, am as TagEqual, bi as ViewAutoLayout, bl as ViewRule, bm as ViewRuleAutoLayout, bn as ViewRuleGlobalPredicateRef, bo as ViewRuleGlobalStyle, bp as ViewRuleGroup, bq as ViewRulePredicate, br as ViewRuleStyle, bs as ViewRuleStyleOrGlobalRef, bt as ViewWithHash, bu as ViewWithNotation, an as WhereOperator, W as WildcardExpr, aA as extractStep, aB as getBBoxCenter, aC as getParallelStepsPrefix, aa as isAndOperator, aD as isAutoLayoutDirection, j as isCustomElement, k as isCustomRelationExpr, aE as isDeploymentView, aF as isDynamicView, aG as isDynamicViewParallelSteps, l as isElement, m as isElementKindExpr, n as isElementPredicateExpr, o as isElementRef, p as isElementTagExpr, aH as isElementView, q as isElementWhere, r as isExpandedElementExpr, aI 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, aJ as isScopedElementView, aK as isStepEdgeId, ae as isTagEqual, aL as isViewRuleAutoLayout, aM as isViewRuleGlobalPredicateRef, aN as isViewRuleGlobalStyle, aO as isViewRuleGroup, aP as isViewRulePredicate, aQ as isViewRuleStyle, z as isWildcard, aR as stepEdgeId, af as whereOperatorAsPredicate } from '../shared/core.CmYMqgha.mjs';
|
|
2
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.ts
CHANGED
|
@@ -1,2 +1,72 @@
|
|
|
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
|
+
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 { bj as ViewId, aV as BBox, bk as ViewManualLayout, aS as AutoLayoutDirection } from '../shared/core.C05RDLhi.js';
|
|
4
|
+
export { ar as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aT as BasicElementView, aU as BasicView, aW as ComputedDeploymentView, aX as ComputedDynamicView, aY as ComputedEdge, aZ as ComputedElementView, a as ComputedLikeC4Model, ay as ComputedNode, C as ComputedView, a_ as CustomColorDefinitions, A as CustomElementExpr, B as CustomRelationExpr, ao as DefaultArrowType, ap as DefaultLineStyle, aq 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, a$ as DeploymentView, b0 as DeploymentViewRule, b1 as DeploymentViewRulePredicate, b2 as DeploymentViewRuleStyle, b3 as DiagramEdge, az as DiagramNode, b4 as DiagramView, E as DirectRelationExpr, b5 as DynamicView, b6 as DynamicViewIncludeRule, b7 as DynamicViewParallelSteps, b8 as DynamicViewRule, b9 as DynamicViewStep, ba as DynamicViewStepOrParallel, bb as EdgeId, F as ElementExpression, G as ElementKindExpr, bv as ElementNotation, H as ElementPredicateExpression, I as ElementRefExpr, J as ElementTagExpr, bc as ElementView, K as ElementWhereExpr, ah as EqualOperator, M as ExpandedElementExpr, N as Expression, X as ExpressionV2, bd 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, as as ModelRelation, be as NodeId, R as NonWilcard, ak as NotOperator, al as OrOperator, S as OutgoingExpr, a9 as ParsedLikeC4Model, P as PredicateSelector, _ as RelationExpr, T as RelationExpression, at as RelationId, U as RelationPredicateExpression, V as RelationWhereExpr, au as RelationshipArrowType, av as RelationshipKind, aw as RelationshipKindSpecification, ax as RelationshipLineType, bf as ScopedElementView, bg as StepEdgeId, bh as StepEdgeIdLiteral, am as TagEqual, bi as ViewAutoLayout, bl as ViewRule, bm as ViewRuleAutoLayout, bn as ViewRuleGlobalPredicateRef, bo as ViewRuleGlobalStyle, bp as ViewRuleGroup, bq as ViewRulePredicate, br as ViewRuleStyle, bs as ViewRuleStyleOrGlobalRef, bt as ViewWithHash, bu as ViewWithNotation, an as WhereOperator, W as WildcardExpr, aA as extractStep, aB as getBBoxCenter, aC as getParallelStepsPrefix, aa as isAndOperator, aD as isAutoLayoutDirection, j as isCustomElement, k as isCustomRelationExpr, aE as isDeploymentView, aF as isDynamicView, aG as isDynamicViewParallelSteps, l as isElement, m as isElementKindExpr, n as isElementPredicateExpr, o as isElementRef, p as isElementTagExpr, aH as isElementView, q as isElementWhere, r as isExpandedElementExpr, aI 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, aJ as isScopedElementView, aK as isStepEdgeId, ae as isTagEqual, aL as isViewRuleAutoLayout, aM as isViewRuleGlobalPredicateRef, aN as isViewRuleGlobalStyle, aO as isViewRuleGroup, aP as isViewRulePredicate, aQ as isViewRuleStyle, z as isWildcard, aR as stepEdgeId, af as whereOperatorAsPredicate } from '../shared/core.C05RDLhi.js';
|
|
2
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 };
|
|
@@ -0,0 +1,20 @@
|
|
|
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/view.CyZrG8BJ.js';
|
|
2
|
+
|
|
3
|
+
const ThemeColors = [
|
|
4
|
+
"amber",
|
|
5
|
+
"blue",
|
|
6
|
+
"gray",
|
|
7
|
+
"slate",
|
|
8
|
+
"green",
|
|
9
|
+
"indigo",
|
|
10
|
+
"muted",
|
|
11
|
+
"primary",
|
|
12
|
+
"red",
|
|
13
|
+
"secondary",
|
|
14
|
+
"sky"
|
|
15
|
+
];
|
|
16
|
+
function isThemeColor(color) {
|
|
17
|
+
return color in ThemeColors;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { isThemeColor };
|