@likec4/core 1.39.4 → 1.40.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 +5 -5
- package/dist/builder/index.mjs +2 -2
- package/dist/compute-view/index.d.mts +5 -5
- package/dist/compute-view/index.mjs +2 -2
- package/dist/compute-view/relationships-view/index.d.mts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/model/connection/deployment/index.d.mts +7 -7
- package/dist/model/connection/deployment/index.mjs +1 -1
- package/dist/model/connection/index.d.mts +8 -8
- package/dist/model/connection/index.mjs +1 -1
- package/dist/model/connection/model/index.d.mts +7 -7
- package/dist/model/index.d.mts +10 -10
- package/dist/model/index.mjs +3 -3
- package/dist/shared/{core.CxGKeL-L.mjs → core.6_Vp2iiN.mjs} +29 -1
- package/dist/shared/{core.CsbOakly.mjs → core.BIAlzwKc.mjs} +1 -1
- package/dist/shared/{core.DmFVWyBc.d.mts → core.BbThmf6M.d.mts} +2 -2
- package/dist/shared/{core.B65NlqR_.d.mts → core.Bpou6c2f.d.mts} +33 -4
- package/dist/shared/{core.PFqKFee4.d.mts → core.CySf-2gP.d.mts} +19 -8
- package/dist/shared/{core.Chtad_Hv.d.mts → core.D704WZES.d.mts} +2 -2
- package/dist/shared/{core.BqVo8LrH.mjs → core.DHQ32OHa.mjs} +25 -5
- package/dist/shared/{core.B4scjmM6.d.mts → core.D_fI5Lf6.d.mts} +1 -1
- package/dist/shared/{core.BZs_hKMJ.d.mts → core.DrVOJuxX.d.mts} +4 -4
- package/dist/shared/{core.1_FtXl46.d.mts → core.DrvfVXkh.d.mts} +1 -1
- package/dist/shared/{core.CNhp8dSD.mjs → core.DuR3R-xJ.mjs} +4 -3
- package/dist/shared/{core.DozSPE83.mjs → core.FPITT8Vx.mjs} +21 -4
- package/dist/shared/{core.Bq0r6_yG.d.mts → core.kxeJe0OY.d.mts} +3 -3
- package/dist/shared/{core.1ypAWObi.d.mts → core.vWJTxpLV.d.mts} +1 -1
- package/dist/types/_aux.d.mts +2 -2
- package/dist/types/expression-model.d.mts +3 -3
- package/dist/types/expression.d.mts +3 -3
- package/dist/types/fqnRef.d.mts +2 -2
- package/dist/types/index.d.mts +6 -6
- package/dist/types/index.mjs +2 -2
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/iterable/index.d.mts +1 -1
- package/package.json +3 -3
- package/src/compute-view/dynamic-view/compute.ts +1 -0
- package/src/model/view/LikeC4ViewModel.ts +24 -6
- package/src/types/RichText.ts +4 -1
- package/src/types/_common.ts +1 -1
- package/src/types/geometry.ts +29 -1
- package/src/types/model-logical.ts +27 -3
- package/src/types/view-computed.ts +7 -0
- package/src/types/view-layouted.ts +7 -0
- package/src/types/view-parsed.dynamic.ts +11 -0
package/dist/builder/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LastArrayElement, Split, Simplify, IsLiteral, Writable, IfNever, IsNever, TupleToUnion, Tagged } from 'type-fest';
|
|
2
|
-
import { g as LikeC4Model } from '../shared/core.
|
|
2
|
+
import { g as LikeC4Model } from '../shared/core.CySf-2gP.mjs';
|
|
3
3
|
import { D as DeploymentFqn, F as Fqn } from '../shared/core.DX-WYEPA.mjs';
|
|
4
|
-
import { l as DeploymentElement, p as DeploymentRelationship,
|
|
5
|
-
import { c as Participant, E as Expression } from '../shared/core.
|
|
4
|
+
import { l as DeploymentElement, p as DeploymentRelationship, I as Element, T as ModelRelation, aj as AnyViewRuleStyle, ao as AutoLayoutDirection, $ as ParsedView, aP as ParsedDeploymentView, b4 as ParsedElementView, h as ParsedLikeC4ModelData, U as ElementSpecification$1, Y as RelationshipSpecification, V as TagSpecification } from '../shared/core.Bpou6c2f.mjs';
|
|
5
|
+
import { c as Participant, E as Expression } from '../shared/core.BbThmf6M.mjs';
|
|
6
6
|
import { ModelFqnExpr, ModelRelationExpr } from '../types/expression-model.mjs';
|
|
7
|
-
import { N as NonEmptyArray, K as KeysOf } from '../shared/core.
|
|
8
|
-
import { y as setProject, a as Aux, S as SpecAux, A as Any } from '../shared/core.
|
|
7
|
+
import { N as NonEmptyArray, K as KeysOf } from '../shared/core.DrvfVXkh.mjs';
|
|
8
|
+
import { y as setProject, a as Aux, S as SpecAux, A as Any } from '../shared/core.D_fI5Lf6.mjs';
|
|
9
9
|
import { c as ElementShape, h as ThemeColor, b as BorderStyle, a as ShapeSize, S as SpacingSize, T as TextSize, f as RelationshipArrowType, R as RelationshipLineType } from '../shared/core.CzdwsPmY.mjs';
|
|
10
10
|
import '../shared/core.CywrQs86.mjs';
|
|
11
11
|
import '../types/fqnRef.mjs';
|
package/dist/builder/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import defu from 'defu';
|
|
2
2
|
import { isArray, isString, map, entries, mapValues, fromEntries, mapToObj, isNullish, pickBy, isNonNullish, hasAtLeast, isFunction } from 'remeda';
|
|
3
|
-
import { c as computeLikeC4Model } from '../shared/core.
|
|
3
|
+
import { c as computeLikeC4Model } from '../shared/core.DuR3R-xJ.mjs';
|
|
4
4
|
import { n as nameFromFqn, d as isSameHierarchy, p as parentFqn } from '../shared/core.DgttqsJc.mjs';
|
|
5
5
|
import { ModelFqnExpr } from '../types/expression-model.mjs';
|
|
6
6
|
import { a as _type, _ as _stage, c as isDeployedInstance } from '../shared/core.yHe79zEl.mjs';
|
|
7
7
|
import { i as invariant } from '../shared/core.D4npX2q8.mjs';
|
|
8
8
|
import { d as isElementView } from '../shared/core.T-eLZTW_.mjs';
|
|
9
9
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
10
|
-
import { D as DefaultThemeColor, a as DefaultElementShape } from '../shared/core.
|
|
10
|
+
import { D as DefaultThemeColor, a as DefaultElementShape } from '../shared/core.DHQ32OHa.mjs';
|
|
11
11
|
|
|
12
12
|
function parseWhere(where) {
|
|
13
13
|
if (isString(where)) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as Any } from '../shared/core.
|
|
2
|
-
import { g as LikeC4Model } from '../shared/core.
|
|
3
|
-
import { h as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData,
|
|
1
|
+
import { A as Any } from '../shared/core.D_fI5Lf6.mjs';
|
|
2
|
+
import { g as LikeC4Model } from '../shared/core.CySf-2gP.mjs';
|
|
3
|
+
import { h as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, $ as ParsedView, a2 as ComputedView } from '../shared/core.Bpou6c2f.mjs';
|
|
4
4
|
import 'type-fest';
|
|
5
|
-
import '../shared/core.
|
|
5
|
+
import '../shared/core.DrvfVXkh.mjs';
|
|
6
6
|
import '../shared/core.DX-WYEPA.mjs';
|
|
7
7
|
import '../shared/core.CywrQs86.mjs';
|
|
8
8
|
import '../shared/core.CzdwsPmY.mjs';
|
|
9
|
-
import '../shared/core.
|
|
9
|
+
import '../shared/core.BbThmf6M.mjs';
|
|
10
10
|
import '../types/fqnRef.mjs';
|
|
11
11
|
import '../types/expression-model.mjs';
|
|
12
12
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as Graph, w as willCreateCycle, t as topologicalSortExports } from '../shared/core.
|
|
2
|
-
export { c as computeLikeC4Model, a as computeParsedModelData, b as computeView, u as unsafeComputeView } from '../shared/core.
|
|
1
|
+
import { G as Graph, w as willCreateCycle, t as topologicalSortExports } from '../shared/core.DuR3R-xJ.mjs';
|
|
2
|
+
export { c as computeLikeC4Model, a as computeParsedModelData, b as computeView, u as unsafeComputeView } from '../shared/core.DuR3R-xJ.mjs';
|
|
3
3
|
import { values, unique, mapValues, omit, mapToObj, map } from 'remeda';
|
|
4
4
|
import { f as isExtendsElementView, d as isElementView } from '../shared/core.T-eLZTW_.mjs';
|
|
5
5
|
import { c as isNonEmptyArray } from '../shared/core.DgttqsJc.mjs';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as Any, U as Unknown, j as ElementId, V as ViewId } from '../../shared/core.
|
|
2
|
-
import { E as ElementModel, R as RelationshipModel, g as LikeC4Model } from '../../shared/core.
|
|
1
|
+
import { A as Any, U as Unknown, j as ElementId, V as ViewId } from '../../shared/core.D_fI5Lf6.mjs';
|
|
2
|
+
import { E as ElementModel, R as RelationshipModel, g as LikeC4Model } from '../../shared/core.CySf-2gP.mjs';
|
|
3
3
|
import 'type-fest';
|
|
4
|
-
import '../../shared/core.
|
|
4
|
+
import '../../shared/core.DrvfVXkh.mjs';
|
|
5
5
|
import '../../shared/core.DX-WYEPA.mjs';
|
|
6
6
|
import '../../shared/core.CywrQs86.mjs';
|
|
7
|
-
import '../../shared/core.
|
|
7
|
+
import '../../shared/core.Bpou6c2f.mjs';
|
|
8
8
|
import '../../types/expression-model.mjs';
|
|
9
|
-
import '../../shared/core.
|
|
9
|
+
import '../../shared/core.BbThmf6M.mjs';
|
|
10
10
|
import '../../types/fqnRef.mjs';
|
|
11
11
|
import '../../shared/core.CzdwsPmY.mjs';
|
|
12
12
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { ElementColors, RelationshipColors, computeColorValues, defaultTheme } from './theme/index.mjs';
|
|
2
|
-
export { B as BiMap, D as DefaultWeakMap, L as LinkedList, M as MultiMap, Q as Queue, a as ancestorsFqn, i as invariant, b as isAncestor, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, h as nonNullable, g as nonexhaustive, p as parentFqn, s as sortNaturalByFqn, j as sortParentsFirst } from './shared/core.
|
|
2
|
+
export { B as BiMap, D as DefaultWeakMap, L as LinkedList, M as MultiMap, Q as Queue, a as ancestorsFqn, i as invariant, b as isAncestor, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, h as nonNullable, g as nonexhaustive, p as parentFqn, s as sortNaturalByFqn, j as sortParentsFirst } from './shared/core.vWJTxpLV.mjs';
|
|
3
3
|
export { D as DefaultMap } from './shared/core.CywrQs86.mjs';
|
|
4
4
|
export { i as isIterable } from './shared/core.DXhDWKFZ.mjs';
|
|
5
|
-
export { A as Any, A as AnyAux, a as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, e as _stage, f as _type, _ as aux, i as isOnStage } from './shared/core.
|
|
5
|
+
export { A as Any, A as AnyAux, a as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, e as _stage, f as _type, _ as aux, i as isOnStage } from './shared/core.D_fI5Lf6.mjs';
|
|
6
6
|
export { A as AnyFqn, B as BuiltInIcon, D as DeploymentFqn, b as DeploymentKind, j as EdgeId, E as ElementKind, F as Fqn, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, N as NodeId, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, k as StepEdgeId, S as StepEdgeIdLiteral, m as StepEdgeKind, T as Tag, V as ViewId, o as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, n as isStepEdgeId, s as scalar, h as splitGlobalFqn, l as stepEdgeId } from './shared/core.DX-WYEPA.mjs';
|
|
7
|
-
export {
|
|
8
|
-
export { C as Coalesce, E as ExclusiveUnion, I as IterableContainer, c as IteratorLike, K as KeysOf, L as Link, b as NTuple, N as NonEmptyArray, a as NonEmptyReadonlyArray, P as Predicate, R as ReorderedArray } from './shared/core.
|
|
9
|
-
export { A as AndOperator, a as EqualOperator, E as Expression, j as Filterable, F as FqnExpr, K as KindEqual, N as NotOperator, k as OperatorPredicate, O as OrOperator, c as Participant, d as ParticipantOperator, P as PredicateSelector, R as RelationExpr, T as TagEqual, W as WhereOperator, g as isAndOperator, b as isKindEqual, f as isNotOperator, h as isOrOperator, e as isParticipantOperator, i as isTagEqual, w as whereOperatorAsPredicate } from './shared/core.
|
|
7
|
+
export { O as AbstractRelationship, ai as AnyExcludePredicate, ah as AnyIncludePredicate, a4 as AnyView, aj as AnyViewRuleStyle, ao as AutoLayoutDirection, u as AuxFromDump, A as AuxFromLikeC4ModelData, B as BBox, aw as BaseParsedViewProperties, av as BaseViewProperties, aD as ComputedDeploymentView, aE as ComputedDynamicView, aB as ComputedEdge, aC as ComputedElementView, C as ComputedLikeC4ModelData, aA as ComputedNode, a2 as ComputedView, K as DefaultArrowType, w as DefaultElementShape, J as DefaultLineStyle, z as DefaultPaddingSize, N as DefaultRelationshipColor, y as DefaultShapeSize, x as DefaultSize, E as DefaultTextSize, v as DefaultThemeColor, k as DeployedInstance, l as DeploymentElement, m as DeploymentElementRef, D as DeploymentElementStyle, j as DeploymentNode, q as DeploymentRelation, p as DeploymentRelationship, aL as DeploymentViewExcludePredicate, aK as DeploymentViewIncludePredicate, aM as DeploymentViewPredicate, aO as DeploymentViewRule, aN as DeploymentViewRuleStyle, aG as DiagramEdge, aF as DiagramNode, a0 as DiagramView, aW as DynamicViewDisplayVariant, aU as DynamicViewIncludeRule, aR as DynamicViewParallelSteps, aV as DynamicViewRule, aQ as DynamicViewStep, aT as DynamicViewStepOrParallel, I as Element, U as ElementSpecification, F as ElementStyle, a_ as ElementViewExcludePredicate, aZ as ElementViewIncludePredicate, a$ as ElementViewPredicate, b3 as ElementViewRule, b0 as ElementViewRuleGroup, b2 as ElementViewRuleStyle, e as GlobalDynamicPredicates, G as GlobalPredicateId, d as GlobalPredicates, f as GlobalStyleID, g as GlobalStyles, aI as LayoutedDeploymentView, aJ as LayoutedDynamicView, aH as LayoutedElementView, L as LayoutedLikeC4ModelData, a0 as LayoutedView, i as LikeC4ModelData, s as LikeC4ModelDump, _ as LikeC4Project, $ as LikeC4View, M as ModelGlobals, T as ModelRelation, ax as NodeNotation, aP as ParsedDeploymentView, aX as ParsedDynamicView, b4 as ParsedElementView, h as ParsedLikeC4ModelData, $ as ParsedView, P as Point, a3 as ProcessedView, t as ProjectDump, c as RectBox, Q as Relationship, Y as RelationshipSpecification, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty, r as SpecTypesFromDump, Z as Specification, S as SpecificationDump, V as TagSpecification, as as ViewAutoLayout, at as ViewManualLayout, a5 as ViewOnStage, a7 as ViewRule, aq as ViewRuleAutoLayout, am as ViewRuleGlobalPredicateRef, ak as ViewRuleGlobalStyle, a8 as ViewRulePredicate, au as ViewType, az as ViewWithHash, ay as ViewWithNotation, a6 as ViewWithType, X as XYPoint, H as ensureSizes, aS as getParallelStepsPrefix, ap as isAutoLayoutDirection, ab as isComputedView, o as isDeployedInstance, n as isDeploymentNode, af as isDeploymentView, a1 as isDiagramView, ag as isDynamicView, aY as isDynamicViewParallelSteps, ac as isElementView, ae as isExtendsElementView, a1 as isLayoutedView, ad as isScopedElementView, W as isTagColorSpecified, ar as isViewRuleAutoLayout, an as isViewRuleGlobalPredicateRef, al as isViewRuleGlobalStyle, b1 as isViewRuleGroup, a9 as isViewRulePredicate, aa as isViewRuleStyle } from './shared/core.Bpou6c2f.mjs';
|
|
8
|
+
export { C as Coalesce, E as ExclusiveUnion, I as IterableContainer, c as IteratorLike, K as KeysOf, L as Link, b as NTuple, N as NonEmptyArray, a as NonEmptyReadonlyArray, P as Predicate, R as ReorderedArray } from './shared/core.DrvfVXkh.mjs';
|
|
9
|
+
export { A as AndOperator, a as EqualOperator, E as Expression, j as Filterable, F as FqnExpr, K as KindEqual, N as NotOperator, k as OperatorPredicate, O as OrOperator, c as Participant, d as ParticipantOperator, P as PredicateSelector, R as RelationExpr, T as TagEqual, W as WhereOperator, g as isAndOperator, b as isKindEqual, f as isNotOperator, h as isOrOperator, e as isParticipantOperator, i as isTagEqual, w as whereOperatorAsPredicate } from './shared/core.BbThmf6M.mjs';
|
|
10
10
|
export { ModelExpression, ModelFqnExpr, ModelRelationExpr } from './types/expression-model.mjs';
|
|
11
11
|
export { FqnRef } from './types/fqnRef.mjs';
|
|
12
12
|
export { b as BorderStyle, B as BorderStyles, i as Color, C as ColorLiteral, d as CustomColor, e as CustomColorDefinitions, c as ElementShape, E as ElementShapes, k as ElementThemeColorValues, l as ElementThemeColors, H as HexColor, L as LikeC4Theme, f as RelationshipArrowType, R as RelationshipLineType, m as RelationshipThemeColorValues, o as RelationshipThemeColors, a as ShapeSize, S as SpacingSize, T as TextSize, h as ThemeColor, n as ThemeColorValues, g as ThemeColors, j as isThemeColor } from './shared/core.CzdwsPmY.mjs';
|
package/dist/index.mjs
CHANGED
|
@@ -7,10 +7,10 @@ export { i as isIterable } from './shared/core.DoM6aM9N.mjs';
|
|
|
7
7
|
export { m as memoizeProp } from './shared/core.CUw_2J9j.mjs';
|
|
8
8
|
export { _ as aux } from './types/_aux.mjs';
|
|
9
9
|
export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, N as NodeId, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, g as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, e as isStepEdgeId, s as scalar, c as splitGlobalFqn, d as stepEdgeId } from './shared/core.Be1n9a0i.mjs';
|
|
10
|
-
export {
|
|
10
|
+
export { h as DefaultArrowType, a as DefaultElementShape, g as DefaultLineStyle, d as DefaultPaddingSize, i as DefaultRelationshipColor, c as DefaultShapeSize, b as DefaultSize, e as DefaultTextSize, D as DefaultThemeColor, R as RichText, f as ensureSizes } from './shared/core.DHQ32OHa.mjs';
|
|
11
11
|
export { _ as _stage, a as _type, h as isAndOperator, c as isDeployedInstance, b as isDeploymentNode, e as isKindEqual, g as isNotOperator, i as isOnStage, j as isOrOperator, f as isParticipantOperator, d as isTagEqual, w as whereOperatorAsPredicate } from './shared/core.yHe79zEl.mjs';
|
|
12
12
|
export { Expression, FqnExpr, RelationExpr } from './types/expression.mjs';
|
|
13
13
|
export { ModelExpression, ModelFqnExpr, ModelRelationExpr } from './types/expression-model.mjs';
|
|
14
14
|
export { FqnRef } from './types/fqnRef.mjs';
|
|
15
|
-
export { B as BBox, a as BorderStyles, E as ElementShapes, R as RectBox, T as ThemeColors, i as isTagColorSpecified, b as isThemeColor } from './shared/core.
|
|
15
|
+
export { B as BBox, a as BorderStyles, E as ElementShapes, R as RectBox, T as ThemeColors, i as isTagColorSpecified, b as isThemeColor } from './shared/core.6_Vp2iiN.mjs';
|
|
16
16
|
export { n as getParallelStepsPrefix, l as isAutoLayoutDirection, b as isComputedView, g as isDeploymentView, c as isDiagramView, h as isDynamicView, o as isDynamicViewParallelSteps, d as isElementView, f as isExtendsElementView, c as isLayoutedView, e as isScopedElementView, m as isViewRuleAutoLayout, k as isViewRuleGlobalPredicateRef, j as isViewRuleGlobalStyle, p as isViewRuleGroup, i as isViewRulePredicate, a as isViewRuleStyle } from './shared/core.T-eLZTW_.mjs';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { C as Connection } from '../../../shared/core.
|
|
2
|
-
export { D as DeploymentConnectionModel, a as findConnection, b as findConnectionsBetween, c as findConnectionsWithin } from '../../../shared/core.
|
|
3
|
-
import '../../../shared/core.
|
|
4
|
-
import '../../../shared/core.
|
|
1
|
+
export { C as Connection } from '../../../shared/core.D704WZES.mjs';
|
|
2
|
+
export { D as DeploymentConnectionModel, a as findConnection, b as findConnectionsBetween, c as findConnectionsWithin } from '../../../shared/core.DrVOJuxX.mjs';
|
|
3
|
+
import '../../../shared/core.CySf-2gP.mjs';
|
|
4
|
+
import '../../../shared/core.D_fI5Lf6.mjs';
|
|
5
5
|
import 'type-fest';
|
|
6
|
-
import '../../../shared/core.
|
|
6
|
+
import '../../../shared/core.DrvfVXkh.mjs';
|
|
7
7
|
import '../../../shared/core.DX-WYEPA.mjs';
|
|
8
8
|
import '../../../shared/core.CywrQs86.mjs';
|
|
9
|
-
import '../../../shared/core.
|
|
9
|
+
import '../../../shared/core.Bpou6c2f.mjs';
|
|
10
10
|
import '../../../types/expression-model.mjs';
|
|
11
|
-
import '../../../shared/core.
|
|
11
|
+
import '../../../shared/core.BbThmf6M.mjs';
|
|
12
12
|
import '../../../types/fqnRef.mjs';
|
|
13
13
|
import '../../../shared/core.CzdwsPmY.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { C as Connection } from '../../../shared/core.BVNaR17u.mjs';
|
|
2
|
-
export { D as DeploymentConnectionModel, f as findConnection, a as findConnectionsBetween, b as findConnectionsWithin } from '../../../shared/core.
|
|
2
|
+
export { D as DeploymentConnectionModel, f as findConnection, a as findConnectionsBetween, b as findConnectionsWithin } from '../../../shared/core.BIAlzwKc.mjs';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { C as Connection } from '../../shared/core.
|
|
2
|
-
export { D as DeploymentConnectionModel, f as deployment } from '../../shared/core.
|
|
3
|
-
export { C as ConnectionModel, f as model } from '../../shared/core.
|
|
4
|
-
import { I as IterableContainer, R as ReorderedArray } from '../../shared/core.
|
|
5
|
-
import '../../shared/core.
|
|
6
|
-
import '../../shared/core.
|
|
1
|
+
import { C as Connection } from '../../shared/core.D704WZES.mjs';
|
|
2
|
+
export { D as DeploymentConnectionModel, f as deployment } from '../../shared/core.DrVOJuxX.mjs';
|
|
3
|
+
export { C as ConnectionModel, f as model } from '../../shared/core.kxeJe0OY.mjs';
|
|
4
|
+
import { I as IterableContainer, R as ReorderedArray } from '../../shared/core.DrvfVXkh.mjs';
|
|
5
|
+
import '../../shared/core.CySf-2gP.mjs';
|
|
6
|
+
import '../../shared/core.D_fI5Lf6.mjs';
|
|
7
7
|
import 'type-fest';
|
|
8
8
|
import '../../shared/core.DX-WYEPA.mjs';
|
|
9
9
|
import '../../shared/core.CywrQs86.mjs';
|
|
10
|
-
import '../../shared/core.
|
|
10
|
+
import '../../shared/core.Bpou6c2f.mjs';
|
|
11
11
|
import '../../types/expression-model.mjs';
|
|
12
|
-
import '../../shared/core.
|
|
12
|
+
import '../../shared/core.BbThmf6M.mjs';
|
|
13
13
|
import '../../types/fqnRef.mjs';
|
|
14
14
|
import '../../shared/core.CzdwsPmY.mjs';
|
|
15
15
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { C as Connection } from '../../shared/core.BVNaR17u.mjs';
|
|
2
|
-
export { D as DeploymentConnectionModel, d as deployment } from '../../shared/core.
|
|
2
|
+
export { D as DeploymentConnectionModel, d as deployment } from '../../shared/core.BIAlzwKc.mjs';
|
|
3
3
|
export { C as ConnectionModel, d as differenceConnections, c as findAscendingConnections, e as findDeepestNestedConnection, g as findDescendantConnections, h as hasSameSource, i as hasSameSourceTarget, j as hasSameTarget, k as isAnyInOut, l as isIncoming, m as isNestedConnection, n as isOutgoing, o as mergeConnections, q as model, s as sortConnectionsByBoundaryHierarchy, p as sortDeepestFirst } from '../../shared/core.D0EgVMQK.mjs';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { C as Connection } from '../../../shared/core.
|
|
2
|
-
export { C as ConnectionModel, a as findConnection, b as findConnectionsBetween, c as findConnectionsWithin } from '../../../shared/core.
|
|
3
|
-
import '../../../shared/core.
|
|
4
|
-
import '../../../shared/core.
|
|
1
|
+
export { C as Connection } from '../../../shared/core.D704WZES.mjs';
|
|
2
|
+
export { C as ConnectionModel, a as findConnection, b as findConnectionsBetween, c as findConnectionsWithin } from '../../../shared/core.kxeJe0OY.mjs';
|
|
3
|
+
import '../../../shared/core.CySf-2gP.mjs';
|
|
4
|
+
import '../../../shared/core.D_fI5Lf6.mjs';
|
|
5
5
|
import 'type-fest';
|
|
6
|
-
import '../../../shared/core.
|
|
6
|
+
import '../../../shared/core.DrvfVXkh.mjs';
|
|
7
7
|
import '../../../shared/core.DX-WYEPA.mjs';
|
|
8
8
|
import '../../../shared/core.CywrQs86.mjs';
|
|
9
|
-
import '../../../shared/core.
|
|
9
|
+
import '../../../shared/core.Bpou6c2f.mjs';
|
|
10
10
|
import '../../../types/expression-model.mjs';
|
|
11
|
-
import '../../../shared/core.
|
|
11
|
+
import '../../../shared/core.BbThmf6M.mjs';
|
|
12
12
|
import '../../../types/fqnRef.mjs';
|
|
13
13
|
import '../../../shared/core.CzdwsPmY.mjs';
|
package/dist/model/index.d.mts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { D as DeploymentNodeModel, a as DeployedInstanceModel, b as DeploymentRelationModel, A as AnyRelationshipModel, N as NestedElementOfDeployedInstanceModel, E as ElementModel, R as RelationshipModel, L as LikeC4ViewModel, c as NodeModel, d as EdgeModel, e as DeploymentElementModel } from '../shared/core.
|
|
2
|
-
export { f as AnyLikeC4Model, l as DeploymentOrFqn, h as DeploymentRelationEndpoint, m as EdgeOrId, n as ElementOrFqn, I as IncomingFilter, j as LikeC4DeploymentModel, g as LikeC4Model, k as LikeC4ViewsFolder, o as NodeOrId, O as OutgoingFilter, i as RelationshipsAccum, W as WithMetadata, p as WithTags } from '../shared/core.
|
|
3
|
-
import { A as Any } from '../shared/core.
|
|
4
|
-
export { a as Aux, S as SpecAux, _ as aux } from '../shared/core.
|
|
5
|
-
export { C as Connection } from '../shared/core.
|
|
6
|
-
export { C as ConnectionModel, f as modelConnection } from '../shared/core.
|
|
7
|
-
export { D as DeploymentConnectionModel, f as deploymentConnection } from '../shared/core.
|
|
1
|
+
import { D as DeploymentNodeModel, a as DeployedInstanceModel, b as DeploymentRelationModel, A as AnyRelationshipModel, N as NestedElementOfDeployedInstanceModel, E as ElementModel, R as RelationshipModel, L as LikeC4ViewModel, c as NodeModel, d as EdgeModel, e as DeploymentElementModel } from '../shared/core.CySf-2gP.mjs';
|
|
2
|
+
export { f as AnyLikeC4Model, l as DeploymentOrFqn, h as DeploymentRelationEndpoint, m as EdgeOrId, n as ElementOrFqn, I as IncomingFilter, j as LikeC4DeploymentModel, g as LikeC4Model, k as LikeC4ViewsFolder, o as NodeOrId, O as OutgoingFilter, i as RelationshipsAccum, W as WithMetadata, p as WithTags } from '../shared/core.CySf-2gP.mjs';
|
|
3
|
+
import { A as Any } from '../shared/core.D_fI5Lf6.mjs';
|
|
4
|
+
export { a as Aux, S as SpecAux, _ as aux } from '../shared/core.D_fI5Lf6.mjs';
|
|
5
|
+
export { C as Connection } from '../shared/core.D704WZES.mjs';
|
|
6
|
+
export { C as ConnectionModel, f as modelConnection } from '../shared/core.kxeJe0OY.mjs';
|
|
7
|
+
export { D as DeploymentConnectionModel, f as deploymentConnection } from '../shared/core.DrVOJuxX.mjs';
|
|
8
8
|
export { differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isIncoming, isNestedConnection, isOutgoing, mergeConnections, sortConnectionsByBoundaryHierarchy, sortDeepestFirst } from './connection/index.mjs';
|
|
9
|
-
export { u as AuxFromDump, A as AuxFromLikeC4ModelData, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty } from '../shared/core.
|
|
9
|
+
export { u as AuxFromDump, A as AuxFromLikeC4ModelData, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty } from '../shared/core.Bpou6c2f.mjs';
|
|
10
10
|
import '../shared/core.DX-WYEPA.mjs';
|
|
11
11
|
import 'type-fest';
|
|
12
12
|
import '../shared/core.CywrQs86.mjs';
|
|
13
|
-
import '../shared/core.
|
|
13
|
+
import '../shared/core.DrvfVXkh.mjs';
|
|
14
14
|
import '../shared/core.CzdwsPmY.mjs';
|
|
15
|
-
import '../shared/core.
|
|
15
|
+
import '../shared/core.BbThmf6M.mjs';
|
|
16
16
|
import '../types/fqnRef.mjs';
|
|
17
17
|
import '../types/expression-model.mjs';
|
|
18
18
|
|
package/dist/model/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { b as EdgeModel, E as ElementModel, a as LikeC4DeploymentModel, L as LikeC4Model, c as LikeC4ViewModel, d as LikeC4ViewsFolder, N as NodeModel, R as RelationshipModel, V as VIEW_FOLDERS_SEPARATOR, e as extractViewTitleFromPath, g as getViewFolderPath, f as isDeployedInstanceModel, h as isDeploymentElementModel, i as isDeploymentNodeModel, k as isDeploymentRelationModel, q as isEdgeModel, m as isElementModel, o as isLikeC4ViewModel, l as isModelRelation, j as isNestedElementOfDeployedInstanceModel, p as isNodeModel, l as isRelationModel, l as isRelationshipModel, n as normalizeViewPath } from '../shared/core.
|
|
2
|
-
export { c as DeployedInstanceModel, D as DeploymentConnectionModel, e as DeploymentNodeModel, g as DeploymentRelationModel, R as RelationshipsAccum, d as deploymentConnection } from '../shared/core.
|
|
1
|
+
export { b as EdgeModel, E as ElementModel, a as LikeC4DeploymentModel, L as LikeC4Model, c as LikeC4ViewModel, d as LikeC4ViewsFolder, N as NodeModel, R as RelationshipModel, V as VIEW_FOLDERS_SEPARATOR, e as extractViewTitleFromPath, g as getViewFolderPath, f as isDeployedInstanceModel, h as isDeploymentElementModel, i as isDeploymentNodeModel, k as isDeploymentRelationModel, q as isEdgeModel, m as isElementModel, o as isLikeC4ViewModel, l as isModelRelation, j as isNestedElementOfDeployedInstanceModel, p as isNodeModel, l as isRelationModel, l as isRelationshipModel, n as normalizeViewPath } from '../shared/core.FPITT8Vx.mjs';
|
|
2
|
+
export { c as DeployedInstanceModel, D as DeploymentConnectionModel, e as DeploymentNodeModel, g as DeploymentRelationModel, R as RelationshipsAccum, d as deploymentConnection } from '../shared/core.BIAlzwKc.mjs';
|
|
3
3
|
export { C as Connection } from '../shared/core.BVNaR17u.mjs';
|
|
4
4
|
export { C as ConnectionModel, d as differenceConnections, c as findAscendingConnections, e as findDeepestNestedConnection, g as findDescendantConnections, h as hasSameSource, i as hasSameSourceTarget, j as hasSameTarget, k as isAnyInOut, l as isIncoming, m as isNestedConnection, n as isOutgoing, o as mergeConnections, q as modelConnection, s as sortConnectionsByBoundaryHierarchy, p as sortDeepestFirst } from '../shared/core.D0EgVMQK.mjs';
|
|
5
|
-
export { R as RichText } from '../shared/core.
|
|
5
|
+
export { R as RichText } from '../shared/core.DHQ32OHa.mjs';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasAtLeast } from 'remeda';
|
|
1
2
|
import { i as invariant } from './core.D4npX2q8.mjs';
|
|
2
3
|
|
|
3
4
|
var BBox;
|
|
@@ -20,7 +21,10 @@ var BBox;
|
|
|
20
21
|
}
|
|
21
22
|
BBox2.fromPoints = fromPoints;
|
|
22
23
|
function merge(...boxes) {
|
|
23
|
-
invariant(boxes
|
|
24
|
+
invariant(hasAtLeast(boxes, 1), "No boxes provided");
|
|
25
|
+
if (boxes.length === 1) {
|
|
26
|
+
return boxes[0];
|
|
27
|
+
}
|
|
24
28
|
let minX = Infinity;
|
|
25
29
|
let minY = Infinity;
|
|
26
30
|
let maxX = -Infinity;
|
|
@@ -48,6 +52,30 @@ var BBox;
|
|
|
48
52
|
};
|
|
49
53
|
}
|
|
50
54
|
BBox2.toRectBox = toRectBox;
|
|
55
|
+
function expand(box, plus) {
|
|
56
|
+
if (plus === 0) {
|
|
57
|
+
return box;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
x: box.x - plus,
|
|
61
|
+
y: box.y - plus,
|
|
62
|
+
width: box.width + plus * 2,
|
|
63
|
+
height: box.height + plus * 2
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
BBox2.expand = expand;
|
|
67
|
+
function shrink(box, minus) {
|
|
68
|
+
if (minus === 0) {
|
|
69
|
+
return box;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
x: box.x + minus,
|
|
73
|
+
y: box.y + minus,
|
|
74
|
+
width: box.width - minus * 2,
|
|
75
|
+
height: box.height - minus * 2
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
BBox2.shrink = shrink;
|
|
51
79
|
})(BBox || (BBox = {}));
|
|
52
80
|
var RectBox;
|
|
53
81
|
((RectBox2) => {
|
|
@@ -4,7 +4,7 @@ import { unique, only, isTruthy, isEmpty } from 'remeda';
|
|
|
4
4
|
import { o as hierarchyLevel, g as commonAncestor, n as nameFromFqn, d as isSameHierarchy } from './core.DgttqsJc.mjs';
|
|
5
5
|
import { a as nonNullable, i as invariant } from './core.D4npX2q8.mjs';
|
|
6
6
|
import { m as memoizeProp } from './core.CUw_2J9j.mjs';
|
|
7
|
-
import {
|
|
7
|
+
import { c as DefaultShapeSize, R as RichText, D as DefaultThemeColor, g as DefaultLineStyle, a as DefaultElementShape } from './core.DHQ32OHa.mjs';
|
|
8
8
|
|
|
9
9
|
class AbstractDeploymentElementModel {
|
|
10
10
|
get style() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Any, T as Tag, k as AllKinds, l as Tags, g as StrictViewId, h as ElementKind } from './core.
|
|
2
|
-
import { N as NonEmptyArray, E as ExclusiveUnion } from './core.
|
|
1
|
+
import { A as Any, T as Tag, k as AllKinds, l as Tags, g as StrictViewId, h as ElementKind } from './core.D_fI5Lf6.mjs';
|
|
2
|
+
import { N as NonEmptyArray, E as ExclusiveUnion } from './core.DrvfVXkh.mjs';
|
|
3
3
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
4
4
|
import { M as MarkdownOrString, I as Icon } from './core.DX-WYEPA.mjs';
|
|
5
5
|
import { i as Color, R as RelationshipLineType, f as RelationshipArrowType, c as ElementShape, b as BorderStyle, a as ShapeSize } from './core.CzdwsPmY.mjs';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Simplify, MergeExclusive, Tagged, NonEmptyTuple, IsNever, IsAny } from 'type-fest';
|
|
2
|
-
import { A as Any, W as WithOptionalTags, z as WithOptionalLinks, g as StrictViewId, e as _stage, f as _type, F as Fqn, B as WithMetadata, h as ElementKind, l as Tags, m as Metadata, R as RelationKind, V as ViewId, U as Unknown, s as DeploymentFqn, o as DeploymentKind, T as Tag, n as MetadataKey, E as ExtractOnStage, M as ModelStage, P as ProjectId$1, j as ElementId, D as DeploymentId, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted, S as SpecAux, a as Aux, N as Never } from './core.
|
|
3
|
-
import { N as NonEmptyArray, E as ExclusiveUnion, L as Link, K as KeysOf } from './core.
|
|
2
|
+
import { A as Any, W as WithOptionalTags, z as WithOptionalLinks, g as StrictViewId, e as _stage, f as _type, F as Fqn, B as WithMetadata, h as ElementKind, l as Tags, m as Metadata, R as RelationKind, V as ViewId, U as Unknown, s as DeploymentFqn, o as DeploymentKind, T as Tag, n as MetadataKey, E as ExtractOnStage, M as ModelStage, P as ProjectId$1, j as ElementId, D as DeploymentId, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted, S as SpecAux, a as Aux, N as Never } from './core.D_fI5Lf6.mjs';
|
|
3
|
+
import { N as NonEmptyArray, E as ExclusiveUnion, L as Link, K as KeysOf } from './core.DrvfVXkh.mjs';
|
|
4
4
|
import { ModelExpression, ModelFqnExpr } from '../types/expression-model.mjs';
|
|
5
5
|
import { I as Icon, M as MarkdownOrString, d as RelationId, T as Tag$1, P as ProjectId, N as NodeId, j as EdgeId, m as StepEdgeKind } from './core.DX-WYEPA.mjs';
|
|
6
6
|
import { b as BorderStyle, a as ShapeSize, S as SpacingSize, T as TextSize, i as Color, c as ElementShape, R as RelationshipLineType, f as RelationshipArrowType, h as ThemeColor, C as ColorLiteral, e as CustomColorDefinitions } from './core.CzdwsPmY.mjs';
|
|
7
7
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
8
|
-
import { E as Expression, F as FqnExpr } from './core.
|
|
8
|
+
import { E as Expression, F as FqnExpr } from './core.BbThmf6M.mjs';
|
|
9
9
|
|
|
10
10
|
type Point = readonly [x: number, y: number];
|
|
11
11
|
interface XYPoint {
|
|
@@ -23,6 +23,8 @@ declare namespace BBox {
|
|
|
23
23
|
function fromPoints(points: Point[]): BBox;
|
|
24
24
|
function merge(...boxes: BBox[]): BBox;
|
|
25
25
|
function toRectBox(box: BBox): RectBox;
|
|
26
|
+
function expand(box: BBox, plus: number): BBox;
|
|
27
|
+
function shrink(box: BBox, minus: number): BBox;
|
|
26
28
|
}
|
|
27
29
|
interface RectBox {
|
|
28
30
|
x1: number;
|
|
@@ -220,8 +222,17 @@ type DynamicViewRule<A extends Any = Any> = ExclusiveUnion<{
|
|
|
220
222
|
GlobalStyle: ViewRuleGlobalStyle;
|
|
221
223
|
AutoLayout: ViewRuleAutoLayout;
|
|
222
224
|
}>;
|
|
225
|
+
type DynamicViewDisplayVariant = 'diagram' | 'sequence';
|
|
223
226
|
interface ParsedDynamicView<A extends Any = Any> extends BaseParsedViewProperties<A> {
|
|
224
227
|
[_type]: 'dynamic';
|
|
228
|
+
/**
|
|
229
|
+
* How to display the dynamic view
|
|
230
|
+
* - `diagram`: display as a regular likec4 view
|
|
231
|
+
* - `sequence`: display as a sequence diagram
|
|
232
|
+
*
|
|
233
|
+
* @default 'diagram'
|
|
234
|
+
*/
|
|
235
|
+
readonly variant?: DynamicViewDisplayVariant;
|
|
225
236
|
readonly steps: DynamicViewStepOrParallel<A>[];
|
|
226
237
|
readonly rules: DynamicViewRule<A>[];
|
|
227
238
|
}
|
|
@@ -240,6 +251,7 @@ interface ModelGlobals<A extends Any = Any> {
|
|
|
240
251
|
|
|
241
252
|
declare const DefaultThemeColor: ThemeColor;
|
|
242
253
|
declare const DefaultElementShape: ElementShape;
|
|
254
|
+
declare const DefaultSize = "md";
|
|
243
255
|
declare const DefaultShapeSize: ShapeSize;
|
|
244
256
|
declare const DefaultPaddingSize: SpacingSize;
|
|
245
257
|
declare const DefaultTextSize: TextSize;
|
|
@@ -265,6 +277,11 @@ interface ElementStyle {
|
|
|
265
277
|
readonly padding?: SpacingSize;
|
|
266
278
|
readonly textSize?: TextSize;
|
|
267
279
|
}
|
|
280
|
+
type WithSizes = Pick<ElementStyle, 'size' | 'padding' | 'textSize'>;
|
|
281
|
+
/**
|
|
282
|
+
* Ensures that the sizes are set to default values if they are not set
|
|
283
|
+
*/
|
|
284
|
+
declare function ensureSizes<S extends WithSizes>({ size, padding, textSize, ...rest }: S): Omit<S, 'size' | 'padding' | 'textSize'> & Required<WithSizes>;
|
|
268
285
|
interface Element<A extends Any = Any> extends WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A> {
|
|
269
286
|
readonly id: Fqn<A>;
|
|
270
287
|
readonly kind: ElementKind<A>;
|
|
@@ -514,6 +531,12 @@ interface ComputedDeploymentView<A extends Any = Any> extends BaseComputedViewPr
|
|
|
514
531
|
}
|
|
515
532
|
interface ComputedDynamicView<A extends Any = Any> extends BaseComputedViewProperties<A> {
|
|
516
533
|
readonly [_type]: 'dynamic';
|
|
534
|
+
/**
|
|
535
|
+
* How to display the dynamic view
|
|
536
|
+
* - `diagram`: display as a regular likec4 view
|
|
537
|
+
* - `sequence`: display as a sequence diagram
|
|
538
|
+
*/
|
|
539
|
+
readonly variant: DynamicViewDisplayVariant;
|
|
517
540
|
}
|
|
518
541
|
|
|
519
542
|
interface DiagramNode<A extends Any = Any> extends ComputedNode<A>, BBox {
|
|
@@ -578,6 +601,12 @@ interface LayoutedDeploymentView<A extends Any = Any> extends BaseLayoutedViewPr
|
|
|
578
601
|
}
|
|
579
602
|
interface LayoutedDynamicView<A extends Any = Any> extends BaseLayoutedViewProperties<A> {
|
|
580
603
|
readonly [_type]: 'dynamic';
|
|
604
|
+
/**
|
|
605
|
+
* How to display the dynamic view
|
|
606
|
+
* - `diagram`: display as a regular likec4 view
|
|
607
|
+
* - `sequence`: display as a sequence diagram
|
|
608
|
+
*/
|
|
609
|
+
readonly variant: DynamicViewDisplayVariant;
|
|
581
610
|
}
|
|
582
611
|
|
|
583
612
|
/**
|
|
@@ -818,4 +847,4 @@ declare class RichText {
|
|
|
818
847
|
equals(other: unknown): boolean;
|
|
819
848
|
}
|
|
820
849
|
|
|
821
|
-
export {
|
|
850
|
+
export { type ParsedView as $, type AuxFromLikeC4ModelData as A, BBox as B, type ComputedLikeC4ModelData as C, type DeploymentElementStyle as D, DefaultTextSize as E, type ElementStyle as F, type GlobalPredicateId as G, ensureSizes as H, type Element as I, DefaultLineStyle as J, DefaultArrowType as K, type LayoutedLikeC4ModelData as L, type ModelGlobals as M, DefaultRelationshipColor as N, type AbstractRelationship as O, type Point as P, type Relationship as Q, RichText as R, type SpecificationDump as S, type ModelRelation as T, type ElementSpecification as U, type TagSpecification as V, isTagColorSpecified as W, type XYPoint as X, type RelationshipSpecification as Y, type Specification as Z, type LikeC4Project as _, type RichTextEmpty as a, type ElementViewPredicate as a$, type LayoutedView as a0, isDiagramView as a1, type ComputedView as a2, type ProcessedView as a3, type AnyView as a4, type ViewOnStage as a5, type ViewWithType as a6, type ViewRule as a7, type ViewRulePredicate as a8, isViewRulePredicate as a9, type ComputedNode as aA, type ComputedEdge as aB, type ComputedElementView as aC, type ComputedDeploymentView as aD, type ComputedDynamicView as aE, type DiagramNode as aF, type DiagramEdge as aG, type LayoutedElementView as aH, type LayoutedDeploymentView as aI, type LayoutedDynamicView as aJ, type DeploymentViewIncludePredicate as aK, type DeploymentViewExcludePredicate as aL, type DeploymentViewPredicate as aM, type DeploymentViewRuleStyle as aN, type DeploymentViewRule as aO, type ParsedDeploymentView as aP, type DynamicViewStep as aQ, type DynamicViewParallelSteps as aR, getParallelStepsPrefix as aS, type DynamicViewStepOrParallel as aT, type DynamicViewIncludeRule as aU, type DynamicViewRule as aV, type DynamicViewDisplayVariant as aW, type ParsedDynamicView as aX, isDynamicViewParallelSteps as aY, type ElementViewIncludePredicate as aZ, type ElementViewExcludePredicate as a_, isViewRuleStyle as aa, isComputedView as ab, isElementView as ac, isScopedElementView as ad, isExtendsElementView as ae, isDeploymentView as af, isDynamicView as ag, type AnyIncludePredicate as ah, type AnyExcludePredicate as ai, type AnyViewRuleStyle as aj, type ViewRuleGlobalStyle as ak, isViewRuleGlobalStyle as al, type ViewRuleGlobalPredicateRef as am, isViewRuleGlobalPredicateRef as an, type AutoLayoutDirection as ao, isAutoLayoutDirection as ap, type ViewRuleAutoLayout as aq, isViewRuleAutoLayout as ar, type ViewAutoLayout as as, type ViewManualLayout as at, type ViewType as au, type BaseViewProperties as av, type BaseParsedViewProperties as aw, type NodeNotation as ax, type ViewWithNotation as ay, type ViewWithHash as az, type RichTextOrEmpty as b, type ElementViewRuleGroup as b0, isViewRuleGroup as b1, type ElementViewRuleStyle as b2, type ElementViewRule as b3, type ParsedElementView as b4, RectBox as c, type GlobalPredicates as d, type GlobalDynamicPredicates as e, type GlobalStyleID as f, type GlobalStyles as g, type ParsedLikeC4ModelData as h, type LikeC4ModelData as i, type DeploymentNode as j, type DeployedInstance as k, type DeploymentElement as l, type DeploymentElementRef as m, isDeploymentNode as n, isDeployedInstance as o, type DeploymentRelationship as p, type DeploymentRelation as q, type SpecTypesFromDump as r, type LikeC4ModelDump as s, type ProjectDump as t, type AuxFromDump as u, DefaultThemeColor as v, DefaultElementShape as w, DefaultSize as x, DefaultShapeSize as y, DefaultPaddingSize as z };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as Any, R as RelationKind, l as Tags, m as Metadata, n as MetadataKey, L as LooseTag, F as Fqn, j as ElementId, h as ElementKind, o as DeploymentKind, E as ExtractOnStage, p as RelationId$1, g as StrictViewId, f as _type, q as LooseElementId, r as LooseDeploymentId, s as DeploymentFqn, t as toComputed, u as toLayouted, v as Stage, D as DeploymentId, U as Unknown, V as ViewId, T as Tag, w as toParsed, P as ProjectId$1, x as LooseViewId, a as Aux, S as SpecAux, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted } from './core.
|
|
1
|
+
import { A as Any, R as RelationKind, l as Tags, m as Metadata, n as MetadataKey, L as LooseTag, F as Fqn, j as ElementId, h as ElementKind, o as DeploymentKind, E as ExtractOnStage, p as RelationId$1, g as StrictViewId, f as _type, q as LooseElementId, r as LooseDeploymentId, s as DeploymentFqn, t as toComputed, u as toLayouted, v as Stage, D as DeploymentId, U as Unknown, V as ViewId, T as Tag, w as toParsed, P as ProjectId$1, x as LooseViewId, a as Aux, S as SpecAux, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted } from './core.D_fI5Lf6.mjs';
|
|
2
2
|
import { d as RelationId, P as ProjectId, a as IconUrl, N as NodeId, G as GroupElementKind, j as EdgeId, k as StepEdgeId, V as ViewId$1 } from './core.DX-WYEPA.mjs';
|
|
3
3
|
import { D as DefaultMap } from './core.CywrQs86.mjs';
|
|
4
4
|
import { SetRequired } from 'type-fest';
|
|
5
|
-
import { b as RichTextOrEmpty,
|
|
6
|
-
import { c as IteratorLike, L as Link, N as NonEmptyArray } from './core.
|
|
5
|
+
import { b as RichTextOrEmpty, Q as Relationship, I as Element, F as ElementStyle, aW as DynamicViewDisplayVariant, a6 as ViewWithType, a2 as ComputedView, a0 as LayoutedView, h as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, L as LayoutedLikeC4ModelData, k as DeployedInstance, D as DeploymentElementStyle, p as DeploymentRelationship, l as DeploymentElement, j as DeploymentNode, s as LikeC4ModelDump, u as AuxFromDump, _ as LikeC4Project, Z as Specification, M as ModelGlobals } from './core.Bpou6c2f.mjs';
|
|
6
|
+
import { c as IteratorLike, L as Link, N as NonEmptyArray } from './core.DrvfVXkh.mjs';
|
|
7
7
|
import { i as Color, R as RelationshipLineType, c as ElementShape } from './core.CzdwsPmY.mjs';
|
|
8
|
-
import { W as WhereOperator } from './core.
|
|
8
|
+
import { W as WhereOperator } from './core.BbThmf6M.mjs';
|
|
9
9
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
10
10
|
|
|
11
11
|
type RelationshipsIterator<A extends Any> = IteratorLike<RelationshipModel<A>>;
|
|
@@ -395,6 +395,11 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
|
|
|
395
395
|
get tags(): Tags<A>;
|
|
396
396
|
get links(): ReadonlyArray<Link>;
|
|
397
397
|
get viewOf(): ElementModel<A> | null;
|
|
398
|
+
/**
|
|
399
|
+
* Available for dynamic views only
|
|
400
|
+
* throws error if view is not dynamic
|
|
401
|
+
*/
|
|
402
|
+
get mode(): DynamicViewDisplayVariant;
|
|
398
403
|
/**
|
|
399
404
|
* All tags from nodes and edges.
|
|
400
405
|
*/
|
|
@@ -421,11 +426,18 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
|
|
|
421
426
|
*/
|
|
422
427
|
nodes(): NodesIterator<A, V>;
|
|
423
428
|
/**
|
|
424
|
-
*
|
|
429
|
+
* Get edge by id, throws error if edge is not found.
|
|
430
|
+
* Use {@link findEdge} if you are not sure if the edge exists.
|
|
431
|
+
*
|
|
425
432
|
* @param edge Edge or id
|
|
426
|
-
* @returns EdgeModel
|
|
433
|
+
* @returns {@link EdgeModel}
|
|
427
434
|
*/
|
|
428
435
|
edge(edge: EdgeOrId): EdgeModel<A, V>;
|
|
436
|
+
/**
|
|
437
|
+
* Find edge by id.
|
|
438
|
+
* @param edge Edge or id
|
|
439
|
+
* @returns {@link EdgeModel} or null if edge is not found
|
|
440
|
+
*/
|
|
429
441
|
findEdge(edge: EdgeOrId): EdgeModel<A, V> | null;
|
|
430
442
|
/**
|
|
431
443
|
* Iterate over all edges.
|
|
@@ -472,8 +484,7 @@ declare namespace LikeC4ViewModel {
|
|
|
472
484
|
}
|
|
473
485
|
interface DeploymentView<A extends Any, V extends $View<A> = $View<A>> extends LikeC4ViewModel<A, ViewWithType<V, 'deployment'>> {
|
|
474
486
|
}
|
|
475
|
-
|
|
476
|
-
}
|
|
487
|
+
type DynamicView<A extends Any, V extends $View<A> = $View<A>> = LikeC4ViewModel<A, ViewWithType<V, 'dynamic'>>;
|
|
477
488
|
}
|
|
478
489
|
|
|
479
490
|
type IncomingFilter = 'all' | 'direct' | 'to-descendants';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ElementModel, e as DeploymentElementModel } from './core.
|
|
2
|
-
import { A as Any } from './core.
|
|
1
|
+
import { E as ElementModel, e as DeploymentElementModel } from './core.CySf-2gP.mjs';
|
|
2
|
+
import { A as Any } from './core.D_fI5Lf6.mjs';
|
|
3
3
|
import { F as Fqn } from './core.DX-WYEPA.mjs';
|
|
4
4
|
|
|
5
5
|
interface Connection<Elem = ElementModel<Any> | DeploymentElementModel<Any>, Id = string> {
|
|
@@ -3,9 +3,26 @@ import { n as nonexhaustive } from './core.D4npX2q8.mjs';
|
|
|
3
3
|
|
|
4
4
|
const DefaultThemeColor = "primary";
|
|
5
5
|
const DefaultElementShape = "rectangle";
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
6
|
+
const DefaultSize = "md";
|
|
7
|
+
const DefaultShapeSize = DefaultSize;
|
|
8
|
+
const DefaultPaddingSize = DefaultSize;
|
|
9
|
+
const DefaultTextSize = DefaultSize;
|
|
10
|
+
function ensureSizes({
|
|
11
|
+
size,
|
|
12
|
+
padding,
|
|
13
|
+
textSize,
|
|
14
|
+
...rest
|
|
15
|
+
}) {
|
|
16
|
+
size ??= DefaultSize;
|
|
17
|
+
textSize ??= size;
|
|
18
|
+
padding ??= size;
|
|
19
|
+
return {
|
|
20
|
+
...rest,
|
|
21
|
+
size,
|
|
22
|
+
padding,
|
|
23
|
+
textSize
|
|
24
|
+
};
|
|
25
|
+
}
|
|
9
26
|
const DefaultLineStyle = "dashed";
|
|
10
27
|
const DefaultArrowType = "normal";
|
|
11
28
|
const DefaultRelationshipColor = "gray";
|
|
@@ -39,7 +56,10 @@ class RichText {
|
|
|
39
56
|
return source;
|
|
40
57
|
}
|
|
41
58
|
if (typeof source === "string") {
|
|
42
|
-
|
|
59
|
+
if (source.trim() === emptyTxt) {
|
|
60
|
+
return RichText.EMPTY;
|
|
61
|
+
}
|
|
62
|
+
return new RichText({ txt: source });
|
|
43
63
|
}
|
|
44
64
|
if ("isEmpty" in source && source.isEmpty) {
|
|
45
65
|
return RichText.EMPTY;
|
|
@@ -166,4 +186,4 @@ class RichText {
|
|
|
166
186
|
}
|
|
167
187
|
}
|
|
168
188
|
|
|
169
|
-
export { DefaultThemeColor as D, RichText as R, DefaultElementShape as a,
|
|
189
|
+
export { DefaultThemeColor as D, RichText as R, DefaultElementShape as a, DefaultSize as b, DefaultShapeSize as c, DefaultPaddingSize as d, DefaultTextSize as e, ensureSizes as f, DefaultLineStyle as g, DefaultArrowType as h, DefaultRelationshipColor as i };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IfNever, IsNever, IsLiteral } from 'type-fest';
|
|
2
|
-
import { C as Coalesce, L as Link } from './core.
|
|
2
|
+
import { C as Coalesce, L as Link } from './core.DrvfVXkh.mjs';
|
|
3
3
|
import { D as DeploymentFqn$1, F as Fqn$1, d as RelationId$1, N as NodeId$1, j as EdgeId$1, P as ProjectId$1, V as ViewId$1, T as Tag$1, E as ElementKind$1, b as DeploymentKind$1, c as RelationshipKind } from './core.DX-WYEPA.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as Connection, c as customInspectSymbol } from './core.
|
|
2
|
-
import { e as DeploymentElementModel, i as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.
|
|
3
|
-
import { A as Any, C as EdgeId } from './core.
|
|
4
|
-
import { c as IteratorLike } from './core.
|
|
1
|
+
import { C as Connection, c as customInspectSymbol } from './core.D704WZES.mjs';
|
|
2
|
+
import { e as DeploymentElementModel, i as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.CySf-2gP.mjs';
|
|
3
|
+
import { A as Any, C as EdgeId } from './core.D_fI5Lf6.mjs';
|
|
4
|
+
import { c as IteratorLike } from './core.DrvfVXkh.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Connection is ephemeral entity, result of a resolving relationships between source and target.
|
|
@@ -46,7 +46,7 @@ type ExclusiveUnion<Expressions, All = AllNever<Expressions>> = Expressions exte
|
|
|
46
46
|
* recursion. None of these have protections because this is an internal type!
|
|
47
47
|
*/
|
|
48
48
|
type NTuple<T, N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : NTuple<T, N, [...Result, T]>;
|
|
49
|
-
type IteratorLike<T> = IteratorObject<T, BuiltinIteratorReturn>;
|
|
49
|
+
type IteratorLike<T> = IteratorObject<T, BuiltinIteratorReturn, unknown>;
|
|
50
50
|
type Predicate<T> = (x: T) => boolean;
|
|
51
51
|
interface Link {
|
|
52
52
|
title?: string;
|
|
@@ -10,9 +10,9 @@ import { w as whereOperatorAsPredicate, a as _type, _ as _stage } from './core.y
|
|
|
10
10
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
11
11
|
import { a as isViewRuleStyle, m as isViewRuleAutoLayout, i as isViewRulePredicate, p as isViewRuleGroup, k as isViewRuleGlobalPredicateRef, j as isViewRuleGlobalStyle, o as isDynamicViewParallelSteps, h as isDynamicView, g as isDeploymentView, d as isElementView } from './core.T-eLZTW_.mjs';
|
|
12
12
|
import { i as isGroupElementKind, G as GroupElementKind, d as stepEdgeId } from './core.Be1n9a0i.mjs';
|
|
13
|
-
import { a as DefaultElementShape, D as DefaultThemeColor,
|
|
13
|
+
import { a as DefaultElementShape, D as DefaultThemeColor, h as DefaultArrowType, g as DefaultLineStyle, i as DefaultRelationshipColor } from './core.DHQ32OHa.mjs';
|
|
14
14
|
import { FqnExpr, RelationExpr } from '../types/expression.mjs';
|
|
15
|
-
import { d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.
|
|
15
|
+
import { d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.BIAlzwKc.mjs';
|
|
16
16
|
import { c as findAscendingConnections, o as mergeConnections, d as differenceConnections, m as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, a as findConnectionsBetween$3, q as modelConnection, g as findDescendantConnections, e as findDeepestNestedConnection, k as isAnyInOut, n as isOutgoing, l as isIncoming, C as ConnectionModel } from './core.D0EgVMQK.mjs';
|
|
17
17
|
import { a as toSet, t as toArray, i as imap } from './core.DLpidoWc.mjs';
|
|
18
18
|
import { D as DefaultMap } from './core.BuoXfSMj.mjs';
|
|
@@ -20,7 +20,7 @@ import { i as ifilter } from './core.CCD1ID81.mjs';
|
|
|
20
20
|
import { i as isome } from './core.Be4Jy9Qx.mjs';
|
|
21
21
|
import { C as Connection, c as customInspectSymbol } from './core.BVNaR17u.mjs';
|
|
22
22
|
import { i as isIterable } from './core.DoM6aM9N.mjs';
|
|
23
|
-
import { m as isElementModel, j as isNestedElementOfDeployedInstanceModel, f as isDeployedInstanceModel, i as isDeploymentNodeModel, h as isDeploymentElementModel, L as LikeC4Model } from './core.
|
|
23
|
+
import { m as isElementModel, j as isNestedElementOfDeployedInstanceModel, f as isDeployedInstanceModel, i as isDeploymentNodeModel, h as isDeploymentElementModel, L as LikeC4Model } from './core.FPITT8Vx.mjs';
|
|
24
24
|
import { a as iunique, i as iflat } from './core.CNGyqkJh.mjs';
|
|
25
25
|
|
|
26
26
|
function buildElementNotations(nodes) {
|
|
@@ -10359,6 +10359,7 @@ class DynamicViewCompute {
|
|
|
10359
10359
|
...view,
|
|
10360
10360
|
[_type]: "dynamic",
|
|
10361
10361
|
[_stage]: "computed",
|
|
10362
|
+
variant: view.variant ?? "diagram",
|
|
10362
10363
|
autoLayout: {
|
|
10363
10364
|
direction: autoLayoutRule?.direction ?? "LR",
|
|
10364
10365
|
...autoLayoutRule?.nodeSep && { nodeSep: autoLayoutRule.nodeSep },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unique, isTruthy, isEmpty, hasAtLeast, values, last, entries, pipe, map, sort, split, sortBy, prop } from 'remeda';
|
|
2
2
|
import { o as hierarchyLevel, n as nameFromFqn, i as isAncestor, g as commonAncestor, s as sortNaturalByFqn, f as sortParentsFirst, p as parentFqn, a as ancestorsFqn, k as compareNaturalHierarchically, j as compareNatural } from './core.DgttqsJc.mjs';
|
|
3
3
|
import { g as getOrCreate } from './core.DcS-0zys.mjs';
|
|
4
|
-
import { e as DeploymentNodeModel, c as DeployedInstanceModel, g as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.
|
|
4
|
+
import { e as DeploymentNodeModel, c as DeployedInstanceModel, g as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.BIAlzwKc.mjs';
|
|
5
5
|
import { D as DefaultMap } from './core.BuoXfSMj.mjs';
|
|
6
6
|
import { i as invariant, a as nonNullable } from './core.D4npX2q8.mjs';
|
|
7
7
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
@@ -9,7 +9,7 @@ import { b as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as wh
|
|
|
9
9
|
import { m as memoizeProp } from './core.CUw_2J9j.mjs';
|
|
10
10
|
import { i as ifilter } from './core.CCD1ID81.mjs';
|
|
11
11
|
import { c as splitGlobalFqn, g as extractStep, e as isStepEdgeId, i as isGroupElementKind, b as isGlobalFqn, a as GlobalFqn } from './core.Be1n9a0i.mjs';
|
|
12
|
-
import { a as DefaultElementShape, D as DefaultThemeColor, R as RichText,
|
|
12
|
+
import { a as DefaultElementShape, D as DefaultThemeColor, R as RichText, c as DefaultShapeSize, i as DefaultRelationshipColor, g as DefaultLineStyle } from './core.DHQ32OHa.mjs';
|
|
13
13
|
import { a as ihead, i as ifind } from './core.GTgsmXS_.mjs';
|
|
14
14
|
|
|
15
15
|
class ElementModel {
|
|
@@ -1015,6 +1015,16 @@ class LikeC4ViewModel {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
return null;
|
|
1017
1017
|
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Available for dynamic views only
|
|
1020
|
+
* throws error if view is not dynamic
|
|
1021
|
+
*/
|
|
1022
|
+
get mode() {
|
|
1023
|
+
if (this.isDynamicView()) {
|
|
1024
|
+
return this.$view.variant ?? "diagram";
|
|
1025
|
+
}
|
|
1026
|
+
throw new Error("View is not dynamic");
|
|
1027
|
+
}
|
|
1018
1028
|
/**
|
|
1019
1029
|
* All tags from nodes and edges.
|
|
1020
1030
|
*/
|
|
@@ -1063,14 +1073,21 @@ class LikeC4ViewModel {
|
|
|
1063
1073
|
return this.#nodes.values();
|
|
1064
1074
|
}
|
|
1065
1075
|
/**
|
|
1066
|
-
*
|
|
1076
|
+
* Get edge by id, throws error if edge is not found.
|
|
1077
|
+
* Use {@link findEdge} if you are not sure if the edge exists.
|
|
1078
|
+
*
|
|
1067
1079
|
* @param edge Edge or id
|
|
1068
|
-
* @returns EdgeModel
|
|
1080
|
+
* @returns {@link EdgeModel}
|
|
1069
1081
|
*/
|
|
1070
1082
|
edge(edge) {
|
|
1071
1083
|
const edgeId = getId(edge);
|
|
1072
1084
|
return nonNullable(this.#edges.get(edgeId), `Edge ${edgeId} not found in view ${this.$view.id}`);
|
|
1073
1085
|
}
|
|
1086
|
+
/**
|
|
1087
|
+
* Find edge by id.
|
|
1088
|
+
* @param edge Edge or id
|
|
1089
|
+
* @returns {@link EdgeModel} or null if edge is not found
|
|
1090
|
+
*/
|
|
1074
1091
|
findEdge(edge) {
|
|
1075
1092
|
return this.#edges.get(getId(edge)) ?? null;
|
|
1076
1093
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as Connection, c as customInspectSymbol } from './core.
|
|
2
|
-
import { E as ElementModel, R as RelationshipModel } from './core.
|
|
3
|
-
import { A as Any, U as Unknown, C as EdgeId } from './core.
|
|
1
|
+
import { C as Connection, c as customInspectSymbol } from './core.D704WZES.mjs';
|
|
2
|
+
import { E as ElementModel, R as RelationshipModel } from './core.CySf-2gP.mjs';
|
|
3
|
+
import { A as Any, U as Unknown, C as EdgeId } from './core.D_fI5Lf6.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Connection refers to any relationships between two elements,
|
package/dist/types/_aux.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'type-fest';
|
|
2
|
-
import '../shared/core.
|
|
3
|
-
export { k as AllKinds, A as Any, A as AnyAux, G as AnySpec, a as Aux, s as DeploymentFqn, D as DeploymentId, o as DeploymentKind, C as EdgeId, j as ElementId, h as ElementKind, F as Fqn, r as LooseDeploymentId, a4 as LooseDeploymentKind, q as LooseElementId, a3 as LooseElementKind, a5 as LooseRelationKind, L as LooseTag, a2 as LooseTags, x as LooseViewId, m as Metadata, n as MetadataKey, N as Never, J as NodeId, a1 as OrString, H as PickByStage, P as ProjectId, p as RelationId, R as RelationKind, K as Spec, S as SpecAux, v as Stage, s as StrictDeploymentFqn, Y as StrictDeploymentKind, X as StrictElementKind, F as StrictFqn, O as StrictProjectId, Z as StrictRelationKind, Q as StrictTag, g as StrictViewId, T as Tag, l as Tags, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, V as ViewId, a0 as WithLinks, B as WithMetadata, z as WithOptionalLinks, W as WithOptionalTags, $ as WithTags, y as setProject, I as setStage, t as toComputed, u as toLayouted, w as toParsed } from '../shared/core.
|
|
2
|
+
import '../shared/core.DrvfVXkh.mjs';
|
|
3
|
+
export { k as AllKinds, A as Any, A as AnyAux, G as AnySpec, a as Aux, s as DeploymentFqn, D as DeploymentId, o as DeploymentKind, C as EdgeId, j as ElementId, h as ElementKind, F as Fqn, r as LooseDeploymentId, a4 as LooseDeploymentKind, q as LooseElementId, a3 as LooseElementKind, a5 as LooseRelationKind, L as LooseTag, a2 as LooseTags, x as LooseViewId, m as Metadata, n as MetadataKey, N as Never, J as NodeId, a1 as OrString, H as PickByStage, P as ProjectId, p as RelationId, R as RelationKind, K as Spec, S as SpecAux, v as Stage, s as StrictDeploymentFqn, Y as StrictDeploymentKind, X as StrictElementKind, F as StrictFqn, O as StrictProjectId, Z as StrictRelationKind, Q as StrictTag, g as StrictViewId, T as Tag, l as Tags, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, V as ViewId, a0 as WithLinks, B as WithMetadata, z as WithOptionalLinks, W as WithOptionalTags, $ as WithTags, y as setProject, I as setStage, t as toComputed, u as toLayouted, w as toParsed } from '../shared/core.D_fI5Lf6.mjs';
|
|
4
4
|
import '../shared/core.DX-WYEPA.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as Any, g as StrictViewId, h as ElementKind, T as Tag } from '../shared/core.
|
|
2
|
-
import { E as ExclusiveUnion } from '../shared/core.
|
|
3
|
-
import { W as WhereOperator, P as PredicateSelector } from '../shared/core.
|
|
1
|
+
import { A as Any, g as StrictViewId, h as ElementKind, T as Tag } from '../shared/core.D_fI5Lf6.mjs';
|
|
2
|
+
import { E as ExclusiveUnion } from '../shared/core.DrvfVXkh.mjs';
|
|
3
|
+
import { W as WhereOperator, P as PredicateSelector } from '../shared/core.BbThmf6M.mjs';
|
|
4
4
|
import { FqnRef } from './fqnRef.mjs';
|
|
5
5
|
import { M as MarkdownOrString, I as Icon } from '../shared/core.DX-WYEPA.mjs';
|
|
6
6
|
import { i as Color, R as RelationshipLineType, f as RelationshipArrowType, c as ElementShape, b as BorderStyle, a as ShapeSize } from '../shared/core.CzdwsPmY.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import '../shared/core.
|
|
2
|
-
import '../shared/core.
|
|
1
|
+
import '../shared/core.D_fI5Lf6.mjs';
|
|
2
|
+
import '../shared/core.DrvfVXkh.mjs';
|
|
3
3
|
import './fqnRef.mjs';
|
|
4
|
-
export { E as Expression, F as FqnExpr, P as PredicateSelector, R as RelationExpr } from '../shared/core.
|
|
4
|
+
export { E as Expression, F as FqnExpr, P as PredicateSelector, R as RelationExpr } from '../shared/core.BbThmf6M.mjs';
|
|
5
5
|
import '../shared/core.DX-WYEPA.mjs';
|
|
6
6
|
import '../shared/core.CzdwsPmY.mjs';
|
|
7
7
|
import 'type-fest';
|
package/dist/types/fqnRef.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Any, U as Unknown$1, j as ElementId, P as ProjectId, F as Fqn, D as DeploymentId } from '../shared/core.
|
|
2
|
-
import { E as ExclusiveUnion } from '../shared/core.
|
|
1
|
+
import { A as Any, U as Unknown$1, j as ElementId, P as ProjectId, F as Fqn, D as DeploymentId } from '../shared/core.D_fI5Lf6.mjs';
|
|
2
|
+
import { E as ExclusiveUnion } from '../shared/core.DrvfVXkh.mjs';
|
|
3
3
|
import 'type-fest';
|
|
4
4
|
import '../shared/core.DX-WYEPA.mjs';
|
|
5
5
|
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { N as NonEmptyArray } from '../shared/core.
|
|
2
|
-
export { C as Coalesce, E as ExclusiveUnion, I as IterableContainer, c as IteratorLike, K as KeysOf, L as Link, b as NTuple, a as NonEmptyReadonlyArray, P as Predicate, R as ReorderedArray } from '../shared/core.
|
|
3
|
-
export { A as Any, A as AnyAux, a as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, e as _stage, f as _type, _ as aux, i as isOnStage } from '../shared/core.
|
|
4
|
-
export { A as AndOperator, a as EqualOperator, E as Expression, j as Filterable, F as FqnExpr, K as KindEqual, N as NotOperator, k as OperatorPredicate, O as OrOperator, c as Participant, d as ParticipantOperator, P as PredicateSelector, R as RelationExpr, T as TagEqual, W as WhereOperator, g as isAndOperator, b as isKindEqual, f as isNotOperator, h as isOrOperator, e as isParticipantOperator, i as isTagEqual, w as whereOperatorAsPredicate } from '../shared/core.
|
|
1
|
+
import { N as NonEmptyArray } from '../shared/core.DrvfVXkh.mjs';
|
|
2
|
+
export { C as Coalesce, E as ExclusiveUnion, I as IterableContainer, c as IteratorLike, K as KeysOf, L as Link, b as NTuple, a as NonEmptyReadonlyArray, P as Predicate, R as ReorderedArray } from '../shared/core.DrvfVXkh.mjs';
|
|
3
|
+
export { A as Any, A as AnyAux, a as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, e as _stage, f as _type, _ as aux, i as isOnStage } from '../shared/core.D_fI5Lf6.mjs';
|
|
4
|
+
export { A as AndOperator, a as EqualOperator, E as Expression, j as Filterable, F as FqnExpr, K as KindEqual, N as NotOperator, k as OperatorPredicate, O as OrOperator, c as Participant, d as ParticipantOperator, P as PredicateSelector, R as RelationExpr, T as TagEqual, W as WhereOperator, g as isAndOperator, b as isKindEqual, f as isNotOperator, h as isOrOperator, e as isParticipantOperator, i as isTagEqual, w as whereOperatorAsPredicate } from '../shared/core.BbThmf6M.mjs';
|
|
5
5
|
export { ModelExpression, ModelFqnExpr, ModelRelationExpr } from './expression-model.mjs';
|
|
6
6
|
export { FqnRef } from './fqnRef.mjs';
|
|
7
|
-
import {
|
|
8
|
-
export {
|
|
7
|
+
import { at as ViewManualLayout, ao as AutoLayoutDirection } from '../shared/core.Bpou6c2f.mjs';
|
|
8
|
+
export { O as AbstractRelationship, ai as AnyExcludePredicate, ah as AnyIncludePredicate, a4 as AnyView, aj as AnyViewRuleStyle, u as AuxFromDump, A as AuxFromLikeC4ModelData, B as BBox, aw as BaseParsedViewProperties, av as BaseViewProperties, aD as ComputedDeploymentView, aE as ComputedDynamicView, aB as ComputedEdge, aC as ComputedElementView, C as ComputedLikeC4ModelData, aA as ComputedNode, a2 as ComputedView, K as DefaultArrowType, w as DefaultElementShape, J as DefaultLineStyle, z as DefaultPaddingSize, N as DefaultRelationshipColor, y as DefaultShapeSize, x as DefaultSize, E as DefaultTextSize, v as DefaultThemeColor, k as DeployedInstance, l as DeploymentElement, m as DeploymentElementRef, D as DeploymentElementStyle, j as DeploymentNode, q as DeploymentRelation, p as DeploymentRelationship, aL as DeploymentViewExcludePredicate, aK as DeploymentViewIncludePredicate, aM as DeploymentViewPredicate, aO as DeploymentViewRule, aN as DeploymentViewRuleStyle, aG as DiagramEdge, aF as DiagramNode, a0 as DiagramView, aW as DynamicViewDisplayVariant, aU as DynamicViewIncludeRule, aR as DynamicViewParallelSteps, aV as DynamicViewRule, aQ as DynamicViewStep, aT as DynamicViewStepOrParallel, I as Element, U as ElementSpecification, F as ElementStyle, a_ as ElementViewExcludePredicate, aZ as ElementViewIncludePredicate, a$ as ElementViewPredicate, b3 as ElementViewRule, b0 as ElementViewRuleGroup, b2 as ElementViewRuleStyle, e as GlobalDynamicPredicates, G as GlobalPredicateId, d as GlobalPredicates, f as GlobalStyleID, g as GlobalStyles, aI as LayoutedDeploymentView, aJ as LayoutedDynamicView, aH as LayoutedElementView, L as LayoutedLikeC4ModelData, a0 as LayoutedView, i as LikeC4ModelData, s as LikeC4ModelDump, _ as LikeC4Project, $ as LikeC4View, M as ModelGlobals, T as ModelRelation, ax as NodeNotation, aP as ParsedDeploymentView, aX as ParsedDynamicView, b4 as ParsedElementView, h as ParsedLikeC4ModelData, $ as ParsedView, P as Point, a3 as ProcessedView, t as ProjectDump, c as RectBox, Q as Relationship, Y as RelationshipSpecification, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty, r as SpecTypesFromDump, Z as Specification, S as SpecificationDump, V as TagSpecification, as as ViewAutoLayout, a5 as ViewOnStage, a7 as ViewRule, aq as ViewRuleAutoLayout, am as ViewRuleGlobalPredicateRef, ak as ViewRuleGlobalStyle, a8 as ViewRulePredicate, au as ViewType, az as ViewWithHash, ay as ViewWithNotation, a6 as ViewWithType, X as XYPoint, H as ensureSizes, aS as getParallelStepsPrefix, ap as isAutoLayoutDirection, ab as isComputedView, o as isDeployedInstance, n as isDeploymentNode, af as isDeploymentView, a1 as isDiagramView, ag as isDynamicView, aY as isDynamicViewParallelSteps, ac as isElementView, ae as isExtendsElementView, a1 as isLayoutedView, ad as isScopedElementView, W as isTagColorSpecified, ar as isViewRuleAutoLayout, an as isViewRuleGlobalPredicateRef, al as isViewRuleGlobalStyle, b1 as isViewRuleGroup, a9 as isViewRulePredicate, aa as isViewRuleStyle } from '../shared/core.Bpou6c2f.mjs';
|
|
9
9
|
import { F as Fqn, D as DeploymentFqn } from '../shared/core.DX-WYEPA.mjs';
|
|
10
10
|
export { A as AnyFqn, B as BuiltInIcon, b as DeploymentKind, j as EdgeId, E as ElementKind, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, N as NodeId, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, k as StepEdgeId, S as StepEdgeIdLiteral, m as StepEdgeKind, T as Tag, V as ViewId, o as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, n as isStepEdgeId, s as scalar, h as splitGlobalFqn, l as stepEdgeId } from '../shared/core.DX-WYEPA.mjs';
|
|
11
11
|
import { b as BorderStyle, c as ElementShape, h as ThemeColor } from '../shared/core.CzdwsPmY.mjs';
|
package/dist/types/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ export { _ as _stage, a as _type, h as isAndOperator, c as isDeployedInstance, b
|
|
|
3
3
|
export { Expression, FqnExpr, RelationExpr } from './expression.mjs';
|
|
4
4
|
export { ModelExpression, ModelFqnExpr, ModelRelationExpr } from './expression-model.mjs';
|
|
5
5
|
export { FqnRef } from './fqnRef.mjs';
|
|
6
|
-
export { B as BBox, a as BorderStyles, E as ElementShapes, R as RectBox, T as ThemeColors, i as isTagColorSpecified, b as isThemeColor } from '../shared/core.
|
|
7
|
-
export {
|
|
6
|
+
export { B as BBox, a as BorderStyles, E as ElementShapes, R as RectBox, T as ThemeColors, i as isTagColorSpecified, b as isThemeColor } from '../shared/core.6_Vp2iiN.mjs';
|
|
7
|
+
export { h as DefaultArrowType, a as DefaultElementShape, g as DefaultLineStyle, d as DefaultPaddingSize, i as DefaultRelationshipColor, c as DefaultShapeSize, b as DefaultSize, e as DefaultTextSize, D as DefaultThemeColor, R as RichText, f as ensureSizes } from '../shared/core.DHQ32OHa.mjs';
|
|
8
8
|
export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, N as NodeId, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, g as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, e as isStepEdgeId, s as scalar, c as splitGlobalFqn, d as stepEdgeId } from '../shared/core.Be1n9a0i.mjs';
|
|
9
9
|
export { n as getParallelStepsPrefix, l as isAutoLayoutDirection, b as isComputedView, g as isDeploymentView, c as isDiagramView, h as isDynamicView, o as isDynamicViewParallelSteps, d as isElementView, f as isExtendsElementView, c as isLayoutedView, e as isScopedElementView, m as isViewRuleAutoLayout, k as isViewRuleGlobalPredicateRef, j as isViewRuleGlobalStyle, p as isViewRuleGroup, i as isViewRulePredicate, a as isViewRuleStyle } from '../shared/core.T-eLZTW_.mjs';
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { D as DefaultMap } from '../shared/core.CywrQs86.mjs';
|
|
2
|
-
export { B as BiMap, D as DefaultWeakMap, L as LinkedList, M as MultiMap, Q as Queue, a as ancestorsFqn, k as commonAncestor, l as compareByFqnHierarchically, o as compareFqnHierarchically, q as hierarchyDistance, r as hierarchyLevel, i as invariant, b as isAncestor, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, h as nonNullable, g as nonexhaustive, p as parentFqn, t as sortByFqnHierarchically, s as sortNaturalByFqn, j as sortParentsFirst } from '../shared/core.
|
|
3
|
-
import { N as NonEmptyArray } from '../shared/core.
|
|
2
|
+
export { B as BiMap, D as DefaultWeakMap, L as LinkedList, M as MultiMap, Q as Queue, a as ancestorsFqn, k as commonAncestor, l as compareByFqnHierarchically, o as compareFqnHierarchically, q as hierarchyDistance, r as hierarchyLevel, i as invariant, b as isAncestor, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, h as nonNullable, g as nonexhaustive, p as parentFqn, t as sortByFqnHierarchically, s as sortNaturalByFqn, j as sortParentsFirst } from '../shared/core.vWJTxpLV.mjs';
|
|
3
|
+
import { N as NonEmptyArray } from '../shared/core.DrvfVXkh.mjs';
|
|
4
4
|
export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isome, iunique, toArray, toSet } from './iterable/index.mjs';
|
|
5
5
|
export { i as isIterable } from '../shared/core.DXhDWKFZ.mjs';
|
|
6
6
|
import '../shared/core.DX-WYEPA.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -121,12 +121,12 @@
|
|
|
121
121
|
"natural-compare-lite": "^1.4.0",
|
|
122
122
|
"object-hash": "^3.0.0",
|
|
123
123
|
"obliterator": "^2.0.5",
|
|
124
|
-
"fdir": "6.
|
|
124
|
+
"fdir": "6.4.0",
|
|
125
125
|
"turbo": "2.5.6",
|
|
126
126
|
"typescript": "5.9.2",
|
|
127
127
|
"unbuild": "3.5.0",
|
|
128
128
|
"vitest": "3.2.4",
|
|
129
|
-
"@likec4/tsconfig": "1.
|
|
129
|
+
"@likec4/tsconfig": "1.40.0"
|
|
130
130
|
},
|
|
131
131
|
"scripts": {
|
|
132
132
|
"typecheck": "tsc -b --verbose",
|
|
@@ -216,6 +216,7 @@ class DynamicViewCompute<A extends AnyAux> {
|
|
|
216
216
|
...view,
|
|
217
217
|
[_type]: 'dynamic',
|
|
218
218
|
[_stage]: 'computed',
|
|
219
|
+
variant: view.variant ?? 'diagram',
|
|
219
220
|
autoLayout: {
|
|
220
221
|
direction: autoLayoutRule?.direction ?? 'LR',
|
|
221
222
|
...(autoLayoutRule?.nodeSep && { nodeSep: autoLayoutRule.nodeSep }),
|
|
@@ -2,6 +2,7 @@ import { isTruthy } from 'remeda'
|
|
|
2
2
|
import type {
|
|
3
3
|
Any,
|
|
4
4
|
AnyView,
|
|
5
|
+
DynamicViewDisplayVariant,
|
|
5
6
|
IteratorLike,
|
|
6
7
|
Link,
|
|
7
8
|
scalar,
|
|
@@ -168,6 +169,17 @@ export class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>>
|
|
|
168
169
|
return null
|
|
169
170
|
}
|
|
170
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Available for dynamic views only
|
|
174
|
+
* throws error if view is not dynamic
|
|
175
|
+
*/
|
|
176
|
+
get mode(): DynamicViewDisplayVariant {
|
|
177
|
+
if (this.isDynamicView()) {
|
|
178
|
+
return this.$view.variant ?? 'diagram'
|
|
179
|
+
}
|
|
180
|
+
throw new Error('View is not dynamic')
|
|
181
|
+
}
|
|
182
|
+
|
|
171
183
|
/**
|
|
172
184
|
* All tags from nodes and edges.
|
|
173
185
|
*/
|
|
@@ -223,17 +235,26 @@ export class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>>
|
|
|
223
235
|
}
|
|
224
236
|
|
|
225
237
|
/**
|
|
226
|
-
*
|
|
238
|
+
* Get edge by id, throws error if edge is not found.
|
|
239
|
+
* Use {@link findEdge} if you are not sure if the edge exists.
|
|
240
|
+
*
|
|
227
241
|
* @param edge Edge or id
|
|
228
|
-
* @returns EdgeModel
|
|
242
|
+
* @returns {@link EdgeModel}
|
|
229
243
|
*/
|
|
230
244
|
public edge(edge: EdgeOrId): EdgeModel<A, V> {
|
|
231
245
|
const edgeId = getId(edge)
|
|
232
246
|
return nonNullable(this.#edges.get(edgeId), `Edge ${edgeId} not found in view ${this.$view.id}`)
|
|
233
247
|
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Find edge by id.
|
|
251
|
+
* @param edge Edge or id
|
|
252
|
+
* @returns {@link EdgeModel} or null if edge is not found
|
|
253
|
+
*/
|
|
234
254
|
public findEdge(edge: EdgeOrId): EdgeModel<A, V> | null {
|
|
235
255
|
return this.#edges.get(getId(edge)) ?? null
|
|
236
256
|
}
|
|
257
|
+
|
|
237
258
|
/**
|
|
238
259
|
* Iterate over all edges.
|
|
239
260
|
*/
|
|
@@ -336,8 +357,5 @@ export namespace LikeC4ViewModel {
|
|
|
336
357
|
{
|
|
337
358
|
}
|
|
338
359
|
|
|
339
|
-
export
|
|
340
|
-
extends LikeC4ViewModel<A, ViewWithType<V, 'dynamic'>>
|
|
341
|
-
{
|
|
342
|
-
}
|
|
360
|
+
export type DynamicView<A extends Any, V extends $View<A> = $View<A>> = LikeC4ViewModel<A, ViewWithType<V, 'dynamic'>>
|
|
343
361
|
}
|
package/src/types/RichText.ts
CHANGED
|
@@ -63,7 +63,10 @@ export class RichText {
|
|
|
63
63
|
return source as RichTextOrEmpty
|
|
64
64
|
}
|
|
65
65
|
if (typeof source === 'string') {
|
|
66
|
-
|
|
66
|
+
if (source.trim() === emptyTxt) {
|
|
67
|
+
return RichText.EMPTY
|
|
68
|
+
}
|
|
69
|
+
return new RichText({ txt: source }) as RichTextOrEmpty
|
|
67
70
|
}
|
|
68
71
|
if ('isEmpty' in source && source.isEmpty) {
|
|
69
72
|
return RichText.EMPTY
|
package/src/types/_common.ts
CHANGED
|
@@ -62,7 +62,7 @@ export type NTuple<
|
|
|
62
62
|
Result extends Array<unknown> = [],
|
|
63
63
|
> = Result['length'] extends N ? Result : NTuple<T, N, [...Result, T]>
|
|
64
64
|
|
|
65
|
-
export type IteratorLike<T> = IteratorObject<T, BuiltinIteratorReturn>
|
|
65
|
+
export type IteratorLike<T> = IteratorObject<T, BuiltinIteratorReturn, unknown>
|
|
66
66
|
|
|
67
67
|
export type Predicate<T> = (x: T) => boolean
|
|
68
68
|
|
package/src/types/geometry.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasAtLeast } from 'remeda'
|
|
1
2
|
import { invariant } from '../utils/invariant'
|
|
2
3
|
|
|
3
4
|
export type Point = readonly [x: number, y: number]
|
|
@@ -34,7 +35,10 @@ export namespace BBox {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export function merge(...boxes: BBox[]): BBox {
|
|
37
|
-
invariant(boxes
|
|
38
|
+
invariant(hasAtLeast(boxes, 1), 'No boxes provided')
|
|
39
|
+
if (boxes.length === 1) {
|
|
40
|
+
return boxes[0]
|
|
41
|
+
}
|
|
38
42
|
let minX = Infinity
|
|
39
43
|
let minY = Infinity
|
|
40
44
|
let maxX = -Infinity
|
|
@@ -61,6 +65,30 @@ export namespace BBox {
|
|
|
61
65
|
y2: box.y + box.height,
|
|
62
66
|
}
|
|
63
67
|
}
|
|
68
|
+
|
|
69
|
+
export function expand(box: BBox, plus: number): BBox {
|
|
70
|
+
if (plus === 0) {
|
|
71
|
+
return box
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
x: box.x - plus,
|
|
75
|
+
y: box.y - plus,
|
|
76
|
+
width: box.width + plus * 2,
|
|
77
|
+
height: box.height + plus * 2,
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function shrink(box: BBox, minus: number): BBox {
|
|
82
|
+
if (minus === 0) {
|
|
83
|
+
return box
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
x: box.x + minus,
|
|
87
|
+
y: box.y + minus,
|
|
88
|
+
width: box.width - minus * 2,
|
|
89
|
+
height: box.height - minus * 2,
|
|
90
|
+
}
|
|
91
|
+
}
|
|
64
92
|
}
|
|
65
93
|
|
|
66
94
|
export interface RectBox {
|
|
@@ -17,9 +17,10 @@ import type {
|
|
|
17
17
|
|
|
18
18
|
export const DefaultThemeColor: ThemeColor = 'primary'
|
|
19
19
|
export const DefaultElementShape: ElementShape = 'rectangle'
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
20
|
+
export const DefaultSize = 'md'
|
|
21
|
+
export const DefaultShapeSize: ShapeSize = DefaultSize
|
|
22
|
+
export const DefaultPaddingSize: SpacingSize = DefaultSize
|
|
23
|
+
export const DefaultTextSize: TextSize = DefaultSize
|
|
23
24
|
|
|
24
25
|
export interface ElementStyle {
|
|
25
26
|
readonly border?: BorderStyle
|
|
@@ -47,6 +48,29 @@ export interface ElementStyle {
|
|
|
47
48
|
readonly textSize?: TextSize
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
type WithSizes = Pick<ElementStyle, 'size' | 'padding' | 'textSize'>
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Ensures that the sizes are set to default values if they are not set
|
|
55
|
+
*/
|
|
56
|
+
export function ensureSizes<S extends WithSizes>({
|
|
57
|
+
size,
|
|
58
|
+
padding,
|
|
59
|
+
textSize,
|
|
60
|
+
...rest
|
|
61
|
+
}: S): Omit<S, 'size' | 'padding' | 'textSize'> & Required<WithSizes> {
|
|
62
|
+
size ??= DefaultSize
|
|
63
|
+
textSize ??= size
|
|
64
|
+
padding ??= size
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
...rest,
|
|
68
|
+
size,
|
|
69
|
+
padding,
|
|
70
|
+
textSize,
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
50
74
|
// dprint-ignore
|
|
51
75
|
export interface Element<A extends AnyAux = AnyAux>
|
|
52
76
|
extends
|
|
@@ -19,6 +19,7 @@ import type {
|
|
|
19
19
|
ViewWithHash,
|
|
20
20
|
ViewWithNotation,
|
|
21
21
|
} from './view-common'
|
|
22
|
+
import type { DynamicViewDisplayVariant } from './view-parsed.dynamic'
|
|
22
23
|
|
|
23
24
|
export interface ComputedNode<A extends Any = Any> extends aux.WithOptionalLinks {
|
|
24
25
|
id: scalar.NodeId
|
|
@@ -108,4 +109,10 @@ export interface ComputedDeploymentView<A extends Any = Any> extends BaseCompute
|
|
|
108
109
|
|
|
109
110
|
export interface ComputedDynamicView<A extends Any = Any> extends BaseComputedViewProperties<A> {
|
|
110
111
|
readonly [_type]: 'dynamic'
|
|
112
|
+
/**
|
|
113
|
+
* How to display the dynamic view
|
|
114
|
+
* - `diagram`: display as a regular likec4 view
|
|
115
|
+
* - `sequence`: display as a sequence diagram
|
|
116
|
+
*/
|
|
117
|
+
readonly variant: DynamicViewDisplayVariant
|
|
111
118
|
}
|
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
ViewWithNotation,
|
|
11
11
|
} from './view-common'
|
|
12
12
|
import type { ComputedEdge, ComputedNode } from './view-computed'
|
|
13
|
+
import type { DynamicViewDisplayVariant } from './view-parsed.dynamic'
|
|
13
14
|
|
|
14
15
|
export interface DiagramNode<A extends AnyAux = AnyAux> extends ComputedNode<A>, BBox {
|
|
15
16
|
x: number
|
|
@@ -88,4 +89,10 @@ export interface LayoutedDeploymentView<A extends AnyAux = AnyAux> extends BaseL
|
|
|
88
89
|
|
|
89
90
|
export interface LayoutedDynamicView<A extends AnyAux = AnyAux> extends BaseLayoutedViewProperties<A> {
|
|
90
91
|
readonly [_type]: 'dynamic'
|
|
92
|
+
/**
|
|
93
|
+
* How to display the dynamic view
|
|
94
|
+
* - `diagram`: display as a regular likec4 view
|
|
95
|
+
* - `sequence`: display as a sequence diagram
|
|
96
|
+
*/
|
|
97
|
+
readonly variant: DynamicViewDisplayVariant
|
|
91
98
|
}
|
|
@@ -65,8 +65,19 @@ export type DynamicViewRule<A extends AnyAux = AnyAux> = ExclusiveUnion<{
|
|
|
65
65
|
AutoLayout: ViewRuleAutoLayout
|
|
66
66
|
}>
|
|
67
67
|
|
|
68
|
+
export type DynamicViewDisplayVariant = 'diagram' | 'sequence'
|
|
69
|
+
|
|
68
70
|
export interface ParsedDynamicView<A extends AnyAux = AnyAux> extends BaseParsedViewProperties<A> {
|
|
69
71
|
[_type]: 'dynamic'
|
|
72
|
+
/**
|
|
73
|
+
* How to display the dynamic view
|
|
74
|
+
* - `diagram`: display as a regular likec4 view
|
|
75
|
+
* - `sequence`: display as a sequence diagram
|
|
76
|
+
*
|
|
77
|
+
* @default 'diagram'
|
|
78
|
+
*/
|
|
79
|
+
readonly variant?: DynamicViewDisplayVariant
|
|
80
|
+
|
|
70
81
|
readonly steps: DynamicViewStepOrParallel<A>[]
|
|
71
82
|
readonly rules: DynamicViewRule<A>[]
|
|
72
83
|
}
|