@likec4/core 1.36.1 → 1.38.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 (49) hide show
  1. package/README.md +2 -2
  2. package/dist/builder/index.d.mts +4 -4
  3. package/dist/builder/index.mjs +11 -8
  4. package/dist/compute-view/index.d.mts +4 -4
  5. package/dist/compute-view/index.mjs +8 -8
  6. package/dist/compute-view/relationships-view/index.d.mts +4 -4
  7. package/dist/index.d.mts +4 -4
  8. package/dist/index.mjs +6 -5
  9. package/dist/model/connection/deployment/index.d.mts +6 -6
  10. package/dist/model/connection/deployment/index.mjs +2 -2
  11. package/dist/model/connection/index.d.mts +8 -8
  12. package/dist/model/connection/index.mjs +2 -2
  13. package/dist/model/connection/model/index.d.mts +6 -6
  14. package/dist/model/index.d.mts +11 -11
  15. package/dist/model/index.mjs +5 -5
  16. package/dist/shared/core.BL_xjl90.mjs +92 -0
  17. package/dist/shared/{core.CaJp8Amg.mjs → core.BW8K1y6R.mjs} +2 -2
  18. package/dist/shared/{core.D8bTI5KC.d.mts → core.Bf5zKDK1.d.mts} +3 -3
  19. package/dist/shared/{core.DoNP3Yl-.d.mts → core.BvlHvikl.d.mts} +13 -4
  20. package/dist/shared/{core.DxDn5nB5.d.mts → core.CE_hG7EJ.d.mts} +10 -6
  21. package/dist/shared/{core._jnYNUQ-.mjs → core.DK6I-Nr7.mjs} +1 -1
  22. package/dist/shared/{core.668kXpZq.d.mts → core.DX-WYEPA.d.mts} +4 -3
  23. package/dist/shared/{core.DHYd2-VU.d.mts → core.DhDo8LAz.d.mts} +3 -3
  24. package/dist/shared/{core.BvIGRozf.mjs → core.DsznOb9G.mjs} +15 -7
  25. package/dist/shared/{core.Bt3kuGUN.d.mts → core.Dtw1SBlz.d.mts} +3 -3
  26. package/dist/shared/{core.Bus32P0S.mjs → core.DyzAZvbX.mjs} +5 -2
  27. package/dist/shared/{core.CaaYNQDM.mjs → core.H8NbNp2X.mjs} +5 -2
  28. package/dist/shared/{core.BFb3p5d-.d.mts → core.O6FG0HF9.d.mts} +1 -1
  29. package/dist/shared/{core.BlwZ4tBa.mjs → core.YyjkRVss.mjs} +7 -7
  30. package/dist/shared/{core.CF82MWyh.d.mts → core.wwaSalox.d.mts} +1 -1
  31. package/dist/types/_aux.d.mts +2 -2
  32. package/dist/types/_aux.mjs +4 -0
  33. package/dist/types/index.d.mts +5 -5
  34. package/dist/types/index.mjs +5 -4
  35. package/dist/types/scalar.d.mts +1 -1
  36. package/dist/types/scalar.mjs +4 -68
  37. package/dist/utils/index.d.mts +2 -2
  38. package/package.json +3 -3
  39. package/src/builder/Builder.ts +4 -1
  40. package/src/compute-view/utils/applyCustomElementProperties.ts +1 -1
  41. package/src/model/DeploymentElementModel.ts +5 -1
  42. package/src/model/LikeC4Model.ts +10 -2
  43. package/src/model/view/LikeC4ViewModel.ts +2 -2
  44. package/src/types/RichText.ts +5 -2
  45. package/src/types/expression-model.ts +3 -3
  46. package/src/types/expression.ts +3 -3
  47. package/src/types/index.ts +2 -2
  48. package/src/types/project.ts +7 -2
  49. package/src/types/scalar.ts +3 -0
