@likec4/core 1.9.0 → 1.10.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.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types_index = require('./shared/core.DcPLm41i.cjs');
3
+ const types_index = require('./shared/core.Db3ntVII.cjs');
4
4
 
5
5
  const limit = (x, low = 0, high = 1) => {
6
6
  return min$3(max$3(low, x), high);
@@ -3563,6 +3563,81 @@ function t(r){return typeof r=="string"}
3563
3563
 
3564
3564
  function n(e){return !!e}
3565
3565
 
3566
+ function getDefaultExportFromCjs (x) {
3567
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3568
+ }
3569
+
3570
+ var naturalCompareLite = {exports: {}};
3571
+
3572
+ /*
3573
+ * @version 1.4.0
3574
+ * @date 2015-10-26
3575
+ * @stability 3 - Stable
3576
+ * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
3577
+ * @license MIT License
3578
+ */
3579
+
3580
+
3581
+ var naturalCompare = function(a, b) {
3582
+ var i, codeA
3583
+ , codeB = 1
3584
+ , posA = 0
3585
+ , posB = 0
3586
+ , alphabet = String.alphabet;
3587
+
3588
+ function getCode(str, pos, code) {
3589
+ if (code) {
3590
+ for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i;
3591
+ return +str.slice(pos - 1, i)
3592
+ }
3593
+ code = alphabet && alphabet.indexOf(str.charAt(pos));
3594
+ return code > -1 ? code + 76 : ((code = str.charCodeAt(pos) || 0), code < 45 || code > 127) ? code
3595
+ : code < 46 ? 65 // -
3596
+ : code < 48 ? code - 1
3597
+ : code < 58 ? code + 18 // 0-9
3598
+ : code < 65 ? code - 11
3599
+ : code < 91 ? code + 11 // A-Z
3600
+ : code < 97 ? code - 37
3601
+ : code < 123 ? code + 5 // a-z
3602
+ : code - 63
3603
+ }
3604
+
3605
+
3606
+ if ((a+="") != (b+="")) for (;codeB;) {
3607
+ codeA = getCode(a, posA++);
3608
+ codeB = getCode(b, posB++);
3609
+
3610
+ if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
3611
+ codeA = getCode(a, posA, posA);
3612
+ codeB = getCode(b, posB, posA = i);
3613
+ posB = i;
3614
+ }
3615
+
3616
+ if (codeA != codeB) return (codeA < codeB) ? -1 : 1
3617
+ }
3618
+ return 0
3619
+ };
3620
+
3621
+ try {
3622
+ naturalCompareLite.exports = naturalCompare;
3623
+ } catch (e) {
3624
+ String.naturalCompare = naturalCompare;
3625
+ }
3626
+
3627
+ var naturalCompareLiteExports = naturalCompareLite.exports;
3628
+ const compare = /*@__PURE__*/getDefaultExportFromCjs(naturalCompareLiteExports);
3629
+
3630
+ function compareNatural(a, b) {
3631
+ if (a === b) return 0;
3632
+ if (t(a)) {
3633
+ if (t(b)) {
3634
+ return compare(a, b);
3635
+ }
3636
+ return 1;
3637
+ }
3638
+ return t(b) ? -1 : 0;
3639
+ }
3640
+
3566
3641
  function isString(value) {
3567
3642
  return value != null && typeof value === "string";
3568
3643
  }
