@likec4/core 1.44.0 → 1.46.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.
Files changed (74) hide show
  1. package/dist/builder/index.d.mts +15 -13
  2. package/dist/builder/index.mjs +33 -17
  3. package/dist/compute-view/index.d.mts +8 -7
  4. package/dist/compute-view/index.mjs +7 -6
  5. package/dist/compute-view/relationships-view/index.d.mts +8 -7
  6. package/dist/compute-view/relationships-view/index.mjs +2 -2
  7. package/dist/geometry/index.d.mts +109 -0
  8. package/dist/geometry/index.mjs +328 -0
  9. package/dist/index.d.mts +29 -7
  10. package/dist/index.mjs +10 -8
  11. package/dist/model/connection/deployment/index.d.mts +10 -9
  12. package/dist/model/connection/deployment/index.mjs +2 -2
  13. package/dist/model/connection/index.d.mts +11 -10
  14. package/dist/model/connection/index.mjs +3 -3
  15. package/dist/model/connection/model/index.d.mts +10 -9
  16. package/dist/model/connection/model/index.mjs +2 -2
  17. package/dist/model/index.d.mts +13 -26
  18. package/dist/model/index.mjs +4 -4
  19. package/dist/shared/{core.Bv3cd-jC.mjs → core.3ZhnKAlZ.mjs} +9 -5
  20. package/dist/shared/{core.CKNmSm2W.d.mts → core.5gPDaaG5.d.mts} +9 -15
  21. package/dist/shared/{core.BnOetIAR.d.mts → core.9U0HL3oG.d.mts} +3 -3
  22. package/dist/shared/{core.M9ayqQZa.mjs → core.BK-tI3Q3.mjs} +2 -3
  23. package/dist/shared/{core.DjAM-S6a.d.mts → core.BLG-ADpi.d.mts} +16 -14
  24. package/dist/shared/core.BPGOjone.d.mts +46 -0
  25. package/dist/shared/{core.DIE3F6sw.mjs → core.BYdtmqY5.mjs} +1 -2
  26. package/dist/shared/core.BhNcrwzK.mjs +7 -0
  27. package/dist/shared/{core.CDOKQTW6.d.mts → core.BkSYCfRg.d.mts} +2 -2
  28. package/dist/shared/core.BkVA6gjl.mjs +5 -0
  29. package/dist/shared/{core.5ZQ-r3Oa.d.mts → core.BqtAzeAh.d.mts} +1 -1
  30. package/dist/shared/{core.DEieYfbG.mjs → core.BspBF3SJ.mjs} +22 -70
  31. package/dist/shared/{core.BnDbAOR2.d.mts → core.Byj60hH6.d.mts} +3 -3
  32. package/dist/shared/{core.CR3PmPzr.mjs → core.CBLX4mT8.mjs} +3811 -15032
  33. package/dist/shared/{core.DX-WYEPA.d.mts → core.CDdf8izT.d.mts} +4 -2
  34. package/dist/shared/core.CLSZtnFh.mjs +69 -0
  35. package/dist/shared/{core.bKIs4oDO.mjs → core.CQPEY2wQ.mjs} +5 -4
  36. package/dist/shared/{core.WwMWeiFL.d.mts → core.CQYL_Z-_.d.mts} +3 -3
  37. package/dist/shared/{core.6VsRBhGY.mjs → core.CdNCAwq7.mjs} +1 -1
  38. package/dist/shared/{core.DrUt0Lbi.mjs → core.CmGY9blO.mjs} +198 -291
  39. package/dist/shared/core.Coi_LOUZ.mjs +7 -0
  40. package/dist/shared/{core.C_Ni6yHl.mjs → core.D0WZutNd.mjs} +3 -1
  41. package/dist/shared/{core.DTJYgLXI.d.mts → core.D4Y4U8Lp.d.mts} +3 -3
  42. package/dist/shared/{core.BMtVqKl7.d.mts → core.DE-g9oFF.d.mts} +22 -46
  43. package/dist/shared/{core.23WeDKcI.mjs → core.DJpiszim.mjs} +265 -233
  44. package/dist/shared/{core.h4TqqSC0.mjs → core.DU8pv3Q6.mjs} +71 -1174
  45. package/dist/shared/{core.CHwVhuc9.mjs → core.DbQpDoJS.mjs} +12 -15
  46. package/dist/shared/{core.CbsSAn1j.mjs → core.DbfO90vF.mjs} +1 -12
  47. package/dist/shared/{core.C0Ye2OCr.mjs → core.DqlrMlsf.mjs} +1 -1
  48. package/dist/shared/core.Qv7vZIwZ.mjs +1282 -0
  49. package/dist/shared/core.oSV6SRfk.mjs +13 -0
  50. package/dist/shared/{core.BuQZczj6.mjs → core.om36dXXW.mjs} +5 -2
  51. package/dist/shared/{core.8mmHFn9g.d.mts → core.or6-EHsb.d.mts} +2 -2
  52. package/dist/shared/{core.DFCHU59b.mjs → core.xeuDd__E.mjs} +3 -4
  53. package/dist/styles/index.d.mts +7 -6
  54. package/dist/styles/index.mjs +4 -4
  55. package/dist/types/_aux.d.mts +2 -2
  56. package/dist/types/expression-model.d.mts +3 -3
  57. package/dist/types/expression.d.mts +3 -3
  58. package/dist/types/fqnRef.d.mts +2 -2
  59. package/dist/types/fqnRef.mjs +1 -1
  60. package/dist/types/index.d.mts +11 -9
  61. package/dist/types/index.mjs +6 -166
  62. package/dist/types/scalar.d.mts +1 -1
  63. package/dist/types/scalar.mjs +1 -1
  64. package/dist/utils/graphology/index.mjs +1 -1
  65. package/dist/utils/index.d.mts +3 -3
  66. package/dist/utils/index.mjs +9 -8
  67. package/dist/utils/iterable/index.d.mts +17 -1
  68. package/dist/utils/iterable/index.mjs +17 -1
  69. package/geometry/package.json +4 -0
  70. package/package.json +20 -12
  71. package/dist/shared/core.B9BjmjuH.mjs +0 -9
  72. package/dist/shared/core.BR4zXDH-.mjs +0 -13
  73. package/dist/shared/core.BdPcbSkN.mjs +0 -118
  74. package/dist/shared/core.OHD4KXm9.mjs +0 -5
