@likec4/core 1.40.0 → 1.41.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 (61) hide show
  1. package/dist/builder/index.d.mts +75 -14
  2. package/dist/builder/index.mjs +111 -47
  3. package/dist/compute-view/index.d.mts +5 -5
  4. package/dist/compute-view/index.mjs +3 -3
  5. package/dist/compute-view/relationships-view/index.d.mts +5 -5
  6. package/dist/index.d.mts +5 -5
  7. package/dist/index.mjs +4 -4
  8. package/dist/model/connection/deployment/index.d.mts +7 -7
  9. package/dist/model/connection/deployment/index.mjs +1 -1
  10. package/dist/model/connection/index.d.mts +8 -8
  11. package/dist/model/connection/index.mjs +1 -1
  12. package/dist/model/connection/model/index.d.mts +7 -7
  13. package/dist/model/index.d.mts +10 -10
  14. package/dist/model/index.mjs +3 -3
  15. package/dist/shared/{core.DHQ32OHa.mjs → core.Ae86Y3tB.mjs} +2 -3
  16. package/dist/shared/{core.FPITT8Vx.mjs → core.Asc11Mjy.mjs} +28 -9
  17. package/dist/shared/{core.CySf-2gP.d.mts → core.BXsxn-hf.d.mts} +29 -4
  18. package/dist/shared/core.BazD6cot.mjs +14 -0
  19. package/dist/shared/{core.D_fI5Lf6.d.mts → core.BhpgpOep.d.mts} +24 -4
  20. package/dist/shared/{core.DuR3R-xJ.mjs → core.BvMRMo7Z.mjs} +68 -46
  21. package/dist/shared/{core.BbThmf6M.d.mts → core.CUG6vpyL.d.mts} +2 -2
  22. package/dist/shared/{core.yHe79zEl.mjs → core.CXy1NLUG.mjs} +2 -2
  23. package/dist/shared/{core.Bpou6c2f.d.mts → core.D-ZGWDDt.d.mts} +19 -38
  24. package/dist/shared/{core.BIAlzwKc.mjs → core.DA5vzwZ9.mjs} +30 -4
  25. package/dist/shared/{core.T-eLZTW_.mjs → core.DJp8fgok.mjs} +6 -2
  26. package/dist/shared/{core.DrvfVXkh.d.mts → core.DgesAwC8.d.mts} +11 -2
  27. package/dist/shared/{core.vWJTxpLV.d.mts → core.FUPplpae.d.mts} +1 -1
  28. package/dist/shared/{core.DrVOJuxX.d.mts → core.hfOE3RfK.d.mts} +4 -4
  29. package/dist/shared/{core.D704WZES.d.mts → core.xSQO0XYD.d.mts} +2 -2
  30. package/dist/shared/{core.kxeJe0OY.d.mts → core.zxTBF_PD.d.mts} +3 -3
  31. package/dist/types/_aux.d.mts +2 -2
  32. package/dist/types/_aux.mjs +1 -5
  33. package/dist/types/expression-model.d.mts +3 -3
  34. package/dist/types/expression.d.mts +3 -3
  35. package/dist/types/fqnRef.d.mts +2 -2
  36. package/dist/types/index.d.mts +6 -6
  37. package/dist/types/index.mjs +4 -4
  38. package/dist/utils/index.d.mts +2 -2
  39. package/dist/utils/iterable/index.d.mts +1 -1
  40. package/package.json +2 -2
  41. package/src/builder/Builder.ts +119 -43
  42. package/src/builder/_types.ts +12 -8
  43. package/src/compute-view/deployment-view/utils.ts +47 -36
  44. package/src/compute-view/relationships-view/layout.ts +7 -6
  45. package/src/compute-view/utils/buildComputedNodes.ts +23 -10
  46. package/src/compute-view/utils/buildElementNotations.ts +2 -1
  47. package/src/model/DeploymentElementModel.ts +33 -3
  48. package/src/model/ElementModel.ts +25 -2
  49. package/src/model/RelationModel.ts +1 -1
  50. package/src/model/view/EdgeModel.ts +3 -2
  51. package/src/model/view/LikeC4ViewModel.ts +1 -1
  52. package/src/model/view/NodeModel.ts +1 -1
  53. package/src/types/RichText.ts +2 -3
  54. package/src/types/_aux.ts +26 -0
  55. package/src/types/_common.ts +23 -1
  56. package/src/types/index.ts +2 -0
  57. package/src/types/model-deployment.ts +8 -18
  58. package/src/types/model-logical.ts +4 -13
  59. package/src/types/model-spec.ts +3 -0
  60. package/src/types/view-computed.ts +21 -13
  61. package/src/types/view-layouted.ts +0 -4