@@ -3659,6 +3734,25 @@ function compareFqnHierarchically(a, b) {
3659
3734
  function compareByFqnHierarchically(a, b) {
3660
3735
  return compareFqnHierarchically(a.id, b.id);
3661
3736
  }
3737
+ function sortByFqnHierarchically(array) {
3738
+ return array.map((item) => ({ item, fqn: item.id.split(".") })).sort((a, b) => {
3739
+ return a.fqn.length - b.fqn.length;
3740
+ }).map(({ item }) => item);
3741
+ }
3742
+ function sortNaturalByFqn(array) {
3743
+ return array.map((item) => ({ item, fqn: item.id.split(".") })).sort((a, b) => {
3744
+ if (a.fqn.length !== b.fqn.length) {
3745
+ return a.fqn.length - b.fqn.length;
3746
+ }
3747
+ for (let i = 0; i < a.fqn.length; i++) {
3748
+ const compare = compareNatural(a.fqn[i], b.fqn[i]);
3749
+ if (compare !== 0) {
3750
+ return compare;
3751
+ }
3752
+ }
3753
+ return 0;
3754
+ }).map(({ item }) => item);
3755
+ }
3662
3756
 
3663
3757
  class LikeC4ViewModel {
3664
3758
  constructor(view, model) {
@@ -4284,14 +4378,14 @@ const compareRelations = (a, b) => {
4284
4378
  return -1;
4285
4379
  }
4286
4380
  const compareParents = parentA && parentB ? compareFqnHierarchically(parentA, parentB) : 0;
4287
- if (compareParents === 0) {
4288
- const compareSource = compareFqnHierarchically(a.source, b.source);
4289
- if (compareSource !== 0) {
4290
- return compareSource;
4291
- }
4292
- return compareFqnHierarchically(a.target, b.target);
4381
+ if (compareParents !== 0) {
4382
+ return compareParents;
4383
+ }
4384
+ const compareSource = compareFqnHierarchically(a.source, b.source);
4385
+ if (compareSource !== 0) {
4386
+ return compareSource;
4293
4387
  }
4294
- return compareParents;
4388
+ return compareFqnHierarchically(a.target, b.target);
4295
4389
  };
4296
4390
 
4297
4391
  exports.AsFqn = types_index.AsFqn;
@@ -4306,6 +4400,7 @@ exports.Expr = types_index.expression;
4306
4400
  exports.StepEdgeId = types_index.StepEdgeId;
4307
4401
  exports.extractStep = types_index.extractStep;
4308
4402
  exports.getBBoxCenter = types_index.getBBoxCenter;
4403
+ exports.getParallelStepsPrefix = types_index.getParallelStepsPrefix;
4309
4404
  exports.invariant = types_index.invariant;
4310
4405
  exports.isAndOperator = types_index.isAndOperator;
4311
4406
  exports.isComputedDynamicView = types_index.isComputedDynamicView;
@@ -4314,6 +4409,7 @@ exports.isCustomElement = types_index.isCustomElement;
4314
4409
  exports.isCustomRelationExpr = types_index.isCustomRelationExpr;
4315
4410
  exports.isDynamicView = types_index.isDynamicView;
4316
4411
  exports.isDynamicViewIncludeRule = types_index.isDynamicViewIncludeRule;
4412
+ exports.isDynamicViewParallelSteps = types_index.isDynamicViewParallelSteps;
4317
4413
  exports.isElement = types_index.isElement;
4318
4414
  exports.isElementKindExpr = types_index.isElementKindExpr;
4319
4415
  exports.isElementPredicateExpr = types_index.isElementPredicateExpr;
@@ -4352,6 +4448,7 @@ exports.ancestorsFqn = ancestorsFqn;
4352
4448
  exports.commonAncestor = commonAncestor;
4353
4449
  exports.compareByFqnHierarchically = compareByFqnHierarchically;
4354
4450
  exports.compareFqnHierarchically = compareFqnHierarchically;
4451
+ exports.compareNatural = compareNatural;
4355
4452
  exports.compareRelations = compareRelations;
4356
4453
  exports.computeColorValues = computeColorValues;
4357
4454
  exports.defaultTheme = defaultTheme;
@@ -4366,3 +4463,5 @@ exports.nameFromFqn = nameFromFqn;
4366
4463
  exports.notDescendantOf = notDescendantOf;
4367
4464
  exports.parentFqn = parentFqn;
4368
4465
  exports.parentFqnPredicate = parentFqnPredicate;
4466
+ exports.sortByFqnHierarchically = sortByFqnHierarchically;
4467
+ exports.sortNaturalByFqn = sortNaturalByFqn;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as Primitive, H as HexColorLiteral, T as ThemeColorValues, L as LiteralUnion, F as Fqn$1, R as RelationID$1, V as ViewID$1, E as EdgeId$1, C as ComputedView, a as Tag, b as ComputedNode, N as NodeId, c as ElementKind, d as ElementShape, e as Color, f as ComputedEdge, g as ComputedLikeC4Model, h as Element, i as Relation, j as RelationshipKind, k as NonEmptyArray } from './shared/core.9l7eW3pn.cjs';
2
- export { aq as AndOperator, A as AsFqn, aP as AutoLayoutDirection, bh as BBox, aU as BasicElementView, aT as BasicView, o as BorderStyle, B as BorderStyles, aE as ColorLiteral, be as ComputedDynamicView, bd as ComputedElementView, m as CustomColor, b1 as CustomColorDefinitions, G as CustomElementExpr, ad as CustomRelationExpr, aA as DefaultArrowType, q as DefaultElementShape, az as DefaultLineStyle, aB as DefaultRelationshipColor, D as DefaultThemeColor, bk as DiagramEdge, bj as DiagramNode, bl as DiagramView, b0 as DynamicView, aZ as DynamicViewIncludeRule, a$ as DynamicViewRule, aY as DynamicViewStep, U as ElementExpression, M as ElementKindExpr, v as ElementKindSpecification, u as ElementKindSpecificationStyle, bo as ElementNotation, $ as ElementPredicateExpression, w as ElementRefExpr, p as ElementShapes, r as ElementStyle, Q as ElementTagExpr, aG as ElementThemeColorValues, aH as ElementThemeColors, aX as ElementView, Z as ElementWhereExpr, aj as EqualOperator, y as ExpandedElementExpr, l as Expr, ah as Expression, aW as ExtendsElementView, I as IconUrl, a3 as InOutExpr, a5 as IncomingExpr, am as KindEqual, aK as LikeC4Theme, b2 as LikeC4View, t as Link, ao as NotOperator, as as OrOperator, a7 as OutgoingExpr, aw as OverviewGraph, ai as ParsedLikeC4Model, n as Point, a1 as RelationExpr, a9 as RelationExpression, af as RelationPredicateExpression, ab as RelationWhereExpr, ay as RelationshipArrowType, aC as RelationshipKindSpecification, ax as RelationshipLineType, aI as RelationshipThemeColorValues, aJ as RelationshipThemeColors, aV as ScopedElementView, b8 as StepEdgeId, b7 as StepEdgeIdLiteral, ak as TagEqual, s as TagSpec, aD as ThemeColor, bn as ViewChange, bm as ViewManualLayout, aS as ViewRule, aQ as ViewRuleAutoLayout, aL as ViewRulePredicate, aN as ViewRuleStyle, bb as ViewWithHash, bc as ViewWithNotation, au as WhereOperator, W as WildcardExpr, X as XYPoint, ba as extractStep, bi as getBBoxCenter, ar as isAndOperator, bf as isComputedDynamicView, bg as isComputedElementView, J as isCustomElement, ae as isCustomRelationExpr, b3 as isDynamicView, a_ as isDynamicViewIncludeRule, Y as isElement, O as isElementKindExpr, a0 as isElementPredicateExpr, x as isElementRef, S as isElementTagExpr, b4 as isElementView, _ as isElementWhere, z as isExpandedElementExpr, b5 as isExtendsElementView, a4 as isInOut, a6 as isIncoming, an as isKindEqual, ap as isNotOperator, at as isOrOperator, a8 as isOutgoing, a2 as isRelation, aa as isRelationExpression, ag as isRelationPredicateExpr, ac as isRelationWhere, b6 as isScopedElementView, b9 as isStepEdgeId, al as isTagEqual, aF as isThemeColor, aR as isViewRuleAutoLayout, aM as isViewRulePredicate, aO as isViewRuleStyle, K as isWildcard, av as whereOperatorAsPredicate } from './shared/core.9l7eW3pn.cjs';
1
+ import { P as Primitive, H as HexColorLiteral, T as ThemeColorValues, L as LiteralUnion, F as Fqn$1, R as RelationID$1, V as ViewID$1, E as EdgeId$1, C as ComputedView, a as Tag, b as ComputedNode, N as NodeId, c as ElementKind, d as ElementShape, e as Color, f as ComputedEdge, g as ComputedLikeC4Model, h as Element, i as Relation, j as RelationshipKind, k as NonEmptyArray } from './shared/core.CpR2fq5B.cjs';
2
+ export { aq as AndOperator, A as AsFqn, aP as AutoLayoutDirection, bl as BBox, aU as BasicElementView, aT as BasicView, o as BorderStyle, B as BorderStyles, aE as ColorLiteral, bi as ComputedDynamicView, bh as ComputedElementView, m as CustomColor, b4 as CustomColorDefinitions, G as CustomElementExpr, ad as CustomRelationExpr, aA as DefaultArrowType, q as DefaultElementShape, az as DefaultLineStyle, aB as DefaultRelationshipColor, D as DefaultThemeColor, bo as DiagramEdge, bn as DiagramNode, bp as DiagramView, b2 as DynamicView, a$ as DynamicViewIncludeRule, aZ as DynamicViewParallelSteps, b1 as DynamicViewRule, aY as DynamicViewStep, a_ as DynamicViewStepOrParallel, U as ElementExpression, M as ElementKindExpr, v as ElementKindSpecification, u as ElementKindSpecificationStyle, bs as ElementNotation, $ as ElementPredicateExpression, w as ElementRefExpr, p as ElementShapes, r as ElementStyle, Q as ElementTagExpr, aG as ElementThemeColorValues, aH as ElementThemeColors, aX as ElementView, Z as ElementWhereExpr, aj as EqualOperator, y as ExpandedElementExpr, l as Expr, ah as Expression, aW as ExtendsElementView, I as IconUrl, a3 as InOutExpr, a5 as IncomingExpr, am as KindEqual, aK as LikeC4Theme, b5 as LikeC4View, t as Link, ao as NotOperator, as as OrOperator, a7 as OutgoingExpr, aw as OverviewGraph, ai as ParsedLikeC4Model, n as Point, a1 as RelationExpr, a9 as RelationExpression, af as RelationPredicateExpression, ab as RelationWhereExpr, ay as RelationshipArrowType, aC as RelationshipKindSpecification, ax as RelationshipLineType, aI as RelationshipThemeColorValues, aJ as RelationshipThemeColors, aV as ScopedElementView, bb as StepEdgeId, ba as StepEdgeIdLiteral, ak as TagEqual, s as TagSpec, aD as ThemeColor, br as ViewChange, bq as ViewManualLayout, aS as ViewRule, aQ as ViewRuleAutoLayout, aL as ViewRulePredicate, aN as ViewRuleStyle, bf as ViewWithHash, bg as ViewWithNotation, au as WhereOperator, W as WildcardExpr, X as XYPoint, bd as extractStep, bm as getBBoxCenter, be as getParallelStepsPrefix, ar as isAndOperator, bj as isComputedDynamicView, bk as isComputedElementView, J as isCustomElement, ae as isCustomRelationExpr, b6 as isDynamicView, b0 as isDynamicViewIncludeRule, b3 as isDynamicViewParallelSteps, Y as isElement, O as isElementKindExpr, a0 as isElementPredicateExpr, x as isElementRef, S as isElementTagExpr, b7 as isElementView, _ as isElementWhere, z as isExpandedElementExpr, b8 as isExtendsElementView, a4 as isInOut, a6 as isIncoming, an as isKindEqual, ap as isNotOperator, at as isOrOperator, a8 as isOutgoing, a2 as isRelation, aa as isRelationExpression, ag as isRelationPredicateExpr, ac as isRelationWhere, b9 as isScopedElementView, bc as isStepEdgeId, al as isTagEqual, aF as isThemeColor, aR as isViewRuleAutoLayout, aM as isViewRulePredicate, aO as isViewRuleStyle, K as isWildcard, av as whereOperatorAsPredicate } from './shared/core.CpR2fq5B.cjs';
3
3
 
4
4
  type Numeric = number | bigint;
5
5
 
@@ -650,6 +650,8 @@ declare namespace LikeC4Model {
650
650
  }
651
651
  }
652
652
 
653
+ declare function compareNatural(a: string | undefined, b: string | undefined): -1 | 0 | 1;
654
+
653
655
  type Predicate<T> = (x: T) => boolean;
654
656
  declare function nameFromFqn(fqn: Fqn$1): string;
655
657
  declare function isAncestor<E extends {
@@ -682,10 +684,20 @@ declare function ancestorsFqn(fqn: Fqn$1): Fqn$1[];
682
684
  * - Positive number if a is deeper than b.
683
685
  * - Negative number if b is deeper than a.
684
686
  */
685
- declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
687
+ declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): -1 | 0 | 1;
686
688
  declare function compareByFqnHierarchically<T extends {
687
689
  id: string;
688
- }>(a: T, b: T): number;
690
+ }>(a: T, b: T): 0 | 1 | -1;
691
+ type IterableContainer$1<T = unknown> = ReadonlyArray<T> | readonly [];
692
+ type ReorderedArray<T extends IterableContainer$1> = {
693
+ -readonly [P in keyof T]: T[number];
694
+ };
695
+ declare function sortByFqnHierarchically<T extends {
696
+ id: string;
697
+ }, A extends IterableContainer$1<T>>(array: A): ReorderedArray<A>;
698
+ declare function sortNaturalByFqn<T extends {
699
+ id: string;
700
+ }, A extends IterableContainer$1<T>>(array: A): ReorderedArray<A>;
689
701
 
