@likec4/core 1.15.1 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types_index = require('./shared/core.Cq_6j35U.cjs');
3
+ const types_index = require('./shared/core.zN6ZscFQ.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; }
@@ -408,7 +408,11 @@ function $rules(...rules) {
408
408
  return (b) => rules.reduce((b2, rule) => rule(b2), b);
409
409
  }
410
410
 
411
- function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _globals = { styles: [] }, _views = /* @__PURE__ */ new Map()) {
411
+ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _views = /* @__PURE__ */ new Map(), _globals = {
412
+ predicates: {},
413
+ dynamicPredicates: {},
414
+ styles: {}
415
+ }) {
412
416
  const toLikeC4Specification = () => ({
413
417
  tags: spec.tags ?? [],
414
418
  elements: {
@@ -467,8 +471,8 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
467
471
  structuredClone(spec),
468
472
  structuredClone(_elements),
469
473
  structuredClone(_relations),
470
- structuredClone(_globals),
471
- structuredClone(_views)
474
+ structuredClone(_views),
475
+ structuredClone(_globals)
472
476
  ),
473
477
  __model: () => ({
474
478
  addElement: (element) => {
@@ -523,9 +527,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
523
527
  specification: toLikeC4Specification(),
524
528
  elements: n(Array.from(_elements.entries())),
525
529
  relations: l$1(_relations, (r) => [r.id, r]),
526
- globals: {
527
- styles: l$1(_globals.styles, (s) => [s.id, s])
528
- },
530
+ globals: structuredClone(_globals),
529
531
  views: n(Array.from(_views.entries()))
530
532
  }),
531
533
  helpers: () => ({
@@ -5400,6 +5402,7 @@ exports.isStepEdgeId = types_index.isStepEdgeId;
5400
5402
  exports.isTagEqual = types_index.isTagEqual;
5401
5403
  exports.isThemeColor = types_index.isThemeColor;
5402
5404
  exports.isViewRuleAutoLayout = types_index.isViewRuleAutoLayout;
5405
+ exports.isViewRuleGlobalPredicateRef = types_index.isViewRuleGlobalPredicateRef;
5403
5406
  exports.isViewRuleGlobalStyle = types_index.isViewRuleGlobalStyle;
5404
5407
  exports.isViewRuleGroup = types_index.isViewRuleGroup;
5405
5408
  exports.isViewRulePredicate = types_index.isViewRulePredicate;
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.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';
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.gZyGTUZz.cjs';
3
+ export { aG as AndOperator, G as AsFqn, bF as BBox, bc as BasicElementView, bb as BasicView, J as BorderStyles, aS as ColorLiteral, bC as ComputedDynamicView, bB as ComputedElementView, y as CustomColor, bo as CustomColorDefinitions, aP as DefaultArrowType, O as DefaultElementShape, aO as DefaultLineStyle, aQ as DefaultRelationshipColor, M as DefaultThemeColor, bm as DynamicView, bj as DynamicViewIncludeRule, bh as DynamicViewParallelSteps, bl as DynamicViewRule, bg as DynamicViewStep, bi as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bJ as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aU as ElementThemeColorValues, aV as ElementThemeColors, bf as ElementView, aa as ElementWhereExpr, az as EqualOperator, $ as ExpandedElementExpr, w as Expr, be as ExtendsElementView, aL as Filterable, av as GlobalDynamicPredicates, at as GlobalPredicateId, au as GlobalPredicates, aw as GlobalStyleID, ax as GlobalStyles, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, aC as KindEqual, aY as LikeC4Theme, U as Link, ay as ModelGlobals, x as NonEmptyReadonlyArray, aE as NotOperator, aI as OrOperator, ak as OutgoingExpr, aN as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aW as RelationshipThemeColorValues, aX as RelationshipThemeColors, bd as ScopedElementView, bu as StepEdgeId, bt as StepEdgeIdLiteral, aA as TagEqual, S as TagSpec, aR as ThemeColor, W as TypedElement, bA as ViewAutoLayout, bI as ViewChange, bH as ViewManualLayout, ba as ViewRule, b6 as ViewRuleAutoLayout, a$ as ViewRuleGlobalPredicateRef, b2 as ViewRuleGlobalStyle, b8 as ViewRuleGroup, aZ as ViewRulePredicate, b4 as ViewRuleStyleOrGlobalRef, by as ViewWithHash, bz as ViewWithNotation, aK as WhereOperator, a2 as WildcardExpr, X as XYPoint, bw as extractStep, bG as getBBoxCenter, bx as getParallelStepsPrefix, aH as isAndOperator, b5 as isAutoLayoutDirection, bD as isComputedDynamicView, bE as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bp as isDynamicView, bk as isDynamicViewIncludeRule, bn as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bq as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, br as isExtendsElementView, ah as isInOut, aj as isIncoming, aD as isKindEqual, aF as isNotOperator, aJ as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bs as isScopedElementView, bv as isStepEdgeId, aB as isTagEqual, aT as isThemeColor, b7 as isViewRuleAutoLayout, b0 as isViewRuleGlobalPredicateRef, b3 as isViewRuleGlobalStyle, b9 as isViewRuleGroup, a_ as isViewRulePredicate, b1 as isViewRuleStyle, a3 as isWildcard, aM as whereOperatorAsPredicate } from './shared/core.gZyGTUZz.cjs';
4
4
 
5
5
  type KeysOf<T> = keyof T extends infer K extends string ? K : never;
6
6
  type BuilderSpecification = {
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.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';
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.gZyGTUZz.mjs';
3
+ export { aG as AndOperator, G as AsFqn, bF as BBox, bc as BasicElementView, bb as BasicView, J as BorderStyles, aS as ColorLiteral, bC as ComputedDynamicView, bB as ComputedElementView, y as CustomColor, bo as CustomColorDefinitions, aP as DefaultArrowType, O as DefaultElementShape, aO as DefaultLineStyle, aQ as DefaultRelationshipColor, M as DefaultThemeColor, bm as DynamicView, bj as DynamicViewIncludeRule, bh as DynamicViewParallelSteps, bl as DynamicViewRule, bg as DynamicViewStep, bi as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bJ as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aU as ElementThemeColorValues, aV as ElementThemeColors, bf as ElementView, aa as ElementWhereExpr, az as EqualOperator, $ as ExpandedElementExpr, w as Expr, be as ExtendsElementView, aL as Filterable, av as GlobalDynamicPredicates, at as GlobalPredicateId, au as GlobalPredicates, aw as GlobalStyleID, ax as GlobalStyles, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, aC as KindEqual, aY as LikeC4Theme, U as Link, ay as ModelGlobals, x as NonEmptyReadonlyArray, aE as NotOperator, aI as OrOperator, ak as OutgoingExpr, aN as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aW as RelationshipThemeColorValues, aX as RelationshipThemeColors, bd as ScopedElementView, bu as StepEdgeId, bt as StepEdgeIdLiteral, aA as TagEqual, S as TagSpec, aR as ThemeColor, W as TypedElement, bA as ViewAutoLayout, bI as ViewChange, bH as ViewManualLayout, ba as ViewRule, b6 as ViewRuleAutoLayout, a$ as ViewRuleGlobalPredicateRef, b2 as ViewRuleGlobalStyle, b8 as ViewRuleGroup, aZ as ViewRulePredicate, b4 as ViewRuleStyleOrGlobalRef, by as ViewWithHash, bz as ViewWithNotation, aK as WhereOperator, a2 as WildcardExpr, X as XYPoint, bw as extractStep, bG as getBBoxCenter, bx as getParallelStepsPrefix, aH as isAndOperator, b5 as isAutoLayoutDirection, bD as isComputedDynamicView, bE as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bp as isDynamicView, bk as isDynamicViewIncludeRule, bn as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bq as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, br as isExtendsElementView, ah as isInOut, aj as isIncoming, aD as isKindEqual, aF as isNotOperator, aJ as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bs as isScopedElementView, bv as isStepEdgeId, aB as isTagEqual, aT as isThemeColor, b7 as isViewRuleAutoLayout, b0 as isViewRuleGlobalPredicateRef, b3 as isViewRuleGlobalStyle, b9 as isViewRuleGroup, a_ as isViewRulePredicate, b1 as isViewRuleStyle, a3 as isWildcard, aM as whereOperatorAsPredicate } from './shared/core.gZyGTUZz.mjs';
4
4
 
5
5
  type KeysOf<T> = keyof T extends infer K extends string ? K : never;
6
6
  type BuilderSpecification = {
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.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';
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.gZyGTUZz.js';
3
+ export { aG as AndOperator, G as AsFqn, bF as BBox, bc as BasicElementView, bb as BasicView, J as BorderStyles, aS as ColorLiteral, bC as ComputedDynamicView, bB as ComputedElementView, y as CustomColor, bo as CustomColorDefinitions, aP as DefaultArrowType, O as DefaultElementShape, aO as DefaultLineStyle, aQ as DefaultRelationshipColor, M as DefaultThemeColor, bm as DynamicView, bj as DynamicViewIncludeRule, bh as DynamicViewParallelSteps, bl as DynamicViewRule, bg as DynamicViewStep, bi as DynamicViewStepOrParallel, a8 as ElementExpression, a4 as ElementKindExpr, Y as ElementKindSpecificationStyle, bJ as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aU as ElementThemeColorValues, aV as ElementThemeColors, bf as ElementView, aa as ElementWhereExpr, az as EqualOperator, $ as ExpandedElementExpr, w as Expr, be as ExtendsElementView, aL as Filterable, av as GlobalDynamicPredicates, at as GlobalPredicateId, au as GlobalPredicates, aw as GlobalStyleID, ax as GlobalStyles, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, aC as KindEqual, aY as LikeC4Theme, U as Link, ay as ModelGlobals, x as NonEmptyReadonlyArray, aE as NotOperator, aI as OrOperator, ak as OutgoingExpr, aN as OverviewGraph, z as Point, ae as RelationExpr, am as RelationExpression, ar as RelationPredicateExpression, ao as RelationWhereExpr, aW as RelationshipThemeColorValues, aX as RelationshipThemeColors, bd as ScopedElementView, bu as StepEdgeId, bt as StepEdgeIdLiteral, aA as TagEqual, S as TagSpec, aR as ThemeColor, W as TypedElement, bA as ViewAutoLayout, bI as ViewChange, bH as ViewManualLayout, ba as ViewRule, b6 as ViewRuleAutoLayout, a$ as ViewRuleGlobalPredicateRef, b2 as ViewRuleGlobalStyle, b8 as ViewRuleGroup, aZ as ViewRulePredicate, b4 as ViewRuleStyleOrGlobalRef, by as ViewWithHash, bz as ViewWithNotation, aK as WhereOperator, a2 as WildcardExpr, X as XYPoint, bw as extractStep, bG as getBBoxCenter, bx as getParallelStepsPrefix, aH as isAndOperator, b5 as isAutoLayoutDirection, bD as isComputedDynamicView, bE as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bp as isDynamicView, bk as isDynamicViewIncludeRule, bn as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bq as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, br as isExtendsElementView, ah as isInOut, aj as isIncoming, aD as isKindEqual, aF as isNotOperator, aJ as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bs as isScopedElementView, bv as isStepEdgeId, aB as isTagEqual, aT as isThemeColor, b7 as isViewRuleAutoLayout, b0 as isViewRuleGlobalPredicateRef, b3 as isViewRuleGlobalStyle, b9 as isViewRuleGroup, a_ as isViewRulePredicate, b1 as isViewRuleStyle, a3 as isWildcard, aM as whereOperatorAsPredicate } from './shared/core.gZyGTUZz.js';
4
4
 
5
5
  type KeysOf<T> = keyof T extends infer K extends string ? K : never;
6
6
  type BuilderSpecification = {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
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';
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.v5DxGcX6.mjs';
2
+ export { A as AsFqn, B as BorderStyles, a3 as ComputedNode, N as DefaultArrowType, M as DefaultLineStyle, a7 as DiagramNode, E as ElementKind, j as ElementShapes, g as Expr, $ as StepEdgeId, a1 as extractStep, a6 as getBBoxCenter, a2 as getParallelStepsPrefix, J as isAndOperator, T as isAutoLayoutDirection, a4 as isComputedDynamicView, a5 as isComputedElementView, m as isCustomElement, C as isCustomRelationExpr, Y as isDynamicView, W as isDynamicViewIncludeRule, X as isDynamicViewParallelSteps, r as isElement, p as isElementKindExpr, k as isElementRef, q as isElementTagExpr, Z as isElementView, s as isElementWhere, l as isExpandedElementExpr, _ 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, a0 as isStepEdgeId, G as isTagEqual, O as isThemeColor, U as isViewRuleAutoLayout, Q as isViewRuleGlobalPredicateRef, S as isViewRuleGlobalStyle, V as isViewRuleGroup, P as isViewRulePredicate, R as isViewRuleStyle, o as isWildcard, h as nonexhaustive, L as whereOperatorAsPredicate } from './shared/core.v5DxGcX6.mjs';
3
3
  import defu from 'defu';
4
4
 
5
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});
@@ -403,7 +403,11 @@ function $rules(...rules) {
403
403
  return (b) => rules.reduce((b2, rule) => rule(b2), b);
404
404
  }
405
405
 
406
- function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _globals = { styles: [] }, _views = /* @__PURE__ */ new Map()) {
406
+ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _views = /* @__PURE__ */ new Map(), _globals = {
407
+ predicates: {},
408
+ dynamicPredicates: {},
409
+ styles: {}
410
+ }) {
407
411
  const toLikeC4Specification = () => ({
408
412
  tags: spec.tags ?? [],
409
413
  elements: {
@@ -462,8 +466,8 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
462
466
  structuredClone(spec),
463
467
  structuredClone(_elements),
464
468
  structuredClone(_relations),
465
- structuredClone(_globals),
466
- structuredClone(_views)
469
+ structuredClone(_views),
470
+ structuredClone(_globals)
467
471
  ),
468
472
  __model: () => ({
469
473
  addElement: (element) => {
@@ -518,9 +522,7 @@ function builder(spec, _elements = /* @__PURE__ */ new Map(), _relations = [], _
518
522
  specification: toLikeC4Specification(),
519
523
  elements: n(Array.from(_elements.entries())),
520
524
  relations: l$1(_relations, (r) => [r.id, r]),
521
- globals: {
522
- styles: l$1(_globals.styles, (s) => [s.id, s])
523
- },
525
+ globals: structuredClone(_globals),
524
526
  views: n(Array.from(_views.entries()))
525
527
  }),
526
528
  helpers: () => ({
@@ -1,4 +1,4 @@
1
- import { Tagged, LiteralUnion, TupleToUnion } from 'type-fest';
1
+ import { Tagged, LiteralUnion, TupleToUnion, NonEmptyTuple } from 'type-fest';
2
2
 
3
3
  type NonEmptyArray<T> = [T, ...T[]];
4
4
  type NonEmptyReadonlyArray<T> = readonly [T, ...T[]];
@@ -142,10 +142,15 @@ type Filterable<FTag extends string = string, FKind extends string = string> = {
142
142
  type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
143
143
  declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
144
144
 
145
+ type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
146
+ type GlobalPredicates = NonEmptyArray<ViewRulePredicate>;
147
+ type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>;
145
148
  type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
146
- interface GlobalStyle {
147
- readonly id: GlobalStyleID;
148
- readonly styles: NonEmptyArray<ViewRuleStyle>;
149
+ type GlobalStyles = NonEmptyTuple<ViewRuleStyle>;
150
+ interface ModelGlobals {
151
+ predicates: Record<GlobalPredicateId, GlobalPredicates>;
152
+ dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
153
+ styles: Record<GlobalStyleID, GlobalStyles>;
149
154
  }
150
155
 
151
156
  type ElementNotation = {
@@ -164,6 +169,10 @@ type ViewRulePredicate = {
164
169
  exclude: Expression[];
165
170
  };
166
171
  declare function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate;
172
+ interface ViewRuleGlobalPredicateRef {
173
+ predicateId: GlobalPredicateId;
174
+ }
175
+ declare function isViewRuleGlobalPredicateRef(rule: ViewRule): rule is ViewRuleGlobalPredicateRef;
167
176
  interface ViewRuleStyle {
168
177
  targets: ElementExpression[];
169
178
  notation?: string;
@@ -195,7 +204,7 @@ interface ViewRuleGroup {
195
204
  opacity?: number;
196
205
  }
197
206
  declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
198
- type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
207
+ type ViewRule = ViewRulePredicate | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
199
208
  interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
200
209
  readonly __?: ViewType;
201
210
  readonly id: ViewID<ViewIDs>;
@@ -258,7 +267,7 @@ type DynamicViewIncludeRule = {
258
267
  include: ElementPredicateExpression[];
259
268
  };
260
269
  declare function isDynamicViewIncludeRule(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
261
- type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
270
+ type DynamicViewRule = DynamicViewIncludeRule | ViewRuleGlobalPredicateRef | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
262
271
  interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'dynamic', ViewIDs, Tags> {
263
272
  readonly __: 'dynamic';
264
273
  readonly steps: DynamicViewStepOrParallel[];
@@ -639,9 +648,7 @@ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds
639
648
  };
640
649
  elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
641
650
  relations: Record<RelationID, Relation>;
642
- globals: {
643
- styles: Record<GlobalStyleID, GlobalStyle>;
644
- };
651
+ globals: ModelGlobals;
645
652
  views: Record<Views, LikeC4View<Views, Tags>>;
646
653
  }
647
654
  /**
@@ -724,4 +731,4 @@ declare namespace ViewChange {
724
731
  }
725
732
  type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
726
733
 
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 };
734
+ 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, type ViewRuleGlobalPredicateRef 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 TagEqual as aA, isTagEqual as aB, type KindEqual as aC, isKindEqual as aD, type NotOperator as aE, isNotOperator as aF, type AndOperator as aG, isAndOperator as aH, type OrOperator as aI, isOrOperator as aJ, type WhereOperator as aK, type Filterable as aL, whereOperatorAsPredicate as aM, OverviewGraph as aN, DefaultLineStyle as aO, DefaultArrowType as aP, DefaultRelationshipColor as aQ, type ThemeColor as aR, type ColorLiteral as aS, isThemeColor as aT, type ElementThemeColorValues as aU, type ElementThemeColors as aV, type RelationshipThemeColorValues as aW, type RelationshipThemeColors as aX, type LikeC4Theme as aY, type ViewRulePredicate as aZ, isViewRulePredicate 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 GlobalPredicateId as at, type GlobalPredicates as au, type GlobalDynamicPredicates as av, type GlobalStyleID as aw, type GlobalStyles as ax, type ModelGlobals as ay, type EqualOperator as az, type RelationshipArrowType as b, isViewRuleGlobalPredicateRef as b0, isViewRuleStyle as b1, type ViewRuleGlobalStyle as b2, isViewRuleGlobalStyle as b3, type ViewRuleStyleOrGlobalRef as b4, isAutoLayoutDirection as b5, type ViewRuleAutoLayout as b6, isViewRuleAutoLayout as b7, type ViewRuleGroup as b8, isViewRuleGroup as b9, type ViewAutoLayout as bA, type ComputedElementView as bB, type ComputedDynamicView as bC, isComputedDynamicView as bD, isComputedElementView as bE, type BBox as bF, getBBoxCenter as bG, type ViewManualLayout as bH, ViewChange as bI, type ElementNotation as bJ, type ViewRule as ba, type BasicView as bb, type BasicElementView as bc, type ScopedElementView as bd, type ExtendsElementView as be, type ElementView as bf, type DynamicViewStep as bg, type DynamicViewParallelSteps as bh, type DynamicViewStepOrParallel as bi, type DynamicViewIncludeRule as bj, isDynamicViewIncludeRule as bk, type DynamicViewRule as bl, type DynamicView as bm, isDynamicViewParallelSteps as bn, type CustomColorDefinitions as bo, isDynamicView as bp, isElementView as bq, isExtendsElementView as br, isScopedElementView as bs, type StepEdgeIdLiteral as bt, StepEdgeId as bu, isStepEdgeId as bv, extractStep as bw, getParallelStepsPrefix as bx, type ViewWithHash as by, type ViewWithNotation 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 };
@@ -1,4 +1,4 @@
1
- import { Tagged, LiteralUnion, TupleToUnion } from 'type-fest';
1
+ import { Tagged, LiteralUnion, TupleToUnion, NonEmptyTuple } from 'type-fest';
2
2
 
3
3
  type NonEmptyArray<T> = [T, ...T[]];
4
4
  type NonEmptyReadonlyArray<T> = readonly [T, ...T[]];
@@ -142,10 +142,15 @@ type Filterable<FTag extends string = string, FKind extends string = string> = {
142
142
  type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
143
143
  declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
144
144
 
145
+ type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
146
+ type GlobalPredicates = NonEmptyArray<ViewRulePredicate>;
147
+ type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>;
145
148
  type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
146
- interface GlobalStyle {
147
- readonly id: GlobalStyleID;
148
- readonly styles: NonEmptyArray<ViewRuleStyle>;
149
+ type GlobalStyles = NonEmptyTuple<ViewRuleStyle>;
150
+ interface ModelGlobals {
151
+ predicates: Record<GlobalPredicateId, GlobalPredicates>;
152
+ dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
153
+ styles: Record<GlobalStyleID, GlobalStyles>;
149
154
  }
150
155
 
151
156
  type ElementNotation = {
@@ -164,6 +169,10 @@ type ViewRulePredicate = {
164
169
  exclude: Expression[];
165
170
  };
166
171
  declare function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate;
172
+ interface ViewRuleGlobalPredicateRef {
173
+ predicateId: GlobalPredicateId;
174
+ }
175
+ declare function isViewRuleGlobalPredicateRef(rule: ViewRule): rule is ViewRuleGlobalPredicateRef;
167
176
  interface ViewRuleStyle {
168
177
  targets: ElementExpression[];
169
178
  notation?: string;
@@ -195,7 +204,7 @@ interface ViewRuleGroup {
195
204
  opacity?: number;
196
205
  }
197
206
  declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
198
- type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
207
+ type ViewRule = ViewRulePredicate | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
199
208
  interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
200
209
  readonly __?: ViewType;
201
210
  readonly id: ViewID<ViewIDs>;
@@ -258,7 +267,7 @@ type DynamicViewIncludeRule = {
258
267
  include: ElementPredicateExpression[];
259
268
  };
260
269
  declare function isDynamicViewIncludeRule(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
261
- type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
270
+ type DynamicViewRule = DynamicViewIncludeRule | ViewRuleGlobalPredicateRef | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
262
271
  interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'dynamic', ViewIDs, Tags> {
263
272
  readonly __: 'dynamic';
264
273
  readonly steps: DynamicViewStepOrParallel[];
@@ -639,9 +648,7 @@ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds
639
648
  };
640
649
  elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
641
650
  relations: Record<RelationID, Relation>;
642
- globals: {
643
- styles: Record<GlobalStyleID, GlobalStyle>;
644
- };
651
+ globals: ModelGlobals;
645
652
  views: Record<Views, LikeC4View<Views, Tags>>;
646
653
  }
647
654
  /**
@@ -724,4 +731,4 @@ declare namespace ViewChange {
724
731
  }
725
732
  type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
726
733
 
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 };
734
+ 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, type ViewRuleGlobalPredicateRef 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 TagEqual as aA, isTagEqual as aB, type KindEqual as aC, isKindEqual as aD, type NotOperator as aE, isNotOperator as aF, type AndOperator as aG, isAndOperator as aH, type OrOperator as aI, isOrOperator as aJ, type WhereOperator as aK, type Filterable as aL, whereOperatorAsPredicate as aM, OverviewGraph as aN, DefaultLineStyle as aO, DefaultArrowType as aP, DefaultRelationshipColor as aQ, type ThemeColor as aR, type ColorLiteral as aS, isThemeColor as aT, type ElementThemeColorValues as aU, type ElementThemeColors as aV, type RelationshipThemeColorValues as aW, type RelationshipThemeColors as aX, type LikeC4Theme as aY, type ViewRulePredicate as aZ, isViewRulePredicate 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 GlobalPredicateId as at, type GlobalPredicates as au, type GlobalDynamicPredicates as av, type GlobalStyleID as aw, type GlobalStyles as ax, type ModelGlobals as ay, type EqualOperator as az, type RelationshipArrowType as b, isViewRuleGlobalPredicateRef as b0, isViewRuleStyle as b1, type ViewRuleGlobalStyle as b2, isViewRuleGlobalStyle as b3, type ViewRuleStyleOrGlobalRef as b4, isAutoLayoutDirection as b5, type ViewRuleAutoLayout as b6, isViewRuleAutoLayout as b7, type ViewRuleGroup as b8, isViewRuleGroup as b9, type ViewAutoLayout as bA, type ComputedElementView as bB, type ComputedDynamicView as bC, isComputedDynamicView as bD, isComputedElementView as bE, type BBox as bF, getBBoxCenter as bG, type ViewManualLayout as bH, ViewChange as bI, type ElementNotation as bJ, type ViewRule as ba, type BasicView as bb, type BasicElementView as bc, type ScopedElementView as bd, type ExtendsElementView as be, type ElementView as bf, type DynamicViewStep as bg, type DynamicViewParallelSteps as bh, type DynamicViewStepOrParallel as bi, type DynamicViewIncludeRule as bj, isDynamicViewIncludeRule as bk, type DynamicViewRule as bl, type DynamicView as bm, isDynamicViewParallelSteps as bn, type CustomColorDefinitions as bo, isDynamicView as bp, isElementView as bq, isExtendsElementView as br, isScopedElementView as bs, type StepEdgeIdLiteral as bt, StepEdgeId as bu, isStepEdgeId as bv, extractStep as bw, getParallelStepsPrefix as bx, type ViewWithHash as by, type ViewWithNotation 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 };
@@ -1,4 +1,4 @@
1
- import { Tagged, LiteralUnion, TupleToUnion } from 'type-fest';
1
+ import { Tagged, LiteralUnion, TupleToUnion, NonEmptyTuple } from 'type-fest';
2
2
 
3
3
  type NonEmptyArray<T> = [T, ...T[]];
4
4
  type NonEmptyReadonlyArray<T> = readonly [T, ...T[]];
@@ -142,10 +142,15 @@ type Filterable<FTag extends string = string, FKind extends string = string> = {
142
142
  type OperatorPredicate<V extends Filterable> = (value: V) => boolean;
143
143
  declare function whereOperatorAsPredicate<FTag extends string = string, FKind extends string = string>(operator: WhereOperator<FTag, FKind>): OperatorPredicate<Filterable<FTag, FKind>>;
144
144
 
145
+ type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>;
146
+ type GlobalPredicates = NonEmptyArray<ViewRulePredicate>;
147
+ type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>;
145
148
  type GlobalStyleID = Tagged<string, 'GlobalStyleID'>;
146
- interface GlobalStyle {
147
- readonly id: GlobalStyleID;
148
- readonly styles: NonEmptyArray<ViewRuleStyle>;
149
+ type GlobalStyles = NonEmptyTuple<ViewRuleStyle>;
150
+ interface ModelGlobals {
151
+ predicates: Record<GlobalPredicateId, GlobalPredicates>;
152
+ dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
153
+ styles: Record<GlobalStyleID, GlobalStyles>;
149
154
  }
150
155
 
151
156
  type ElementNotation = {
@@ -164,6 +169,10 @@ type ViewRulePredicate = {
164
169
  exclude: Expression[];
165
170
  };
166
171
  declare function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate;
172
+ interface ViewRuleGlobalPredicateRef {
173
+ predicateId: GlobalPredicateId;
174
+ }
175
+ declare function isViewRuleGlobalPredicateRef(rule: ViewRule): rule is ViewRuleGlobalPredicateRef;
167
176
  interface ViewRuleStyle {
168
177
  targets: ElementExpression[];
169
178
  notation?: string;
@@ -195,7 +204,7 @@ interface ViewRuleGroup {
195
204
  opacity?: number;
196
205
  }
197
206
  declare function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup;
198
- type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
207
+ type ViewRule = ViewRulePredicate | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
199
208
  interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
200
209
  readonly __?: ViewType;
201
210
  readonly id: ViewID<ViewIDs>;
@@ -258,7 +267,7 @@ type DynamicViewIncludeRule = {
258
267
  include: ElementPredicateExpression[];
259
268
  };
260
269
  declare function isDynamicViewIncludeRule(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
261
- type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
270
+ type DynamicViewRule = DynamicViewIncludeRule | ViewRuleGlobalPredicateRef | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
262
271
  interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'dynamic', ViewIDs, Tags> {
263
272
  readonly __: 'dynamic';
264
273
  readonly steps: DynamicViewStepOrParallel[];
@@ -639,9 +648,7 @@ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds
639
648
  };
640
649
  elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
641
650
  relations: Record<RelationID, Relation>;
642
- globals: {
643
- styles: Record<GlobalStyleID, GlobalStyle>;
644
- };
651
+ globals: ModelGlobals;
645
652
  views: Record<Views, LikeC4View<Views, Tags>>;
646
653
  }
647
654
  /**
@@ -724,4 +731,4 @@ declare namespace ViewChange {
724
731
  }
725
732
  type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
726
733
 
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 };
734
+ 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, type ViewRuleGlobalPredicateRef 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 TagEqual as aA, isTagEqual as aB, type KindEqual as aC, isKindEqual as aD, type NotOperator as aE, isNotOperator as aF, type AndOperator as aG, isAndOperator as aH, type OrOperator as aI, isOrOperator as aJ, type WhereOperator as aK, type Filterable as aL, whereOperatorAsPredicate as aM, OverviewGraph as aN, DefaultLineStyle as aO, DefaultArrowType as aP, DefaultRelationshipColor as aQ, type ThemeColor as aR, type ColorLiteral as aS, isThemeColor as aT, type ElementThemeColorValues as aU, type ElementThemeColors as aV, type RelationshipThemeColorValues as aW, type RelationshipThemeColors as aX, type LikeC4Theme as aY, type ViewRulePredicate as aZ, isViewRulePredicate 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 GlobalPredicateId as at, type GlobalPredicates as au, type GlobalDynamicPredicates as av, type GlobalStyleID as aw, type GlobalStyles as ax, type ModelGlobals as ay, type EqualOperator as az, type RelationshipArrowType as b, isViewRuleGlobalPredicateRef as b0, isViewRuleStyle as b1, type ViewRuleGlobalStyle as b2, isViewRuleGlobalStyle as b3, type ViewRuleStyleOrGlobalRef as b4, isAutoLayoutDirection as b5, type ViewRuleAutoLayout as b6, isViewRuleAutoLayout as b7, type ViewRuleGroup as b8, isViewRuleGroup as b9, type ViewAutoLayout as bA, type ComputedElementView as bB, type ComputedDynamicView as bC, isComputedDynamicView as bD, isComputedElementView as bE, type BBox as bF, getBBoxCenter as bG, type ViewManualLayout as bH, ViewChange as bI, type ElementNotation as bJ, type ViewRule as ba, type BasicView as bb, type BasicElementView as bc, type ScopedElementView as bd, type ExtendsElementView as be, type ElementView as bf, type DynamicViewStep as bg, type DynamicViewParallelSteps as bh, type DynamicViewStepOrParallel as bi, type DynamicViewIncludeRule as bj, isDynamicViewIncludeRule as bk, type DynamicViewRule as bl, type DynamicView as bm, isDynamicViewParallelSteps as bn, type CustomColorDefinitions as bo, isDynamicView as bp, isElementView as bq, isExtendsElementView as br, isScopedElementView as bs, type StepEdgeIdLiteral as bt, StepEdgeId as bu, isStepEdgeId as bv, extractStep as bw, getParallelStepsPrefix as bx, type ViewWithHash as by, type ViewWithNotation 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 };
@@ -203,6 +203,9 @@ function isThemeColor(color) {
203
203
  function isViewRulePredicate(rule) {
204
204
  return "include" in rule && Array.isArray(rule.include) || "exclude" in rule && Array.isArray(rule.exclude);
205
205
  }
206
+ function isViewRuleGlobalPredicateRef(rule) {
207
+ return "predicateId" in rule;
208
+ }
206
209
  function isViewRuleStyle(rule) {
207
210
  return "style" in rule && "targets" in rule;
208
211
  }
@@ -287,4 +290,4 @@ var DiagramNode;
287
290
  DiagramNode2.isNodesGroup = isNodesGroup;
288
291
  })(DiagramNode || (DiagramNode = {}));
289
292
 
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 };
293
+ export { StepEdgeId 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, isViewRuleGlobalPredicateRef as Q, isViewRuleStyle as R, isViewRuleGlobalStyle as S, isAutoLayoutDirection as T, isViewRuleAutoLayout as U, isViewRuleGroup as V, isDynamicViewIncludeRule as W, isDynamicViewParallelSteps as X, isDynamicView as Y, isElementView as Z, isExtendsElementView as _, invariant as a, isStepEdgeId as a0, extractStep as a1, getParallelStepsPrefix as a2, ComputedNode as a3, isComputedDynamicView as a4, isComputedElementView as a5, getBBoxCenter as a6, DiagramNode as a7, 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 };
@@ -205,6 +205,9 @@ function isThemeColor(color) {
205
205
  function isViewRulePredicate(rule) {
206
206
  return "include" in rule && Array.isArray(rule.include) || "exclude" in rule && Array.isArray(rule.exclude);
207
207
  }
208
+ function isViewRuleGlobalPredicateRef(rule) {
209
+ return "predicateId" in rule;
210
+ }
208
211
  function isViewRuleStyle(rule) {
209
212
  return "style" in rule && "targets" in rule;
210
213
  }
@@ -337,6 +340,7 @@ exports.isStepEdgeId = isStepEdgeId;
337
340
  exports.isTagEqual = isTagEqual;
338
341
  exports.isThemeColor = isThemeColor;
339
342
  exports.isViewRuleAutoLayout = isViewRuleAutoLayout;
343
+ exports.isViewRuleGlobalPredicateRef = isViewRuleGlobalPredicateRef;
340
344
  exports.isViewRuleGlobalStyle = isViewRuleGlobalStyle;
341
345
  exports.isViewRuleGroup = isViewRuleGroup;
342
346
  exports.isViewRulePredicate = isViewRulePredicate;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const types_index = require('../shared/core.Cq_6j35U.cjs');
3
+ const types_index = require('../shared/core.zN6ZscFQ.cjs');
4
4
 
5
5
 
6
6
 
@@ -61,6 +61,7 @@ exports.isStepEdgeId = types_index.isStepEdgeId;
61
61
  exports.isTagEqual = types_index.isTagEqual;
62
62
  exports.isThemeColor = types_index.isThemeColor;
63
63
  exports.isViewRuleAutoLayout = types_index.isViewRuleAutoLayout;
64
+ exports.isViewRuleGlobalPredicateRef = types_index.isViewRuleGlobalPredicateRef;
64
65
  exports.isViewRuleGlobalStyle = types_index.isViewRuleGlobalStyle;
65
66
  exports.isViewRuleGroup = types_index.isViewRuleGroup;
66
67
  exports.isViewRulePredicate = types_index.isViewRulePredicate;
@@ -1,2 +1,2 @@
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';
1
+ export { aG as AndOperator, G as AsFqn, A as AutoLayoutDirection, bF as BBox, bc as BasicElementView, bb as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aS as ColorLiteral, bC as ComputedDynamicView, q as ComputedEdge, bB as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, bo as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aP as DefaultArrowType, O as DefaultElementShape, aO as DefaultLineStyle, aQ as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bm as DynamicView, bj as DynamicViewIncludeRule, bh as DynamicViewParallelSteps, bl as DynamicViewRule, bg as DynamicViewStep, bi as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bJ as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aU as ElementThemeColorValues, aV as ElementThemeColors, bf as ElementView, aa as ElementWhereExpr, az as EqualOperator, $ as ExpandedElementExpr, f as Expression, be as ExtendsElementView, aL as Filterable, F as Fqn, av as GlobalDynamicPredicates, at as GlobalPredicateId, au as GlobalPredicates, aw as GlobalStyleID, ax as GlobalStyles, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, aC as KindEqual, s as LayoutedLikeC4Model, aY as LikeC4Theme, L as LikeC4View, U as Link, ay as ModelGlobals, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aE as NotOperator, aI as OrOperator, ak as OutgoingExpr, aN 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, aW as RelationshipThemeColorValues, aX as RelationshipThemeColors, bd as ScopedElementView, bu as StepEdgeId, bt as StepEdgeIdLiteral, m as Tag, aA as TagEqual, S as TagSpec, aR as ThemeColor, T as ThemeColorValues, W as TypedElement, bA as ViewAutoLayout, bI as ViewChange, j as ViewID, bH as ViewManualLayout, ba as ViewRule, b6 as ViewRuleAutoLayout, a$ as ViewRuleGlobalPredicateRef, b2 as ViewRuleGlobalStyle, b8 as ViewRuleGroup, aZ as ViewRulePredicate, V as ViewRuleStyle, b4 as ViewRuleStyleOrGlobalRef, by as ViewWithHash, bz as ViewWithNotation, aK as WhereOperator, a2 as WildcardExpr, X as XYPoint, bw as extractStep, bG as getBBoxCenter, bx as getParallelStepsPrefix, aH as isAndOperator, b5 as isAutoLayoutDirection, bD as isComputedDynamicView, bE as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bp as isDynamicView, bk as isDynamicViewIncludeRule, bn as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bq as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, br as isExtendsElementView, ah as isInOut, aj as isIncoming, aD as isKindEqual, aF as isNotOperator, aJ as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bs as isScopedElementView, bv as isStepEdgeId, aB as isTagEqual, aT as isThemeColor, b7 as isViewRuleAutoLayout, b0 as isViewRuleGlobalPredicateRef, b3 as isViewRuleGlobalStyle, b9 as isViewRuleGroup, a_ as isViewRulePredicate, b1 as isViewRuleStyle, a3 as isWildcard, aM as whereOperatorAsPredicate } from '../shared/core.gZyGTUZz.cjs';
2
2
  import 'type-fest';
@@ -1,2 +1,2 @@
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';
1
+ export { aG as AndOperator, G as AsFqn, A as AutoLayoutDirection, bF as BBox, bc as BasicElementView, bb as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aS as ColorLiteral, bC as ComputedDynamicView, q as ComputedEdge, bB as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, bo as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aP as DefaultArrowType, O as DefaultElementShape, aO as DefaultLineStyle, aQ as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bm as DynamicView, bj as DynamicViewIncludeRule, bh as DynamicViewParallelSteps, bl as DynamicViewRule, bg as DynamicViewStep, bi as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bJ as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aU as ElementThemeColorValues, aV as ElementThemeColors, bf as ElementView, aa as ElementWhereExpr, az as EqualOperator, $ as ExpandedElementExpr, f as Expression, be as ExtendsElementView, aL as Filterable, F as Fqn, av as GlobalDynamicPredicates, at as GlobalPredicateId, au as GlobalPredicates, aw as GlobalStyleID, ax as GlobalStyles, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, aC as KindEqual, s as LayoutedLikeC4Model, aY as LikeC4Theme, L as LikeC4View, U as Link, ay as ModelGlobals, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aE as NotOperator, aI as OrOperator, ak as OutgoingExpr, aN 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, aW as RelationshipThemeColorValues, aX as RelationshipThemeColors, bd as ScopedElementView, bu as StepEdgeId, bt as StepEdgeIdLiteral, m as Tag, aA as TagEqual, S as TagSpec, aR as ThemeColor, T as ThemeColorValues, W as TypedElement, bA as ViewAutoLayout, bI as ViewChange, j as ViewID, bH as ViewManualLayout, ba as ViewRule, b6 as ViewRuleAutoLayout, a$ as ViewRuleGlobalPredicateRef, b2 as ViewRuleGlobalStyle, b8 as ViewRuleGroup, aZ as ViewRulePredicate, V as ViewRuleStyle, b4 as ViewRuleStyleOrGlobalRef, by as ViewWithHash, bz as ViewWithNotation, aK as WhereOperator, a2 as WildcardExpr, X as XYPoint, bw as extractStep, bG as getBBoxCenter, bx as getParallelStepsPrefix, aH as isAndOperator, b5 as isAutoLayoutDirection, bD as isComputedDynamicView, bE as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bp as isDynamicView, bk as isDynamicViewIncludeRule, bn as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bq as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, br as isExtendsElementView, ah as isInOut, aj as isIncoming, aD as isKindEqual, aF as isNotOperator, aJ as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bs as isScopedElementView, bv as isStepEdgeId, aB as isTagEqual, aT as isThemeColor, b7 as isViewRuleAutoLayout, b0 as isViewRuleGlobalPredicateRef, b3 as isViewRuleGlobalStyle, b9 as isViewRuleGroup, a_ as isViewRulePredicate, b1 as isViewRuleStyle, a3 as isWildcard, aM as whereOperatorAsPredicate } from '../shared/core.gZyGTUZz.mjs';
2
2
  import 'type-fest';
@@ -1,2 +1,2 @@
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';
1
+ export { aG as AndOperator, G as AsFqn, A as AutoLayoutDirection, bF as BBox, bc as BasicElementView, bb as BasicView, B as BorderStyle, J as BorderStyles, C as Color, aS as ColorLiteral, bC as ComputedDynamicView, q as ComputedEdge, bB as ComputedElementView, r as ComputedLikeC4Model, n as ComputedNode, l as ComputedView, y as CustomColor, bo as CustomColorDefinitions, g as CustomElementExpr, h as CustomRelationExpr, aP as DefaultArrowType, O as DefaultElementShape, aO as DefaultLineStyle, aQ as DefaultRelationshipColor, M as DefaultThemeColor, v as DiagramEdge, u as DiagramNode, D as DiagramView, bm as DynamicView, bj as DynamicViewIncludeRule, bh as DynamicViewParallelSteps, bl as DynamicViewRule, bg as DynamicViewStep, bi as DynamicViewStepOrParallel, k as EdgeId, d as Element, a8 as ElementExpression, p as ElementKind, a4 as ElementKindExpr, E as ElementKindSpecification, Y as ElementKindSpecificationStyle, bJ as ElementNotation, ac as ElementPredicateExpression, Z as ElementRefExpr, a as ElementShape, K as ElementShapes, Q as ElementStyle, a6 as ElementTagExpr, aU as ElementThemeColorValues, aV as ElementThemeColors, bf as ElementView, aa as ElementWhereExpr, az as EqualOperator, $ as ExpandedElementExpr, f as Expression, be as ExtendsElementView, aL as Filterable, F as Fqn, av as GlobalDynamicPredicates, at as GlobalPredicateId, au as GlobalPredicates, aw as GlobalStyleID, ax as GlobalStyles, H as HexColorLiteral, I as IconUrl, ag as InOutExpr, ai as IncomingExpr, aC as KindEqual, s as LayoutedLikeC4Model, aY as LikeC4Theme, L as LikeC4View, U as Link, ay as ModelGlobals, o as NodeId, N as NonEmptyArray, x as NonEmptyReadonlyArray, aE as NotOperator, aI as OrOperator, ak as OutgoingExpr, aN 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, aW as RelationshipThemeColorValues, aX as RelationshipThemeColors, bd as ScopedElementView, bu as StepEdgeId, bt as StepEdgeIdLiteral, m as Tag, aA as TagEqual, S as TagSpec, aR as ThemeColor, T as ThemeColorValues, W as TypedElement, bA as ViewAutoLayout, bI as ViewChange, j as ViewID, bH as ViewManualLayout, ba as ViewRule, b6 as ViewRuleAutoLayout, a$ as ViewRuleGlobalPredicateRef, b2 as ViewRuleGlobalStyle, b8 as ViewRuleGroup, aZ as ViewRulePredicate, V as ViewRuleStyle, b4 as ViewRuleStyleOrGlobalRef, by as ViewWithHash, bz as ViewWithNotation, aK as WhereOperator, a2 as WildcardExpr, X as XYPoint, bw as extractStep, bG as getBBoxCenter, bx as getParallelStepsPrefix, aH as isAndOperator, b5 as isAutoLayoutDirection, bD as isComputedDynamicView, bE as isComputedElementView, a1 as isCustomElement, aq as isCustomRelationExpr, bp as isDynamicView, bk as isDynamicViewIncludeRule, bn as isDynamicViewParallelSteps, a9 as isElement, a5 as isElementKindExpr, ad as isElementPredicateExpr, _ as isElementRef, a7 as isElementTagExpr, bq as isElementView, ab as isElementWhere, a0 as isExpandedElementExpr, br as isExtendsElementView, ah as isInOut, aj as isIncoming, aD as isKindEqual, aF as isNotOperator, aJ as isOrOperator, al as isOutgoing, af as isRelation, an as isRelationExpression, as as isRelationPredicateExpr, ap as isRelationWhere, bs as isScopedElementView, bv as isStepEdgeId, aB as isTagEqual, aT as isThemeColor, b7 as isViewRuleAutoLayout, b0 as isViewRuleGlobalPredicateRef, b3 as isViewRuleGlobalStyle, b9 as isViewRuleGroup, a_ as isViewRulePredicate, b1 as isViewRuleStyle, a3 as isWildcard, aM as whereOperatorAsPredicate } from '../shared/core.gZyGTUZz.js';
2
2
  import 'type-fest';
@@ -1 +1 @@
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';
1
+ export { A as AsFqn, B as BorderStyles, a3 as ComputedNode, N as DefaultArrowType, c as DefaultElementShape, M as DefaultLineStyle, f as DefaultRelationshipColor, D as DefaultThemeColor, a7 as DiagramNode, E as ElementKind, j as ElementShapes, $ as StepEdgeId, a1 as extractStep, a6 as getBBoxCenter, a2 as getParallelStepsPrefix, J as isAndOperator, T as isAutoLayoutDirection, a4 as isComputedDynamicView, a5 as isComputedElementView, m as isCustomElement, C as isCustomRelationExpr, Y as isDynamicView, W as isDynamicViewIncludeRule, X as isDynamicViewParallelSteps, r as isElement, p as isElementKindExpr, i as isElementPredicateExpr, k as isElementRef, q as isElementTagExpr, Z as isElementView, s as isElementWhere, l as isExpandedElementExpr, _ 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, a0 as isStepEdgeId, G as isTagEqual, O as isThemeColor, U as isViewRuleAutoLayout, Q as isViewRuleGlobalPredicateRef, S as isViewRuleGlobalStyle, V as isViewRuleGroup, P as isViewRulePredicate, R as isViewRuleStyle, o as isWildcard, L as whereOperatorAsPredicate } from '../shared/core.v5DxGcX6.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "1.15.1",
3
+ "version": "1.16.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -80,7 +80,7 @@
80
80
  "type-fest": "4.26.1"
81
81
  },
82
82
  "devDependencies": {
83
- "@likec4/tsconfig": "1.15.1",
83
+ "@likec4/tsconfig": "1.16.0",
84
84
  "@mantine/colors-generator": "7.13.4",
85
85
  "@types/natural-compare-lite": "^1.4.2",
86
86
  "chroma-js": "^3.1.2",
@@ -90,7 +90,7 @@
90
90
  "turbo": "^2.2.3",
91
91
  "typescript": "^5.6.3",
92
92
  "unbuild": "^3.0.0-rc.11",
93
- "vitest": "^2.1.3"
93
+ "vitest": "^2.1.4"
94
94
  },
95
95
  "packageManager": "yarn@4.5.1"
96
96
  }
@@ -10,11 +10,11 @@ import {
10
10
  type ElementShape,
11
11
  type ElementView,
12
12
  type Fqn,
13
- type GlobalStyle,
14
13
  type IconUrl,
15
14
  isScopedElementView,
16
15
  type LikeC4View,
17
16
  type Link,
17
+ type ModelGlobals,
18
18
  type NonEmptyArray,
19
19
  type Relation,
20
20
  type RelationID,
@@ -220,10 +220,12 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
220
220
  spec: Spec,
221
221
  _elements = new Map<string, Element>(),
222
222
  _relations = [] as Relation[],
223
- _globals = { styles: [] } as {
224
- styles: GlobalStyle[]
225
- },
226
- _views = new Map<string, LikeC4View>()
223
+ _views = new Map<string, LikeC4View>(),
224
+ _globals = {
225
+ predicates: {},
226
+ dynamicPredicates: {},
227
+ styles: {}
228
+ } as ModelGlobals
227
229
  ): Builder<T> {
228
230
  const toLikeC4Specification = (): Types.ToParsedLikeC4Model<T>['specification'] => ({
229
231
  tags: (spec.tags ?? []) as Tag<T['Tag']>[],
@@ -287,8 +289,8 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
287
289
  structuredClone(spec),
288
290
  structuredClone(_elements),
289
291
  structuredClone(_relations),
290
- structuredClone(_globals),
291
- structuredClone(_views)
292
+ structuredClone(_views),
293
+ structuredClone(_globals)
292
294
  ),
293
295
  __model: () => ({
294
296
  addElement: (element) => {
@@ -343,9 +345,7 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
343
345
  specification: toLikeC4Specification(),
344
346
  elements: fromEntries(Array.from(_elements.entries())) as any,
345
347
  relations: mapToObj(_relations, r => [r.id, r]),
346
- globals: {
347
- styles: mapToObj(_globals.styles, s => [s.id, s])
348
- },
348
+ globals: structuredClone(_globals),
349
349
  views: fromEntries(Array.from(_views.entries())) as any
350
350
  }),
351
351
  helpers: () => ({
@@ -335,6 +335,8 @@ export const fakeComputedModel = {
335
335
  elements: fakeElements,
336
336
  relations: fakeRelations,
337
337
  globals: {
338
+ predicates: {},
339
+ dynamicPredicates: {},
338
340
  styles: {}
339
341
  },
340
342
  views: {}
@@ -1,10 +1,19 @@
1
- import type { Tagged } from 'type-fest'
1
+ import type { NonEmptyTuple, Tagged } from 'type-fest'
2
2
  import type { NonEmptyArray } from './_common'
3
- import type { ViewRuleStyle } from './view'
3
+ import type { DynamicViewIncludeRule, ViewRulePredicate, ViewRuleStyle } from './view'
4
+
5
+ export type GlobalPredicateId = Tagged<string, 'GlobalPredicateId'>
6
+
7
+ export type GlobalPredicates = NonEmptyArray<ViewRulePredicate>
8
+
9
+ export type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>
4
10
 
5
11
  export type GlobalStyleID = Tagged<string, 'GlobalStyleID'>
6
12
 
7
- export interface GlobalStyle {
8
- readonly id: GlobalStyleID
9
- readonly styles: NonEmptyArray<ViewRuleStyle>
13
+ export type GlobalStyles = NonEmptyTuple<ViewRuleStyle>
14
+
15
+ export interface ModelGlobals {
16
+ predicates: Record<GlobalPredicateId, GlobalPredicates>
17
+ dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>
18
+ styles: Record<GlobalStyleID, GlobalStyles>
10
19
  }
@@ -1,5 +1,5 @@
1
1
  import type { ElementKindSpecification, Tag, TypedElement } from './element'
2
- import type { GlobalStyle, GlobalStyleID } from './global'
2
+ import type { ModelGlobals } from './global'
3
3
  import type { Relation, RelationID, RelationshipKindSpecification } from './relation'
4
4
  import type { ComputedView, DiagramView, LikeC4View, ViewID } from './view'
5
5
 
@@ -20,9 +20,7 @@ export interface ParsedLikeC4Model<
20
20
  }
21
21
  elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>
22
22
  relations: Record<RelationID, Relation>
23
- globals: {
24
- styles: Record<GlobalStyleID, GlobalStyle>
25
- }
23
+ globals: ModelGlobals
26
24
  views: Record<Views, LikeC4View<Views, Tags>>
27
25
  }
28
26
 
package/src/types/view.ts CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  type Tag
12
12
  } from './element'
13
13
  import type { ElementExpression, ElementPredicateExpression, Expression } from './expression'
14
- import type { GlobalStyleID } from './global'
14
+ import type { GlobalPredicateId, GlobalStyleID } from './global'
15
15
  import type { RelationID, RelationshipArrowType, RelationshipKind, RelationshipLineType } from './relation'
16
16
  import type { Color, ThemeColorValues } from './theme'
17
17
  import type { ElementNotation } from './view-notation'
@@ -34,6 +34,13 @@ export function isViewRulePredicate(rule: ViewRule): rule is ViewRulePredicate {
34
34
  )
35
35
  }
36
36
 
37
+ export interface ViewRuleGlobalPredicateRef {
38
+ predicateId: GlobalPredicateId
39
+ }
40
+ export function isViewRuleGlobalPredicateRef(rule: ViewRule): rule is ViewRuleGlobalPredicateRef {
41
+ return 'predicateId' in rule
42
+ }
43
+
37
44
  export interface ViewRuleStyle {
38
45
  targets: ElementExpression[]
39
46
  notation?: string
@@ -83,7 +90,13 @@ export function isViewRuleGroup(rule: ViewRule): rule is ViewRuleGroup {
83
90
  return 'title' in rule && 'groupRules' in rule && Array.isArray(rule.groupRules)
84
91
  }
85
92
 
86
- export type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout
93
+ export type ViewRule =
94
+ | ViewRulePredicate
95
+ | ViewRuleGlobalPredicateRef
96
+ | ViewRuleGroup
97
+ | ViewRuleStyle
98
+ | ViewRuleGlobalStyle
99
+ | ViewRuleAutoLayout
87
100
 
88
101
  export interface BasicView<
89
102
  ViewType extends 'element' | 'dynamic',
@@ -178,7 +191,12 @@ export function isDynamicViewIncludeRule(rule: DynamicViewRule): rule is Dynamic
178
191
  return 'include' in rule && Array.isArray(rule.include)
179
192
  }
180
193
 
181
- export type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout
194
+ export type DynamicViewRule =
195
+ | DynamicViewIncludeRule
196
+ | ViewRuleGlobalPredicateRef
197
+ | ViewRuleStyle
198
+ | ViewRuleGlobalStyle
199
+ | ViewRuleAutoLayout
182
200
  export interface DynamicView<
183
201
  ViewIDs extends string = string,
184
202
  Tags extends string = string