@@ -1,5 +1,5 @@
1
- export { b as EdgeModel, E as ElementModel, a as LikeC4DeploymentModel, L as LikeC4Model, c as LikeC4ViewModel, d as LikeC4ViewsFolder, N as NodeModel, R as RelationshipModel, V as VIEW_FOLDERS_SEPARATOR, e as extractViewTitleFromPath, g as getViewFolderPath, f as isDeployedInstanceModel, h as isDeploymentElementModel, i as isDeploymentNodeModel, k as isDeploymentRelationModel, q as isEdgeModel, m as isElementModel, o as isLikeC4ViewModel, l as isModelRelation, j as isNestedElementOfDeployedInstanceModel, p as isNodeModel, l as isRelationModel, l as isRelationshipModel, n as normalizeViewPath } from '../shared/core.FPITT8Vx.mjs';
2
- export { c as DeployedInstanceModel, D as DeploymentConnectionModel, e as DeploymentNodeModel, g as DeploymentRelationModel, R as RelationshipsAccum, d as deploymentConnection } from '../shared/core.BIAlzwKc.mjs';
1
+ export { b as EdgeModel, E as ElementModel, a as LikeC4DeploymentModel, L as LikeC4Model, c as LikeC4ViewModel, d as LikeC4ViewsFolder, N as NodeModel, R as RelationshipModel, V as VIEW_FOLDERS_SEPARATOR, e as extractViewTitleFromPath, g as getViewFolderPath, f as isDeployedInstanceModel, h as isDeploymentElementModel, i as isDeploymentNodeModel, k as isDeploymentRelationModel, q as isEdgeModel, m as isElementModel, o as isLikeC4ViewModel, l as isModelRelation, j as isNestedElementOfDeployedInstanceModel, p as isNodeModel, l as isRelationModel, l as isRelationshipModel, n as normalizeViewPath } from '../shared/core.Asc11Mjy.mjs';
2
+ export { c as DeployedInstanceModel, D as DeploymentConnectionModel, e as DeploymentNodeModel, g as DeploymentRelationModel, R as RelationshipsAccum, d as deploymentConnection } from '../shared/core.DA5vzwZ9.mjs';
3
3
  export { C as Connection } from '../shared/core.BVNaR17u.mjs';
4
4
  export { C as ConnectionModel, d as differenceConnections, c as findAscendingConnections, e as findDeepestNestedConnection, g as findDescendantConnections, h as hasSameSource, i as hasSameSourceTarget, j as hasSameTarget, k as isAnyInOut, l as isIncoming, m as isNestedConnection, n as isOutgoing, o as mergeConnections, q as modelConnection, s as sortConnectionsByBoundaryHierarchy, p as sortDeepestFirst } from '../shared/core.D0EgVMQK.mjs';
5
- export { R as RichText } from '../shared/core.DHQ32OHa.mjs';
5
+ export { R as RichText } from '../shared/core.Ae86Y3tB.mjs';
@@ -27,7 +27,6 @@ const DefaultLineStyle = "dashed";
27
27
  const DefaultArrowType = "normal";
28
28
  const DefaultRelationshipColor = "gray";
29
29
 
30
- const richtxt = Symbol.for("richtxt");
31
30
  const symb_text = Symbol.for("text");
32
31
  const symb_html = Symbol.for("html");
33
32
  const emptyTxt = "";
@@ -42,8 +41,8 @@ class RichText {
42
41
  * return RichText.memoize(this, this.$element.description)
43
42
  * }
44
43
  */