690
702
  /**
691
703
  * This should only be used for defining generics which extend any kind of JS
@@ -776,6 +788,6 @@ declare function delay(ms?: number): Promise<unknown>;
776
788
  declare const compareRelations: <T extends {
777
789
  source: string;
778
790
  target: string;
779
- }>(a: T, b: T) => number;
791
+ }>(a: T, b: T) => 0 | 1 | -1;
780
792
 
781
- export { Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementShape, Fqn$1 as Fqn, HexColorLiteral, LikeC4Model, LikeC4ViewModel, NodeId, NonEmptyArray, Relation, RelationID$1 as RelationID, RelationshipColors, RelationshipKind, Tag, ThemeColorValues, ViewID$1 as ViewID, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareRelations, computeColorValues, defaultTheme, delay, hasAtLeast, invariant, isAncestor, isDescendantOf, isNonEmptyArray, isSameHierarchy, isString, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn, parentFqnPredicate };
793
+ export { Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementShape, Fqn$1 as Fqn, HexColorLiteral, LikeC4Model, LikeC4ViewModel, NodeId, NonEmptyArray, Relation, RelationID$1 as RelationID, RelationshipColors, RelationshipKind, Tag, ThemeColorValues, ViewID$1 as ViewID, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareRelations, computeColorValues, defaultTheme, delay, hasAtLeast, invariant, isAncestor, isDescendantOf, isNonEmptyArray, isSameHierarchy, isString, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn, parentFqnPredicate, sortByFqnHierarchically, sortNaturalByFqn };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as Primitive, H as HexColorLiteral, T as ThemeColorValues, L as LiteralUnion, F as Fqn$1, R as RelationID$1, V as ViewID$1, E as EdgeId$1, C as ComputedView, a as Tag, b as ComputedNode, N as NodeId, c as ElementKind, d as ElementShape, e as Color, f as ComputedEdge, g as ComputedLikeC4Model, h as Element, i as Relation, j as RelationshipKind, k as NonEmptyArray } from './shared/core.9l7eW3pn.mjs';
2
- export { aq as AndOperator, A as AsFqn, aP as AutoLayoutDirection, bh as BBox, aU as BasicElementView, aT as BasicView, o as BorderStyle, B as BorderStyles, aE as ColorLiteral, be as ComputedDynamicView, bd as ComputedElementView, m as CustomColor, b1 as CustomColorDefinitions, G as CustomElementExpr, ad as CustomRelationExpr, aA as DefaultArrowType, q as DefaultElementShape, az as DefaultLineStyle, aB as DefaultRelationshipColor, D as DefaultThemeColor, bk as DiagramEdge, bj as DiagramNode, bl as DiagramView, b0 as DynamicView, aZ as DynamicViewIncludeRule, a$ as DynamicViewRule, aY as DynamicViewStep, U as ElementExpression, M as ElementKindExpr, v as ElementKindSpecification, u as ElementKindSpecificationStyle, bo as ElementNotation, $ as ElementPredicateExpression, w as ElementRefExpr, p as ElementShapes, r as ElementStyle, Q as ElementTagExpr, aG as ElementThemeColorValues, aH as ElementThemeColors, aX as ElementView, Z as ElementWhereExpr, aj as EqualOperator, y as ExpandedElementExpr, l as Expr, ah as Expression, aW as ExtendsElementView, I as IconUrl, a3 as InOutExpr, a5 as IncomingExpr, am as KindEqual, aK as LikeC4Theme, b2 as LikeC4View, t as Link, ao as NotOperator, as as OrOperator, a7 as OutgoingExpr, aw as OverviewGraph, ai as ParsedLikeC4Model, n as Point, a1 as RelationExpr, a9 as RelationExpression, af as RelationPredicateExpression, ab as RelationWhereExpr, ay as RelationshipArrowType, aC as RelationshipKindSpecification, ax as RelationshipLineType, aI as RelationshipThemeColorValues, aJ as RelationshipThemeColors, aV as ScopedElementView, b8 as StepEdgeId, b7 as StepEdgeIdLiteral, ak as TagEqual, s as TagSpec, aD as ThemeColor, bn as ViewChange, bm as ViewManualLayout, aS as ViewRule, aQ as ViewRuleAutoLayout, aL as ViewRulePredicate, aN as ViewRuleStyle, bb as ViewWithHash, bc as ViewWithNotation, au as WhereOperator, W as WildcardExpr, X as XYPoint, ba as extractStep, bi as getBBoxCenter, ar as isAndOperator, bf as isComputedDynamicView, bg as isComputedElementView, J as isCustomElement, ae as isCustomRelationExpr, b3 as isDynamicView, a_ as isDynamicViewIncludeRule, Y as isElement, O as isElementKindExpr, a0 as isElementPredicateExpr, x as isElementRef, S as isElementTagExpr, b4 as isElementView, _ as isElementWhere, z as isExpandedElementExpr, b5 as isExtendsElementView, a4 as isInOut, a6 as isIncoming, an as isKindEqual, ap as isNotOperator, at as isOrOperator, a8 as isOutgoing, a2 as isRelation, aa as isRelationExpression, ag as isRelationPredicateExpr, ac as isRelationWhere, b6 as isScopedElementView, b9 as isStepEdgeId, al as isTagEqual, aF as isThemeColor, aR as isViewRuleAutoLayout, aM as isViewRulePredicate, aO as isViewRuleStyle, K as isWildcard, av as whereOperatorAsPredicate } from './shared/core.9l7eW3pn.mjs';
1
+ import { P as Primitive, H as HexColorLiteral, T as ThemeColorValues, L as LiteralUnion, F as Fqn$1, R as RelationID$1, V as ViewID$1, E as EdgeId$1, C as ComputedView, a as Tag, b as ComputedNode, N as NodeId, c as ElementKind, d as ElementShape, e as Color, f as ComputedEdge, g as ComputedLikeC4Model, h as Element, i as Relation, j as RelationshipKind, k as NonEmptyArray } from './shared/core.CpR2fq5B.mjs';
2
+ export { aq as AndOperator, A as AsFqn, aP as AutoLayoutDirection, bl as BBox, aU as BasicElementView, aT as BasicView, o as BorderStyle, B as BorderStyles, aE as ColorLiteral, bi as ComputedDynamicView, bh as ComputedElementView, m as CustomColor, b4 as CustomColorDefinitions, G as CustomElementExpr, ad as CustomRelationExpr, aA as DefaultArrowType, q as DefaultElementShape, az as DefaultLineStyle, aB as DefaultRelationshipColor, D as DefaultThemeColor, bo as DiagramEdge, bn as DiagramNode, bp as DiagramView, b2 as DynamicView, a$ as DynamicViewIncludeRule, aZ as DynamicViewParallelSteps, b1 as DynamicViewRule, aY as DynamicViewStep, a_ as DynamicViewStepOrParallel, U as ElementExpression, M as ElementKindExpr, v as ElementKindSpecification, u as ElementKindSpecificationStyle, bs as ElementNotation, $ as ElementPredicateExpression, w as ElementRefExpr, p as ElementShapes, r as ElementStyle, Q as ElementTagExpr, aG as ElementThemeColorValues, aH as ElementThemeColors, aX as ElementView, Z as ElementWhereExpr, aj as EqualOperator, y as ExpandedElementExpr, l as Expr, ah as Expression, aW as ExtendsElementView, I as IconUrl, a3 as InOutExpr, a5 as IncomingExpr, am as KindEqual, aK as LikeC4Theme, b5 as LikeC4View, t as Link, ao as NotOperator, as as OrOperator, a7 as OutgoingExpr, aw as OverviewGraph, ai as ParsedLikeC4Model, n as Point, a1 as RelationExpr, a9 as RelationExpression, af as RelationPredicateExpression, ab as RelationWhereExpr, ay as RelationshipArrowType, aC as RelationshipKindSpecification, ax as RelationshipLineType, aI as RelationshipThemeColorValues, aJ as RelationshipThemeColors, aV as ScopedElementView, bb as StepEdgeId, ba as StepEdgeIdLiteral, ak as TagEqual, s as TagSpec, aD as ThemeColor, br as ViewChange, bq as ViewManualLayout, aS as ViewRule, aQ as ViewRuleAutoLayout, aL as ViewRulePredicate, aN as ViewRuleStyle, bf as ViewWithHash, bg as ViewWithNotation, au as WhereOperator, W as WildcardExpr, X as XYPoint, bd as extractStep, bm as getBBoxCenter, be as getParallelStepsPrefix, ar as isAndOperator, bj as isComputedDynamicView, bk as isComputedElementView, J as isCustomElement, ae as isCustomRelationExpr, b6 as isDynamicView, b0 as isDynamicViewIncludeRule, b3 as isDynamicViewParallelSteps, Y as isElement, O as isElementKindExpr, a0 as isElementPredicateExpr, x as isElementRef, S as isElementTagExpr, b7 as isElementView, _ as isElementWhere, z as isExpandedElementExpr, b8 as isExtendsElementView, a4 as isInOut, a6 as isIncoming, an as isKindEqual, ap as isNotOperator, at as isOrOperator, a8 as isOutgoing, a2 as isRelation, aa as isRelationExpression, ag as isRelationPredicateExpr, ac as isRelationWhere, b9 as isScopedElementView, bc as isStepEdgeId, al as isTagEqual, aF as isThemeColor, aR as isViewRuleAutoLayout, aM as isViewRulePredicate, aO as isViewRuleStyle, K as isWildcard, av as whereOperatorAsPredicate } from './shared/core.CpR2fq5B.mjs';
3
3
 
4
4
  type Numeric = number | bigint;
5
5
 
@@ -650,6 +650,8 @@ declare namespace LikeC4Model {
650
650
  }
651
651
  }
652
652
 
653
+ declare function compareNatural(a: string | undefined, b: string | undefined): -1 | 0 | 1;
654
+
653
655
  type Predicate<T> = (x: T) => boolean;
654
656
  declare function nameFromFqn(fqn: Fqn$1): string;
655
657
  declare function isAncestor<E extends {
@@ -682,10 +684,20 @@ declare function ancestorsFqn(fqn: Fqn$1): Fqn$1[];
682
684
  * - Positive number if a is deeper than b.
683
685
  * - Negative number if b is deeper than a.
684
686
  */
