@likec4/core 1.32.1 → 1.33.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 (101) hide show
  1. package/dist/builder/index.d.mts +10 -6
  2. package/dist/builder/index.mjs +45 -13
  3. package/dist/compute-view/index.d.mts +6 -4
  4. package/dist/compute-view/index.mjs +33 -10
  5. package/dist/compute-view/relationships-view/index.d.mts +6 -4
  6. package/dist/compute-view/relationships-view/index.mjs +6 -3
  7. package/dist/index.d.mts +9 -138
  8. package/dist/index.mjs +31 -3712
  9. package/dist/model/connection/deployment/index.d.mts +10 -0
  10. package/dist/model/connection/deployment/index.mjs +18 -0
  11. package/dist/model/connection/index.d.mts +70 -0
  12. package/dist/model/connection/index.mjs +23 -0
  13. package/dist/model/connection/model/index.d.mts +10 -0
  14. package/dist/model/connection/model/index.mjs +11 -0
  15. package/dist/model/index.d.mts +14 -256
  16. package/dist/model/index.mjs +27 -5
  17. package/dist/shared/{core.DXzRBkuI.d.mts → core.1pNeDdRk.d.mts} +92 -81
  18. package/dist/shared/{core.BuO4ncfY.d.mts → core.668kXpZq.d.mts} +42 -52
  19. package/dist/shared/core.8KM0D6va.mjs +33 -0
  20. package/dist/shared/core.B0oEIXqd.mjs +47 -0
  21. package/dist/shared/core.BH9nN-_I.mjs +22 -0
  22. package/dist/shared/core.BMCb0wJI.mjs +177 -0
  23. package/dist/shared/core.BTnf14gD.mjs +331 -0
  24. package/dist/shared/core.BgvIuGGU.mjs +3 -0
  25. package/dist/shared/core.BoyJPEen.mjs +21 -0
  26. package/dist/shared/{core.CUYDgv2-.mjs → core.Br7Fab9l.mjs} +12 -15
  27. package/dist/shared/{core.BrCnZFTn.mjs → core.Btl47GOn.mjs} +3 -3
  28. package/dist/shared/core.ByrmCl9I.mjs +5 -0
  29. package/dist/shared/core.C80Z37Eu.mjs +29 -0
  30. package/dist/shared/{core.Pf5I9o0e.d.mts → core.CF82MWyh.d.mts} +1 -1
  31. package/dist/shared/{core.rmvsy0n3.mjs → core.C_C-3c1S.mjs} +5 -198
  32. package/dist/shared/core.CeQbbp7K.d.mts +41 -0
  33. package/dist/shared/{core.DoK86JEe.mjs → core.CpwrZi3D.mjs} +2 -73
  34. package/dist/shared/{core.CpXlRyE5.mjs → core.CtKXPqN_.mjs} +5 -36
  35. package/dist/shared/core.CxGKeL-L.mjs +144 -0
  36. package/dist/shared/core.CzdwsPmY.d.mts +69 -0
  37. package/dist/shared/{core.Cy9smucx.mjs → core.D4npX2q8.mjs} +1 -3
  38. package/dist/shared/core.D56nCp7e.mjs +168 -0
  39. package/dist/shared/core.D5qVzkws.mjs +724 -0
  40. package/dist/shared/core.DDAPzd3T.d.mts +87 -0
  41. package/dist/shared/{core.CBpKAlhj.mjs → core.DDynPqbh.mjs} +96 -56
  42. package/dist/shared/{core.Bk7wEZFG.mjs → core.DXRAwwDB.mjs} +3 -2
  43. package/dist/shared/core.DcS-0zys.mjs +10 -0
  44. package/dist/shared/{core.BaYE_r29.d.mts → core.De___iBS.d.mts} +4 -3
  45. package/dist/shared/core.DsMrjY2q.mjs +34 -0
  46. package/dist/shared/core.DuSLYTG6.d.mts +57 -0
  47. package/dist/shared/core.Dy-F3xRP.d.mts +83 -0
  48. package/dist/shared/{core.znRaUX_A.d.mts → core.OLInHaJx.d.mts} +48 -41
  49. package/dist/shared/core.XptQjhMA.mjs +1295 -0
  50. package/dist/shared/{core.cbA9VZ02.mjs → core.hoq9W4rW.mjs} +28 -1073
  51. package/dist/shared/core.zLlww-07.mjs +3 -0
  52. package/dist/theme/index.d.mts +134 -0
  53. package/dist/theme/index.mjs +3709 -0
  54. package/dist/types/aux.d.mts +3 -2
  55. package/dist/types/index.d.mts +9 -5
  56. package/dist/types/index.mjs +17 -146
  57. package/dist/utils/index.d.mts +16 -100
  58. package/dist/utils/index.mjs +25 -1312
  59. package/dist/utils/iterable/index.d.mts +100 -0
  60. package/dist/utils/iterable/index.mjs +24 -0
  61. package/package.json +26 -10
  62. package/src/builder/Builder.ts +13 -4
  63. package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +0 -13
  64. package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +2 -6
  65. package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +0 -7
  66. package/src/builder/_types.ts +6 -2
  67. package/src/compute-view/deployment-view/__test__/fixture.ts +15 -5
  68. package/src/compute-view/deployment-view/utils.ts +13 -13
  69. package/src/compute-view/dynamic-view/compute.ts +2 -1
  70. package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +2 -2
  71. package/src/compute-view/relationships-view/layout.ts +1 -1
  72. package/src/compute-view/utils/applyCustomElementProperties.ts +8 -0
  73. package/src/compute-view/utils/applyCustomRelationProperties.ts +2 -0
  74. package/src/compute-view/utils/buildComputedNodes.ts +4 -3
  75. package/src/compute-view/utils/merge-props-from-relationships.ts +6 -5
  76. package/src/compute-view/utils/view-hash.ts +24 -3
  77. package/src/model/DeploymentElementModel.ts +22 -18
  78. package/src/model/ElementModel.ts +14 -10
  79. package/src/model/RelationModel.ts +21 -21
  80. package/src/model/index.ts +4 -0
  81. package/src/model/types.ts +11 -0
  82. package/src/model/view/EdgeModel.ts +6 -5
  83. package/src/model/view/LikeC4ViewModel.ts +10 -4
  84. package/src/model/view/NodeModel.ts +6 -4
  85. package/src/theme/index.ts +12 -5
  86. package/src/types/RichText.ts +200 -0
  87. package/src/types/aux.ts +1 -1
  88. package/src/types/index.ts +2 -0
  89. package/src/types/model-deployment.ts +4 -3
  90. package/src/types/model-logical.ts +3 -3
  91. package/src/types/scalar.ts +47 -2
  92. package/src/types/view-common.ts +1 -1
  93. package/src/types/view-computed.ts +2 -4
  94. package/src/types/view-layouted.ts +9 -0
  95. package/src/types/view-parsed.deployment.ts +0 -1
  96. package/src/types/view.ts +0 -27
  97. package/src/utils/index.ts +5 -10
  98. package/src/utils/markdown/index.ts +2 -0
  99. package/src/utils/markdown/to-html.ts +32 -0
  100. package/src/utils/markdown/to-text.ts +14 -0
  101. package/src/utils/promises.ts +4 -0
