@likec4/core 1.47.0 → 1.49.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 (152) hide show
  1. package/LICENSE +1 -1
  2. package/dist/THIRD-PARTY-LICENSES.md +1012 -0
  3. package/dist/_chunks/Builder.view-element.mjs +2 -0
  4. package/dist/_chunks/LikeC4Model.d.mts +1283 -0
  5. package/dist/_chunks/RichText.mjs +1 -0
  6. package/dist/_chunks/_types.d.mts +777 -0
  7. package/dist/_chunks/_types2.d.mts +36 -0
  8. package/dist/_chunks/assignTagColors.mjs +1 -0
  9. package/dist/_chunks/calcDriftsFromSnapshot.mjs +1 -0
  10. package/dist/_chunks/guards.d.mts +2026 -0
  11. package/dist/_chunks/guards.mjs +4 -0
  12. package/dist/_chunks/index.d.mts +288 -0
  13. package/dist/_chunks/libs/@mantine/colors-generator.mjs +15 -0
  14. package/dist/_chunks/libs/@radix-ui/colors.mjs +1 -0
  15. package/dist/_chunks/libs/@ungap/structured-clone.mjs +1 -0
  16. package/dist/_chunks/libs/bail.mjs +1 -0
  17. package/dist/_chunks/libs/ccount.mjs +1 -0
  18. package/dist/_chunks/libs/character-entities-html4.mjs +1 -0
  19. package/dist/_chunks/libs/character-entities-legacy.mjs +1 -0
  20. package/dist/_chunks/libs/character-entities.mjs +2 -0
  21. package/dist/_chunks/libs/comma-separated-tokens.mjs +1 -0
  22. package/dist/_chunks/libs/decode-named-character-reference.mjs +1 -0
  23. package/dist/_chunks/libs/defu.mjs +1 -0
  24. package/dist/_chunks/libs/devlop.mjs +1 -0
  25. package/dist/_chunks/libs/escape-string-regexp.mjs +1 -0
  26. package/dist/_chunks/libs/extend.mjs +1 -0
  27. package/dist/_chunks/libs/graphology-dag.mjs +1 -0
  28. package/dist/_chunks/libs/graphology.mjs +1 -0
  29. package/dist/_chunks/libs/hast-util-sanitize.mjs +1 -0
  30. package/dist/_chunks/libs/hast-util-to-html.mjs +9 -0
  31. package/dist/_chunks/libs/is-plain-obj.mjs +1 -0
  32. package/dist/_chunks/libs/longest-streak.mjs +1 -0
  33. package/dist/_chunks/libs/markdown-table.mjs +2 -0
  34. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +1 -0
  35. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +3 -0
  36. package/dist/_chunks/libs/mdast-util-gfm.mjs +15 -0
  37. package/dist/_chunks/libs/mdast-util-to-hast.mjs +11 -0
  38. package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -0
  39. package/dist/_chunks/libs/mnemonist.d.mts +164 -0
  40. package/dist/_chunks/libs/mnemonist.mjs +1 -0
  41. package/dist/_chunks/libs/natural-compare-lite.mjs +9 -0
  42. package/dist/_chunks/libs/ohash.mjs +1 -0
  43. package/dist/_chunks/libs/rehype-sanitize.mjs +1 -0
  44. package/dist/_chunks/libs/rehype-stringify.mjs +1 -0
  45. package/dist/_chunks/libs/remark-gfm.mjs +1 -0
  46. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +3 -0
  47. package/dist/_chunks/libs/remark-parse.mjs +1 -0
  48. package/dist/_chunks/libs/remark-rehype.mjs +1 -0
  49. package/dist/_chunks/libs/remeda.mjs +1 -0
  50. package/dist/_chunks/libs/trough.mjs +1 -0
  51. package/dist/_chunks/libs/unified.mjs +1 -0
  52. package/dist/_chunks/rolldown-runtime.mjs +1 -0
  53. package/dist/_chunks/theme.d.mts +148 -0
  54. package/dist/_chunks/to-text.d.mts +404 -0
  55. package/dist/_chunks/to-text.mjs +1 -0
  56. package/dist/_chunks/vector.d.mts +198 -0
  57. package/dist/_chunks/vector.mjs +1 -0
  58. package/dist/builder/index.d.mts +5 -775
  59. package/dist/builder/index.mjs +1 -1053
  60. package/dist/compute-view/index.d.mts +156 -56
  61. package/dist/compute-view/index.mjs +2 -229
  62. package/dist/geometry/index.d.mts +2 -109
  63. package/dist/geometry/index.mjs +1 -328
  64. package/dist/index.d.mts +14 -20
  65. package/dist/index.mjs +1 -18
  66. package/dist/model/index.d.mts +5 -57
  67. package/dist/model/index.mjs +1 -4
  68. package/dist/styles/index.d.mts +3 -117
  69. package/dist/styles/index.mjs +1 -63
  70. package/dist/types/index.d.mts +3 -47
  71. package/dist/types/index.mjs +1 -17
  72. package/dist/utils/graphology/index.d.mts +2 -1864
  73. package/dist/utils/graphology/index.mjs +1 -1
  74. package/dist/utils/index.d.mts +4 -124
  75. package/dist/utils/index.mjs +1 -44
  76. package/package.json +20 -24
  77. package/compute-view/relationships/package.json +0 -4
  78. package/dist/compute-view/relationships-view/index.d.mts +0 -51
  79. package/dist/compute-view/relationships-view/index.mjs +0 -185
  80. package/dist/model/connection/deployment/index.d.mts +0 -15
  81. package/dist/model/connection/deployment/index.mjs +0 -2
  82. package/dist/model/connection/index.d.mts +0 -75
  83. package/dist/model/connection/index.mjs +0 -3
  84. package/dist/model/connection/model/index.d.mts +0 -15
  85. package/dist/model/connection/model/index.mjs +0 -2
  86. package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
  87. package/dist/shared/core.78IWAHAE.mjs +0 -332
  88. package/dist/shared/core.B85MJLTf.mjs +0 -5
  89. package/dist/shared/core.BFd1lU9R.mjs +0 -29
  90. package/dist/shared/core.BKlholso.mjs +0 -3
  91. package/dist/shared/core.BNN-3vPH.mjs +0 -1255
  92. package/dist/shared/core.BPGOjone.d.mts +0 -46
  93. package/dist/shared/core.BP_QHEXs.mjs +0 -785
  94. package/dist/shared/core.BbE4y-yl.mjs +0 -177
  95. package/dist/shared/core.Bdy3hhTc.mjs +0 -28382
  96. package/dist/shared/core.BfCKSW-g.d.mts +0 -1266
  97. package/dist/shared/core.BhNcrwzK.mjs +0 -7
  98. package/dist/shared/core.BkVA6gjl.mjs +0 -5
  99. package/dist/shared/core.BoYfZOBm.mjs +0 -3
  100. package/dist/shared/core.BsSXS-_R.mjs +0 -7
  101. package/dist/shared/core.C3JowhaZ.mjs +0 -32
  102. package/dist/shared/core.C4x8aaWa.mjs +0 -27
  103. package/dist/shared/core.CAgYpDtM.d.mts +0 -98
  104. package/dist/shared/core.CHf8VEa3.mjs +0 -1206
  105. package/dist/shared/core.CLSZtnFh.mjs +0 -69
  106. package/dist/shared/core.C_3y3eqV.d.mts +0 -139
  107. package/dist/shared/core.CbT8JVYL.mjs +0 -5
  108. package/dist/shared/core.CdNCAwq7.mjs +0 -176
  109. package/dist/shared/core.CmGY9blO.mjs +0 -6717
  110. package/dist/shared/core.CmPXpJ8l.mjs +0 -21
  111. package/dist/shared/core.Coi_LOUZ.mjs +0 -7
  112. package/dist/shared/core.CqAJJpK_.mjs +0 -3
  113. package/dist/shared/core.CywrQs86.d.mts +0 -31
  114. package/dist/shared/core.D00YbOhQ.d.mts +0 -300
  115. package/dist/shared/core.D0WZutNd.mjs +0 -94
  116. package/dist/shared/core.D4npX2q8.mjs +0 -18
  117. package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
  118. package/dist/shared/core.DC5IAaDT.d.mts +0 -334
  119. package/dist/shared/core.DE9qzhn8.d.mts +0 -83
  120. package/dist/shared/core.DGcIbsj4.mjs +0 -3946
  121. package/dist/shared/core.DH7TXqXf.mjs +0 -136
  122. package/dist/shared/core.DKhRkHRN.d.mts +0 -41
  123. package/dist/shared/core.DRJma0Ol.mjs +0 -22
  124. package/dist/shared/core.DU5SRqNF.mjs +0 -2209
  125. package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
  126. package/dist/shared/core.DbfO90vF.mjs +0 -434
  127. package/dist/shared/core.DcS-0zys.mjs +0 -10
  128. package/dist/shared/core.Dh119QSP.mjs +0 -4995
  129. package/dist/shared/core.DjcWextK.mjs +0 -1371
  130. package/dist/shared/core.Dojz4bvg.d.mts +0 -504
  131. package/dist/shared/core.FZ305VYd.mjs +0 -21
  132. package/dist/shared/core.OtRNdMxy.d.mts +0 -352
  133. package/dist/shared/core.RfnaEmgA.mjs +0 -7
  134. package/dist/shared/core.btEq3i3f.mjs +0 -300
  135. package/dist/shared/core.oSV6SRfk.mjs +0 -13
  136. package/dist/shared/core.om36dXXW.mjs +0 -41
  137. package/dist/shared/core.osFs8tU7.d.mts +0 -466
  138. package/dist/shared/core.q10OP9oJ.mjs +0 -5
  139. package/dist/shared/core.tpvDGvdC.d.mts +0 -87
  140. package/dist/shared/core.uFk_o9X6.mjs +0 -13
  141. package/dist/types/_aux.d.mts +0 -4
  142. package/dist/types/_aux.mjs +0 -8
  143. package/dist/types/expression-model.d.mts +0 -190
  144. package/dist/types/expression-model.mjs +0 -109
  145. package/dist/types/expression.d.mts +0 -6
  146. package/dist/types/expression.mjs +0 -113
  147. package/dist/types/fqnRef.d.mts +0 -60
  148. package/dist/types/fqnRef.mjs +0 -45
  149. package/dist/types/scalar.d.mts +0 -2
  150. package/dist/types/scalar.mjs +0 -4
  151. package/dist/utils/iterable/index.d.mts +0 -132
  152. package/dist/utils/iterable/index.mjs +0 -62
