@likec4/core 1.14.0 → 1.15.1

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,15 +1,23 @@
1
1
  'use strict';
2
2
 
3
- const types_index = require('./shared/core.DWJhMIfV.cjs');
3
+ const types_index = require('./shared/core.Cq_6j35U.cjs');
4
4
  const defu = require('defu');
5
5
 
6
6
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
7
7
 
8
8
  const defu__default = /*#__PURE__*/_interopDefaultCompat(defu);
9
9
 
10
+ function d$1(...e){return types_index.u(a,e,o$3)}var a=(e,n)=>e.length<n.length?e.map((t,r)=>[t,n[r]]):n.map((t,r)=>[e[r],t]),o$3=e=>(n,t)=>({hasNext:!0,next:[n,e[t]],done:t>=e.length-1});
11
+
12
+ var s={done:!1,hasNext:!1};
13
+
14
+ function x(t,...o){let n=t,u=o.map(e=>"lazy"in e?f(e):void 0),p=0;for(;p<o.length;){if(u[p]===void 0||!B(n)){let i=o[p];n=i(n),p+=1;continue}let r=[];for(let i=p;i<o.length;i++){let l=u[i];if(l===void 0||(r.push(l),l.isSingle))break}let a=[];for(let i of n)if(A(i,a,r))break;let{isSingle:y}=r.at(-1);n=y?a[0]:a,p+=r.length;}return n}function A(t,o,n){if(n.length===0)return o.push(t),!1;let u=t,p=s,e=!1;for(let[r,a]of n.entries()){let{index:y,items:i}=a;if(i.push(u),p=a(u,y,i),a.index+=1,p.hasNext){if(p.hasMany??!1){for(let l of p.next)if(A(l,o,n.slice(r+1)))return !0;return e}u=p.next;}if(!p.hasNext)break;p.done&&(e=!0);}return p.hasNext&&o.push(u),e}function f(t){let{lazy:o,lazyArgs:n}=t,u=o(...n);return Object.assign(u,{isSingle:o.single??!1,index:0,items:[]})}function B(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}
15
+
10
16
  function r$1(...n){return types_index.u(Object.values,n)}
11
17
 
12
- function i$2(...e){return types_index.u(r,e)}var r=(e,t)=>e.length>=t;
18
+ function i$3(...e){return types_index.u(r,e)}var r=(e,t)=>e.length>=t;
19
+
20
+ function u$1(...e){return types_index.u(i$2,e)}function i$2(e,a){let n=[];for(let[o,r]of e.entries()){if(!a(r,o,e))break;n.push(r);}return n}
13
21
 
14
22
  function o$2(r,n){let e=Math.ceil(r),t=Math.floor(n);if(t<e)throw new RangeError(`randomInteger: The range [${r.toString()},${n.toString()}] contains no integer`);return Math.floor(Math.random()*(t-e+1)+e)}
15
23
 
@@ -411,7 +419,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
411
419
  }
412
420
  });