@@ -1,8 +1,10 @@
1
- import { LastArrayElement, Split, Simplify, IsLiteral, Writable, IfNever, TupleToUnion, Tagged } from 'type-fest';
2
- import { L as LikeC4Model } from '../shared/core.znRaUX_A.mjs';
3
- import { D as DeploymentFqn, F as Fqn, d as NonEmptyArray, K as KeysOf } from '../shared/core.BuO4ncfY.mjs';
4
- import { q as DeploymentElement, u as DeploymentRelationship, O as Element, Z as ModelRelation, a8 as Participant, M as ModelFqnExpr, a as ModelRelationExpr, aZ as AnyViewRuleStyle, b2 as AutoLayoutDirection, E as Expression, aF as ParsedView, bt as ParsedDeploymentView, bJ as ParsedElementView, k as ParsedLikeC4ModelData, ar as ElementShape, ay as ThemeColor, ap as BorderStyle, an as ShapeSize, al as SpacingSize, am as TextSize, aw as RelationshipArrowType, av as RelationshipLineType, _ as ElementSpecification$1, a1 as RelationshipSpecification, $ as TagSpecification } from '../shared/core.DXzRBkuI.mjs';
5
- import { b as Aux, S as SpecAux, A as Any } from '../shared/core.BaYE_r29.mjs';
1
+ import { LastArrayElement, Split, Simplify, IsLiteral, Writable, IfNever, IsNever, TupleToUnion, Tagged } from 'type-fest';
2
+ import { g as LikeC4Model } from '../shared/core.OLInHaJx.mjs';
3
+ import { D as DeploymentFqn, F as Fqn } from '../shared/core.668kXpZq.mjs';
4
+ import { r as DeploymentElement, v as DeploymentRelationship, Q as Element, Z as ModelRelation, a8 as Participant, M as ModelFqnExpr, d as ModelRelationExpr, aF as AnyViewRuleStyle, aK as AutoLayoutDirection, E as Expression, al as ParsedView, b9 as ParsedDeploymentView, bp as ParsedElementView, n as ParsedLikeC4ModelData, _ as ElementSpecification$1, a1 as RelationshipSpecification, $ as TagSpecification } from '../shared/core.1pNeDdRk.mjs';
5
+ import { N as NonEmptyArray, K as KeysOf } from '../shared/core.DuSLYTG6.mjs';
6
+ import { c as ElementShape, h as ThemeColor, b as BorderStyle, a as ShapeSize, S as SpacingSize, T as TextSize, f as RelationshipArrowType, R as RelationshipLineType } from '../shared/core.CzdwsPmY.mjs';
7
+ import { b as Aux, S as SpecAux, A as Any } from '../shared/core.De___iBS.mjs';
6
8
  import '../shared/core.CywrQs86.mjs';
7
9
 
8
10
  type ToNested$1<T, Id extends string> = T extends TypesNested<infer P, any, any, any, any, any, any, any, infer F> ? TypesNested<`${P}.${Id}`, T['ElementKind'], T['Fqn'], T['ViewId'], T['RelationshipKind'], T['Tag'], T['MetadataKey'], T['DeploymentKind'], `${P}.${Id}` | F> : T extends AnyTypes ? TypesNested<Id, T['ElementKind'], T['Fqn'], T['ViewId'], T['RelationshipKind'], T['Tag'], T['MetadataKey'], T['DeploymentKind'], Id | T['DeploymentFqn']> : never;
@@ -579,7 +581,9 @@ type BuilderSpecification = {
579
581
  };
