@likec4/core 1.31.0 → 1.32.1
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/README.md +407 -5
- package/dist/builder/index.d.mts +221 -42
- package/dist/builder/index.mjs +118 -65
- package/dist/compute-view/index.d.mts +23 -7
- package/dist/compute-view/index.mjs +11 -6
- package/dist/compute-view/relationships-view/index.d.mts +9 -7
- package/dist/compute-view/relationships-view/index.mjs +3 -2
- package/dist/index.d.mts +10 -14
- package/dist/index.mjs +9 -6
- package/dist/model/index.d.mts +173 -19
- package/dist/model/index.mjs +6 -1
- package/dist/shared/core.BaYE_r29.d.mts +258 -0
- package/dist/shared/core.Bk7wEZFG.mjs +276 -0
- package/dist/shared/core.BrCnZFTn.mjs +32 -0
- package/dist/shared/core.BuO4ncfY.d.mts +146 -0
- package/dist/shared/{core.Bq753SYD.mjs → core.CBpKAlhj.mjs} +2012 -4422
- package/dist/shared/core.CUYDgv2-.mjs +214 -0
- package/dist/shared/{core.Cu-UdkSl.mjs → core.CpXlRyE5.mjs} +7 -494
- package/dist/shared/{core.C-YXI-43.mjs → core.Cy9smucx.mjs} +3 -1
- package/dist/shared/core.CywrQs86.d.mts +31 -0
- package/dist/shared/core.DXzRBkuI.d.mts +1264 -0
- package/dist/shared/core.DoK86JEe.mjs +518 -0
- package/dist/shared/{core.D2830qgg.d.mts → core.Pf5I9o0e.d.mts} +1 -1
- package/dist/shared/core.cbA9VZ02.mjs +2681 -0
- package/dist/shared/{core.CQXU9DF7.mjs → core.rmvsy0n3.mjs} +23 -32
- package/dist/shared/core.znRaUX_A.d.mts +920 -0
- package/dist/types/aux.d.mts +3 -0
- package/dist/types/aux.mjs +1 -0
- package/dist/types/index.d.mts +7 -45
- package/dist/types/index.mjs +130 -3
- package/dist/utils/index.d.mts +221 -53
- package/dist/utils/index.mjs +14 -10
- package/package.json +16 -8
- package/src/builder/Builder.deploymentModel.ts +82 -18
- package/src/builder/Builder.element.ts +40 -20
- package/src/builder/Builder.model.ts +66 -17
- package/src/builder/Builder.ts +168 -76
- package/src/builder/Builder.view-common.ts +35 -17
- package/src/builder/Builder.view-deployment.ts +25 -25
- package/src/builder/Builder.view-element.ts +13 -12
- package/src/builder/Builder.views.ts +12 -7
- package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +62 -34
- package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +319 -0
- package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +45 -24
- package/src/builder/_types.ts +34 -27
- package/src/compute-view/compute-view.ts +31 -34
- package/src/compute-view/deployment-view/__test__/TestHelper.ts +27 -14
- package/src/compute-view/deployment-view/__test__/fixture.ts +15 -13
- package/src/compute-view/deployment-view/_types.ts +10 -10
- package/src/compute-view/deployment-view/clean-connections.ts +5 -7
- package/src/compute-view/deployment-view/compute.ts +16 -13
- package/src/compute-view/deployment-view/memory/memory.ts +5 -6
- package/src/compute-view/deployment-view/predicates/deploymentRefs.ts +4 -5
- package/src/compute-view/deployment-view/predicates/relation-direct.ts +25 -50
- package/src/compute-view/deployment-view/predicates/relation-in-out.ts +5 -7
- package/src/compute-view/deployment-view/predicates/relation-incoming.ts +7 -11
- package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +7 -10
- package/src/compute-view/deployment-view/predicates/utils.ts +37 -31
- package/src/compute-view/deployment-view/predicates/wildcard.ts +3 -2
- package/src/compute-view/deployment-view/stages/stage-final.ts +2 -2
- package/src/compute-view/deployment-view/stages/stage-include.ts +1 -1
- package/src/compute-view/deployment-view/utils.ts +79 -72
- package/src/compute-view/dynamic-view/__test__/fixture.ts +20 -11
- package/src/compute-view/dynamic-view/compute.ts +60 -53
- package/src/compute-view/element-view/__test__/TestHelper.ts +53 -29
- package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +26 -26
- package/src/compute-view/element-view/__test__/fixture.ts +134 -83
- package/src/compute-view/element-view/_types.ts +14 -19
- package/src/compute-view/element-view/clean-connections.ts +12 -8
- package/src/compute-view/element-view/compute.ts +61 -51
- package/src/compute-view/element-view/memory/NodeGroup.ts +8 -9
- package/src/compute-view/element-view/memory/memory.ts +22 -22
- package/src/compute-view/element-view/memory/stage-include.ts +5 -3
- package/src/compute-view/element-view/predicates/_utils.ts +18 -14
- package/src/compute-view/element-view/predicates/element-expand.ts +4 -5
- package/src/compute-view/element-view/predicates/element-kind-tag.ts +3 -4
- package/src/compute-view/element-view/predicates/element-ref.ts +3 -4
- package/src/compute-view/element-view/predicates/relation-direct.ts +16 -12
- package/src/compute-view/element-view/predicates/relation-in-out.ts +7 -8
- package/src/compute-view/element-view/predicates/relation-in.ts +19 -26
- package/src/compute-view/element-view/predicates/relation-out.ts +20 -21
- package/src/compute-view/element-view/predicates/wildcard.ts +3 -3
- package/src/compute-view/element-view/utils.ts +25 -23
- package/src/compute-view/index.ts +1 -1
- package/src/compute-view/memory/AbstractStageExclude.ts +3 -4
- package/src/compute-view/memory/AbstractStageInclude.ts +1 -1
- package/src/compute-view/memory/_types.ts +3 -2
- package/src/compute-view/relationships-view/_types.ts +3 -4
- package/src/compute-view/relationships-view/compute.ts +8 -11
- package/src/compute-view/relationships-view/layout.ts +6 -6
- package/src/compute-view/relationships-view/utils.ts +4 -4
- package/src/compute-view/utils/ancestorsOfNode.ts +7 -7
- package/src/compute-view/utils/applyCustomElementProperties.ts +16 -8
- package/src/compute-view/utils/applyCustomRelationProperties.ts +19 -9
- package/src/compute-view/utils/applyViewRuleStyles.ts +18 -10
- package/src/compute-view/utils/buildComputedNodes.ts +40 -40
- package/src/compute-view/utils/buildElementNotations.ts +14 -14
- package/src/compute-view/utils/elementExpressionToPredicate.ts +14 -15
- package/src/compute-view/utils/link-nodes-with-edges.ts +6 -4
- package/src/compute-view/utils/merge-props-from-relationships.ts +52 -20
- package/src/compute-view/utils/relationExpressionToPredicates.ts +19 -19
- package/src/compute-view/utils/resolve-extended-views.ts +8 -7
- package/src/compute-view/utils/resolve-global-rules.ts +31 -26
- package/src/compute-view/utils/topological-sort.ts +14 -14
- package/src/compute-view/utils/view-hash.ts +2 -2
- package/src/compute-view/utils/with-readable-edges.ts +9 -5
- package/src/index.ts +0 -32
- package/src/model/DeploymentElementModel.ts +171 -144
- package/src/model/DeploymentModel.ts +88 -65
- package/src/model/ElementModel.ts +85 -74
- package/src/model/LikeC4Model.ts +430 -241
- package/src/model/RelationModel.ts +63 -29
- package/src/model/__test__/fixture.ts +50 -36
- package/src/model/connection/Connection.ts +2 -2
- package/src/model/connection/deployment/DeploymentConnectionModel.ts +21 -24
- package/src/model/connection/deployment/find.ts +1 -1
- package/src/model/connection/model/ConnectionModel.ts +21 -20
- package/src/model/connection/model/find.ts +7 -7
- package/src/model/connection/ops.ts +6 -6
- package/src/model/guards.ts +66 -14
- package/src/model/index.ts +20 -7
- package/src/model/types.ts +41 -97
- package/src/model/view/EdgeModel.ts +47 -41
- package/src/model/view/LikeC4ViewModel.ts +130 -80
- package/src/model/view/NodeModel.ts +102 -96
- package/src/theme/element.ts +1 -1
- package/src/theme/index.ts +9 -9
- package/src/theme/relationships.ts +1 -1
- package/src/types/_common.ts +21 -15
- package/src/types/aux.ts +285 -0
- package/src/types/const.ts +34 -0
- package/src/types/expression-model.ts +292 -0
- package/src/types/expression.ts +311 -0
- package/src/types/fqnRef.ts +88 -0
- package/src/types/geometry.ts +131 -0
- package/src/types/global.ts +10 -8
- package/src/types/index.ts +39 -201
- package/src/types/model-data.ts +52 -84
- package/src/types/model-deployment.ts +87 -0
- package/src/types/model-dump.ts +72 -0
- package/src/types/model-logical.ts +111 -0
- package/src/types/model-spec.ts +81 -0
- package/src/types/operators.ts +51 -52
- package/src/types/scalar.ts +114 -0
- package/src/types/{theme.ts → styles.ts} +55 -15
- package/src/types/view-changes.ts +4 -5
- package/src/types/view-common.ts +157 -0
- package/src/types/view-computed.ts +113 -0
- package/src/types/view-layouted.ts +82 -0
- package/src/types/view-parsed.deployment.ts +40 -0
- package/src/types/view-parsed.dynamic.ts +78 -0
- package/src/types/view-parsed.element.ts +65 -0
- package/src/types/view.ts +122 -542
- package/src/utils/compare-natural.ts +43 -1
- package/src/utils/getOrCreate.ts +0 -34
- package/src/utils/index.ts +7 -12
- package/src/utils/iterable/filter.ts +1 -1
- package/src/utils/iterable/find.ts +3 -1
- package/src/utils/iterable/head.ts +22 -0
- package/src/utils/iterable/index.ts +1 -0
- package/src/utils/iterable/map.ts +1 -1
- package/src/utils/iterable/reduce.ts +1 -1
- package/src/utils/iterable/some.ts +1 -1
- package/src/utils/memoize-prop.ts +30 -0
- package/src/utils/object-hash.ts +1 -1
- package/src/utils/relations.ts +14 -11
- package/src/utils/string-hash.ts +1 -1
- package/dist/shared/core.CQDU11hR.d.mts +0 -753
- package/dist/shared/core.DJvmfnEi.d.mts +0 -1153
- package/dist/shared/core.DgfwjBtu.mjs +0 -495
- package/dist/shared/core.Dx7siloV.d.mts +0 -146
- package/dist/shared/core.SjLhMA7a.d.mts +0 -62
- package/src/builder/__snapshots__/Builder.spec.ts.snap +0 -374
- package/src/compute-view/element-view/predicates.ts +0 -520
- package/src/compute-view/utils/uniqueTags.ts +0 -21
- package/src/types/deployments.ts +0 -170
- package/src/types/element.ts +0 -109
- package/src/types/expression-v2-model.ts +0 -314
- package/src/types/expression-v2.ts +0 -392
- package/src/types/overview-graph.ts +0 -43
- package/src/types/relation.ts +0 -61
- package/src/types/scalars.ts +0 -39
- package/src/types/view-notation.ts +0 -9
- package/src/utils/graphlib.ts +0 -10
- /package/src/{errors/index.ts → utils/invariant.ts} +0 -0
package/dist/builder/index.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { m,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { i, l, d, c as computeLikeC4Model } from '../shared/core.CBpKAlhj.mjs';
|
|
2
|
+
import { m, i as i$1 } from '../shared/core.DoK86JEe.mjs';
|
|
3
|
+
import { _ as _type, D as DefaultElementShape, a as DefaultThemeColor, n as n$1, b as _stage, i as isDeployedInstance, F as FqnRef } from '../shared/core.CUYDgv2-.mjs';
|
|
4
|
+
import { n as nameFromFqn, d as isSameHierarchy, p as parentFqn, t as t$2 } from '../shared/core.rmvsy0n3.mjs';
|
|
5
|
+
import { l as l$1 } from '../shared/core.CpXlRyE5.mjs';
|
|
5
6
|
import { u } from '../shared/core.DbRvwARP.mjs';
|
|
6
|
-
import {
|
|
7
|
+
import { t as t$1 } from '../shared/core.cbA9VZ02.mjs';
|
|
8
|
+
import { t, i as invariant } from '../shared/core.Cy9smucx.mjs';
|
|
9
|
+
import { o, M as ModelFqnExpr, a as isElementView } from '../shared/core.Bk7wEZFG.mjs';
|
|
10
|
+
import '../shared/core.BrCnZFTn.mjs';
|
|
7
11
|
|
|
8
12
|
function n(...r){return u(Object.fromEntries,r)}
|
|
9
13
|
|
|
@@ -93,12 +97,16 @@ function parseWhere(where) {
|
|
|
93
97
|
};
|
|
94
98
|
case op.startsWith("source."):
|
|
95
99
|
return {
|
|
96
|
-
operator: parseWhere(
|
|
100
|
+
operator: parseWhere(
|
|
101
|
+
op.replace("source.", "")
|
|
102
|
+
),
|
|
97
103
|
participant: "source"
|
|
98
104
|
};
|
|
99
105
|
case op.startsWith("target."):
|
|
100
106
|
return {
|
|
101
|
-
operator: parseWhere(
|
|
107
|
+
operator: parseWhere(
|
|
108
|
+
op.replace("target.", "")
|
|
109
|
+
),
|
|
102
110
|
participant: "target"
|
|
103
111
|
};
|
|
104
112
|
default:
|
|
@@ -137,7 +145,7 @@ function $include(...args) {
|
|
|
137
145
|
}
|
|
138
146
|
const custom = args[1].with;
|
|
139
147
|
if (custom) {
|
|
140
|
-
const isElement =
|
|
148
|
+
const isElement = ModelFqnExpr.is(expr);
|
|
141
149
|
if (isElement) {
|
|
142
150
|
expr = {
|
|
143
151
|
custom: {
|
|
@@ -335,7 +343,7 @@ function $expr(expr) {
|
|
|
335
343
|
|
|
336
344
|
function mkViewBuilder(view) {
|
|
337
345
|
const viewBuilder = {
|
|
338
|
-
$expr: view
|
|
346
|
+
$expr: view[_type] === "deployment" ? $deploymentExpr : $expr,
|
|
339
347
|
autoLayout(autoLayout) {
|
|
340
348
|
view.rules.push({
|
|
341
349
|
direction: autoLayout
|
|
@@ -370,23 +378,52 @@ function mkViewBuilder(view) {
|
|
|
370
378
|
return viewBuilder;
|
|
371
379
|
}
|
|
372
380
|
|
|
381
|
+
function validateSpec(specification) {
|
|
382
|
+
for (const [kind, spec] of t$1(specification.elements)) {
|
|
383
|
+
if (spec.tags) {
|
|
384
|
+
for (const tag of spec.tags) {
|
|
385
|
+
invariant(specification.tags?.[tag], `Invalid specification for element kind "${kind}": tag "${tag}" not found`);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
if (specification.deployments) {
|
|
390
|
+
for (const [kind, spec] of t$1(specification.deployments)) {
|
|
391
|
+
if (spec.tags) {
|
|
392
|
+
for (const tag of spec.tags) {
|
|
393
|
+
invariant(
|
|
394
|
+
specification.tags?.[tag],
|
|
395
|
+
`Invalid specification for deployment kind "${kind}": tag "${tag}" not found`
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
373
402
|
function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _views = /* @__PURE__ */ new Map(), _globals = {
|
|
374
403
|
predicates: {},
|
|
375
404
|
dynamicPredicates: {},
|
|
376
405
|
styles: {}
|
|
377
406
|
}, _deployments = /* @__PURE__ */ new Map(), _deploymentRelations = []) {
|
|
378
|
-
const toLikeC4Specification = () =>
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
407
|
+
const toLikeC4Specification = () => {
|
|
408
|
+
validateSpec(spec);
|
|
409
|
+
return {
|
|
410
|
+
elements: {
|
|
411
|
+
...structuredClone(spec.elements)
|
|
412
|
+
},
|
|
413
|
+
deployments: {
|
|
414
|
+
...structuredClone(spec.deployments)
|
|
415
|
+
},
|
|
416
|
+
relationships: {
|
|
417
|
+
...structuredClone(spec.relationships)
|
|
418
|
+
},
|
|
419
|
+
tags: i(spec.tags ?? {}, (tagSpec) => ({
|
|
420
|
+
color: DefaultThemeColor,
|
|
421
|
+
...tagSpec
|
|
422
|
+
})),
|
|
423
|
+
...!!spec.metadataKeys ? { metadataKeys: spec.metadataKeys } : {},
|
|
424
|
+
customColors: {}
|
|
425
|
+
};
|
|
426
|
+
};
|
|
390
427
|
const mapLinks = (links) => {
|
|
391
428
|
if (!links || !i$1(links, 1)) {
|
|
392
429
|
return null;
|
|
@@ -394,7 +431,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
394
431
|
return m(links, (l) => typeof l === "string" ? { url: l } : l);
|
|
395
432
|
};
|
|
396
433
|
const createGenericView = (id, _props, builder2) => {
|
|
397
|
-
if (t$
|
|
434
|
+
if (t$2(_props)) {
|
|
398
435
|
builder2 = _props;
|
|
399
436
|
_props = {};
|
|
400
437
|
}
|
|
@@ -403,7 +440,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
403
440
|
links: _links = [],
|
|
404
441
|
title = null,
|
|
405
442
|
description = null,
|
|
406
|
-
tags =
|
|
443
|
+
tags = [],
|
|
407
444
|
...props
|
|
408
445
|
} = typeof _props === "string" ? { title: _props } : { ..._props };
|
|
409
446
|
const links = mapLinks(_links);
|
|
@@ -413,7 +450,8 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
413
450
|
description,
|
|
414
451
|
tags,
|
|
415
452
|
links,
|
|
416
|
-
|
|
453
|
+
_stage: "parsed",
|
|
454
|
+
// customColorDefinitions: {},
|
|
417
455
|
...props
|
|
418
456
|
}, builder2];
|
|
419
457
|
};
|
|
@@ -447,9 +485,9 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
447
485
|
return self;
|
|
448
486
|
},
|
|
449
487
|
__addRelation(relation) {
|
|
450
|
-
const sourceEl = _elements.get(relation.source);
|
|
488
|
+
const sourceEl = _elements.get(FqnRef.flatten(relation.source));
|
|
451
489
|
invariant(sourceEl, `Element with id "${relation.source}" not found`);
|
|
452
|
-
const targetEl = _elements.get(relation.target);
|
|
490
|
+
const targetEl = _elements.get(FqnRef.flatten(relation.target));
|
|
453
491
|
invariant(targetEl, `Element with id "${relation.target}" not found`);
|
|
454
492
|
invariant(
|
|
455
493
|
!isSameHierarchy(sourceEl, targetEl),
|
|
@@ -461,13 +499,14 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
461
499
|
});
|
|
462
500
|
return self;
|
|
463
501
|
},
|
|
464
|
-
/**
|
|
465
|
-
* Fully qualified name for nested elements
|
|
466
|
-
*/
|
|
467
502
|
__fqn(id) {
|
|
468
503
|
invariant(id.trim() !== "", "Id must be non-empty");
|
|
469
504
|
return id;
|
|
470
505
|
},
|
|
506
|
+
__deploymentFqn(id) {
|
|
507
|
+
invariant(id.trim() !== "", "Id must be non-empty");
|
|
508
|
+
return id;
|
|
509
|
+
},
|
|
471
510
|
__addSourcelessRelation() {
|
|
472
511
|
throw new Error("Can be called only in nested model");
|
|
473
512
|
},
|
|
@@ -475,7 +514,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
475
514
|
if (_views.has(view.id)) {
|
|
476
515
|
throw new Error(`View with id "${view.id}" already exists`);
|
|
477
516
|
}
|
|
478
|
-
if (
|
|
517
|
+
if (isElementView(view) && "viewOf" in view) {
|
|
479
518
|
invariant(
|
|
480
519
|
_elements.get(view.viewOf),
|
|
481
520
|
`Invalid scoped view ${view.id}, wlement with id "${view.viewOf}" not found`
|
|
@@ -495,7 +534,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
495
534
|
`Parent element with id "${parent}" not found for node with id "${node.id}"`
|
|
496
535
|
);
|
|
497
536
|
}
|
|
498
|
-
if (
|
|
537
|
+
if (isDeployedInstance(node)) {
|
|
499
538
|
invariant(parent, `Instance ${node.id} of ${node.element} must be deployed under a parent node`);
|
|
500
539
|
invariant(
|
|
501
540
|
_elements.get(node.element),
|
|
@@ -507,16 +546,16 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
507
546
|
},
|
|
508
547
|
__addDeploymentRelation: (relation) => {
|
|
509
548
|
invariant(
|
|
510
|
-
!isSameHierarchy(relation.source.
|
|
549
|
+
!isSameHierarchy(relation.source.deployment, relation.target.deployment),
|
|
511
550
|
"Cannot create relationship between elements in the same hierarchy"
|
|
512
551
|
);
|
|
513
552
|
invariant(
|
|
514
|
-
_deployments.has(relation.source.
|
|
515
|
-
`Relation "${relation.source.
|
|
553
|
+
_deployments.has(relation.source.deployment),
|
|
554
|
+
`Relation "${relation.source.deployment} -> ${relation.target.deployment}" references non-existing source`
|
|
516
555
|
);
|
|
517
556
|
invariant(
|
|
518
|
-
_deployments.has(relation.target.
|
|
519
|
-
`Relation "${relation.source.
|
|
557
|
+
_deployments.has(relation.target.deployment),
|
|
558
|
+
`Relation "${relation.source.deployment} -> ${relation.target.deployment}" references non-existing target`
|
|
520
559
|
);
|
|
521
560
|
_deploymentRelations.push({
|
|
522
561
|
id: `deploy_rel${_deploymentRelations.length + 1}`,
|
|
@@ -525,6 +564,8 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
525
564
|
return self;
|
|
526
565
|
},
|
|
527
566
|
build: () => ({
|
|
567
|
+
[_stage]: "parsed",
|
|
568
|
+
projectId: "from-builder",
|
|
528
569
|
specification: toLikeC4Specification(),
|
|
529
570
|
elements: n(
|
|
530
571
|
structuredClone(
|
|
@@ -550,7 +591,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
550
591
|
}),
|
|
551
592
|
toLikeC4Model: () => {
|
|
552
593
|
const parsed = self.build();
|
|
553
|
-
return
|
|
594
|
+
return computeLikeC4Model(parsed);
|
|
554
595
|
},
|
|
555
596
|
helpers: () => ({
|
|
556
597
|
model: {
|
|
@@ -571,8 +612,12 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
571
612
|
);
|
|
572
613
|
const links = mapLinks(_links);
|
|
573
614
|
b.__addRelation({
|
|
574
|
-
source
|
|
575
|
-
|
|
615
|
+
source: {
|
|
616
|
+
model: source
|
|
617
|
+
},
|
|
618
|
+
target: {
|
|
619
|
+
model: target
|
|
620
|
+
},
|
|
576
621
|
title,
|
|
577
622
|
...links && { links },
|
|
578
623
|
...props
|
|
@@ -592,7 +637,9 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
592
637
|
);
|
|
593
638
|
const links = mapLinks(_links);
|
|
594
639
|
b.__addSourcelessRelation({
|
|
595
|
-
target
|
|
640
|
+
target: {
|
|
641
|
+
model: target
|
|
642
|
+
},
|
|
596
643
|
title,
|
|
597
644
|
...links && { links },
|
|
598
645
|
...props
|
|
@@ -620,7 +667,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
620
667
|
title: title ?? nameFromFqn(_id),
|
|
621
668
|
description: null,
|
|
622
669
|
technology: null,
|
|
623
|
-
tags:
|
|
670
|
+
tags: [],
|
|
624
671
|
color: specStyle?.color ?? DefaultThemeColor,
|
|
625
672
|
shape: specStyle?.shape ?? DefaultElementShape,
|
|
626
673
|
style: d({
|
|
@@ -646,7 +693,9 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
646
693
|
b.__addSourcelessRelation = (relation) => {
|
|
647
694
|
return b.__addRelation({
|
|
648
695
|
...relation,
|
|
649
|
-
source:
|
|
696
|
+
source: {
|
|
697
|
+
model: __fqn(id)
|
|
698
|
+
}
|
|
650
699
|
});
|
|
651
700
|
};
|
|
652
701
|
ops.reduce((b2, op) => op(b2), b);
|
|
@@ -670,7 +719,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
670
719
|
const [generic, builder2] = createGenericView(id, _props, _builder);
|
|
671
720
|
const view = {
|
|
672
721
|
...generic,
|
|
673
|
-
|
|
722
|
+
[_type]: "element",
|
|
674
723
|
rules: []
|
|
675
724
|
};
|
|
676
725
|
const add = (b) => {
|
|
@@ -695,7 +744,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
695
744
|
const view = {
|
|
696
745
|
...generic,
|
|
697
746
|
viewOf,
|
|
698
|
-
|
|
747
|
+
[_type]: "element",
|
|
699
748
|
rules: []
|
|
700
749
|
};
|
|
701
750
|
const add = (b) => {
|
|
@@ -719,7 +768,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
719
768
|
const [generic, builder2] = createGenericView(id, _props, _builder);
|
|
720
769
|
const view = {
|
|
721
770
|
...generic,
|
|
722
|
-
|
|
771
|
+
[_type]: "deployment",
|
|
723
772
|
rules: []
|
|
724
773
|
};
|
|
725
774
|
const add = (b) => {
|
|
@@ -768,7 +817,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
768
817
|
title,
|
|
769
818
|
...props
|
|
770
819
|
} = typeof _props === "string" ? { title: _props } : { ..._props };
|
|
771
|
-
const _id = b.
|
|
820
|
+
const _id = b.__deploymentFqn(id);
|
|
772
821
|
invariant(_elements.has(target), `Target element with id "${target}" not found`);
|
|
773
822
|
b.__addDeployment({
|
|
774
823
|
id: _id,
|
|
@@ -783,18 +832,18 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
783
832
|
rel: (source, target, _props) => {
|
|
784
833
|
return (b) => {
|
|
785
834
|
const {
|
|
786
|
-
title,
|
|
835
|
+
title = null,
|
|
787
836
|
links,
|
|
788
837
|
...props
|
|
789
838
|
} = typeof _props === "string" ? { title: _props } : { ..._props };
|
|
790
839
|
b.__addDeploymentRelation({
|
|
791
840
|
source: {
|
|
792
|
-
|
|
841
|
+
deployment: source
|
|
793
842
|
},
|
|
794
843
|
target: {
|
|
795
|
-
|
|
844
|
+
deployment: target
|
|
796
845
|
},
|
|
797
|
-
|
|
846
|
+
title,
|
|
798
847
|
...links && { links: mapLinks(links) },
|
|
799
848
|
...props
|
|
800
849
|
});
|
|
@@ -813,7 +862,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
813
862
|
...props
|
|
814
863
|
} = typeof _props === "string" ? { title: _props } : { ..._props };
|
|
815
864
|
const icon = _icon ?? specStyle?.icon;
|
|
816
|
-
const _id = b.
|
|
865
|
+
const _id = b.__deploymentFqn(id);
|
|
817
866
|
b.__addDeployment({
|
|
818
867
|
id: _id,
|
|
819
868
|
kind,
|
|
@@ -821,18 +870,20 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
821
870
|
description: null,
|
|
822
871
|
technology: null,
|
|
823
872
|
tags: null,
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
873
|
+
style: {
|
|
874
|
+
...icon && { icon },
|
|
875
|
+
color: specStyle?.color ?? DefaultThemeColor,
|
|
876
|
+
shape: specStyle?.shape ?? DefaultElementShape,
|
|
877
|
+
...d({
|
|
878
|
+
border: specStyle?.border,
|
|
879
|
+
opacity: specStyle?.opacity,
|
|
880
|
+
size: specStyle?.size,
|
|
881
|
+
padding: specStyle?.padding,
|
|
882
|
+
textSize: specStyle?.textSize,
|
|
883
|
+
...style
|
|
884
|
+
}, l$1)
|
|
885
|
+
},
|
|
834
886
|
...links && { links: mapLinks(links) },
|
|
835
|
-
...icon && { icon },
|
|
836
887
|
...spec2,
|
|
837
888
|
...props
|
|
838
889
|
});
|
|
@@ -840,12 +891,12 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
840
891
|
};
|
|
841
892
|
add.with = (...ops) => (b) => {
|
|
842
893
|
add(b);
|
|
843
|
-
const {
|
|
894
|
+
const { __deploymentFqn } = b;
|
|
844
895
|
try {
|
|
845
|
-
b.
|
|
896
|
+
b.__deploymentFqn = (child) => `${__deploymentFqn(id)}.${child}`;
|
|
846
897
|
ops.reduce((b2, op) => op(b2), b);
|
|
847
898
|
} finally {
|
|
848
|
-
b.
|
|
899
|
+
b.__deploymentFqn = __deploymentFqn;
|
|
849
900
|
}
|
|
850
901
|
return b;
|
|
851
902
|
};
|
|
@@ -883,6 +934,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
|
|
|
883
934
|
var Builder;
|
|
884
935
|
((Builder2) => {
|
|
885
936
|
function forSpecification(spec) {
|
|
937
|
+
validateSpec(spec);
|
|
886
938
|
const b = builder(spec);
|
|
887
939
|
return {
|
|
888
940
|
...b.helpers(),
|
|
@@ -891,6 +943,7 @@ var Builder;
|
|
|
891
943
|
}
|
|
892
944
|
Builder2.forSpecification = forSpecification;
|
|
893
945
|
function specification(spec) {
|
|
946
|
+
validateSpec(spec);
|
|
894
947
|
return builder(spec);
|
|
895
948
|
}
|
|
896
949
|
Builder2.specification = specification;
|
|
@@ -1,22 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import { L as
|
|
1
|
+
import { A as Any } from '../shared/core.BaYE_r29.mjs';
|
|
2
|
+
import { L as LikeC4Model } from '../shared/core.znRaUX_A.mjs';
|
|
3
|
+
import { k as ParsedLikeC4ModelData, l as ComputedLikeC4ModelData, aF as ParsedView, aI as ComputedView } from '../shared/core.DXzRBkuI.mjs';
|
|
3
4
|
import 'type-fest';
|
|
4
|
-
import '../shared/core.
|
|
5
|
+
import '../shared/core.BuO4ncfY.mjs';
|
|
6
|
+
import '../shared/core.CywrQs86.mjs';
|
|
7
|
+
|
|
8
|
+
type ComputeViewResult<V> = {
|
|
9
|
+
isSuccess: true;
|
|
10
|
+
error?: undefined;
|
|
11
|
+
view: V;
|
|
12
|
+
} | {
|
|
13
|
+
isSuccess: false;
|
|
14
|
+
error: Error;
|
|
15
|
+
view: undefined;
|
|
16
|
+
};
|
|
17
|
+
declare function unsafeComputeView<A extends Any>(viewsource: ParsedView<A>, likec4model: LikeC4Model<any>): ComputedView<A>;
|
|
18
|
+
declare function computeView<A extends Any>(viewsource: ParsedView<A>, likec4model: LikeC4Model<A>): ComputeViewResult<ComputedView<A>>;
|
|
19
|
+
declare function computeParsedModelData<A extends Any>(parsed: ParsedLikeC4ModelData<A>): ComputedLikeC4ModelData<A>;
|
|
20
|
+
declare function computeLikeC4Model<A extends Any>(parsed: ParsedLikeC4ModelData<A>): LikeC4Model.Computed<A>;
|
|
5
21
|
|
|
6
22
|
/**
|
|
7
23
|
* Resolve rules of extended views
|
|
8
24
|
* (Removes invalid views)
|
|
9
25
|
*/
|
|
10
|
-
declare function resolveRulesExtendedViews<V extends Record<any,
|
|
26
|
+
declare function resolveRulesExtendedViews<A extends Any, V extends Record<any, ParsedView<A>>>(unresolvedViews: V): V;
|
|
11
27
|
|
|
12
28
|
/**
|
|
13
29
|
* Convert hashed edge ids to human-readable
|
|
14
30
|
* Mostly for testing purposes
|
|
15
31
|
*/
|
|
16
|
-
declare function withReadableEdges<
|
|
32
|
+
declare function withReadableEdges<V extends ComputedView<any>>({ edges, nodes, ...view }: V, separator?: string): V & {
|
|
17
33
|
nodeIds: string[];
|
|
18
34
|
edgeIds: string[];
|
|
19
35
|
};
|
|
20
|
-
declare function viewsWithReadableEdges<
|
|
36
|
+
declare function viewsWithReadableEdges<A extends Any>({ views, ...model }: ComputedLikeC4ModelData<A>): ComputedLikeC4ModelData<A>;
|
|
21
37
|
|
|
22
|
-
export { resolveRulesExtendedViews, viewsWithReadableEdges, withReadableEdges };
|
|
38
|
+
export { type ComputeViewResult, computeLikeC4Model, computeParsedModelData, computeView, resolveRulesExtendedViews, unsafeComputeView, viewsWithReadableEdges, withReadableEdges };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { G as Graph,
|
|
2
|
-
export { c as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { G as Graph, w as willCreateCycle, t as topologicalSortExports, i as i$2, l } from '../shared/core.CBpKAlhj.mjs';
|
|
2
|
+
export { c as computeLikeC4Model, a as computeParsedModelData, b as computeView, u as unsafeComputeView } from '../shared/core.CBpKAlhj.mjs';
|
|
3
|
+
import { r, i as i$1 } from '../shared/core.cbA9VZ02.mjs';
|
|
4
|
+
import { i as isExtendsElementView, a as isElementView } from '../shared/core.Bk7wEZFG.mjs';
|
|
5
|
+
import { c as isNonEmptyArray } from '../shared/core.rmvsy0n3.mjs';
|
|
6
|
+
import { i, m } from '../shared/core.DoK86JEe.mjs';
|
|
6
7
|
import { u } from '../shared/core.DbRvwARP.mjs';
|
|
8
|
+
import '../shared/core.CpXlRyE5.mjs';
|
|
9
|
+
import '../shared/core.Cy9smucx.mjs';
|
|
10
|
+
import '../shared/core.CUYDgv2-.mjs';
|
|
11
|
+
import '../shared/core.BrCnZFTn.mjs';
|
|
7
12
|
|
|
8
13
|
function y(...t){return u(f,t)}function f(t,e){if(!i(e,1))return {...t};if(!i(e,2)){let{[e[0]]:r,...m}=t;return m}let o={...t};for(let r of e)delete o[r];return o}
|
|
9
14
|
|
|
@@ -56,7 +61,7 @@ function resolveRulesExtendedViews(unresolvedViews) {
|
|
|
56
61
|
...view,
|
|
57
62
|
title: view.title ?? extendsFrom.title ?? null,
|
|
58
63
|
description: view.description ?? extendsFrom.description ?? null,
|
|
59
|
-
tags
|
|
64
|
+
tags,
|
|
60
65
|
links: isNonEmptyArray(links) ? links : null,
|
|
61
66
|
rules: [...extendsFrom.rules, ...view.rules]
|
|
62
67
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as Any, U as Unknown, g as ElementId, V as ViewId } from '../../shared/core.BaYE_r29.mjs';
|
|
2
|
+
import { E as ElementModel, R as RelationshipModel, L as LikeC4Model } from '../../shared/core.znRaUX_A.mjs';
|
|
2
3
|
import 'type-fest';
|
|
3
|
-
import '../../shared/core.
|
|
4
|
-
import '../../shared/core.
|
|
4
|
+
import '../../shared/core.BuO4ncfY.mjs';
|
|
5
|
+
import '../../shared/core.CywrQs86.mjs';
|
|
6
|
+
import '../../shared/core.DXzRBkuI.mjs';
|
|
5
7
|
|
|
6
|
-
type RelationshipsViewData<M extends
|
|
8
|
+
type RelationshipsViewData<M extends Any = Unknown> = {
|
|
7
9
|
incomers: ReadonlySet<ElementModel<M>>;
|
|
8
10
|
incoming: ReadonlySet<RelationshipModel<M>>;
|
|
9
11
|
subjects: ReadonlySet<ElementModel<M>>;
|
|
@@ -11,11 +13,11 @@ type RelationshipsViewData<M extends AnyAux = AnyAux> = {
|
|
|
11
13
|
outgoers: ReadonlySet<ElementModel<M>>;
|
|
12
14
|
};
|
|
13
15
|
|
|
14
|
-
declare function computeRelationshipsView<
|
|
16
|
+
declare function computeRelationshipsView<M extends Any>(subjectId: ElementId<M>, likec4model: LikeC4Model<M>, scopeViewId: ViewId<M> | null, scope?: 'global' | 'view'): RelationshipsViewData<M>;
|
|
15
17
|
|
|
16
|
-
declare function treeFromElements<
|
|
18
|
+
declare function treeFromElements<M extends Any>(elements: Iterable<ElementModel<M>>): {
|
|
17
19
|
sorted: readonly ElementModel<M>[];
|
|
18
|
-
byId: (id: M
|
|
20
|
+
byId: (id: ElementId<M>) => ElementModel<M>;
|
|
19
21
|
root: ReadonlySet<ElementModel<M>>;
|
|
20
22
|
parent: (el: ElementModel<M>) => ElementModel<M> | null;
|
|
21
23
|
children: (el: ElementModel<M>) => ReadonlyArray<ElementModel<M>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { s as sortParentsFirst, D as DefaultMap, i as isDescendantOf, a as isAncestor,
|
|
2
|
-
import { n as nonNullable, i as invariant } from '../../shared/core.
|
|
1
|
+
import { s as sortParentsFirst, D as DefaultMap, i as isDescendantOf, a as isAncestor, b as ifilter, C } from '../../shared/core.rmvsy0n3.mjs';
|
|
2
|
+
import { n as nonNullable, i as invariant } from '../../shared/core.Cy9smucx.mjs';
|
|
3
|
+
import { t as toSet, a as toArray, i as imap } from '../../shared/core.BrCnZFTn.mjs';
|
|
3
4
|
|
|
4
5
|
function treeFromElements(elements) {
|
|
5
6
|
const sorted = sortParentsFirst([...elements]);
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { BiMap,
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { A as
|
|
7
|
-
export {
|
|
8
|
-
export { I as IterableContainer, R as ReorderedArray, a as ancestorsFqn, c as commonAncestor, b as compareByFqnHierarchically, d as compareFqnHierarchically, h as hierarchyDistance, e as hierarchyLevel, i as isAncestor, f as isDescendantOf, g as isSameHierarchy, n as nameFromFqn, p as parentFqn, s as sortByFqnHierarchically, j as sortNaturalByFqn, k as sortParentsFirst } from './shared/core.
|
|
1
|
+
import { C as ColorLiteral, T as ThemeColorValues, L as LikeC4Theme } from './shared/core.DXzRBkuI.mjs';
|
|
2
|
+
export { W as AbstractRelationship, ad as AndOperator, aY as AnyExcludePredicate, aX as AnyIncludePredicate, aK as AnyView, aZ as AnyViewRuleStyle, b2 as AutoLayoutDirection, y as AuxFromDump, A as AuxFromLikeC4ModelData, B as BBox, ba as BaseParsedViewProperties, b9 as BaseViewProperties, ap as BorderStyle, ao as BorderStyles, az as Color, bh as ComputedDeploymentView, bi as ComputedDynamicView, bf as ComputedEdge, bg as ComputedElementView, l as ComputedLikeC4ModelData, be as ComputedNode, aI as ComputedView, at as CustomColor, au as CustomColorDefinitions, U as DefaultArrowType, H as DefaultElementShape, Q as DefaultLineStyle, J as DefaultPaddingSize, V as DefaultRelationshipColor, I as DefaultShapeSize, K as DefaultTextSize, z as DefaultThemeColor, p as DeployedInstance, q as DeploymentElement, r as DeploymentElementRef, D as DeploymentElementStyle, o as DeploymentNode, v as DeploymentRelation, u as DeploymentRelationship, bp as DeploymentViewExcludePredicate, bo as DeploymentViewIncludePredicate, bq as DeploymentViewPredicate, bs as DeploymentViewRule, br as DeploymentViewRuleStyle, bk as DiagramEdge, bj as DiagramNode, aG as DiagramView, by as DynamicViewIncludeRule, bv as DynamicViewParallelSteps, bz as DynamicViewRule, bu as DynamicViewStep, bx as DynamicViewStepOrParallel, O as Element, ar as ElementShape, aq as ElementShapes, _ as ElementSpecification, N as ElementStyle, aB as ElementThemeColorValues, aC as ElementThemeColors, bD as ElementViewExcludePredicate, bC as ElementViewIncludePredicate, bE as ElementViewPredicate, bI as ElementViewRule, bF as ElementViewRuleGroup, bH as ElementViewRuleStyle, a3 as EqualOperator, E as Expression, ai as Filterable, F as FqnExpr, c as FqnRef, g as GlobalDynamicPredicates, G as GlobalPredicateId, f as GlobalPredicates, h as GlobalStyleID, i as GlobalStyles, as as HexColor, a6 as KindEqual, bm as LayoutedDeploymentView, bn as LayoutedDynamicView, bl as LayoutedElementView, m as LayoutedLikeC4ModelData, aG as LayoutedView, n as LikeC4ModelData, x as LikeC4ModelDump, aF as LikeC4View, b as ModelExpression, M as ModelFqnExpr, j as ModelGlobals, Z as ModelRelation, a as ModelRelationExpr, bb as NodeNotation, ab as NotOperator, aj as OperatorPredicate, af as OrOperator, bt as ParsedDeploymentView, bA as ParsedDynamicView, bJ as ParsedElementView, k as ParsedLikeC4ModelData, aF as ParsedView, a8 as Participant, a9 as ParticipantOperator, d as Point, P as PredicateSelector, aJ as ProcessedView, e as RectBox, R as RelationExpr, Y as Relationship, aw as RelationshipArrowType, av as RelationshipLineType, a1 as RelationshipSpecification, aD as RelationshipThemeColorValues, aE as RelationshipThemeColors, an as ShapeSize, al as SpacingSize, w as SpecTypesFromDump, a2 as Specification, S as SpecificationDump, a4 as TagEqual, $ as TagSpecification, am as TextSize, ay as ThemeColor, ax as ThemeColors, b6 as ViewAutoLayout, b7 as ViewManualLayout, aL as ViewOnStage, aN as ViewRule, b4 as ViewRuleAutoLayout, b0 as ViewRuleGlobalPredicateRef, a_ as ViewRuleGlobalStyle, aO as ViewRulePredicate, b8 as ViewType, bd as ViewWithHash, bc as ViewWithNotation, aM as ViewWithType, ah as WhereOperator, X as XYPoint, bw as getParallelStepsPrefix, ae as isAndOperator, b3 as isAutoLayoutDirection, aR as isComputedView, t as isDeployedInstance, s as isDeploymentNode, aV as isDeploymentView, aH as isDiagramView, aW as isDynamicView, bB as isDynamicViewParallelSteps, aS as isElementView, aU as isExtendsElementView, a7 as isKindEqual, aH as isLayoutedView, ac as isNotOperator, ag as isOrOperator, aa as isParticipantOperator, aT as isScopedElementView, a0 as isTagColorSpecified, a5 as isTagEqual, aA as isThemeColor, b5 as isViewRuleAutoLayout, b1 as isViewRuleGlobalPredicateRef, a$ as isViewRuleGlobalStyle, bG as isViewRuleGroup, aP as isViewRulePredicate, aQ as isViewRuleStyle, ak as whereOperatorAsPredicate } from './shared/core.DXzRBkuI.mjs';
|
|
3
|
+
export { BiMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, commonHead, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equalsSet, getOrCreate, hasAtLeast, ifilter, ifind, iflat, ihead, imap, intersection, invariant, ireduce, isIterable, isNonEmptyArray, isString, isome, iunique, memoizeProp, nonNullable, nonexhaustive, objectHash, stringHash, symmetricDifference, toArray, toSet, union } from './utils/index.mjs';
|
|
4
|
+
export { D as DefaultMap } from './shared/core.CywrQs86.mjs';
|
|
5
|
+
export { A as Any, A as AnyAux, b as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, c as UnknownComputed, d as UnknownLayouted, e as UnknownParsed, _ as _stage, f as _type, a as aux, i as isOnStage } from './shared/core.BaYE_r29.mjs';
|
|
6
|
+
export { A as AnyFqn, B as BuiltInIcon, C as Coalesce, D as DeploymentFqn, b as DeploymentKind, E as EdgeId, a as ElementKind, f as ExclusiveUnion, F as Fqn, m as GlobalFqn, G as GroupElementKind, i as Icon, j as IconUrl, I as IteratorLike, K as KeysOf, L as Link, g as NTuple, N as NodeId, d as NonEmptyArray, e as NonEmptyReadonlyArray, h as Predicate, P as ProjectId, R as RelationId, l as RelationKind, c as RelationshipKind, p as StepEdgeId, S as StepEdgeIdLiteral, r as StepEdgeKind, T as Tag, V as ViewId, u as extractStep, n as isGlobalFqn, k as isGroupElementKind, t as isStepEdgeId, s as scalar, o as splitGlobalFqn, q as stepEdgeId } from './shared/core.BuO4ncfY.mjs';
|
|
7
|
+
export { ViewChange } from './types/index.mjs';
|
|
8
|
+
export { I as IterableContainer, R as ReorderedArray, a as ancestorsFqn, c as commonAncestor, b as compareByFqnHierarchically, d as compareFqnHierarchically, h as hierarchyDistance, e as hierarchyLevel, i as isAncestor, f as isDescendantOf, g as isSameHierarchy, n as nameFromFqn, p as parentFqn, s as sortByFqnHierarchically, j as sortNaturalByFqn, k as sortParentsFirst } from './shared/core.Pf5I9o0e.mjs';
|
|
9
9
|
import 'type-fest';
|
|
10
10
|
|
|
11
11
|
declare const ElementColors: {
|
|
@@ -136,10 +136,6 @@ declare const RelationshipColors: {
|
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
declare const defaultTheme: LikeC4Theme;
|
|
139
|
-
declare function computeColorValues(color:
|
|
139
|
+
declare function computeColorValues(color: ColorLiteral): ThemeColorValues;
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
declare function invariant(condition: any, message?: string): asserts condition;
|
|
143
|
-
declare function nonexhaustive(value: never): never;
|
|
144
|
-
|
|
145
|
-
export { ElementColors, HexColorLiteral, LikeC4Theme, RelationshipColors, ThemeColorValues, computeColorValues, defaultTheme, invariant, nonNullable, nonexhaustive };
|
|
141
|
+
export { ColorLiteral, ElementColors, LikeC4Theme, RelationshipColors, ThemeColorValues, computeColorValues, defaultTheme };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { ThemeColors, isThemeColor } from './types/index.mjs';
|
|
1
|
+
export { f as DefaultArrowType, D as DefaultElementShape, g as DefaultLineStyle, m as DefaultPaddingSize, h as DefaultRelationshipColor, l as DefaultShapeSize, p as DefaultTextSize, a as DefaultThemeColor, A as DeploymentFqn, H as EdgeId, z as Fqn, F as FqnRef, B as GlobalFqn, G as GroupElementKind, N as NodeId, R as RelationId, S as StepEdgeKind, V as ViewId, b as _stage, _ as _type, I as extractStep, v as isAndOperator, i as isDeployedInstance, k as isDeploymentNode, C as isGlobalFqn, e as isGroupElementKind, r as isKindEqual, u as isNotOperator, j as isOnStage, x as isOrOperator, t as isParticipantOperator, d as isStepEdgeId, q as isTagEqual, E as splitGlobalFqn, s as stepEdgeId, w as whereOperatorAsPredicate } from './shared/core.CUYDgv2-.mjs';
|
|
2
|
+
export { E as Expression, F as FqnExpr, k as ModelExpression, M as ModelFqnExpr, j as ModelRelationExpr, R as RelationExpr, s as getParallelStepsPrefix, r as isAutoLayoutDirection, n as isComputedView, m as isDeploymentView, p as isDiagramView, l as isDynamicView, h as isDynamicViewParallelSteps, a as isElementView, i as isExtendsElementView, p as isLayoutedView, q as isScopedElementView, d as isViewRuleAutoLayout, f as isViewRuleGlobalPredicateRef, g as isViewRuleGlobalStyle, e as isViewRuleGroup, c as isViewRulePredicate, b as isViewRuleStyle } from './shared/core.Bk7wEZFG.mjs';
|
|
3
|
+
export { BBox, BorderStyles, ElementShapes, RectBox, ThemeColors, isTagColorSpecified, isThemeColor } from './types/index.mjs';
|
|
5
4
|
export { BiMap, DefaultWeakMap, LinkedList, MultiMap, Queue, compareRelations, delay, ireduce } from './utils/index.mjs';
|
|
6
|
-
export { D as DefaultMap, l as ancestorsFqn,
|
|
7
|
-
export { S as Stack, c as commonHead,
|
|
5
|
+
export { D as DefaultMap, l as ancestorsFqn, k as commonAncestor, h as compareByFqnHierarchically, q as compareFqnHierarchically, m as compareNatural, o as compareNaturalHierarchically, r as hierarchyDistance, u as hierarchyLevel, b as ifilter, a as isAncestor, i as isDescendantOf, c as isNonEmptyArray, d as isSameHierarchy, w as isString, n as nameFromFqn, p as parentFqn, j as sortByFqnHierarchically, v as sortNaturalByFqn, s as sortParentsFirst } from './shared/core.rmvsy0n3.mjs';
|
|
6
|
+
export { S as Stack, c as commonHead, e as iflat, i as isIterable, b as iunique, o as objectHash } from './shared/core.CpXlRyE5.mjs';
|
|
7
|
+
export { i as invariant, n as nonNullable, a as nonexhaustive } from './shared/core.Cy9smucx.mjs';
|
|
8
|
+
export { d as difference, j as equalsSet, g as getOrCreate, i as hasAtLeast, c as ifind, e as ihead, a as intersection, b as isome, f as memoizeProp, k as stringHash, s as symmetricDifference, u as union } from './shared/core.DoK86JEe.mjs';
|
|
9
|
+
export { i as imap, a as toArray, t as toSet } from './shared/core.BrCnZFTn.mjs';
|
|
10
|
+
import './shared/core.DbRvwARP.mjs';
|
|
8
11
|
|
|
9
12
|
const { min: min$4, max: max$4 } = Math;
|
|
10
13
|
|