@@ -1,6 +1,6 @@
1
- import { C as Connection, c as customInspectSymbol } from './core.D8bTI5KC.mjs';
2
- import { e as DeploymentElementModel, i as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.DoNP3Yl-.mjs';
3
- import { A as Any, C as EdgeId } from './core.BFb3p5d-.mjs';
1
+ import { C as Connection, c as customInspectSymbol } from './core.Bf5zKDK1.mjs';
2
+ import { e as DeploymentElementModel, i as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.BvlHvikl.mjs';
3
+ import { A as Any, C as EdgeId } from './core.O6FG0HF9.mjs';
4
4
  import { I as IteratorLike } from './core.DuSLYTG6.mjs';
5
5
 
6
6
  /**
@@ -4,15 +4,15 @@ import { m as m$2 } from './core.ByrmCl9I.mjs';
4
4
  import { i as i$2 } from './core.CpwrZi3D.mjs';
5
5
  import { g as hierarchyLevel, n as nameFromFqn, i as isAncestor, d as commonAncestor, l as sortNaturalByFqn, m as sortParentsFirst, p as parentFqn, b as ancestorsFqn, C, a as compareNaturalHierarchically, c as compareNatural } from './core.DQj9iv_y.mjs';
6
6
  import { g as getOrCreate } from './core.DcS-0zys.mjs';
7
- import { i as i$1, n as n$3, e as DeploymentNodeModel, c as DeployedInstanceModel, N as NestedElementOfDeployedInstanceModel, g as DeploymentRelationModel } from './core.Bus32P0S.mjs';
7
+ import { i as i$1, n as n$3, e as DeploymentNodeModel, c as DeployedInstanceModel, N as NestedElementOfDeployedInstanceModel, g as DeploymentRelationModel } from './core.DyzAZvbX.mjs';
8
8
  import { D as DefaultMap } from './core.yaRvRnMW.mjs';
9
9
  import { i as invariant, a as nonNullable } from './core.D4npX2q8.mjs';
10
- import { F as FqnRef, b as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as whereOperatorAsPredicate } from './core._jnYNUQ-.mjs';
10
+ import { F as FqnRef, b as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as whereOperatorAsPredicate } from './core.DK6I-Nr7.mjs';
11
11
  import { m as memoizeProp } from './core.B0oEIXqd.mjs';
12
12
  import { i as ifilter } from './core.BH9nN-_I.mjs';
13
- import { splitGlobalFqn, extractStep, isStepEdgeId, isGroupElementKind, isGlobalFqn, GlobalFqn } from '../types/scalar.mjs';
13
+ import { c as splitGlobalFqn, g as extractStep, e as isStepEdgeId, i as isGroupElementKind, b as isGlobalFqn, a as GlobalFqn } from './core.BL_xjl90.mjs';
14
14
  import { n as n$2 } from './core.CnIyafWn.mjs';
15
- import { a as DefaultElementShape, D as DefaultThemeColor, R as RichText, b as DefaultShapeSize, g as DefaultRelationshipColor, e as DefaultLineStyle } from './core.CaaYNQDM.mjs';
15
+ import { a as DefaultElementShape, D as DefaultThemeColor, R as RichText, b as DefaultShapeSize, g as DefaultRelationshipColor, e as DefaultLineStyle } from './core.H8NbNp2X.mjs';
16
16
  import { a as ihead, i as ifind } from './core.DsMrjY2q.mjs';
17
17
 
18
18
  function r(...t){return u$1(Object.values,t)}
@@ -984,10 +984,10 @@ class LikeC4ViewModel {
984
984
  return this.$view.id;
985
985
  }
986
986
  /**
987
- * Returns title if defined, otherwise returns its {@link id}
987
+ * Returns title if defined, otherwise returns title of the element it is based on, otherwise returns its {@link id}
988
988
  */
989
989
  get titleOrId() {
990
- return this.title ?? this.id;
990
+ return this.title ?? this.viewOf?.title ?? this.id;
991
991
  }
992
992
  /**
993
993
  * Returns title if defined, otherwise returns `Untitled`.
@@ -1488,9 +1488,17 @@ class LikeC4Model {
1488
1488
  get stage() {
1489
1489
  return this.$data[_stage];
1490
1490
  }
1491
+ /**
1492
+ * Returns the Project ID associated with the model.
1493
+ * If the project ID is not defined in the model, it returns "default".
1494
+ */
1491
1495
  get projectId() {
1492
- return this.$data.projectId ?? "unknown";
1496
+ return this.$data.projectId ?? "default";
1493
1497
  }
1498
+ /**
1499
+ * Returns the project associated with the model.
1500
+ * If the project is not defined in the model, it returns a default project with the ID "default".
1501
+ */
1494
1502
  get project() {
1495
1503
  return this.$data.project ?? memoizeProp(this, Symbol.for("project"), () => ({
1496
1504
  id: this.projectId
@@ -1,6 +1,6 @@
1
- import { C as Connection, c as customInspectSymbol } from './core.D8bTI5KC.mjs';
2
- import { E as ElementModel, R as RelationshipModel } from './core.DoNP3Yl-.mjs';
3
- import { A as Any, U as Unknown, C as EdgeId } from './core.BFb3p5d-.mjs';
1
+ import { C as Connection, c as customInspectSymbol } from './core.Bf5zKDK1.mjs';
2
+ import { E as ElementModel, R as RelationshipModel } from './core.BvlHvikl.mjs';
3
+ import { A as Any, U as Unknown, C as EdgeId } from './core.O6FG0HF9.mjs';
4
4
 
5
5
  /**
6
6
  * Connection refers to any relationships between two elements,
@@ -1,11 +1,11 @@
1
1
  import { c as customInspectSymbol } from './core.C1GV0WWV.mjs';
2
2
  import { a as intersection, d as difference, u as union, b as stringHash, e as equals } from './core.CpwrZi3D.mjs';
3
- import { C, t as s, g as hierarchyLevel, d as commonAncestor, k as isSameHierarchy } from './core.DQj9iv_y.mjs';
3
+ import { C, t as s, g as hierarchyLevel, d as commonAncestor, n as nameFromFqn, k as isSameHierarchy } from './core.DQj9iv_y.mjs';
4
4
  import { u } from './core.DbRvwARP.mjs';
5
5
  import { n as n$1 } from './core.CnIyafWn.mjs';
6
6
  import { a as nonNullable, i as invariant } from './core.D4npX2q8.mjs';
7
7
  import { m as memoizeProp } from './core.B0oEIXqd.mjs';
8
- import { b as DefaultShapeSize, R as RichText, D as DefaultThemeColor, e as DefaultLineStyle, a as DefaultElementShape } from './core.CaaYNQDM.mjs';
8
+ import { b as DefaultShapeSize, R as RichText, D as DefaultThemeColor, e as DefaultLineStyle, a as DefaultElementShape } from './core.H8NbNp2X.mjs';
9
9
 
10
10
  function y(t,i){let a=i.length-t.length;if(a===1){let[n,...r]=i;return C(n,{lazy:t,lazyArgs:r})}if(a===0){let n={lazy:t,lazyArgs:i};return Object.assign(e=>C(e,n),n)}throw new Error("Wrong number of arguments")}
11
11
 
@@ -24,6 +24,9 @@ class AbstractDeploymentElementModel {
24
24
  ...this.$node.style
25
25
  };
26
26
  }
27
+ get name() {
28
+ return nameFromFqn(this.id);
29
+ }
27
30
  get shape() {
28
31
  return this.$node.style?.shape ?? DefaultElementShape;
29
32
  }
@@ -148,8 +148,11 @@ class RichText {
148
148
  if (this.isEmpty || this.$source === null) {
149
149
  return emptyTxt;
150
150
  }
151
- const markdown = this.$source.md ?? this.$source.txt;
152
- return memoizeProp(this, symb_html, () => markdownToHtml(markdown));
151
+ const source = this.$source;
152
+ if ("txt" in source) {
153
+ return source.txt;
154
+ }
155
+ return memoizeProp(this, symb_html, () => markdownToHtml(source.md));
153
156
  }
154
157
  equals(other) {
155
158
  if (this === other) return true;
@@ -1,6 +1,6 @@
1
1
  import { IfNever, IsNever, IsLiteral } from 'type-fest';
2
2
  import { C as Coalesce, L as Link } from './core.DuSLYTG6.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.668kXpZq.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';
4
4
 
5
5
  /**
6
6
  * Determines the stage of the model:
@@ -1,7 +1,7 @@
1
- import { s as a$2, t as t$3, u as a$3, r as r$3, m as isElementModel, j as isNestedElementOfDeployedInstanceModel, f as isDeployedInstanceModel, i as isDeploymentNodeModel, h as isDeploymentElementModel, L as LikeC4Model } from './core.BvIGRozf.mjs';
1
+ import { s as a$2, t as t$3, u as a$3, r as r$3, m as isElementModel, j as isNestedElementOfDeployedInstanceModel, f as isDeployedInstanceModel, i as isDeploymentNodeModel, h as isDeploymentElementModel, L as LikeC4Model } from './core.DsznOb9G.mjs';
2
2
  import { u as u$5 } from './core.DbRvwARP.mjs';
3
3
  import { m as m$2 } from './core.ByrmCl9I.mjs';
4
- import { i as i$a, t as t$4, n as n$2, d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.Bus32P0S.mjs';
4
+ import { i as i$a, t as t$4, n as n$2, d as deploymentConnection, R as RelationshipsAccum, D as DeploymentConnectionModel } from './core.DyzAZvbX.mjs';
5
5
  import { p as p$1, f as findAscendingConnections, m as mergeConnections, d as differenceConnections, j as isNestedConnection, s as sortConnectionsByBoundaryHierarchy, o as findConnectionsBetween$3, n as modelConnection, b as findDescendantConnections, a as findDeepestNestedConnection, i as isAnyInOut, k as isOutgoing, g as isIncoming, C as ConnectionModel } from './core.Y3j3s-oq.mjs';
6
6
  import { u as a$1, C, t as s, r as getDefaultExportFromCjs, j as isDescendantOf, m as sortParentsFirst, i as isAncestor, p as parentFqn, e as compareByFqnHierarchically, o as isNonEmptyArray, n as nameFromFqn, s as sortByFqnHierarchically, d as commonAncestor, b as ancestorsFqn, k as isSameHierarchy } from './core.DQj9iv_y.mjs';
7
7
  import { c as commonHead, r as requireForeach, a as requireIterator, u as u$6, o as objectHash, d as d$5, S as Stack } from './core.HUONfQfd.mjs';
@@ -10,10 +10,10 @@ import { n } from './core.CnIyafWn.mjs';
10
10
  import { d as difference, a as intersection, u as union, i as i$b, h as hasIntersection } from './core.CpwrZi3D.mjs';
11
11
  import { a as isIterable, n as n$1, l as l$5, b as iunique, i as iflat } from './core.8KM0D6va.mjs';
12
12
  import { o as o$7 } from './core.BgvIuGGU.mjs';
13
- import { w as whereOperatorAsPredicate, F as FqnRef, y, a as _type, _ as _stage, n as n$3 } from './core._jnYNUQ-.mjs';
14
- import { M as ModelFqnExpr, c as isViewRuleStyle, F as FqnExpr, R as RelationExpr, s as o$8, i as isViewRulePredicate, o as isViewRuleAutoLayout, r as isViewRuleGroup, m as isViewRuleGlobalPredicateRef, l as isViewRuleGlobalStyle, q as isDynamicViewParallelSteps, a as ModelRelationExpr, b as ModelExpression, k as isDynamicView, j as isDeploymentView, f as isElementView } from './core.CaJp8Amg.mjs';
15
- import { isGroupElementKind, GroupElementKind, stepEdgeId } from '../types/scalar.mjs';
16
- import { a as DefaultElementShape, D as DefaultThemeColor, f as DefaultArrowType, e as DefaultLineStyle, g as DefaultRelationshipColor } from './core.CaaYNQDM.mjs';
13
+ import { w as whereOperatorAsPredicate, F as FqnRef, y, a as _type, _ as _stage, n as n$3 } from './core.DK6I-Nr7.mjs';
14
+ import { M as ModelFqnExpr, c as isViewRuleStyle, F as FqnExpr, R as RelationExpr, s as o$8, i as isViewRulePredicate, o as isViewRuleAutoLayout, r as isViewRuleGroup, m as isViewRuleGlobalPredicateRef, l as isViewRuleGlobalStyle, q as isDynamicViewParallelSteps, a as ModelRelationExpr, b as ModelExpression, k as isDynamicView, j as isDeploymentView, f as isElementView } from './core.BW8K1y6R.mjs';
15
+ import { i as isGroupElementKind, G as GroupElementKind, d as stepEdgeId } from './core.BL_xjl90.mjs';
16
+ import { a as DefaultElementShape, D as DefaultThemeColor, f as DefaultArrowType, e as DefaultLineStyle, g as DefaultRelationshipColor } from './core.H8NbNp2X.mjs';
17
17
  import { k } from './core.BpJu1RrF.mjs';
18
18
  import { a as toSet, t as toArray, i as imap } from './core.Btl47GOn.mjs';
19
19
  import { D as DefaultMap } from './core.yaRvRnMW.mjs';
@@ -3395,7 +3395,7 @@ function applyCustomElementProperties(_rules, _nodes) {
3395
3395
  node = {
3396
3396
  ...node,
3397
3397
  isCustomized: true,
3398
- description: { txt: description }
3398
+ description
3399
3399
  };
3400
3400
  }
3401
3401
  let styleOverride;
@@ -1,4 +1,4 @@
1
- import { F as Fqn } from './core.668kXpZq.mjs';
1
+ import { F as Fqn } from './core.DX-WYEPA.mjs';
2
2
 
3
3
  declare function parentFqn<E extends string>(fqn: E): E | null;
4
4
  declare function nameFromFqn<E extends string>(fqn: E): string;
@@ -1,4 +1,4 @@
1
1
  import 'type-fest';
2
2
  import '../shared/core.DuSLYTG6.mjs';
3
- export { y as AllKinds, A as Any, A as AnyAux, G as AnySpec, a as Aux, p as DeploymentFqn, s as DeploymentId, D as DeploymentKind, C as EdgeId, g as ElementId, k as ElementKind, F as Fqn, o as LooseDeploymentId, a4 as LooseDeploymentKind, n as LooseElementId, a3 as LooseElementKind, a5 as LooseRelationKind, L as LooseTag, a2 as LooseTags, w as LooseViewId, h as Metadata, j as MetadataKey, N as Never, J as NodeId, a1 as OrString, H as PickByStage, P as ProjectId, l as RelationId, R as RelationKind, K as Spec, S as SpecAux, r as Stage, p as StrictDeploymentFqn, Y as StrictDeploymentKind, X as StrictElementKind, F as StrictFqn, O as StrictProjectId, Z as StrictRelationKind, Q as StrictTag, m as StrictViewId, u as Tag, T as Tags, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, V as ViewId, a0 as WithLinks, B as WithMetadata, z as WithOptionalLinks, W as WithOptionalTags, $ as WithTags, x as setProject, I as setStage, t as toComputed, q as toLayouted, v as toParsed } from '../shared/core.BFb3p5d-.mjs';
4
- import '../shared/core.668kXpZq.mjs';
3
+ export { y as AllKinds, A as Any, A as AnyAux, G as AnySpec, a as Aux, p as DeploymentFqn, s as DeploymentId, D as DeploymentKind, C as EdgeId, g as ElementId, k as ElementKind, F as Fqn, o as LooseDeploymentId, a4 as LooseDeploymentKind, n as LooseElementId, a3 as LooseElementKind, a5 as LooseRelationKind, L as LooseTag, a2 as LooseTags, w as LooseViewId, h as Metadata, j as MetadataKey, N as Never, J as NodeId, a1 as OrString, H as PickByStage, P as ProjectId, l as RelationId, R as RelationKind, K as Spec, S as SpecAux, r as Stage, p as StrictDeploymentFqn, Y as StrictDeploymentKind, X as StrictElementKind, F as StrictFqn, O as StrictProjectId, Z as StrictRelationKind, Q as StrictTag, m as StrictViewId, u as Tag, T as Tags, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, V as ViewId, a0 as WithLinks, B as WithMetadata, z as WithOptionalLinks, W as WithOptionalTags, $ as WithTags, x as setProject, I as setStage, t as toComputed, q as toLayouted, v as toParsed } from '../shared/core.O6FG0HF9.mjs';
4
+ import '../shared/core.DX-WYEPA.mjs';
@@ -1 +1,5 @@
1
+ const _aux = {
2
+ __proto__: null
3
+ };
1
4
 
5
+ export { _aux as _ };
@@ -1,10 +1,10 @@
1
1
  import { N as NonEmptyArray } from '../shared/core.DuSLYTG6.mjs';
2
2
  export { C as Coalesce, E as ExclusiveUnion, I as IteratorLike, K as KeysOf, L as Link, b as NTuple, a as NonEmptyReadonlyArray, P as Predicate } from '../shared/core.DuSLYTG6.mjs';
3
- export { A as Any, A as AnyAux, a as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, e as _stage, f as _type, _ as aux, i as isOnStage } from '../shared/core.BFb3p5d-.mjs';
4
- import { aR as ViewManualLayout, aM as AutoLayoutDirection } from '../shared/core.DxDn5nB5.mjs';
5
- export { Y as AbstractRelationship, ae as AndOperator, aG as AnyExcludePredicate, aF as AnyIncludePredicate, as as AnyView, aH as AnyViewRuleStyle, H as AuxFromDump, A as AuxFromLikeC4ModelData, B as BBox, aU as BaseParsedViewProperties, aT as BaseViewProperties, a$ as ComputedDeploymentView, b0 as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, C as ComputedLikeC4ModelData, aY as ComputedNode, aq as ComputedView, V as DefaultArrowType, J as DefaultElementShape, U as DefaultLineStyle, N as DefaultPaddingSize, W as DefaultRelationshipColor, K as DefaultShapeSize, O as DefaultTextSize, I as DefaultThemeColor, q as DeployedInstance, r as DeploymentElement, s as DeploymentElementRef, D as DeploymentElementStyle, p as DeploymentNode, w as DeploymentRelation, v as DeploymentRelationship, b7 as DeploymentViewExcludePredicate, b6 as DeploymentViewIncludePredicate, b8 as DeploymentViewPredicate, ba as DeploymentViewRule, b9 as DeploymentViewRuleStyle, b2 as DiagramEdge, b1 as DiagramNode, ao as DiagramView, bg as DynamicViewIncludeRule, bd as DynamicViewParallelSteps, bh as DynamicViewRule, bc as DynamicViewStep, bf as DynamicViewStepOrParallel, T as Element, $ as ElementSpecification, Q as ElementStyle, bl as ElementViewExcludePredicate, bk as ElementViewIncludePredicate, bm as ElementViewPredicate, bq as ElementViewRule, bn as ElementViewRuleGroup, bp as ElementViewRuleStyle, a4 as EqualOperator, E as Expression, aj as Filterable, F as FqnExpr, f as FqnRef, j as GlobalDynamicPredicates, G as GlobalPredicateId, i as GlobalPredicates, k as GlobalStyleID, l as GlobalStyles, a7 as KindEqual, b4 as LayoutedDeploymentView, b5 as LayoutedDynamicView, b3 as LayoutedElementView, L as LayoutedLikeC4ModelData, ao as LayoutedView, o as LikeC4ModelData, y as LikeC4ModelDump, am as LikeC4Project, an as LikeC4View, e as ModelExpression, M as ModelFqnExpr, m as ModelGlobals, _ as ModelRelation, d as ModelRelationExpr, aV as NodeNotation, ac as NotOperator, ak as OperatorPredicate, ag as OrOperator, bb as ParsedDeploymentView, bi as ParsedDynamicView, br as ParsedElementView, n as ParsedLikeC4ModelData, an as ParsedView, a9 as Participant, aa as ParticipantOperator, g as Point, P as PredicateSelector, ar as ProcessedView, z as ProjectDump, h as RectBox, c as RelationExpr, Z as Relationship, a2 as RelationshipSpecification, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty, x as SpecTypesFromDump, a3 as Specification, S as SpecificationDump, a5 as TagEqual, a0 as TagSpecification, aQ as ViewAutoLayout, at as ViewOnStage, av as ViewRule, aO as ViewRuleAutoLayout, aK as ViewRuleGlobalPredicateRef, aI as ViewRuleGlobalStyle, aw as ViewRulePredicate, aS as ViewType, aX as ViewWithHash, aW as ViewWithNotation, au as ViewWithType, ai as WhereOperator, X as XYPoint, be as getParallelStepsPrefix, af as isAndOperator, aN as isAutoLayoutDirection, az as isComputedView, u as isDeployedInstance, t as isDeploymentNode, aD as isDeploymentView, ap as isDiagramView, aE as isDynamicView, bj as isDynamicViewParallelSteps, aA as isElementView, aC as isExtendsElementView, a8 as isKindEqual, ap as isLayoutedView, ad as isNotOperator, ah as isOrOperator, ab as isParticipantOperator, aB as isScopedElementView, a1 as isTagColorSpecified, a6 as isTagEqual, aP as isViewRuleAutoLayout, aL as isViewRuleGlobalPredicateRef, aJ as isViewRuleGlobalStyle, bo as isViewRuleGroup, ax as isViewRulePredicate, ay as isViewRuleStyle, al as whereOperatorAsPredicate } from '../shared/core.DxDn5nB5.mjs';
6
- import { F as Fqn, D as DeploymentFqn } from '../shared/core.668kXpZq.mjs';
7
- export { A as AnyFqn, B as BuiltInIcon, b as DeploymentKind, j as EdgeId, E as ElementKind, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, N as NodeId, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, k as StepEdgeId, S as StepEdgeIdLiteral, m as StepEdgeKind, T as Tag, V as ViewId, o as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, n as isStepEdgeId, s as scalar, h as splitGlobalFqn, l as stepEdgeId } from '../shared/core.668kXpZq.mjs';
3
+ export { A as Any, A as AnyAux, a as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, b as UnknownComputed, c as UnknownLayouted, d as UnknownParsed, e as _stage, f as _type, _ as aux, i as isOnStage } from '../shared/core.O6FG0HF9.mjs';
4
+ import { aR as ViewManualLayout, aM as AutoLayoutDirection } from '../shared/core.CE_hG7EJ.mjs';
5
+ export { Y as AbstractRelationship, ae as AndOperator, aG as AnyExcludePredicate, aF as AnyIncludePredicate, as as AnyView, aH as AnyViewRuleStyle, H as AuxFromDump, A as AuxFromLikeC4ModelData, B as BBox, aU as BaseParsedViewProperties, aT as BaseViewProperties, a$ as ComputedDeploymentView, b0 as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, C as ComputedLikeC4ModelData, aY as ComputedNode, aq as ComputedView, V as DefaultArrowType, J as DefaultElementShape, U as DefaultLineStyle, N as DefaultPaddingSize, W as DefaultRelationshipColor, K as DefaultShapeSize, O as DefaultTextSize, I as DefaultThemeColor, q as DeployedInstance, r as DeploymentElement, s as DeploymentElementRef, D as DeploymentElementStyle, p as DeploymentNode, w as DeploymentRelation, v as DeploymentRelationship, b7 as DeploymentViewExcludePredicate, b6 as DeploymentViewIncludePredicate, b8 as DeploymentViewPredicate, ba as DeploymentViewRule, b9 as DeploymentViewRuleStyle, b2 as DiagramEdge, b1 as DiagramNode, ao as DiagramView, bg as DynamicViewIncludeRule, bd as DynamicViewParallelSteps, bh as DynamicViewRule, bc as DynamicViewStep, bf as DynamicViewStepOrParallel, T as Element, $ as ElementSpecification, Q as ElementStyle, bl as ElementViewExcludePredicate, bk as ElementViewIncludePredicate, bm as ElementViewPredicate, bq as ElementViewRule, bn as ElementViewRuleGroup, bp as ElementViewRuleStyle, a4 as EqualOperator, E as Expression, aj as Filterable, F as FqnExpr, f as FqnRef, j as GlobalDynamicPredicates, G as GlobalPredicateId, i as GlobalPredicates, k as GlobalStyleID, l as GlobalStyles, a7 as KindEqual, b4 as LayoutedDeploymentView, b5 as LayoutedDynamicView, b3 as LayoutedElementView, L as LayoutedLikeC4ModelData, ao as LayoutedView, o as LikeC4ModelData, y as LikeC4ModelDump, am as LikeC4Project, an as LikeC4View, e as ModelExpression, M as ModelFqnExpr, m as ModelGlobals, _ as ModelRelation, d as ModelRelationExpr, aV as NodeNotation, ac as NotOperator, ak as OperatorPredicate, ag as OrOperator, bb as ParsedDeploymentView, bi as ParsedDynamicView, br as ParsedElementView, n as ParsedLikeC4ModelData, an as ParsedView, a9 as Participant, aa as ParticipantOperator, g as Point, P as PredicateSelector, ar as ProcessedView, z as ProjectDump, h as RectBox, c as RelationExpr, Z as Relationship, a2 as RelationshipSpecification, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty, x as SpecTypesFromDump, a3 as Specification, S as SpecificationDump, a5 as TagEqual, a0 as TagSpecification, aQ as ViewAutoLayout, at as ViewOnStage, av as ViewRule, aO as ViewRuleAutoLayout, aK as ViewRuleGlobalPredicateRef, aI as ViewRuleGlobalStyle, aw as ViewRulePredicate, aS as ViewType, aX as ViewWithHash, aW as ViewWithNotation, au as ViewWithType, ai as WhereOperator, X as XYPoint, be as getParallelStepsPrefix, af as isAndOperator, aN as isAutoLayoutDirection, az as isComputedView, u as isDeployedInstance, t as isDeploymentNode, aD as isDeploymentView, ap as isDiagramView, aE as isDynamicView, bj as isDynamicViewParallelSteps, aA as isElementView, aC as isExtendsElementView, a8 as isKindEqual, ap as isLayoutedView, ad as isNotOperator, ah as isOrOperator, ab as isParticipantOperator, aB as isScopedElementView, a1 as isTagColorSpecified, a6 as isTagEqual, aP as isViewRuleAutoLayout, aL as isViewRuleGlobalPredicateRef, aJ as isViewRuleGlobalStyle, bo as isViewRuleGroup, ax as isViewRulePredicate, ay as isViewRuleStyle, al as whereOperatorAsPredicate } from '../shared/core.CE_hG7EJ.mjs';
6
+ import { F as Fqn, D as DeploymentFqn } from '../shared/core.DX-WYEPA.mjs';
7
+ export { A as AnyFqn, B as BuiltInIcon, b as DeploymentKind, j as EdgeId, E as ElementKind, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, N as NodeId, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, k as StepEdgeId, S as StepEdgeIdLiteral, m as StepEdgeKind, T as Tag, V as ViewId, o as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, n as isStepEdgeId, s as scalar, h as splitGlobalFqn, l as stepEdgeId } from '../shared/core.DX-WYEPA.mjs';
8
8
  import { b as BorderStyle, c as ElementShape, h as ThemeColor } from '../shared/core.CzdwsPmY.mjs';
9
9
  export { B as BorderStyles, i as Color, C as ColorLiteral, d as CustomColor, e as CustomColorDefinitions, E as ElementShapes, k as ElementThemeColorValues, l as ElementThemeColors, H as HexColor, L as LikeC4Theme, f as RelationshipArrowType, R as RelationshipLineType, m as RelationshipThemeColorValues, o as RelationshipThemeColors, a as ShapeSize, S as SpacingSize, T as TextSize, n as ThemeColorValues, g as ThemeColors, j as isThemeColor } from '../shared/core.CzdwsPmY.mjs';
10
10
  import 'type-fest';
@@ -1,8 +1,9 @@
1
- export { F as FqnRef, _ as _stage, a as _type, h as isAndOperator, c as isDeployedInstance, b as isDeploymentNode, e as isKindEqual, g as isNotOperator, i as isOnStage, j as isOrOperator, f as isParticipantOperator, d as isTagEqual, w as whereOperatorAsPredicate } from '../shared/core._jnYNUQ-.mjs';
2
- export { E as Expression, F as FqnExpr, b as ModelExpression, M as ModelFqnExpr, a as ModelRelationExpr, R as RelationExpr, p as getParallelStepsPrefix, n as isAutoLayoutDirection, d as isComputedView, j as isDeploymentView, e as isDiagramView, k as isDynamicView, q as isDynamicViewParallelSteps, f as isElementView, h as isExtendsElementView, e as isLayoutedView, g as isScopedElementView, o as isViewRuleAutoLayout, m as isViewRuleGlobalPredicateRef, l as isViewRuleGlobalStyle, r as isViewRuleGroup, i as isViewRulePredicate, c as isViewRuleStyle } from '../shared/core.CaJp8Amg.mjs';
1
+ export { _ as aux } from './_aux.mjs';
2
+ export { F as FqnRef, _ as _stage, a as _type, h as isAndOperator, c as isDeployedInstance, b as isDeploymentNode, e as isKindEqual, g as isNotOperator, i as isOnStage, j as isOrOperator, f as isParticipantOperator, d as isTagEqual, w as whereOperatorAsPredicate } from '../shared/core.DK6I-Nr7.mjs';
3
+ export { E as Expression, F as FqnExpr, b as ModelExpression, M as ModelFqnExpr, a as ModelRelationExpr, R as RelationExpr, p as getParallelStepsPrefix, n as isAutoLayoutDirection, d as isComputedView, j as isDeploymentView, e as isDiagramView, k as isDynamicView, q as isDynamicViewParallelSteps, f as isElementView, h as isExtendsElementView, e as isLayoutedView, g as isScopedElementView, o as isViewRuleAutoLayout, m as isViewRuleGlobalPredicateRef, l as isViewRuleGlobalStyle, r as isViewRuleGroup, i as isViewRulePredicate, c as isViewRuleStyle } from '../shared/core.BW8K1y6R.mjs';
3
4
  export { B as BBox, a as BorderStyles, E as ElementShapes, R as RectBox, T as ThemeColors, i as isTagColorSpecified, b as isThemeColor } from '../shared/core.CxGKeL-L.mjs';
4
- export { f as DefaultArrowType, a as DefaultElementShape, e as DefaultLineStyle, c as DefaultPaddingSize, g as DefaultRelationshipColor, b as DefaultShapeSize, d as DefaultTextSize, D as DefaultThemeColor, R as RichText } from '../shared/core.CaaYNQDM.mjs';
5
- export { DeploymentFqn, EdgeId, Fqn, GlobalFqn, GroupElementKind, NodeId, RelationId, StepEdgeKind, ViewId, extractStep, flattenMarkdownOrString, isGlobalFqn, isGroupElementKind, isStepEdgeId, splitGlobalFqn, stepEdgeId } from './scalar.mjs';
5
+ export { f as DefaultArrowType, a as DefaultElementShape, e as DefaultLineStyle, c as DefaultPaddingSize, g as DefaultRelationshipColor, b as DefaultShapeSize, d as DefaultTextSize, D as DefaultThemeColor, R as RichText } from '../shared/core.H8NbNp2X.mjs';
6
+ export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, N as NodeId, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, g as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, e as isStepEdgeId, s as scalar, c as splitGlobalFqn, d as stepEdgeId } from '../shared/core.BL_xjl90.mjs';
6
7
  import '../shared/core.zLlww-07.mjs';
7
8
  import '../shared/core.CnIyafWn.mjs';
8
9
  import '../shared/core.BgvIuGGU.mjs';
@@ -1,2 +1,2 @@
1
1
  import 'type-fest';
2
- export { A as AnyFqn, B as BuiltInIcon, D as DeploymentFqn, b as DeploymentKind, j as EdgeId, E as ElementKind, F as Fqn, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, N as NodeId, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, k as StepEdgeId, S as StepEdgeIdLiteral, m as StepEdgeKind, T as Tag, V as ViewId, o as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, n as isStepEdgeId, h as splitGlobalFqn, l as stepEdgeId } from '../shared/core.668kXpZq.mjs';
2
+ export { A as AnyFqn, B as BuiltInIcon, D as DeploymentFqn, b as DeploymentKind, j as EdgeId, E as ElementKind, F as Fqn, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, N as NodeId, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, k as StepEdgeId, S as StepEdgeIdLiteral, m as StepEdgeKind, T as Tag, V as ViewId, o as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, n as isStepEdgeId, h as splitGlobalFqn, l as stepEdgeId } from '../shared/core.DX-WYEPA.mjs';
@@ -1,68 +1,4 @@
1
- import { n } from '../shared/core.CnIyafWn.mjs';
2
- import { t } from '../shared/core.zLlww-07.mjs';
3
- import { i as invariant } from '../shared/core.D4npX2q8.mjs';
4
-
5
- function flattenMarkdownOrString(value) {
6
- if (value === null || value === void 0) {
7
- return null;
8
- }
9
- const content = t(value) ? value : value.txt ?? value.md;
10
- return n(content?.trim()) ? content : null;
11
- }
12
- function Fqn(name, parent) {
13
- return parent ? parent + "." + name : name;
14
- }
15
- const GroupElementKind = "@group";
16
- function isGroupElementKind(v) {
17
- return v.kind === GroupElementKind;
18
- }
19
- function DeploymentFqn(name, parent) {
20
- return parent ? parent + "." + name : name;
21
- }
22
- function ViewId(id) {
23
- return id;
24
- }
25
- function RelationId(id) {
26
- return id;
27
- }
28
- function GlobalFqn(projectId, name) {
29
- invariant(n(projectId), "Project ID must start with @");
30
- return "@" + projectId + "." + name;
31
- }
32
- function isGlobalFqn(fqn) {
33
- return fqn.startsWith("@");
34
- }
35
- function splitGlobalFqn(fqn) {
36
- if (!fqn.startsWith("@")) {
37
- return [null, fqn];
38
- }
39
- const firstDot = fqn.indexOf(".");
40
- if (firstDot < 2) {
41
- throw new Error("Invalid global FQN");
42
- }
43
- const projectId = fqn.slice(1, firstDot);
44
- const name = fqn.slice(firstDot + 1);
45
- return [projectId, name];
46
- }
47
- function NodeId(id) {
48
- return id;
49
- }
50
- function EdgeId(id) {
51
- return id;
52
- }
53
- function stepEdgeId(step, parallelStep) {
54
- const id = `step-${String(step).padStart(2, "0")}`;
55
- return parallelStep ? `${id}.${parallelStep}` : id;
56
- }
57
- const StepEdgeKind = "@step";
58
- function isStepEdgeId(id) {
59
- return id.startsWith("step-");
60
- }
61
- function extractStep(id) {
62
- if (!isStepEdgeId(id)) {
63
- throw new Error(`Invalid step edge id: ${id}`);
64
- }
65
- return parseFloat(id.slice("step-".length));
66
- }
67
-
68
- export { DeploymentFqn, EdgeId, Fqn, GlobalFqn, GroupElementKind, NodeId, RelationId, StepEdgeKind, ViewId, extractStep, flattenMarkdownOrString, isGlobalFqn, isGroupElementKind, isStepEdgeId, splitGlobalFqn, stepEdgeId };
1
+ import '../shared/core.CnIyafWn.mjs';
2
+ import '../shared/core.zLlww-07.mjs';
3
+ import '../shared/core.D4npX2q8.mjs';
4
+ export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, N as NodeId, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, g as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, e as isStepEdgeId, c as splitGlobalFqn, d as stepEdgeId } from '../shared/core.BL_xjl90.mjs';
@@ -1,9 +1,9 @@
1
1
  export { D as DefaultMap } from '../shared/core.CywrQs86.mjs';
2
- export { I as IterableContainer, R as ReorderedArray, a as ancestorsFqn, c as commonAncestor, b as compareByFqnHierarchically, d as compareFqnHierarchically, h as hierarchyDistance, e as hierarchyLevel, i as isAncestor, f as isDescendantOf, g as isSameHierarchy, n as nameFromFqn, p as parentFqn, s as sortByFqnHierarchically, j as sortNaturalByFqn, k as sortParentsFirst } from '../shared/core.CF82MWyh.mjs';
2
+ export { I as IterableContainer, R as ReorderedArray, a as ancestorsFqn, c as commonAncestor, b as compareByFqnHierarchically, d as compareFqnHierarchically, h as hierarchyDistance, e as hierarchyLevel, i as isAncestor, f as isDescendantOf, g as isSameHierarchy, n as nameFromFqn, p as parentFqn, s as sortByFqnHierarchically, j as sortNaturalByFqn, k as sortParentsFirst } from '../shared/core.wwaSalox.mjs';
3
3
  import { N as NonEmptyArray } from '../shared/core.DuSLYTG6.mjs';
4
4
  import { Tagged, Simplify, Or, IfNever, IsLiteral, And, GreaterThan, IsNever, IsEqual, ReadonlyTuple, IsNumericLiteral } from 'type-fest';
5
5
  export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isIterable, isome, iunique, toArray, toSet } from './iterable/index.mjs';
6
- import '../shared/core.668kXpZq.mjs';
6
+ import '../shared/core.DX-WYEPA.mjs';
7
7
 
8
8
  /**
9
9
  * Mnemonist DefaultWeakMap Typings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "1.36.1",
3
+ "version": "1.38.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -99,7 +99,7 @@
99
99
  "type-fest": "^4.41.0",
100
100
  "unified": "11.0.5",
101
101
  "chroma-js": "^3.1.2",
102
- "@mantine/colors-generator": "8.2.2"
102
+ "@mantine/colors-generator": "8.2.4"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@types/chroma-js": "^3.1.1",
@@ -125,7 +125,7 @@
125
125
  "typescript": "5.9.2",
126
126
  "unbuild": "3.5.0",
127
127
  "vitest": "3.2.4",
128
- "@likec4/tsconfig": "1.36.1"
128
+ "@likec4/tsconfig": "1.38.0"
129
129
  },
130
130
  "scripts": {
131
131
  "typecheck": "tsc -b --verbose",
@@ -408,7 +408,10 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
408
408
  build: (project?: LikeC4Project) => ({
409
409
  [_stage]: 'parsed',
410
410
  projectId: project?.id ?? 'from-builder',
411
- project: project ?? { id: 'from-builder' },
411
+ project: {
412
+ id: 'from-builder',
413
+ ...project,
414
+ },
412
415
  specification: toLikeC4Specification(),
413
416
  elements: fromEntries(
414
417
  structuredClone(
@@ -67,7 +67,7 @@ export function applyCustomElementProperties<A extends AnyAux>(
67
67
  node = {
68
68
  ...node,
69
69
  isCustomized: true,
70
- description: { txt: description },
70
+ description,
71
71
  }
72
72
  }
73
73
 
@@ -21,7 +21,7 @@ import {
21
21
  RichText,
22
22
  } from '../types'
23
23
  import * as aux from '../types/_aux'
24
- import { commonAncestor, hierarchyLevel, memoizeProp, nonNullable } from '../utils'
24
+ import { commonAncestor, hierarchyLevel, memoizeProp, nameFromFqn, nonNullable } from '../utils'
25
25
  import { difference, intersection, union } from '../utils/set'
26
26
  import type { LikeC4DeploymentModel } from './DeploymentModel'
27
27
  import type { ElementModel } from './ElementModel'
@@ -55,6 +55,10 @@ abstract class AbstractDeploymentElementModel<A extends Any> implements WithTags
55
55
  }
56
56
  }
57
57
 
58
+ get name(): string {
59
+ return nameFromFqn(this.id)
60
+ }
61
+
58
62
  get shape(): C4ElementShape {
59
63
  return this.$node.style?.shape ?? DefaultElementShape
60
64
  }
@@ -12,12 +12,12 @@ import type {
12
12
  ModelGlobals,
13
13
  ParsedLikeC4ModelData,
14
14
  Relationship,
15
- scalar,
16
15
  Specification,
17
16
  WhereOperator,
18
17
  } from '../types'
19
18
  import { type ProjectId, _stage, GlobalFqn, isGlobalFqn, isOnStage, whereOperatorAsPredicate } from '../types'
20
19
  import type * as aux from '../types/_aux'
20
+ import * as scalar from '../types/scalar'
21
21
  import { compareNatural, compareNaturalHierarchically, ifilter, invariant, memoizeProp, nonNullable } from '../utils'
22
22
  import { ancestorsFqn, commonAncestor, parentFqn, sortParentsFirst } from '../utils/fqn'
23
23
  import { DefaultMap } from '../utils/mnemonist'
@@ -294,10 +294,18 @@ export class LikeC4Model<A extends Any = aux.Unknown> {
294
294
  return this.$data[_stage] as aux.Stage<A>
295
295
  }
296
296
 
297
+ /**
298
+ * Returns the Project ID associated with the model.
299
+ * If the project ID is not defined in the model, it returns "default".
300
+ */
297
301
  get projectId(): aux.ProjectId<A> {
298
- return this.$data.projectId ?? 'unknown' as any
302
+ return this.$data.projectId ?? 'default' as any
299
303
  }
300
304
 
305
+ /**
306
+ * Returns the project associated with the model.
307
+ * If the project is not defined in the model, it returns a default project with the ID "default".
308
+ */
301
309
  get project(): LikeC4Project {
302
310
  return this.$data.project ?? memoizeProp(this, Symbol.for('project'), () => ({
303
311
  id: this.projectId as unknown as scalar.ProjectId,
@@ -113,10 +113,10 @@ export class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>>
113
113
  }
114
114
 
115
115
  /**
116
- * Returns title if defined, otherwise returns its {@link id}
116
+ * Returns title if defined, otherwise returns title of the element it is based on, otherwise returns its {@link id}
117
117
  */
118
118
  get titleOrId(): string {
119
- return this.title ?? this.id
119
+ return this.title ?? this.viewOf?.title ?? this.id
120
120
  }
121
121
 
122
122
  /**
@@ -182,8 +182,11 @@ export class RichText {
182
182
  if (this.isEmpty || this.$source === null) {
183
183
  return emptyTxt
184
184
  }
185
- const markdown = this.$source.md ?? this.$source.txt
186
- return memoizeProp(this, symb_html, () => markdownToHtml(markdown))
185
+ const source = this.$source
186
+ if ('txt' in source) {
187
+ return source.txt
188
+ }
189
+ return memoizeProp(this, symb_html, () => markdownToHtml(source.md!))
187
190
  }
188
191
 
189
192
  equals(other: unknown): boolean {
@@ -4,7 +4,7 @@ import type { ExclusiveUnion } from './_common'
4
4
  import type { PredicateSelector } from './expression'
5
5
  import { FqnRef } from './fqnRef'
6
6
  import type { WhereOperator } from './operators'
7
- import { type Icon } from './scalar'
7
+ import type * as scalar from './scalar'
8
8
  import type {
9
9
  BorderStyle,
10
10
  Color,
@@ -72,12 +72,12 @@ export namespace ModelFqnExpr {
72
72
  custom: {
73
73
  expr: OrWhere<A>
74
74
  title?: string
75
- description?: string
75
+ description?: scalar.MarkdownOrString
76
76
  technology?: string
77
77
  notation?: string
78
78
  shape?: ElementShape
79
79
  color?: Color
80
- icon?: Icon
80
+ icon?: scalar.Icon
81
81
  border?: BorderStyle
82
82
  opacity?: number
83
83
  navigateTo?: aux.StrictViewId<A>
@@ -3,7 +3,7 @@ import type { AnyAux } from './_aux'
3
3
  import type { ExclusiveUnion } from './_common'
4
4
  import { FqnRef } from './fqnRef'
5
5
  import type { WhereOperator } from './operators'
6
- import { type Icon } from './scalar'
6
+ import type * as scalar from './scalar'
7
7
  import type {
8
8
  BorderStyle,
9
9
  Color,
@@ -86,12 +86,12 @@ export namespace FqnExpr {
86
86
  custom: {
87
87
  expr: OrWhere<A>
88
88
  title?: string
89
- description?: string
89
+ description?: scalar.MarkdownOrString
90
90
  technology?: string
91
91
  notation?: string
92
92
  shape?: ElementShape
93
93
  color?: Color
94
- icon?: Icon
94
+ icon?: scalar.Icon
95
95
  border?: BorderStyle
96
96
  opacity?: number
97
97
  navigateTo?: aux.StrictViewId<A>
@@ -1,6 +1,6 @@
1
1
  export * from './_common'
2
2
 
3
- export type * as aux from './_aux'
3
+ export * as aux from './_aux'
4
4
 
5
5
  export type {
6
6
  Any,
@@ -37,6 +37,6 @@ export * from './view-parsed.deployment'
37
37
  export * from './view-parsed.dynamic'
38
38
  export * from './view-parsed.element'
39
39
 
40
- export type * as scalar from './scalar'
40
+ export * as scalar from './scalar'
41
41
 
42
42
  export { RichText, type RichTextEmpty, type RichTextOrEmpty } from './RichText'
@@ -1,9 +1,14 @@
1
1
  import * as scalar from './scalar'
2
2
 
3
3
  /**
4
- * LikeC4 projects encapsulate model, and can import from each other
4
+ * Configuration of the project, as read from the config file.
5
+ * LikeC4 projects encapsulate models, and can import from each other
5
6
  */
6
7
  export interface LikeC4Project {
7
- id: scalar.ProjectId
8
+ /**
9
+ * ID of the project, casted to {@link scalar.ProjectId}
10
+ */
11
+ readonly id: scalar.ProjectId
12
+
8
13
  title?: string
9
14
  }
@@ -3,6 +3,9 @@ import type { Tagged } from 'type-fest'
3
3
  import { invariant } from '../utils'
4
4
 
5
5
  export type ProjectId<T = string> = Tagged<T, 'ProjectID'>
6
+ export function ProjectId(name: string): ProjectId {
7
+ return name as unknown as ProjectId
8
+ }
6
9
 
7
10
  export type MarkdownOrString = { txt: string; md?: never } | { md: string; txt?: never }
8
11