@@ -1,51 +1,11 @@
1
1
  import { Tagged, NonEmptyTuple, IsNever, PartialDeep, WritableDeep, Except } from 'type-fest';
2
- import { s as BorderStyle, q as ShapeSize, r as SpacingSize, p as TextSize, Q as Color, u as ElementShape, v as RelationshipLineType, y as RelationshipArrowType, D as ThemeColor, C as ColorLiteral, I as CustomColorDefinitions, b as LikeC4Theme, L as LikeC4StyleDefaults } from './core.BnOetIAR.mjs';
3
- import { A as Any, s as WithOptionalTags, u as WithOptionalLinks, m as StrictViewId, j as _stage, k as _type, F as Fqn, R as RelationKind, W as WithDescriptionAndTech, v as WithMetadata, w as WithNotation, n as ElementKind, T as Tag, y as DeploymentKind, C as MetadataKey, G as WithTags, x as DeploymentFqn } from './core.CDOKQTW6.mjs';
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.9U0HL3oG.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.BkSYCfRg.mjs';
4
4
  import { N as NonEmptyArray, E as ExclusiveUnion, a as NonEmptyReadonlyArray, L as Link } from './core.DB0Ue5Wx.mjs';
5
- import { I as Icon, M as MarkdownOrString, 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
+ import { M as MarkdownOrString, I as Icon, d as RelationId, T as Tag$1, P as ProjectId, j as NodeId, k as EdgeId, n as StepEdgeKind } from './core.CDdf8izT.mjs';
6
6
  import { FqnRef } from '../types/fqnRef.mjs';
7
7
  import { ModelExpression, ModelFqnExpr } from '../types/expression-model.mjs';
8
-
9
- type Point = readonly [x: number, y: number];
10
- interface XYPoint {
11
- x: number;
12
- y: number;
13
- }
14
- interface BBox {
15
- x: number;
16
- y: number;
17
- width: number;
18
- height: number;
19
- }
20
- declare namespace BBox {
21
- function center({ x, y, width, height }: BBox): XYPoint;
22
- function fromPoints(points: Point[]): BBox;
23
- function merge(...boxes: BBox[]): BBox;
24
- function fromRectBox(rect: RectBox): BBox;
25
- function toRectBox(box: BBox): RectBox;
26
- function expand(box: BBox, plus: number): BBox;
27
- function shrink(box: BBox, minus: number): BBox;
28
- /**
29
- * Returns true if `a` includes `b` (i.e. `b` is inside `a`)
30
- */
31
- function includes(a: BBox, b: BBox): boolean;
32
- }
33
- interface RectBox {
34
- x1: number;
35
- y1: number;
36
- x2: number;
37
- y2: number;
38
- }
39
- declare namespace RectBox {
40
- function center({ x1, y1, x2, y2 }: RectBox): XYPoint;
41
- function fromPoints(points: Point[]): RectBox;
42
- function merge(...boxes: RectBox[]): RectBox;
43
- function toBBox(box: RectBox): BBox;
44
- /**
45
- * Returns true if `a` includes `b` (i.e. `b` is inside `a`)
46
- */
47
- function includes(a: RectBox, b: RectBox): boolean;
48
- }
8
+ import { P as Point, X as XYPoint, B as BBox } from './core.BPGOjone.mjs';
49
9
 
50
10
  interface AnyIncludePredicate<Expr> {
51
11
  include: Expr[];
@@ -78,6 +38,11 @@ interface ViewRuleGlobalPredicateRef {
78
38
  predicateId: GlobalPredicateId;
79
39
  }
80
40
  declare function isViewRuleGlobalPredicateRef(rule: object): rule is ViewRuleGlobalPredicateRef;
41
+ type RankValue = 'max' | 'min' | 'same' | 'sink' | 'source';
42
+ interface ViewRuleRank<Expr> {
43
+ targets: Expr[];
44
+ rank: RankValue;
45
+ }
81
46
  type AutoLayoutDirection = 'TB' | 'BT' | 'LR' | 'RL';
82
47
  declare function isAutoLayoutDirection(autoLayout: unknown): autoLayout is AutoLayoutDirection;
83
48
  interface ViewRuleAutoLayout {
@@ -112,7 +77,6 @@ type ViewManualLayout = {
112
77
  height: number;
113
78
  }>;
114
79
  readonly edges: Record<string, {
115
- dotpos?: string;
116
80
  points: NonEmptyArray<Point>;
117
81
  controlPoints?: NonEmptyArray<XYPoint>;
118
82
  labelBBox?: BBox;
@@ -182,6 +146,9 @@ interface ElementViewRuleGroup<A extends Any = Any> {
182
146
  declare function isViewRuleGroup<A extends Any>(rule: ElementViewRule<A>): rule is ElementViewRuleGroup<A>;
183
147
  interface ElementViewRuleStyle<A extends Any = Any> extends AnyViewRuleStyle<ModelFqnExpr<A>> {
184
148
  }
149
+ interface ElementViewRuleRank<A extends Any = Any> extends ViewRuleRank<ModelFqnExpr<A>> {
150
+ }
151
+ declare function isViewRuleRank<A extends Any>(rule: ElementViewRule<A>): rule is ElementViewRuleRank<A>;
185
152
  type ElementViewRule<A extends Any = Any> = ExclusiveUnion<{
186
153
  IncludePredicate: ElementViewIncludePredicate<A>;
187
154
  ExcludePredicate: ElementViewExcludePredicate<A>;
@@ -190,6 +157,7 @@ type ElementViewRule<A extends Any = Any> = ExclusiveUnion<{
190
157
  GlobalStyle: ViewRuleGlobalStyle;
191
158
  GlobalPredicateRef: ViewRuleGlobalPredicateRef;
192
159
  AutoLayout: ViewRuleAutoLayout;
160
+ Rank: ElementViewRuleRank<A>;
193
161
  }>;
194
162
  interface ParsedElementView<A extends Any = Any> extends BaseParsedViewProperties<A> {
195
163
  [_type]: 'element';
@@ -418,6 +386,9 @@ interface LikeC4Project {
418
386
  * Custom styles
419
387
  */
420
388
  styles?: LikeC4ProjectStylesConfig | undefined;
389
+ /**
390
+ * Configuration for manual layouts snapshots
391
+ */
421
392
  manualLayouts?: LikeC4ProjectManualLayoutsConfig | undefined;
422
393
  }
423
394
 
@@ -492,6 +463,10 @@ interface ComputedEdge<A extends Any = Any> extends WithOptionalTags<A> {
492
463
  */
493
464
  dir?: 'forward' | 'back' | 'both';
494
465
  }
466
+ interface ComputedRankConstraint {
467
+ type: RankValue;
468
+ nodes: NodeId[];
469
+ }
495
470
  interface BaseComputedViewProperties<A extends Any> extends BaseViewProperties<A>, ViewWithHash, ViewWithNotation {
496
471
  readonly [_stage]: 'computed';
497
472
  readonly autoLayout: ViewAutoLayout;
@@ -511,6 +486,7 @@ interface ComputedElementView<A extends Any = Any> extends BaseComputedViewPrope
511
486
  readonly [_type]: 'element';
512
487
  readonly viewOf?: Fqn<A>;
513
488
  readonly extends?: StrictViewId<A>;
489
+ readonly ranks?: ComputedRankConstraint[];
514
490
  }
515
491
  interface ComputedDeploymentView<A extends Any = Any> extends BaseComputedViewProperties<A> {
516
492
  readonly [_type]: 'deployment';
@@ -525,4 +501,4 @@ interface ComputedDynamicView<A extends Any = Any> extends BaseComputedViewPrope
525
501
  readonly variant: DynamicViewDisplayVariant;
526
502
  }
527
503
 
528
- export { type DynamicStepsParallel as $, type AbstractRelationship as A, BBox as B, type ViewManualLayout as C, type ViewType as D, type ElementStyle as E, type BaseViewProperties as F, type GlobalPredicateId as G, type BaseParsedViewProperties as H, type ViewWithNotation as I, type ViewWithHash as J, type ComputedNodeStyle as K, type LikeC4ProjectTheme 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 LikeC4ProjectStyleDefaults as l, type LikeC4ProjectStylesConfig 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 };
504
+ export { getParallelStepsPrefix as $, type AbstractRelationship as A, type ViewAutoLayout 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 ComputedEdge as P, type ComputedRankConstraint as Q, type Relationship as R, type Specification as S, type TagSpecification as T, type ComputedElementView as U, type ViewRuleGlobalStyle as V, type ComputedDeploymentView as W, type ComputedDynamicView as X, type DynamicStep as Y, type DynamicStepsSeries as Z, type DynamicStepsParallel as _, type GlobalPredicates as a, type DynamicViewStep as a0, isDynamicStep as a1, isDynamicStepsParallel as a2, isDynamicStepsSeries as a3, type DynamicViewIncludeRule as a4, type DynamicViewRule as a5, type DynamicViewDisplayVariant as a6, type ParsedDynamicView as a7, type ElementViewIncludePredicate as a8, type ElementViewExcludePredicate as a9, type ElementViewPredicate as aa, type ElementViewRuleGroup as ab, isViewRuleGroup as ac, type ElementViewRuleStyle as ad, type ElementViewRuleRank as ae, isViewRuleRank as af, type ElementViewRule as ag, type ParsedElementView as ah, type GlobalDynamicPredicates as b, type GlobalStyleID as c, type GlobalStyles as d, ensureSizes as e, type Element as f, type ModelRelation as g, type ElementSpecification as h, isTagColorSpecified as i, type RelationshipSpecification as j, type LikeC4ProjectTheme as k, type LikeC4ProjectStyleDefaults as l, type LikeC4ProjectManualLayoutsConfig as m, type LikeC4Project as n, type AnyIncludePredicate as o, type AnyExcludePredicate as p, type AnyViewRuleStyle as q, isViewRuleGlobalStyle as r, type ViewRuleGlobalPredicateRef as s, isViewRuleGlobalPredicateRef as t, type RankValue as u, type ViewRuleRank as v, type AutoLayoutDirection as w, isAutoLayoutDirection as x, type ViewRuleAutoLayout as y, isViewRuleAutoLayout as z };