@likec4/core 1.43.0 → 1.45.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/builder/index.d.mts +15 -14
- package/dist/builder/index.mjs +35 -18
- package/dist/compute-view/index.d.mts +9 -9
- package/dist/compute-view/index.mjs +8 -7
- package/dist/compute-view/relationships-view/index.d.mts +7 -7
- package/dist/compute-view/relationships-view/index.mjs +2 -2
- package/dist/index.d.mts +27 -7
- package/dist/index.mjs +8 -7
- package/dist/model/connection/deployment/index.d.mts +9 -9
- package/dist/model/connection/deployment/index.mjs +2 -2
- package/dist/model/connection/index.d.mts +10 -10
- package/dist/model/connection/index.mjs +3 -3
- package/dist/model/connection/model/index.d.mts +9 -9
- package/dist/model/connection/model/index.mjs +2 -2
- package/dist/model/index.d.mts +11 -11
- package/dist/model/index.mjs +4 -4
- package/dist/shared/{core.CDvVInBp.d.mts → core.0zAQeenX.d.mts} +3 -3
- package/dist/shared/core.3ZhnKAlZ.mjs +106 -0
- package/dist/shared/{core.CwsG7hOw.d.mts → core.5ZQ-r3Oa.d.mts} +1 -1
- package/dist/shared/{core.hNWo20Ym.d.mts → core.B73yxfPi.d.mts} +55 -36
- package/dist/shared/{core.Cq2kxOI-.d.mts → core.BGFjN3nv.d.mts} +3 -3
- package/dist/shared/{core.rCeaAqgW.mjs → core.BdPcbSkN.mjs} +1 -1
- package/dist/shared/core.BhNcrwzK.mjs +7 -0
- package/dist/shared/core.BkVA6gjl.mjs +5 -0
- package/dist/shared/core.BuQZczj6.mjs +38 -0
- package/dist/shared/{core.2N_9BzyD.mjs → core.CQPEY2wQ.mjs} +5 -4
- package/dist/shared/{core.DFi2dOTl.mjs → core.CR3PmPzr.mjs} +85 -1
- package/dist/shared/{core.DyToofsP.mjs → core.CRI1AjFj.mjs} +276 -145
- package/dist/shared/{core.CXWsKEDr.mjs → core.CWwSgOzF.mjs} +268 -631
- package/dist/shared/{core.727Qoh_W.mjs → core.CdNCAwq7.mjs} +2 -101
- package/dist/shared/{core.QJD_fcrc.mjs → core.CmPXpJ8l.mjs} +1 -14
- package/dist/shared/{core.DTdfiejA.d.mts → core.Cog93roC.d.mts} +2 -2
- package/dist/shared/core.Coi_LOUZ.mjs +7 -0
- package/dist/shared/{core.CcJ1FZ7h.d.mts → core.CpURdWRM.d.mts} +174 -76
- package/dist/shared/{core.D5fzJWbF.d.mts → core.DB0Ue5Wx.d.mts} +1 -1
- package/dist/shared/{core.DNbUPnve.mjs → core.DEieYfbG.mjs} +27 -25
- package/dist/shared/{core.BYNkXQ8A.mjs → core.DH7TXqXf.mjs} +30 -1
- package/dist/shared/{core.DMMOWQqc.mjs → core.DIE3F6sw.mjs} +2 -2
- package/dist/shared/{core.D0NziuvN.mjs → core.DViDmiAu.mjs} +5 -5
- package/dist/shared/{core.Be05qJwN.mjs → core.D_f4F48-.mjs} +41 -18
- package/dist/shared/{core.C2TiyjI6.mjs → core.DbfO90vF.mjs} +20 -31
- package/dist/shared/{core.BT-9gaqQ.d.mts → core.DnCLhN8C.d.mts} +83 -94
- package/dist/shared/{core.BouyJs63.mjs → core.DqlrMlsf.mjs} +1 -1
- package/dist/shared/{core.CNgZvKb8.mjs → core.DrUt0Lbi.mjs} +1 -1
- package/dist/shared/{core.CT1xBp4R.d.mts → core.Dvh1H0T2.d.mts} +2 -2
- package/dist/shared/core.M9ayqQZa.mjs +1207 -0
- package/dist/shared/{core.CvLjw3bH.d.mts → core.mUnpvHtA.d.mts} +96 -12
- package/dist/shared/core.oSV6SRfk.mjs +13 -0
- package/dist/shared/core.q10OP9oJ.mjs +5 -0
- package/dist/shared/{core.BXs4wY7R.d.mts → core.t3qfsVvn.d.mts} +4 -4
- package/dist/shared/core.uFk_o9X6.mjs +13 -0
- package/dist/shared/core.vzLtp8i3.mjs +1282 -0
- package/dist/styles/index.d.mts +18 -8
- package/dist/styles/index.mjs +63 -1
- package/dist/types/_aux.d.mts +2 -2
- package/dist/types/_aux.mjs +8 -1
- package/dist/types/expression-model.d.mts +3 -3
- package/dist/types/expression.d.mts +3 -3
- package/dist/types/fqnRef.d.mts +7 -8
- package/dist/types/index.d.mts +17 -13
- package/dist/types/index.mjs +51 -14
- package/dist/utils/graphology/index.mjs +1 -1
- package/dist/utils/index.d.mts +3 -2
- package/dist/utils/index.mjs +9 -6
- package/dist/utils/iterable/index.d.mts +1 -1
- package/dist/utils/iterable/index.mjs +2 -1
- package/package.json +18 -17
- package/dist/shared/core.01VTr9qu.mjs +0 -170
- package/dist/shared/core.1vX5a9AY.mjs +0 -86
- package/dist/shared/core.BazD6cot.mjs +0 -14
- package/dist/shared/core.BzTakU3I.mjs +0 -67
- package/dist/shared/core.OHD4KXm9.mjs +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Tagged, NonEmptyTuple, PartialDeep, WritableDeep, Except } from 'type-fest';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Tagged, NonEmptyTuple, IsNever, PartialDeep, WritableDeep, Except } from 'type-fest';
|
|
2
|
+
import { h as ElementShape, C as Color, B as BorderStyle, e as ShapeSize, S as SpacingSize, d as TextSize, f as RelationshipLineType, g as RelationshipArrowType, T as ThemeColor, G as ColorLiteral, Q as CustomColorDefinitions, a as LikeC4Theme, b as LikeC4StyleDefaults } from './core.0zAQeenX.mjs';
|
|
3
|
+
import { A as Any, s as WithOptionalTags, u as WithOptionalLinks, S as StrictViewId, m as _stage, n as _type, F as Fqn, R as RelationKind, W as WithDescriptionAndTech, v as WithMetadata, w as WithNotation, E as ElementKind, T as Tag, y as DeploymentKind, C as MetadataKey, G as WithTags, x as DeploymentFqn } from './core.B73yxfPi.mjs';
|
|
4
|
+
import { N as NonEmptyArray, E as ExclusiveUnion, a as NonEmptyReadonlyArray, L as Link } from './core.DB0Ue5Wx.mjs';
|
|
5
|
+
import { M as MarkdownOrString, I as Icon, d as RelationId, T as Tag$1, P as ProjectId, N as NodeId, j as EdgeId, m as StepEdgeKind } from './core.DX-WYEPA.mjs';
|
|
5
6
|
import { FqnRef } from '../types/fqnRef.mjs';
|
|
6
|
-
import { N as NonEmptyArray, E as ExclusiveUnion, a as NonEmptyReadonlyArray } from './core.D5fzJWbF.mjs';
|
|
7
7
|
import { ModelExpression, ModelFqnExpr } from '../types/expression-model.mjs';
|
|
8
8
|
|
|
9
9
|
type Point = readonly [x: number, y: number];
|
|
@@ -19,11 +19,20 @@ interface BBox {
|
|
|
19
19
|
}
|
|
20
20
|
declare namespace BBox {
|
|
21
21
|
function center({ x, y, width, height }: BBox): XYPoint;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the four corner points of the box in clockwise order starting from top-left
|
|
24
|
+
*/
|
|
25
|
+
function toPoints({ x, y, width, height }: BBox): [XYPoint, XYPoint, XYPoint, XYPoint];
|
|
22
26
|
function fromPoints(points: Point[]): BBox;
|
|
23
27
|
function merge(...boxes: BBox[]): BBox;
|
|
28
|
+
function fromRectBox(rect: RectBox): BBox;
|
|
24
29
|
function toRectBox(box: BBox): RectBox;
|
|
25
30
|
function expand(box: BBox, plus: number): BBox;
|
|
26
31
|
function shrink(box: BBox, minus: number): BBox;
|
|
32
|
+
/**
|
|
33
|
+
* Returns true if `a` includes `b` (i.e. `b` is inside `a`)
|
|
34
|
+
*/
|
|
35
|
+
function includes(a: BBox, b: BBox): boolean;
|
|
27
36
|
}
|
|
28
37
|
interface RectBox {
|
|
29
38
|
x1: number;
|
|
@@ -36,6 +45,10 @@ declare namespace RectBox {
|
|
|
36
45
|
function fromPoints(points: Point[]): RectBox;
|
|
37
46
|
function merge(...boxes: RectBox[]): RectBox;
|
|
38
47
|
function toBBox(box: RectBox): BBox;
|
|
48
|
+
/**
|
|
49
|
+
* Returns true if `a` includes `b` (i.e. `b` is inside `a`)
|
|
50
|
+
*/
|
|
51
|
+
function includes(a: RectBox, b: RectBox): boolean;
|
|
39
52
|
}
|
|
40
53
|
|
|
41
54
|
interface AnyIncludePredicate<Expr> {
|
|
@@ -82,6 +95,12 @@ interface ViewAutoLayout {
|
|
|
82
95
|
rankSep?: number;
|
|
83
96
|
nodeSep?: number;
|
|
84
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* v1 Manual layout of a view, stored in the block comment to the view definition.
|
|
100
|
+
* Keeping this type for backward compatibility and migration purposes.
|
|
101
|
+
*
|
|
102
|
+
* @deprecated Use {@link ViewManualLayoutSnapshot} instead
|
|
103
|
+
*/
|
|
85
104
|
type ViewManualLayout = {
|
|
86
105
|
readonly hash: string;
|
|
87
106
|
readonly x: number;
|
|
@@ -97,7 +116,6 @@ type ViewManualLayout = {
|
|
|
97
116
|
height: number;
|
|
98
117
|
}>;
|
|
99
118
|
readonly edges: Record<string, {
|
|
100
|
-
dotpos?: string;
|
|
101
119
|
points: NonEmptyArray<Point>;
|
|
102
120
|
controlPoints?: NonEmptyArray<XYPoint>;
|
|
103
121
|
labelBBox?: BBox;
|
|
@@ -125,10 +143,6 @@ interface BaseParsedViewProperties<A extends Any> extends BaseViewProperties<A>
|
|
|
125
143
|
* Undefined if the view is auto-generated.
|
|
126
144
|
*/
|
|
127
145
|
readonly docUri?: string | undefined;
|
|
128
|
-
/**
|
|
129
|
-
* If the view is changed manually this field contains the layout data.
|
|
130
|
-
*/
|
|
131
|
-
readonly manualLayout?: ViewManualLayout | undefined;
|
|
132
146
|
}
|
|
133
147
|
type NodeNotation = {
|
|
134
148
|
kinds: string[];
|
|
@@ -320,6 +334,64 @@ interface Relationship<A extends Any = Any> extends AbstractRelationship<A> {
|
|
|
320
334
|
*/
|
|
321
335
|
type ModelRelation<A extends Any = Any> = Relationship<A>;
|
|
322
336
|
|
|
337
|
+
/**
|
|
338
|
+
* Element and deployment kind specification
|
|
339
|
+
*/
|
|
340
|
+
interface ElementSpecification {
|
|
341
|
+
tags?: Tag$1[];
|
|
342
|
+
title?: string;
|
|
343
|
+
summary?: MarkdownOrString;
|
|
344
|
+
description?: MarkdownOrString;
|
|
345
|
+
technology?: string;
|
|
346
|
+
notation?: string;
|
|
347
|
+
links?: NonEmptyArray<Link>;
|
|
348
|
+
style: {
|
|
349
|
+
shape?: ElementShape;
|
|
350
|
+
icon?: Icon;
|
|
351
|
+
color?: Color;
|
|
352
|
+
border?: BorderStyle;
|
|
353
|
+
opacity?: number;
|
|
354
|
+
size?: ShapeSize;
|
|
355
|
+
padding?: SpacingSize;
|
|
356
|
+
textSize?: TextSize;
|
|
357
|
+
multiple?: boolean;
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
interface TagSpecification {
|
|
361
|
+
color: ThemeColor | ColorLiteral;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Checks if tag color is defined in the specification
|
|
365
|
+
* Expects HEX, `rgb(...)` or `rgba(...)` color
|
|
366
|
+
*/
|
|
367
|
+
declare function isTagColorSpecified(spec: string | TagSpecification): spec is {
|
|
368
|
+
color: ColorLiteral;
|
|
369
|
+
};
|
|
370
|
+
interface RelationshipSpecification {
|
|
371
|
+
technology?: string;
|
|
372
|
+
notation?: string;
|
|
373
|
+
color?: Color;
|
|
374
|
+
line?: RelationshipLineType;
|
|
375
|
+
head?: RelationshipArrowType;
|
|
376
|
+
tail?: RelationshipArrowType;
|
|
377
|
+
}
|
|
378
|
+
type Specification<A> = A extends Any ? {
|
|
379
|
+
tags: {
|
|
380
|
+
[key in Tag<A>]: TagSpecification;
|
|
381
|
+
};
|
|
382
|
+
elements: {
|
|
383
|
+
[key in ElementKind<A>]: Partial<ElementSpecification>;
|
|
384
|
+
};
|
|
385
|
+
deployments: {
|
|
386
|
+
[key in DeploymentKind<A>]: Partial<ElementSpecification>;
|
|
387
|
+
};
|
|
388
|
+
relationships: {
|
|
389
|
+
[key in RelationKind<A>]: Partial<RelationshipSpecification>;
|
|
390
|
+
};
|
|
391
|
+
metadataKeys?: IsNever<MetadataKey<A>> extends true ? never : MetadataKey<A>[];
|
|
392
|
+
customColors?: CustomColorDefinitions;
|
|
393
|
+
} : never;
|
|
394
|
+
|
|
323
395
|
type LikeC4ProjectTheme = PartialDeep<WritableDeep<LikeC4Theme>, {
|
|
324
396
|
recurseIntoArrays: false;
|
|
325
397
|
allowUndefinedInNonTupleArrays: false;
|
|
@@ -332,6 +404,9 @@ interface LikeC4ProjectStylesConfig {
|
|
|
332
404
|
theme?: LikeC4ProjectTheme;
|
|
333
405
|
defaults?: LikeC4ProjectStyleDefaults;
|
|
334
406
|
}
|
|
407
|
+
interface LikeC4ProjectManualLayoutsConfig {
|
|
408
|
+
outDir: string;
|
|
409
|
+
}
|
|
335
410
|
/**
|
|
336
411
|
* Configuration of the project, as read from the config file.
|
|
337
412
|
* LikeC4 projects encapsulate models, and can import from each other
|
|
@@ -346,6 +421,10 @@ interface LikeC4Project {
|
|
|
346
421
|
* Custom styles
|
|
347
422
|
*/
|
|
348
423
|
styles?: LikeC4ProjectStylesConfig | undefined;
|
|
424
|
+
/**
|
|
425
|
+
* Configuration for manual layouts snapshots
|
|
426
|
+
*/
|
|
427
|
+
manualLayouts?: LikeC4ProjectManualLayoutsConfig | undefined;
|
|
349
428
|
}
|
|
350
429
|
|
|
351
430
|
type ComputedNodeStyle = Except<ElementStyle, 'icon' | 'shape' | 'color', {
|
|
@@ -425,7 +504,12 @@ interface BaseComputedViewProperties<A extends Any> extends BaseViewProperties<A
|
|
|
425
504
|
readonly nodes: ComputedNode<A>[];
|
|
426
505
|
readonly edges: ComputedEdge<A>[];
|
|
427
506
|
/**
|
|
428
|
-
* If the view
|
|
507
|
+
* If the view has manual layout (v2)
|
|
508
|
+
*/
|
|
509
|
+
readonly hasManualLayout?: boolean;
|
|
510
|
+
/**
|
|
511
|
+
* Manual layout data (v1), for compatibility during migration
|
|
512
|
+
* @deprecated
|
|
429
513
|
*/
|
|
430
514
|
readonly manualLayout?: ViewManualLayout | undefined;
|
|
431
515
|
}
|
|
@@ -447,4 +531,4 @@ interface ComputedDynamicView<A extends Any = Any> extends BaseComputedViewPrope
|
|
|
447
531
|
readonly variant: DynamicViewDisplayVariant;
|
|
448
532
|
}
|
|
449
533
|
|
|
450
|
-
export { type
|
|
534
|
+
export { type DynamicStepsParallel as $, type AbstractRelationship as A, BBox as B, type ComputedNodeStyle as C, type ViewManualLayout as D, type ElementStyle as E, type ViewType as F, type GlobalPredicateId as G, type BaseViewProperties as H, type BaseParsedViewProperties as I, type ViewWithNotation as J, type ViewWithHash as K, type LikeC4ProjectStylesConfig as L, type ModelGlobals as M, type NodeNotation as N, type ComputedNode as O, type Point as P, type ComputedEdge as Q, RectBox as R, type Specification as S, type TagSpecification as T, type ComputedElementView as U, type ViewRuleGlobalStyle as V, type ComputedDeploymentView as W, type XYPoint as X, type ComputedDynamicView as Y, type DynamicStep as Z, type DynamicStepsSeries as _, type GlobalPredicates as a, getParallelStepsPrefix as a0, type DynamicViewStep as a1, isDynamicStep as a2, isDynamicStepsParallel as a3, isDynamicStepsSeries as a4, type DynamicViewIncludeRule as a5, type DynamicViewRule as a6, type DynamicViewDisplayVariant as a7, type ParsedDynamicView as a8, type ElementViewIncludePredicate as a9, type ElementViewExcludePredicate as aa, type ElementViewPredicate as ab, type ElementViewRuleGroup as ac, isViewRuleGroup as ad, type ElementViewRuleStyle as ae, type ElementViewRule as af, type ParsedElementView as ag, type GlobalDynamicPredicates as b, type GlobalStyleID as c, type GlobalStyles as d, ensureSizes as e, type Element as f, type Relationship as g, type ModelRelation as h, type ElementSpecification as i, isTagColorSpecified as j, type RelationshipSpecification as k, type LikeC4ProjectTheme as l, type LikeC4ProjectStyleDefaults as m, type LikeC4ProjectManualLayoutsConfig as n, type LikeC4Project as o, type AnyIncludePredicate as p, type AnyExcludePredicate as q, type AnyViewRuleStyle as r, isViewRuleGlobalStyle as s, type ViewRuleGlobalPredicateRef as t, isViewRuleGlobalPredicateRef as u, type AutoLayoutDirection as v, isAutoLayoutDirection as w, type ViewRuleAutoLayout as x, isViewRuleAutoLayout as y, type ViewAutoLayout as z };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { i as invariant } from './core.D4npX2q8.mjs';
|
|
2
|
+
|
|
3
|
+
function stringHash(str) {
|
|
4
|
+
let hash = 5381;
|
|
5
|
+
const len = str.length;
|
|
6
|
+
invariant(len > 0, "stringHash: empty string");
|
|
7
|
+
for (let i = 0; i < len; i++) {
|
|
8
|
+
hash = hash * 33 ^ str.charCodeAt(i);
|
|
9
|
+
}
|
|
10
|
+
return (hash >>> 0).toString(36);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { stringHash as s };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as Connection, c as customInspectSymbol } from './core.
|
|
2
|
-
import { e as DeploymentElementModel, h as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.
|
|
3
|
-
import { A as Any,
|
|
4
|
-
import { c as IteratorLike } from './core.
|
|
1
|
+
import { C as Connection, c as customInspectSymbol } from './core.Cog93roC.mjs';
|
|
2
|
+
import { e as DeploymentElementModel, h as RelationshipsAccum, D as DeploymentNodeModel, R as RelationshipModel, b as DeploymentRelationModel } from './core.CpURdWRM.mjs';
|
|
3
|
+
import { A as Any, z as EdgeId } from './core.B73yxfPi.mjs';
|
|
4
|
+
import { c as IteratorLike } from './core.DB0Ue5Wx.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Connection is ephemeral entity, result of a resolving relationships between source and target.
|