@likec4/core 1.20.3 → 1.21.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/dist/builder/index.cjs +24 -18
- package/dist/builder/index.d.cts +11 -5
- package/dist/builder/index.d.mts +11 -5
- package/dist/builder/index.d.ts +11 -5
- package/dist/builder/index.mjs +10 -4
- package/dist/compute-view/index.cjs +6 -6
- package/dist/compute-view/index.d.cts +4 -4
- package/dist/compute-view/index.d.mts +4 -4
- package/dist/compute-view/index.d.ts +4 -4
- package/dist/compute-view/index.mjs +6 -6
- package/dist/index.cjs +53 -14
- package/dist/index.d.cts +6 -6
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +47 -11
- package/dist/model/index.cjs +1 -1
- package/dist/model/index.d.cts +5 -5
- package/dist/model/index.d.mts +5 -5
- package/dist/model/index.d.ts +5 -5
- package/dist/model/index.mjs +1 -1
- package/dist/shared/{core.Cmfo_N4F.d.mts → core.5Z5cpENq.d.mts} +5 -4
- package/dist/shared/{core.D4wZW7zR.d.ts → core.BJfq046m.d.ts} +5 -4
- package/dist/shared/{core.C0ygs98j.d.cts → core.BS_nXBsP.d.cts} +9 -2
- package/dist/shared/{core.CajOK_t3.d.mts → core.BYs5deiY.d.cts} +1 -1
- package/dist/shared/{core.Bezy7K65.mjs → core.BfZZXtur.mjs} +2 -2
- package/dist/shared/{core.CwZmAghJ.d.cts → core.BgPZ8Tl8.d.cts} +5 -4
- package/dist/shared/{core.FACQZmma.cjs → core.BjR0D3IO.cjs} +15 -15
- package/dist/shared/{core.uxHtIZaH.cjs → core.CAkSSvJ6.cjs} +11 -5
- package/dist/shared/{core.El-gigOM.mjs → core.CE-kCVHA.mjs} +1 -1
- package/dist/shared/{core.DjMYkPMQ.d.mts → core.CJaCUZQ9.d.mts} +9 -2
- package/dist/shared/{core.88YY6vtF.d.mts → core.CT1nzYjO.d.cts} +2 -2
- package/dist/shared/{core.0PxLtLpP.mjs → core.CYNYaH2U.mjs} +5 -2
- package/dist/shared/{core.CCyhaU-4.mjs → core.CeefT_JU.mjs} +6 -6
- package/dist/shared/{core.BG1hfxpq.mjs → core.Cz9Oy_FA.mjs} +475 -409
- package/dist/shared/{core.BIZD3l1g.d.cts → core.D0KD4FiT.d.mts} +1 -1
- package/dist/shared/{core.DRfrKNT6.cjs → core.D91uYrqI.cjs} +551 -485
- package/dist/shared/{core.BtISRjMA.d.ts → core.DQCc-Jxk.d.ts} +1 -1
- package/dist/shared/{core.Db_OTRdC.cjs → core.DnPc_NDM.cjs} +1 -1
- package/dist/shared/{core.CNUzoKM7.d.ts → core.Dp3HTiRV.d.ts} +2 -2
- package/dist/shared/{core.CKYxnFEl.cjs → core.DqQrj2oQ.cjs} +2 -2
- package/dist/shared/{core.Bs71hdR4.d.ts → core.DsDq-blc.d.ts} +9 -2
- package/dist/shared/{core.Lh2RFJf1.d.cts → core.DuuS_BrY.d.mts} +2 -2
- package/dist/shared/{core.BJfn72tj.d.ts → core.QP35c488.d.cts} +33 -1
- package/dist/shared/{core.BJfn72tj.d.cts → core.QP35c488.d.mts} +33 -1
- package/dist/shared/{core.BJfn72tj.d.mts → core.QP35c488.d.ts} +33 -1
- package/dist/types/index.cjs +4 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.mjs +3 -3
- package/package.json +6 -6
- package/src/builder/Builder.ts +11 -5
- package/src/builder/Builder.view-common.ts +1 -0
- package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +16 -4
- package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +21 -5
- package/src/builder/_types.ts +9 -0
- package/src/compute-view/deployment-view/predicates/{elements.ts → deploymentRefs.ts} +32 -21
- package/src/compute-view/deployment-view/predicates/index.ts +1 -1
- package/src/compute-view/deployment-view/predicates/utils.ts +56 -1
- package/src/compute-view/deployment-view/predicates/wildcard.ts +20 -9
- package/src/compute-view/memory/AbstractStageExclude.ts +1 -1
- package/src/compute-view/utils/applyCustomElementProperties.ts +18 -1
- package/src/compute-view/utils/applyViewRuleStyles.ts +9 -0
- package/src/compute-view/utils/buildComputedNodes.ts +13 -9
- package/src/index.ts +1 -1
- package/src/model/DeploymentElementModel.ts +5 -2
- package/src/model/ElementModel.ts +10 -0
- package/src/{colors → theme}/element.ts +9 -9
- package/src/{colors → theme}/index.ts +41 -5
- package/src/{colors → theme}/relationships.ts +9 -9
- package/src/types/element.ts +19 -1
- package/src/types/expression.ts +4 -1
- package/src/types/index.ts +6 -0
- package/src/types/theme.ts +22 -1
- package/src/types/view.ts +5 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LikeC4Model, E as ElementModel, R as RelationshipModel } from './core.
|
|
2
|
-
import { F as Fqn } from './core.
|
|
1
|
+
import { L as LikeC4Model, E as ElementModel, R as RelationshipModel } from './core.BJfq046m.js';
|
|
2
|
+
import { F as Fqn } from './core.QP35c488.js';
|
|
3
3
|
|
|
4
4
|
declare function computeRelationshipsView(subjectId: Fqn, likec4model: LikeC4Model): {
|
|
5
5
|
incomers: Set<ElementModel<LikeC4Model.Any>>;
|
|
@@ -16,9 +16,9 @@ function nonexhaustive(value) {
|
|
|
16
16
|
throw new Error(`NonExhaustive value: ${value}`);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
function u$1(
|
|
19
|
+
function u$1(o,n,a){let t=r=>o(r,...n);return a===undefined?t:Object.assign(t,{lazy:a,lazyArgs:n})}
|
|
20
20
|
|
|
21
|
-
function u(r,n,
|
|
21
|
+
function u(r,n,o){let a=r.length-n.length;if(a===0)return r(...n);if(a===1)return u$1(r,n,o);throw new Error("Wrong number of arguments")}
|
|
22
22
|
|
|
23
23
|
exports.invariant = invariant;
|
|
24
24
|
exports.nonNullable = nonNullable;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tagged, NonEmptyTuple, Simplify, MergeExclusive } from 'type-fest';
|
|
2
|
-
import { N as NonEmptyArray, F as Fqn,
|
|
2
|
+
import { N as NonEmptyArray, F as Fqn, i as ElementKind, r as Tag, o as ElementShape, v as Color, I as IconUrl, k as BorderStyle, S as ShapeSize, E as ExclusiveUnion, p as ElementStyle, q as Link, P as Point, X as XYPoint, T as ThemeColorValues, G as SpacingSize, J as TextSize, M as ThemeColor, m as ElementKindSpecification, t as TypedElement } from './core.QP35c488.js';
|
|
3
3
|
|
|
4
4
|
type EqualOperator<V> = {
|
|
5
5
|
eq: V;
|
|
@@ -93,6 +93,9 @@ interface CustomElementExpr extends Omit<BaseExpr, 'custom'> {
|
|
|
93
93
|
opacity?: number;
|
|
94
94
|
navigateTo?: ViewId;
|
|
95
95
|
multiple?: boolean;
|
|
96
|
+
size?: ShapeSize;
|
|
97
|
+
padding?: ShapeSize;
|
|
98
|
+
textSize?: ShapeSize;
|
|
96
99
|
};
|
|
97
100
|
}
|
|
98
101
|
declare function isCustomElement(expr: Expression): expr is CustomElementExpr;
|
|
@@ -393,6 +396,10 @@ interface ViewRuleGroup {
|
|
|
393
396
|
color?: Color;
|
|
394
397
|
border?: BorderStyle;
|
|
395
398
|
opacity?: number;
|
|
399
|
+
multiple?: boolean;
|
|
400
|
+
size?: ShapeSize;
|
|
401
|
+
padding?: SpacingSize;
|
|
402
|
+
textSize?: TextSize;
|
|
396
403
|
}
|
|
397
404
|
declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
|
|
398
405
|
type ViewRule = ViewRulePredicate | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
|
|
@@ -848,4 +855,4 @@ interface LayoutedLikeC4Model<Fqns extends string = string, DeploymentFqns exten
|
|
|
848
855
|
views: Record<Views, DiagramView<Views, Tags>>;
|
|
849
856
|
}
|
|
850
857
|
|
|
851
|
-
export { type GlobalDynamicPredicates as $, type CustomElementExpr as A, type CustomRelationExpr as B,
|
|
858
|
+
export { type GlobalDynamicPredicates as $, type CustomElementExpr as A, type CustomRelationExpr as B, type ComputedLikeC4Model as C, DeploymentElement as D, type DirectRelationExpr as E, type ElementExpression as F, type ElementKindExpr as G, type ElementPredicateExpression as H, type ElementRefExpr as I, type ElementTagExpr as J, type ElementWhereExpr as K, type LikeC4View as L, type ExpandedElementExpr as M, type Expression as N, type IncomingExpr as O, type PredicateSelector as P, type InOutExpr as Q, type NonWilcard as R, type OutgoingExpr as S, type RelationExpression as T, type RelationPredicateExpression as U, type RelationWhereExpr as V, type WildcardExpr as W, ExpressionV2 as X, FqnExpr as Y, FqnRef as Z, RelationExpr as _, ComputedView as a, type CustomColorDefinitions as a$, type GlobalPredicateId as a0, type GlobalPredicates as a1, type GlobalStyleID as a2, type GlobalStyles as a3, type ModelGlobals as a4, type AnyParsedLikeC4Model as a5, type GenericLikeC4Model as a6, type LayoutedLikeC4Model as a7, type LikeC4ModelDump as a8, type ParsedLikeC4Model as a9, DiagramNode as aA, extractStep as aB, getBBoxCenter as aC, getParallelStepsPrefix as aD, isAutoLayoutDirection as aE, isDeploymentView as aF, isDynamicView as aG, isDynamicViewParallelSteps as aH, isElementView as aI, isExtendsElementView as aJ, isScopedElementView as aK, isStepEdgeId as aL, isViewRuleAutoLayout as aM, isViewRuleGlobalPredicateRef as aN, isViewRuleGlobalStyle as aO, isViewRuleGroup as aP, isViewRulePredicate as aQ, isViewRuleStyle as aR, stepEdgeId as aS, type AutoLayoutDirection as aT, type BasicElementView as aU, type BasicView as aV, type BBox as aW, type ComputedDeploymentView as aX, type ComputedDynamicView as aY, type ComputedEdge as aZ, type ComputedElementView as a_, isAndOperator as aa, isKindEqual as ab, isNotOperator as ac, isOrOperator as ad, isTagEqual as ae, whereOperatorAsPredicate as af, type AndOperator as ag, type EqualOperator as ah, type Filterable as ai, type KindEqual as aj, type NotOperator as ak, type OperatorPredicate as al, type OrOperator as am, type TagEqual as an, type WhereOperator as ao, DefaultArrowType as ap, DefaultLineStyle as aq, DefaultRelationshipColor as ar, type AbstractRelation as as, type ModelRelation as at, type RelationId as au, type RelationshipArrowType as av, type RelationshipKind as aw, type RelationshipKindSpecification as ax, type RelationshipLineType as ay, ComputedNode as az, type DeployedInstance as b, type DeploymentView as b0, type DeploymentViewRule as b1, type DeploymentViewRulePredicate as b2, type DeploymentViewRuleStyle as b3, type DiagramEdge as b4, type DiagramView as b5, type DynamicView as b6, type DynamicViewIncludeRule as b7, type DynamicViewParallelSteps as b8, type DynamicViewRule as b9, type DynamicViewStep as ba, type DynamicViewStepOrParallel as bb, type EdgeId as bc, type ElementView as bd, type ExtendsElementView as be, type NodeId as bf, type ScopedElementView as bg, type StepEdgeId as bh, type StepEdgeIdLiteral as bi, type ViewAutoLayout as bj, type ViewId as bk, type ViewManualLayout as bl, type ViewRule as bm, type ViewRuleAutoLayout as bn, type ViewRuleGlobalPredicateRef as bo, type ViewRuleGlobalStyle as bp, type ViewRuleGroup as bq, type ViewRulePredicate as br, type ViewRuleStyle as bs, type ViewRuleStyleOrGlobalRef as bt, type ViewWithHash as bu, type ViewWithNotation as bv, type ElementNotation as bw, type Participant as bx, type DeploymentElementStyle as c, type DeploymentNode as d, expression as e, type DeploymentNodeKind as f, type DeploymentNodeKindSpecification as g, type DeploymentRef as h, type DeploymentRelation as i, isCustomElement as j, isCustomRelationExpr as k, isElement as l, isElementKindExpr as m, isElementPredicateExpr as n, isElementRef as o, isElementTagExpr as p, isElementWhere as q, isExpandedElementExpr as r, isIncoming as s, isInOut as t, isOutgoing as u, isRelation as v, isRelationExpression as w, isRelationPredicateExpr as x, isRelationWhere as y, isWildcard as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LikeC4Model, E as ElementModel, R as RelationshipModel } from './core.
|
|
2
|
-
import { F as Fqn } from './core.
|
|
1
|
+
import { L as LikeC4Model, E as ElementModel, R as RelationshipModel } from './core.5Z5cpENq.mjs';
|
|
2
|
+
import { F as Fqn } from './core.QP35c488.mjs';
|
|
3
3
|
|
|
4
4
|
declare function computeRelationshipsView(subjectId: Fqn, likec4model: LikeC4Model): {
|
|
5
5
|
incomers: Set<ElementModel<LikeC4Model.Any>>;
|
|
@@ -5,6 +5,12 @@ type ThemeColor = typeof ThemeColors[number];
|
|
|
5
5
|
type HexColorLiteral = `#${string}`;
|
|
6
6
|
type ColorLiteral = HexColorLiteral;
|
|
7
7
|
type Color = LiteralUnion<ThemeColor, string>;
|
|
8
|
+
type ShapeSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
/**
|
|
10
|
+
* For padding, margin, etc.
|
|
11
|
+
*/
|
|
12
|
+
type SpacingSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
14
|
declare function isThemeColor(color: Color): color is ThemeColor;
|
|
9
15
|
interface ElementThemeColorValues {
|
|
10
16
|
fill: ColorLiteral;
|
|
@@ -32,6 +38,18 @@ interface LikeC4Theme {
|
|
|
32
38
|
shadow: ColorLiteral;
|
|
33
39
|
relationships: RelationshipThemeColors;
|
|
34
40
|
elements: ElementThemeColors;
|
|
41
|
+
sizes: {
|
|
42
|
+
[key in ShapeSize]: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
spacing: {
|
|
48
|
+
[key in SpacingSize]: number;
|
|
49
|
+
};
|
|
50
|
+
textSizes: {
|
|
51
|
+
[key in TextSize]: number;
|
|
52
|
+
};
|
|
35
53
|
}
|
|
36
54
|
|
|
37
55
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
@@ -96,6 +114,9 @@ declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile
|
|
|
96
114
|
type ElementShape = TupleToUnion<typeof ElementShapes>;
|
|
97
115
|
declare const DefaultThemeColor: ThemeColor;
|
|
98
116
|
declare const DefaultElementShape: ElementShape;
|
|
117
|
+
declare const DefaultShapeSize: ShapeSize;
|
|
118
|
+
declare const DefaultPaddingSize: SpacingSize;
|
|
119
|
+
declare const DefaultTextSize: TextSize;
|
|
99
120
|
interface ElementStyle {
|
|
100
121
|
readonly border?: BorderStyle;
|
|
101
122
|
/**
|
|
@@ -109,6 +130,14 @@ interface ElementStyle {
|
|
|
109
130
|
* @default false
|
|
110
131
|
*/
|
|
111
132
|
readonly multiple?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Shape size
|
|
135
|
+
*
|
|
136
|
+
* @default 'md'
|
|
137
|
+
*/
|
|
138
|
+
readonly size?: ShapeSize;
|
|
139
|
+
readonly padding?: SpacingSize;
|
|
140
|
+
readonly textSize?: TextSize;
|
|
112
141
|
}
|
|
113
142
|
type Tag<Tags extends string = string> = Tagged<Tags, 'Tag'>;
|
|
114
143
|
interface TagSpec {
|
|
@@ -143,6 +172,9 @@ interface ElementKindSpecificationStyle {
|
|
|
143
172
|
color?: Color;
|
|
144
173
|
border?: BorderStyle;
|
|
145
174
|
opacity?: number;
|
|
175
|
+
size?: ShapeSize;
|
|
176
|
+
padding?: SpacingSize;
|
|
177
|
+
textSize?: TextSize;
|
|
146
178
|
}
|
|
147
179
|
interface ElementKindSpecification {
|
|
148
180
|
readonly technology?: string;
|
|
@@ -150,4 +182,4 @@ interface ElementKindSpecification {
|
|
|
150
182
|
readonly style: ElementKindSpecificationStyle;
|
|
151
183
|
}
|
|
152
184
|
|
|
153
|
-
export { AsFqn as A, BorderStyles as B, type CustomColor as C, DefaultElementShape as D, type ExclusiveUnion as E, type Fqn as F, type HexColorLiteral as H, type IconUrl as I, type KeysOf as K, type LikeC4Theme as L, type NonEmptyArray as N, type Point as P, type RelationshipThemeColors as R, type ThemeColorValues as T, type XYPoint as X, type IteratorLike as a, type NonEmptyReadonlyArray as b, type NTuple as c, type Predicate as d,
|
|
185
|
+
export { AsFqn as A, BorderStyles as B, type CustomColor as C, DefaultElementShape as D, type ExclusiveUnion as E, type Fqn as F, type SpacingSize as G, type HexColorLiteral as H, type IconUrl as I, type TextSize as J, type KeysOf as K, type LikeC4Theme as L, type ThemeColor as M, type NonEmptyArray as N, type Point as P, type RelationshipThemeColors as R, type ShapeSize as S, type ThemeColorValues as T, type XYPoint as X, type IteratorLike as a, type NonEmptyReadonlyArray as b, type NTuple as c, type Predicate as d, DefaultPaddingSize as e, DefaultShapeSize as f, DefaultTextSize as g, DefaultThemeColor as h, ElementKind as i, ElementShapes as j, type BorderStyle as k, type Element as l, type ElementKindSpecification as m, type ElementKindSpecificationStyle as n, type ElementShape as o, type ElementStyle as p, type Link as q, type Tag as r, type TagSpec as s, type TypedElement as t, isThemeColor as u, type Color as v, type ColorLiteral as w, type ElementThemeColors as x, type ElementThemeColorValues as y, type RelationshipThemeColorValues as z };
|
|
@@ -5,6 +5,12 @@ type ThemeColor = typeof ThemeColors[number];
|
|
|
5
5
|
type HexColorLiteral = `#${string}`;
|
|
6
6
|
type ColorLiteral = HexColorLiteral;
|
|
7
7
|
type Color = LiteralUnion<ThemeColor, string>;
|
|
8
|
+
type ShapeSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
/**
|
|
10
|
+
* For padding, margin, etc.
|
|
11
|
+
*/
|
|
12
|
+
type SpacingSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
14
|
declare function isThemeColor(color: Color): color is ThemeColor;
|
|
9
15
|
interface ElementThemeColorValues {
|
|
10
16
|
fill: ColorLiteral;
|
|
@@ -32,6 +38,18 @@ interface LikeC4Theme {
|
|
|
32
38
|
shadow: ColorLiteral;
|
|
33
39
|
relationships: RelationshipThemeColors;
|
|
34
40
|
elements: ElementThemeColors;
|
|
41
|
+
sizes: {
|
|
42
|
+
[key in ShapeSize]: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
spacing: {
|
|
48
|
+
[key in SpacingSize]: number;
|
|
49
|
+
};
|
|
50
|
+
textSizes: {
|
|
51
|
+
[key in TextSize]: number;
|
|
52
|
+
};
|
|
35
53
|
}
|
|
36
54
|
|
|
37
55
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
@@ -96,6 +114,9 @@ declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile
|
|
|
96
114
|
type ElementShape = TupleToUnion<typeof ElementShapes>;
|
|
97
115
|
declare const DefaultThemeColor: ThemeColor;
|
|
98
116
|
declare const DefaultElementShape: ElementShape;
|
|
117
|
+
declare const DefaultShapeSize: ShapeSize;
|
|
118
|
+
declare const DefaultPaddingSize: SpacingSize;
|
|
119
|
+
declare const DefaultTextSize: TextSize;
|
|
99
120
|
interface ElementStyle {
|
|
100
121
|
readonly border?: BorderStyle;
|
|
101
122
|
/**
|
|
@@ -109,6 +130,14 @@ interface ElementStyle {
|
|
|
109
130
|
* @default false
|
|
110
131
|
*/
|
|
111
132
|
readonly multiple?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Shape size
|
|
135
|
+
*
|
|
136
|
+
* @default 'md'
|
|
137
|
+
*/
|
|
138
|
+
readonly size?: ShapeSize;
|
|
139
|
+
readonly padding?: SpacingSize;
|
|
140
|
+
readonly textSize?: TextSize;
|
|
112
141
|
}
|
|
113
142
|
type Tag<Tags extends string = string> = Tagged<Tags, 'Tag'>;
|
|
114
143
|
interface TagSpec {
|
|
@@ -143,6 +172,9 @@ interface ElementKindSpecificationStyle {
|
|
|
143
172
|
color?: Color;
|
|
144
173
|
border?: BorderStyle;
|
|
145
174
|
opacity?: number;
|
|
175
|
+
size?: ShapeSize;
|
|
176
|
+
padding?: SpacingSize;
|
|
177
|
+
textSize?: TextSize;
|
|
146
178
|
}
|
|
147
179
|
interface ElementKindSpecification {
|
|
148
180
|
readonly technology?: string;
|
|
@@ -150,4 +182,4 @@ interface ElementKindSpecification {
|
|
|
150
182
|
readonly style: ElementKindSpecificationStyle;
|
|
151
183
|
}
|
|
152
184
|
|
|
153
|
-
export { AsFqn as A, BorderStyles as B, type CustomColor as C, DefaultElementShape as D, type ExclusiveUnion as E, type Fqn as F, type HexColorLiteral as H, type IconUrl as I, type KeysOf as K, type LikeC4Theme as L, type NonEmptyArray as N, type Point as P, type RelationshipThemeColors as R, type ThemeColorValues as T, type XYPoint as X, type IteratorLike as a, type NonEmptyReadonlyArray as b, type NTuple as c, type Predicate as d,
|
|
185
|
+
export { AsFqn as A, BorderStyles as B, type CustomColor as C, DefaultElementShape as D, type ExclusiveUnion as E, type Fqn as F, type SpacingSize as G, type HexColorLiteral as H, type IconUrl as I, type TextSize as J, type KeysOf as K, type LikeC4Theme as L, type ThemeColor as M, type NonEmptyArray as N, type Point as P, type RelationshipThemeColors as R, type ShapeSize as S, type ThemeColorValues as T, type XYPoint as X, type IteratorLike as a, type NonEmptyReadonlyArray as b, type NTuple as c, type Predicate as d, DefaultPaddingSize as e, DefaultShapeSize as f, DefaultTextSize as g, DefaultThemeColor as h, ElementKind as i, ElementShapes as j, type BorderStyle as k, type Element as l, type ElementKindSpecification as m, type ElementKindSpecificationStyle as n, type ElementShape as o, type ElementStyle as p, type Link as q, type Tag as r, type TagSpec as s, type TypedElement as t, isThemeColor as u, type Color as v, type ColorLiteral as w, type ElementThemeColors as x, type ElementThemeColorValues as y, type RelationshipThemeColorValues as z };
|
|
@@ -5,6 +5,12 @@ type ThemeColor = typeof ThemeColors[number];
|
|
|
5
5
|
type HexColorLiteral = `#${string}`;
|
|
6
6
|
type ColorLiteral = HexColorLiteral;
|
|
7
7
|
type Color = LiteralUnion<ThemeColor, string>;
|
|
8
|
+
type ShapeSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
/**
|
|
10
|
+
* For padding, margin, etc.
|
|
11
|
+
*/
|
|
12
|
+
type SpacingSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
type TextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
14
|
declare function isThemeColor(color: Color): color is ThemeColor;
|
|
9
15
|
interface ElementThemeColorValues {
|
|
10
16
|
fill: ColorLiteral;
|
|
@@ -32,6 +38,18 @@ interface LikeC4Theme {
|
|
|
32
38
|
shadow: ColorLiteral;
|
|
33
39
|
relationships: RelationshipThemeColors;
|
|
34
40
|
elements: ElementThemeColors;
|
|
41
|
+
sizes: {
|
|
42
|
+
[key in ShapeSize]: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
spacing: {
|
|
48
|
+
[key in SpacingSize]: number;
|
|
49
|
+
};
|
|
50
|
+
textSizes: {
|
|
51
|
+
[key in TextSize]: number;
|
|
52
|
+
};
|
|
35
53
|
}
|
|
36
54
|
|
|
37
55
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
@@ -96,6 +114,9 @@ declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile
|
|
|
96
114
|
type ElementShape = TupleToUnion<typeof ElementShapes>;
|
|
97
115
|
declare const DefaultThemeColor: ThemeColor;
|
|
98
116
|
declare const DefaultElementShape: ElementShape;
|
|
117
|
+
declare const DefaultShapeSize: ShapeSize;
|
|
118
|
+
declare const DefaultPaddingSize: SpacingSize;
|
|
119
|
+
declare const DefaultTextSize: TextSize;
|
|
99
120
|
interface ElementStyle {
|
|
100
121
|
readonly border?: BorderStyle;
|
|
101
122
|
/**
|
|
@@ -109,6 +130,14 @@ interface ElementStyle {
|
|
|
109
130
|
* @default false
|
|
110
131
|
*/
|
|
111
132
|
readonly multiple?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Shape size
|
|
135
|
+
*
|
|
136
|
+
* @default 'md'
|
|
137
|
+
*/
|
|
138
|
+
readonly size?: ShapeSize;
|
|
139
|
+
readonly padding?: SpacingSize;
|
|
140
|
+
readonly textSize?: TextSize;
|
|
112
141
|
}
|
|
113
142
|
type Tag<Tags extends string = string> = Tagged<Tags, 'Tag'>;
|
|
114
143
|
interface TagSpec {
|
|
@@ -143,6 +172,9 @@ interface ElementKindSpecificationStyle {
|
|
|
143
172
|
color?: Color;
|
|
144
173
|
border?: BorderStyle;
|
|
145
174
|
opacity?: number;
|
|
175
|
+
size?: ShapeSize;
|
|
176
|
+
padding?: SpacingSize;
|
|
177
|
+
textSize?: TextSize;
|
|
146
178
|
}
|
|
147
179
|
interface ElementKindSpecification {
|
|
148
180
|
readonly technology?: string;
|
|
@@ -150,4 +182,4 @@ interface ElementKindSpecification {
|
|
|
150
182
|
readonly style: ElementKindSpecificationStyle;
|
|
151
183
|
}
|
|
152
184
|
|
|
153
|
-
export { AsFqn as A, BorderStyles as B, type CustomColor as C, DefaultElementShape as D, type ExclusiveUnion as E, type Fqn as F, type HexColorLiteral as H, type IconUrl as I, type KeysOf as K, type LikeC4Theme as L, type NonEmptyArray as N, type Point as P, type RelationshipThemeColors as R, type ThemeColorValues as T, type XYPoint as X, type IteratorLike as a, type NonEmptyReadonlyArray as b, type NTuple as c, type Predicate as d,
|
|
185
|
+
export { AsFqn as A, BorderStyles as B, type CustomColor as C, DefaultElementShape as D, type ExclusiveUnion as E, type Fqn as F, type SpacingSize as G, type HexColorLiteral as H, type IconUrl as I, type TextSize as J, type KeysOf as K, type LikeC4Theme as L, type ThemeColor as M, type NonEmptyArray as N, type Point as P, type RelationshipThemeColors as R, type ShapeSize as S, type ThemeColorValues as T, type XYPoint as X, type IteratorLike as a, type NonEmptyReadonlyArray as b, type NTuple as c, type Predicate as d, DefaultPaddingSize as e, DefaultShapeSize as f, DefaultTextSize as g, DefaultThemeColor as h, ElementKind as i, ElementShapes as j, type BorderStyle as k, type Element as l, type ElementKindSpecification as m, type ElementKindSpecificationStyle as n, type ElementShape as o, type ElementStyle as p, type Link as q, type Tag as r, type TagSpec as s, type TypedElement as t, isThemeColor as u, type Color as v, type ColorLiteral as w, type ElementThemeColors as x, type ElementThemeColorValues as y, type RelationshipThemeColorValues as z };
|
package/dist/types/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const view = require('../shared/core.
|
|
3
|
+
const view = require('../shared/core.CAkSSvJ6.cjs');
|
|
4
4
|
|
|
5
5
|
const ThemeColors = [
|
|
6
6
|
"amber",
|
|
@@ -32,7 +32,10 @@ Object.defineProperty(exports, "ComputedView", {
|
|
|
32
32
|
exports.DefaultArrowType = view.DefaultArrowType;
|
|
33
33
|
exports.DefaultElementShape = view.DefaultElementShape;
|
|
34
34
|
exports.DefaultLineStyle = view.DefaultLineStyle;
|
|
35
|
+
exports.DefaultPaddingSize = view.DefaultPaddingSize;
|
|
35
36
|
exports.DefaultRelationshipColor = view.DefaultRelationshipColor;
|
|
37
|
+
exports.DefaultShapeSize = view.DefaultShapeSize;
|
|
38
|
+
exports.DefaultTextSize = view.DefaultTextSize;
|
|
36
39
|
exports.DefaultThemeColor = view.DefaultThemeColor;
|
|
37
40
|
Object.defineProperty(exports, "DeploymentElement", {
|
|
38
41
|
enumerable: true,
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { X as XYPoint, N as NonEmptyArray, P as Point,
|
|
2
|
-
export { A as AsFqn, B as BorderStyles,
|
|
3
|
-
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.
|
|
4
|
-
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView,
|
|
1
|
+
import { X as XYPoint, N as NonEmptyArray, P as Point, k as BorderStyle, o as ElementShape, M as ThemeColor, F as Fqn } from '../shared/core.QP35c488.cjs';
|
|
2
|
+
export { A as AsFqn, B as BorderStyles, v as Color, w as ColorLiteral, C as CustomColor, D as DefaultElementShape, e as DefaultPaddingSize, f as DefaultShapeSize, g as DefaultTextSize, h as DefaultThemeColor, l as Element, i as ElementKind, m as ElementKindSpecification, n as ElementKindSpecificationStyle, j as ElementShapes, p as ElementStyle, y as ElementThemeColorValues, x as ElementThemeColors, E as ExclusiveUnion, H as HexColorLiteral, I as IconUrl, a as IteratorLike, K as KeysOf, L as LikeC4Theme, q as Link, c as NTuple, b as NonEmptyReadonlyArray, d as Predicate, z as RelationshipThemeColorValues, R as RelationshipThemeColors, S as ShapeSize, G as SpacingSize, r as Tag, s as TagSpec, J as TextSize, T as ThemeColorValues, t as TypedElement, u as isThemeColor } from '../shared/core.QP35c488.cjs';
|
|
3
|
+
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.BS_nXBsP.cjs';
|
|
4
|
+
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, C as ComputedLikeC4Model, az as ComputedNode, a as ComputedView, a$ as CustomColorDefinitions, A as CustomElementExpr, B as CustomRelationExpr, ap as DefaultArrowType, aq as DefaultLineStyle, ar as DefaultRelationshipColor, b as DeployedInstance, D as DeploymentElement, c as DeploymentElementStyle, d as DeploymentNode, f as DeploymentNodeKind, g as DeploymentNodeKindSpecification, h as DeploymentRef, i as DeploymentRelation, b0 as DeploymentView, b1 as DeploymentViewRule, b2 as DeploymentViewRulePredicate, b3 as DeploymentViewRuleStyle, b4 as DiagramEdge, aA as DiagramNode, b5 as DiagramView, E as DirectRelationExpr, b6 as DynamicView, b7 as DynamicViewIncludeRule, b8 as DynamicViewParallelSteps, b9 as DynamicViewRule, ba as DynamicViewStep, bb as DynamicViewStepOrParallel, bc as EdgeId, F as ElementExpression, G as ElementKindExpr, bw as ElementNotation, H as ElementPredicateExpression, I as ElementRefExpr, J as ElementTagExpr, bd as ElementView, K as ElementWhereExpr, ah as EqualOperator, M as ExpandedElementExpr, N as Expression, X as ExpressionV2, be as ExtendsElementView, ai as Filterable, Y as FqnExpr, Z as FqnRef, a6 as GenericLikeC4Model, $ as GlobalDynamicPredicates, a0 as GlobalPredicateId, a1 as GlobalPredicates, a2 as GlobalStyleID, a3 as GlobalStyles, Q as InOutExpr, O as IncomingExpr, aj as KindEqual, a7 as LayoutedLikeC4Model, a8 as LikeC4ModelDump, L as LikeC4View, a4 as ModelGlobals, at as ModelRelation, bf as NodeId, R as NonWilcard, ak as NotOperator, al as OperatorPredicate, am as OrOperator, S as OutgoingExpr, a9 as ParsedLikeC4Model, P as PredicateSelector, _ as RelationExpr, T as RelationExpression, au as RelationId, U as RelationPredicateExpression, V as RelationWhereExpr, av as RelationshipArrowType, aw as RelationshipKind, ax as RelationshipKindSpecification, ay as RelationshipLineType, bg as ScopedElementView, bh as StepEdgeId, bi as StepEdgeIdLiteral, an as TagEqual, bj as ViewAutoLayout, bm as ViewRule, bn as ViewRuleAutoLayout, bo as ViewRuleGlobalPredicateRef, bp as ViewRuleGlobalStyle, bq as ViewRuleGroup, br as ViewRulePredicate, bs as ViewRuleStyle, bt as ViewRuleStyleOrGlobalRef, bu as ViewWithHash, bv as ViewWithNotation, ao as WhereOperator, W as WildcardExpr, aB as extractStep, aC as getBBoxCenter, aD as getParallelStepsPrefix, aa as isAndOperator, aE as isAutoLayoutDirection, j as isCustomElement, k as isCustomRelationExpr, aF as isDeploymentView, aG as isDynamicView, aH as isDynamicViewParallelSteps, l as isElement, m as isElementKindExpr, n as isElementPredicateExpr, o as isElementRef, p as isElementTagExpr, aI as isElementView, q as isElementWhere, r as isExpandedElementExpr, aJ as isExtendsElementView, t as isInOut, s as isIncoming, ab as isKindEqual, ac as isNotOperator, ad as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, aK as isScopedElementView, aL as isStepEdgeId, ae as isTagEqual, aM as isViewRuleAutoLayout, aN as isViewRuleGlobalPredicateRef, aO as isViewRuleGlobalStyle, aP as isViewRuleGroup, aQ as isViewRulePredicate, aR as isViewRuleStyle, z as isWildcard, aS as stepEdgeId, af as whereOperatorAsPredicate } from '../shared/core.BS_nXBsP.cjs';
|
|
5
5
|
import 'type-fest';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { X as XYPoint, N as NonEmptyArray, P as Point,
|
|
2
|
-
export { A as AsFqn, B as BorderStyles,
|
|
3
|
-
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.
|
|
4
|
-
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView,
|
|
1
|
+
import { X as XYPoint, N as NonEmptyArray, P as Point, k as BorderStyle, o as ElementShape, M as ThemeColor, F as Fqn } from '../shared/core.QP35c488.mjs';
|
|
2
|
+
export { A as AsFqn, B as BorderStyles, v as Color, w as ColorLiteral, C as CustomColor, D as DefaultElementShape, e as DefaultPaddingSize, f as DefaultShapeSize, g as DefaultTextSize, h as DefaultThemeColor, l as Element, i as ElementKind, m as ElementKindSpecification, n as ElementKindSpecificationStyle, j as ElementShapes, p as ElementStyle, y as ElementThemeColorValues, x as ElementThemeColors, E as ExclusiveUnion, H as HexColorLiteral, I as IconUrl, a as IteratorLike, K as KeysOf, L as LikeC4Theme, q as Link, c as NTuple, b as NonEmptyReadonlyArray, d as Predicate, z as RelationshipThemeColorValues, R as RelationshipThemeColors, S as ShapeSize, G as SpacingSize, r as Tag, s as TagSpec, J as TextSize, T as ThemeColorValues, t as TypedElement, u as isThemeColor } from '../shared/core.QP35c488.mjs';
|
|
3
|
+
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.CJaCUZQ9.mjs';
|
|
4
|
+
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, C as ComputedLikeC4Model, az as ComputedNode, a as ComputedView, a$ as CustomColorDefinitions, A as CustomElementExpr, B as CustomRelationExpr, ap as DefaultArrowType, aq as DefaultLineStyle, ar as DefaultRelationshipColor, b as DeployedInstance, D as DeploymentElement, c as DeploymentElementStyle, d as DeploymentNode, f as DeploymentNodeKind, g as DeploymentNodeKindSpecification, h as DeploymentRef, i as DeploymentRelation, b0 as DeploymentView, b1 as DeploymentViewRule, b2 as DeploymentViewRulePredicate, b3 as DeploymentViewRuleStyle, b4 as DiagramEdge, aA as DiagramNode, b5 as DiagramView, E as DirectRelationExpr, b6 as DynamicView, b7 as DynamicViewIncludeRule, b8 as DynamicViewParallelSteps, b9 as DynamicViewRule, ba as DynamicViewStep, bb as DynamicViewStepOrParallel, bc as EdgeId, F as ElementExpression, G as ElementKindExpr, bw as ElementNotation, H as ElementPredicateExpression, I as ElementRefExpr, J as ElementTagExpr, bd as ElementView, K as ElementWhereExpr, ah as EqualOperator, M as ExpandedElementExpr, N as Expression, X as ExpressionV2, be as ExtendsElementView, ai as Filterable, Y as FqnExpr, Z as FqnRef, a6 as GenericLikeC4Model, $ as GlobalDynamicPredicates, a0 as GlobalPredicateId, a1 as GlobalPredicates, a2 as GlobalStyleID, a3 as GlobalStyles, Q as InOutExpr, O as IncomingExpr, aj as KindEqual, a7 as LayoutedLikeC4Model, a8 as LikeC4ModelDump, L as LikeC4View, a4 as ModelGlobals, at as ModelRelation, bf as NodeId, R as NonWilcard, ak as NotOperator, al as OperatorPredicate, am as OrOperator, S as OutgoingExpr, a9 as ParsedLikeC4Model, P as PredicateSelector, _ as RelationExpr, T as RelationExpression, au as RelationId, U as RelationPredicateExpression, V as RelationWhereExpr, av as RelationshipArrowType, aw as RelationshipKind, ax as RelationshipKindSpecification, ay as RelationshipLineType, bg as ScopedElementView, bh as StepEdgeId, bi as StepEdgeIdLiteral, an as TagEqual, bj as ViewAutoLayout, bm as ViewRule, bn as ViewRuleAutoLayout, bo as ViewRuleGlobalPredicateRef, bp as ViewRuleGlobalStyle, bq as ViewRuleGroup, br as ViewRulePredicate, bs as ViewRuleStyle, bt as ViewRuleStyleOrGlobalRef, bu as ViewWithHash, bv as ViewWithNotation, ao as WhereOperator, W as WildcardExpr, aB as extractStep, aC as getBBoxCenter, aD as getParallelStepsPrefix, aa as isAndOperator, aE as isAutoLayoutDirection, j as isCustomElement, k as isCustomRelationExpr, aF as isDeploymentView, aG as isDynamicView, aH as isDynamicViewParallelSteps, l as isElement, m as isElementKindExpr, n as isElementPredicateExpr, o as isElementRef, p as isElementTagExpr, aI as isElementView, q as isElementWhere, r as isExpandedElementExpr, aJ as isExtendsElementView, t as isInOut, s as isIncoming, ab as isKindEqual, ac as isNotOperator, ad as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, aK as isScopedElementView, aL as isStepEdgeId, ae as isTagEqual, aM as isViewRuleAutoLayout, aN as isViewRuleGlobalPredicateRef, aO as isViewRuleGlobalStyle, aP as isViewRuleGroup, aQ as isViewRulePredicate, aR as isViewRuleStyle, z as isWildcard, aS as stepEdgeId, af as whereOperatorAsPredicate } from '../shared/core.CJaCUZQ9.mjs';
|
|
5
5
|
import 'type-fest';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { X as XYPoint, N as NonEmptyArray, P as Point,
|
|
2
|
-
export { A as AsFqn, B as BorderStyles,
|
|
3
|
-
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.
|
|
4
|
-
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView,
|
|
1
|
+
import { X as XYPoint, N as NonEmptyArray, P as Point, k as BorderStyle, o as ElementShape, M as ThemeColor, F as Fqn } from '../shared/core.QP35c488.js';
|
|
2
|
+
export { A as AsFqn, B as BorderStyles, v as Color, w as ColorLiteral, C as CustomColor, D as DefaultElementShape, e as DefaultPaddingSize, f as DefaultShapeSize, g as DefaultTextSize, h as DefaultThemeColor, l as Element, i as ElementKind, m as ElementKindSpecification, n as ElementKindSpecificationStyle, j as ElementShapes, p as ElementStyle, y as ElementThemeColorValues, x as ElementThemeColors, E as ExclusiveUnion, H as HexColorLiteral, I as IconUrl, a as IteratorLike, K as KeysOf, L as LikeC4Theme, q as Link, c as NTuple, b as NonEmptyReadonlyArray, d as Predicate, z as RelationshipThemeColorValues, R as RelationshipThemeColors, S as ShapeSize, G as SpacingSize, r as Tag, s as TagSpec, J as TextSize, T as ThemeColorValues, t as TypedElement, u as isThemeColor } from '../shared/core.QP35c488.js';
|
|
3
|
+
import { bk as ViewId, aW as BBox, bl as ViewManualLayout, aT as AutoLayoutDirection } from '../shared/core.DsDq-blc.js';
|
|
4
|
+
export { as as AbstractRelation, ag as AndOperator, a5 as AnyParsedLikeC4Model, aU as BasicElementView, aV as BasicView, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, C as ComputedLikeC4Model, az as ComputedNode, a as ComputedView, a$ as CustomColorDefinitions, A as CustomElementExpr, B as CustomRelationExpr, ap as DefaultArrowType, aq as DefaultLineStyle, ar as DefaultRelationshipColor, b as DeployedInstance, D as DeploymentElement, c as DeploymentElementStyle, d as DeploymentNode, f as DeploymentNodeKind, g as DeploymentNodeKindSpecification, h as DeploymentRef, i as DeploymentRelation, b0 as DeploymentView, b1 as DeploymentViewRule, b2 as DeploymentViewRulePredicate, b3 as DeploymentViewRuleStyle, b4 as DiagramEdge, aA as DiagramNode, b5 as DiagramView, E as DirectRelationExpr, b6 as DynamicView, b7 as DynamicViewIncludeRule, b8 as DynamicViewParallelSteps, b9 as DynamicViewRule, ba as DynamicViewStep, bb as DynamicViewStepOrParallel, bc as EdgeId, F as ElementExpression, G as ElementKindExpr, bw as ElementNotation, H as ElementPredicateExpression, I as ElementRefExpr, J as ElementTagExpr, bd as ElementView, K as ElementWhereExpr, ah as EqualOperator, M as ExpandedElementExpr, N as Expression, X as ExpressionV2, be as ExtendsElementView, ai as Filterable, Y as FqnExpr, Z as FqnRef, a6 as GenericLikeC4Model, $ as GlobalDynamicPredicates, a0 as GlobalPredicateId, a1 as GlobalPredicates, a2 as GlobalStyleID, a3 as GlobalStyles, Q as InOutExpr, O as IncomingExpr, aj as KindEqual, a7 as LayoutedLikeC4Model, a8 as LikeC4ModelDump, L as LikeC4View, a4 as ModelGlobals, at as ModelRelation, bf as NodeId, R as NonWilcard, ak as NotOperator, al as OperatorPredicate, am as OrOperator, S as OutgoingExpr, a9 as ParsedLikeC4Model, P as PredicateSelector, _ as RelationExpr, T as RelationExpression, au as RelationId, U as RelationPredicateExpression, V as RelationWhereExpr, av as RelationshipArrowType, aw as RelationshipKind, ax as RelationshipKindSpecification, ay as RelationshipLineType, bg as ScopedElementView, bh as StepEdgeId, bi as StepEdgeIdLiteral, an as TagEqual, bj as ViewAutoLayout, bm as ViewRule, bn as ViewRuleAutoLayout, bo as ViewRuleGlobalPredicateRef, bp as ViewRuleGlobalStyle, bq as ViewRuleGroup, br as ViewRulePredicate, bs as ViewRuleStyle, bt as ViewRuleStyleOrGlobalRef, bu as ViewWithHash, bv as ViewWithNotation, ao as WhereOperator, W as WildcardExpr, aB as extractStep, aC as getBBoxCenter, aD as getParallelStepsPrefix, aa as isAndOperator, aE as isAutoLayoutDirection, j as isCustomElement, k as isCustomRelationExpr, aF as isDeploymentView, aG as isDynamicView, aH as isDynamicViewParallelSteps, l as isElement, m as isElementKindExpr, n as isElementPredicateExpr, o as isElementRef, p as isElementTagExpr, aI as isElementView, q as isElementWhere, r as isExpandedElementExpr, aJ as isExtendsElementView, t as isInOut, s as isIncoming, ab as isKindEqual, ac as isNotOperator, ad as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, aK as isScopedElementView, aL as isStepEdgeId, ae as isTagEqual, aM as isViewRuleAutoLayout, aN as isViewRuleGlobalPredicateRef, aO as isViewRuleGlobalStyle, aP as isViewRuleGroup, aQ as isViewRulePredicate, aR as isViewRuleStyle, z as isWildcard, aS as stepEdgeId, af as whereOperatorAsPredicate } from '../shared/core.DsDq-blc.js';
|
|
5
5
|
import 'type-fest';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AsFqn, B as BorderStyles,
|
|
1
|
+
export { A as AsFqn, B as BorderStyles, U as ComputedNode, V as ComputedView, Q as DefaultArrowType, d as DefaultElementShape, S as DefaultLineStyle, g as DefaultPaddingSize, T as DefaultRelationshipColor, h as DefaultShapeSize, j as DefaultTextSize, e as DefaultThemeColor, D as DeploymentElement, W as DiagramNode, E as ElementKind, k as ElementShapes, H as ExpressionV2, I as FqnExpr, J as FqnRef, R as RelationExpr, X as extractStep, Y as getBBoxCenter, Z as getParallelStepsPrefix, K as isAndOperator, _ as isAutoLayoutDirection, l as isCustomElement, m as isCustomRelationExpr, $ as isDeploymentView, a0 as isDynamicView, a1 as isDynamicViewParallelSteps, p as isElement, q as isElementKindExpr, b as isElementPredicateExpr, r as isElementRef, s as isElementTagExpr, a as isElementView, t as isElementWhere, u as isExpandedElementExpr, i as isExtendsElementView, w as isInOut, v as isIncoming, L as isKindEqual, M as isNotOperator, N as isOrOperator, x as isOutgoing, y as isRelation, z as isRelationExpression, C as isRelationPredicateExpr, F as isRelationWhere, c as isScopedElementView, a2 as isStepEdgeId, O as isTagEqual, a3 as isViewRuleAutoLayout, a4 as isViewRuleGlobalPredicateRef, a5 as isViewRuleGlobalStyle, a6 as isViewRuleGroup, a7 as isViewRulePredicate, a8 as isViewRuleStyle, G as isWildcard, a9 as stepEdgeId, P as whereOperatorAsPredicate } from '../shared/core.CYNYaH2U.mjs';
|
|
2
2
|
|
|
3
3
|
const ThemeColors = [
|
|
4
4
|
"amber",
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const object_hash = require('../shared/core.
|
|
4
|
-
const
|
|
3
|
+
const object_hash = require('../shared/core.BjR0D3IO.cjs');
|
|
4
|
+
const chunkWIMGWYZL = require('../shared/core.DqQrj2oQ.cjs');
|
|
5
5
|
|
|
6
6
|
function o(r,n){let e=Math.ceil(r),t=Math.floor(n);if(t<e)throw new RangeError(`randomInteger: The range [${r.toString()},${n.toString()}] contains no integer`);return Math.floor(Math.random()*(t-e+1)+e)}
|
|
7
7
|
|
|
8
8
|
function ireduce(arg1, arg2, arg3) {
|
|
9
9
|
const reducer = object_hash.n(arg3) ? arg2 : arg1;
|
|
10
10
|
const initialValue = arg3 ?? arg2;
|
|
11
|
-
|
|
11
|
+
chunkWIMGWYZL.invariant(object_hash.t$1(reducer));
|
|
12
12
|
function _reduce(iter) {
|
|
13
13
|
let acc = initialValue;
|
|
14
14
|
for (const value of iter) {
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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.
|
|
2
|
-
import { N as NonEmptyArray, a as IteratorLike } from '../shared/core.
|
|
1
|
+
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.BYs5deiY.cjs';
|
|
2
|
+
import { N as NonEmptyArray, a as IteratorLike } from '../shared/core.QP35c488.cjs';
|
|
3
3
|
export { default as objectHash } from '/home/runner/work/likec4/likec4/node_modules/@types/object-hash/index.d.ts';
|
|
4
4
|
import { IsNumericLiteral } from 'type-fest';
|
|
5
5
|
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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.
|
|
2
|
-
import { N as NonEmptyArray, a as IteratorLike } from '../shared/core.
|
|
1
|
+
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.D0KD4FiT.mjs';
|
|
2
|
+
import { N as NonEmptyArray, a as IteratorLike } from '../shared/core.QP35c488.mjs';
|
|
3
3
|
export { default as objectHash } from '/home/runner/work/likec4/likec4/node_modules/@types/object-hash/index.d.ts';
|
|
4
4
|
import { IsNumericLiteral } from 'type-fest';
|
|
5
5
|
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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.
|
|
2
|
-
import { N as NonEmptyArray, a as IteratorLike } from '../shared/core.
|
|
1
|
+
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.DQCc-Jxk.js';
|
|
2
|
+
import { N as NonEmptyArray, a as IteratorLike } from '../shared/core.QP35c488.js';
|
|
3
3
|
export { default as objectHash } from '/home/runner/work/likec4/likec4/node_modules/@types/object-hash/index.d.ts';
|
|
4
4
|
import { IsNumericLiteral } from 'type-fest';
|
|
5
5
|
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as t, _ as n, j as commonAncestor, o as compareFqnHierarchically } from '../shared/core.
|
|
2
|
-
export { D as DefaultMap, e as LinkedList, q as Queue, S as Stack, h as ancestorsFqn, f as commonHead, k as compareByFqnHierarchically, g as compareNatural, K as difference, L as equalsSet, z as getOrCreate, a as hasAtLeast, r as hierarchyDistance, s as hierarchyLevel, C as ifilter, i as ifind, E as iflat, F as imap, M as intersection, u as isAncestor, v as isDescendantOf, G as isIterable, A as isNonEmptyArray, c as isSameHierarchy, B as isString, H as isome, I as iunique, n as nameFromFqn, Q as objectHash, p as parentFqn, w as sortByFqnHierarchically, x as sortNaturalByFqn, y as sortParentsFirst, P as stringHash, N as symmetricDifference, J as toArray, t as toSet, O as union } from '../shared/core.
|
|
3
|
-
import { i as invariant } from '../shared/core.
|
|
1
|
+
import { d as t, _ as n, j as commonAncestor, o as compareFqnHierarchically } from '../shared/core.CeefT_JU.mjs';
|
|
2
|
+
export { D as DefaultMap, e as LinkedList, q as Queue, S as Stack, h as ancestorsFqn, f as commonHead, k as compareByFqnHierarchically, g as compareNatural, K as difference, L as equalsSet, z as getOrCreate, a as hasAtLeast, r as hierarchyDistance, s as hierarchyLevel, C as ifilter, i as ifind, E as iflat, F as imap, M as intersection, u as isAncestor, v as isDescendantOf, G as isIterable, A as isNonEmptyArray, c as isSameHierarchy, B as isString, H as isome, I as iunique, n as nameFromFqn, Q as objectHash, p as parentFqn, w as sortByFqnHierarchically, x as sortNaturalByFqn, y as sortParentsFirst, P as stringHash, N as symmetricDifference, J as toArray, t as toSet, O as union } from '../shared/core.CeefT_JU.mjs';
|
|
3
|
+
import { i as invariant } from '../shared/core.BfZZXtur.mjs';
|
|
4
4
|
|
|
5
5
|
function o(r,n){let e=Math.ceil(r),t=Math.floor(n);if(t<e)throw new RangeError(`randomInteger: The range [${r.toString()},${n.toString()}] contains no integer`);return Math.floor(Math.random()*(t-e+1)+e)}
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@dagrejs/dagre": "1.1.4",
|
|
115
|
-
"@likec4/tsconfig": "1.
|
|
116
|
-
"@mantine/colors-generator": "7.
|
|
115
|
+
"@likec4/tsconfig": "1.21.1",
|
|
116
|
+
"@mantine/colors-generator": "7.16.2",
|
|
117
117
|
"@types/natural-compare-lite": "^1.4.2",
|
|
118
118
|
"@types/object-hash": "^3.0.6",
|
|
119
119
|
"chroma-js": "^3.1.2",
|
|
@@ -125,11 +125,11 @@
|
|
|
125
125
|
"natural-compare-lite": "^1.4.0",
|
|
126
126
|
"object-hash": "^3.0.0",
|
|
127
127
|
"obliterator": "^2.0.5",
|
|
128
|
-
"remeda": "^2.
|
|
129
|
-
"turbo": "^2.
|
|
128
|
+
"remeda": "^2.20.1",
|
|
129
|
+
"turbo": "^2.4.0",
|
|
130
130
|
"typescript": "^5.7.3",
|
|
131
131
|
"unbuild": "^3.3.1",
|
|
132
|
-
"vitest": "^
|
|
132
|
+
"vitest": "^3.0.4"
|
|
133
133
|
},
|
|
134
134
|
"packageManager": "yarn@4.6.0"
|
|
135
135
|
}
|
package/src/builder/Builder.ts
CHANGED
|
@@ -5,9 +5,6 @@ import { invariant } from '../errors'
|
|
|
5
5
|
import { LikeC4Model } from '../model/LikeC4Model'
|
|
6
6
|
import {
|
|
7
7
|
type Color,
|
|
8
|
-
DefaultElementShape,
|
|
9
|
-
DefaultThemeColor,
|
|
10
|
-
DeploymentElement,
|
|
11
8
|
type DeploymentRelation,
|
|
12
9
|
type DeploymentView,
|
|
13
10
|
type Element,
|
|
@@ -15,7 +12,6 @@ import {
|
|
|
15
12
|
type ElementView,
|
|
16
13
|
type Fqn,
|
|
17
14
|
type IconUrl,
|
|
18
|
-
isScopedElementView,
|
|
19
15
|
type LikeC4View,
|
|
20
16
|
type Link,
|
|
21
17
|
type ModelGlobals,
|
|
@@ -23,6 +19,10 @@ import {
|
|
|
23
19
|
type NonEmptyArray,
|
|
24
20
|
type RelationId,
|
|
25
21
|
type Tag,
|
|
22
|
+
DefaultElementShape,
|
|
23
|
+
DefaultThemeColor,
|
|
24
|
+
DeploymentElement,
|
|
25
|
+
isScopedElementView,
|
|
26
26
|
} from '../types'
|
|
27
27
|
import { isSameHierarchy, nameFromFqn, parentFqn } from '../utils/fqn'
|
|
28
28
|
import type { AnyTypes, BuilderSpecification, Types } from './_types'
|
|
@@ -38,7 +38,7 @@ import type { AddElementHelpers, ModelBuilder, ModelBuilderFunction, ModelHelper
|
|
|
38
38
|
import { $autoLayout, $exclude, $include, $rules, $style } from './Builder.view-common'
|
|
39
39
|
import type { DeploymentRulesBuilderOp } from './Builder.view-deployment'
|
|
40
40
|
import type { ElementViewRulesBuilder } from './Builder.view-element'
|
|
41
|
-
import {
|
|
41
|
+
import { type ViewsBuilder, type ViewsBuilderFunction, type ViewsHelpers, mkViewBuilder } from './Builder.views'
|
|
42
42
|
import type { BuilderMethods } from './Builder.with'
|
|
43
43
|
|
|
44
44
|
export interface Builder<T extends AnyTypes> extends BuilderMethods<T> {
|
|
@@ -427,6 +427,9 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
|
|
|
427
427
|
style: pickBy({
|
|
428
428
|
border: specStyle?.border,
|
|
429
429
|
opacity: specStyle?.opacity,
|
|
430
|
+
size: specStyle?.size,
|
|
431
|
+
padding: specStyle?.padding,
|
|
432
|
+
textSize: specStyle?.textSize,
|
|
430
433
|
...style,
|
|
431
434
|
}, isNonNullish),
|
|
432
435
|
links,
|
|
@@ -662,6 +665,9 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
|
|
|
662
665
|
style: pickBy({
|
|
663
666
|
border: specStyle?.border,
|
|
664
667
|
opacity: specStyle?.opacity,
|
|
668
|
+
size: specStyle?.size,
|
|
669
|
+
padding: specStyle?.padding,
|
|
670
|
+
textSize: specStyle?.textSize,
|
|
665
671
|
...style,
|
|
666
672
|
}, isNonNullish),
|
|
667
673
|
...links && { links: mapLinks(links) },
|
|
@@ -67,6 +67,7 @@ export namespace ViewPredicate {
|
|
|
67
67
|
export type WhereEq<Types extends AnyTypes> =
|
|
68
68
|
| ViewPredicate.WhereTag<Types['Tag']>
|
|
69
69
|
| ViewPredicate.WhereKind<Types['ElementKind']>
|
|
70
|
+
| ViewPredicate.WhereKind<Types['DeploymentKind']>
|
|
70
71
|
| ViewPredicate.WhereParticipant<Types>
|
|
71
72
|
|
|
72
73
|
export type WhereOperator<Types extends AnyTypes> = ViewPredicate.WhereEq<Types> | {
|