413
421
  const mapLinks = (links) => {
414
- if (!links || !i$2(links, 1)) {
422
+ if (!links || !i$3(links, 1)) {
415
423
  return null;
416
424
  }
417
425
  return m(links, (l) => typeof l === "string" ? { url: l } : l);
@@ -5286,6 +5294,18 @@ class LikeC4Model {
5286
5294
  LikeC4Model2.ElementModel = ElementModel;
5287
5295
  })(LikeC4Model || (LikeC4Model = {}));
5288
5296
 
5297
+ function commonHead(sources, targets, equals) {
5298
+ if (sources.length === 0 || targets.length === 0) {
5299
+ return [];
5300
+ }
5301
+ equals ??= Object.is;
5302
+ return x(
5303
+ d$1(sources, targets),
5304
+ u$1(([source, target]) => equals(source, target)),
5305
+ m(([source, _]) => source)
5306
+ );
5307
+ }
5308
+
5289
5309
  const DELAY = "LIKEC4_DELAY";
5290
5310
  function delay(...args) {
5291
5311
  let ms = 100;
@@ -5323,11 +5343,23 @@ const compareRelations = (a, b) => {
5323
5343
 
5324
5344
  exports.AsFqn = types_index.AsFqn;
5325
5345
  exports.BorderStyles = types_index.BorderStyles;
5346
+ Object.defineProperty(exports, "ComputedNode", {
5347
+ enumerable: true,
5348
+ get: function () { return types_index.ComputedNode; }
5349
+ });
5326
5350
  exports.DefaultArrowType = types_index.DefaultArrowType;
5327
5351
  exports.DefaultElementShape = types_index.DefaultElementShape;
5328
5352
  exports.DefaultLineStyle = types_index.DefaultLineStyle;
5329
5353
  exports.DefaultRelationshipColor = types_index.DefaultRelationshipColor;
5330
5354
  exports.DefaultThemeColor = types_index.DefaultThemeColor;
5355
+ Object.defineProperty(exports, "DiagramNode", {
5356
+ enumerable: true,
5357
+ get: function () { return types_index.DiagramNode; }
5358
+ });
5359
+ Object.defineProperty(exports, "ElementKind", {
5360
+ enumerable: true,
5361
+ get: function () { return types_index.ElementKind; }
5362
+ });
5331
5363
  exports.ElementShapes = types_index.ElementShapes;
5332
5364
  exports.Expr = types_index.expression;
5333
5365
  exports.StepEdgeId = types_index.StepEdgeId;
@@ -5369,6 +5401,7 @@ exports.isTagEqual = types_index.isTagEqual;
5369
5401
  exports.isThemeColor = types_index.isThemeColor;
5370
5402
  exports.isViewRuleAutoLayout = types_index.isViewRuleAutoLayout;
5371
5403
  exports.isViewRuleGlobalStyle = types_index.isViewRuleGlobalStyle;
5404
+ exports.isViewRuleGroup = types_index.isViewRuleGroup;
5372
5405
  exports.isViewRulePredicate = types_index.isViewRulePredicate;
5373
5406
  exports.isViewRuleStyle = types_index.isViewRuleStyle;
5374
5407
  exports.isWildcard = types_index.isWildcard;
@@ -5382,6 +5415,7 @@ exports.LikeC4ViewModel = LikeC4ViewModel;
5382
5415
  exports.RelationshipColors = RelationshipColors;
5383
5416
  exports.ancestorsFqn = ancestorsFqn;
5384
5417
  exports.commonAncestor = commonAncestor;
5418
+ exports.commonHead = commonHead;
5385
5419
  exports.compareByFqnHierarchically = compareByFqnHierarchically;
5386
5420
  exports.compareFqnHierarchically = compareFqnHierarchically;
5387
5421
  exports.compareNatural = compareNatural;
@@ -5389,7 +5423,7 @@ exports.compareRelations = compareRelations;
5389
5423
  exports.computeColorValues = computeColorValues;
5390
5424
  exports.defaultTheme = defaultTheme;
5391
5425
  exports.delay = delay;
5392
- exports.hasAtLeast = i$2;
5426
+ exports.hasAtLeast = i$3;
5393
5427
  exports.isAncestor = isAncestor;
5394
5428
  exports.isDescendantOf = isDescendantOf;
5395
5429
  exports.isNonEmptyArray = isNonEmptyArray;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IfNever, TupleToUnion, Tagged, Simplify, LiteralUnion, Class, IsNumericLiteral } from 'type-fest';
2
- import { E as ElementKindSpecification, R as RelationshipKindSpecification, P as ParsedLikeC4Model, a as ElementShape, C as Color, B as BorderStyle, b as RelationshipArrowType, c as RelationshipLineType, d as Element, e as Relation, F as Fqn$1, L as LikeC4View, f as Expression, V as ViewRuleStyle, A as AutoLayoutDirection, N as NonEmptyArray, g as CustomElementExpr, h as CustomRelationExpr, H as HexColorLiteral, T as ThemeColorValues, i as RelationID$1, j as ViewID$1, k as EdgeId$1, l as ComputedView, m as Tag, n as ComputedNode, o as NodeId, p as ElementKind, q as ComputedEdge, r as ComputedLikeC4Model, s as LayoutedLikeC4Model, t as RelationshipKind, D as DiagramView, u as DiagramNode, v as DiagramEdge } from './shared/core.zgP5gtDY.cjs';
3
- export { aC as AndOperator, G as AsFqn, bv as BBox, b2 as BasicElementView, b1 as BasicView, J as BorderStyles, aN as ColorLiteral, bs as ComputedDynamicView, br as ComputedElementView, y as CustomColor, be as CustomColorDefinitions, aK as DefaultArrowType, O as DefaultElementShape, aJ as DefaultLineStyle, aL as DefaultRelationshipColor, M as DefaultThemeColor, bc as DynamicView, b9 as DynamicViewIncludeRule, b7 as DynamicViewParallelSteps, bb as DynamicViewRule, b6 as DynamicViewStep, b8 as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bz as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aP as ElementThemeColorValues, aQ as ElementThemeColors, b5 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, w as Expr, b4 as ExtendsElementView, au as GlobalStyle, at as GlobalStyleID, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, aT as LikeC4Theme, U as Link, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aI as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aR as RelationshipThemeColorValues, aS as RelationshipThemeColors, b3 as ScopedElementView, bk as StepEdgeId, bj as StepEdgeIdLiteral, aw as TagEqual, S as TagSpec, aM as ThemeColor, W as TypedElement, bq as ViewAutoLayout, by as ViewChange, bx as ViewManualLayout, b0 as ViewRule, a_ as ViewRuleAutoLayout, aX as ViewRuleGlobalStyle, aU as ViewRulePredicate, bo as ViewWithHash, bp as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bm as extractStep, bw as getBBoxCenter, bn as getParallelStepsPrefix, aD as isAndOperator, aZ as isAutoLayoutDirection, bt as isComputedDynamicView, bu as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bf as isDynamicView, ba as isDynamicViewIncludeRule, bd as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bg as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bh as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bi as isScopedElementView, bl as isStepEdgeId, ax as isTagEqual, aO as isThemeColor, a$ as isViewRuleAutoLayout, aY as isViewRuleGlobalStyle, aV as isViewRulePredicate, aW as isViewRuleStyle, a3 as isWildcard, aH as whereOperatorAsPredicate } from './shared/core.zgP5gtDY.cjs';
2
+ import { E as ElementKindSpecification, R as RelationshipKindSpecification, P as ParsedLikeC4Model, a as ElementShape, C as Color, B as BorderStyle, b as RelationshipArrowType, c as RelationshipLineType, d as Element, e as Relation, F as Fqn$1, L as LikeC4View, f as Expression, V as ViewRuleStyle, A as AutoLayoutDirection, N as NonEmptyArray, g as CustomElementExpr, h as CustomRelationExpr, H as HexColorLiteral, T as ThemeColorValues, i as RelationID$1, j as ViewID$1, k as EdgeId$1, l as ComputedView, m as Tag, n as ComputedNode, o as NodeId, p as ElementKind, q as ComputedEdge, r as ComputedLikeC4Model, s as LayoutedLikeC4Model, t as RelationshipKind, D as DiagramView, u as DiagramNode, v as DiagramEdge } from './shared/core.CpdWcGpN.cjs';
3
+ export { aC as AndOperator, G as AsFqn, bz as BBox, b6 as BasicElementView, b5 as BasicView, J as BorderStyles, aO as ColorLiteral, bw as ComputedDynamicView, bv as ComputedElementView, y as CustomColor, bi as CustomColorDefinitions, aL as DefaultArrowType, O as DefaultElementShape, aK as DefaultLineStyle, aM as DefaultRelationshipColor, M as DefaultThemeColor, bg as DynamicView, bd as DynamicViewIncludeRule, bb as DynamicViewParallelSteps, bf as DynamicViewRule, ba as DynamicViewStep, bc as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bD as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aQ as ElementThemeColorValues, aR as ElementThemeColors, b9 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, w as Expr, b8 as ExtendsElementView, aH as Filterable, au as GlobalStyle, at as GlobalStyleID, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, aU as LikeC4Theme, U as Link, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aJ as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aS as RelationshipThemeColorValues, aT as RelationshipThemeColors, b7 as ScopedElementView, bo as StepEdgeId, bn as StepEdgeIdLiteral, aw as TagEqual, S as TagSpec, aN as ThemeColor, W as TypedElement, bu as ViewAutoLayout, bC as ViewChange, bB as ViewManualLayout, b4 as ViewRule, b0 as ViewRuleAutoLayout, aY as ViewRuleGlobalStyle, b2 as ViewRuleGroup, aV as ViewRulePredicate, a_ as ViewRuleStyleOrGlobalRef, bs as ViewWithHash, bt as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bq as extractStep, bA as getBBoxCenter, br as getParallelStepsPrefix, aD as isAndOperator, a$ as isAutoLayoutDirection, bx as isComputedDynamicView, by as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bj as isDynamicView, be as isDynamicViewIncludeRule, bh as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bk as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bl as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bm as isScopedElementView, bp as isStepEdgeId, ax as isTagEqual, aP as isThemeColor, b1 as isViewRuleAutoLayout, aZ as isViewRuleGlobalStyle, b3 as isViewRuleGroup, aW as isViewRulePredicate, aX as isViewRuleStyle, a3 as isWildcard, aI as whereOperatorAsPredicate } from './shared/core.CpdWcGpN.cjs';
4
4
 
5
5
  type KeysOf<T> = keyof T extends infer K extends string ? K : never;
6
6
  type BuilderSpecification = {
@@ -898,6 +898,11 @@ declare namespace LikeC4DiagramModel {
898
898
  }
899
899
  }
900
900
 
901
+ /**
902
+ * Common head of two arrays
903
+ */
904
+ declare function commonHead<T>(sources: ReadonlyArray<T>, targets: ReadonlyArray<T>, equals?: (a: T, b: T) => boolean): T[];
905
+
901
906
  declare function compareNatural(a: string | undefined, b: string | undefined): -1 | 0 | 1;
902
907
 
903
908
  type Predicate<T> = (x: T) => boolean;
@@ -1040,4 +1045,4 @@ declare const compareRelations: <T extends {
1040
1045
  target: string;
1041
1046
  }>(a: T, b: T) => 0 | 1 | -1;
1042
1047
 
1043
- export { type AnyTypes, type AnyTypesNested, AutoLayoutDirection, BorderStyle, Builder, type BuilderSpecification, Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, CustomElementExpr, CustomRelationExpr, DiagramEdge, DiagramNode, DiagramView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementKindSpecification, ElementShape, type Expression, Fqn$1 as Fqn, HexColorLiteral, LayoutedLikeC4Model, LikeC4DiagramModel, LikeC4Model, LikeC4View, LikeC4ViewModel, type ModelBuilder, type ModelHelpers, NodeId, NonEmptyArray, ParsedLikeC4Model, Relation, RelationID$1 as RelationID, RelationshipArrowType, RelationshipColors, RelationshipKind, RelationshipKindSpecification, RelationshipLineType, Tag, ThemeColorValues, Types, type TypesNested, type ViewBuilder, type ViewHelpers, ViewID$1 as ViewID, ViewRuleStyle, type ViewsBuilder, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareRelations, computeColorValues, defaultTheme, delay, hasAtLeast, invariant, isAncestor, isDescendantOf, isNonEmptyArray, isSameHierarchy, isString, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn, parentFqnPredicate, sortByFqnHierarchically, sortNaturalByFqn };
1048
+ export { type AnyTypes, type AnyTypesNested, AutoLayoutDirection, BorderStyle, Builder, type BuilderSpecification, Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, CustomElementExpr, CustomRelationExpr, DiagramEdge, DiagramNode, DiagramView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementKindSpecification, ElementShape, type Expression, Fqn$1 as Fqn, HexColorLiteral, LayoutedLikeC4Model, LikeC4DiagramModel, LikeC4Model, LikeC4View, LikeC4ViewModel, type ModelBuilder, type ModelHelpers, NodeId, NonEmptyArray, ParsedLikeC4Model, Relation, RelationID$1 as RelationID, RelationshipArrowType, RelationshipColors, RelationshipKind, RelationshipKindSpecification, RelationshipLineType, Tag, ThemeColorValues, Types, type TypesNested, type ViewBuilder, type ViewHelpers, ViewID$1 as ViewID, ViewRuleStyle, type ViewsBuilder, ancestorsFqn, commonAncestor, commonHead, 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,6 +1,6 @@
1
1
  import { IfNever, TupleToUnion, Tagged, Simplify, LiteralUnion, Class, IsNumericLiteral } from 'type-fest';
2
- import { E as ElementKindSpecification, R as RelationshipKindSpecification, P as ParsedLikeC4Model, a as ElementShape, C as Color, B as BorderStyle, b as RelationshipArrowType, c as RelationshipLineType, d as Element, e as Relation, F as Fqn$1, L as LikeC4View, f as Expression, V as ViewRuleStyle, A as AutoLayoutDirection, N as NonEmptyArray, g as CustomElementExpr, h as CustomRelationExpr, H as HexColorLiteral, T as ThemeColorValues, i as RelationID$1, j as ViewID$1, k as EdgeId$1, l as ComputedView, m as Tag, n as ComputedNode, o as NodeId, p as ElementKind, q as ComputedEdge, r as ComputedLikeC4Model, s as LayoutedLikeC4Model, t as RelationshipKind, D as DiagramView, u as DiagramNode, v as DiagramEdge } from './shared/core.zgP5gtDY.mjs';
3
- export { aC as AndOperator, G as AsFqn, bv as BBox, b2 as BasicElementView, b1 as BasicView, J as BorderStyles, aN as ColorLiteral, bs as ComputedDynamicView, br as ComputedElementView, y as CustomColor, be as CustomColorDefinitions, aK as DefaultArrowType, O as DefaultElementShape, aJ as DefaultLineStyle, aL as DefaultRelationshipColor, M as DefaultThemeColor, bc as DynamicView, b9 as DynamicViewIncludeRule, b7 as DynamicViewParallelSteps, bb as DynamicViewRule, b6 as DynamicViewStep, b8 as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bz as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aP as ElementThemeColorValues, aQ as ElementThemeColors, b5 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, w as Expr, b4 as ExtendsElementView, au as GlobalStyle, at as GlobalStyleID, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, aT as LikeC4Theme, U as Link, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aI as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aR as RelationshipThemeColorValues, aS as RelationshipThemeColors, b3 as ScopedElementView, bk as StepEdgeId, bj as StepEdgeIdLiteral, aw as TagEqual, S as TagSpec, aM as ThemeColor, W as TypedElement, bq as ViewAutoLayout, by as ViewChange, bx as ViewManualLayout, b0 as ViewRule, a_ as ViewRuleAutoLayout, aX as ViewRuleGlobalStyle, aU as ViewRulePredicate, bo as ViewWithHash, bp as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bm as extractStep, bw as getBBoxCenter, bn as getParallelStepsPrefix, aD as isAndOperator, aZ as isAutoLayoutDirection, bt as isComputedDynamicView, bu as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bf as isDynamicView, ba as isDynamicViewIncludeRule, bd as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bg as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bh as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bi as isScopedElementView, bl as isStepEdgeId, ax as isTagEqual, aO as isThemeColor, a$ as isViewRuleAutoLayout, aY as isViewRuleGlobalStyle, aV as isViewRulePredicate, aW as isViewRuleStyle, a3 as isWildcard, aH as whereOperatorAsPredicate } from './shared/core.zgP5gtDY.mjs';
2
+ import { E as ElementKindSpecification, R as RelationshipKindSpecification, P as ParsedLikeC4Model, a as ElementShape, C as Color, B as BorderStyle, b as RelationshipArrowType, c as RelationshipLineType, d as Element, e as Relation, F as Fqn$1, L as LikeC4View, f as Expression, V as ViewRuleStyle, A as AutoLayoutDirection, N as NonEmptyArray, g as CustomElementExpr, h as CustomRelationExpr, H as HexColorLiteral, T as ThemeColorValues, i as RelationID$1, j as ViewID$1, k as EdgeId$1, l as ComputedView, m as Tag, n as ComputedNode, o as NodeId, p as ElementKind, q as ComputedEdge, r as ComputedLikeC4Model, s as LayoutedLikeC4Model, t as RelationshipKind, D as DiagramView, u as DiagramNode, v as DiagramEdge } from './shared/core.CpdWcGpN.mjs';
3
+ export { aC as AndOperator, G as AsFqn, bz as BBox, b6 as BasicElementView, b5 as BasicView, J as BorderStyles, aO as ColorLiteral, bw as ComputedDynamicView, bv as ComputedElementView, y as CustomColor, bi as CustomColorDefinitions, aL as DefaultArrowType, O as DefaultElementShape, aK as DefaultLineStyle, aM as DefaultRelationshipColor, M as DefaultThemeColor, bg as DynamicView, bd as DynamicViewIncludeRule, bb as DynamicViewParallelSteps, bf as DynamicViewRule, ba as DynamicViewStep, bc as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bD as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aQ as ElementThemeColorValues, aR as ElementThemeColors, b9 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, w as Expr, b8 as ExtendsElementView, aH as Filterable, au as GlobalStyle, at as GlobalStyleID, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, aU as LikeC4Theme, U as Link, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aJ as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aS as RelationshipThemeColorValues, aT as RelationshipThemeColors, b7 as ScopedElementView, bo as StepEdgeId, bn as StepEdgeIdLiteral, aw as TagEqual, S as TagSpec, aN as ThemeColor, W as TypedElement, bu as ViewAutoLayout, bC as ViewChange, bB as ViewManualLayout, b4 as ViewRule, b0 as ViewRuleAutoLayout, aY as ViewRuleGlobalStyle, b2 as ViewRuleGroup, aV as ViewRulePredicate, a_ as ViewRuleStyleOrGlobalRef, bs as ViewWithHash, bt as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bq as extractStep, bA as getBBoxCenter, br as getParallelStepsPrefix, aD as isAndOperator, a$ as isAutoLayoutDirection, bx as isComputedDynamicView, by as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bj as isDynamicView, be as isDynamicViewIncludeRule, bh as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bk as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bl as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bm as isScopedElementView, bp as isStepEdgeId, ax as isTagEqual, aP as isThemeColor, b1 as isViewRuleAutoLayout, aZ as isViewRuleGlobalStyle, b3 as isViewRuleGroup, aW as isViewRulePredicate, aX as isViewRuleStyle, a3 as isWildcard, aI as whereOperatorAsPredicate } from './shared/core.CpdWcGpN.mjs';
4
4
 
5
5
  type KeysOf<T> = keyof T extends infer K extends string ? K : never;
6
6
  type BuilderSpecification = {
@@ -898,6 +898,11 @@ declare namespace LikeC4DiagramModel {
898
898
  }
899
899
  }
900
900
 
901
+ /**
902
+ * Common head of two arrays
903
+ */
904
+ declare function commonHead<T>(sources: ReadonlyArray<T>, targets: ReadonlyArray<T>, equals?: (a: T, b: T) => boolean): T[];
905
+
901
906
  declare function compareNatural(a: string | undefined, b: string | undefined): -1 | 0 | 1;
902
907
 
903
908
  type Predicate<T> = (x: T) => boolean;
@@ -1040,4 +1045,4 @@ declare const compareRelations: <T extends {
1040
1045
  target: string;
1041
1046
  }>(a: T, b: T) => 0 | 1 | -1;
1042
1047
 
1043
- export { type AnyTypes, type AnyTypesNested, AutoLayoutDirection, BorderStyle, Builder, type BuilderSpecification, Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, CustomElementExpr, CustomRelationExpr, DiagramEdge, DiagramNode, DiagramView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementKindSpecification, ElementShape, type Expression, Fqn$1 as Fqn, HexColorLiteral, LayoutedLikeC4Model, LikeC4DiagramModel, LikeC4Model, LikeC4View, LikeC4ViewModel, type ModelBuilder, type ModelHelpers, NodeId, NonEmptyArray, ParsedLikeC4Model, Relation, RelationID$1 as RelationID, RelationshipArrowType, RelationshipColors, RelationshipKind, RelationshipKindSpecification, RelationshipLineType, Tag, ThemeColorValues, Types, type TypesNested, type ViewBuilder, type ViewHelpers, ViewID$1 as ViewID, ViewRuleStyle, type ViewsBuilder, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareRelations, computeColorValues, defaultTheme, delay, hasAtLeast, invariant, isAncestor, isDescendantOf, isNonEmptyArray, isSameHierarchy, isString, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn, parentFqnPredicate, sortByFqnHierarchically, sortNaturalByFqn };
1048
+ export { type AnyTypes, type AnyTypesNested, AutoLayoutDirection, BorderStyle, Builder, type BuilderSpecification, Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, CustomElementExpr, CustomRelationExpr, DiagramEdge, DiagramNode, DiagramView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementKindSpecification, ElementShape, type Expression, Fqn$1 as Fqn, HexColorLiteral, LayoutedLikeC4Model, LikeC4DiagramModel, LikeC4Model, LikeC4View, LikeC4ViewModel, type ModelBuilder, type ModelHelpers, NodeId, NonEmptyArray, ParsedLikeC4Model, Relation, RelationID$1 as RelationID, RelationshipArrowType, RelationshipColors, RelationshipKind, RelationshipKindSpecification, RelationshipLineType, Tag, ThemeColorValues, Types, type TypesNested, type ViewBuilder, type ViewHelpers, ViewID$1 as ViewID, ViewRuleStyle, type ViewsBuilder, ancestorsFqn, commonAncestor, commonHead, 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.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IfNever, TupleToUnion, Tagged, Simplify, LiteralUnion, Class, IsNumericLiteral } from 'type-fest';
2
- import { E as ElementKindSpecification, R as RelationshipKindSpecification, P as ParsedLikeC4Model, a as ElementShape, C as Color, B as BorderStyle, b as RelationshipArrowType, c as RelationshipLineType, d as Element, e as Relation, F as Fqn$1, L as LikeC4View, f as Expression, V as ViewRuleStyle, A as AutoLayoutDirection, N as NonEmptyArray, g as CustomElementExpr, h as CustomRelationExpr, H as HexColorLiteral, T as ThemeColorValues, i as RelationID$1, j as ViewID$1, k as EdgeId$1, l as ComputedView, m as Tag, n as ComputedNode, o as NodeId, p as ElementKind, q as ComputedEdge, r as ComputedLikeC4Model, s as LayoutedLikeC4Model, t as RelationshipKind, D as DiagramView, u as DiagramNode, v as DiagramEdge } from './shared/core.zgP5gtDY.js';
3
- export { aC as AndOperator, G as AsFqn, bv as BBox, b2 as BasicElementView, b1 as BasicView, J as BorderStyles, aN as ColorLiteral, bs as ComputedDynamicView, br as ComputedElementView, y as CustomColor, be as CustomColorDefinitions, aK as DefaultArrowType, O as DefaultElementShape, aJ as DefaultLineStyle, aL as DefaultRelationshipColor, M as DefaultThemeColor, bc as DynamicView, b9 as DynamicViewIncludeRule, b7 as DynamicViewParallelSteps, bb as DynamicViewRule, b6 as DynamicViewStep, b8 as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bz as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aP as ElementThemeColorValues, aQ as ElementThemeColors, b5 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, w as Expr, b4 as ExtendsElementView, au as GlobalStyle, at as GlobalStyleID, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, aT as LikeC4Theme, U as Link, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aI as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aR as RelationshipThemeColorValues, aS as RelationshipThemeColors, b3 as ScopedElementView, bk as StepEdgeId, bj as StepEdgeIdLiteral, aw as TagEqual, S as TagSpec, aM as ThemeColor, W as TypedElement, bq as ViewAutoLayout, by as ViewChange, bx as ViewManualLayout, b0 as ViewRule, a_ as ViewRuleAutoLayout, aX as ViewRuleGlobalStyle, aU as ViewRulePredicate, bo as ViewWithHash, bp as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bm as extractStep, bw as getBBoxCenter, bn as getParallelStepsPrefix, aD as isAndOperator, aZ as isAutoLayoutDirection, bt as isComputedDynamicView, bu as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bf as isDynamicView, ba as isDynamicViewIncludeRule, bd as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bg as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bh as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bi as isScopedElementView, bl as isStepEdgeId, ax as isTagEqual, aO as isThemeColor, a$ as isViewRuleAutoLayout, aY as isViewRuleGlobalStyle, aV as isViewRulePredicate, aW as isViewRuleStyle, a3 as isWildcard, aH as whereOperatorAsPredicate } from './shared/core.zgP5gtDY.js';
2
+ import { E as ElementKindSpecification, R as RelationshipKindSpecification, P as ParsedLikeC4Model, a as ElementShape, C as Color, B as BorderStyle, b as RelationshipArrowType, c as RelationshipLineType, d as Element, e as Relation, F as Fqn$1, L as LikeC4View, f as Expression, V as ViewRuleStyle, A as AutoLayoutDirection, N as NonEmptyArray, g as CustomElementExpr, h as CustomRelationExpr, H as HexColorLiteral, T as ThemeColorValues, i as RelationID$1, j as ViewID$1, k as EdgeId$1, l as ComputedView, m as Tag, n as ComputedNode, o as NodeId, p as ElementKind, q as ComputedEdge, r as ComputedLikeC4Model, s as LayoutedLikeC4Model, t as RelationshipKind, D as DiagramView, u as DiagramNode, v as DiagramEdge } from './shared/core.CpdWcGpN.js';
3
+ export { aC as AndOperator, G as AsFqn, bz as BBox, b6 as BasicElementView, b5 as BasicView, J as BorderStyles, aO as ColorLiteral, bw as ComputedDynamicView, bv as ComputedElementView, y as CustomColor, bi as CustomColorDefinitions, aL as DefaultArrowType, O as DefaultElementShape, aK as DefaultLineStyle, aM as DefaultRelationshipColor, M as DefaultThemeColor, bg as DynamicView, bd as DynamicViewIncludeRule, bb as DynamicViewParallelSteps, bf as DynamicViewRule, ba as DynamicViewStep, bc as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bD as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aQ as ElementThemeColorValues, aR as ElementThemeColors, b9 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, w as Expr, b8 as ExtendsElementView, aH as Filterable, au as GlobalStyle, at as GlobalStyleID, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, aU as LikeC4Theme, U as Link, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aJ as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aS as RelationshipThemeColorValues, aT as RelationshipThemeColors, b7 as ScopedElementView, bo as StepEdgeId, bn as StepEdgeIdLiteral, aw as TagEqual, S as TagSpec, aN as ThemeColor, W as TypedElement, bu as ViewAutoLayout, bC as ViewChange, bB as ViewManualLayout, b4 as ViewRule, b0 as ViewRuleAutoLayout, aY as ViewRuleGlobalStyle, b2 as ViewRuleGroup, aV as ViewRulePredicate, a_ as ViewRuleStyleOrGlobalRef, bs as ViewWithHash, bt as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bq as extractStep, bA as getBBoxCenter, br as getParallelStepsPrefix, aD as isAndOperator, a$ as isAutoLayoutDirection, bx as isComputedDynamicView, by as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bj as isDynamicView, be as isDynamicViewIncludeRule, bh as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bk as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bl as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bm as isScopedElementView, bp as isStepEdgeId, ax as isTagEqual, aP as isThemeColor, b1 as isViewRuleAutoLayout, aZ as isViewRuleGlobalStyle, b3 as isViewRuleGroup, aW as isViewRulePredicate, aX as isViewRuleStyle, a3 as isWildcard, aI as whereOperatorAsPredicate } from './shared/core.CpdWcGpN.js';
4
4
 
5
5
  type KeysOf<T> = keyof T extends infer K extends string ? K : never;
6
6
  type BuilderSpecification = {
@@ -898,6 +898,11 @@ declare namespace LikeC4DiagramModel {
898
898
  }
899
899
  }
900
900
 
901
+ /**
902
+ * Common head of two arrays
903
+ */
904
+ declare function commonHead<T>(sources: ReadonlyArray<T>, targets: ReadonlyArray<T>, equals?: (a: T, b: T) => boolean): T[];
905
+
901
906
  declare function compareNatural(a: string | undefined, b: string | undefined): -1 | 0 | 1;
902
907
 
903
908
  type Predicate<T> = (x: T) => boolean;
@@ -1040,4 +1045,4 @@ declare const compareRelations: <T extends {
1040
1045
  target: string;
1041
1046
  }>(a: T, b: T) => 0 | 1 | -1;
1042
1047
 
1043
- export { type AnyTypes, type AnyTypesNested, AutoLayoutDirection, BorderStyle, Builder, type BuilderSpecification, Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, CustomElementExpr, CustomRelationExpr, DiagramEdge, DiagramNode, DiagramView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementKindSpecification, ElementShape, type Expression, Fqn$1 as Fqn, HexColorLiteral, LayoutedLikeC4Model, LikeC4DiagramModel, LikeC4Model, LikeC4View, LikeC4ViewModel, type ModelBuilder, type ModelHelpers, NodeId, NonEmptyArray, ParsedLikeC4Model, Relation, RelationID$1 as RelationID, RelationshipArrowType, RelationshipColors, RelationshipKind, RelationshipKindSpecification, RelationshipLineType, Tag, ThemeColorValues, Types, type TypesNested, type ViewBuilder, type ViewHelpers, ViewID$1 as ViewID, ViewRuleStyle, type ViewsBuilder, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareRelations, computeColorValues, defaultTheme, delay, hasAtLeast, invariant, isAncestor, isDescendantOf, isNonEmptyArray, isSameHierarchy, isString, nameFromFqn, nonNullable, nonexhaustive, notDescendantOf, parentFqn, parentFqnPredicate, sortByFqnHierarchically, sortNaturalByFqn };
1048
+ export { type AnyTypes, type AnyTypesNested, AutoLayoutDirection, BorderStyle, Builder, type BuilderSpecification, Color, ComputedEdge, ComputedLikeC4Model, ComputedNode, ComputedView, CustomElementExpr, CustomRelationExpr, DiagramEdge, DiagramNode, DiagramView, EdgeId$1 as EdgeId, Element, ElementColors, ElementKind, ElementKindSpecification, ElementShape, type Expression, Fqn$1 as Fqn, HexColorLiteral, LayoutedLikeC4Model, LikeC4DiagramModel, LikeC4Model, LikeC4View, LikeC4ViewModel, type ModelBuilder, type ModelHelpers, NodeId, NonEmptyArray, ParsedLikeC4Model, Relation, RelationID$1 as RelationID, RelationshipArrowType, RelationshipColors, RelationshipKind, RelationshipKindSpecification, RelationshipLineType, Tag, ThemeColorValues, Types, type TypesNested, type ViewBuilder, type ViewHelpers, ViewID$1 as ViewID, ViewRuleStyle, type ViewsBuilder, ancestorsFqn, commonAncestor, commonHead, 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.mjs CHANGED
@@ -1,20 +1,28 @@
1
- import { u as u$1, i as isElementPredicateExpr, n as n$2, a as invariant, b as isScopedElementView, D as DefaultThemeColor, c as DefaultElementShape, e, d as nonNullable, f as DefaultRelationshipColor } from './shared/core.NzRKuMZ7.mjs';
2
- export { A as AsFqn, B as BorderStyles, M as DefaultArrowType, L as DefaultLineStyle, E as ElementShapes, g as Expr, Y as StepEdgeId, _ as extractStep, a2 as getBBoxCenter, $ as getParallelStepsPrefix, I as isAndOperator, R as isAutoLayoutDirection, a0 as isComputedDynamicView, a1 as isComputedElementView, l as isCustomElement, z as isCustomRelationExpr, V as isDynamicView, T as isDynamicViewIncludeRule, U as isDynamicViewParallelSteps, q as isElement, o as isElementKindExpr, j as isElementRef, p as isElementTagExpr, W as isElementView, r as isElementWhere, k as isExpandedElementExpr, X as isExtendsElementView, t as isInOut, v as isIncoming, G as isKindEqual, H as isNotOperator, J as isOrOperator, w as isOutgoing, s as isRelation, x as isRelationExpression, C as isRelationPredicateExpr, y as isRelationWhere, Z as isStepEdgeId, F as isTagEqual, N as isThemeColor, S as isViewRuleAutoLayout, Q as isViewRuleGlobalStyle, O as isViewRulePredicate, P as isViewRuleStyle, m as isWildcard, h as nonexhaustive, K as whereOperatorAsPredicate } from './shared/core.NzRKuMZ7.mjs';
1
+ import { u as u$2, i as isElementPredicateExpr, n as n$2, a as invariant, b as isScopedElementView, D as DefaultThemeColor, c as DefaultElementShape, e, d as nonNullable, f as DefaultRelationshipColor } from './shared/core.zYtlWYjW.mjs';
2
+ export { A as AsFqn, B as BorderStyles, a2 as ComputedNode, N as DefaultArrowType, M as DefaultLineStyle, a6 as DiagramNode, E as ElementKind, j as ElementShapes, g as Expr, _ as StepEdgeId, a0 as extractStep, a5 as getBBoxCenter, a1 as getParallelStepsPrefix, J as isAndOperator, S as isAutoLayoutDirection, a3 as isComputedDynamicView, a4 as isComputedElementView, m as isCustomElement, C as isCustomRelationExpr, X as isDynamicView, V as isDynamicViewIncludeRule, W as isDynamicViewParallelSteps, r as isElement, p as isElementKindExpr, k as isElementRef, q as isElementTagExpr, Y as isElementView, s as isElementWhere, l as isExpandedElementExpr, Z as isExtendsElementView, v as isInOut, w as isIncoming, H as isKindEqual, I as isNotOperator, K as isOrOperator, x as isOutgoing, t as isRelation, y as isRelationExpression, F as isRelationPredicateExpr, z as isRelationWhere, $ as isStepEdgeId, G as isTagEqual, O as isThemeColor, T as isViewRuleAutoLayout, R as isViewRuleGlobalStyle, U as isViewRuleGroup, P as isViewRulePredicate, Q as isViewRuleStyle, o as isWildcard, h as nonexhaustive, L as whereOperatorAsPredicate } from './shared/core.zYtlWYjW.mjs';
3
3
  import defu from 'defu';
4
4
 
5
- function r$1(...n){return u$1(Object.values,n)}
5
+ function d$1(...e){return u$2(a,e,o$3)}var a=(e,n)=>e.length<n.length?e.map((t,r)=>[t,n[r]]):n.map((t,r)=>[e[r],t]),o$3=e=>(n,t)=>({hasNext:!0,next:[n,e[t]],done:t>=e.length-1});
6
6
 
7
- function i$2(...e){return u$1(r,e)}var r=(e,t)=>e.length>=t;
7
+ var s={done:!1,hasNext:!1};
8
+
9
+ function x(t,...o){let n=t,u=o.map(e=>"lazy"in e?f(e):void 0),p=0;for(;p<o.length;){if(u[p]===void 0||!B(n)){let i=o[p];n=i(n),p+=1;continue}let r=[];for(let i=p;i<o.length;i++){let l=u[i];if(l===void 0||(r.push(l),l.isSingle))break}let a=[];for(let i of n)if(A(i,a,r))break;let{isSingle:y}=r.at(-1);n=y?a[0]:a,p+=r.length;}return n}function A(t,o,n){if(n.length===0)return o.push(t),!1;let u=t,p=s,e=!1;for(let[r,a]of n.entries()){let{index:y,items:i}=a;if(i.push(u),p=a(u,y,i),a.index+=1,p.hasNext){if(p.hasMany??!1){for(let l of p.next)if(A(l,o,n.slice(r+1)))return !0;return e}u=p.next;}if(!p.hasNext)break;p.done&&(e=!0);}return p.hasNext&&o.push(u),e}function f(t){let{lazy:o,lazyArgs:n}=t,u=o(...n);return Object.assign(u,{isSingle:o.single??!1,index:0,items:[]})}function B(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}
10
+
11
+ function r$1(...n){return u$2(Object.values,n)}
12
+
13
+ function i$3(...e){return u$2(r,e)}var r=(e,t)=>e.length>=t;
14
+
15
+ function u$1(...e){return u$2(i$2,e)}function i$2(e,a){let n=[];for(let[o,r]of e.entries()){if(!a(r,o,e))break;n.push(r);}return n}
8
16
 
9
17
  function o$2(r,n){let e=Math.ceil(r),t=Math.floor(n);if(t<e)throw new RangeError(`randomInteger: The range [${r.toString()},${n.toString()}] contains no integer`);return Math.floor(Math.random()*(t-e+1)+e)}
10
18
 
11
- function i$1(...e){return u$1(u,e)}function u(e,o){let t={};for(let[r,n]of Object.entries(e))o(n,r,e)&&(t[r]=n);return t}
19
+ function i$1(...e){return u$2(u,e)}function u(e,o){let t={};for(let[r,n]of Object.entries(e))o(n,r,e)&&(t[r]=n);return t}
12
20
 
13
- function m(...a){return u$1(o$1,a,p)}var o$1=(a,e)=>a.map(e),p=a=>(e,r,t)=>({done:!1,hasNext:!0,next:a(e,r,t)});
21
+ function m(...a){return u$2(o$1,a,p)}var o$1=(a,e)=>a.map(e),p=a=>(e,r,t)=>({done:!1,hasNext:!0,next:a(e,r,t)});
14
22
 
15
- function l$1(...n){return u$1(d,n)}function d(n,o){let e={};for(let[a,t]of n.entries()){let[y,u]=o(t,a,n);e[y]=u;}return e}
23
+ function l$1(...n){return u$2(d,n)}function d(n,o){let e={};for(let[a,t]of n.entries()){let[y,u]=o(t,a,n);e[y]=u;}return e}
16
24
 
17
- function i(...e){return u$1(o,e)}function o(e,u){let a={};for(let[n,r]of Object.entries(e)){let l=u(r,n,e);a[n]=l;}return a}
25
+ function i(...e){return u$2(o,e)}function o(e,u){let a={};for(let[n,r]of Object.entries(e)){let l=u(r,n,e);a[n]=l;}return a}
18
26
 
19
27
  function t$1(r){return typeof r=="string"}
20
28
 
@@ -24,7 +32,7 @@ function t(n){return typeof n=="function"}
24
32
 
25
33
  function l(n){return n!=null}
26
34
 
27
- function n(...r){return u$1(Object.fromEntries,r)}
35
+ function n(...r){return u$2(Object.fromEntries,r)}
28
36
 
29
37
  function getDefaultExportFromCjs (x) {
30
38
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
@@ -406,7 +414,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
406
414
  }
407
415
  });
408
416
  const mapLinks = (links) => {
409
- if (!links || !i$2(links, 1)) {
417
+ if (!links || !i$3(links, 1)) {
410
418
  return null;
411
419
  }
412
420
  return m(links, (l) => typeof l === "string" ? { url: l } : l);
@@ -5281,6 +5289,18 @@ class LikeC4Model {
5281
5289
  LikeC4Model2.ElementModel = ElementModel;
5282
5290
  })(LikeC4Model || (LikeC4Model = {}));
5283
5291
 
5292
+ function commonHead(sources, targets, equals) {
5293
+ if (sources.length === 0 || targets.length === 0) {
5294
+ return [];
5295
+ }
5296
+ equals ??= Object.is;
5297
+ return x(
5298
+ d$1(sources, targets),
5299
+ u$1(([source, target]) => equals(source, target)),
5300
+ m(([source, _]) => source)
5301
+ );
5302
+ }
5303
+
5284
5304
  const DELAY = "LIKEC4_DELAY";
5285
5305
  function delay(...args) {
5286
5306
  let ms = 100;
@@ -5316,4 +5336,4 @@ const compareRelations = (a, b) => {
5316
5336
  return compareFqnHierarchically(a.target, b.target);
5317
5337
  };
5318
5338
 
5319
- export { Builder, DefaultElementShape, DefaultRelationshipColor, DefaultThemeColor, ElementColors, LikeC4DiagramModel, LikeC4Model, LikeC4ViewModel, RelationshipColors, ancestorsFqn, commonAncestor, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareRelations, computeColorValues, defaultTheme, delay, i$2 as hasAtLeast, invariant, isAncestor, isDescendantOf, isElementPredicateExpr, isNonEmptyArray, isSameHierarchy, isScopedElementView, isString, nameFromFqn, nonNullable, notDescendantOf, parentFqn, parentFqnPredicate, sortByFqnHierarchically, sortNaturalByFqn };
5339
+ export { Builder, DefaultElementShape, DefaultRelationshipColor, DefaultThemeColor, ElementColors, LikeC4DiagramModel, LikeC4Model, LikeC4ViewModel, RelationshipColors, ancestorsFqn, commonAncestor, commonHead, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareRelations, computeColorValues, defaultTheme, delay, i$3 as hasAtLeast, invariant, isAncestor, isDescendantOf, isElementPredicateExpr, isNonEmptyArray, isSameHierarchy, isScopedElementView, isString, nameFromFqn, nonNullable, notDescendantOf, parentFqn, parentFqnPredicate, sortByFqnHierarchically, sortNaturalByFqn };
@@ -49,6 +49,9 @@ declare function AsFqn(name: string, parent?: Fqn | null): Fqn;
49
49
  declare const BorderStyles: readonly ["solid", "dashed", "dotted", "none"];
50
50
  type BorderStyle = TupleToUnion<typeof BorderStyles>;
51
51
  type ElementKind<Kinds extends string = string> = Tagged<Kinds, 'ElementKind'>;
52
+ declare namespace ElementKind {
53
+ const Group: ElementKind;
54
+ }
52
55
  declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile", "cylinder", "storage", "queue"];
53
56
  type ElementShape = TupleToUnion<typeof ElementShapes>;
54
57
  declare const DefaultThemeColor = "primary";
@@ -139,6 +142,12 @@ type Filterable<FTag extends string = string, FKind extends string = string> = {
139
142
  type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
140
143
  declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
141
144
 
145
+ type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
146
+ interface GlobalStyle {
147
+ readonly id: GlobalStyleID;
148
+ readonly styles: NonEmptyArray<ViewRuleStyle>;
149
+ }
150
+
142
151
  type ElementNotation = {
143
152
  kinds: ElementKind[];
144
153
  shape: ElementShape;
@@ -146,12 +155,6 @@ type ElementNotation = {
146
155
  title: string;
147
156
  };
148
157
 
149
- type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
150
- interface GlobalStyle {
151
- readonly id: GlobalStyleID;
152
- readonly styles: NonEmptyArray<ViewRuleStyle>;
153
- }
154
-
155
158
  type ViewID<Id extends string = string> = Tagged<Id, 'ViewID'>;
156
159
  type ViewRulePredicate = {
157
160
  include: Expression[];
@@ -175,6 +178,7 @@ interface ViewRuleGlobalStyle {
175
178
  styleId: GlobalStyleID;
176
179
  }
177
180
  declare function isViewRuleGlobalStyle(rule: ViewRule): rule is ViewRuleGlobalStyle;
181
+ type ViewRuleStyleOrGlobalRef = ViewRuleStyle | ViewRuleGlobalStyle;
178
182
  type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
179
183
  declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
180
184
  interface ViewRuleAutoLayout {
@@ -183,7 +187,15 @@ interface ViewRuleAutoLayout {
183
187
  rankSep?: number;
184
188
  }
185
189
  declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
186
- type ViewRule = ViewRulePredicate | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
190
+ interface ViewRuleGroup {
191
+ groupRules: Array<ViewRulePredicate | ViewRuleGroup>;
192
+ title: string | null;
193
+ color?: Color;
194
+ border?: BorderStyle;
195
+ opacity?: number;
196
+ }
197
+ declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
198
+ type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
187
199
  interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
188
200
  readonly __?: ViewType;
189
201
  readonly id: ViewID<ViewIDs>;
@@ -300,6 +312,12 @@ interface ComputedNode {
300
312
  */
301
313
  isCustomized?: boolean;
302
314
  }
315
+ declare namespace ComputedNode {
316
+ /**
317
+ * Nodes group is a special kind of node, exisiting only in view
318
+ */
319
+ function isNodesGroup(node: ComputedNode): boolean;
320
+ }
303
321
  interface ComputedEdge {
304
322
  id: EdgeId;
305
323
  parent: NodeId | null;
@@ -377,6 +395,12 @@ interface DiagramNode extends ComputedNode {
377
395
  position: Point;
378
396
  labelBBox: BBox;
379
397
  }
398
+ declare namespace DiagramNode {
399
+ /**
400
+ * Nodes group is a special kind of node, exisiting only in view
401
+ */
402
+ function isNodesGroup(node: DiagramNode): boolean;
403
+ }
380
404
  interface DiagramEdge extends ComputedEdge {
381
405
  points: NonEmptyArray<Point>;
382
406
  controlPoints?: NonEmptyArray<XYPoint>;
@@ -700,4 +724,4 @@ declare namespace ViewChange {
700
724
  }
701
725
  type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
702
726
 
703
- export { type ExpandedElementExpr as $, type AutoLayoutDirection as A, type BorderStyle as B, type Color as C, type DiagramView as D, type ElementKindSpecification as E, type Fqn as F, AsFqn as G, type HexColorLiteral as H, type IconUrl as I, BorderStyles as J, ElementShapes as K, type LikeC4View as L, DefaultThemeColor as M, type NonEmptyArray as N, DefaultElementShape as O, type ParsedLikeC4Model as P, type ElementStyle as Q, type RelationshipKindSpecification as R, type TagSpec as S, type ThemeColorValues as T, type Link as U, type ViewRuleStyle as V, type TypedElement as W, type XYPoint as X, type ElementKindSpecificationStyle as Y, type ElementRefExpr as Z, isElementRef as _, type ElementShape as a, isViewRuleAutoLayout as a$, isExpandedElementExpr as a0, isCustomElement as a1, type WildcardExpr as a2, isWildcard as a3, type ElementKindExpr as a4, isElementKindExpr as a5, type ElementTagExpr as a6, isElementTagExpr as a7, type ElementExpression as a8, isElement as a9, type NotOperator as aA, isNotOperator as aB, type AndOperator as aC, isAndOperator as aD, type OrOperator as aE, isOrOperator as aF, type WhereOperator as aG, whereOperatorAsPredicate as aH, OverviewGraph as aI, DefaultLineStyle as aJ, DefaultArrowType as aK, DefaultRelationshipColor as aL, type ThemeColor as aM, type ColorLiteral as aN, isThemeColor as aO, type ElementThemeColorValues as aP, type ElementThemeColors as aQ, type RelationshipThemeColorValues as aR, type RelationshipThemeColors as aS, type LikeC4Theme as aT, type ViewRulePredicate as aU, isViewRulePredicate as aV, isViewRuleStyle as aW, type ViewRuleGlobalStyle as aX, isViewRuleGlobalStyle as aY, isAutoLayoutDirection as aZ, type ViewRuleAutoLayout as a_, type ElementWhereExpr as aa, isElementWhere as ab, type ElementPredicateExpression as ac, isElementPredicateExpr as ad, type RelationExpr as ae, isRelation as af, type InOutExpr as ag, isInOut as ah, type IncomingExpr as ai, isIncoming as aj, type OutgoingExpr as ak, isOutgoing as al, type RelationExpression as am, isRelationExpression as an, type RelationWhereExpr as ao, isRelationWhere as ap, isCustomRelationExpr as aq, type RelationPredicateExpression as ar, isRelationPredicateExpr as as, type GlobalStyleID as at, type GlobalStyle as au, type EqualOperator as av, type TagEqual as aw, isTagEqual as ax, type KindEqual as ay, isKindEqual as az, type RelationshipArrowType as b, type ViewRule as b0, type BasicView as b1, type BasicElementView as b2, type ScopedElementView as b3, type ExtendsElementView as b4, type ElementView as b5, type DynamicViewStep as b6, type DynamicViewParallelSteps as b7, type DynamicViewStepOrParallel as b8, type DynamicViewIncludeRule as b9, isDynamicViewIncludeRule as ba, type DynamicViewRule as bb, type DynamicView as bc, isDynamicViewParallelSteps as bd, type CustomColorDefinitions as be, isDynamicView as bf, isElementView as bg, isExtendsElementView as bh, isScopedElementView as bi, type StepEdgeIdLiteral as bj, StepEdgeId as bk, isStepEdgeId as bl, extractStep as bm, getParallelStepsPrefix as bn, type ViewWithHash as bo, type ViewWithNotation as bp, type ViewAutoLayout as bq, type ComputedElementView as br, type ComputedDynamicView as bs, isComputedDynamicView as bt, isComputedElementView as bu, type BBox as bv, getBBoxCenter as bw, type ViewManualLayout as bx, ViewChange as by, type ElementNotation as bz, type RelationshipLineType as c, type Element as d, type Relation as e, type Expression as f, type CustomElementExpr as g, type CustomRelationExpr as h, type RelationID as i, type ViewID as j, type EdgeId as k, type ComputedView as l, type Tag as m, type ComputedNode as n, type NodeId as o, type ElementKind as p, type ComputedEdge as q, type ComputedLikeC4Model as r, type LayoutedLikeC4Model as s, type RelationshipKind as t, type DiagramNode as u, type DiagramEdge as v, expression as w, type NonEmptyReadonlyArray as x, type CustomColor as y, type Point as z };
727
+ export { type ExpandedElementExpr as $, type AutoLayoutDirection as A, type BorderStyle as B, type Color as C, type DiagramView as D, type ElementKindSpecification as E, type Fqn as F, AsFqn as G, type HexColorLiteral as H, type IconUrl as I, BorderStyles as J, ElementShapes as K, type LikeC4View as L, DefaultThemeColor as M, type NonEmptyArray as N, DefaultElementShape as O, type ParsedLikeC4Model as P, type ElementStyle as Q, type RelationshipKindSpecification as R, type TagSpec as S, type ThemeColorValues as T, type Link as U, type ViewRuleStyle as V, type TypedElement as W, type XYPoint as X, type ElementKindSpecificationStyle as Y, type ElementRefExpr as Z, isElementRef as _, type ElementShape as a, isAutoLayoutDirection as a$, isExpandedElementExpr as a0, isCustomElement as a1, type WildcardExpr as a2, isWildcard as a3, type ElementKindExpr as a4, isElementKindExpr as a5, type ElementTagExpr as a6, isElementTagExpr as a7, type ElementExpression as a8, isElement as a9, type NotOperator as aA, isNotOperator as aB, type AndOperator as aC, isAndOperator as aD, type OrOperator as aE, isOrOperator as aF, type WhereOperator as aG, type Filterable as aH, whereOperatorAsPredicate as aI, OverviewGraph as aJ, DefaultLineStyle as aK, DefaultArrowType as aL, DefaultRelationshipColor as aM, type ThemeColor as aN, type ColorLiteral as aO, isThemeColor as aP, type ElementThemeColorValues as aQ, type ElementThemeColors as aR, type RelationshipThemeColorValues as aS, type RelationshipThemeColors as aT, type LikeC4Theme as aU, type ViewRulePredicate as aV, isViewRulePredicate as aW, isViewRuleStyle as aX, type ViewRuleGlobalStyle as aY, isViewRuleGlobalStyle as aZ, type ViewRuleStyleOrGlobalRef as a_, type ElementWhereExpr as aa, isElementWhere as ab, type ElementPredicateExpression as ac, isElementPredicateExpr as ad, type RelationExpr as ae, isRelation as af, type InOutExpr as ag, isInOut as ah, type IncomingExpr as ai, isIncoming as aj, type OutgoingExpr as ak, isOutgoing as al, type RelationExpression as am, isRelationExpression as an, type RelationWhereExpr as ao, isRelationWhere as ap, isCustomRelationExpr as aq, type RelationPredicateExpression as ar, isRelationPredicateExpr as as, type GlobalStyleID as at, type GlobalStyle as au, type EqualOperator as av, type TagEqual as aw, isTagEqual as ax, type KindEqual as ay, isKindEqual as az, type RelationshipArrowType as b, type ViewRuleAutoLayout as b0, isViewRuleAutoLayout as b1, type ViewRuleGroup as b2, isViewRuleGroup as b3, type ViewRule as b4, type BasicView as b5, type BasicElementView as b6, type ScopedElementView as b7, type ExtendsElementView as b8, type ElementView as b9, getBBoxCenter as bA, type ViewManualLayout as bB, ViewChange as bC, type ElementNotation as bD, type DynamicViewStep as ba, type DynamicViewParallelSteps as bb, type DynamicViewStepOrParallel as bc, type DynamicViewIncludeRule as bd, isDynamicViewIncludeRule as be, type DynamicViewRule as bf, type DynamicView as bg, isDynamicViewParallelSteps as bh, type CustomColorDefinitions as bi, isDynamicView as bj, isElementView as bk, isExtendsElementView as bl, isScopedElementView as bm, type StepEdgeIdLiteral as bn, StepEdgeId as bo, isStepEdgeId as bp, extractStep as bq, getParallelStepsPrefix as br, type ViewWithHash as bs, type ViewWithNotation as bt, type ViewAutoLayout as bu, type ComputedElementView as bv, type ComputedDynamicView as bw, isComputedDynamicView as bx, isComputedElementView as by, type BBox as bz, type RelationshipLineType as c, type Element as d, type Relation as e, type Expression as f, type CustomElementExpr as g, type CustomRelationExpr as h, type RelationID as i, type ViewID as j, type EdgeId as k, type ComputedView as l, type Tag as m, ComputedNode as n, type NodeId as o, ElementKind as p, type ComputedEdge as q, type ComputedLikeC4Model as r, type LayoutedLikeC4Model as s, type RelationshipKind as t, DiagramNode as u, type DiagramEdge as v, expression as w, type NonEmptyReadonlyArray as x, type CustomColor as y, type Point as z };
@@ -49,6 +49,9 @@ declare function AsFqn(name: string, parent?: Fqn | null): Fqn;
49
49
  declare const BorderStyles: readonly ["solid", "dashed", "dotted", "none"];
50
50
  type BorderStyle = TupleToUnion<typeof BorderStyles>;
51
51
  type ElementKind<Kinds extends string = string> = Tagged<Kinds, 'ElementKind'>;
52
+ declare namespace ElementKind {
53
+ const Group: ElementKind;
54
+ }
52
55
  declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile", "cylinder", "storage", "queue"];
53
56
  type ElementShape = TupleToUnion<typeof ElementShapes>;
54
57
  declare const DefaultThemeColor = "primary";
@@ -139,6 +142,12 @@ type Filterable<FTag extends string = string, FKind extends string = string> = {
139
142
  type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
140
143
  declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
141
144
 
145
+ type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
146
+ interface GlobalStyle {
147
+ readonly id: GlobalStyleID;
148
+ readonly styles: NonEmptyArray<ViewRuleStyle>;
149
+ }
150
+
142
151
  type ElementNotation = {
143
152
  kinds: ElementKind[];
144
153
  shape: ElementShape;
@@ -146,12 +155,6 @@ type ElementNotation = {
146
155
  title: string;
147
156
  };
148
157
 
149
- type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
150
- interface GlobalStyle {
151
- readonly id: GlobalStyleID;
152
- readonly styles: NonEmptyArray<ViewRuleStyle>;
153
- }
154
-
155
158
  type ViewID<Id extends string = string> = Tagged<Id, 'ViewID'>;
156
159
  type ViewRulePredicate = {
157
160
  include: Expression[];
@@ -175,6 +178,7 @@ interface ViewRuleGlobalStyle {
175
178
  styleId: GlobalStyleID;
176
179
  }
177
180
  declare function isViewRuleGlobalStyle(rule: ViewRule): rule is ViewRuleGlobalStyle;
181
+ type ViewRuleStyleOrGlobalRef = ViewRuleStyle | ViewRuleGlobalStyle;
178
182
  type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
179
183
  declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
180
184
  interface ViewRuleAutoLayout {
@@ -183,7 +187,15 @@ interface ViewRuleAutoLayout {
183
187
  rankSep?: number;
184
188
  }
185
189
  declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
186
- type ViewRule = ViewRulePredicate | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
190
+ interface ViewRuleGroup {
191
+ groupRules: Array<ViewRulePredicate | ViewRuleGroup>;
192
+ title: string | null;
193
+ color?: Color;
194
+ border?: BorderStyle;
195
+ opacity?: number;
196
+ }
197
+ declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
198
+ type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
187
199
  interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
188
200
  readonly __?: ViewType;
189
201
  readonly id: ViewID<ViewIDs>;
@@ -300,6 +312,12 @@ interface ComputedNode {
300
312
  */
301
313
  isCustomized?: boolean;
302
314
  }
315
+ declare namespace ComputedNode {
316
+ /**
317
+ * Nodes group is a special kind of node, exisiting only in view
318
+ */
319
+ function isNodesGroup(node: ComputedNode): boolean;
320
+ }
303
321
  interface ComputedEdge {
304
322
  id: EdgeId;
305
323
  parent: NodeId | null;
@@ -377,6 +395,12 @@ interface DiagramNode extends ComputedNode {
377
395
  position: Point;
378
396
  labelBBox: BBox;
379
397
  }
398
+ declare namespace DiagramNode {
399
+ /**
400
+ * Nodes group is a special kind of node, exisiting only in view
401
+ */
402
+ function isNodesGroup(node: DiagramNode): boolean;
403
+ }
380
404
  interface DiagramEdge extends ComputedEdge {
381
405
  points: NonEmptyArray<Point>;
382
406
  controlPoints?: NonEmptyArray<XYPoint>;
@@ -700,4 +724,4 @@ declare namespace ViewChange {
700
724
  }
701
725
  type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
702
726
 
703
- export { type ExpandedElementExpr as $, type AutoLayoutDirection as A, type BorderStyle as B, type Color as C, type DiagramView as D, type ElementKindSpecification as E, type Fqn as F, AsFqn as G, type HexColorLiteral as H, type IconUrl as I, BorderStyles as J, ElementShapes as K, type LikeC4View as L, DefaultThemeColor as M, type NonEmptyArray as N, DefaultElementShape as O, type ParsedLikeC4Model as P, type ElementStyle as Q, type RelationshipKindSpecification as R, type TagSpec as S, type ThemeColorValues as T, type Link as U, type ViewRuleStyle as V, type TypedElement as W, type XYPoint as X, type ElementKindSpecificationStyle as Y, type ElementRefExpr as Z, isElementRef as _, type ElementShape as a, isViewRuleAutoLayout as a$, isExpandedElementExpr as a0, isCustomElement as a1, type WildcardExpr as a2, isWildcard as a3, type ElementKindExpr as a4, isElementKindExpr as a5, type ElementTagExpr as a6, isElementTagExpr as a7, type ElementExpression as a8, isElement as a9, type NotOperator as aA, isNotOperator as aB, type AndOperator as aC, isAndOperator as aD, type OrOperator as aE, isOrOperator as aF, type WhereOperator as aG, whereOperatorAsPredicate as aH, OverviewGraph as aI, DefaultLineStyle as aJ, DefaultArrowType as aK, DefaultRelationshipColor as aL, type ThemeColor as aM, type ColorLiteral as aN, isThemeColor as aO, type ElementThemeColorValues as aP, type ElementThemeColors as aQ, type RelationshipThemeColorValues as aR, type RelationshipThemeColors as aS, type LikeC4Theme as aT, type ViewRulePredicate as aU, isViewRulePredicate as aV, isViewRuleStyle as aW, type ViewRuleGlobalStyle as aX, isViewRuleGlobalStyle as aY, isAutoLayoutDirection as aZ, type ViewRuleAutoLayout as a_, type ElementWhereExpr as aa, isElementWhere as ab, type ElementPredicateExpression as ac, isElementPredicateExpr as ad, type RelationExpr as ae, isRelation as af, type InOutExpr as ag, isInOut as ah, type IncomingExpr as ai, isIncoming as aj, type OutgoingExpr as ak, isOutgoing as al, type RelationExpression as am, isRelationExpression as an, type RelationWhereExpr as ao, isRelationWhere as ap, isCustomRelationExpr as aq, type RelationPredicateExpression as ar, isRelationPredicateExpr as as, type GlobalStyleID as at, type GlobalStyle as au, type EqualOperator as av, type TagEqual as aw, isTagEqual as ax, type KindEqual as ay, isKindEqual as az, type RelationshipArrowType as b, type ViewRule as b0, type BasicView as b1, type BasicElementView as b2, type ScopedElementView as b3, type ExtendsElementView as b4, type ElementView as b5, type DynamicViewStep as b6, type DynamicViewParallelSteps as b7, type DynamicViewStepOrParallel as b8, type DynamicViewIncludeRule as b9, isDynamicViewIncludeRule as ba, type DynamicViewRule as bb, type DynamicView as bc, isDynamicViewParallelSteps as bd, type CustomColorDefinitions as be, isDynamicView as bf, isElementView as bg, isExtendsElementView as bh, isScopedElementView as bi, type StepEdgeIdLiteral as bj, StepEdgeId as bk, isStepEdgeId as bl, extractStep as bm, getParallelStepsPrefix as bn, type ViewWithHash as bo, type ViewWithNotation as bp, type ViewAutoLayout as bq, type ComputedElementView as br, type ComputedDynamicView as bs, isComputedDynamicView as bt, isComputedElementView as bu, type BBox as bv, getBBoxCenter as bw, type ViewManualLayout as bx, ViewChange as by, type ElementNotation as bz, type RelationshipLineType as c, type Element as d, type Relation as e, type Expression as f, type CustomElementExpr as g, type CustomRelationExpr as h, type RelationID as i, type ViewID as j, type EdgeId as k, type ComputedView as l, type Tag as m, type ComputedNode as n, type NodeId as o, type ElementKind as p, type ComputedEdge as q, type ComputedLikeC4Model as r, type LayoutedLikeC4Model as s, type RelationshipKind as t, type DiagramNode as u, type DiagramEdge as v, expression as w, type NonEmptyReadonlyArray as x, type CustomColor as y, type Point as z };
727
+ export { type ExpandedElementExpr as $, type AutoLayoutDirection as A, type BorderStyle as B, type Color as C, type DiagramView as D, type ElementKindSpecification as E, type Fqn as F, AsFqn as G, type HexColorLiteral as H, type IconUrl as I, BorderStyles as J, ElementShapes as K, type LikeC4View as L, DefaultThemeColor as M, type NonEmptyArray as N, DefaultElementShape as O, type ParsedLikeC4Model as P, type ElementStyle as Q, type RelationshipKindSpecification as R, type TagSpec as S, type ThemeColorValues as T, type Link as U, type ViewRuleStyle as V, type TypedElement as W, type XYPoint as X, type ElementKindSpecificationStyle as Y, type ElementRefExpr as Z, isElementRef as _, type ElementShape as a, isAutoLayoutDirection as a$, isExpandedElementExpr as a0, isCustomElement as a1, type WildcardExpr as a2, isWildcard as a3, type ElementKindExpr as a4, isElementKindExpr as a5, type ElementTagExpr as a6, isElementTagExpr as a7, type ElementExpression as a8, isElement as a9, type NotOperator as aA, isNotOperator as aB, type AndOperator as aC, isAndOperator as aD, type OrOperator as aE, isOrOperator as aF, type WhereOperator as aG, type Filterable as aH, whereOperatorAsPredicate as aI, OverviewGraph as aJ, DefaultLineStyle as aK, DefaultArrowType as aL, DefaultRelationshipColor as aM, type ThemeColor as aN, type ColorLiteral as aO, isThemeColor as aP, type ElementThemeColorValues as aQ, type ElementThemeColors as aR, type RelationshipThemeColorValues as aS, type RelationshipThemeColors as aT, type LikeC4Theme as aU, type ViewRulePredicate as aV, isViewRulePredicate as aW, isViewRuleStyle as aX, type ViewRuleGlobalStyle as aY, isViewRuleGlobalStyle as aZ, type ViewRuleStyleOrGlobalRef as a_, type ElementWhereExpr as aa, isElementWhere as ab, type ElementPredicateExpression as ac, isElementPredicateExpr as ad, type RelationExpr as ae, isRelation as af, type InOutExpr as ag, isInOut as ah, type IncomingExpr as ai, isIncoming as aj, type OutgoingExpr as ak, isOutgoing as al, type RelationExpression as am, isRelationExpression as an, type RelationWhereExpr as ao, isRelationWhere as ap, isCustomRelationExpr as aq, type RelationPredicateExpression as ar, isRelationPredicateExpr as as, type GlobalStyleID as at, type GlobalStyle as au, type EqualOperator as av, type TagEqual as aw, isTagEqual as ax, type KindEqual as ay, isKindEqual as az, type RelationshipArrowType as b, type ViewRuleAutoLayout as b0, isViewRuleAutoLayout as b1, type ViewRuleGroup as b2, isViewRuleGroup as b3, type ViewRule as b4, type BasicView as b5, type BasicElementView as b6, type ScopedElementView as b7, type ExtendsElementView as b8, type ElementView as b9, getBBoxCenter as bA, type ViewManualLayout as bB, ViewChange as bC, type ElementNotation as bD, type DynamicViewStep as ba, type DynamicViewParallelSteps as bb, type DynamicViewStepOrParallel as bc, type DynamicViewIncludeRule as bd, isDynamicViewIncludeRule as be, type DynamicViewRule as bf, type DynamicView as bg, isDynamicViewParallelSteps as bh, type CustomColorDefinitions as bi, isDynamicView as bj, isElementView as bk, isExtendsElementView as bl, isScopedElementView as bm, type StepEdgeIdLiteral as bn, StepEdgeId as bo, isStepEdgeId as bp, extractStep as bq, getParallelStepsPrefix as br, type ViewWithHash as bs, type ViewWithNotation as bt, type ViewAutoLayout as bu, type ComputedElementView as bv, type ComputedDynamicView as bw, isComputedDynamicView as bx, isComputedElementView as by, type BBox as bz, type RelationshipLineType as c, type Element as d, type Relation as e, type Expression as f, type CustomElementExpr as g, type CustomRelationExpr as h, type RelationID as i, type ViewID as j, type EdgeId as k, type ComputedView as l, type Tag as m, ComputedNode as n, type NodeId as o, ElementKind as p, type ComputedEdge as q, type ComputedLikeC4Model as r, type LayoutedLikeC4Model as s, type RelationshipKind as t, DiagramNode as u, type DiagramEdge as v, expression as w, type NonEmptyReadonlyArray as x, type CustomColor as y, type Point as z };
@@ -49,6 +49,9 @@ declare function AsFqn(name: string, parent?: Fqn | null): Fqn;
49
49
  declare const BorderStyles: readonly ["solid", "dashed", "dotted", "none"];
50
50
  type BorderStyle = TupleToUnion<typeof BorderStyles>;
51
51
  type ElementKind<Kinds extends string = string> = Tagged<Kinds, 'ElementKind'>;
52
+ declare namespace ElementKind {
53
+ const Group: ElementKind;
54
+ }
52
55
  declare const ElementShapes: readonly ["rectangle", "person", "browser", "mobile", "cylinder", "storage", "queue"];
53
56
  type ElementShape = TupleToUnion<typeof ElementShapes>;
54
57
  declare const DefaultThemeColor = "primary";
@@ -139,6 +142,12 @@ type Filterable<FTag extends string = string, FKind extends string = string> = {
139
142
  type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
140
143
  declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
141
144
 
145
+ type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
146
+ interface GlobalStyle {
147
+ readonly id: GlobalStyleID;
148
+ readonly styles: NonEmptyArray<ViewRuleStyle>;
149
+ }
150
+
142
151
  type ElementNotation = {
143
152
  kinds: ElementKind[];
144
153
  shape: ElementShape;
@@ -146,12 +155,6 @@ type ElementNotation = {
146
155
  title: string;
147
156
  };
148
157
 
149
- type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
150
- interface GlobalStyle {
151
- readonly id: GlobalStyleID;
152
- readonly styles: NonEmptyArray<ViewRuleStyle>;
153
- }
154
-
155
158
  type ViewID<Id extends string = string> = Tagged<Id, 'ViewID'>;
156
159
  type ViewRulePredicate = {
157
160
  include: Expression[];
@@ -175,6 +178,7 @@ interface ViewRuleGlobalStyle {
175
178
  styleId: GlobalStyleID;
176
179
  }
177
180
  declare function isViewRuleGlobalStyle(rule: ViewRule): rule is ViewRuleGlobalStyle;
181
+ type ViewRuleStyleOrGlobalRef = ViewRuleStyle | ViewRuleGlobalStyle;
178
182
  type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
179
183
  declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
180
184
  interface ViewRuleAutoLayout {
@@ -183,7 +187,15 @@ interface ViewRuleAutoLayout {
183
187
  rankSep?: number;
184
188
  }
185
189
  declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
186
- type ViewRule = ViewRulePredicate | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
190
+ interface ViewRuleGroup {
191
+ groupRules: Array<ViewRulePredicate | ViewRuleGroup>;
192
+ title: string | null;
193
+ color?: Color;
194
+ border?: BorderStyle;
195
+ opacity?: number;
196
+ }
197
+ declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
198
+ type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
187
199
  interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
188
200
  readonly __?: ViewType;
189
201
  readonly id: ViewID<ViewIDs>;
@@ -300,6 +312,12 @@ interface ComputedNode {
300
312
  */
301
313
  isCustomized?: boolean;
302
314
  }
315
+ declare namespace ComputedNode {
316
+ /**
317
+ * Nodes group is a special kind of node, exisiting only in view
318
+ */
319
+ function isNodesGroup(node: ComputedNode): boolean;
320
+ }
303
321
  interface ComputedEdge {
304
322
  id: EdgeId;
305
323
  parent: NodeId | null;
@@ -377,6 +395,12 @@ interface DiagramNode extends ComputedNode {
377
395
  position: Point;
378
396
  labelBBox: BBox;
379
397
  }
398
+ declare namespace DiagramNode {
399
+ /**
400
+ * Nodes group is a special kind of node, exisiting only in view
401
+ */
402
+ function isNodesGroup(node: DiagramNode): boolean;
403
+ }
380
404
  interface DiagramEdge extends ComputedEdge {
381
405
  points: NonEmptyArray<Point>;
382
406
  controlPoints?: NonEmptyArray<XYPoint>;
@@ -700,4 +724,4 @@ declare namespace ViewChange {
700
724
  }
701
725
  type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
702
726
 
703
- export { type ExpandedElementExpr as $, type AutoLayoutDirection as A, type BorderStyle as B, type Color as C, type DiagramView as D, type ElementKindSpecification as E, type Fqn as F, AsFqn as G, type HexColorLiteral as H, type IconUrl as I, BorderStyles as J, ElementShapes as K, type LikeC4View as L, DefaultThemeColor as M, type NonEmptyArray as N, DefaultElementShape as O, type ParsedLikeC4Model as P, type ElementStyle as Q, type RelationshipKindSpecification as R, type TagSpec as S, type ThemeColorValues as T, type Link as U, type ViewRuleStyle as V, type TypedElement as W, type XYPoint as X, type ElementKindSpecificationStyle as Y, type ElementRefExpr as Z, isElementRef as _, type ElementShape as a, isViewRuleAutoLayout as a$, isExpandedElementExpr as a0, isCustomElement as a1, type WildcardExpr as a2, isWildcard as a3, type ElementKindExpr as a4, isElementKindExpr as a5, type ElementTagExpr as a6, isElementTagExpr as a7, type ElementExpression as a8, isElement as a9, type NotOperator as aA, isNotOperator as aB, type AndOperator as aC, isAndOperator as aD, type OrOperator as aE, isOrOperator as aF, type WhereOperator as aG, whereOperatorAsPredicate as aH, OverviewGraph as aI, DefaultLineStyle as aJ, DefaultArrowType as aK, DefaultRelationshipColor as aL, type ThemeColor as aM, type ColorLiteral as aN, isThemeColor as aO, type ElementThemeColorValues as aP, type ElementThemeColors as aQ, type RelationshipThemeColorValues as aR, type RelationshipThemeColors as aS, type LikeC4Theme as aT, type ViewRulePredicate as aU, isViewRulePredicate as aV, isViewRuleStyle as aW, type ViewRuleGlobalStyle as aX, isViewRuleGlobalStyle as aY, isAutoLayoutDirection as aZ, type ViewRuleAutoLayout as a_, type ElementWhereExpr as aa, isElementWhere as ab, type ElementPredicateExpression as ac, isElementPredicateExpr as ad, type RelationExpr as ae, isRelation as af, type InOutExpr as ag, isInOut as ah, type IncomingExpr as ai, isIncoming as aj, type OutgoingExpr as ak, isOutgoing as al, type RelationExpression as am, isRelationExpression as an, type RelationWhereExpr as ao, isRelationWhere as ap, isCustomRelationExpr as aq, type RelationPredicateExpression as ar, isRelationPredicateExpr as as, type GlobalStyleID as at, type GlobalStyle as au, type EqualOperator as av, type TagEqual as aw, isTagEqual as ax, type KindEqual as ay, isKindEqual as az, type RelationshipArrowType as b, type ViewRule as b0, type BasicView as b1, type BasicElementView as b2, type ScopedElementView as b3, type ExtendsElementView as b4, type ElementView as b5, type DynamicViewStep as b6, type DynamicViewParallelSteps as b7, type DynamicViewStepOrParallel as b8, type DynamicViewIncludeRule as b9, isDynamicViewIncludeRule as ba, type DynamicViewRule as bb, type DynamicView as bc, isDynamicViewParallelSteps as bd, type CustomColorDefinitions as be, isDynamicView as bf, isElementView as bg, isExtendsElementView as bh, isScopedElementView as bi, type StepEdgeIdLiteral as bj, StepEdgeId as bk, isStepEdgeId as bl, extractStep as bm, getParallelStepsPrefix as bn, type ViewWithHash as bo, type ViewWithNotation as bp, type ViewAutoLayout as bq, type ComputedElementView as br, type ComputedDynamicView as bs, isComputedDynamicView as bt, isComputedElementView as bu, type BBox as bv, getBBoxCenter as bw, type ViewManualLayout as bx, ViewChange as by, type ElementNotation as bz, type RelationshipLineType as c, type Element as d, type Relation as e, type Expression as f, type CustomElementExpr as g, type CustomRelationExpr as h, type RelationID as i, type ViewID as j, type EdgeId as k, type ComputedView as l, type Tag as m, type ComputedNode as n, type NodeId as o, type ElementKind as p, type ComputedEdge as q, type ComputedLikeC4Model as r, type LayoutedLikeC4Model as s, type RelationshipKind as t, type DiagramNode as u, type DiagramEdge as v, expression as w, type NonEmptyReadonlyArray as x, type CustomColor as y, type Point as z };
727
+ export { type ExpandedElementExpr as $, type AutoLayoutDirection as A, type BorderStyle as B, type Color as C, type DiagramView as D, type ElementKindSpecification as E, type Fqn as F, AsFqn as G, type HexColorLiteral as H, type IconUrl as I, BorderStyles as J, ElementShapes as K, type LikeC4View as L, DefaultThemeColor as M, type NonEmptyArray as N, DefaultElementShape as O, type ParsedLikeC4Model as P, type ElementStyle as Q, type RelationshipKindSpecification as R, type TagSpec as S, type ThemeColorValues as T, type Link as U, type ViewRuleStyle as V, type TypedElement as W, type XYPoint as X, type ElementKindSpecificationStyle as Y, type ElementRefExpr as Z, isElementRef as _, type ElementShape as a, isAutoLayoutDirection as a$, isExpandedElementExpr as a0, isCustomElement as a1, type WildcardExpr as a2, isWildcard as a3, type ElementKindExpr as a4, isElementKindExpr as a5, type ElementTagExpr as a6, isElementTagExpr as a7, type ElementExpression as a8, isElement as a9, type NotOperator as aA, isNotOperator as aB, type AndOperator as aC, isAndOperator as aD, type OrOperator as aE, isOrOperator as aF, type WhereOperator as aG, type Filterable as aH, whereOperatorAsPredicate as aI, OverviewGraph as aJ, DefaultLineStyle as aK, DefaultArrowType as aL, DefaultRelationshipColor as aM, type ThemeColor as aN, type ColorLiteral as aO, isThemeColor as aP, type ElementThemeColorValues as aQ, type ElementThemeColors as aR, type RelationshipThemeColorValues as aS, type RelationshipThemeColors as aT, type LikeC4Theme as aU, type ViewRulePredicate as aV, isViewRulePredicate as aW, isViewRuleStyle as aX, type ViewRuleGlobalStyle as aY, isViewRuleGlobalStyle as aZ, type ViewRuleStyleOrGlobalRef as a_, type ElementWhereExpr as aa, isElementWhere as ab, type ElementPredicateExpression as ac, isElementPredicateExpr as ad, type RelationExpr as ae, isRelation as af, type InOutExpr as ag, isInOut as ah, type IncomingExpr as ai, isIncoming as aj, type OutgoingExpr as ak, isOutgoing as al, type RelationExpression as am, isRelationExpression as an, type RelationWhereExpr as ao, isRelationWhere as ap, isCustomRelationExpr as aq, type RelationPredicateExpression as ar, isRelationPredicateExpr as as, type GlobalStyleID as at, type GlobalStyle as au, type EqualOperator as av, type TagEqual as aw, isTagEqual as ax, type KindEqual as ay, isKindEqual as az, type RelationshipArrowType as b, type ViewRuleAutoLayout as b0, isViewRuleAutoLayout as b1, type ViewRuleGroup as b2, isViewRuleGroup as b3, type ViewRule as b4, type BasicView as b5, type BasicElementView as b6, type ScopedElementView as b7, type ExtendsElementView as b8, type ElementView as b9, getBBoxCenter as bA, type ViewManualLayout as bB, ViewChange as bC, type ElementNotation as bD, type DynamicViewStep as ba, type DynamicViewParallelSteps as bb, type DynamicViewStepOrParallel as bc, type DynamicViewIncludeRule as bd, isDynamicViewIncludeRule as be, type DynamicViewRule as bf, type DynamicView as bg, isDynamicViewParallelSteps as bh, type CustomColorDefinitions as bi, isDynamicView as bj, isElementView as bk, isExtendsElementView as bl, isScopedElementView as bm, type StepEdgeIdLiteral as bn, StepEdgeId as bo, isStepEdgeId as bp, extractStep as bq, getParallelStepsPrefix as br, type ViewWithHash as bs, type ViewWithNotation as bt, type ViewAutoLayout as bu, type ComputedElementView as bv, type ComputedDynamicView as bw, isComputedDynamicView as bx, isComputedElementView as by, type BBox as bz, type RelationshipLineType as c, type Element as d, type Relation as e, type Expression as f, type CustomElementExpr as g, type CustomRelationExpr as h, type RelationID as i, type ViewID as j, type EdgeId as k, type ComputedView as l, type Tag as m, ComputedNode as n, type NodeId as o, ElementKind as p, type ComputedEdge as q, type ComputedLikeC4Model as r, type LayoutedLikeC4Model as s, type RelationshipKind as t, DiagramNode as u, type DiagramEdge as v, expression as w, type NonEmptyReadonlyArray as x, type CustomColor as y, type Point as z };
@@ -34,6 +34,10 @@ function AsFqn(name, parent) {
34
34
  return parent ? parent + "." + name : name;
35
35
  }
36
36
  const BorderStyles = ["solid", "dashed", "dotted", "none"];
37
+ exports.ElementKind = void 0;
38
+ ((ElementKind2) => {
39
+ ElementKind2.Group = "@group";
40
+ })(exports.ElementKind || (exports.ElementKind = {}));
37
41
  const ElementShapes = [
38
42
  "rectangle",
39
43
  "person",
@@ -213,6 +217,9 @@ function isAutoLayoutDirection(autoLayout) {
213
217
  function isViewRuleAutoLayout(rule) {
214
218
  return "direction" in rule;
215
219
  }
220
+ function isViewRuleGroup(rule) {
221
+ return "title" in rule && "groupRules" in rule && Array.isArray(rule.groupRules);
222
+ }
216
223
  function isDynamicViewIncludeRule(rule) {
217
224
  return "include" in rule && Array.isArray(rule.include);
218
225
  }
@@ -250,6 +257,13 @@ function getParallelStepsPrefix(id) {
250
257
  }
251
258
  return null;
252
259
  }
260
+ exports.ComputedNode = void 0;
261
+ ((ComputedNode2) => {
262
+ function isNodesGroup(node) {
263
+ return node.kind === exports.ElementKind.Group;
264
+ }
265
+ ComputedNode2.isNodesGroup = isNodesGroup;
266
+ })(exports.ComputedNode || (exports.ComputedNode = {}));
253
267
  function isComputedDynamicView(view) {
254
268
  return view.__ === "dynamic";
255
269
  }
@@ -267,6 +281,13 @@ function getBBoxCenter({
267
281
  y: y + height / 2
268
282
  };
269
283
  }
284
+ exports.DiagramNode = void 0;
285
+ ((DiagramNode2) => {
286
+ function isNodesGroup(node) {
287
+ return node.kind === exports.ElementKind.Group;
288
+ }
289
+ DiagramNode2.isNodesGroup = isNodesGroup;
290
+ })(exports.DiagramNode || (exports.DiagramNode = {}));
270
291
 
271
292
  exports.AsFqn = AsFqn;
272
293
  exports.BorderStyles = BorderStyles;
@@ -317,6 +338,7 @@ exports.isTagEqual = isTagEqual;
317
338
  exports.isThemeColor = isThemeColor;
318
339
  exports.isViewRuleAutoLayout = isViewRuleAutoLayout;
319
340
  exports.isViewRuleGlobalStyle = isViewRuleGlobalStyle;
341
+ exports.isViewRuleGroup = isViewRuleGroup;
320
342
  exports.isViewRulePredicate = isViewRulePredicate;
321
343
  exports.isViewRuleStyle = isViewRuleStyle;
322
344
  exports.isWildcard = isWildcard;
@@ -32,6 +32,10 @@ function AsFqn(name, parent) {
32
32
  return parent ? parent + "." + name : name;
33
33
  }
34
34
  const BorderStyles = ["solid", "dashed", "dotted", "none"];
35
+ var ElementKind;
36
+ ((ElementKind2) => {
37
+ ElementKind2.Group = "@group";
38
+ })(ElementKind || (ElementKind = {}));
35
39
  const ElementShapes = [
36
40
  "rectangle",
37
41
  "person",
@@ -211,6 +215,9 @@ function isAutoLayoutDirection(autoLayout) {
211
215
  function isViewRuleAutoLayout(rule) {
212
216
  return "direction" in rule;
213
217
  }
218
+ function isViewRuleGroup(rule) {
219
+ return "title" in rule && "groupRules" in rule && Array.isArray(rule.groupRules);
220
+ }
214
221
  function isDynamicViewIncludeRule(rule) {
215
222
  return "include" in rule && Array.isArray(rule.include);
216
223
  }
@@ -248,6 +255,13 @@ function getParallelStepsPrefix(id) {
248
255
  }
249
256
  return null;
250
257
  }
258
+ var ComputedNode;
259
+ ((ComputedNode2) => {
260
+ function isNodesGroup(node) {
261
+ return node.kind === ElementKind.Group;
262
+ }
263
+ ComputedNode2.isNodesGroup = isNodesGroup;
264
+ })(ComputedNode || (ComputedNode = {}));
251
265
  function isComputedDynamicView(view) {
252
266
  return view.__ === "dynamic";
253
267
  }
@@ -265,5 +279,12 @@ function getBBoxCenter({
265
279
  y: y + height / 2
266
280
  };
267
281
  }
282
+ var DiagramNode;
283
+ ((DiagramNode2) => {
284
+ function isNodesGroup(node) {
285
+ return node.kind === ElementKind.Group;
286
+ }
287
+ DiagramNode2.isNodesGroup = isNodesGroup;
288
+ })(DiagramNode || (DiagramNode = {}));
268
289
 
269
- export { getParallelStepsPrefix as $, AsFqn as A, BorderStyles as B, isRelationPredicateExpr as C, DefaultThemeColor as D, ElementShapes as E, isTagEqual as F, isKindEqual as G, isNotOperator as H, isAndOperator as I, isOrOperator as J, whereOperatorAsPredicate as K, DefaultLineStyle as L, DefaultArrowType as M, isThemeColor as N, isViewRulePredicate as O, isViewRuleStyle as P, isViewRuleGlobalStyle as Q, isAutoLayoutDirection as R, isViewRuleAutoLayout as S, isDynamicViewIncludeRule as T, isDynamicViewParallelSteps as U, isDynamicView as V, isElementView as W, isExtendsElementView as X, StepEdgeId as Y, isStepEdgeId as Z, extractStep as _, invariant as a, isComputedDynamicView as a0, isComputedElementView as a1, getBBoxCenter as a2, isScopedElementView as b, DefaultElementShape as c, nonNullable as d, e$1 as e, DefaultRelationshipColor as f, expression as g, nonexhaustive as h, isElementPredicateExpr as i, isElementRef as j, isExpandedElementExpr as k, isCustomElement as l, isWildcard as m, n, isElementKindExpr as o, isElementTagExpr as p, isElement as q, isElementWhere as r, isRelation as s, isInOut as t, u, isIncoming as v, isOutgoing as w, isRelationExpression as x, isRelationWhere as y, isCustomRelationExpr as z };
290
+ export { isStepEdgeId as $, AsFqn as A, BorderStyles as B, isCustomRelationExpr as C, DefaultThemeColor as D, ElementKind as E, isRelationPredicateExpr as F, isTagEqual as G, isKindEqual as H, isNotOperator as I, isAndOperator as J, isOrOperator as K, whereOperatorAsPredicate as L, DefaultLineStyle as M, DefaultArrowType as N, isThemeColor as O, isViewRulePredicate as P, isViewRuleStyle as Q, isViewRuleGlobalStyle as R, isAutoLayoutDirection as S, isViewRuleAutoLayout as T, isViewRuleGroup as U, isDynamicViewIncludeRule as V, isDynamicViewParallelSteps as W, isDynamicView as X, isElementView as Y, isExtendsElementView as Z, StepEdgeId as _, invariant as a, extractStep as a0, getParallelStepsPrefix as a1, ComputedNode as a2, isComputedDynamicView as a3, isComputedElementView as a4, getBBoxCenter as a5, DiagramNode as a6, isScopedElementView as b, DefaultElementShape as c, nonNullable as d, e$1 as e, DefaultRelationshipColor as f, expression as g, nonexhaustive as h, isElementPredicateExpr as i, ElementShapes as j, isElementRef as k, isExpandedElementExpr as l, isCustomElement as m, n, isWildcard as o, isElementKindExpr as p, isElementTagExpr as q, isElement as r, isElementWhere as s, isRelation as t, u, isInOut as v, isIncoming as w, isOutgoing as x, isRelationExpression as y, isRelationWhere as z };
@@ -1,16 +1,28 @@
1
1
  'use strict';
2
2
 
3
- const types_index = require('../shared/core.DWJhMIfV.cjs');
3
+ const types_index = require('../shared/core.Cq_6j35U.cjs');
4
4
 
5
5
 
6
6
 
7
7
  exports.AsFqn = types_index.AsFqn;
8
8
  exports.BorderStyles = types_index.BorderStyles;
9
+ Object.defineProperty(exports, "ComputedNode", {
10
+ enumerable: true,
11
+ get: function () { return types_index.ComputedNode; }
12
+ });
9
13
  exports.DefaultArrowType = types_index.DefaultArrowType;
10
14
  exports.DefaultElementShape = types_index.DefaultElementShape;
11
15
  exports.DefaultLineStyle = types_index.DefaultLineStyle;
12
16
  exports.DefaultRelationshipColor = types_index.DefaultRelationshipColor;
13
17
  exports.DefaultThemeColor = types_index.DefaultThemeColor;
18
+ Object.defineProperty(exports, "DiagramNode", {
19
+ enumerable: true,
20
+ get: function () { return types_index.DiagramNode; }
21
+ });
22
+ Object.defineProperty(exports, "ElementKind", {
23
+ enumerable: true,
24
+ get: function () { return types_index.ElementKind; }
25
+ });
14
26
  exports.ElementShapes = types_index.ElementShapes;
15
27
  exports.StepEdgeId = types_index.StepEdgeId;
16
28
  exports.extractStep = types_index.extractStep;
@@ -50,6 +62,7 @@ exports.isTagEqual = types_index.isTagEqual;
50
62
  exports.isThemeColor = types_index.isThemeColor;
51
63
  exports.isViewRuleAutoLayout = types_index.isViewRuleAutoLayout;
52
64
  exports.isViewRuleGlobalStyle = types_index.isViewRuleGlobalStyle;
65
+ exports.isViewRuleGroup = types_index.isViewRuleGroup;
53
66
  exports.isViewRulePredicate = types_index.isViewRulePredicate;
54
67
  exports.isViewRuleStyle = types_index.isViewRuleStyle;
55
68
  exports.isWildcard = types_index.isWildcard;
@@ -1,2 +1,2 @@
1
- export { aC as AndOperator, G as AsFqn, A as AutoLayoutDirection, bv as BBox, b2 as BasicElementView, b1 as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aN as ColorLiteral, bs as ComputedDynamicView, q as ComputedEdge, br as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, be as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aK as DefaultArrowType, O as DefaultElementShape, aJ as DefaultLineStyle, aL as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bc as DynamicView, b9 as DynamicViewIncludeRule, b7 as DynamicViewParallelSteps, bb as DynamicViewRule, b6 as DynamicViewStep, b8 as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bz as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aP as ElementThemeColorValues, aQ as ElementThemeColors, b5 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, f as Expression, b4 as ExtendsElementView, F as Fqn, au as GlobalStyle, at as GlobalStyleID, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, s as LayoutedLikeC4Model, aT as LikeC4Theme, L as LikeC4View, U as Link, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aI as OverviewGraph, P as ParsedLikeC4Model, z as Point, e as Relation, ae as RelationExpr, am as RelationExpression, i as RelationID, ar as RelationPredicateExpression, ao as RelationWhereExpr, b as RelationshipArrowType, t as RelationshipKind, R as RelationshipKindSpecification, c as RelationshipLineType, aR as RelationshipThemeColorValues, aS as RelationshipThemeColors, b3 as ScopedElementView, bk as StepEdgeId, bj as StepEdgeIdLiteral, m as Tag, aw as TagEqual, S as TagSpec, aM as ThemeColor, T as ThemeColorValues, W as TypedElement, bq as ViewAutoLayout, by as ViewChange, j as ViewID, bx as ViewManualLayout, b0 as ViewRule, a_ as ViewRuleAutoLayout, aX as ViewRuleGlobalStyle, aU as ViewRulePredicate, V as ViewRuleStyle, bo as ViewWithHash, bp as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bm as extractStep, bw as getBBoxCenter, bn as getParallelStepsPrefix, aD as isAndOperator, aZ as isAutoLayoutDirection, bt as isComputedDynamicView, bu as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bf as isDynamicView, ba as isDynamicViewIncludeRule, bd as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bg as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bh as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bi as isScopedElementView, bl as isStepEdgeId, ax as isTagEqual, aO as isThemeColor, a$ as isViewRuleAutoLayout, aY as isViewRuleGlobalStyle, aV as isViewRulePredicate, aW as isViewRuleStyle, a3 as isWildcard, aH as whereOperatorAsPredicate } from '../shared/core.zgP5gtDY.cjs';
1
+ export { aC as AndOperator, G as AsFqn, A as AutoLayoutDirection, bz as BBox, b6 as BasicElementView, b5 as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aO as ColorLiteral, bw as ComputedDynamicView, q as ComputedEdge, bv as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, bi as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aL as DefaultArrowType, O as DefaultElementShape, aK as DefaultLineStyle, aM as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bg as DynamicView, bd as DynamicViewIncludeRule, bb as DynamicViewParallelSteps, bf as DynamicViewRule, ba as DynamicViewStep, bc as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bD as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aQ as ElementThemeColorValues, aR as ElementThemeColors, b9 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, f as Expression, b8 as ExtendsElementView, aH as Filterable, F as Fqn, au as GlobalStyle, at as GlobalStyleID, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, s as LayoutedLikeC4Model, aU as LikeC4Theme, L as LikeC4View, U as Link, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aJ as OverviewGraph, P as ParsedLikeC4Model, z as Point, e as Relation, ae as RelationExpr, am as RelationExpression, i as RelationID, ar as RelationPredicateExpression, ao as RelationWhereExpr, b as RelationshipArrowType, t as RelationshipKind, R as RelationshipKindSpecification, c as RelationshipLineType, aS as RelationshipThemeColorValues, aT as RelationshipThemeColors, b7 as ScopedElementView, bo as StepEdgeId, bn as StepEdgeIdLiteral, m as Tag, aw as TagEqual, S as TagSpec, aN as ThemeColor, T as ThemeColorValues, W as TypedElement, bu as ViewAutoLayout, bC as ViewChange, j as ViewID, bB as ViewManualLayout, b4 as ViewRule, b0 as ViewRuleAutoLayout, aY as ViewRuleGlobalStyle, b2 as ViewRuleGroup, aV as ViewRulePredicate, V as ViewRuleStyle, a_ as ViewRuleStyleOrGlobalRef, bs as ViewWithHash, bt as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bq as extractStep, bA as getBBoxCenter, br as getParallelStepsPrefix, aD as isAndOperator, a$ as isAutoLayoutDirection, bx as isComputedDynamicView, by as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bj as isDynamicView, be as isDynamicViewIncludeRule, bh as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bk as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bl as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bm as isScopedElementView, bp as isStepEdgeId, ax as isTagEqual, aP as isThemeColor, b1 as isViewRuleAutoLayout, aZ as isViewRuleGlobalStyle, b3 as isViewRuleGroup, aW as isViewRulePredicate, aX as isViewRuleStyle, a3 as isWildcard, aI as whereOperatorAsPredicate } from '../shared/core.CpdWcGpN.cjs';
2
2
  import 'type-fest';
@@ -1,2 +1,2 @@
1
- export { aC as AndOperator, G as AsFqn, A as AutoLayoutDirection, bv as BBox, b2 as BasicElementView, b1 as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aN as ColorLiteral, bs as ComputedDynamicView, q as ComputedEdge, br as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, be as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aK as DefaultArrowType, O as DefaultElementShape, aJ as DefaultLineStyle, aL as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bc as DynamicView, b9 as DynamicViewIncludeRule, b7 as DynamicViewParallelSteps, bb as DynamicViewRule, b6 as DynamicViewStep, b8 as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bz as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aP as ElementThemeColorValues, aQ as ElementThemeColors, b5 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, f as Expression, b4 as ExtendsElementView, F as Fqn, au as GlobalStyle, at as GlobalStyleID, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, s as LayoutedLikeC4Model, aT as LikeC4Theme, L as LikeC4View, U as Link, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aI as OverviewGraph, P as ParsedLikeC4Model, z as Point, e as Relation, ae as RelationExpr, am as RelationExpression, i as RelationID, ar as RelationPredicateExpression, ao as RelationWhereExpr, b as RelationshipArrowType, t as RelationshipKind, R as RelationshipKindSpecification, c as RelationshipLineType, aR as RelationshipThemeColorValues, aS as RelationshipThemeColors, b3 as ScopedElementView, bk as StepEdgeId, bj as StepEdgeIdLiteral, m as Tag, aw as TagEqual, S as TagSpec, aM as ThemeColor, T as ThemeColorValues, W as TypedElement, bq as ViewAutoLayout, by as ViewChange, j as ViewID, bx as ViewManualLayout, b0 as ViewRule, a_ as ViewRuleAutoLayout, aX as ViewRuleGlobalStyle, aU as ViewRulePredicate, V as ViewRuleStyle, bo as ViewWithHash, bp as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bm as extractStep, bw as getBBoxCenter, bn as getParallelStepsPrefix, aD as isAndOperator, aZ as isAutoLayoutDirection, bt as isComputedDynamicView, bu as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bf as isDynamicView, ba as isDynamicViewIncludeRule, bd as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bg as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bh as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bi as isScopedElementView, bl as isStepEdgeId, ax as isTagEqual, aO as isThemeColor, a$ as isViewRuleAutoLayout, aY as isViewRuleGlobalStyle, aV as isViewRulePredicate, aW as isViewRuleStyle, a3 as isWildcard, aH as whereOperatorAsPredicate } from '../shared/core.zgP5gtDY.mjs';
1
+ export { aC as AndOperator, G as AsFqn, A as AutoLayoutDirection, bz as BBox, b6 as BasicElementView, b5 as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aO as ColorLiteral, bw as ComputedDynamicView, q as ComputedEdge, bv as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, bi as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aL as DefaultArrowType, O as DefaultElementShape, aK as DefaultLineStyle, aM as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bg as DynamicView, bd as DynamicViewIncludeRule, bb as DynamicViewParallelSteps, bf as DynamicViewRule, ba as DynamicViewStep, bc as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bD as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aQ as ElementThemeColorValues, aR as ElementThemeColors, b9 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, f as Expression, b8 as ExtendsElementView, aH as Filterable, F as Fqn, au as GlobalStyle, at as GlobalStyleID, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, s as LayoutedLikeC4Model, aU as LikeC4Theme, L as LikeC4View, U as Link, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aJ as OverviewGraph, P as ParsedLikeC4Model, z as Point, e as Relation, ae as RelationExpr, am as RelationExpression, i as RelationID, ar as RelationPredicateExpression, ao as RelationWhereExpr, b as RelationshipArrowType, t as RelationshipKind, R as RelationshipKindSpecification, c as RelationshipLineType, aS as RelationshipThemeColorValues, aT as RelationshipThemeColors, b7 as ScopedElementView, bo as StepEdgeId, bn as StepEdgeIdLiteral, m as Tag, aw as TagEqual, S as TagSpec, aN as ThemeColor, T as ThemeColorValues, W as TypedElement, bu as ViewAutoLayout, bC as ViewChange, j as ViewID, bB as ViewManualLayout, b4 as ViewRule, b0 as ViewRuleAutoLayout, aY as ViewRuleGlobalStyle, b2 as ViewRuleGroup, aV as ViewRulePredicate, V as ViewRuleStyle, a_ as ViewRuleStyleOrGlobalRef, bs as ViewWithHash, bt as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bq as extractStep, bA as getBBoxCenter, br as getParallelStepsPrefix, aD as isAndOperator, a$ as isAutoLayoutDirection, bx as isComputedDynamicView, by as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bj as isDynamicView, be as isDynamicViewIncludeRule, bh as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bk as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bl as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bm as isScopedElementView, bp as isStepEdgeId, ax as isTagEqual, aP as isThemeColor, b1 as isViewRuleAutoLayout, aZ as isViewRuleGlobalStyle, b3 as isViewRuleGroup, aW as isViewRulePredicate, aX as isViewRuleStyle, a3 as isWildcard, aI as whereOperatorAsPredicate } from '../shared/core.CpdWcGpN.mjs';
2
2
  import 'type-fest';
@@ -1,2 +1,2 @@
1
- export { aC as AndOperator, G as AsFqn, A as AutoLayoutDirection, bv as BBox, b2 as BasicElementView, b1 as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aN as ColorLiteral, bs as ComputedDynamicView, q as ComputedEdge, br as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, be as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aK as DefaultArrowType, O as DefaultElementShape, aJ as DefaultLineStyle, aL as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bc as DynamicView, b9 as DynamicViewIncludeRule, b7 as DynamicViewParallelSteps, bb as DynamicViewRule, b6 as DynamicViewStep, b8 as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bz as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aP as ElementThemeColorValues, aQ as ElementThemeColors, b5 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, f as Expression, b4 as ExtendsElementView, F as Fqn, au as GlobalStyle, at as GlobalStyleID, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, s as LayoutedLikeC4Model, aT as LikeC4Theme, L as LikeC4View, U as Link, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aI as OverviewGraph, P as ParsedLikeC4Model, z as Point, e as Relation, ae as RelationExpr, am as RelationExpression, i as RelationID, ar as RelationPredicateExpression, ao as RelationWhereExpr, b as RelationshipArrowType, t as RelationshipKind, R as RelationshipKindSpecification, c as RelationshipLineType, aR as RelationshipThemeColorValues, aS as RelationshipThemeColors, b3 as ScopedElementView, bk as StepEdgeId, bj as StepEdgeIdLiteral, m as Tag, aw as TagEqual, S as TagSpec, aM as ThemeColor, T as ThemeColorValues, W as TypedElement, bq as ViewAutoLayout, by as ViewChange, j as ViewID, bx as ViewManualLayout, b0 as ViewRule, a_ as ViewRuleAutoLayout, aX as ViewRuleGlobalStyle, aU as ViewRulePredicate, V as ViewRuleStyle, bo as ViewWithHash, bp as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bm as extractStep, bw as getBBoxCenter, bn as getParallelStepsPrefix, aD as isAndOperator, aZ as isAutoLayoutDirection, bt as isComputedDynamicView, bu as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bf as isDynamicView, ba as isDynamicViewIncludeRule, bd as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bg as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bh as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bi as isScopedElementView, bl as isStepEdgeId, ax as isTagEqual, aO as isThemeColor, a$ as isViewRuleAutoLayout, aY as isViewRuleGlobalStyle, aV as isViewRulePredicate, aW as isViewRuleStyle, a3 as isWildcard, aH as whereOperatorAsPredicate } from '../shared/core.zgP5gtDY.js';
1
+ export { aC as AndOperator, G as AsFqn, A as AutoLayoutDirection, bz as BBox, b6 as BasicElementView, b5 as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aO as ColorLiteral, bw as ComputedDynamicView, q as ComputedEdge, bv as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, bi as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aL as DefaultArrowType, O as DefaultElementShape, aK as DefaultLineStyle, aM as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bg as DynamicView, bd as DynamicViewIncludeRule, bb as DynamicViewParallelSteps, bf as DynamicViewRule, ba as DynamicViewStep, bc as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bD as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aQ as ElementThemeColorValues, aR as ElementThemeColors, b9 as ElementView, aa as ElementWhereExpr, av as EqualOperator, $ as ExpandedElementExpr, f as Expression, b8 as ExtendsElementView, aH as Filterable, F as Fqn, au as GlobalStyle, at as GlobalStyleID, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, ay as KindEqual, s as LayoutedLikeC4Model, aU as LikeC4Theme, L as LikeC4View, U as Link, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aA as NotOperator, aE as OrOperator, ak as OutgoingExpr, aJ as OverviewGraph, P as ParsedLikeC4Model, z as Point, e as Relation, ae as RelationExpr, am as RelationExpression, i as RelationID, ar as RelationPredicateExpression, ao as RelationWhereExpr, b as RelationshipArrowType, t as RelationshipKind, R as RelationshipKindSpecification, c as RelationshipLineType, aS as RelationshipThemeColorValues, aT as RelationshipThemeColors, b7 as ScopedElementView, bo as StepEdgeId, bn as StepEdgeIdLiteral, m as Tag, aw as TagEqual, S as TagSpec, aN as ThemeColor, T as ThemeColorValues, W as TypedElement, bu as ViewAutoLayout, bC as ViewChange, j as ViewID, bB as ViewManualLayout, b4 as ViewRule, b0 as ViewRuleAutoLayout, aY as ViewRuleGlobalStyle, b2 as ViewRuleGroup, aV as ViewRulePredicate, V as ViewRuleStyle, a_ as ViewRuleStyleOrGlobalRef, bs as ViewWithHash, bt as ViewWithNotation, aG as WhereOperator, a2 as WildcardExpr, X as XYPoint, bq as extractStep, bA as getBBoxCenter, br as getParallelStepsPrefix, aD as isAndOperator, a$ as isAutoLayoutDirection, bx as isComputedDynamicView, by as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bj as isDynamicView, be as isDynamicViewIncludeRule, bh as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bk as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, bl as isExtendsElementView, ah as isInOut, aj as isIncoming, az as isKindEqual, aB as isNotOperator, aF as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bm as isScopedElementView, bp as isStepEdgeId, ax as isTagEqual, aP as isThemeColor, b1 as isViewRuleAutoLayout, aZ as isViewRuleGlobalStyle, b3 as isViewRuleGroup, aW as isViewRulePredicate, aX as isViewRuleStyle, a3 as isWildcard, aI as whereOperatorAsPredicate } from '../shared/core.CpdWcGpN.js';
2
2
  import 'type-fest';
@@ -1 +1 @@
1
- export { A as AsFqn, B as BorderStyles, M as DefaultArrowType, c as DefaultElementShape, L as DefaultLineStyle, f as DefaultRelationshipColor, D as DefaultThemeColor, E as ElementShapes, Y as StepEdgeId, _ as extractStep, a2 as getBBoxCenter, $ as getParallelStepsPrefix, I as isAndOperator, R as isAutoLayoutDirection, a0 as isComputedDynamicView, a1 as isComputedElementView, l as isCustomElement, z as isCustomRelationExpr, V as isDynamicView, T as isDynamicViewIncludeRule, U as isDynamicViewParallelSteps, q as isElement, o as isElementKindExpr, i as isElementPredicateExpr, j as isElementRef, p as isElementTagExpr, W as isElementView, r as isElementWhere, k as isExpandedElementExpr, X as isExtendsElementView, t as isInOut, v as isIncoming, G as isKindEqual, H as isNotOperator, J as isOrOperator, w as isOutgoing, s as isRelation, x as isRelationExpression, C as isRelationPredicateExpr, y as isRelationWhere, b as isScopedElementView, Z as isStepEdgeId, F as isTagEqual, N as isThemeColor, S as isViewRuleAutoLayout, Q as isViewRuleGlobalStyle, O as isViewRulePredicate, P as isViewRuleStyle, m as isWildcard, K as whereOperatorAsPredicate } from '../shared/core.NzRKuMZ7.mjs';
1
+ export { A as AsFqn, B as BorderStyles, a2 as ComputedNode, N as DefaultArrowType, c as DefaultElementShape, M as DefaultLineStyle, f as DefaultRelationshipColor, D as DefaultThemeColor, a6 as DiagramNode, E as ElementKind, j as ElementShapes, _ as StepEdgeId, a0 as extractStep, a5 as getBBoxCenter, a1 as getParallelStepsPrefix, J as isAndOperator, S as isAutoLayoutDirection, a3 as isComputedDynamicView, a4 as isComputedElementView, m as isCustomElement, C as isCustomRelationExpr, X as isDynamicView, V as isDynamicViewIncludeRule, W as isDynamicViewParallelSteps, r as isElement, p as isElementKindExpr, i as isElementPredicateExpr, k as isElementRef, q as isElementTagExpr, Y as isElementView, s as isElementWhere, l as isExpandedElementExpr, Z as isExtendsElementView, v as isInOut, w as isIncoming, H as isKindEqual, I as isNotOperator, K as isOrOperator, x as isOutgoing, t as isRelation, y as isRelationExpression, F as isRelationPredicateExpr, z as isRelationWhere, b as isScopedElementView, $ as isStepEdgeId, G as isTagEqual, O as isThemeColor, T as isViewRuleAutoLayout, R as isViewRuleGlobalStyle, U as isViewRuleGroup, P as isViewRulePredicate, Q as isViewRuleStyle, o as isWildcard, L as whereOperatorAsPredicate } from '../shared/core.zYtlWYjW.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "1.14.0",
3
+ "version": "1.15.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -80,17 +80,17 @@
80
80
  "type-fest": "4.26.1"
81
81
  },
82
82
  "devDependencies": {
83
- "@likec4/tsconfig": "1.14.0",
84
- "@mantine/colors-generator": "^7.13.2",
83
+ "@likec4/tsconfig": "1.15.1",
84
+ "@mantine/colors-generator": "7.13.4",
85
85
  "@types/natural-compare-lite": "^1.4.2",
86
86
  "chroma-js": "^3.1.2",
87
87
  "execa": "^9.3.1",
88
88
  "natural-compare-lite": "^1.4.0",
89
- "remeda": "^2.15.0",
90
- "turbo": "^2.1.3",
89
+ "remeda": "^2.16.0",
90
+ "turbo": "^2.2.3",
91
91
  "typescript": "^5.6.3",
92
92
  "unbuild": "^3.0.0-rc.11",
93
93
  "vitest": "^2.1.3"
94
94
  },
95
- "packageManager": "yarn@4.5.0"
95
+ "packageManager": "yarn@4.5.1"
96
96
  }
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export * from './errors'
6
6
  export * from './model'
7
7
 
8
8
  export * from './types'
9
+ export * from './utils/commonHead'
9
10
  export * from './utils/compare-natural'
10
11
  export * from './utils/fqn'
11
12
  export * from './utils/guards'
@@ -14,6 +14,9 @@ export const BorderStyles = ['solid', 'dashed', 'dotted', 'none'] as const
14
14
  export type BorderStyle = TupleToUnion<typeof BorderStyles>
15
15
 
16
16
  export type ElementKind<Kinds extends string = string> = Tagged<Kinds, 'ElementKind'>
17
+ export namespace ElementKind {
18
+ export const Group = '@group' as ElementKind
19
+ }
17
20
  export const ElementShapes = [
18
21
  'rectangle',
19
22
  'person',
@@ -60,7 +60,7 @@ export type WhereOperator<Tag, Kind> =
60
60
  | AndOperator<Tag, Kind>
61
61
  | OrOperator<Tag, Kind>
62
62
 
63
- type Filterable<
63
+ export type Filterable<
64
64
  FTag extends string = string,
65
65
  FKind extends string = string
66
66
  > = {
package/src/types/view.ts CHANGED
@@ -1,12 +1,20 @@
1
1
  import { isArray, isNullish } from 'remeda'
2
2
  import type { Tagged } from 'type-fest'
3
3
  import type { IconUrl, NonEmptyArray, Point, XYPoint } from './_common'
4
- import type { ElementKind, ElementShape, ElementStyle, Fqn, Link, Tag } from './element'
4
+ import {
5
+ type BorderStyle,
6
+ ElementKind,
7
+ type ElementShape,
8
+ type ElementStyle,
9
+ type Fqn,
10
+ type Link,
11
+ type Tag
12
+ } from './element'
5
13
  import type { ElementExpression, ElementPredicateExpression, Expression } from './expression'
14
+ import type { GlobalStyleID } from './global'
6
15
  import type { RelationID, RelationshipArrowType, RelationshipKind, RelationshipLineType } from './relation'
7
16
  import type { Color, ThemeColorValues } from './theme'
8
17
  import type { ElementNotation } from './view-notation'
9
- import type { GlobalStyleID } from './global'
10
18
 
11
19
  export type ViewID<Id extends string = string> = Tagged<Id, 'ViewID'>
12
20
 
@@ -40,12 +48,14 @@ export function isViewRuleStyle(rule: ViewRule): rule is ViewRuleStyle {
40
48
  }
41
49
 
42
50
  export interface ViewRuleGlobalStyle {
43
- styleId: GlobalStyleID,
51
+ styleId: GlobalStyleID
44
52
  }
45
53
  export function isViewRuleGlobalStyle(rule: ViewRule): rule is ViewRuleGlobalStyle {
46
54
  return 'styleId' in rule
47
55
  }
48
56
 
57
+ export type ViewRuleStyleOrGlobalRef = ViewRuleStyle | ViewRuleGlobalStyle
58
+
49
59
  export type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL'
50
60
  export function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection {
51
61
  return autoLayout === 'TB' || autoLayout === 'BT' || autoLayout === 'LR' || autoLayout === 'RL'
@@ -60,7 +70,20 @@ export function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout
60
70
  return 'direction' in rule
61
71
  }
62
72
 
63
- export type ViewRule = ViewRulePredicate | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout
73
+ export interface ViewRuleGroup {
74
+ groupRules: Array<ViewRulePredicate | ViewRuleGroup>
75
+ title: string | null
76
+ color?: Color
77
+ border?: BorderStyle
78
+ // 0-100
79
+ opacity?: number
80
+ }
81
+
82
+ export function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup {
83
+ return 'title' in rule && 'groupRules' in rule && Array.isArray(rule.groupRules)
84
+ }
85
+
86
+ export type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout
64
87
 
65
88
  export interface BasicView<
66
89
  ViewType extends 'element' | 'dynamic',
@@ -255,6 +278,14 @@ export interface ComputedNode {
255
278
  */
256
279
  isCustomized?: boolean
257
280
  }
281
+ export namespace ComputedNode {
282
+ /**
283
+ * Nodes group is a special kind of node, exisiting only in view
284
+ */
285
+ export function isNodesGroup(node: ComputedNode): boolean {
286
+ return node.kind === ElementKind.Group
287
+ }
288
+ }
258
289
 
259
290
  export interface ComputedEdge {
260
291
  id: EdgeId
@@ -368,6 +399,15 @@ export interface DiagramNode extends ComputedNode {
368
399
  labelBBox: BBox
369
400
  }
370
401
 
402
+ export namespace DiagramNode {
403
+ /**
404
+ * Nodes group is a special kind of node, exisiting only in view
405
+ */
406
+ export function isNodesGroup(node: DiagramNode): boolean {
407
+ return node.kind === ElementKind.Group
408
+ }
409
+ }
410
+
371
411
  export interface DiagramEdge extends ComputedEdge {
372
412
  // Bezier points
373
413
  points: NonEmptyArray<Point>
@@ -0,0 +1,20 @@
1
+ import { map, pipe, takeWhile, zip } from 'remeda'
2
+
3
+ /**
4
+ * Common head of two arrays
5
+ */
6
+ export function commonHead<T>(
7
+ sources: ReadonlyArray<T>,
8
+ targets: ReadonlyArray<T>,
9
+ equals?: (a: T, b: T) => boolean
10
+ ): T[] {
11
+ if (sources.length === 0 || targets.length === 0) {
12
+ return []
13
+ }
14
+ equals ??= Object.is
15
+ return pipe(
16
+ zip(sources, targets),
17
+ takeWhile(([source, target]) => equals(source, target)),
18
+ map(([source, _]) => source)
19
+ )
20
+ }
@@ -1,3 +1,4 @@
1
+ export * from './commonHead'
1
2
  export * from './compare-natural'
2
3
  export * from './fqn'
3
4
  export * from './guards'