@likec4/core 1.13.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 +54 -5
- 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 +48 -14
- package/dist/shared/{core.C4jDMQ1i.d.cts → core.CYtN9Czk.d.cts} +40 -3
- package/dist/shared/{core.C4jDMQ1i.d.mts → core.CYtN9Czk.d.mts} +40 -3
- package/dist/shared/{core.C4jDMQ1i.d.ts → core.CYtN9Czk.d.ts} +40 -3
- package/dist/shared/{core.IR7XOEkQ.cjs → core.Cq_6j35U.cjs} +26 -0
- package/dist/shared/{core.BJDxVHFh.mjs → core.zYtlWYjW.mjs} +25 -1
- package/dist/types/index.cjs +15 -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 +8 -8
- package/src/builder/Builder.ts +8 -0
- package/src/index.ts +1 -0
- package/src/model/__test__/fixture.ts +3 -0
- package/src/types/element.ts +3 -0
- package/src/types/global.ts +10 -0
- package/src/types/index.ts +1 -0
- package/src/types/model.ts +4 -0
- package/src/types/view.ts +51 -3
- package/src/utils/commonHead.ts +20 -0
- package/src/utils/index.ts +1 -0
|
@@ -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;
|
|
@@ -165,6 +174,11 @@ interface ViewRuleStyle {
|
|
|
165
174
|
};
|
|
166
175
|
}
|
|
167
176
|
declare function isViewRuleStyle(rule: ViewRule): rule is ViewRuleStyle;
|
|
177
|
+
interface ViewRuleGlobalStyle {
|
|
178
|
+
styleId: GlobalStyleID;
|
|
179
|
+
}
|
|
180
|
+
declare function isViewRuleGlobalStyle(rule: ViewRule): rule is ViewRuleGlobalStyle;
|
|
181
|
+
type ViewRuleStyleOrGlobalRef = ViewRuleStyle | ViewRuleGlobalStyle;
|
|
168
182
|
type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
|
|
169
183
|
declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
|
|
170
184
|
interface ViewRuleAutoLayout {
|
|
@@ -173,7 +187,15 @@ interface ViewRuleAutoLayout {
|
|
|
173
187
|
rankSep?: number;
|
|
174
188
|
}
|
|
175
189
|
declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
|
|
176
|
-
|
|
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;
|
|
177
199
|
interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
|
|
178
200
|
readonly __?: ViewType;
|
|
179
201
|
readonly id: ViewID<ViewIDs>;
|
|
@@ -236,7 +258,7 @@ type DynamicViewIncludeRule = {
|
|
|
236
258
|
include: ElementPredicateExpression[];
|
|
237
259
|
};
|
|
238
260
|
declare function isDynamicViewIncludeRule(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
|
|
239
|
-
type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleAutoLayout;
|
|
261
|
+
type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
|
|
240
262
|
interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'dynamic', ViewIDs, Tags> {
|
|
241
263
|
readonly __: 'dynamic';
|
|
242
264
|
readonly steps: DynamicViewStepOrParallel[];
|
|
@@ -290,6 +312,12 @@ interface ComputedNode {
|
|
|
290
312
|
*/
|
|
291
313
|
isCustomized?: boolean;
|
|
292
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
|
+
}
|
|
293
321
|
interface ComputedEdge {
|
|
294
322
|
id: EdgeId;
|
|
295
323
|
parent: NodeId | null;
|
|
@@ -367,6 +395,12 @@ interface DiagramNode extends ComputedNode {
|
|
|
367
395
|
position: Point;
|
|
368
396
|
labelBBox: BBox;
|
|
369
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
|
+
}
|
|
370
404
|
interface DiagramEdge extends ComputedEdge {
|
|
371
405
|
points: NonEmptyArray<Point>;
|
|
372
406
|
controlPoints?: NonEmptyArray<XYPoint>;
|
|
@@ -605,6 +639,9 @@ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds
|
|
|
605
639
|
};
|
|
606
640
|
elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
|
|
607
641
|
relations: Record<RelationID, Relation>;
|
|
642
|
+
globals: {
|
|
643
|
+
styles: Record<GlobalStyleID, GlobalStyle>;
|
|
644
|
+
};
|
|
608
645
|
views: Record<Views, LikeC4View<Views, Tags>>;
|
|
609
646
|
}
|
|
610
647
|
/**
|
|
@@ -687,4 +724,4 @@ declare namespace ViewChange {
|
|
|
687
724
|
}
|
|
688
725
|
type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
|
|
689
726
|
|
|
690
|
-
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
|
|
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;
|
|
@@ -165,6 +174,11 @@ interface ViewRuleStyle {
|
|
|
165
174
|
};
|
|
166
175
|
}
|
|
167
176
|
declare function isViewRuleStyle(rule: ViewRule): rule is ViewRuleStyle;
|
|
177
|
+
interface ViewRuleGlobalStyle {
|
|
178
|
+
styleId: GlobalStyleID;
|
|
179
|
+
}
|
|
180
|
+
declare function isViewRuleGlobalStyle(rule: ViewRule): rule is ViewRuleGlobalStyle;
|
|
181
|
+
type ViewRuleStyleOrGlobalRef = ViewRuleStyle | ViewRuleGlobalStyle;
|
|
168
182
|
type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
|
|
169
183
|
declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
|
|
170
184
|
interface ViewRuleAutoLayout {
|
|
@@ -173,7 +187,15 @@ interface ViewRuleAutoLayout {
|
|
|
173
187
|
rankSep?: number;
|
|
174
188
|
}
|
|
175
189
|
declare function isViewRuleAutoLayout(rule: ViewRule): rule is ViewRuleAutoLayout;
|
|
176
|
-
|
|
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;
|
|
177
199
|
interface BasicView<ViewType extends 'element' | 'dynamic', ViewIDs extends string, Tags extends string> {
|
|
178
200
|
readonly __?: ViewType;
|
|
179
201
|
readonly id: ViewID<ViewIDs>;
|
|
@@ -236,7 +258,7 @@ type DynamicViewIncludeRule = {
|
|
|
236
258
|
include: ElementPredicateExpression[];
|
|
237
259
|
};
|
|
238
260
|
declare function isDynamicViewIncludeRule(rule: DynamicViewRule): rule is DynamicViewIncludeRule;
|
|
239
|
-
type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleAutoLayout;
|
|
261
|
+
type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
|
|
240
262
|
interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<'dynamic', ViewIDs, Tags> {
|
|
241
263
|
readonly __: 'dynamic';
|
|
242
264
|
readonly steps: DynamicViewStepOrParallel[];
|
|
@@ -290,6 +312,12 @@ interface ComputedNode {
|
|
|
290
312
|
*/
|
|
291
313
|
isCustomized?: boolean;
|
|
292
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
|
+
}
|
|
293
321
|
interface ComputedEdge {
|
|
294
322
|
id: EdgeId;
|
|
295
323
|
parent: NodeId | null;
|
|
@@ -367,6 +395,12 @@ interface DiagramNode extends ComputedNode {
|
|
|
367
395
|
position: Point;
|
|
368
396
|
labelBBox: BBox;
|
|
369
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
|
+
}
|
|
370
404
|
interface DiagramEdge extends ComputedEdge {
|
|
371
405
|
points: NonEmptyArray<Point>;
|
|
372
406
|
controlPoints?: NonEmptyArray<XYPoint>;
|
|
@@ -605,6 +639,9 @@ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds
|
|
|
605
639
|
};
|
|
606
640
|
elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
|
|
607
641
|
relations: Record<RelationID, Relation>;
|
|
642
|
+
globals: {
|
|
643
|
+
styles: Record<GlobalStyleID, GlobalStyle>;
|
|
644
|
+
};
|
|
608
645
|
views: Record<Views, LikeC4View<Views, Tags>>;
|
|
609
646
|
}
|
|
610
647
|
/**
|
|
@@ -687,4 +724,4 @@ declare namespace ViewChange {
|
|
|
687
724
|
}
|
|
688
725
|
type ViewChange = ViewChange.ChangeElementStyle | ViewChange.SaveManualLayout | ViewChange.ChangeAutoLayout;
|
|
689
726
|
|
|
690
|
-
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
|
|
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",
|
|
@@ -204,12 +208,18 @@ function isViewRulePredicate(rule) {
|
|
|
204
208
|
function isViewRuleStyle(rule) {
|
|
205
209
|
return "style" in rule && "targets" in rule;
|
|
206
210
|
}
|
|
211
|
+
function isViewRuleGlobalStyle(rule) {
|
|
212
|
+
return "styleId" in rule;
|
|
213
|
+
}
|
|
207
214
|
function isAutoLayoutDirection(autoLayout) {
|
|
208
215
|
return autoLayout === "TB" || autoLayout === "BT" || autoLayout === "LR" || autoLayout === "RL";
|
|
209
216
|
}
|
|
210
217
|
function isViewRuleAutoLayout(rule) {
|
|
211
218
|
return "direction" in rule;
|
|
212
219
|
}
|
|
220
|
+
function isViewRuleGroup(rule) {
|
|
221
|
+
return "title" in rule && "groupRules" in rule && Array.isArray(rule.groupRules);
|
|
222
|
+
}
|
|
213
223
|
function isDynamicViewIncludeRule(rule) {
|
|
214
224
|
return "include" in rule && Array.isArray(rule.include);
|
|
215
225
|
}
|
|
@@ -247,6 +257,13 @@ function getParallelStepsPrefix(id) {
|
|
|
247
257
|
}
|
|
248
258
|
return null;
|
|
249
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 = {}));
|
|
250
267
|
function isComputedDynamicView(view) {
|
|
251
268
|
return view.__ === "dynamic";
|
|
252
269
|
}
|
|
@@ -264,6 +281,13 @@ function getBBoxCenter({
|
|
|
264
281
|
y: y + height / 2
|
|
265
282
|
};
|
|
266
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 = {}));
|
|
267
291
|
|
|
268
292
|
exports.AsFqn = AsFqn;
|
|
269
293
|
exports.BorderStyles = BorderStyles;
|
|
@@ -313,6 +337,8 @@ exports.isStepEdgeId = isStepEdgeId;
|
|
|
313
337
|
exports.isTagEqual = isTagEqual;
|
|
314
338
|
exports.isThemeColor = isThemeColor;
|
|
315
339
|
exports.isViewRuleAutoLayout = isViewRuleAutoLayout;
|
|
340
|
+
exports.isViewRuleGlobalStyle = isViewRuleGlobalStyle;
|
|
341
|
+
exports.isViewRuleGroup = isViewRuleGroup;
|
|
316
342
|
exports.isViewRulePredicate = isViewRulePredicate;
|
|
317
343
|
exports.isViewRuleStyle = isViewRuleStyle;
|
|
318
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",
|
|
@@ -202,12 +206,18 @@ function isViewRulePredicate(rule) {
|
|
|
202
206
|
function isViewRuleStyle(rule) {
|
|
203
207
|
return "style" in rule && "targets" in rule;
|
|
204
208
|
}
|
|
209
|
+
function isViewRuleGlobalStyle(rule) {
|
|
210
|
+
return "styleId" in rule;
|
|
211
|
+
}
|
|
205
212
|
function isAutoLayoutDirection(autoLayout) {
|
|
206
213
|
return autoLayout === "TB" || autoLayout === "BT" || autoLayout === "LR" || autoLayout === "RL";
|
|
207
214
|
}
|
|
208
215
|
function isViewRuleAutoLayout(rule) {
|
|
209
216
|
return "direction" in rule;
|
|
210
217
|
}
|
|
218
|
+
function isViewRuleGroup(rule) {
|
|
219
|
+
return "title" in rule && "groupRules" in rule && Array.isArray(rule.groupRules);
|
|
220
|
+
}
|
|
211
221
|
function isDynamicViewIncludeRule(rule) {
|
|
212
222
|
return "include" in rule && Array.isArray(rule.include);
|
|
213
223
|
}
|
|
@@ -245,6 +255,13 @@ function getParallelStepsPrefix(id) {
|
|
|
245
255
|
}
|
|
246
256
|
return null;
|
|
247
257
|
}
|
|
258
|
+
var ComputedNode;
|
|
259
|
+
((ComputedNode2) => {
|
|
260
|
+
function isNodesGroup(node) {
|
|
261
|
+
return node.kind === ElementKind.Group;
|
|
262
|
+
}
|
|
263
|
+
ComputedNode2.isNodesGroup = isNodesGroup;
|
|
264
|
+
})(ComputedNode || (ComputedNode = {}));
|
|
248
265
|
function isComputedDynamicView(view) {
|
|
249
266
|
return view.__ === "dynamic";
|
|
250
267
|
}
|
|
@@ -262,5 +279,12 @@ function getBBoxCenter({
|
|
|
262
279
|
y: y + height / 2
|
|
263
280
|
};
|
|
264
281
|
}
|
|
282
|
+
var DiagramNode;
|
|
283
|
+
((DiagramNode2) => {
|
|
284
|
+
function isNodesGroup(node) {
|
|
285
|
+
return node.kind === ElementKind.Group;
|
|
286
|
+
}
|
|
287
|
+
DiagramNode2.isNodesGroup = isNodesGroup;
|
|
288
|
+
})(DiagramNode || (DiagramNode = {}));
|
|
265
289
|
|
|
266
|
-
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;
|
|
@@ -49,6 +61,8 @@ exports.isStepEdgeId = types_index.isStepEdgeId;
|
|
|
49
61
|
exports.isTagEqual = types_index.isTagEqual;
|
|
50
62
|
exports.isThemeColor = types_index.isThemeColor;
|
|
51
63
|
exports.isViewRuleAutoLayout = types_index.isViewRuleAutoLayout;
|
|
64
|
+
exports.isViewRuleGlobalStyle = types_index.isViewRuleGlobalStyle;
|
|
65
|
+
exports.isViewRuleGroup = types_index.isViewRuleGroup;
|
|
52
66
|
exports.isViewRulePredicate = types_index.isViewRulePredicate;
|
|
53
67
|
exports.isViewRuleStyle = types_index.isViewRuleStyle;
|
|
54
68
|
exports.isWildcard = types_index.isWildcard;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
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 {
|
|
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 {
|
|
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
|
-
"chroma-js": "^3.1.
|
|
86
|
+
"chroma-js": "^3.1.2",
|
|
87
87
|
"execa": "^9.3.1",
|
|
88
88
|
"natural-compare-lite": "^1.4.0",
|
|
89
|
-
"remeda": "^2.
|
|
90
|
-
"turbo": "^2.
|
|
89
|
+
"remeda": "^2.15.0",
|
|
90
|
+
"turbo": "^2.2.3",
|
|
91
91
|
"typescript": "^5.6.3",
|
|
92
92
|
"unbuild": "^3.0.0-rc.11",
|
|
93
|
-
"vitest": "^2.1.
|
|
93
|
+
"vitest": "^2.1.3"
|
|
94
94
|
},
|
|
95
|
-
"packageManager": "yarn@4.5.
|
|
95
|
+
"packageManager": "yarn@4.5.1"
|
|
96
96
|
}
|
package/src/builder/Builder.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type ElementShape,
|
|
11
11
|
type ElementView,
|
|
12
12
|
type Fqn,
|
|
13
|
+
type GlobalStyle,
|
|
13
14
|
type IconUrl,
|
|
14
15
|
isScopedElementView,
|
|
15
16
|
type LikeC4View,
|
|
@@ -219,6 +220,9 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
|
|
|
219
220
|
spec: Spec,
|
|
220
221
|
_elements = new Map<string, Element>(),
|
|
221
222
|
_relations = [] as Relation[],
|
|
223
|
+
_globals = { styles: [] } as {
|
|
224
|
+
styles: GlobalStyle[]
|
|
225
|
+
},
|
|
222
226
|
_views = new Map<string, LikeC4View>()
|
|
223
227
|
): Builder<T> {
|
|
224
228
|
const toLikeC4Specification = (): Types.ToParsedLikeC4Model<T>['specification'] => ({
|
|
@@ -283,6 +287,7 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
|
|
|
283
287
|
structuredClone(spec),
|
|
284
288
|
structuredClone(_elements),
|
|
285
289
|
structuredClone(_relations),
|
|
290
|
+
structuredClone(_globals),
|
|
286
291
|
structuredClone(_views)
|
|
287
292
|
),
|
|
288
293
|
__model: () => ({
|
|
@@ -338,6 +343,9 @@ function builder<Spec extends BuilderSpecification, T extends AnyTypes>(
|
|
|
338
343
|
specification: toLikeC4Specification(),
|
|
339
344
|
elements: fromEntries(Array.from(_elements.entries())) as any,
|
|
340
345
|
relations: mapToObj(_relations, r => [r.id, r]),
|
|
346
|
+
globals: {
|
|
347
|
+
styles: mapToObj(_globals.styles, s => [s.id, s])
|
|
348
|
+
},
|
|
341
349
|
views: fromEntries(Array.from(_views.entries())) as any
|
|
342
350
|
}),
|
|
343
351
|
helpers: () => ({
|
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',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Tagged } from 'type-fest'
|
|
2
|
+
import type { NonEmptyArray } from './_common'
|
|
3
|
+
import type { ViewRuleStyle } from './view'
|
|
4
|
+
|
|
5
|
+
export type GlobalStyleID = Tagged<string, 'GlobalStyleID'>
|
|
6
|
+
|
|
7
|
+
export interface GlobalStyle {
|
|
8
|
+
readonly id: GlobalStyleID
|
|
9
|
+
readonly styles: NonEmptyArray<ViewRuleStyle>
|
|
10
|
+
}
|
package/src/types/index.ts
CHANGED
package/src/types/model.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ElementKindSpecification, Tag, TypedElement } from './element'
|
|
2
|
+
import type { GlobalStyle, GlobalStyleID } from './global'
|
|
2
3
|
import type { Relation, RelationID, RelationshipKindSpecification } from './relation'
|
|
3
4
|
import type { ComputedView, DiagramView, LikeC4View, ViewID } from './view'
|
|
4
5
|
|
|
@@ -19,6 +20,9 @@ export interface ParsedLikeC4Model<
|
|
|
19
20
|
}
|
|
20
21
|
elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>
|
|
21
22
|
relations: Record<RelationID, Relation>
|
|
23
|
+
globals: {
|
|
24
|
+
styles: Record<GlobalStyleID, GlobalStyle>
|
|
25
|
+
}
|
|
22
26
|
views: Record<Views, LikeC4View<Views, Tags>>
|
|
23
27
|
}
|
|
24
28
|
|