685
- declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): number;
687
+ declare function compareFqnHierarchically<T extends string = string>(a: T, b: T): -1 | 0 | 1;
686
688
  declare function compareByFqnHierarchically<T extends {
687
689
  id: string;
688
- }>(a: T, b: T): number;
690
+ }>(a: T, b: T): 0 | 1 | -1;
691
+ type IterableContainer$1<T = unknown> = ReadonlyArray<T> | readonly [];
692
+ type ReorderedArray<T extends IterableContainer$1> = {
693
+ -readonly [P in keyof T]: T[number];
694
+ };
695
+ declare function sortByFqnHierarchically<T extends {
696
+ id: string;
697
+ }, A extends IterableContainer$1<T>>(array: A): ReorderedArray<A>;
698
+ declare function sortNaturalByFqn<T extends {
699
+ id: string;
700
+ }, A extends IterableContainer$1<T>>(array: A): ReorderedArray<A>;
689
701
 
690
702
  /**
691
703
  * This should only be used for defining generics which extend any kind of JS
@@ -776,6 +788,6 @@ declare function delay(ms?: number): Promise<unknown>;
776
788
  declare const compareRelations: <T extends {
777
789
  source: string;
778
790
  target: string;
779
- }>(a: T, b: T) => number;
791
+ }>(a: T, b: T) => 0 | 1 | -1;
780
792
 
781
- export { Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementShape, Fqn$1 as Fqn, HexColorLiteral, LikeC4Model, LikeC4ViewModel, NodeId, NonEmptyArray, Relation, RelationID$1 as RelationID, RelationshipColors, RelationshipKind, Tag, ThemeColorValues, ViewID$1 as ViewID, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareRelations, computeColorValues, defaultTheme, delay, hasAtLeast, invariant, isAncestor, isDescendantOf, isNonEmptyArray, isSameHierarchy, isString, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn, parentFqnPredicate };
793
+ export { Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementShape, Fqn$1 as Fqn, HexColorLiteral, LikeC4Model, LikeC4ViewModel, NodeId, NonEmptyArray, Relation, RelationID$1 as RelationID, RelationshipColors, RelationshipKind, Tag, ThemeColorValues, ViewID$1 as ViewID, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareRelations, computeColorValues, defaultTheme, delay, hasAtLeast, invariant, isAncestor, isDescendantOf, isNonEmptyArray, isSameHierarchy, isString, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn, parentFqnPredicate, sortByFqnHierarchically, sortNaturalByFqn };