580
582
  metadataKeys?: string[];
581
583
  };
582
- type Metadata<MetadataKey extends string> = IfNever<MetadataKey, never, Record<MetadataKey, string>>;
584
+ type Metadata<MetadataKey extends string> = IsNever<MetadataKey> extends true ? never : IsLiteral<MetadataKey> extends true ? {
585
+ [key in MetadataKey]?: string;
586
+ } : Record<string, string>;
583
587
  type NewElementProps<Tag, Metadata> = {
584
588
  title?: string;
585
589
  description?: string;
@@ -1,13 +1,36 @@
1
- import { i, l, d, c as computeLikeC4Model } from '../shared/core.CBpKAlhj.mjs';
2
- import { m, i as i$1 } from '../shared/core.DoK86JEe.mjs';
3
- import { _ as _type, D as DefaultElementShape, a as DefaultThemeColor, n as n$1, b as _stage, i as isDeployedInstance, F as FqnRef } from '../shared/core.CUYDgv2-.mjs';
4
- import { n as nameFromFqn, d as isSameHierarchy, p as parentFqn, t as t$2 } from '../shared/core.rmvsy0n3.mjs';
5
- import { l as l$1 } from '../shared/core.CpXlRyE5.mjs';
1
+ import { i, l, d, c as computeLikeC4Model } from '../shared/core.DDynPqbh.mjs';
2
+ import { m } from '../shared/core.ByrmCl9I.mjs';
3
+ import { a as _type, t as n$1, _ as _stage, c as isDeployedInstance, F as FqnRef } from '../shared/core.Br7Fab9l.mjs';
4
+ import { t as t$2 } from '../shared/core.BH9nN-_I.mjs';
5
+ import { l as l$1 } from '../shared/core.8KM0D6va.mjs';
6
6
  import { u } from '../shared/core.DbRvwARP.mjs';
7
- import { t as t$1 } from '../shared/core.cbA9VZ02.mjs';
8
- import { t, i as invariant } from '../shared/core.Cy9smucx.mjs';
9
- import { o, M as ModelFqnExpr, a as isElementView } from '../shared/core.Bk7wEZFG.mjs';
10
- import '../shared/core.BrCnZFTn.mjs';
7
+ import { t as t$1 } from '../shared/core.hoq9W4rW.mjs';
8
+ import { i as i$1 } from '../shared/core.CpwrZi3D.mjs';
9
+ import { n as nameFromFqn, k as isSameHierarchy, p as parentFqn } from '../shared/core.C_C-3c1S.mjs';
10
+ import { t } from '../shared/core.zLlww-07.mjs';
11
+ import { s as o, M as ModelFqnExpr, f as isElementView } from '../shared/core.DXRAwwDB.mjs';
12
+ import { i as invariant } from '../shared/core.D4npX2q8.mjs';
13
+ import { a as DefaultElementShape, D as DefaultThemeColor } from '../shared/core.D56nCp7e.mjs';
14
+ import '../shared/core.D5qVzkws.mjs';
15
+ import '../shared/core.C80Z37Eu.mjs';
16
+ import '../shared/core.B0oEIXqd.mjs';
17
+ import 'rehype-raw';
18
+ import 'rehype-sanitize';
19
+ import 'rehype-stringify';
20
+ import 'remark-gfm';
21
+ import 'remark-parse';
22
+ import 'remark-rehype';
23
+ import 'unified';
24
+ import 'mdast-util-from-markdown';
25
+ import 'mdast-util-to-string';
26
+ import '../shared/core.BTnf14gD.mjs';
27
+ import '../shared/core.BgvIuGGU.mjs';
28
+ import '../shared/core.BoyJPEen.mjs';
29
+ import '../shared/core.CtKXPqN_.mjs';
30
+ import '../shared/core.Btl47GOn.mjs';
31
+ import '../shared/core.BMCb0wJI.mjs';
32
+ import '../shared/core.DcS-0zys.mjs';
33
+ import '../shared/core.DsMrjY2q.mjs';
11
34
 
12
35
  function n(...r){return u(Object.fromEntries,r)}
13
36
 
@@ -447,11 +470,10 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
447
470
  return [{
448
471
  id,
449
472
  title,
450
- description,
473
+ description: description ? { txt: description } : null,
451
474
  tags,
452
475
  links,
453
476
  _stage: "parsed",
454
- // customColorDefinitions: {},
455
477
  ...props
456
478
  }, builder2];
457
479
  };
@@ -605,6 +627,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
605
627
  const {
606
628
  title = "",
607
629
  links: _links = [],
630
+ description = null,
608
631
  ...props
609
632
  } = defu(
610
633
  typeof _props === "string" ? { title: _props } : { ..._props },
@@ -619,6 +642,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
619
642
  model: target
620
643
  },
621
644
  title,
645
+ ...description && { description: { txt: description } },
622
646
  ...links && { links },
623
647
  ...props
624
648
  });
@@ -630,6 +654,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
630
654
  const {
631
655
  title = "",
632
656
  links: _links = [],
657
+ description = null,
633
658
  ...props
634
659
  } = defu(
635
660
  typeof _props === "string" ? { title: _props } : { ..._props },
@@ -641,6 +666,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
641
666
  model: target
642
667
  },
643
668
  title,
669
+ ...description && { description: { txt: description } },
644
670
  ...links && { links },
645
671
  ...props
646
672
  });
