@likec4/core 1.48.0 → 1.50.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.
Files changed (130) hide show
  1. package/dist/THIRD-PARTY-LICENSES.md +1034 -0
  2. package/dist/_chunks/Builder.view-element.mjs +2 -3284
  3. package/dist/_chunks/LikeC4Model.d.mts +21 -25
  4. package/dist/_chunks/_types.d.mts +1 -5
  5. package/dist/_chunks/_types2.d.mts +2 -4
  6. package/dist/_chunks/assignTagColors.mjs +1 -24
  7. package/dist/_chunks/geometry.mjs +1 -335
  8. package/dist/_chunks/index.d.mts +1995 -131
  9. package/dist/_chunks/index2.d.mts +153 -892
  10. package/dist/_chunks/index3.d.mts +15 -13
  11. package/dist/_chunks/index4.d.mts +229 -3
  12. package/dist/_chunks/index5.d.mts +392 -30
  13. package/dist/_chunks/libs/@mantine/colors-generator.mjs +2 -3403
  14. package/dist/_chunks/libs/@radix-ui/colors.mjs +1 -0
  15. package/dist/_chunks/libs/@ungap/structured-clone.mjs +1 -213
  16. package/dist/_chunks/libs/bail.mjs +1 -14
  17. package/dist/_chunks/libs/ccount.mjs +1 -25
  18. package/dist/_chunks/libs/character-entities-html4.mjs +1 -263
  19. package/dist/_chunks/libs/character-entities-legacy.mjs +1 -117
  20. package/dist/_chunks/libs/character-entities.mjs +2 -2136
  21. package/dist/_chunks/libs/comma-separated-tokens.mjs +1 -18
  22. package/dist/_chunks/libs/decode-named-character-reference.mjs +1 -21
  23. package/dist/_chunks/libs/defu.mjs +1 -42
  24. package/dist/_chunks/libs/devlop.mjs +1 -5
  25. package/dist/_chunks/libs/escape-string-regexp.mjs +1 -8
  26. package/dist/_chunks/libs/extend.mjs +1 -77
  27. package/dist/_chunks/libs/graphology-dag.mjs +1 -703
  28. package/dist/_chunks/libs/graphology.mjs +1 -4565
  29. package/dist/_chunks/libs/hast-util-sanitize.mjs +1 -863
  30. package/dist/_chunks/libs/hast-util-to-html.mjs +9 -2696
  31. package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
  32. package/dist/_chunks/libs/longest-streak.mjs +1 -30
  33. package/dist/_chunks/libs/markdown-table.mjs +2 -290
  34. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +1 -653
  35. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +3 -8522
  36. package/dist/_chunks/libs/mdast-util-gfm.mjs +15 -2393
  37. package/dist/_chunks/libs/mdast-util-to-hast.mjs +11 -1803
  38. package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -2243
  39. package/dist/_chunks/libs/mnemonist.d.mts +1 -91
  40. package/dist/_chunks/libs/mnemonist.mjs +1 -1978
  41. package/dist/_chunks/libs/natural-compare-lite.mjs +9 -42
  42. package/dist/_chunks/libs/ohash.mjs +1 -0
  43. package/dist/_chunks/libs/rehype-sanitize.mjs +1 -29
  44. package/dist/_chunks/libs/rehype-stringify.mjs +1 -34
  45. package/dist/_chunks/libs/remark-gfm.mjs +1 -36
  46. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +3 -100
  47. package/dist/_chunks/libs/remark-parse.mjs +1 -39
  48. package/dist/_chunks/libs/remark-rehype.mjs +1 -171
  49. package/dist/_chunks/libs/remeda.mjs +2 -702
  50. package/dist/_chunks/libs/trough.mjs +1 -158
  51. package/dist/_chunks/libs/unified.mjs +1 -2212
  52. package/dist/_chunks/manual-layout.mjs +1 -0
  53. package/dist/_chunks/model.mjs +4 -1898
  54. package/dist/_chunks/rolldown-runtime.mjs +1 -42
  55. package/dist/_chunks/types.mjs +1 -0
  56. package/dist/_chunks/utils.mjs +1 -483
  57. package/dist/builder/index.d.mts +3 -6
  58. package/dist/builder/index.mjs +1 -662
  59. package/dist/compute-view/index.d.mts +85 -13
  60. package/dist/compute-view/index.mjs +2 -262
  61. package/dist/geometry/index.d.mts +2 -2
  62. package/dist/geometry/index.mjs +1 -3
  63. package/dist/index.d.mts +7 -13
  64. package/dist/index.mjs +1 -27
  65. package/dist/model/index.d.mts +4 -11
  66. package/dist/model/index.mjs +1 -11
  67. package/dist/styles/index.d.mts +2 -7
  68. package/dist/styles/index.mjs +1 -30
  69. package/dist/types/index.d.mts +3 -9
  70. package/dist/types/index.mjs +1 -15
  71. package/dist/utils/graphology/index.d.mts +1 -1
  72. package/dist/utils/graphology/index.mjs +1 -3
  73. package/dist/utils/index.d.mts +5 -10
  74. package/dist/utils/index.mjs +1 -17
  75. package/package.json +14 -13
  76. package/dist/_chunks/LikeC4Styles.mjs +0 -691
  77. package/dist/_chunks/RichText.d.mts +0 -84
  78. package/dist/_chunks/RichText.mjs +0 -148
  79. package/dist/_chunks/_aux.d.mts +0 -289
  80. package/dist/_chunks/_aux.mjs +0 -18
  81. package/dist/_chunks/calcDriftsFromSnapshot.mjs +0 -379
  82. package/dist/_chunks/connection.mjs +0 -0
  83. package/dist/_chunks/const.d.mts +0 -43
  84. package/dist/_chunks/const.mjs +0 -33
  85. package/dist/_chunks/expression-model.d.mts +0 -192
  86. package/dist/_chunks/expression-model.mjs +0 -103
  87. package/dist/_chunks/expression.d.mts +0 -347
  88. package/dist/_chunks/expression.mjs +0 -107
  89. package/dist/_chunks/find.d.mts +0 -82
  90. package/dist/_chunks/find.mjs +0 -646
  91. package/dist/_chunks/find2.d.mts +0 -78
  92. package/dist/_chunks/find2.mjs +0 -287
  93. package/dist/_chunks/fqnRef.d.mts +0 -58
  94. package/dist/_chunks/fqnRef.mjs +0 -41
  95. package/dist/_chunks/index6.d.mts +0 -43
  96. package/dist/_chunks/index7.d.mts +0 -268
  97. package/dist/_chunks/index8.d.mts +0 -144
  98. package/dist/_chunks/invariant.mjs +0 -18
  99. package/dist/_chunks/iterable.mjs +0 -146
  100. package/dist/_chunks/libs/graphology-types.d.mts +0 -601
  101. package/dist/_chunks/libs/graphology.d.mts +0 -6
  102. package/dist/_chunks/mnemonist.mjs +0 -0
  103. package/dist/_chunks/model2.mjs +0 -0
  104. package/dist/_chunks/relationships-view.mjs +0 -132
  105. package/dist/_chunks/scalar.d.mts +0 -109
  106. package/dist/_chunks/scalar.mjs +0 -84
  107. package/dist/compute-view/relationships-view/index.d.mts +0 -16
  108. package/dist/compute-view/relationships-view/index.mjs +0 -7
  109. package/dist/model/connection/deployment/index.d.mts +0 -12
  110. package/dist/model/connection/deployment/index.mjs +0 -9
  111. package/dist/model/connection/index.d.mts +0 -14
  112. package/dist/model/connection/index.mjs +0 -10
  113. package/dist/model/connection/model/index.d.mts +0 -12
  114. package/dist/model/connection/model/index.mjs +0 -8
  115. package/dist/types/RichText.d.mts +0 -3
  116. package/dist/types/RichText.mjs +0 -7
  117. package/dist/types/_aux.d.mts +0 -3
  118. package/dist/types/_aux.mjs +0 -3
  119. package/dist/types/expression-model.d.mts +0 -6
  120. package/dist/types/expression-model.mjs +0 -7
  121. package/dist/types/expression.d.mts +0 -5
  122. package/dist/types/expression.mjs +0 -7
  123. package/dist/types/fqnRef.d.mts +0 -4
  124. package/dist/types/fqnRef.mjs +0 -7
  125. package/dist/types/scalar.d.mts +0 -2
  126. package/dist/types/scalar.mjs +0 -7
  127. package/dist/utils/iterable/index.d.mts +0 -9
  128. package/dist/utils/iterable/index.mjs +0 -3
  129. package/dist/utils/mnemonist.d.mts +0 -2
  130. package/dist/utils/mnemonist.mjs +0 -12
