@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,466 +0,0 @@
1
- import { Simplify, IsAny } from 'type-fest';
2
- import { A as Any, U as Unknown, W as WithDescriptionAndTech, s as WithOptionalTags, u as WithOptionalLinks, v as WithMetadata, w as WithNotation, x as DeploymentFqn, y as DeploymentKind, F as Fqn, n as _type, m as _stage, o as _layout, S as StrictViewId, N as NodeId, z as EdgeId, k as ExtractOnStage, M as ModelStage, P as ProjectId, a as ElementId, D as DeploymentId, d as AnyParsed, i as UnknownParsed, V as ViewId$1, b as AnyComputed, g as UnknownComputed, c as AnyLayouted, h as UnknownLayouted, f as SpecAux, e as Aux, B as Never } from './core.D00YbOhQ.mjs';
3
- import { a as NonEmptyReadonlyArray, N as NonEmptyArray, E as ExclusiveUnion, K as KeysOf } from './core.DB0Ue5Wx.mjs';
4
- import { E as ElementStyle, A as AbstractRelationship, F as ViewType, B as ViewAutoLayout, J as ViewWithNotation, H as BaseViewProperties, K as ViewWithHash, O as ComputedNode, P as ComputedEdge, a6 as DynamicViewDisplayVariant, I as BaseParsedViewProperties, o as AnyIncludePredicate, p as AnyExcludePredicate, q as AnyViewRuleStyle, y as ViewRuleAutoLayout, ah as ParsedElementView, a7 as ParsedDynamicView, U as ComputedElementView, W as ComputedDeploymentView, X as ComputedDynamicView, n as LikeC4Project, S as Specification, f as Element, R as Relationship, M as ModelGlobals } from './core.Dojz4bvg.mjs';
5
- import { FqnRef } from '../types/fqnRef.mjs';
6
- import { F as Fqn$1, V as ViewId, M as MarkdownOrString, d as RelationId } from './core.C_3y3eqV.mjs';
7
- import { B as BBox, P as Point, X as XYPoint } from './core.BPGOjone.mjs';
8
- import { j as Expression, F as FqnExpr } from './core.DC5IAaDT.mjs';
9
-
10
- interface DeploymentNode<A extends Any = Unknown> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A>, WithNotation {
11
- element?: never;
12
- readonly id: DeploymentFqn<A>;
13
- readonly kind: DeploymentKind<A>;
14
- readonly title: string;
15
- readonly style: ElementStyle;
16
- }
17
- interface DeployedInstance<A extends Any = Unknown> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A>, WithNotation {
18
- kind?: never;
19
- /**
20
- * Format: `<DeploymentNode Fqn>.<Instance Id>`
21
- * i.e parent fqn is deployment target
22
- */
23
- readonly id: DeploymentFqn<A>;
24
- readonly element: Fqn<A>;
25
- readonly title?: string;
26
- readonly style: ElementStyle;
27
- }
28
- type DeploymentElement<A extends Any = Unknown> = DeploymentNode<A> | DeployedInstance<A>;
29
- type DeploymentElementRef<A extends Any = Unknown> = {
30
- readonly id: DeploymentFqn<A>;
31
- readonly element?: Fqn<A>;
32
- };
33
- declare function isDeploymentNode<A extends Any>(el: DeploymentElement<A>): el is DeploymentNode<A>;
34
- declare function isDeployedInstance<A extends Any>(el: DeploymentElement<A>): el is DeployedInstance<A>;
35
- /**
36
- * Relationship in deployment model
37
- */
38
- interface DeploymentRelationship<A extends Any = Unknown> extends AbstractRelationship<A> {
39
- readonly source: FqnRef.DeploymentRef<A>;
40
- readonly target: FqnRef.DeploymentRef<A>;
41
- }
42
- /**
43
- * Backward compatibility alias
44
- * @deprecated Use {@link DeploymentRelationship} instead
45
- */
46
- type DeploymentRelation<A extends Any = Unknown> = DeploymentRelationship<A>;
47
-
48
- type LayoutedViewDriftReason = 'not-exists' | 'type-changed' | 'nodes-added' | 'nodes-removed' | 'nodes-drift' | 'edges-added' | 'edges-removed' | 'edges-drift';
49
- type DiagramNodeDriftReason = 'removed' | 'added' | 'label-changed' | 'modelRef-changed' | 'parent-changed' | 'children-changed' | 'became-compound' | 'became-leaf' | 'shape-changed';
50
- type DiagramEdgeDriftReason = 'removed' | 'added' | 'label-added' | 'label-removed' | 'label-changed' | 'notes-changed' | 'direction-changed' | 'source-changed' | 'target-changed';
51
- type ViewManualLayoutSnapshotPerType = {
52
- readonly [_type]: 'element';
53
- readonly viewOf?: Fqn$1;
54
- readonly extends?: ViewId;
55
- } | {
56
- readonly [_type]: 'deployment';
57
- } | {
58
- readonly [_type]: 'dynamic';
59
- readonly sequenceLayout: LayoutedDynamicView.Sequence.Layout;
60
- };
61
- type ViewManualLayoutSnapshot<Type extends ViewType = ViewType> = Simplify<ViewManualLayoutSnapshotPerType & {
62
- readonly id: ViewId;
63
- readonly title: string | null;
64
- readonly description: MarkdownOrString | null;
65
- readonly [_type]: Type;
66
- readonly [_stage]: 'layouted';
67
- readonly hash: string;
68
- readonly nodes: ReadonlyArray<DiagramNode>;
69
- readonly edges: ReadonlyArray<DiagramEdge>;
70
- readonly bounds: BBox;
71
- readonly autoLayout: ViewAutoLayout;
72
- } & ViewWithNotation>;
73
-
74
- interface DiagramNode<A extends Any = Any> extends ComputedNode<A>, BBox {
75
- /**
76
- * Absolute X coordinate
77
- */
78
- x: number;
79
- /**
80
- * Absolute Y coordinate
81
- */
82
- y: number;
83
- width: number;
84
- height: number;
85
- /**
86
- * Bounding box of label
87
- * (Absolute coordinates)
88
- */
89
- labelBBox: BBox;
90
- /**
91
- * List of reasons causing node drift
92
- */
93
- drifts?: NonEmptyReadonlyArray<DiagramNodeDriftReason> | null;
94
- }
95
- interface DiagramEdge<A extends Any = Any> extends ComputedEdge<A> {
96
- /**
97
- * Bezier points
98
- * (Absolute coordinates)
99
- */
100
- points: NonEmptyArray<Point>;
101
- /**
102
- * Control points to adjust the edge
103
- * (Absolute coordinates)
104
- */
105
- controlPoints?: NonEmptyArray<XYPoint> | null;
106
- /**
107
- * Bounding box of label
108
- * (Absolute coordinates)
109
- */
110
- labelBBox?: BBox | null;
111
- /**
112
- * List of reasons causing edge drift
113
- */
114
- drifts?: NonEmptyReadonlyArray<DiagramEdgeDriftReason> | null;
115
- }
116
- /**
117
- * Type of the layout
118
- * - `auto`: auto-layouted from the current sources
119
- * - `manual`: read from the manually layouted snapshot
120
- */
121
- type LayoutType = 'auto' | 'manual';
122
- interface BaseLayoutedViewProperties<A extends Any> extends BaseViewProperties<A>, ViewWithHash, ViewWithNotation {
123
- readonly [_stage]: 'layouted';
124
- /**
125
- * If undefined, view does not have any manual layouts, and is auto-layouted
126
- */
127
- readonly [_layout]?: LayoutType;
128
- readonly autoLayout: ViewAutoLayout;
129
- readonly nodes: ReadonlyArray<DiagramNode<A>>;
130
- readonly edges: ReadonlyArray<DiagramEdge<A>>;
131
- readonly bounds: BBox;
132
- /**
133
- * If diagram has manual layout
134
- * But was changed and layout should be recalculated
135
- * @deprecated manual layout v2 uses {@link drifts}
136
- */
137
- readonly hasLayoutDrift?: boolean;
138
- /**
139
- * List of reasons causing layout drift
140
- * If undefined or null, there is no layout drift or view is auto-layouted
141
- */
142
- readonly drifts?: NonEmptyReadonlyArray<LayoutedViewDriftReason> | null;
143
- }
144
- interface LayoutedElementView<A extends Any = Any> extends BaseLayoutedViewProperties<A> {
145
- readonly [_type]: 'element';
146
- readonly viewOf?: Fqn<A>;
147
- readonly extends?: StrictViewId<A>;
148
- }
149
- interface LayoutedDeploymentView<A extends Any = Any> extends BaseLayoutedViewProperties<A> {
150
- readonly [_type]: 'deployment';
151
- }
152
- interface LayoutedDynamicView<A extends Any = Any> extends BaseLayoutedViewProperties<A> {
153
- readonly [_type]: 'dynamic';
154
- /**
155
- * Default variant of this dynamic view
156
- * - `diagram`: display as a regular likec4 view (default if not specified)
157
- * - `sequence`: display as a sequence diagram
158
- */
159
- readonly variant: DynamicViewDisplayVariant;
160
- /**
161
- * Sequence layout of this dynamic view
162
- */
163
- readonly sequenceLayout: LayoutedDynamicView.Sequence.Layout;
164
- }
165
- declare namespace LayoutedDynamicView {
166
- namespace Sequence {
167
- interface ActorPort {
168
- readonly id: string;
169
- readonly cx: number;
170
- readonly cy: number;
171
- readonly height: number;
172
- readonly type: 'target' | 'source';
173
- readonly position: 'left' | 'right' | 'top' | 'bottom';
174
- }
175
- interface Actor {
176
- readonly id: NodeId;
177
- readonly x: number;
178
- readonly y: number;
179
- readonly width: number;
180
- readonly height: number;
181
- readonly ports: ReadonlyArray<ActorPort>;
182
- }
183
- interface Compound {
184
- readonly id: NodeId;
185
- /**
186
- * Original node id, since multiple compound nodes can be built from one node
187
- */
188
- readonly origin: NodeId;
189
- readonly x: number;
190
- readonly y: number;
191
- readonly width: number;
192
- readonly height: number;
193
- readonly depth: number;
194
- }
195
- interface ParallelArea {
196
- readonly parallelPrefix: string;
197
- readonly x: number;
198
- readonly y: number;
199
- readonly width: number;
200
- readonly height: number;
201
- }
202
- interface Step {
203
- readonly id: EdgeId;
204
- readonly labelBBox?: {
205
- width: number;
206
- height: number;
207
- } | undefined;
208
- readonly sourceHandle: string;
209
- readonly targetHandle: string;
210
- }
211
- interface Layout {
212
- readonly actors: ReadonlyArray<Actor>;
213
- /**
214
- * Steps in the sequence diagram (filtered edges with compound nodes)
215
- */
216
- readonly steps: ReadonlyArray<Step>;
217
- readonly compounds: ReadonlyArray<Compound>;
218
- readonly parallelAreas: ReadonlyArray<ParallelArea>;
219
- readonly bounds: BBox;
220
- }
221
- }
222
- }
223
-
224
- /**
225
- * Predicates scoped to deployment model
226
- */
227
- interface DeploymentViewIncludePredicate<A extends Any = Unknown> extends AnyIncludePredicate<Expression<A>> {
228
- }
229
- interface DeploymentViewExcludePredicate<A extends Any = Unknown> extends AnyExcludePredicate<Expression<A>> {
230
- }
231
- type DeploymentViewPredicate<A extends Any = Unknown> = DeploymentViewIncludePredicate<A> | DeploymentViewExcludePredicate<A>;
232
- interface DeploymentViewRuleStyle<A extends Any = Unknown> extends AnyViewRuleStyle<FqnExpr<A>> {
233
- }
234
- type DeploymentViewRule<A extends Any = Unknown> = ExclusiveUnion<{
235
- Include: DeploymentViewIncludePredicate<A>;
236
- Exclude: DeploymentViewExcludePredicate<A>;
237
- Style: DeploymentViewRuleStyle<A>;
238
- AutoLayout: ViewRuleAutoLayout;
239
- }>;
240
- interface ParsedDeploymentView<A extends Any = Unknown> extends BaseParsedViewProperties<A> {
241
- [_type]: 'deployment';
242
- readonly rules: DeploymentViewRule<A>[];
243
- }
244
-
245
- type ParsedView<A extends Any = Any> = ParsedElementView<A> | ParsedDeploymentView<A> | ParsedDynamicView<A>;
246
-
247
- type ComputedView<A extends Any = Any> = ComputedElementView<A> | ComputedDeploymentView<A> | ComputedDynamicView<A>;
248
- type LayoutedView<A extends Any = Any> = LayoutedElementView<A> | LayoutedDeploymentView<A> | LayoutedDynamicView<A>;
249
- type ProcessedView<A extends Any = Any> = ComputedView<A> | LayoutedView<A>;
250
-
251
- type AnyView<A extends Any = Any> = ParsedElementView<A> | ParsedDeploymentView<A> | ParsedDynamicView<A> | ComputedElementView<A> | ComputedDeploymentView<A> | ComputedDynamicView<A> | LayoutedElementView<A> | LayoutedDeploymentView<A> | LayoutedDynamicView<A>;
252
- type ViewOnStage<V extends AnyView<Any>, T extends ModelStage> = Extract<V, {
253
- [_stage]: T;
254
- }>;
255
- type ViewWithType<V extends AnyView<Any>, T extends ViewType> = Extract<V, {
256
- [_type]: T;
257
- }>;
258
- type ViewRule<A extends Any = Any> = ParsedView<A>['rules'][number];
259
- type ViewRulePredicate<A extends Any = Any> = Extract<ViewRule<A>, {
260
- include: any[];
261
- } | {
262
- exclude: any[];
263
- }>;
264
- declare function isViewRulePredicate<V extends ViewRule<any>>(rule: V): rule is Extract<V, {
265
- include: any[];
266
- } | {
267
- exclude: any[];
268
- }>;
269
- declare function isViewRuleStyle<V extends ViewRule<any>>(rule: V): rule is Extract<V, {
270
- targets: any[];
271
- style: {};
272
- }>;
273
- declare function isComputedView<V extends AnyView<any>>(view: V): view is ExtractOnStage<V, 'computed'>;
274
- declare function isDiagramView<V extends AnyView<any>>(view: V): view is ExtractOnStage<V, 'layouted'>;
275
-
276
- declare function isElementView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'element'>;
277
- declare function isScopedElementView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'element'> & {
278
- viewOf: Fqn<Any>;
279
- };
280
- declare function isExtendsElementView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'element'> & {
281
- extends: StrictViewId<Any>;
282
- };
283
- declare function isDeploymentView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'deployment'>;
284
- declare function isDynamicView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'dynamic'>;
285
-
286
- /**
287
- * Represents a LikeC4 model data, in different stages of processing
288
- * - {@link ParsedLikeC4ModelData} - parsed from DSL or result from Builder
289
- * - {@link ComputedLikeC4ModelData} - computed from parsed model
290
- * - {@link LayoutedLikeC4ModelData} - layouted from computed model
291
- *
292
- * !IMPORTANT: This is a low-level type, use `LikeC4Model` instead.
293
- */
294
- interface BaseLikeC4ModelData<A extends Any> {
295
- [_stage]: A['Stage'];
296
- projectId: ProjectId<A>;
297
- project: LikeC4Project;
298
- specification: Specification<A>;
299
- elements: Record<ElementId<A>, Element<A>>;
300
- deployments: {
301
- elements: Record<DeploymentId<A>, DeploymentElement<A>>;
302
- relations: Record<RelationId, DeploymentRelationship<A>>;
303
- };
304
- relations: Record<RelationId, Relationship<A>>;
305
- globals: ModelGlobals;
306
- imports: Record<string, NonEmptyArray<Element<A>>>;
307
- }
308
- type AuxFromLikeC4ModelData<D> = D extends BaseLikeC4ModelData<infer A extends Any> ? IsAny<A> extends true ? never : A : never;
309
- interface ParsedLikeC4ModelData<A extends AnyParsed = UnknownParsed> extends BaseLikeC4ModelData<A> {
310
- [_stage]: 'parsed';
311
- views: Record<ViewId$1<A>, ParsedView<A>>;
312
- }
313
- interface ComputedLikeC4ModelData<A extends AnyComputed = UnknownComputed> extends BaseLikeC4ModelData<A> {
314
- [_stage]: 'computed';
315
- views: Record<ViewId$1<A>, ComputedView<A>>;
316
- /**
317
- * If project contains saved manual layouts
318
- */
319
- manualLayouts?: Record<ViewId, ViewManualLayoutSnapshot>;
320
- }
321
- interface LayoutedLikeC4ModelData<A extends AnyLayouted = UnknownLayouted> extends BaseLikeC4ModelData<A> {
322
- [_stage]: 'layouted';
323
- views: Record<ViewId$1<A>, LayoutedView<A>>;
324
- /**
325
- * If this model contains saved manual layouts
326
- */
327
- manualLayouts?: Record<ViewId, ViewManualLayoutSnapshot>;
328
- }
329
- type LikeC4ModelData<A extends Any> = ParsedLikeC4ModelData<A> | ComputedLikeC4ModelData<A> | LayoutedLikeC4ModelData<A>;
330
-
331
- /**
332
- * JSON representation of {@link Specification}
333
- */
334
- interface SpecificationDump {
335
- elements: {
336
- [kind: string]: object;
337
- };
338
- tags?: {
339
- [tag: string]: object;
340
- };
341
- deployments?: {
342
- [kind: string]: object;
343
- };
344
- relationships?: {
345
- [kind: string]: object;
346
- };
347
- metadataKeys?: string[];
348
- customColors?: {
349
- [kind: string]: object;
350
- };
351
- }
352
- type SpecTypesFromDump<J> = J extends SpecificationDump ? SpecAux<KeysOf<J['elements']>, KeysOf<J['deployments']>, KeysOf<J['relationships']>, KeysOf<J['tags']>, J['metadataKeys'] extends readonly [string, ...string[]] ? J['metadataKeys'][number] : never> : SpecAux<never, never, never, never, never>;
353
- /**
354
- * Dump differs from {@link ParsedLikeC4ModelData} by the fact that it is computed or layouted
355
- */
356
- type LikeC4ModelDump = {
357
- [_stage]?: 'computed' | 'layouted';
358
- projectId?: string;
359
- project?: ProjectDump;
360
- specification: SpecificationDump;
361
- elements?: {
362
- [kind: string]: object;
363
- };
364
- deployments: {
365
- elements?: {
366
- [kind: string]: object;
367
- };
368
- relations?: {};
369
- };
370
- views?: {
371
- [kind: string]: object;
372
- };
373
- relations?: {};
374
- globals?: {
375
- predicates?: {};
376
- dynamicPredicates?: {};
377
- styles?: {};
378
- };
379
- imports?: {};
380
- };
381
- type ProjectDump = {
382
- id: string;
383
- name?: string;
384
- title?: string | undefined;
385
- };
386
- type AuxFromDump<D> = D extends LikeC4ModelDump ? Aux<D[_stage] extends infer S extends 'computed' | 'layouted' ? S : 'computed' | 'layouted' | 'parsed', KeysOf<D['elements']>, KeysOf<D['deployments']['elements']>, KeysOf<D['views']>, D['projectId'] extends infer PID extends string ? PID : never, SpecTypesFromDump<D['specification']>> : Never;
387
-
388
- interface RichTextEmpty {
389
- readonly isEmpty: true;
390
- readonly isMarkdown: false;
391
- readonly nonEmpty: false;
392
- readonly $source: null;
393
- readonly text: null;
394
- readonly md: null;
395
- readonly html: null;
396
- equals(other: unknown): boolean;
397
- }
398
- interface RichTextNonEmpty {
399
- readonly isEmpty: false;
400
- readonly nonEmpty: true;
401
- readonly isMarkdown: boolean;
402
- readonly $source: MarkdownOrString;
403
- readonly text: string;
404
- readonly md: string;
405
- readonly html: string;
406
- equals(other: unknown): boolean;
407
- }
408
- type RichTextOrEmpty = RichTextNonEmpty | RichTextEmpty;
409
- /**
410
- * RichText is a class that represents a potentially markdown string.
411
- * It can be either a plain text or a markdown.
412
- * It is used to represent the content of a node or a link.
413
- */
414
- declare class RichText {
415
- private static getOrCreateFromText;
416
- private static getOrCreateFromMarkdown;
417
- /**
418
- * Creates and memoizes a RichText instance.
419
- * @see ElementModel.description
420
- * @example
421
- *
422
- * get description(): RichTextOrEmpty {
423
- * return RichText.memoize(this, 'description', this.$element.description)
424
- * }
425
- */
426
- static memoize(obj: object, tag: symbol | string, source: MarkdownOrString | null | undefined): RichTextOrEmpty;
427
- /**
428
- * Creates a RichText instance from a source.
429
- */
430
- static from(source: RichTextOrEmpty | MarkdownOrString | string | null | undefined): RichTextOrEmpty;
431
- /**
432
- * This is a workaround for the fact that we need instance of RichText for `instanceof` checks
433
- * It is invalid inheritance (returning `null` from getters), and we cast to @see RichTextEmpty
434
- */
435
- static EMPTY: RichTextEmpty;
436
- readonly $source: Readonly<MarkdownOrString> | null;
437
- readonly isEmpty: boolean;
438
- readonly nonEmpty: boolean;
439
- readonly isMarkdown: boolean;
440
- /**
441
- * Private constructor to prevent direct instantiation.
442
- * Use {@link RichText.from} or {@link RichText.memoize} instead.
443
- */
444
- private constructor();
445
- /**
446
- * Returns the text content of the rich text.
447
- * If the source is a string, it returns the string.
448
- * If the source is a markdown, it returns the markdown.
449
- */
450
- get text(): string;
451
- /**
452
- * Returns the markdown content of the rich text.
453
- * If the source is a string, it returns the string.
454
- * If the source is a markdown, it returns the markdown.
455
- */
456
- get md(): string;
457
- /**
458
- * Returns the html content of the rich text.
459
- * If the source is a string, it returns the string.
460
- * If the source is a markdown, it returns the HTML.
461
- */
462
- get html(): string;
463
- equals(other: unknown): boolean;
464
- }
465
-
466
- export { type DeploymentViewRule as $, type AuxFromLikeC4ModelData as A, isComputedView as B, type ComputedLikeC4ModelData as C, type DeploymentNode as D, isElementView as E, isScopedElementView as F, isExtendsElementView as G, isDeploymentView as H, isDynamicView as I, type DiagramNode as J, type DiagramEdge as K, type LayoutedView as L, type LayoutType as M, type LayoutedElementView as N, type LayoutedDeploymentView as O, type ParsedLikeC4ModelData as P, LayoutedDynamicView as Q, RichText as R, type SpecificationDump as S, type LayoutedViewDriftReason as T, type DiagramNodeDriftReason as U, type ViewManualLayoutSnapshot as V, type DiagramEdgeDriftReason as W, type DeploymentViewIncludePredicate as X, type DeploymentViewExcludePredicate as Y, type DeploymentViewPredicate as Z, type DeploymentViewRuleStyle as _, type RichTextEmpty as a, type ParsedDeploymentView as a0, type RichTextOrEmpty as b, type LayoutedLikeC4ModelData as c, type LikeC4ModelData as d, type DeployedInstance as e, type DeploymentElement as f, type DeploymentElementRef as g, isDeployedInstance as h, isDeploymentNode as i, type DeploymentRelationship as j, type DeploymentRelation as k, type SpecTypesFromDump as l, type LikeC4ModelDump as m, type ProjectDump as n, type AuxFromDump as o, type ParsedView as p, isDiagramView as q, type ComputedView as r, type ProcessedView as s, type AnyView as t, type ViewOnStage as u, type ViewWithType as v, type ViewRule as w, type ViewRulePredicate as x, isViewRulePredicate as y, isViewRuleStyle as z };
@@ -1,5 +0,0 @@
1
- import { t as t$1 } from './core.BsSXS-_R.mjs';
2
-
3
- function t(...t){return t$1(n,t)}const n=(e,t)=>[...e,...t];
4
-
5
- export { t };
@@ -1,87 +0,0 @@
1
- import { C as Connection, c as customInspectSymbol } from './core.DKhRkHRN.mjs';
2
- import { e as DeploymentElementModel, h as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.BfCKSW-g.mjs';
3
- import { A as Any, z as EdgeId } from './core.D00YbOhQ.mjs';
4
- import { c as IteratorLike } from './core.DB0Ue5Wx.mjs';
5
-
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
-
59
- /**
60
- * Resolve connection from source to target
61
- * If direction is `both`, also look for reverse connection
62
- *
63
- * @default direction directed
64
- */
65
- declare function findConnection<M extends Any>(source: DeploymentElementModel<M>, target: DeploymentElementModel<NoInfer<M>>, direction: 'directed'): readonly [DeploymentConnectionModel<M>] | readonly [];
66
- declare function findConnection<M extends Any>(source: DeploymentElementModel<M>, target: DeploymentElementModel<NoInfer<M>>, direction: 'both'): readonly [DeploymentConnectionModel<M>, DeploymentConnectionModel<M>] | readonly [DeploymentConnectionModel<M>] | readonly [];
67
- 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 [];
68
- /**
69
- * Resolve all connections between element and others
70
- * By default, look for both directions.
71
- *
72
- * @default direction both
73
- */
74
- declare function findConnectionsBetween<M extends Any>(element: DeploymentElementModel<M>, others: Iterable<DeploymentElementModel<NoInfer<M>>>, direction?: 'directed' | 'both'): readonly DeploymentConnectionModel<M>[];
75
- /**
76
- * Resolve all connections within a given set of elements
77
- */
78
- declare function findConnectionsWithin<M extends Any>(elements: Iterable<DeploymentElementModel<M>>): readonly DeploymentConnectionModel<M>[];
79
-
80
- declare const find_findConnection: typeof findConnection;
81
- declare const find_findConnectionsBetween: typeof findConnectionsBetween;
82
- declare const find_findConnectionsWithin: typeof findConnectionsWithin;
83
- declare namespace find {
84
- export { find_findConnection as findConnection, find_findConnectionsBetween as findConnectionsBetween, find_findConnectionsWithin as findConnectionsWithin };
85
- }
86
-
87
- export { DeploymentConnectionModel as D, findConnection as a, findConnectionsBetween as b, findConnectionsWithin as c, find as f };
@@ -1,13 +0,0 @@
1
- function ihead(iterable) {
2
- if (!iterable) {
3
- return _head;
4
- }
5
- return _head(iterable);
6
- }
7
- function _head(iter) {
8
- const iterator = iter[Symbol.iterator]();
9
- const { value } = iterator.next();
10
- return value;
11
- }
12
-
13
- export { ihead as i };
@@ -1,4 +0,0 @@
1
- import 'type-fest';
2
- import '../shared/core.DB0Ue5Wx.mjs';
3
- export { q as AllKinds, A as Any, A as AnyAux, b as AnyComputed, c as AnyLayouted, $ as AnyOnStage, d as AnyParsed, Z as AnySpec, e as Aux, x as DeploymentFqn, D as DeploymentId, y as DeploymentKind, z as EdgeId, a as ElementId, E as ElementKind, F as Fqn, O as LooseDeploymentId, ae as LooseDeploymentKind, K as LooseElementId, ad as LooseElementKind, L as LooseLiteral, af as LooseRelationKind, I as LooseTag, ac as LooseTags, X as LooseViewId, H as Metadata, C as MetadataKey, B as Never, N as NodeId, ab as OrString, a0 as PickByStage, P as ProjectId, J as RelationId, R as RelationKind, a4 as Spec, f as SpecAux, Q as Stage, x as StrictDeploymentFqn, a8 as StrictDeploymentKind, a7 as StrictElementKind, F as StrictFqn, a5 as StrictProjectId, a9 as StrictRelationKind, a6 as StrictTag, S as StrictViewId, T as Tag, r as Tags, U as Unknown, g as UnknownComputed, h as UnknownLayouted, i as UnknownParsed, V as ViewId, W as WithDescriptionAndTech, aa as WithLinks, v as WithMetadata, w as WithNotation, u as WithOptionalLinks, s as WithOptionalTags, G as WithTags, p as preferDescription, j as preferSummary, Y as setProject, a1 as setStage, t as toComputed, a3 as toLayouted, a2 as toParsed } from '../shared/core.D00YbOhQ.mjs';
4
- import '../shared/core.C_3y3eqV.mjs';
@@ -1,8 +0,0 @@
1
- function preferSummary(a) {
2
- return a.summary ?? a.description;
3
- }
4
- function preferDescription(a) {
5
- return a.description ?? a.summary;
6
- }
7
-
8
- export { preferDescription, preferSummary };