45
- static memoize(obj, source) {
46
- return memoizeProp(obj, richtxt, () => RichText.from(source));
44
+ static memoize(obj, tag, source) {
45
+ return memoizeProp(obj, tag, () => RichText.from(source));
47
46
  }
48
47
  /**
49
48
  * Creates a RichText instance from a source.
@@ -1,15 +1,16 @@
1
- import { unique, isTruthy, isEmpty, hasAtLeast, values, last, entries, pipe, map, sort, split, sortBy, prop } from 'remeda';
1
+ import { unique, isShallowEqual, isTruthy, isEmpty, hasAtLeast, values, last, entries, pipe, map, sort, split, sortBy, prop } from 'remeda';
2
2
  import { o as hierarchyLevel, n as nameFromFqn, i as isAncestor, g as commonAncestor, s as sortNaturalByFqn, f as sortParentsFirst, p as parentFqn, a as ancestorsFqn, k as compareNaturalHierarchically, j as compareNatural } from './core.DgttqsJc.mjs';
3
3
  import { g as getOrCreate } from './core.DcS-0zys.mjs';
4
- import { e as DeploymentNodeModel, c as DeployedInstanceModel, g as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.BIAlzwKc.mjs';
4
+ import { e as DeploymentNodeModel, c as DeployedInstanceModel, g as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.DA5vzwZ9.mjs';
5
5
  import { D as DefaultMap } from './core.BuoXfSMj.mjs';
6
6
  import { i as invariant, a as nonNullable } from './core.D4npX2q8.mjs';
7
7
  import { FqnRef } from '../types/fqnRef.mjs';
8
- import { b as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as whereOperatorAsPredicate } from './core.yHe79zEl.mjs';
8
+ import { b as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as whereOperatorAsPredicate } from './core.CXy1NLUG.mjs';
9
9
  import { m as memoizeProp } from './core.CUw_2J9j.mjs';
10
10
  import { i as ifilter } from './core.CCD1ID81.mjs';
11
11
  import { c as splitGlobalFqn, g as extractStep, e as isStepEdgeId, i as isGroupElementKind, b as isGlobalFqn, a as GlobalFqn } from './core.Be1n9a0i.mjs';
12
- import { a as DefaultElementShape, D as DefaultThemeColor, R as RichText, c as DefaultShapeSize, i as DefaultRelationshipColor, g as DefaultLineStyle } from './core.DHQ32OHa.mjs';
12
+ import { a as DefaultElementShape, D as DefaultThemeColor, R as RichText, c as DefaultShapeSize, i as DefaultRelationshipColor, g as DefaultLineStyle } from './core.Ae86Y3tB.mjs';
13
+ import { a as preferSummary, p as preferDescription } from './core.BazD6cot.mjs';
13
14
  import { a as ihead, i as ifind } from './core.GTgsmXS_.mjs';
14
15
 
15
16
  class ElementModel {
@@ -67,8 +68,26 @@ class ElementModel {
67
68
  get title() {
68
69
  return this.$element.title;
69
70
  }
71
+ /**
72
+ * Returns true if the element has a summary and a description
73
+ * (if one is missing - it falls back to another)
74
+ */
75
+ get hasSummary() {
76
+ return !!this.$element.summary && !!this.$element.description && !isShallowEqual(this.$element.summary, this.$element.description);
77
+ }
78
+ /**
79
+ * Short description of the element.
80
+ * Falls back to description if summary is not provided.
81
+ */
82
+ get summary() {
83
+ return RichText.memoize(this, "summary", preferSummary(this.$element));
84
+ }
85
+ /**
86
+ * Long description of the element.
87
+ * Falls back to summary if description is not provided.
88
+ */
70
89
  get description() {
71
- return RichText.memoize(this, this.$element.description);
90
+ return RichText.memoize(this, "description", preferDescription(this.$element));
72
91
  }
73
92
  get technology() {
74
93
  return this.$element.technology ?? null;
@@ -609,7 +628,7 @@ class RelationshipModel {
609
628
  return this.$relationship.technology;
610
629
  }
611
630
  get description() {
612
- return RichText.memoize(this, this.$relationship.description);
631
+ return RichText.memoize(this, "description", this.$relationship.description);
613
632
  }
614
633
  get navigateTo() {
615
634
  return this.$relationship.navigateTo ? this.model.view(this.$relationship.navigateTo) : null;
@@ -682,7 +701,7 @@ class EdgeModel {
682
701
  return this.#edge.label ?? null;
683
702
  }
684
703
  get description() {
685
- return RichText.memoize(this, this.#edge.description);
704
+ return RichText.memoize(this, "description", this.#edge.description);
686
705
  }
687
706
  get technology() {
688
707
  return this.#edge.technology ?? null;
@@ -747,7 +766,7 @@ class NodeModel {
747
766
  return this.#node.kind;
748
767
  }
749
768
  get description() {
750
- return RichText.memoize(this, this.#node.description);
769
+ return RichText.memoize(this, "description", this.#node.description);
751
770
  }
752
771
  get technology() {
753
772
  return this.#node.technology ?? null;
@@ -1000,7 +1019,7 @@ class LikeC4ViewModel {
1000
1019
  });
1001
1020
  }
1002
1021
  get description() {
1003
- return RichText.memoize(this, this.$view.description);
1022
+ return RichText.memoize(this, "description", this.$view.description);
1004
1023
  }
1005
1024
  get tags() {
1006
1025
  return this.$view.tags ?? [];
@@ -1,11 +1,11 @@
1
- import { A as Any, R as RelationKind, l as Tags, m as Metadata, n as MetadataKey, L as LooseTag, F as Fqn, j as ElementId, h as ElementKind, o as DeploymentKind, E as ExtractOnStage, p as RelationId$1, g as StrictViewId, f as _type, q as LooseElementId, r as LooseDeploymentId, s as DeploymentFqn, t as toComputed, u as toLayouted, v as Stage, D as DeploymentId, U as Unknown, V as ViewId, T as Tag, w as toParsed, P as ProjectId$1, x as LooseViewId, a as Aux, S as SpecAux, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted } from './core.D_fI5Lf6.mjs';
1
+ import { A as Any, R as RelationKind, m as Tags, n as Metadata, o as MetadataKey, L as LooseTag, F as Fqn, k as ElementId, j as ElementKind, q as DeploymentKind, E as ExtractOnStage, r as RelationId$1, h as StrictViewId, g as _type, s as LooseElementId, t as LooseDeploymentId, u as DeploymentFqn, v as toComputed, w as toLayouted, x as Stage, D as DeploymentId, U as Unknown, V as ViewId, T as Tag, y as toParsed, P as ProjectId$1, z as LooseViewId, a as Aux, S as SpecAux, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted } from './core.BhpgpOep.mjs';
2
2
  import { d as RelationId, P as ProjectId, a as IconUrl, N as NodeId, G as GroupElementKind, j as EdgeId, k as StepEdgeId, V as ViewId$1 } from './core.DX-WYEPA.mjs';
3
3
  import { D as DefaultMap } from './core.CywrQs86.mjs';
4
4
  import { SetRequired } from 'type-fest';
5
- import { b as RichTextOrEmpty, Q as Relationship, I as Element, F as ElementStyle, aW as DynamicViewDisplayVariant, a6 as ViewWithType, a2 as ComputedView, a0 as LayoutedView, h as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, L as LayoutedLikeC4ModelData, k as DeployedInstance, D as DeploymentElementStyle, p as DeploymentRelationship, l as DeploymentElement, j as DeploymentNode, s as LikeC4ModelDump, u as AuxFromDump, _ as LikeC4Project, Z as Specification, M as ModelGlobals } from './core.Bpou6c2f.mjs';
6
- import { c as IteratorLike, L as Link, N as NonEmptyArray } from './core.DrvfVXkh.mjs';
5
+ import { b as RichTextOrEmpty, Q as Relationship, I as Element, F as ElementStyle, aW as DynamicViewDisplayVariant, a6 as ViewWithType, a2 as ComputedView, a0 as LayoutedView, h as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, L as LayoutedLikeC4ModelData, k as DeployedInstance, D as DeploymentElementStyle, p as DeploymentRelationship, l as DeploymentElement, j as DeploymentNode, s as LikeC4ModelDump, u as AuxFromDump, _ as LikeC4Project, Z as Specification, M as ModelGlobals } from './core.D-ZGWDDt.mjs';
6
+ import { c as IteratorLike, L as Link, N as NonEmptyArray } from './core.DgesAwC8.mjs';
7
7
  import { i as Color, R as RelationshipLineType, c as ElementShape } from './core.CzdwsPmY.mjs';
8
- import { W as WhereOperator } from './core.BbThmf6M.mjs';
8
+ import { W as WhereOperator } from './core.CUG6vpyL.mjs';
9
9
  import { FqnRef } from '../types/fqnRef.mjs';
10
10
 
11
11
  type RelationshipsIterator<A extends Any> = IteratorLike<RelationshipModel<A>>;
@@ -89,6 +89,20 @@ declare class ElementModel<A extends Any = Any> implements WithTags<A>, WithMeta
89
89
  */
90
90
  get tags(): Tags<A>;
91
91
  get title(): string;
92
+ /**
93
+ * Returns true if the element has a summary and a description
94
+ * (if one is missing - it falls back to another)
95
+ */
96
+ get hasSummary(): boolean;
97
+ /**
98
+ * Short description of the element.
99
+ * Falls back to description if summary is not provided.
100
+ */
101
+ get summary(): RichTextOrEmpty;
102
+ /**
103
+ * Long description of the element.
104
+ * Falls back to summary if description is not provided.
105
+ */
92
106
  get description(): RichTextOrEmpty;
93
107
  get technology(): string | null;
94
108
  get links(): ReadonlyArray<Link>;
@@ -626,6 +640,15 @@ declare abstract class AbstractDeploymentElementModel<A extends Any> implements
626
640
  get name(): string;
627
641
  get shape(): ElementShape;
628
642
  get color(): Color;
643
+ /**
644
+ * Short description of the element.
645
+ * Falls back to description if summary is not provided.
646
+ */
647
+ get summary(): RichTextOrEmpty;
648
+ /**
649
+ * Long description of the element.
650
+ * Falls back to summary if description is not provided.
651
+ */
629
652
  get description(): RichTextOrEmpty;
630
653
  get technology(): string | null;
631
654
  get links(): ReadonlyArray<Link>;
@@ -735,6 +758,7 @@ declare class DeployedInstanceModel<A extends Any = Any> extends AbstractDeploym
735
758
  get color(): Color;
736
759
  get tags(): Tags<A>;
737
760
  get kind(): ElementKind<A>;
761
+ get summary(): RichTextOrEmpty;
738
762
  get description(): RichTextOrEmpty;
739
763
  get technology(): string | null;
740
764
  get links(): ReadonlyArray<Link>;
@@ -757,6 +781,7 @@ declare class NestedElementOfDeployedInstanceModel<A extends Any = Any> {
757
781
  get shape(): ElementShape;
758
782
  get color(): Color;
759
783
  get title(): string;
784
+ get summary(): RichTextOrEmpty;
760
785
  get description(): RichTextOrEmpty;
761
786
  get technology(): string | null;
762
787
  isDeploymentNode(): this is DeploymentNodeModel<A>;
@@ -0,0 +1,14 @@
1
+ function preferSummary(a) {
2
+ return a.summary ?? a.description;
3
+ }
4
+ function preferDescription(a) {
5
+ return a.description ?? a.summary;
6
+ }
7
+
8
+ const _aux = {
9
+ __proto__: null,
10
+ preferDescription: preferDescription,
11
+ preferSummary: preferSummary
12
+ };
13
+
14
+ export { _aux as _, preferSummary as a, preferDescription as p };
@@ -1,6 +1,6 @@
1
1
  import { IfNever, IsNever, IsLiteral } from 'type-fest';
2
- import { C as Coalesce, L as Link } from './core.DrvfVXkh.mjs';
3
- import { D as DeploymentFqn$1, F as Fqn$1, d as RelationId$1, N as NodeId$1, j as EdgeId$1, P as ProjectId$1, V as ViewId$1, T as Tag$1, E as ElementKind$1, b as DeploymentKind$1, c as RelationshipKind } from './core.DX-WYEPA.mjs';
2
+ import { C as Coalesce, L as Link } from './core.DgesAwC8.mjs';
3
+ import { D as DeploymentFqn$1, F as Fqn$1, d as RelationId$1, N as NodeId$1, j as EdgeId$1, P as ProjectId$1, V as ViewId$1, T as Tag$1, E as ElementKind$1, b as DeploymentKind$1, c as RelationshipKind, M as MarkdownOrString } from './core.DX-WYEPA.mjs';
4
4
 
5
5
  /**
6
6
  * Determines the stage of the model:
@@ -172,6 +172,19 @@ type StrictTag<A> = A extends infer T extends Any ? Tag$1<Tag<T>> : never;
172
172
  type StrictElementKind<A> = A extends infer T extends Any ? ElementKind$1<ElementKind<T>> : never;
173
173
  type StrictDeploymentKind<A> = A extends infer T extends Any ? DeploymentKind$1<DeploymentKind<T>> : never;
174
174
  type StrictRelationKind<A> = A extends infer T extends Any ? RelationshipKind<RelationKind<T>> : never;
175
+ type WithDescriptionAndTech = {
176
+ readonly summary?: MarkdownOrString | null;
177
+ readonly description?: MarkdownOrString | null;
178
+ readonly technology?: string | null;
179
+ };
180
+ /**
181
+ * Returns summary if it is not null, otherwise returns description
182
+ */
183
+ declare function preferSummary(a: WithDescriptionAndTech): MarkdownOrString | null | undefined;
184
+ /**
185
+ * Returns description if it is not null, otherwise returns summary
186
+ */
187
+ declare function preferDescription(a: WithDescriptionAndTech): MarkdownOrString | null | undefined;
175
188
  type WithTags<A extends Any> = {
176
189
  readonly tags: Tags<A>;
177
190
  };
@@ -187,6 +200,9 @@ type WithOptionalLinks = {
187
200
  type WithMetadata<A extends Any> = {
188
201
  readonly metadata?: Metadata<A>;
189
202
  };
203
+ type WithNotation = {
204
+ readonly notation?: string | null;
205
+ };
190
206
  /**
191
207
  * @see {@link LiteralUnion} from type-fest (https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts)
192
208
  */
@@ -244,18 +260,22 @@ type _aux_UnknownComputed = UnknownComputed;
244
260
  type _aux_UnknownLayouted = UnknownLayouted;
245
261
  type _aux_UnknownParsed = UnknownParsed;
246
262
  type _aux_ViewId<A> = ViewId<A>;
263
+ type _aux_WithDescriptionAndTech = WithDescriptionAndTech;
247
264
  type _aux_WithLinks = WithLinks;
248
265
  type _aux_WithMetadata<A extends Any> = WithMetadata<A>;
266
+ type _aux_WithNotation = WithNotation;
249
267
  type _aux_WithOptionalLinks = WithOptionalLinks;
250
268
  type _aux_WithOptionalTags<A extends Any> = WithOptionalTags<A>;
251
269
  type _aux_WithTags<A extends Any> = WithTags<A>;
270
+ declare const _aux_preferDescription: typeof preferDescription;
271
+ declare const _aux_preferSummary: typeof preferSummary;
252
272
  type _aux_setProject<A, P extends string> = setProject<A, P>;
253
273
  type _aux_setStage<A, S extends ModelStage> = setStage<A, S>;
254
274
  type _aux_toComputed<A> = toComputed<A>;
255
275
  type _aux_toLayouted<A> = toLayouted<A>;
256
276
  type _aux_toParsed<A> = toParsed<A>;
257
277
  declare namespace _aux {
258
- export type { _aux_AllKinds as AllKinds, _aux_Any as Any, Any as AnyAux, _aux_AnySpec as AnySpec, _aux_Aux as Aux, _aux_DeploymentFqn as DeploymentFqn, _aux_DeploymentId as DeploymentId, _aux_DeploymentKind as DeploymentKind, _aux_EdgeId as EdgeId, _aux_ElementId as ElementId, _aux_ElementKind as ElementKind, _aux_Fqn as Fqn, _aux_LooseDeploymentId as LooseDeploymentId, _aux_LooseDeploymentKind as LooseDeploymentKind, _aux_LooseElementId as LooseElementId, _aux_LooseElementKind as LooseElementKind, _aux_LooseRelationKind as LooseRelationKind, _aux_LooseTag as LooseTag, _aux_LooseTags as LooseTags, _aux_LooseViewId as LooseViewId, _aux_Metadata as Metadata, _aux_MetadataKey as MetadataKey, _aux_Never as Never, _aux_NodeId as NodeId, _aux_OrString as OrString, _aux_PickByStage as PickByStage, _aux_ProjectId as ProjectId, _aux_RelationId as RelationId, _aux_RelationKind as RelationKind, _aux_Spec as Spec, _aux_SpecAux as SpecAux, _aux_Stage as Stage, DeploymentFqn as StrictDeploymentFqn, _aux_StrictDeploymentKind as StrictDeploymentKind, _aux_StrictElementKind as StrictElementKind, Fqn as StrictFqn, _aux_StrictProjectId as StrictProjectId, _aux_StrictRelationKind as StrictRelationKind, _aux_StrictTag as StrictTag, _aux_StrictViewId as StrictViewId, _aux_Tag as Tag, _aux_Tags as Tags, _aux_Unknown as Unknown, _aux_UnknownComputed as UnknownComputed, _aux_UnknownLayouted as UnknownLayouted, _aux_UnknownParsed as UnknownParsed, _aux_ViewId as ViewId, _aux_WithLinks as WithLinks, _aux_WithMetadata as WithMetadata, _aux_WithOptionalLinks as WithOptionalLinks, _aux_WithOptionalTags as WithOptionalTags, _aux_WithTags as WithTags, _aux_setProject as setProject, _aux_setStage as setStage, _aux_toComputed as toComputed, _aux_toLayouted as toLayouted, _aux_toParsed as toParsed };
278
+ export { type _aux_AllKinds as AllKinds, type _aux_Any as Any, type Any as AnyAux, type _aux_AnySpec as AnySpec, type _aux_Aux as Aux, type _aux_DeploymentFqn as DeploymentFqn, type _aux_DeploymentId as DeploymentId, type _aux_DeploymentKind as DeploymentKind, type _aux_EdgeId as EdgeId, type _aux_ElementId as ElementId, type _aux_ElementKind as ElementKind, type _aux_Fqn as Fqn, type _aux_LooseDeploymentId as LooseDeploymentId, type _aux_LooseDeploymentKind as LooseDeploymentKind, type _aux_LooseElementId as LooseElementId, type _aux_LooseElementKind as LooseElementKind, type _aux_LooseRelationKind as LooseRelationKind, type _aux_LooseTag as LooseTag, type _aux_LooseTags as LooseTags, type _aux_LooseViewId as LooseViewId, type _aux_Metadata as Metadata, type _aux_MetadataKey as MetadataKey, type _aux_Never as Never, type _aux_NodeId as NodeId, type _aux_OrString as OrString, type _aux_PickByStage as PickByStage, type _aux_ProjectId as ProjectId, type _aux_RelationId as RelationId, type _aux_RelationKind as RelationKind, type _aux_Spec as Spec, type _aux_SpecAux as SpecAux, type _aux_Stage as Stage, type DeploymentFqn as StrictDeploymentFqn, type _aux_StrictDeploymentKind as StrictDeploymentKind, type _aux_StrictElementKind as StrictElementKind, type Fqn as StrictFqn, type _aux_StrictProjectId as StrictProjectId, type _aux_StrictRelationKind as StrictRelationKind, type _aux_StrictTag as StrictTag, type _aux_StrictViewId as StrictViewId, type _aux_Tag as Tag, type _aux_Tags as Tags, type _aux_Unknown as Unknown, type _aux_UnknownComputed as UnknownComputed, type _aux_UnknownLayouted as UnknownLayouted, type _aux_UnknownParsed as UnknownParsed, type _aux_ViewId as ViewId, type _aux_WithDescriptionAndTech as WithDescriptionAndTech, type _aux_WithLinks as WithLinks, type _aux_WithMetadata as WithMetadata, type _aux_WithNotation as WithNotation, type _aux_WithOptionalLinks as WithOptionalLinks, type _aux_WithOptionalTags as WithOptionalTags, type _aux_WithTags as WithTags, _aux_preferDescription as preferDescription, _aux_preferSummary as preferSummary, type _aux_setProject as setProject, type _aux_setStage as setStage, type _aux_toComputed as toComputed, type _aux_toLayouted as toLayouted, type _aux_toParsed as toParsed };
259
279
  }
260
280
 
261
- export { type WithTags as $, type Any as A, type WithMetadata as B, type EdgeId as C, type DeploymentId as D, type ExtractOnStage as E, type Fqn as F, type AnySpec as G, type PickByStage as H, type setStage as I, type NodeId as J, type Spec as K, type LooseTag as L, type ModelStage as M, type Never as N, type StrictProjectId as O, type ProjectId as P, type StrictTag as Q, type RelationKind as R, type SpecAux as S, type Tag as T, type Unknown as U, type ViewId as V, type WithOptionalTags as W, type StrictElementKind as X, type StrictDeploymentKind as Y, type StrictRelationKind as Z, _aux as _, type Aux as a, type WithLinks as a0, type OrString as a1, type LooseTags as a2, type LooseElementKind as a3, type LooseDeploymentKind as a4, type LooseRelationKind as a5, type UnknownComputed as b, type UnknownLayouted as c, type UnknownParsed as d, _stage as e, _type as f, type StrictViewId as g, type ElementKind as h, isOnStage as i, type ElementId as j, type AllKinds as k, type Tags as l, type Metadata as m, type MetadataKey as n, type DeploymentKind as o, type RelationId as p, type LooseElementId as q, type LooseDeploymentId as r, type DeploymentFqn as s, type toComputed as t, type toLayouted as u, type Stage as v, type toParsed as w, type LooseViewId as x, type setProject as y, type WithOptionalLinks as z };
281
+ export { type StrictProjectId as $, type Any as A, type setProject as B, type WithOptionalLinks as C, type DeploymentId as D, type ExtractOnStage as E, type Fqn as F, type WithDescriptionAndTech as G, type WithMetadata as H, type WithNotation as I, type WithTags as J, type EdgeId as K, type LooseTag as L, type ModelStage as M, type Never as N, type AnySpec as O, type ProjectId as P, type PickByStage as Q, type RelationKind as R, type SpecAux as S, type Tag as T, type Unknown as U, type ViewId as V, type WithOptionalTags as W, type setStage as X, type NodeId as Y, type Spec as Z, _aux as _, type Aux as a, type StrictTag as a0, type StrictElementKind as a1, type StrictDeploymentKind as a2, type StrictRelationKind as a3, type WithLinks as a4, type OrString as a5, type LooseTags as a6, type LooseElementKind as a7, type LooseDeploymentKind as a8, type LooseRelationKind as a9, type UnknownComputed as b, type UnknownLayouted as c, type UnknownParsed as d, preferSummary as e, _stage as f, _type as g, type StrictViewId as h, isOnStage as i, type ElementKind as j, type ElementId as k, type AllKinds as l, type Tags as m, type Metadata as n, type MetadataKey as o, preferDescription as p, type DeploymentKind as q, type RelationId as r, type LooseElementId as s, type LooseDeploymentId as t, type DeploymentFqn as u, type toComputed as v, type toLayouted as w, type Stage as x, type toParsed as y, type LooseViewId as z };
@@ -1,4 +1,4 @@
1
- import { pipe, groupBy, prop, mapValues, piped, map, unique, entries, flatMap, sortBy, last, reverse, partition, takeWhile, forEach, mapToObj, isTruthy, isBoolean, filter, isNot, anyPass, isDefined, reduce, isDeepEqual, only, pickBy, hasAtLeast, isEmpty as isEmpty$1, values, dropWhile, zip, take as take$2, isNonNullish, isArray, pick, findLast, omitBy, isNullish, when, constant, concat, indexBy } from 'remeda';
1
+ import { pipe, filter, groupBy, prop, mapValues, piped, map, unique, entries, flatMap, sortBy, last, reverse, partition, takeWhile, forEach, mapToObj, isTruthy, isBoolean, isNot, anyPass, isDefined, reduce, isDeepEqual, only, pickBy, hasAtLeast, values, dropWhile, zip, take as take$2, isNonNullish, isArray, pick, findLast, omitBy, isNullish, isEmpty as isEmpty$1, when, constant, concat, indexBy } from 'remeda';
2
2
  import { c as commonHead, o as objectHash, S as Stack } from './core.BB6zA-UU.mjs';
3
3
  import { a as nonNullable, i as invariant, n as nonexhaustive } from './core.D4npX2q8.mjs';
4
4
  import { EventEmitter } from 'events';
@@ -6,13 +6,14 @@ import { r as getDefaultExportFromCjs, b as isDescendantOf, f as sortParentsFirs
6
6
  import { r as requireIterator, b as requireSupport, a as requireForeach } from './core.CaT0SUUK.mjs';
7
7
  import { d as difference, i as intersection, u as union, h as hasIntersection } from './core.4u1dVmfX.mjs';
8
8
  import { ModelFqnExpr, ModelRelationExpr, ModelExpression } from '../types/expression-model.mjs';
9
- import { w as whereOperatorAsPredicate, a as _type, _ as _stage } from './core.yHe79zEl.mjs';
9
+ import { w as whereOperatorAsPredicate, a as _type, _ as _stage } from './core.CXy1NLUG.mjs';
10
10
  import { FqnRef } from '../types/fqnRef.mjs';
11
- import { a as isViewRuleStyle, m as isViewRuleAutoLayout, i as isViewRulePredicate, p as isViewRuleGroup, k as isViewRuleGlobalPredicateRef, j as isViewRuleGlobalStyle, o as isDynamicViewParallelSteps, h as isDynamicView, g as isDeploymentView, d as isElementView } from './core.T-eLZTW_.mjs';
11
+ import { a as isViewRuleStyle, o as omitUndefined, m as isViewRuleAutoLayout, i as isViewRulePredicate, q as isViewRuleGroup, k as isViewRuleGlobalPredicateRef, j as isViewRuleGlobalStyle, p as isDynamicViewParallelSteps, h as isDynamicView, g as isDeploymentView, d as isElementView } from './core.DJp8fgok.mjs';
12
12
  import { i as isGroupElementKind, G as GroupElementKind, d as stepEdgeId } from './core.Be1n9a0i.mjs';
13
- import { a as DefaultElementShape, D as DefaultThemeColor, h as DefaultArrowType, g as DefaultLineStyle, i as DefaultRelationshipColor } from './core.DHQ32OHa.mjs';
13
+ import { a as preferSummary } from './core.BazD6cot.mjs';
14
+ import { a as DefaultElementShape, D as DefaultThemeColor, h as DefaultArrowType, g as DefaultLineStyle, i as DefaultRelationshipColor } from './core.Ae86Y3tB.mjs';
14
15
  import { FqnExpr, RelationExpr } from '../types/expression.mjs';
15
- import { d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.BIAlzwKc.mjs';
16
+ import { d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.DA5vzwZ9.mjs';
16
17
  import { c as findAscendingConnections, o as mergeConnections, d as differenceConnections, m as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, a as findConnectionsBetween$3, q as modelConnection, g as findDescendantConnections, e as findDeepestNestedConnection, k as isAnyInOut, n as isOutgoing, l as isIncoming, C as ConnectionModel } from './core.D0EgVMQK.mjs';
17
18
  import { a as toSet, t as toArray, i as imap } from './core.DLpidoWc.mjs';
18
19
  import { D as DefaultMap } from './core.BuoXfSMj.mjs';
@@ -20,12 +21,13 @@ import { i as ifilter } from './core.CCD1ID81.mjs';
20
21
  import { i as isome } from './core.Be4Jy9Qx.mjs';
21
22
  import { C as Connection, c as customInspectSymbol } from './core.BVNaR17u.mjs';
22
23
  import { i as isIterable } from './core.DoM6aM9N.mjs';
23
- import { m as isElementModel, j as isNestedElementOfDeployedInstanceModel, f as isDeployedInstanceModel, i as isDeploymentNodeModel, h as isDeploymentElementModel, L as LikeC4Model } from './core.FPITT8Vx.mjs';
24
+ import { m as isElementModel, j as isNestedElementOfDeployedInstanceModel, f as isDeployedInstanceModel, i as isDeploymentNodeModel, h as isDeploymentElementModel, L as LikeC4Model } from './core.Asc11Mjy.mjs';
24
25
  import { a as iunique, i as iflat } from './core.CNGyqkJh.mjs';
25
26
 
26
27
  function buildElementNotations(nodes) {
27
28
  return pipe(
28
29
  nodes,
30
+ filter((n) => !!n.notation),
29
31
  groupBy(prop("notation")),
30
32
  mapValues(
31
33
  piped(
@@ -8541,12 +8543,25 @@ function updateDepthOfAncestors(node, nodes) {
8541
8543
  }
8542
8544
  }
8543
8545
  function elementModelToNodeSource(el) {
8544
- return {
8545
- ...el.$element,
8546
- tags: [...el.tags],
8547
- id: el.id,
8548
- modelRef: el.id
8549
- };
8546
+ const {
8547
+ id,
8548
+ summary,
8549
+ // omit
8550
+ style,
8551
+ metadata,
8552
+ // omit
8553
+ ...rest
8554
+ } = el.$element;
8555
+ return omitUndefined({
8556
+ id,
8557
+ modelRef: id,
8558
+ ...rest,
8559
+ style: { ...style },
8560
+ color: el.color,
8561
+ shape: el.shape,
8562
+ description: preferSummary(el.$element),
8563
+ tags: [...el.tags]
8564
+ });
8550
8565
  }
8551
8566
  function buildComputedNodes(elements, groups) {
8552
8567
  const nodesMap = /* @__PURE__ */ new Map();
@@ -8843,38 +8858,50 @@ function deploymentExpressionToPredicate(target) {
8843
8858
  }
8844
8859
  nonexhaustive(target);
8845
8860
  }
8861
+ function instanceSummary(model) {
8862
+ return preferSummary(model.$instance) ?? preferSummary(model.element.$element);
8863
+ }
8846
8864
  function toNodeSource(el) {
8847
8865
  if (el.isDeploymentNode()) {
8848
8866
  const onlyOneInstance = el.onlyOneInstance();
8849
- let { title, kind, id, description: description2, ...$node } = el.$node;
8850
- const { icon: icon2, color: color2, shape: shape2, ...style2 } = el.$node.style ?? {};
8867
+ let {
8868
+ title,
8869
+ id,
8870
+ description: description2,
8871
+ summary,
8872
+ metadata,
8873
+ style: style2,
8874
+ element: element2,
8875
+ tags: _tags,
8876
+ // omit
8877
+ ...$node
8878
+ } = el.$node;
8879
+ let icon2 = style2.icon;
8851
8880
  let tags = [...el.tags];
8881
+ summary ??= description2;
8852
8882
  if (onlyOneInstance) {
8853
8883
  tags = unique([...tags, ...onlyOneInstance.tags]);
8854
8884
  if (title === nameFromFqn(el.id)) {
8855
8885
  title = onlyOneInstance.title;
8856
8886
  }
8857
- description2 = onlyOneInstance.description.$source ?? description2;
8887
+ icon2 ??= onlyOneInstance.style.icon;
8888
+ summary ??= instanceSummary(onlyOneInstance);
8858
8889
  }
8859
- return {
8890
+ return omitUndefined({
8891
+ id,
8892
+ deploymentRef: id,
8893
+ title,
8894
+ ...$node,
8895
+ color: style2.color ?? onlyOneInstance?.color ?? DefaultThemeColor,
8896
+ shape: style2.shape ?? DefaultElementShape,
8860
8897
  ...onlyOneInstance && {
8861
- ...toNodeSource(onlyOneInstance),
8862
8898
  modelRef: onlyOneInstance.element.id
8863
8899
  },
8864
- title,
8865
- ...$node,
8866
- ...icon2 && { icon: icon2 },
8867
- ...color2 && { color: color2 },
8868
- ...shape2 && { shape: shape2 },
8869
- ...description2 && { description: description2 },
8900
+ icon: icon2,
8901
+ description: summary,
8870
8902
  tags,
8871
- style: {
8872
- ...style2
8873
- },
8874
- deploymentRef: id,
8875
- kind,
8876
- id
8877
- };
8903
+ style: style2
8904
+ });
8878
8905
  }
8879
8906
  invariant(el.isInstance(), "Expected Instance");
8880
8907
  const instance = el.$instance;
@@ -8884,30 +8911,25 @@ function toNodeSource(el) {
8884
8911
  ...element.links,
8885
8912
  ...instance.links ?? []
8886
8913
  ];
8887
- const metadata = {
8888
- ...element.getMetadata(),
8889
- ...instance.metadata
8890
- };
8891
8914
  const notation = instance.notation ?? element.$element.notation;
8892
- let description = el.description.$source;
8893
- let technology = instance.technology ?? element.technology;
8894
- return {
8915
+ const description = instanceSummary(el);
8916
+ const technology = el.technology ?? void 0;
8917
+ return omitUndefined({
8895
8918
  id: el.id,
8896
8919
  kind: "instance",
8897
8920
  title: el.title,
8898
- ...description && { description },
8899
- ...technology && { technology },
8921
+ description,
8922
+ technology,
8900
8923
  tags: [...el.tags],
8901
- links: hasAtLeast(links, 1) ? links : null,
8902
- ...icon && { icon },
8903
- ...color && { color },
8904
- ...shape && { shape },
8924
+ links: hasAtLeast(links, 1) ? links : void 0,
8925
+ icon,
8926
+ color,
8927
+ shape,
8905
8928
  style,
8906
8929
  deploymentRef: instance.id,
8907
8930
  modelRef: element.id,
8908
- ...notation && { notation },
8909
- ...!isEmpty$1(metadata) && { metadata }
8910
- };
8931
+ notation
8932
+ });
8911
8933
  }
8912
8934
  function toComputedEdges$1(connections) {
8913
8935
  return connections.reduce((acc, e) => {
@@ -1,5 +1,5 @@
1
- import { A as Any, T as Tag, k as AllKinds, l as Tags, g as StrictViewId, h as ElementKind } from './core.D_fI5Lf6.mjs';
2
- import { N as NonEmptyArray, E as ExclusiveUnion } from './core.DrvfVXkh.mjs';
1
+ import { A as Any, T as Tag, l as AllKinds, m as Tags, h as StrictViewId, j as ElementKind } from './core.BhpgpOep.mjs';
2
+ import { N as NonEmptyArray, E as ExclusiveUnion } from './core.DgesAwC8.mjs';
3
3
  import { FqnRef } from '../types/fqnRef.mjs';
4
4
  import { M as MarkdownOrString, I as Icon } from './core.DX-WYEPA.mjs';
5
5
  import { i as Color, R as RelationshipLineType, f as RelationshipArrowType, c as ElementShape, b as BorderStyle, a as ShapeSize } from './core.CzdwsPmY.mjs';
@@ -8,10 +8,10 @@ const _stage = "_stage";
8
8
  const _type = "_type";
9
9
 
10
10
  function isDeploymentNode(el) {
11
- return "kind" in el && !isTruthy(el.element);
11
+ return isTruthy(el.kind) && !isTruthy(el.element);
12
12
  }
13
13
  function isDeployedInstance(el) {
14
- return "element" in el && isTruthy(el.element);
14
+ return isTruthy(el.element) && !isTruthy(el.kind);
15
15
  }
16
16
 
17
17
  function isTagEqual(operator) {