@@ -1,103 +0,0 @@
1
- import { t as FqnRef } from "./fqnRef.mjs";
2
-
3
- //#region src/types/expression-model.ts
4
- let ModelFqnExpr;
5
- (function(_ModelFqnExpr) {
6
- function isWildcard(expr) {
7
- return "wildcard" in expr && expr.wildcard === true;
8
- }
9
- _ModelFqnExpr.isWildcard = isWildcard;
10
- function isModelRef(ref) {
11
- return "ref" in ref && FqnRef.isModelRef(ref.ref);
12
- }
13
- _ModelFqnExpr.isModelRef = isModelRef;
14
- function isElementKindExpr(expr) {
15
- return "elementKind" in expr && "isEqual" in expr;
16
- }
17
- _ModelFqnExpr.isElementKindExpr = isElementKindExpr;
18
- function isElementTagExpr(expr) {
19
- return "elementTag" in expr && "isEqual" in expr;
20
- }
21
- _ModelFqnExpr.isElementTagExpr = isElementTagExpr;
22
- function isWhere(expr) {
23
- return "where" in expr && is(expr.where.expr);
24
- }
25
- _ModelFqnExpr.isWhere = isWhere;
26
- function isCustom(expr) {
27
- return "custom" in expr && (is(expr.custom.expr) || isWhere(expr.custom.expr));
28
- }
29
- _ModelFqnExpr.isCustom = isCustom;
30
- function is(expr) {
31
- return isWildcard(expr) || isModelRef(expr) || isElementKindExpr(expr) || isElementTagExpr(expr);
32
- }
33
- _ModelFqnExpr.is = is;
34
- function unwrap(expr) {
35
- if (isCustom(expr)) expr = expr.custom.expr;
36
- if (isWhere(expr)) expr = expr.where.expr;
37
- return expr;
38
- }
39
- _ModelFqnExpr.unwrap = unwrap;
40
- })(ModelFqnExpr || (ModelFqnExpr = {}));
41
- let ModelRelationExpr;
42
- (function(_ModelRelationExpr) {
43
- function isDirect(expr) {
44
- return "source" in expr && "target" in expr;
45
- }
46
- _ModelRelationExpr.isDirect = isDirect;
47
- function isIncoming(expr) {
48
- return "incoming" in expr;
49
- }
50
- _ModelRelationExpr.isIncoming = isIncoming;
51
- function isOutgoing(expr) {
52
- return "outgoing" in expr;
53
- }
54
- _ModelRelationExpr.isOutgoing = isOutgoing;
55
- function isInOut(expr) {
56
- return "inout" in expr;
57
- }
58
- _ModelRelationExpr.isInOut = isInOut;
59
- function isWhere(expr) {
60
- return "where" in expr && (isDirect(expr.where.expr) || isIncoming(expr.where.expr) || isOutgoing(expr.where.expr) || isInOut(expr.where.expr));
61
- }
62
- _ModelRelationExpr.isWhere = isWhere;
63
- function isCustom(expr) {
64
- return "customRelation" in expr;
65
- }
66
- _ModelRelationExpr.isCustom = isCustom;
67
- function is(expr) {
68
- return isDirect(expr) || isIncoming(expr) || isOutgoing(expr) || isInOut(expr);
69
- }
70
- _ModelRelationExpr.is = is;
71
- function unwrap(expr) {
72
- if (isCustom(expr)) expr = expr.customRelation.expr;
73
- if (isWhere(expr)) expr = expr.where.expr;
74
- return expr;
75
- }
76
- _ModelRelationExpr.unwrap = unwrap;
77
- })(ModelRelationExpr || (ModelRelationExpr = {}));
78
- let ModelExpression;
79
- (function(_ModelExpression) {
80
- function isWhere(expr) {
81
- return "where" in expr;
82
- }
83
- _ModelExpression.isWhere = isWhere;
84
- function isRelationWhere(expr) {
85
- return ModelRelationExpr.isWhere(expr);
86
- }
87
- _ModelExpression.isRelationWhere = isRelationWhere;
88
- function isFqnExprWhere(expr) {
89
- return ModelFqnExpr.isWhere(expr);
90
- }
91
- _ModelExpression.isFqnExprWhere = isFqnExprWhere;
92
- function isFqnExpr(expr) {
93
- return ModelFqnExpr.is(expr) || ModelFqnExpr.isWhere(expr) || ModelFqnExpr.isCustom(expr);
94
- }
95
- _ModelExpression.isFqnExpr = isFqnExpr;
96
- function isRelationExpr(expr) {
97
- return ModelRelationExpr.is(expr) || ModelRelationExpr.isWhere(expr) || ModelRelationExpr.isCustom(expr);
98
- }
99
- _ModelExpression.isRelationExpr = isRelationExpr;
100
- })(ModelExpression || (ModelExpression = {}));
101
-
102
- //#endregion
103
- export { ModelFqnExpr as n, ModelRelationExpr as r, ModelExpression as t };
@@ -1,347 +0,0 @@
1
- import { H as StrictViewId, U as Tag, W as Tags, m as ElementKind, n as Any, t as AllKinds, vt as ExclusiveUnion, wt as NonEmptyArray } from "./_aux.mjs";
2
- import { f as MarkdownOrString, u as Icon } from "./scalar.mjs";
3
- import { t as FqnRef } from "./fqnRef.mjs";
4
- import { Tagged, TupleToUnion } from "type-fest";
5
-
6
- //#region ../../styled-system/preset/src/defaults/types.d.ts
7
- declare const Sizes: readonly ["xs", "sm", "md", "lg", "xl"];
8
- declare const IconPositions: readonly ["left", "right", "top", "bottom"];
9
- declare const BorderStyles: readonly ["solid", "dashed", "dotted", "none"];
10
- declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile", "cylinder", "storage", "queue", "bucket", "document"];
11
- declare const ThemeColors: readonly ["amber", "blue", "gray", "slate", "green", "indigo", "muted", "primary", "red", "secondary", "sky"];
12
- declare const DefaultTagColors: readonly ["tomato", "grass", "blue", "ruby", "orange", "indigo", "pink", "teal", "purple", "amber", "crimson", "red", "lime", "yellow", "violet"];
13
- //#endregion
14
- //#region src/styles/types.d.ts
15
- /**
16
- * For padding, margin, etc.
17
- */
18
- type Size = typeof Sizes[number];
19
- type TextSize = Size;
20
- type ShapeSize = Size;
21
- type SpacingSize = Size;
22
- type IconSize = Size;
23
- type IconPosition = typeof IconPositions[number];
24
- type BorderStyle = typeof BorderStyles[number];
25
- type ElementShape = typeof ElementShapes[number];
26
- type HexColor = `#${string}`;
27
- type ColorLiteral = HexColor | `rgb(${number},${number},${number})` | `rgba(${number},${number},${number},${number})`;
28
- type RelationshipLineType = 'dashed' | 'solid' | 'dotted';
29
- declare const RelationshipArrowTypes: readonly ["none", "normal", "onormal", "dot", "odot", "diamond", "odiamond", "crow", "open", "vee"];
30
- type RelationshipArrowType = TupleToUnion<typeof RelationshipArrowTypes>;
31
- type ThemeColor = typeof ThemeColors[number];
32
- declare function isThemeColor(color: string): color is ThemeColor;
33
- type CustomColorDefinitions = {
34
- [key: string]: ThemeColorValues;
35
- };
36
- type CustomColor = Tagged<string, 'CustomColor'>;
37
- declare function isCustomColor(color: string): color is CustomColor;
38
- type Color = ThemeColor | CustomColor;
39
- interface ElementColorValues {
40
- readonly fill: ColorLiteral;
41
- readonly stroke: ColorLiteral;
42
- readonly hiContrast: ColorLiteral;
43
- readonly loContrast: ColorLiteral;
44
- }
45
- interface RelationshipColorValues {
46
- readonly line: ColorLiteral;
47
- readonly labelBg: ColorLiteral;
48
- readonly label: ColorLiteral;
49
- }
50
- interface ThemeColorValues {
51
- readonly elements: ElementColorValues;
52
- readonly relationships: RelationshipColorValues;
53
- }
54
- /**
55
- * Default style values for elements, groups and relationships
56
- */
57
- interface LikeC4StyleDefaults {
58
- readonly color: ThemeColor;
59
- readonly size: ShapeSize;
60
- readonly shape: ElementShape;
61
- readonly opacity?: number;
62
- readonly border?: BorderStyle;
63
- readonly padding?: SpacingSize;
64
- readonly text?: TextSize;
65
- readonly iconPosition?: IconPosition;
66
- /**
67
- * Default style values for groups
68
- * If not specified, the default values for elements are used
69
- */
70
- readonly group?: {
71
- readonly color?: ThemeColor;
72
- readonly opacity?: number;
73
- readonly border?: BorderStyle;
74
- };
75
- readonly relationship: {
76
- readonly color: ThemeColor;
77
- readonly line: RelationshipLineType;
78
- readonly arrow: RelationshipArrowType;
79
- };
80
- }
81
- interface LikeC4Theme {
82
- readonly colors: Readonly<Record<ThemeColor, ThemeColorValues>>;
83
- readonly sizes: Readonly<Record<ShapeSize, {
84
- readonly width: number;
85
- readonly height: number;
86
- }>>;
87
- readonly spacing: Readonly<Record<SpacingSize, number>>;
88
- readonly textSizes: Readonly<Record<TextSize, number>>;
89
- readonly iconSizes: Readonly<Record<IconSize, number>>;
90
- }
91
- interface LikeC4StylesConfig {
92
- readonly theme: LikeC4Theme;
93
- readonly defaults: LikeC4StyleDefaults;
94
- }
95
- //#endregion
96
- //#region src/types/operators.d.ts
97
- type EqualOperator<V> = {
98
- eq: V;
99
- neq?: never;
100
- } | {
101
- eq?: never;
102
- neq: V;
103
- };
104
- type AllNever = {
105
- not?: never;
106
- and?: never;
107
- or?: never;
108
- tag?: never;
109
- kind?: never;
110
- participant?: never;
111
- operator?: never;
112
- };
113
- type TagEqual<A extends Any> = Omit<AllNever, 'tag'> & {
114
- tag: EqualOperator<Tag<A>> | Tag<A>;
115
- };
116
- declare function isTagEqual<A extends Any>(operator: WhereOperator<A>): operator is TagEqual<A>;
117
- type KindEqual<A extends Any> = Omit<AllNever, 'kind'> & {
118
- kind: EqualOperator<AllKinds<A>> | AllKinds<A>;
119
- };
120
- declare function isKindEqual<A extends Any>(operator: WhereOperator<A>): operator is KindEqual<A>;
121
- type Participant = 'source' | 'target';
122
- type ParticipantOperator<A extends Any> = Omit<AllNever, 'participant' | 'operator'> & {
123
- participant: Participant;
124
- operator: KindEqual<A> | TagEqual<A>;
125
- };
126
- declare function isParticipantOperator<A extends Any>(operator: WhereOperator<A>): operator is ParticipantOperator<A>;
127
- type NotOperator<A extends Any> = Omit<AllNever, 'not'> & {
128
- not: WhereOperator<A>;
129
- };
130
- declare function isNotOperator<A extends Any>(operator: WhereOperator<A>): operator is NotOperator<A>;
131
- type AndOperator<A extends Any> = Omit<AllNever, 'and'> & {
132
- and: NonEmptyArray<WhereOperator<A>>;
133
- };
134
- declare function isAndOperator<A extends Any>(operator: WhereOperator<A>): operator is AndOperator<A>;
135
- type OrOperator<A extends Any> = Omit<AllNever, 'or'> & {
136
- or: NonEmptyArray<WhereOperator<A>>;
137
- };
138
- declare function isOrOperator<A extends Any>(operator: WhereOperator<A>): operator is OrOperator<A>;
139
- type WhereOperator<A extends Any = Any> = TagEqual<A> | KindEqual<A> | ParticipantOperator<A> | NotOperator<A> | AndOperator<A> | OrOperator<A>;
140
- type Filterable<A extends Any> = {
141
- tags?: Tags<A> | null | undefined;
142
- kind?: AllKinds<A> | null | undefined;
143
- source?: Filterable<A>;
144
- target?: Filterable<A>;
145
- };
146
- type OperatorPredicate<A extends Any> = (value: Filterable<A>) => boolean;
147
- declare function whereOperatorAsPredicate<A extends Any>(operator: WhereOperator<A>): OperatorPredicate<A>;
148
- //#endregion
149
- //#region src/types/expression.d.ts
150
- type AnyAux = Any;
151
- type PredicateSelector = 'children' | 'expanded' | 'descendants';
152
- declare namespace FqnExpr {
153
- type Wildcard = {
154
- wildcard: true;
155
- };
156
- function isWildcard<A extends AnyAux>(expr: Expression<A>): expr is FqnExpr.Wildcard;
157
- interface ModelRef<M extends AnyAux = AnyAux> {
158
- ref: FqnRef.ModelRef<M>;
159
- selector?: PredicateSelector;
160
- }
161
- function isModelRef<A extends AnyAux>(ref: Expression<A>): ref is FqnExpr.ModelRef<A>;
162
- interface DeploymentRef<A extends AnyAux = AnyAux> {
163
- ref: FqnRef.DeploymentRef<A>;
164
- selector?: PredicateSelector;
165
- }
166
- function isDeploymentRef<A extends AnyAux>(expr: Expression<A>): expr is FqnExpr.DeploymentRef<A>;
167
- interface ElementKindExpr<A extends AnyAux = AnyAux> {
168
- elementKind: ElementKind<A>;
169
- isEqual: boolean;
170
- }
171
- function isElementKindExpr<A extends AnyAux>(expr: Expression<A>): expr is ElementKindExpr<A>;
172
- interface ElementTagExpr<A extends AnyAux = AnyAux> {
173
- elementTag: Tag<A>;
174
- isEqual: boolean;
175
- }
176
- function isElementTagExpr<A extends AnyAux>(expr: Expression<A>): expr is ElementTagExpr<A>;
177
- type NonWildcard<A extends AnyAux = AnyAux> = ExclusiveUnion<{
178
- ModelRef: ModelRef<A>;
179
- DeploymentRef: DeploymentRef<A>;
180
- ElementKind: ElementKindExpr<A>;
181
- ElementTag: ElementTagExpr<A>;
182
- }>;
183
- interface Where<A extends AnyAux = AnyAux> {
184
- where: {
185
- expr: ExclusiveUnion<{
186
- Wildcard: Wildcard;
187
- ModelRef: ModelRef<A>;
188
- DeploymentRef: DeploymentRef<A>;
189
- ElementKind: ElementKindExpr<A>;
190
- ElementTag: ElementTagExpr<A>;
191
- }>;
192
- condition: WhereOperator<A>;
193
- };
194
- }
195
- function isWhere<A extends AnyAux>(expr: Expression<A>): expr is FqnExpr.Where<A>;
196
- interface Custom<A extends AnyAux = AnyAux> {
197
- custom: {
198
- expr: OrWhere<A>;
199
- title?: string;
200
- description?: MarkdownOrString;
201
- technology?: string;
202
- notation?: string;
203
- shape?: ElementShape;
204
- color?: Color;
205
- icon?: Icon;
206
- iconColor?: Color;
207
- iconSize?: ShapeSize;
208
- iconPosition?: IconPosition;
209
- border?: BorderStyle;
210
- opacity?: number;
211
- navigateTo?: StrictViewId<A>;
212
- multiple?: boolean;
213
- size?: ShapeSize;
214
- padding?: ShapeSize;
215
- textSize?: ShapeSize;
216
- };
217
- }
218
- function isCustom<A extends AnyAux>(expr: Expression<A>): expr is Custom<A>;
219
- function is<A extends AnyAux>(expr: Expression<A>): expr is FqnExpr<A>;
220
- type OrWhere<A extends AnyAux = AnyAux> = ExclusiveUnion<{
221
- Wildcard: FqnExpr.Wildcard;
222
- ModelRef: FqnExpr.ModelRef<A>;
223
- DeploymentRef: FqnExpr.DeploymentRef<A>;
224
- ElementKind: ElementKindExpr<A>;
225
- ElementTag: ElementTagExpr<A>;
226
- Where: FqnExpr.Where<A>;
227
- }>;
228
- type Any<A extends AnyAux = AnyAux> = ExclusiveUnion<{
229
- Wildcard: Wildcard;
230
- ModelRef: ModelRef<A>;
231
- DeploymentRef: DeploymentRef<A>;
232
- ElementKind: ElementKindExpr<A>;
233
- ElementTag: ElementTagExpr<A>;
234
- Where: Where<A>;
235
- Custom: Custom<A>;
236
- }>;
237
- function unwrap<A extends AnyAux>(expr: FqnExpr.Any<A>): Wildcard | ModelRef<A> | DeploymentRef<A> | ElementKindExpr<A> | ElementTagExpr<A>;
238
- }
239
- type FqnExpr<A extends AnyAux = AnyAux> = ExclusiveUnion<{
240
- Wildcard: FqnExpr.Wildcard;
241
- ModelRef: FqnExpr.ModelRef<A>;
242
- DeploymentRef: FqnExpr.DeploymentRef<A>;
243
- ElementKind: FqnExpr.ElementKindExpr<A>;
244
- ElementTag: FqnExpr.ElementTagExpr<A>;
245
- }>;
246
- declare namespace RelationExpr {
247
- type Endpoint<A extends AnyAux = AnyAux> = FqnExpr.Where<A>['where']['expr'];
248
- interface Direct<A extends AnyAux = AnyAux> {
249
- source: Endpoint<A>;
250
- target: Endpoint<A>;
251
- isBidirectional?: boolean;
252
- }
253
- function isDirect<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr.Direct<A>;
254
- interface Incoming<A extends AnyAux = AnyAux> {
255
- incoming: Endpoint<A>;
256
- }
257
- function isIncoming<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr.Incoming<A>;
258
- interface Outgoing<A extends AnyAux = AnyAux> {
259
- outgoing: Endpoint<A>;
260
- }
261
- function isOutgoing<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr.Outgoing<A>;
262
- interface InOut<A extends AnyAux = AnyAux> {
263
- inout: Endpoint<A>;
264
- }
265
- function isInOut<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr.InOut<A>;
266
- interface Where<A extends AnyAux = AnyAux> {
267
- where: {
268
- expr: ExclusiveUnion<{
269
- Direct: RelationExpr.Direct<A>;
270
- Incoming: RelationExpr.Incoming<A>;
271
- Outgoing: RelationExpr.Outgoing<A>;
272
- InOut: RelationExpr.InOut<A>;
273
- }>;
274
- condition: WhereOperator<A>;
275
- };
276
- }
277
- function isWhere<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr.Where<A>;
278
- interface Custom<A extends AnyAux = AnyAux> {
279
- customRelation: {
280
- expr: OrWhere<A>;
281
- title?: string;
282
- description?: string;
283
- technology?: string;
284
- notation?: string;
285
- navigateTo?: StrictViewId<A>;
286
- notes?: string;
287
- color?: Color;
288
- line?: RelationshipLineType;
289
- head?: RelationshipArrowType;
290
- tail?: RelationshipArrowType;
291
- };
292
- }
293
- function isCustom<A extends AnyAux>(expr: Expression<A>): expr is Custom<A>;
294
- function is<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr<A>;
295
- type OrWhere<A extends AnyAux = AnyAux> = ExclusiveUnion<{
296
- Direct: Direct<A>;
297
- Incoming: Incoming<A>;
298
- Outgoing: Outgoing<A>;
299
- InOut: InOut<A>;
300
- Where: Where<A>;
301
- }>;
302
- type Any<A extends AnyAux = AnyAux> = ExclusiveUnion<{
303
- Direct: Direct<A>;
304
- Incoming: Incoming<A>;
305
- Outgoing: Outgoing<A>;
306
- InOut: InOut<A>;
307
- Where: Where<A>;
308
- Custom: Custom<A>;
309
- }>;
310
- function unwrap<A extends AnyAux>(expr: RelationExpr.Any<A>): Direct<A> | Incoming<A> | Outgoing<A> | InOut<A>;
311
- }
312
- type RelationExpr<A extends AnyAux = AnyAux> = ExclusiveUnion<{
313
- Direct: RelationExpr.Direct<A>;
314
- Incoming: RelationExpr.Incoming<A>;
315
- Outgoing: RelationExpr.Outgoing<A>;
316
- InOut: RelationExpr.InOut<A>;
317
- }>;
318
- /**
319
- * Represents a version 2 expression which can be one of several types.
320
- *
321
- * @template D - The type for the deployment FQN, defaults to `Fqn`.
322
- * @template M - The type for the model FQN, defaults to `Fqn`.
323
- */
324
- type Expression<A extends AnyAux = AnyAux> = ExclusiveUnion<{
325
- Wildcard: FqnExpr.Wildcard;
326
- ModelRef: FqnExpr.ModelRef<A>;
327
- DeploymentRef: FqnExpr.DeploymentRef<A>;
328
- ElementKind: FqnExpr.ElementKindExpr<A>;
329
- ElementTag: FqnExpr.ElementTagExpr<A>;
330
- Custom: FqnExpr.Custom<A>;
331
- Direct: RelationExpr.Direct<A>;
332
- Incoming: RelationExpr.Incoming<A>;
333
- Outgoing: RelationExpr.Outgoing<A>;
334
- InOut: RelationExpr.InOut<A>;
335
- Where: Expression.Where<A>;
336
- CustomRelation: RelationExpr.Custom<A>;
337
- }>;
338
- declare namespace Expression {
339
- type Where<A extends AnyAux = AnyAux> = FqnExpr.Where<A> | RelationExpr.Where<A>;
340
- function isWhere<A extends AnyAux>(expr: Expression<A>): expr is Expression.Where<A>;
341
- function isRelationWhere<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr.Where<A>;
342
- function isFqnExprWhere<A extends AnyAux>(expr: Expression<A>): expr is FqnExpr.Where<A>;
343
- function isFqnExpr<A extends AnyAux>(expr: Expression<A>): expr is FqnExpr.Any<A>;
344
- function isRelation<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr.Any<A>;
345
- }
346
- //#endregion
347
- export { ThemeColors as $, HexColor as A, ShapeSize as B, BorderStyle as C, CustomColorDefinitions as D, CustomColor as E, LikeC4Theme as F, ThemeColorValues as G, SpacingSize as H, RelationshipArrowType as I, BorderStyles as J, isCustomColor as K, RelationshipArrowTypes as L, IconSize as M, LikeC4StyleDefaults as N, ElementColorValues as O, LikeC4StylesConfig as P, Sizes as Q, RelationshipColorValues as R, whereOperatorAsPredicate as S, ColorLiteral as T, TextSize as U, Size as V, ThemeColor as W, ElementShapes as X, DefaultTagColors as Y, IconPositions as Z, isKindEqual as _, AndOperator as a, isParticipantOperator as b, KindEqual as c, OrOperator as d, Participant as f, isAndOperator as g, WhereOperator as h, RelationExpr as i, IconPosition as j, ElementShape as k, NotOperator as l, TagEqual as m, FqnExpr as n, EqualOperator as o, ParticipantOperator as p, isThemeColor as q, PredicateSelector as r, Filterable as s, Expression as t, OperatorPredicate as u, isNotOperator as v, Color as w, isTagEqual as x, isOrOperator as y, RelationshipLineType as z };
@@ -1,107 +0,0 @@
1
- import { t as FqnRef } from "./fqnRef.mjs";
2
-
3
- //#region src/types/expression.ts
4
- let FqnExpr;
5
- (function(_FqnExpr) {
6
- function isWildcard(expr) {
7
- return "wildcard" in expr && expr.wildcard === true;
8
- }
9
- _FqnExpr.isWildcard = isWildcard;
10
- function isModelRef(ref) {
11
- return "ref" in ref && FqnRef.isModelRef(ref.ref);
12
- }
13
- _FqnExpr.isModelRef = isModelRef;
14
- function isDeploymentRef(expr) {
15
- return "ref" in expr && FqnRef.isDeploymentRef(expr.ref);
16
- }
17
- _FqnExpr.isDeploymentRef = isDeploymentRef;
18
- function isElementKindExpr(expr) {
19
- return "elementKind" in expr && "isEqual" in expr;
20
- }
21
- _FqnExpr.isElementKindExpr = isElementKindExpr;
22
- function isElementTagExpr(expr) {
23
- return "elementTag" in expr && "isEqual" in expr;
24
- }
25
- _FqnExpr.isElementTagExpr = isElementTagExpr;
26
- function isWhere(expr) {
27
- return "where" in expr && is(expr.where.expr);
28
- }
29
- _FqnExpr.isWhere = isWhere;
30
- function isCustom(expr) {
31
- return "custom" in expr && (is(expr.custom.expr) || isWhere(expr.custom.expr));
32
- }
33
- _FqnExpr.isCustom = isCustom;
34
- function is(expr) {
35
- return isWildcard(expr) || isModelRef(expr) || isDeploymentRef(expr) || isElementKindExpr(expr) || isElementTagExpr(expr);
36
- }
37
- _FqnExpr.is = is;
38
- function unwrap(expr) {
39
- if (isCustom(expr)) expr = expr.custom.expr;
40
- if (isWhere(expr)) expr = expr.where.expr;
41
- return expr;
42
- }
43
- _FqnExpr.unwrap = unwrap;
44
- })(FqnExpr || (FqnExpr = {}));
45
- let RelationExpr;
46
- (function(_RelationExpr) {
47
- function isDirect(expr) {
48
- return "source" in expr && "target" in expr;
49
- }
50
- _RelationExpr.isDirect = isDirect;
51
- function isIncoming(expr) {
52
- return "incoming" in expr;
53
- }
54
- _RelationExpr.isIncoming = isIncoming;
55
- function isOutgoing(expr) {
56
- return "outgoing" in expr;
57
- }
58
- _RelationExpr.isOutgoing = isOutgoing;
59
- function isInOut(expr) {
60
- return "inout" in expr;
61
- }
62
- _RelationExpr.isInOut = isInOut;
63
- function isWhere(expr) {
64
- return "where" in expr && (isDirect(expr.where.expr) || isIncoming(expr.where.expr) || isOutgoing(expr.where.expr) || isInOut(expr.where.expr));
65
- }
66
- _RelationExpr.isWhere = isWhere;
67
- function isCustom(expr) {
68
- return "customRelation" in expr;
69
- }
70
- _RelationExpr.isCustom = isCustom;
71
- function is(expr) {
72
- return isDirect(expr) || isIncoming(expr) || isOutgoing(expr) || isInOut(expr);
73
- }
74
- _RelationExpr.is = is;
75
- function unwrap(expr) {
76
- if (isCustom(expr)) expr = expr.customRelation.expr;
77
- if (isWhere(expr)) expr = expr.where.expr;
78
- return expr;
79
- }
80
- _RelationExpr.unwrap = unwrap;
81
- })(RelationExpr || (RelationExpr = {}));
82
- let Expression;
83
- (function(_Expression) {
84
- function isWhere(expr) {
85
- return "where" in expr;
86
- }
87
- _Expression.isWhere = isWhere;
88
- function isRelationWhere(expr) {
89
- return RelationExpr.isWhere(expr);
90
- }
91
- _Expression.isRelationWhere = isRelationWhere;
92
- function isFqnExprWhere(expr) {
93
- return FqnExpr.isWhere(expr);
94
- }
95
- _Expression.isFqnExprWhere = isFqnExprWhere;
96
- function isFqnExpr(expr) {
97
- return FqnExpr.is(expr) || FqnExpr.isWhere(expr) || FqnExpr.isCustom(expr);
98
- }
99
- _Expression.isFqnExpr = isFqnExpr;
100
- function isRelation(expr) {
101
- return RelationExpr.is(expr) || RelationExpr.isWhere(expr) || RelationExpr.isCustom(expr);
102
- }
103
- _Expression.isRelation = isRelation;
104
- })(Expression || (Expression = {}));
105
-
106
- //#endregion
107
- export { FqnExpr as n, RelationExpr as r, Expression as t };
@@ -1,82 +0,0 @@
1
- import { bt as IteratorLike, f as EdgeId, n as Any } from "./_aux.mjs";
2
- import { T as RelationshipModel, a as DeploymentNodeModel, i as DeploymentElementModel, l as RelationshipsAccum, s as DeploymentRelationModel } from "./LikeC4Model.mjs";
3
- import { n as Connection, t as customInspectSymbol } from "./const.mjs";
4
-
5
- //#region src/model/connection/deployment/DeploymentConnectionModel.d.ts
6
- /**
7
- * Connection is ephemeral entity, result of a resolving relationships between source and target.
8
- * Includes direct relationships and/or between their nested elements.
9
- */
10
- declare class DeploymentConnectionModel<A extends Any = Any> implements Connection<DeploymentElementModel<A>, EdgeId> {
11
- readonly source: DeploymentElementModel<A>;
12
- readonly target: DeploymentElementModel<A>;
13
- readonly relations: RelationshipsAccum<A>;
14
- readonly id: EdgeId;
15
- constructor(source: DeploymentElementModel<A>, target: DeploymentElementModel<A>, relations: RelationshipsAccum<A>);
16
- /**
17
- * Human readable expression of the connection
18
- * Mostly used for testing and debugging
19
- */
20
- get expression(): string;
21
- private _boundary;
22
- /**
23
- * Common ancestor of the source and target elements.
24
- * Represents the boundary of the connection.
25
- */
26
- get boundary(): DeploymentNodeModel<A> | null;
27
- nonEmpty(): boolean;
28
- [customInspectSymbol](_depth: any, _inspectOptions: any, _inspect: any): string;
29
- toString(): string;
30
- /**
31
- * Check if connection contains deployment relation,
32
- * that is directly connected to source or target.
33
- */
34
- hasDirectDeploymentRelation(): boolean;
35
- values(): IteratorLike<RelationshipModel<A> | DeploymentRelationModel<A>>;
36
- /**
37
- * Merge with another connections, if it has the same source and target.
38
- * Returns new connection with union of relationships.
39
- */
40
- mergeWith(others: DeploymentConnectionModel<A>[]): DeploymentConnectionModel<A>;
41
- /**
42
- * Merge with another connection, if it has the same source and target.
43
- * Returns new connection with union of relationships.
44
- */
45
- mergeWith(other: DeploymentConnectionModel<A>): DeploymentConnectionModel<A>;
46
- difference(other: DeploymentConnectionModel<A>): DeploymentConnectionModel<A>;
47
- intersect(other: DeploymentConnectionModel<A>): DeploymentConnectionModel<A>;
48
- equals(other: Connection): boolean;
49
- /**
50
- * Creates a clone of the current `DeploymentConnectionModel` instance with optional overrides.
51
- * if `null` is provided in overrides, the corresponding relation set will be empty.
52
- */
53
- update(overrides?: {
54
- model?: ReadonlySet<RelationshipModel<A>> | null;
55
- deployment?: ReadonlySet<DeploymentRelationModel<A>> | null;
56
- }): DeploymentConnectionModel<A>;
57
- }
58
- declare namespace find_d_exports {
59
- export { findConnection, findConnectionsBetween, findConnectionsWithin };
60
- }
61
- /**
62
- * Resolve connection from source to target
63
- * If direction is `both`, also look for reverse connection
64
- *
65
- * @default direction directed
66
- */
67
- declare function findConnection<M extends Any>(source: DeploymentElementModel<M>, target: DeploymentElementModel<NoInfer<M>>, direction: 'directed'): readonly [DeploymentConnectionModel<M>] | readonly [];
68
- declare function findConnection<M extends Any>(source: DeploymentElementModel<M>, target: DeploymentElementModel<NoInfer<M>>, direction: 'both'): readonly [DeploymentConnectionModel<M>, DeploymentConnectionModel<M>] | readonly [DeploymentConnectionModel<M>] | readonly [];
69
- declare function findConnection<M extends Any>(source: DeploymentElementModel<M>, target: DeploymentElementModel<NoInfer<M>>, direction?: 'directed' | 'both'): readonly [DeploymentConnectionModel<M>, DeploymentConnectionModel<M>] | readonly [DeploymentConnectionModel<M>] | readonly [];
70
- /**
71
- * Resolve all connections between element and others
72
- * By default, look for both directions.
73
- *
74
- * @default direction both
75
- */
76
- declare function findConnectionsBetween<M extends Any>(element: DeploymentElementModel<M>, others: Iterable<DeploymentElementModel<NoInfer<M>>>, direction?: 'directed' | 'both'): readonly DeploymentConnectionModel<M>[];
77
- /**
78
- * Resolve all connections within a given set of elements
79
- */
80
- declare function findConnectionsWithin<M extends Any>(elements: Iterable<DeploymentElementModel<M>>): readonly DeploymentConnectionModel<M>[];
81
- //#endregion
82
- export { DeploymentConnectionModel as a, find_d_exports as i, findConnectionsBetween as n, findConnectionsWithin as r, findConnection as t };