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