@@ -1,504 +0,0 @@
1
- import { Tagged, NonEmptyTuple, IsNever, PartialDeep, WritableDeep, Except } from 'type-fest';
2
- import { h as ElementShape, C as Color, B as BorderStyle, e as ShapeSize, S as SpacingSize, d as TextSize, f as RelationshipLineType, g as RelationshipArrowType, T as ThemeColor, G as ColorLiteral, Q as CustomColorDefinitions, a as LikeC4Theme, b as LikeC4StyleDefaults } from './core.DC5IAaDT.mjs';
3
- import { A as Any, s as WithOptionalTags, u as WithOptionalLinks, S as StrictViewId, m as _stage, n as _type, F as Fqn, R as RelationKind, W as WithDescriptionAndTech, v as WithMetadata, w as WithNotation, E as ElementKind, T as Tag, y as DeploymentKind, C as MetadataKey, G as WithTags, x as DeploymentFqn } from './core.D00YbOhQ.mjs';
4
- import { N as NonEmptyArray, E as ExclusiveUnion, a as NonEmptyReadonlyArray, L as Link } from './core.DB0Ue5Wx.mjs';
5
- import { M as MarkdownOrString, I as Icon, d as RelationId, T as Tag$1, P as ProjectId, j as NodeId, k as EdgeId, n as StepEdgeKind } from './core.C_3y3eqV.mjs';
6
- import { FqnRef } from '../types/fqnRef.mjs';
7
- import { ModelExpression, ModelFqnExpr } from '../types/expression-model.mjs';
8
- import { P as Point, X as XYPoint, B as BBox } from './core.BPGOjone.mjs';
9
-
10
- interface AnyIncludePredicate<Expr> {
11
- include: Expr[];
12
- exclude?: never;
13
- }
14
- interface AnyExcludePredicate<Expr> {
15
- include?: never;
16
- exclude: Expr[];
17
- }
18
- interface AnyViewRuleStyle<Expr> {
19
- targets: Expr[];
20
- notation?: string;
21
- style: {
22
- border?: BorderStyle;
23
- opacity?: number;
24
- multiple?: boolean;
25
- size?: ShapeSize;
26
- padding?: SpacingSize;
27
- textSize?: TextSize;
28
- color?: Color;
29
- shape?: ElementShape;
30
- icon?: Icon;
31
- };
32
- }
33
- interface ViewRuleGlobalStyle {
34
- styleId: GlobalStyleID;
35
- }
36
- declare function isViewRuleGlobalStyle(rule: object): rule is ViewRuleGlobalStyle;
37
- interface ViewRuleGlobalPredicateRef {
38
- predicateId: GlobalPredicateId;
39
- }
40
- declare function isViewRuleGlobalPredicateRef(rule: object): rule is ViewRuleGlobalPredicateRef;
41
- type RankValue = 'max' | 'min' | 'same' | 'sink' | 'source';
42
- interface ViewRuleRank<Expr> {
43
- targets: Expr[];
44
- rank: RankValue;
45
- }
46
- type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
47
- declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
48
- interface ViewRuleAutoLayout {
49
- direction: AutoLayoutDirection;
50
- nodeSep?: number;
51
- rankSep?: number;
52
- }
53
- declare function isViewRuleAutoLayout(rule: object): rule is ViewRuleAutoLayout;
54
- interface ViewAutoLayout {
55
- direction: ViewRuleAutoLayout['direction'];
56
- rankSep?: number;
57
- nodeSep?: number;
58
- }
59
- /**
60
- * v1 Manual layout of a view, stored in the block comment to the view definition.
61
- * Keeping this type for backward compatibility and migration purposes.
62
- *
63
- * @deprecated Use {@link ViewManualLayoutSnapshot} instead
64
- */
65
- type ViewManualLayout = {
66
- readonly hash: string;
67
- readonly x: number;
68
- readonly y: number;
69
- readonly width: number;
70
- readonly height: number;
71
- readonly autoLayout: ViewAutoLayout;
72
- readonly nodes: Record<string, {
73
- isCompound: boolean;
74
- x: number;
75
- y: number;
76
- width: number;
77
- height: number;
78
- }>;
79
- readonly edges: Record<string, {
80
- points: NonEmptyArray<Point>;
81
- controlPoints?: NonEmptyArray<XYPoint>;
82
- labelBBox?: BBox;
83
- }>;
84
- };
85
- type ViewType = 'element' | 'dynamic' | 'deployment';
86
- interface BaseViewProperties<A extends Any> extends WithOptionalTags<A>, WithOptionalLinks {
87
- readonly id: StrictViewId<A>;
88
- readonly title: string | null;
89
- readonly description: MarkdownOrString | null;
90
- /**
91
- * Source file containing this view, relative to the project root.
92
- * Undefined if the view is auto-generated.
93
- */
94
- readonly sourcePath?: string | undefined;
95
- }
96
- interface BaseParsedViewProperties<A extends Any> extends BaseViewProperties<A> {
97
- /**
98
- * Internal field to identify the stage of the view.
99
- * This is used to create the correct type of the view.
100
- */
101
- readonly [_stage]: 'parsed';
102
- /**
103
- * URI to the source file of this view.
104
- * Undefined if the view is auto-generated.
105
- */
106
- readonly docUri?: string | undefined;
107
- }
108
- type NodeNotation = {
109
- kinds: string[];
110
- shape: ElementShape;
111
- color: Color;
112
- title: string;
113
- };
114
- interface ViewWithNotation {
115
- notation?: {
116
- nodes: NodeNotation[];
117
- };
118
- }
119
- interface ViewWithHash {
120
- /**
121
- * Hash of the view object.
122
- * This is used to detect changes in layout
123
- */
124
- hash: string;
125
- }
126
-
127
- /**
128
- * Predicates scoped to logical model
129
- */
130
- interface ElementViewIncludePredicate<A extends Any = Any> extends AnyIncludePredicate<ModelExpression<A>> {
131
- }
132
- interface ElementViewExcludePredicate<A extends Any = Any> extends AnyExcludePredicate<ModelExpression<A>> {
133
- }
134
- type ElementViewPredicate<A extends Any = Any> = ElementViewIncludePredicate<A> | ElementViewExcludePredicate<A>;
135
- interface ElementViewRuleGroup<A extends Any = Any> {
136
- groupRules: Array<ElementViewPredicate<A> | ElementViewRuleGroup<A>>;
137
- title: string | null;
138
- color?: Color;
139
- border?: BorderStyle;
140
- opacity?: number;
141
- multiple?: boolean;
142
- size?: ShapeSize;
143
- padding?: SpacingSize;
144
- textSize?: TextSize;
145
- }
146
- declare function isViewRuleGroup<A extends Any>(rule: ElementViewRule<A>): rule is ElementViewRuleGroup<A>;
147
- interface ElementViewRuleStyle<A extends Any = Any> extends AnyViewRuleStyle<ModelFqnExpr<A>> {
148
- }
149
- interface ElementViewRuleRank<A extends Any = Any> extends ViewRuleRank<ModelFqnExpr<A>> {
150
- }
151
- declare function isViewRuleRank<A extends Any>(rule: ElementViewRule<A>): rule is ElementViewRuleRank<A>;
152
- type ElementViewRule<A extends Any = Any> = ExclusiveUnion<{
153
- IncludePredicate: ElementViewIncludePredicate<A>;
154
- ExcludePredicate: ElementViewExcludePredicate<A>;
155
- Group: ElementViewRuleGroup<A>;
156
- Style: ElementViewRuleStyle<A>;
157
- GlobalStyle: ViewRuleGlobalStyle;
158
- GlobalPredicateRef: ViewRuleGlobalPredicateRef;
159
- AutoLayout: ViewRuleAutoLayout;
160
- Rank: ElementViewRuleRank<A>;
161
- }>;
162
- interface ParsedElementView<A extends Any = Any> extends BaseParsedViewProperties<A> {
163
- [_type]: 'element';
164
- readonly rules: ElementViewRule<A>[];
165
- readonly viewOf?: Fqn<A>;
166
- readonly extends?: StrictViewId<A>;
167
- }
168
-
169
- interface DynamicStep<A extends Any = Any> {
170
- readonly source: Fqn<A>;
171
- readonly target: Fqn<A>;
172
- readonly title?: string | null;
173
- readonly kind?: RelationKind<A>;
174
- readonly description?: MarkdownOrString;
175
- readonly technology?: string;
176
- readonly notation?: string;
177
- readonly notes?: MarkdownOrString;
178
- readonly color?: Color;
179
- readonly line?: RelationshipLineType;
180
- readonly head?: RelationshipArrowType;
181
- readonly tail?: RelationshipArrowType;
182
- readonly isBackward?: boolean;
183
- readonly navigateTo?: StrictViewId<A>;
184
- /**
185
- * Path to the AST node relative to the view body ast
186
- * Used to locate the step in the source code
187
- */
188
- readonly astPath: string;
189
- }
190
- interface DynamicStepsSeries<A extends Any = Any> {
191
- readonly seriesId: string;
192
- readonly __series: NonEmptyReadonlyArray<DynamicStep<A>>;
193
- }
194
- interface DynamicStepsParallel<A extends Any = Any> {
195
- readonly parallelId: string;
196
- readonly __parallel: NonEmptyReadonlyArray<DynamicStep<A> | DynamicStepsSeries<A>>;
197
- }
198
- declare function getParallelStepsPrefix(id: string): string | null;
199
- type DynamicViewStep<A extends Any = Any> = ExclusiveUnion<{
200
- Step: DynamicStep<A>;
201
- Series: DynamicStepsSeries<A>;
202
- Parallel: DynamicStepsParallel<A>;
203
- }>;
204
- declare function isDynamicStep<A extends Any>(step: DynamicViewStep<A> | undefined): step is DynamicStep<A>;
205
- declare function isDynamicStepsParallel<A extends Any>(step: DynamicViewStep<A> | undefined): step is DynamicStepsParallel<A>;
206
- declare function isDynamicStepsSeries<A extends Any>(step: DynamicViewStep<A> | undefined): step is DynamicStepsSeries<A>;
207
- interface DynamicViewIncludeRule<A extends Any = Any> {
208
- include: ModelFqnExpr.Any<A>[];
209
- }
210
- type DynamicViewRule<A extends Any = Any> = ExclusiveUnion<{
211
- Include: DynamicViewIncludeRule<A>;
212
- GlobalPredicateRef: ViewRuleGlobalPredicateRef;
213
- ElementViewRuleStyle: ElementViewRuleStyle<A>;
214
- GlobalStyle: ViewRuleGlobalStyle;
215
- AutoLayout: ViewRuleAutoLayout;
216
- }>;
217
- type DynamicViewDisplayVariant = 'diagram' | 'sequence';
218
- interface ParsedDynamicView<A extends Any = Any> extends BaseParsedViewProperties<A> {
219
- [_type]: 'dynamic';
220
- /**
221
- * How to display the dynamic view
222
- * - `diagram`: display as a regular likec4 view
223
- * - `sequence`: display as a sequence diagram
224
- *
225
- * @default 'diagram'
226
- */
227
- readonly variant?: DynamicViewDisplayVariant;
228
- readonly steps: DynamicViewStep<A>[];
229
- readonly rules: DynamicViewRule<A>[];
230
- }
231
-
232
- type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
233
- type GlobalPredicates<A extends Any = Any> = NonEmptyArray<ElementViewPredicate<A>>;
234
- type GlobalDynamicPredicates<A extends Any = Any> = NonEmptyArray<DynamicViewIncludeRule<A>>;
235
- type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
236
- type GlobalStyles<A extends Any = Any> = NonEmptyTuple<ElementViewRuleStyle<A>>;
237
- interface ModelGlobals<A extends Any = Any> {
238
- readonly predicates: Record<GlobalPredicateId, GlobalPredicates<A>>;
239
- readonly dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates<A>>;
240
- readonly styles: Record<GlobalStyleID, GlobalStyles<A>>;
241
- }
242
-
243
- interface ElementStyle {
244
- readonly icon?: Icon;
245
- readonly shape?: ElementShape;
246
- readonly color?: Color;
247
- readonly border?: BorderStyle;
248
- /**
249
- * In percentage 0-100, 0 is fully transparent
250
- *
251
- * @default 100
252
- */
253
- readonly opacity?: number;
254
- /**
255
- * If true, the element is rendered as multiple shapes
256
- * @default false
257
- */
258
- readonly multiple?: boolean;
259
- /**
260
- * Shape size
261
- *
262
- * @default 'md'
263
- */
264
- readonly size?: ShapeSize;
265
- readonly padding?: SpacingSize;
266
- readonly textSize?: TextSize;
267
- }
268
- type WithSizes = Pick<ElementStyle, 'size' | 'padding' | 'textSize'>;
269
- /**
270
- * Ensures that the sizes are set to default values if they are not set
271
- */
272
- declare function ensureSizes<S extends WithSizes>({ size, padding, textSize, ...rest }: S, defaultSize?: "xs" | "sm" | "md" | "lg" | "xl"): Omit<S, 'size' | 'padding' | 'textSize'> & Required<WithSizes>;
273
- interface Element<A extends Any = Any> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A>, WithNotation {
274
- readonly id: Fqn<A>;
275
- readonly kind: ElementKind<A>;
276
- readonly title: string;
277
- readonly style: ElementStyle;
278
- }
279
- interface AbstractRelationship<A extends Any> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A> {
280
- readonly id: RelationId;
281
- readonly title?: string | null;
282
- readonly kind?: RelationKind<A>;
283
- readonly color?: Color;
284
- readonly line?: RelationshipLineType;
285
- readonly head?: RelationshipArrowType;
286
- readonly tail?: RelationshipArrowType;
287
- readonly navigateTo?: StrictViewId<A>;
288
- }
289
- /**
290
- * Relationship between two model elements
291
- */
292
- interface Relationship<A extends Any = Any> extends AbstractRelationship<A> {
293
- readonly source: FqnRef.ModelRef<A>;
294
- readonly target: FqnRef.ModelRef<A>;
295
- }
296
- /**
297
- * Backward compatibility alias
298
- * @deprecated Use {@link Relationship} instead
299
- */
300
- type ModelRelation<A extends Any = Any> = Relationship<A>;
301
-
302
- /**
303
- * Element and deployment kind specification
304
- */
305
- interface ElementSpecification {
306
- tags?: Tag$1[];
307
- title?: string;
308
- summary?: MarkdownOrString;
309
- description?: MarkdownOrString;
310
- technology?: string;
311
- notation?: string;
312
- links?: NonEmptyArray<Link>;
313
- style: {
314
- shape?: ElementShape;
315
- icon?: Icon;
316
- color?: Color;
317
- border?: BorderStyle;
318
- opacity?: number;
319
- size?: ShapeSize;
320
- padding?: SpacingSize;
321
- textSize?: TextSize;
322
- multiple?: boolean;
323
- };
324
- }
325
- interface TagSpecification {
326
- color: ThemeColor | ColorLiteral;
327
- }
328
- /**
329
- * Checks if tag color is defined in the specification
330
- * Expects HEX, `rgb(...)` or `rgba(...)` color
331
- */
332
- declare function isTagColorSpecified(spec: string | TagSpecification): spec is {
333
- color: ColorLiteral;
334
- };
335
- interface RelationshipSpecification {
336
- technology?: string;
337
- notation?: string;
338
- color?: Color;
339
- line?: RelationshipLineType;
340
- head?: RelationshipArrowType;
341
- tail?: RelationshipArrowType;
342
- }
343
- type Specification<A> = A extends Any ? {
344
- tags: {
345
- [key in Tag<A>]: TagSpecification;
346
- };
347
- elements: {
348
- [key in ElementKind<A>]: Partial<ElementSpecification>;
349
- };
350
- deployments: {
351
- [key in DeploymentKind<A>]: Partial<ElementSpecification>;
352
- };
353
- relationships: {
354
- [key in RelationKind<A>]: Partial<RelationshipSpecification>;
355
- };
356
- metadataKeys?: IsNever<MetadataKey<A>> extends true ? never : MetadataKey<A>[];
357
- customColors?: CustomColorDefinitions;
358
- } : never;
359
-
360
- type LikeC4ProjectTheme = PartialDeep<WritableDeep<LikeC4Theme>, {
361
- recurseIntoArrays: false;
362
- allowUndefinedInNonTupleArrays: false;
363
- }>;
364
- type LikeC4ProjectStyleDefaults = PartialDeep<WritableDeep<LikeC4StyleDefaults>, {
365
- recurseIntoArrays: false;
366
- allowUndefinedInNonTupleArrays: false;
367
- }>;
368
- interface LikeC4ProjectStylesConfig {
369
- theme?: LikeC4ProjectTheme;
370
- defaults?: LikeC4ProjectStyleDefaults;
371
- }
372
- interface LikeC4ProjectManualLayoutsConfig {
373
- outDir: string;
374
- }
375
- /**
376
- * Configuration of the project, as read from the config file.
377
- * LikeC4 projects encapsulate models, and can import from each other
378
- */
379
- interface LikeC4Project {
380
- /**
381
- * ID of the project, casted to {@link scalar.ProjectId}
382
- */
383
- readonly id: ProjectId;
384
- title?: string;
385
- /**
386
- * Custom styles
387
- */
388
- styles?: LikeC4ProjectStylesConfig | undefined;
389
- /**
390
- * Configuration for manual layouts snapshots
391
- */
392
- manualLayouts?: LikeC4ProjectManualLayoutsConfig | undefined;
393
- }
394
-
395
- type ComputedNodeStyle = Except<ElementStyle, 'icon' | 'shape' | 'color', {
396
- requireExactProps: true;
397
- }>;
398
- interface ComputedNode<A extends Any = Any> extends WithTags<A>, WithOptionalLinks {
399
- id: NodeId;
400
- kind: ElementKind<A> | DeploymentKind<A> | '@group';
401
- parent: NodeId | null;
402
- /**
403
- * Reference to model element
404
- */
405
- modelRef?: Fqn<A>;
406
- /**
407
- * Reference to deployment element
408
- */
409
- deploymentRef?: DeploymentFqn<A>;
410
- title: string;
411
- /**
412
- * Description of the node
413
- * either summary or description
414
- */
415
- description?: MarkdownOrString | null;
416
- technology?: string | null;
417
- children: NodeId[];
418
- inEdges: EdgeId[];
419
- outEdges: EdgeId[];
420
- shape: ElementShape;
421
- color: Color;
422
- icon?: Icon | null;
423
- style: ComputedNodeStyle;
424
- navigateTo?: StrictViewId<A> | null;
425
- level: number;
426
- depth?: number | null;
427
- /**
428
- * If this node was customized in the view
429
- */
430
- isCustomized?: boolean;
431
- notation?: string | null;
432
- }
433
- interface ComputedEdge<A extends Any = Any> extends WithOptionalTags<A> {
434
- id: EdgeId;
435
- parent: NodeId | null;
436
- source: NodeId;
437
- target: NodeId;
438
- label: string | null;
439
- description?: MarkdownOrString | null;
440
- technology?: string | null;
441
- relations: RelationId[];
442
- kind?: RelationKind<A> | typeof StepEdgeKind;
443
- notation?: string;
444
- notes?: MarkdownOrString;
445
- color: Color;
446
- line: RelationshipLineType;
447
- head?: RelationshipArrowType;
448
- tail?: RelationshipArrowType;
449
- navigateTo?: StrictViewId<A> | null;
450
- /**
451
- * If this edge is derived from custom relationship predicate
452
- */
453
- isCustomized?: boolean;
454
- /**
455
- * Path to the AST node relative to the view body ast
456
- * Available only in dynamic views
457
- * @internal
458
- */
459
- astPath?: string;
460
- /**
461
- * For layouting purposes
462
- * @default 'forward'
463
- */
464
- dir?: 'forward' | 'back' | 'both';
465
- }
466
- interface ComputedRankConstraint {
467
- type: RankValue;
468
- nodes: NodeId[];
469
- }
470
- interface BaseComputedViewProperties<A extends Any> extends BaseViewProperties<A>, ViewWithHash, ViewWithNotation {
471
- readonly [_stage]: 'computed';
472
- readonly autoLayout: ViewAutoLayout;
473
- readonly nodes: ReadonlyArray<ComputedNode<A>>;
474
- readonly edges: ReadonlyArray<ComputedEdge<A>>;
475
- /**
476
- * If the view has manual layout (v2)
477
- */
478
- readonly hasManualLayout?: boolean;
479
- /**
480
- * Manual layout data (v1), for compatibility during migration
481
- * @deprecated
482
- */
483
- readonly manualLayout?: ViewManualLayout | undefined;
484
- }
485
- interface ComputedElementView<A extends Any = Any> extends BaseComputedViewProperties<A> {
486
- readonly [_type]: 'element';
487
- readonly viewOf?: Fqn<A>;
488
- readonly extends?: StrictViewId<A>;
489
- readonly ranks?: ComputedRankConstraint[];
490
- }
491
- interface ComputedDeploymentView<A extends Any = Any> extends BaseComputedViewProperties<A> {
492
- readonly [_type]: 'deployment';
493
- }
494
- interface ComputedDynamicView<A extends Any = Any> extends BaseComputedViewProperties<A> {
495
- readonly [_type]: 'dynamic';
496
- /**
497
- * How to display the dynamic view
498
- * - `diagram`: display as a regular likec4 view
499
- * - `sequence`: display as a sequence diagram
500
- */
501
- readonly variant: DynamicViewDisplayVariant;
502
- }
503
-
504
- export { getParallelStepsPrefix as $, type AbstractRelationship as A, type ViewAutoLayout as B, type ComputedNodeStyle as C, type ViewManualLayout as D, type ElementStyle as E, type ViewType as F, type GlobalPredicateId as G, type BaseViewProperties as H, type BaseParsedViewProperties as I, type ViewWithNotation as J, type ViewWithHash as K, type LikeC4ProjectStylesConfig as L, type ModelGlobals as M, type NodeNotation as N, type ComputedNode as O, type ComputedEdge as P, type ComputedRankConstraint as Q, type Relationship as R, type Specification as S, type TagSpecification as T, type ComputedElementView as U, type ViewRuleGlobalStyle as V, type ComputedDeploymentView as W, type ComputedDynamicView as X, type DynamicStep as Y, type DynamicStepsSeries as Z, type DynamicStepsParallel as _, type GlobalPredicates as a, type DynamicViewStep as a0, isDynamicStep as a1, isDynamicStepsParallel as a2, isDynamicStepsSeries as a3, type DynamicViewIncludeRule as a4, type DynamicViewRule as a5, type DynamicViewDisplayVariant as a6, type ParsedDynamicView as a7, type ElementViewIncludePredicate as a8, type ElementViewExcludePredicate as a9, type ElementViewPredicate as aa, type ElementViewRuleGroup as ab, isViewRuleGroup as ac, type ElementViewRuleStyle as ad, type ElementViewRuleRank as ae, isViewRuleRank as af, type ElementViewRule as ag, type ParsedElementView as ah, type GlobalDynamicPredicates as b, type GlobalStyleID as c, type GlobalStyles as d, ensureSizes as e, type Element as f, type ModelRelation as g, type ElementSpecification as h, isTagColorSpecified as i, type RelationshipSpecification as j, type LikeC4ProjectTheme as k, type LikeC4ProjectStyleDefaults as l, type LikeC4ProjectManualLayoutsConfig as m, type LikeC4Project as n, type AnyIncludePredicate as o, type AnyExcludePredicate as p, type AnyViewRuleStyle as q, isViewRuleGlobalStyle as r, type ViewRuleGlobalPredicateRef as s, isViewRuleGlobalPredicateRef as t, type RankValue as u, type ViewRuleRank as v, type AutoLayoutDirection as w, isAutoLayoutDirection as x, type ViewRuleAutoLayout as y, isViewRuleAutoLayout as z };
@@ -1,21 +0,0 @@
1
- import { e } from './core.DRJma0Ol.mjs';
2
- import { i as invariant } from './core.D4npX2q8.mjs';
3
-
4
- function isome(arg1, arg2) {
5
- const pred = arg2 ?? arg1;
6
- invariant(e(pred));
7
- function _some(iter) {
8
- for (const value of iter) {
9
- if (pred(value)) {
10
- return true;
11
- }
12
- }
13
- return false;
14
- }
15
- if (!arg2) {
16
- return _some;
17
- }
18
- return _some(arg1);
19
- }
20
-
21
- export { isome as i };