@@ -656,6 +682,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
656
682
  icon: _icon,
657
683
  style,
658
684
  title,
685
+ description = null,
659
686
  ...props
660
687
  } = typeof _props === "string" ? { title: _props } : { ..._props };
661
688
  const links = mapLinks(_links);
@@ -665,7 +692,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
665
692
  id: _id,
666
693
  kind,
667
694
  title: title ?? nameFromFqn(_id),
668
- description: null,
695
+ ...description && { description: { txt: description } },
669
696
  technology: null,
670
697
  tags: [],
671
698
  color: specStyle?.color ?? DefaultThemeColor,
@@ -815,6 +842,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
815
842
  const {
816
843
  links,
817
844
  title,
845
+ description = null,
818
846
  ...props
819
847
  } = typeof _props === "string" ? { title: _props } : { ..._props };
820
848
  const _id = b.__deploymentFqn(id);
@@ -823,6 +851,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
823
851
  id: _id,
824
852
  element: target,
825
853
  ...title && { title },
854
+ ...description && { description: { txt: description } },
826
855
  ...links && { links: mapLinks(links) },
827
856
  ...props
828
857
  });
@@ -834,6 +863,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
834
863
  const {
835
864
  title = null,
836
865
  links,
866
+ description = null,
837
867
  ...props
838
868
  } = typeof _props === "string" ? { title: _props } : { ..._props };
839
869
  b.__addDeploymentRelation({
@@ -844,6 +874,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
844
874
  deployment: target
845
875
  },
846
876
  title,
877
+ ...description && { description: { txt: description } },
847
878
  ...links && { links: mapLinks(links) },
848
879
  ...props
849
880
  });
@@ -859,6 +890,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
859
890
  icon: _icon,
860
891
  style,
861
892
  title,
893
+ description = null,
862
894
  ...props
863
895
  } = typeof _props === "string" ? { title: _props } : { ..._props };
864
896
  const icon = _icon ?? specStyle?.icon;
@@ -867,7 +899,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
867
899
  id: _id,
868
900
  kind,
869
901
  title: title ?? nameFromFqn(_id),
870
- description: null,
902
+ ...description && { description: { txt: description } },
871
903
  technology: null,
872
904
  tags: null,
