@likec4/core 1.45.0 → 1.46.2

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 (64) hide show
  1. package/dist/builder/index.d.mts +8 -7
  2. package/dist/builder/index.mjs +8 -7
  3. package/dist/compute-view/index.d.mts +8 -7
  4. package/dist/compute-view/index.mjs +5 -5
  5. package/dist/compute-view/relationships-view/index.d.mts +8 -7
  6. package/dist/geometry/index.d.mts +109 -0
  7. package/dist/geometry/index.mjs +328 -0
  8. package/dist/index.d.mts +10 -8
  9. package/dist/index.mjs +9 -8
  10. package/dist/model/connection/deployment/index.d.mts +10 -9
  11. package/dist/model/connection/deployment/index.mjs +2 -2
  12. package/dist/model/connection/index.d.mts +11 -10
  13. package/dist/model/connection/index.mjs +3 -3
  14. package/dist/model/connection/model/index.d.mts +10 -9
  15. package/dist/model/connection/model/index.mjs +2 -2
  16. package/dist/model/index.d.mts +12 -11
  17. package/dist/model/index.mjs +4 -4
  18. package/dist/shared/{core.DnCLhN8C.d.mts → core.5gPDaaG5.d.mts} +5 -4
  19. package/dist/shared/{core.CQPEY2wQ.mjs → core.78IWAHAE.mjs} +1 -1
  20. package/dist/shared/{core.0zAQeenX.d.mts → core.9U0HL3oG.d.mts} +2 -2
  21. package/dist/shared/{core.DqlrMlsf.mjs → core.BFd1lU9R.mjs} +1 -1
  22. package/dist/shared/core.BPGOjone.d.mts +46 -0
  23. package/dist/shared/{core.DIE3F6sw.mjs → core.BYdtmqY5.mjs} +1 -2
  24. package/dist/shared/{core.B73yxfPi.d.mts → core.BkSYCfRg.d.mts} +1 -1
  25. package/dist/shared/{core.5ZQ-r3Oa.d.mts → core.BqtAzeAh.d.mts} +1 -1
  26. package/dist/shared/{core.DEieYfbG.mjs → core.BspBF3SJ.mjs} +22 -70
  27. package/dist/shared/{core.CR3PmPzr.mjs → core.CBLX4mT8.mjs} +3811 -15032
  28. package/dist/shared/{core.DX-WYEPA.d.mts → core.CDdf8izT.d.mts} +4 -2
  29. package/dist/shared/core.CLSZtnFh.mjs +69 -0
  30. package/dist/shared/{core.D_f4F48-.mjs → core.CRhT4Iio.mjs} +10 -7
  31. package/dist/shared/{core.DrUt0Lbi.mjs → core.CmGY9blO.mjs} +198 -291
  32. package/dist/shared/{core.C_Ni6yHl.mjs → core.D0WZutNd.mjs} +3 -1
  33. package/dist/shared/{core.mUnpvHtA.d.mts → core.DE-g9oFF.d.mts} +19 -49
  34. package/dist/shared/{core.M9ayqQZa.mjs → core.DEK-BO3_.mjs} +4 -5
  35. package/dist/shared/{core.CpURdWRM.d.mts → core.DK3pdsTf.d.mts} +8 -6
  36. package/dist/shared/{core.vzLtp8i3.mjs → core.DSalPD6v.mjs} +259 -189
  37. package/dist/shared/{core.CRI1AjFj.mjs → core.DVfPJPJj.mjs} +33 -30
  38. package/dist/shared/{core.Cog93roC.d.mts → core.DezoCAzf.d.mts} +3 -3
  39. package/dist/shared/{core.BGFjN3nv.d.mts → core.I8sCl3WM.d.mts} +3 -3
  40. package/dist/shared/{core.t3qfsVvn.d.mts → core.e5GJ61_a.d.mts} +3 -3
  41. package/dist/shared/{core.BuQZczj6.mjs → core.om36dXXW.mjs} +5 -2
  42. package/dist/shared/{core.Dvh1H0T2.d.mts → core.or6-EHsb.d.mts} +2 -2
  43. package/dist/shared/{core.DViDmiAu.mjs → core.xeuDd__E.mjs} +1 -2
  44. package/dist/shared/{core.CWwSgOzF.mjs → core.xgoPk2RG.mjs} +165 -135
  45. package/dist/styles/index.d.mts +7 -6
  46. package/dist/styles/index.mjs +1 -1
  47. package/dist/types/_aux.d.mts +2 -2
  48. package/dist/types/expression-model.d.mts +3 -3
  49. package/dist/types/expression.d.mts +3 -3
  50. package/dist/types/fqnRef.d.mts +2 -2
  51. package/dist/types/fqnRef.mjs +1 -1
  52. package/dist/types/index.d.mts +11 -9
  53. package/dist/types/index.mjs +6 -180
  54. package/dist/types/scalar.d.mts +1 -1
  55. package/dist/types/scalar.mjs +1 -1
  56. package/dist/utils/graphology/index.mjs +1 -1
  57. package/dist/utils/index.d.mts +3 -3
  58. package/dist/utils/index.mjs +5 -5
  59. package/dist/utils/iterable/index.d.mts +17 -1
  60. package/dist/utils/iterable/index.mjs +17 -1
  61. package/geometry/package.json +4 -0
  62. package/package.json +20 -12
  63. package/dist/shared/core.BR4zXDH-.mjs +0 -13
  64. package/dist/shared/core.BdPcbSkN.mjs +0 -118