873
905
  style: {
@@ -1,9 +1,11 @@
1
- import { A as Any } from '../shared/core.BaYE_r29.mjs';
2
- import { L as LikeC4Model } from '../shared/core.znRaUX_A.mjs';
3
- import { k as ParsedLikeC4ModelData, l as ComputedLikeC4ModelData, aF as ParsedView, aI as ComputedView } from '../shared/core.DXzRBkuI.mjs';
1
+ import { A as Any } from '../shared/core.De___iBS.mjs';
2
+ import { g as LikeC4Model } from '../shared/core.OLInHaJx.mjs';
3
+ import { n as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, al as ParsedView, ao as ComputedView } from '../shared/core.1pNeDdRk.mjs';
4
4
  import 'type-fest';
5
- import '../shared/core.BuO4ncfY.mjs';
5
+ import '../shared/core.DuSLYTG6.mjs';
6
+ import '../shared/core.668kXpZq.mjs';
6
7
  import '../shared/core.CywrQs86.mjs';
8
+ import '../shared/core.CzdwsPmY.mjs';
7
9
 
8
10
  type ComputeViewResult<V> = {
9
11
  isSuccess: true;
@@ -1,14 +1,37 @@
1
- import { G as Graph, w as willCreateCycle, t as topologicalSortExports, i as i$2, l } from '../shared/core.CBpKAlhj.mjs';
2
- export { c as computeLikeC4Model, a as computeParsedModelData, b as computeView, u as unsafeComputeView } from '../shared/core.CBpKAlhj.mjs';
3
- import { r, i as i$1 } from '../shared/core.cbA9VZ02.mjs';
4
- import { i as isExtendsElementView, a as isElementView } from '../shared/core.Bk7wEZFG.mjs';
5
- import { c as isNonEmptyArray } from '../shared/core.rmvsy0n3.mjs';
6
- import { i, m } from '../shared/core.DoK86JEe.mjs';
1
+ import { G as Graph, w as willCreateCycle, t as topologicalSortExports, i as i$2, l } from '../shared/core.DDynPqbh.mjs';
2
+ export { c as computeLikeC4Model, a as computeParsedModelData, b as computeView, u as unsafeComputeView } from '../shared/core.DDynPqbh.mjs';
3
+ import { i as i$1 } from '../shared/core.D5qVzkws.mjs';
4
+ import { r } from '../shared/core.hoq9W4rW.mjs';
5
+ import { h as isExtendsElementView, f as isElementView } from '../shared/core.DXRAwwDB.mjs';
6
+ import { o as isNonEmptyArray } from '../shared/core.C_C-3c1S.mjs';
7
+ import { i } from '../shared/core.CpwrZi3D.mjs';
7
8
  import { u } from '../shared/core.DbRvwARP.mjs';
8
- import '../shared/core.CpXlRyE5.mjs';
9
- import '../shared/core.Cy9smucx.mjs';
10
- import '../shared/core.CUYDgv2-.mjs';
11
- import '../shared/core.BrCnZFTn.mjs';
9
+ import { m } from '../shared/core.ByrmCl9I.mjs';
10
+ import '../shared/core.BTnf14gD.mjs';
11
+ import '../shared/core.C80Z37Eu.mjs';
12
+ import '../shared/core.BgvIuGGU.mjs';
13
+ import '../shared/core.BoyJPEen.mjs';
14
+ import '../shared/core.BH9nN-_I.mjs';
15
+ import '../shared/core.D4npX2q8.mjs';
16
+ import '../shared/core.CtKXPqN_.mjs';
17
+ import '../shared/core.8KM0D6va.mjs';
18
+ import '../shared/core.D56nCp7e.mjs';
19
+ import '../shared/core.B0oEIXqd.mjs';
20
+ import 'rehype-raw';
21
+ import 'rehype-sanitize';
22
+ import 'rehype-stringify';
23
+ import 'remark-gfm';
24
+ import 'remark-parse';
25
+ import 'remark-rehype';
26
+ import 'unified';
27
+ import 'mdast-util-from-markdown';
28
+ import 'mdast-util-to-string';
29
+ import '../shared/core.Br7Fab9l.mjs';
30
+ import '../shared/core.zLlww-07.mjs';
31
+ import '../shared/core.Btl47GOn.mjs';
32
+ import '../shared/core.BMCb0wJI.mjs';
33
+ import '../shared/core.DcS-0zys.mjs';
34
+ import '../shared/core.DsMrjY2q.mjs';
12
35
 
13
36
  function y(...t){return u(f,t)}function f(t,e){if(!i(e,1))return {...t};if(!i(e,2)){let{[e[0]]:r,...m}=t;return m}let o={...t};for(let r of e)delete o[r];return o}
14
37
 
@@ -1,9 +1,11 @@
1
- import { A as Any, U as Unknown, g as ElementId, V as ViewId } from '../../shared/core.BaYE_r29.mjs';
2
- import { E as ElementModel, R as RelationshipModel, L as LikeC4Model } from '../../shared/core.znRaUX_A.mjs';
1
+ import { A as Any, U as Unknown, g as ElementId, V as ViewId } from '../../shared/core.De___iBS.mjs';
2
+ import { E as ElementModel, R as RelationshipModel, g as LikeC4Model } from '../../shared/core.OLInHaJx.mjs';
3
3
  import 'type-fest';
4
- import '../../shared/core.BuO4ncfY.mjs';
4
+ import '../../shared/core.DuSLYTG6.mjs';
5
+ import '../../shared/core.668kXpZq.mjs';
5
6
  import '../../shared/core.CywrQs86.mjs';
6
- import '../../shared/core.DXzRBkuI.mjs';
7
+ import '../../shared/core.1pNeDdRk.mjs';
8
+ import '../../shared/core.CzdwsPmY.mjs';
7
9
 
8
10
  type RelationshipsViewData<M extends Any = Unknown> = {
9
11
  incomers: ReadonlySet<ElementModel<M>>;
@@ -1,6 +1,9 @@
1
- import { s as sortParentsFirst, D as DefaultMap, i as isDescendantOf, a as isAncestor, b as ifilter, C } from '../../shared/core.rmvsy0n3.mjs';
2
- import { n as nonNullable, i as invariant } from '../../shared/core.Cy9smucx.mjs';
3
- import { t as toSet, a as toArray, i as imap } from '../../shared/core.BrCnZFTn.mjs';
1
+ import { m as sortParentsFirst, j as isDescendantOf, i as isAncestor, C } from '../../shared/core.C_C-3c1S.mjs';
2
+ import { D as DefaultMap } from '../../shared/core.BMCb0wJI.mjs';
3
+ import { a as nonNullable, i as invariant } from '../../shared/core.D4npX2q8.mjs';
4
+ import { a as toSet, t as toArray, i as imap } from '../../shared/core.Btl47GOn.mjs';
5
+ import { i as ifilter } from '../../shared/core.BH9nN-_I.mjs';
6
+ import '../../shared/core.zLlww-07.mjs';
4
7
 
5
8
  function treeFromElements(elements) {
6
9
  const sorted = sortParentsFirst([...elements]);
package/dist/index.d.mts CHANGED
@@ -1,141 +1,12 @@
1
- import { C as ColorLiteral, T as ThemeColorValues, L as LikeC4Theme } from './shared/core.DXzRBkuI.mjs';
2
- export { W as AbstractRelationship, ad as AndOperator, aY as AnyExcludePredicate, aX as AnyIncludePredicate, aK as AnyView, aZ as AnyViewRuleStyle, b2 as AutoLayoutDirection, y as AuxFromDump, A as AuxFromLikeC4ModelData, B as BBox, ba as BaseParsedViewProperties, b9 as BaseViewProperties, ap as BorderStyle, ao as BorderStyles, az as Color, bh as ComputedDeploymentView, bi as ComputedDynamicView, bf as ComputedEdge, bg as ComputedElementView, l as ComputedLikeC4ModelData, be as ComputedNode, aI as ComputedView, at as CustomColor, au as CustomColorDefinitions, U as DefaultArrowType, H as DefaultElementShape, Q as DefaultLineStyle, J as DefaultPaddingSize, V as DefaultRelationshipColor, I as DefaultShapeSize, K as DefaultTextSize, z as DefaultThemeColor, p as DeployedInstance, q as DeploymentElement, r as DeploymentElementRef, D as DeploymentElementStyle, o as DeploymentNode, v as DeploymentRelation, u as DeploymentRelationship, bp as DeploymentViewExcludePredicate, bo as DeploymentViewIncludePredicate, bq as DeploymentViewPredicate, bs as DeploymentViewRule, br as DeploymentViewRuleStyle, bk as DiagramEdge, bj as DiagramNode, aG as DiagramView, by as DynamicViewIncludeRule, bv as DynamicViewParallelSteps, bz as DynamicViewRule, bu as DynamicViewStep, bx as DynamicViewStepOrParallel, O as Element, ar as ElementShape, aq as ElementShapes, _ as ElementSpecification, N as ElementStyle, aB as ElementThemeColorValues, aC as ElementThemeColors, bD as ElementViewExcludePredicate, bC as ElementViewIncludePredicate, bE as ElementViewPredicate, bI as ElementViewRule, bF as ElementViewRuleGroup, bH as ElementViewRuleStyle, a3 as EqualOperator, E as Expression, ai as Filterable, F as FqnExpr, c as FqnRef, g as GlobalDynamicPredicates, G as GlobalPredicateId, f as GlobalPredicates, h as GlobalStyleID, i as GlobalStyles, as as HexColor, a6 as KindEqual, bm as LayoutedDeploymentView, bn as LayoutedDynamicView, bl as LayoutedElementView, m as LayoutedLikeC4ModelData, aG as LayoutedView, n as LikeC4ModelData, x as LikeC4ModelDump, aF as LikeC4View, b as ModelExpression, M as ModelFqnExpr, j as ModelGlobals, Z as ModelRelation, a as ModelRelationExpr, bb as NodeNotation, ab as NotOperator, aj as OperatorPredicate, af as OrOperator, bt as ParsedDeploymentView, bA as ParsedDynamicView, bJ as ParsedElementView, k as ParsedLikeC4ModelData, aF as ParsedView, a8 as Participant, a9 as ParticipantOperator, d as Point, P as PredicateSelector, aJ as ProcessedView, e as RectBox, R as RelationExpr, Y as Relationship, aw as RelationshipArrowType, av as RelationshipLineType, a1 as RelationshipSpecification, aD as RelationshipThemeColorValues, aE as RelationshipThemeColors, an as ShapeSize, al as SpacingSize, w as SpecTypesFromDump, a2 as Specification, S as SpecificationDump, a4 as TagEqual, $ as TagSpecification, am as TextSize, ay as ThemeColor, ax as ThemeColors, b6 as ViewAutoLayout, b7 as ViewManualLayout, aL as ViewOnStage, aN as ViewRule, b4 as ViewRuleAutoLayout, b0 as ViewRuleGlobalPredicateRef, a_ as ViewRuleGlobalStyle, aO as ViewRulePredicate, b8 as ViewType, bd as ViewWithHash, bc as ViewWithNotation, aM as ViewWithType, ah as WhereOperator, X as XYPoint, bw as getParallelStepsPrefix, ae as isAndOperator, b3 as isAutoLayoutDirection, aR as isComputedView, t as isDeployedInstance, s as isDeploymentNode, aV as isDeploymentView, aH as isDiagramView, aW as isDynamicView, bB as isDynamicViewParallelSteps, aS as isElementView, aU as isExtendsElementView, a7 as isKindEqual, aH as isLayoutedView, ac as isNotOperator, ag as isOrOperator, aa as isParticipantOperator, aT as isScopedElementView, a0 as isTagColorSpecified, a5 as isTagEqual, aA as isThemeColor, b5 as isViewRuleAutoLayout, b1 as isViewRuleGlobalPredicateRef, a$ as isViewRuleGlobalStyle, bG as isViewRuleGroup, aP as isViewRulePredicate, aQ as isViewRuleStyle, ak as whereOperatorAsPredicate } from './shared/core.DXzRBkuI.mjs';
3
- export { BiMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, commonHead, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equalsSet, getOrCreate, hasAtLeast, ifilter, ifind, iflat, ihead, imap, intersection, invariant, ireduce, isIterable, isNonEmptyArray, isString, isome, iunique, memoizeProp, nonNullable, nonexhaustive, objectHash, stringHash, symmetricDifference, toArray, toSet, union } from './utils/index.mjs';
1
+ export { ElementColors, RelationshipColors, computeColorValues, defaultTheme } from './theme/index.mjs';
2
+ export { BiMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, commonHead, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equalsSet, getOrCreate, hasAtLeast, intersection, invariant, isNonEmptyArray, isString, markdownToHtml, markdownToText, memoizeProp, nonNullable, nonexhaustive, objectHash, promiseNextTick, stringHash, symmetricDifference, union } from './utils/index.mjs';
4
3
  export { D as DefaultMap } from './shared/core.CywrQs86.mjs';
5
- export { A as Any, A as AnyAux, b as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, c as UnknownComputed, d as UnknownLayouted, e as UnknownParsed, _ as _stage, f as _type, a as aux, i as isOnStage } from './shared/core.BaYE_r29.mjs';
6
- export { A as AnyFqn, B as BuiltInIcon, C as Coalesce, D as DeploymentFqn, b as DeploymentKind, E as EdgeId, a as ElementKind, f as ExclusiveUnion, F as Fqn, m as GlobalFqn, G as GroupElementKind, i as Icon, j as IconUrl, I as IteratorLike, K as KeysOf, L as Link, g as NTuple, N as NodeId, d as NonEmptyArray, e as NonEmptyReadonlyArray, h as Predicate, P as ProjectId, R as RelationId, l as RelationKind, c as RelationshipKind, p as StepEdgeId, S as StepEdgeIdLiteral, r as StepEdgeKind, T as Tag, V as ViewId, u as extractStep, n as isGlobalFqn, k as isGroupElementKind, t as isStepEdgeId, s as scalar, o as splitGlobalFqn, q as stepEdgeId } from './shared/core.BuO4ncfY.mjs';
4
+ export { A as Any, A as AnyAux, b as Aux, E as ExtractOnStage, M as ModelStage, S as SpecAux, U as Unknown, c as UnknownComputed, d as UnknownLayouted, e as UnknownParsed, _ as _stage, f as _type, a as aux, i as isOnStage } from './shared/core.De___iBS.mjs';
5
+ 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, s as scalar, h as splitGlobalFqn, l as stepEdgeId } from './shared/core.668kXpZq.mjs';
6
+ export { W as AbstractRelationship, ad as AndOperator, aE as AnyExcludePredicate, aD as AnyIncludePredicate, aq as AnyView, aF as AnyViewRuleStyle, aK as AutoLayoutDirection, z as AuxFromDump, A as AuxFromLikeC4ModelData, B as BBox, aS as BaseParsedViewProperties, aR as BaseViewProperties, aZ as ComputedDeploymentView, a_ as ComputedDynamicView, aX as ComputedEdge, aY as ComputedElementView, C as ComputedLikeC4ModelData, aW as ComputedNode, ao as ComputedView, U as DefaultArrowType, I as DefaultElementShape, T as DefaultLineStyle, K as DefaultPaddingSize, V as DefaultRelationshipColor, J as DefaultShapeSize, N as DefaultTextSize, H as DefaultThemeColor, q as DeployedInstance, r as DeploymentElement, s as DeploymentElementRef, D as DeploymentElementStyle, p as DeploymentNode, w as DeploymentRelation, v as DeploymentRelationship, b5 as DeploymentViewExcludePredicate, b4 as DeploymentViewIncludePredicate, b6 as DeploymentViewPredicate, b8 as DeploymentViewRule, b7 as DeploymentViewRuleStyle, b0 as DiagramEdge, a$ as DiagramNode, am as DiagramView, be as DynamicViewIncludeRule, bb as DynamicViewParallelSteps, bf as DynamicViewRule, ba as DynamicViewStep, bd as DynamicViewStepOrParallel, Q as Element, _ as ElementSpecification, O as ElementStyle, bj as ElementViewExcludePredicate, bi as ElementViewIncludePredicate, bk as ElementViewPredicate, bo as ElementViewRule, bl as ElementViewRuleGroup, bn as ElementViewRuleStyle, a3 as EqualOperator, E as Expression, ai as Filterable, F as FqnExpr, f as FqnRef, j as GlobalDynamicPredicates, G as GlobalPredicateId, i as GlobalPredicates, k as GlobalStyleID, l as GlobalStyles, a6 as KindEqual, b2 as LayoutedDeploymentView, b3 as LayoutedDynamicView, b1 as LayoutedElementView, L as LayoutedLikeC4ModelData, am as LayoutedView, o as LikeC4ModelData, y as LikeC4ModelDump, al as LikeC4View, e as ModelExpression, M as ModelFqnExpr, m as ModelGlobals, Z as ModelRelation, d as ModelRelationExpr, aT as NodeNotation, ab as NotOperator, aj as OperatorPredicate, af as OrOperator, b9 as ParsedDeploymentView, bg as ParsedDynamicView, bp as ParsedElementView, n as ParsedLikeC4ModelData, al as ParsedView, a8 as Participant, a9 as ParticipantOperator, g as Point, P as PredicateSelector, ap as ProcessedView, h as RectBox, c as RelationExpr, Y as Relationship, a1 as RelationshipSpecification, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty, x as SpecTypesFromDump, a2 as Specification, S as SpecificationDump, a4 as TagEqual, $ as TagSpecification, aO as ViewAutoLayout, aP as ViewManualLayout, ar as ViewOnStage, at as ViewRule, aM as ViewRuleAutoLayout, aI as ViewRuleGlobalPredicateRef, aG as ViewRuleGlobalStyle, au as ViewRulePredicate, aQ as ViewType, aV as ViewWithHash, aU as ViewWithNotation, as as ViewWithType, ah as WhereOperator, X as XYPoint, bc as getParallelStepsPrefix, ae as isAndOperator, aL as isAutoLayoutDirection, ax as isComputedView, u as isDeployedInstance, t as isDeploymentNode, aB as isDeploymentView, an as isDiagramView, aC as isDynamicView, bh as isDynamicViewParallelSteps, ay as isElementView, aA as isExtendsElementView, a7 as isKindEqual, an as isLayoutedView, ac as isNotOperator, ag as isOrOperator, aa as isParticipantOperator, az as isScopedElementView, a0 as isTagColorSpecified, a5 as isTagEqual, aN as isViewRuleAutoLayout, aJ as isViewRuleGlobalPredicateRef, aH as isViewRuleGlobalStyle, bm as isViewRuleGroup, av as isViewRulePredicate, aw as isViewRuleStyle, ak as whereOperatorAsPredicate } from './shared/core.1pNeDdRk.mjs';
7
+ export { C as Coalesce, E as ExclusiveUnion, I as IteratorLike, K as KeysOf, L as Link, b as NTuple, N as NonEmptyArray, a as NonEmptyReadonlyArray, P as Predicate } from './shared/core.DuSLYTG6.mjs';
8
+ export { b as BorderStyle, B as BorderStyles, i as Color, C as ColorLiteral, d as CustomColor, e as CustomColorDefinitions, c as ElementShape, 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, h as ThemeColor, n as ThemeColorValues, g as ThemeColors, j as isThemeColor } from './shared/core.CzdwsPmY.mjs';
7
9
  export { ViewChange } from './types/index.mjs';
8
- 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.Pf5I9o0e.mjs';
10
+ 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';
11
+ export { ifilter, ifind, iflat, ihead, imap, ireduce, isIterable, isome, iunique, toArray, toSet } from './utils/iterable/index.mjs';
9
12
  import 'type-fest';
10
-
11
- declare const ElementColors: {
12
- readonly primary: {
13
- fill: "#3b82f6";
14
- stroke: "#2563eb";
15
- hiContrast: "#eff6ff";
16
- loContrast: "#bfdbfe";
17
- };
18
- readonly blue: {
19
- fill: "#3b82f6";
20
- stroke: "#2563eb";
21
- hiContrast: "#eff6ff";
22
- loContrast: "#bfdbfe";
23
- };
24
- readonly secondary: {
25
- fill: "#0284c7";
26
- stroke: "#0369a1";
27
- hiContrast: "#f0f9ff";
28
- loContrast: "#B6ECF7";
29
- };
30
- readonly sky: {
31
- fill: "#0284c7";
32
- stroke: "#0369a1";
33
- hiContrast: "#f0f9ff";
34
- loContrast: "#B6ECF7";
35
- };
36
- readonly muted: {
37
- fill: "#64748b";
38
- stroke: "#475569";
39
- hiContrast: "#f8fafc";
40
- loContrast: "#cbd5e1";
41
- };
42
- readonly slate: {
43
- fill: "#64748b";
44
- stroke: "#475569";
45
- hiContrast: "#f8fafc";
46
- loContrast: "#cbd5e1";
47
- };
48
- readonly gray: {
49
- readonly fill: "#737373";
50
- readonly stroke: "#525252";
51
- readonly hiContrast: "#fafafa";
52
- readonly loContrast: "#d4d4d4";
53
- };
54
- readonly red: {
55
- readonly fill: "#AC4D39";
56
- readonly stroke: "#853A2D";
57
- readonly hiContrast: "#FBD3CB";
58
- readonly loContrast: "#f5b2a3";
59
- };
60
- readonly green: {
61
- readonly fill: "#428a4f";
62
- readonly stroke: "#2d5d39";
63
- readonly hiContrast: "#f8fafc";
64
- readonly loContrast: "#c2f0c2";
65
- };
66
- readonly amber: {
67
- readonly fill: "#A35829";
68
- readonly stroke: "#7E451D";
69
- readonly hiContrast: "#FFE0C2";
70
- readonly loContrast: "#f9b27c";
71
- };
72
- readonly indigo: {
73
- readonly fill: "#6366f1";
74
- readonly stroke: "#4f46e5";
75
- readonly hiContrast: "#eef2ff";
76
- readonly loContrast: "#c7d2fe";
77
- };
78
- };
79
-
80
- declare const RelationshipColors: {
81
- amber: {
82
- lineColor: "#b45309";
83
- labelBgColor: "#78350f";
84
- labelColor: "#FFE0C2";
85
- };
86
- blue: {
87
- lineColor: "#3b82f6";
88
- labelBgColor: "#172554";
89
- labelColor: "#60a5fa";
90
- };
91
- gray: {
92
- lineColor: "#6E6E6E";
93
- labelBgColor: "#18191b";
94
- labelColor: "#C6C6C6";
95
- };
96
- green: {
97
- lineColor: "#15803d";
98
- labelBgColor: "#052e16";
99
- labelColor: "#22c55e";
100
- };
101
- indigo: {
102
- lineColor: "#6366f1";
103
- labelBgColor: "#1e1b4b";
104
- labelColor: "#818cf8";
105
- };
106
- muted: {
107
- lineColor: "#64748b";
108
- labelBgColor: "#0f172a";
109
- labelColor: "#cbd5e1";
110
- };
111
- primary: {
112
- lineColor: "#3b82f6";
113
- labelBgColor: "#172554";
114
- labelColor: "#60a5fa";
115
- };
116
- red: {
117
- lineColor: "#AC4D39";
118
- labelBgColor: "#b91c1c";
119
- labelColor: "#f5b2a3";
120
- };
121
- secondary: {
122
- lineColor: "#0ea5e9";
123
- labelBgColor: "#082f49";
124
- labelColor: "#38bdf8";
125
- };
126
- sky: {
127
- lineColor: "#0ea5e9";
128
- labelBgColor: "#082f49";
129
- labelColor: "#38bdf8";
130
- };
131
- slate: {
132
- lineColor: "#64748b";
133
- labelBgColor: "#0f172a";
134
- labelColor: "#cbd5e1";
135
- };
136
- };
137
-
138
- declare const defaultTheme: LikeC4Theme;
139
- declare function computeColorValues(color: ColorLiteral): ThemeColorValues;
140
-
141
- export { ColorLiteral, ElementColors, LikeC4Theme, RelationshipColors, ThemeColorValues, computeColorValues, defaultTheme };