@@ -1,19 +1,19 @@
1
- import { t as t$3, e as e$2, a as DeploymentNodeModel, b as DeployedInstanceModel, c as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.D_f4F48-.mjs';
2
- import { e as e$1 } from './core.BKlholso.mjs';
1
+ import { t as t$3, e as e$3, a as DeploymentNodeModel, b as DeployedInstanceModel, c as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.CRhT4Iio.mjs';
2
+ import { e as e$2 } from './core.BKlholso.mjs';
3
3
  import { n as n$1 } from './core.BhNcrwzK.mjs';
4
- import { c as splitGlobalFqn, g as extractStep, e as isStepEdgeId, i as isGroupElementKind, b as isGlobalFqn, a as GlobalFqn } from './core.C_Ni6yHl.mjs';
4
+ import { c as splitGlobalFqn, h as extractStep, g as isStepEdgeId, i as isGroupElementKind, b as isGlobalFqn, a as GlobalFqn } from './core.D0WZutNd.mjs';
5
5
  import { m as hierarchyLevel, n as nameFromFqn, i as isAncestor, g as commonAncestor, s as sortNaturalByFqn, f as sortParentsFirst, p as parentFqn, a as ancestorsFqn } from './core.CdNCAwq7.mjs';
6
- import { m as memoizeProp } from './core.BR4zXDH-.mjs';
7
- import { R as RichText, e as exact } from './core.M9ayqQZa.mjs';
6
+ import { m as memoizeProp } from './core.CLSZtnFh.mjs';
7
+ import { R as RichText, e as exact } from './core.DEK-BO3_.mjs';
8
8
  import { preferSummary, preferDescription } from '../types/_aux.mjs';
9
9
  import { i as ihead } from './core.uFk_o9X6.mjs';
10
10
  import { t as t$6, b as compareNaturalHierarchically, c as compareNatural } from './core.3ZhnKAlZ.mjs';
11
11
  import { t as t$2, a as t$4 } from './core.BsSXS-_R.mjs';
12
- import { t as t$5, e as e$3 } from './core.Coi_LOUZ.mjs';
12
+ import { t as t$5, e as e$4 } from './core.Coi_LOUZ.mjs';
13
13
  import { t as t$8 } from './core.CbT8JVYL.mjs';
14
14
  import { t as t$7 } from './core.BkVA6gjl.mjs';
15
- import { c as calcDriftsFromSnapshot, a as applyManualLayout, h as t$9 } from './core.vzLtp8i3.mjs';
16
- import { L as LikeC4Styles } from './core.DEieYfbG.mjs';
15
+ import { c as calcDriftsFromSnapshot, a as applyManualLayout, h as t$9 } from './core.DSalPD6v.mjs';
16
+ import { L as LikeC4Styles } from './core.BspBF3SJ.mjs';
17
17
  import { g as getOrCreate } from './core.DcS-0zys.mjs';
18
18
  import { D as DefaultMap } from './core.BbE4y-yl.mjs';
19
19
  import { i as invariant, a as nonNullable } from './core.D4npX2q8.mjs';
@@ -21,8 +21,10 @@ import { FqnRef } from '../types/fqnRef.mjs';
21
21
  import { c as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as whereOperatorAsPredicate } from './core.DH7TXqXf.mjs';
22
22
  import { i as ifind } from './core.CmPXpJ8l.mjs';
23
23
  import { i as ifilter } from './core.DRJma0Ol.mjs';
24
- import './core.DqlrMlsf.mjs';
25
- import './core.CQPEY2wQ.mjs';
24
+ import './core.BFd1lU9R.mjs';
25
+ import './core.78IWAHAE.mjs';
26
+
27
+ function e$1(e){if(e==null||e===``)return true;if(typeof e!=`object`)return false;if(`length`in e&&typeof e.length==`number`)return e.length===0;if(`size`in e&&typeof e.size==`number`)return e.size===0;for(let t in e)return false;return Object.getOwnPropertySymbols(e).length===0}
26
28
 
27
29
  function t$1(...t){return t$2(n,t)}const n=e=>e.at(-1);
28
30
 
@@ -79,7 +81,7 @@ class ElementModel {
79
81
  * It includes tags from the element and its kind.
80
82
  */
81
83
  get tags() {
82
- return memoizeProp(this, Symbol.for("tags"), () => {
84
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("tags"), () => {
83
85
  return n$1([
84
86
  ...this.$element.tags ?? [],
85
87
  ...this.$model.specification.elements[this.$element.kind]?.tags ?? []
@@ -117,7 +119,7 @@ class ElementModel {
117
119
  return this.$element.links ?? [];
118
120
  }
119
121
  get defaultView() {
120
- return memoizeProp(this, Symbol.for("defaultView"), () => ihead(this.scopedViews()) ?? null);
122
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("defaultView"), () => ihead(this.scopedViews()) ?? null);
121
123
  }
122
124
  get isRoot() {
123
125
  return this.parent === null;
@@ -224,16 +226,16 @@ class ElementModel {
224
226
  return;
225
227
  }
226
228
  get allOutgoing() {
227
- return memoizeProp(this, Symbol.for("allOutgoing"), () => new Set(this.outgoing()));
229
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("allOutgoing"), () => new Set(this.outgoing()));
228
230
  }
229
231
  get allIncoming() {
230
- return memoizeProp(this, Symbol.for("allIncoming"), () => new Set(this.incoming()));
232
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("allIncoming"), () => new Set(this.incoming()));
231
233
  }
232
234
  /**
233
235
  * Iterate over all views that include this element.
234
236
  */
235
237
  views() {
236
- return memoizeProp(this, Symbol.for("views"), () => {
238
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("views"), () => {
237
239
  const views = /* @__PURE__ */ new Set();
238
240
  for (const view of this.$model.views()) {
239
241
  if (view.includesElement(this.id)) {
@@ -248,7 +250,7 @@ class ElementModel {
248
250
  * It is possible that element is not included in the view.
249
251
  */
250
252
  scopedViews() {
251
- return memoizeProp(this, Symbol.for("scopedViews"), () => {
253
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("scopedViews"), () => {
252
254
  const views = /* @__PURE__ */ new Set();
253
255
  for (const vm of this.$model.views()) {
254
256
  if (vm.isScopedElementView() && vm.viewOf.id === this.id) {
@@ -262,13 +264,13 @@ class ElementModel {
262
264
  * @returns true if the element is deployed
263
265
  */
264
266
  isDeployed() {
265
- return e$1(ihead(this.deployments()));
267
+ return e$2(ihead(this.deployments()));
266
268
  }
267
269
  deployments() {
268
270
  return this.$model.deployment.instancesOf(this);
269
271
  }
270
272
  hasMetadata() {
271
- return !!this.$element.metadata && !e$2(this.$element.metadata);
273
+ return !!this.$element.metadata && !e$3(this.$element.metadata);
272
274
  }
273
275
  getMetadata(field) {
274
276
  if (field) {
@@ -467,7 +469,8 @@ class LikeC4DeploymentModel {
467
469
  * Returns a specific relationship by its ID.
468
470
  */
469
471
  relationship(id) {
470
- return nonNullable(this.#relations.get(getId(id)), `DeploymentRelationModel ${id} not found`);
472
+ const relationId = getId(id);
473
+ return nonNullable(this.#relations.get(relationId), `DeploymentRelationModel ${relationId} not found`);
471
474
  }
472
475
  findRelationship(id) {
473
476
  return this.#relations.get(id) ?? null;
@@ -647,13 +650,13 @@ class RelationshipModel {
647
650
  return `${this.source.id} -> ${this.target.id}`;
648
651
  }
649
652
  get title() {
650
- if (!e$1(this.$relationship.title)) {
653
+ if (!e$2(this.$relationship.title)) {
651
654
  return null;
652
655
  }
653
656
  return this.$relationship.title;
654
657
  }
655
658
  get technology() {
656
- if (!e$1(this.$relationship.technology)) {
659
+ if (!e$2(this.$relationship.technology)) {
657
660
  return null;
658
661
  }
659
662
  return this.$relationship.technology;
@@ -721,7 +724,7 @@ class RelationshipModel {
721
724
  return true;
722
725
  }
723
726
  hasMetadata() {
724
- return !!this.$relationship.metadata && !e$2(this.$relationship.metadata);
727
+ return !!this.$relationship.metadata && !e$3(this.$relationship.metadata);
725
728
  }
726
729
  getMetadata(field) {
727
730
  if (field) {
@@ -967,13 +970,13 @@ class NodeModel {
967
970
  * Check if this node references to logical model element.
968
971
  */
969
972
  hasElement() {
970
- return e$1(this.$node.modelRef);
973
+ return e$2(this.$node.modelRef);
971
974
  }
972
975
  /**
973
976
  * Check if this node references to deployment element (Node or Instance).
974
977
  */
975
978
  hasDeployment() {
976
- return e$1(this.$node.deploymentRef);
979
+ return e$2(this.$node.deploymentRef);
977
980
  }
978
981
  /**
979
982
  * Check if this node references to deployed instance
@@ -1331,7 +1334,7 @@ class LikeC4ViewModel {
1331
1334
  return this.#view[_type] === "element";
1332
1335
  }
1333
1336
  isScopedElementView() {
1334
- return this.#view[_type] === "element" && e$1(this.#view.viewOf);
1337
+ return this.#view[_type] === "element" && e$2(this.#view.viewOf);
1335
1338
  }
1336
1339
  isDeploymentView() {
1337
1340
  return this.#view[_type] === "deployment";
@@ -1428,7 +1431,7 @@ class LikeC4ViewsFolder {
1428
1431
  */
1429
1432
  get parent() {
1430
1433
  invariant(!this.isRoot, "Root view folder has no parent");
1431
- if (e$2(this.parentPath)) {
1434
+ if (e$1(this.parentPath)) {
1432
1435
  return null;
1433
1436
  }
1434
1437
  return this.$model.viewFolder(this.parentPath);
@@ -1601,7 +1604,7 @@ class LikeC4Model {
1601
1604
  }
1602
1605
  e(folderPath, VIEW_FOLDERS_SEPARATOR).reduce((segments, segment) => {
1603
1606
  const parent = segments.join(VIEW_FOLDERS_SEPARATOR);
1604
- const path = e$2(parent) ? segment : parent + VIEW_FOLDERS_SEPARATOR + segment;
1607
+ const path = e$3(parent) ? segment : parent + VIEW_FOLDERS_SEPARATOR + segment;
1605
1608
  const folder = getOrCreateFolder(path);
1606
1609
  this._viewFolderItems.get(parent).add(folder);
1607
1610
  segments.push(segment);
@@ -1704,7 +1707,7 @@ class LikeC4Model {
1704
1707
  * If the project is not defined in the model, it returns a default project with the ID "default".
1705
1708
  */
1706
1709
  get project() {
1707
- return this.$data.project ?? memoizeProp(this, Symbol.for("project"), () => ({
1710
+ return this.$data.project ?? memoizeProp(this, /* @__PURE__ */ Symbol.for("project"), () => ({
1708
1711
  id: this.projectId
1709
1712
  }));
1710
1713
  }
@@ -1712,7 +1715,7 @@ class LikeC4Model {
1712
1715
  return this.$data.specification;
1713
1716
  }
1714
1717
  get globals() {
1715
- return memoizeProp(this, Symbol.for("globals"), () => ({
1718
+ return memoizeProp(this, /* @__PURE__ */ Symbol.for("globals"), () => ({
1716
1719
  predicates: {
1717
1720
  ...this.$data.globals?.predicates
1718
1721
  },
@@ -1978,7 +1981,7 @@ class LikeC4Model {
1978
1981
  })),
1979
1982
  t$7((a, b) => compareNatural(a.tag, b.tag)),
1980
1983
  t$9(
1981
- [e$3("count"), "desc"]
1984
+ [e$4("count"), "desc"]
1982
1985
  )
1983
1986
  ));
1984
1987
  }
@@ -1,6 +1,6 @@
1
- import { E as ElementModel, e as DeploymentElementModel } from './core.CpURdWRM.mjs';
2
- import { A as Any } from './core.B73yxfPi.mjs';
3
- import { F as Fqn } from './core.DX-WYEPA.mjs';
1
+ import { E as ElementModel, e as DeploymentElementModel } from './core.DK3pdsTf.mjs';
2
+ import { A as Any } from './core.BkSYCfRg.mjs';
3
+ import { F as Fqn } from './core.CDdf8izT.mjs';
4
4
 
5
5
  interface Connection<Elem = ElementModel<Any> | DeploymentElementModel<Any>, Id = string> {
6
6
  readonly id: Id;
@@ -1,6 +1,6 @@
1
- import { C as Connection, c as customInspectSymbol } from './core.Cog93roC.mjs';
2
- import { E as ElementModel, R as RelationshipModel } from './core.CpURdWRM.mjs';
3
- import { A as Any, U as Unknown, z as EdgeId } from './core.B73yxfPi.mjs';
1
+ import { C as Connection, c as customInspectSymbol } from './core.DezoCAzf.mjs';
2
+ import { E as ElementModel, R as RelationshipModel } from './core.DK3pdsTf.mjs';
3
+ import { A as Any, U as Unknown, z as EdgeId } from './core.BkSYCfRg.mjs';
4
4
 
5
5
  /**
6
6
  * Connection refers to any relationships between two elements,
@@ -1,6 +1,6 @@
1
- import { C as Connection, c as customInspectSymbol } from './core.Cog93roC.mjs';
2
- import { e as DeploymentElementModel, h as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.CpURdWRM.mjs';
3
- import { A as Any, z as EdgeId } from './core.B73yxfPi.mjs';
1
+ import { C as Connection, c as customInspectSymbol } from './core.DezoCAzf.mjs';
2
+ import { e as DeploymentElementModel, h as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.DK3pdsTf.mjs';
3
+ import { A as Any, z as EdgeId } from './core.BkSYCfRg.mjs';
4
4
  import { c as IteratorLike } from './core.DB0Ue5Wx.mjs';
5
5
 
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { e as isStepEdgeId } from './core.C_Ni6yHl.mjs';
1
+ import { g as isStepEdgeId } from './core.D0WZutNd.mjs';
2
2
 
3
3
  function e(e){return Array.isArray(e)}
4
4
 
@@ -34,5 +34,8 @@ function isDynamicStepsSeries(step) {
34
34
  function isViewRuleGroup(rule) {
35
35
  return "title" in rule && "groupRules" in rule && Array.isArray(rule.groupRules);
36
36
  }
37
+ function isViewRuleRank(rule) {
38
+ return "rank" in rule && Array.isArray(rule.targets);
39
+ }
37
40
 
38
- export { isViewRuleGlobalPredicateRef as a, isAutoLayoutDirection as b, isViewRuleAutoLayout as c, isDynamicStep as d, isDynamicStepsParallel as e, isDynamicStepsSeries as f, getParallelStepsPrefix as g, isViewRuleGroup as h, isViewRuleGlobalStyle as i, e as j };
41
+ export { isViewRuleGlobalPredicateRef as a, isAutoLayoutDirection as b, isViewRuleAutoLayout as c, isDynamicStep as d, isDynamicStepsParallel as e, isDynamicStepsSeries as f, getParallelStepsPrefix as g, isViewRuleGroup as h, isViewRuleGlobalStyle as i, isViewRuleRank as j, e as k };
@@ -1,6 +1,6 @@
1
- import { L as LikeC4StylesConfig, a as LikeC4Theme, b as LikeC4StyleDefaults, E as ElementColorValues, R as RelationshipColorValues, T as ThemeColor, c as ThemeColorValues, d as TextSize, S as SpacingSize, e as ShapeSize } from './core.0zAQeenX.mjs';
1
+ import { L as LikeC4StylesConfig, a as LikeC4Theme, b as LikeC4StyleDefaults, E as ElementColorValues, R as RelationshipColorValues, T as ThemeColor, c as ThemeColorValues, d as TextSize, S as SpacingSize, e as ShapeSize } from './core.9U0HL3oG.mjs';
2
2
  import { LiteralUnion } from 'type-fest';
3
- import { L as LikeC4ProjectStylesConfig, C as ComputedNodeStyle } from './core.mUnpvHtA.mjs';
3
+ import { L as LikeC4ProjectStylesConfig, C as ComputedNodeStyle } from './core.DE-g9oFF.mjs';
4
4
 
5
5
  /**
6
6
  * Styles of a LikeC4 project
@@ -1,6 +1,5 @@
1
1
  import { g as getDefaultExportFromCjs } from './core.B85MJLTf.mjs';
2
- import { r as requireIterator } from './core.BdPcbSkN.mjs';
3
- import { r as requireForeach } from './core.CR3PmPzr.mjs';
2
+ import { b as requireIterator, r as requireForeach } from './core.CBLX4mT8.mjs';
4
3
  import { t as t$3 } from './core.3ZhnKAlZ.mjs';
5
4
  import { t as t$4 } from './core.CbT8JVYL.mjs';
6
5
  import { t as t$2 } from './core.BsSXS-_R.mjs';