@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,10 +1,11 @@
1
1
  import { Simplify, IsAny } from 'type-fest';
2
- import { A as Any, U as Unknown, W as WithDescriptionAndTech, s as WithOptionalTags, u as WithOptionalLinks, v as WithMetadata, w as WithNotation, x as DeploymentFqn, y as DeploymentKind, F as Fqn, k as _type, j as _stage, l as _layout, N as NodeId, z as EdgeId, m as StrictViewId, E as ExtractOnStage, M as ModelStage, P as ProjectId, o as ElementId, D as DeploymentId, c as AnyParsed, g as UnknownParsed, V as ViewId$1, a as AnyComputed, e as UnknownComputed, b as AnyLayouted, f as UnknownLayouted, S as SpecAux, d as Aux, B as Never } from './core.CDOKQTW6.mjs';
2
+ import { A as Any, U as Unknown, W as WithDescriptionAndTech, s as WithOptionalTags, u as WithOptionalLinks, v as WithMetadata, w as WithNotation, x as DeploymentFqn, y as DeploymentKind, F as Fqn, n as _type, m as _stage, o as _layout, S as StrictViewId, N as NodeId, z as EdgeId, k as ExtractOnStage, M as ModelStage, P as ProjectId, a as ElementId, D as DeploymentId, d as AnyParsed, i as UnknownParsed, V as ViewId$1, b as AnyComputed, g as UnknownComputed, c as AnyLayouted, h as UnknownLayouted, f as SpecAux, e as Aux, B as Never } from './core.BkSYCfRg.mjs';
3
3
  import { a as NonEmptyReadonlyArray, N as NonEmptyArray, E as ExclusiveUnion, K as KeysOf } from './core.DB0Ue5Wx.mjs';
4
- import { E as ElementStyle, A as AbstractRelationship, D as ViewType, B as BBox, z as ViewAutoLayout, I as ViewWithNotation, F as BaseViewProperties, J as ViewWithHash, O as ComputedNode, Q as ComputedEdge, P as Point, X as XYPoint, a7 as DynamicViewDisplayVariant, H as BaseParsedViewProperties, p as AnyIncludePredicate, q as AnyExcludePredicate, r as AnyViewRuleStyle, x as ViewRuleAutoLayout, ag as ParsedElementView, a8 as ParsedDynamicView, U as ComputedElementView, W as ComputedDeploymentView, Y as ComputedDynamicView, o as LikeC4Project, S as Specification, f as Element, g as Relationship, M as ModelGlobals } from './core.BMtVqKl7.mjs';
4
+ import { E as ElementStyle, A as AbstractRelationship, F as ViewType, B as ViewAutoLayout, J as ViewWithNotation, H as BaseViewProperties, K as ViewWithHash, O as ComputedNode, P as ComputedEdge, a6 as DynamicViewDisplayVariant, I as BaseParsedViewProperties, o as AnyIncludePredicate, p as AnyExcludePredicate, q as AnyViewRuleStyle, y as ViewRuleAutoLayout, ah as ParsedElementView, a7 as ParsedDynamicView, U as ComputedElementView, W as ComputedDeploymentView, X as ComputedDynamicView, n as LikeC4Project, S as Specification, f as Element, R as Relationship, M as ModelGlobals } from './core.DE-g9oFF.mjs';
5
5
  import { FqnRef } from '../types/fqnRef.mjs';
6
- import { F as Fqn$1, V as ViewId, M as MarkdownOrString, d as RelationId } from './core.DX-WYEPA.mjs';
7
- import { E as Expression, F as FqnExpr } from './core.BnOetIAR.mjs';
6
+ import { F as Fqn$1, V as ViewId, M as MarkdownOrString, d as RelationId } from './core.CDdf8izT.mjs';
7
+ import { B as BBox, P as Point, X as XYPoint } from './core.BPGOjone.mjs';
8
+ import { j as Expression, F as FqnExpr } from './core.9U0HL3oG.mjs';
8
9
 
9
10
  interface DeploymentNode<A extends Any = Unknown> extends WithDescriptionAndTech, WithOptionalTags<A>, WithOptionalLinks, WithMetadata<A>, WithNotation {
10
11
  element?: never;
@@ -44,9 +45,9 @@ interface DeploymentRelationship<A extends Any = Unknown> extends AbstractRelati
44
45
  */
45
46
  type DeploymentRelation<A extends Any = Unknown> = DeploymentRelationship<A>;
46
47
 
47
- type LayoutedViewDriftReason = 'not-exists' | 'type-changed' | 'nodes-mismatch' | 'edges-mismatch';
48
- type DiagramNodeDriftReason = 'missing' | 'label-changed' | 'modelRef-changed' | 'parent-changed' | 'children-changed' | 'became-compound' | 'became-leaf' | 'shape-changed';
49
- type DiagramEdgeDriftReason = 'missing' | 'label-changed' | 'direction-changed' | 'source-changed' | 'target-changed';
48
+ type LayoutedViewDriftReason = 'not-exists' | 'type-changed' | 'nodes-added' | 'nodes-removed' | 'nodes-drift' | 'edges-added' | 'edges-removed' | 'edges-drift';
49
+ type DiagramNodeDriftReason = 'removed' | 'added' | 'label-changed' | 'modelRef-changed' | 'parent-changed' | 'children-changed' | 'became-compound' | 'became-leaf' | 'shape-changed';
50
+ type DiagramEdgeDriftReason = 'removed' | 'added' | 'label-added' | 'label-removed' | 'label-changed' | 'notes-changed' | 'direction-changed' | 'source-changed' | 'target-changed';
50
51
  type ViewManualLayoutSnapshotPerType = {
51
52
  readonly [_type]: 'element';
52
53
  readonly viewOf?: Fqn$1;
@@ -107,13 +108,6 @@ interface DiagramEdge<A extends Any = Any> extends ComputedEdge<A> {
107
108
  * (Absolute coordinates)
108
109
  */
109
110
  labelBBox?: BBox | null;
110
- /**
111
- * Graphviz edge POS
112
- *
113
- * TODO: temporary solution, should be moved out
114
- * @deprecated
115
- */
116
- dotpos?: string;
117
111
  /**
118
112
  * List of reasons causing edge drift
119
113
  */
@@ -469,4 +463,4 @@ declare class RichText {
469
463
  equals(other: unknown): boolean;
470
464
  }
471
465
 
472
- export { type DeploymentViewRule as $, type AuxFromLikeC4ModelData as A, isElementView as B, type ComputedLikeC4ModelData as C, type DeploymentNode as D, isScopedElementView as E, isExtendsElementView as F, isDeploymentView as G, isDynamicView as H, type DiagramNode as I, type DiagramEdge as J, type LayoutType as K, type LayoutedLikeC4ModelData as L, type LayoutedElementView as M, type LayoutedDeploymentView as N, LayoutedDynamicView as O, type ParsedLikeC4ModelData as P, type LayoutedViewDriftReason as Q, RichText as R, type SpecificationDump as S, type DiagramNodeDriftReason as T, type DiagramEdgeDriftReason as U, type ViewOnStage as V, type ViewManualLayoutSnapshot as W, type DeploymentViewIncludePredicate as X, type DeploymentViewExcludePredicate as Y, type DeploymentViewPredicate as Z, type DeploymentViewRuleStyle as _, type RichTextEmpty as a, type ParsedDeploymentView as a0, type RichTextOrEmpty as b, type LikeC4ModelData as c, type DeployedInstance as d, type DeploymentElement as e, type DeploymentElementRef as f, isDeployedInstance as g, type DeploymentRelationship as h, isDeploymentNode as i, type DeploymentRelation as j, type SpecTypesFromDump as k, type LikeC4ModelDump as l, type ProjectDump as m, type AuxFromDump as n, type ParsedView as o, type LayoutedView as p, isDiagramView as q, type ComputedView as r, type ProcessedView as s, type AnyView as t, type ViewWithType as u, type ViewRule as v, type ViewRulePredicate as w, isViewRulePredicate as x, isViewRuleStyle as y, isComputedView as z };
466
+ export { type DeploymentViewRule as $, type AuxFromLikeC4ModelData as A, isComputedView as B, type ComputedLikeC4ModelData as C, type DeploymentNode as D, isElementView as E, isScopedElementView as F, isExtendsElementView as G, isDeploymentView as H, isDynamicView as I, type DiagramNode as J, type DiagramEdge as K, type LayoutedView as L, type LayoutType as M, type LayoutedElementView as N, type LayoutedDeploymentView as O, type ParsedLikeC4ModelData as P, LayoutedDynamicView as Q, RichText as R, type SpecificationDump as S, type LayoutedViewDriftReason as T, type DiagramNodeDriftReason as U, type ViewManualLayoutSnapshot as V, type DiagramEdgeDriftReason as W, type DeploymentViewIncludePredicate as X, type DeploymentViewExcludePredicate as Y, type DeploymentViewPredicate as Z, type DeploymentViewRuleStyle as _, type RichTextEmpty as a, type ParsedDeploymentView as a0, type RichTextOrEmpty as b, type LayoutedLikeC4ModelData as c, type LikeC4ModelData as d, type DeployedInstance as e, type DeploymentElement as f, type DeploymentElementRef as g, isDeployedInstance as h, isDeploymentNode as i, type DeploymentRelationship as j, type DeploymentRelation as k, type SpecTypesFromDump as l, type LikeC4ModelDump as m, type ProjectDump as n, type AuxFromDump as o, type ParsedView as p, isDiagramView as q, type ComputedView as r, type ProcessedView as s, type AnyView as t, type ViewOnStage as u, type ViewWithType as v, type ViewRule as w, type ViewRulePredicate as x, isViewRulePredicate as y, isViewRuleStyle as z };
@@ -1,8 +1,8 @@
1
1
  import { TupleToUnion, Tagged } from 'type-fest';
2
- import { A as Any, T as Tag, q as AllKinds, r as Tags, m as StrictViewId, n as ElementKind } from './core.CDOKQTW6.mjs';
2
+ import { A as Any, T as Tag, q as AllKinds, r as Tags, S as StrictViewId, E as ElementKind } from './core.BkSYCfRg.mjs';
3
3
  import { N as NonEmptyArray, E as ExclusiveUnion } from './core.DB0Ue5Wx.mjs';
4
4
  import { FqnRef } from '../types/fqnRef.mjs';
5
- import { M as MarkdownOrString, I as Icon } from './core.DX-WYEPA.mjs';
5
+ import { M as MarkdownOrString, I as Icon } from './core.CDdf8izT.mjs';
6
6
 
7
7
  /**
8
8
  * For padding, margin, etc.
@@ -331,4 +331,4 @@ declare namespace Expression {
331
331
  function isRelation<A extends AnyAux>(expr: Expression<A>): expr is RelationExpr.Any<A>;
332
332
  }
333
333
 
334
- export { type AndOperator as A, BorderStyles as B, type ColorLiteral as C, type ThemeColor as D, Expression as E, FqnExpr as F, isThemeColor as G, type HexColor as H, type CustomColorDefinitions as I, type CustomColor as J, type KindEqual as K, type LikeC4StyleDefaults as L, isCustomColor as M, type NotOperator as N, type OrOperator as O, type PredicateSelector as P, type Color as Q, RelationExpr as R, Sizes as S, type ThemeColorValues as T, type ElementColorValues as U, type RelationshipColorValues as V, type WhereOperator as W, type LikeC4StylesConfig as a, type LikeC4Theme as b, type EqualOperator as c, type TagEqual as d, isKindEqual as e, type Participant as f, type ParticipantOperator as g, isParticipantOperator as h, isTagEqual as i, isNotOperator as j, isAndOperator as k, isOrOperator as l, type Filterable as m, type OperatorPredicate as n, type Size as o, type TextSize as p, type ShapeSize as q, type SpacingSize as r, type BorderStyle as s, ElementShapes as t, type ElementShape as u, type RelationshipLineType as v, whereOperatorAsPredicate as w, RelationshipArrowTypes as x, type RelationshipArrowType as y, ThemeColors as z };
334
+ export { type AndOperator as A, type BorderStyle as B, type Color as C, ElementShapes as D, type ElementColorValues as E, FqnExpr as F, type ColorLiteral as G, type HexColor as H, RelationshipArrowTypes as I, ThemeColors as J, type KindEqual as K, type LikeC4StylesConfig as L, isThemeColor as M, type NotOperator as N, type OrOperator as O, type PredicateSelector as P, type CustomColorDefinitions as Q, type RelationshipColorValues as R, type SpacingSize as S, type ThemeColor as T, type CustomColor as U, isCustomColor as V, type WhereOperator as W, type LikeC4Theme as a, type LikeC4StyleDefaults as b, type ThemeColorValues as c, type TextSize as d, type ShapeSize as e, type RelationshipLineType as f, type RelationshipArrowType as g, type ElementShape as h, RelationExpr as i, Expression as j, type EqualOperator as k, type TagEqual as l, isTagEqual as m, isKindEqual as n, type Participant as o, type ParticipantOperator as p, isParticipantOperator as q, isNotOperator as r, isAndOperator as s, isOrOperator as t, type Filterable as u, type OperatorPredicate as v, whereOperatorAsPredicate as w, Sizes as x, type Size as y, BorderStyles as z };
@@ -1,8 +1,7 @@
1
1
  import { t as t$1 } from './core.BsSXS-_R.mjs';
2
2
  import { g as getDefaultExportFromCjs } from './core.B85MJLTf.mjs';
3
- import { r as requireIterator } from './core.BdPcbSkN.mjs';
4
- import { r as requireForeach, a as markdownToText, m as markdownToHtml } from './core.CR3PmPzr.mjs';
5
- import { m as memoizeProp } from './core.BR4zXDH-.mjs';
3
+ import { r as requireForeach, b as requireIterator, a as markdownToText, m as markdownToHtml } from './core.CBLX4mT8.mjs';
4
+ import { m as memoizeProp } from './core.CLSZtnFh.mjs';
6
5
  import { n as nonexhaustive } from './core.D4npX2q8.mjs';
7
6
 
8
7
  function t(...t){return t$1(n,t)}function n(e,t){let n={...e};for(let[r,i]of Object.entries(n))t(i,r,e)&&delete n[r];return n}
@@ -1,12 +1,13 @@
1
1
  import { SetRequired, IsAny } from 'type-fest';
2
- import { L as LikeC4Styles } from './core.8mmHFn9g.mjs';
3
- import { A as Any, R as RelationKind, r as Tags, H as Metadata, C as MetadataKey, I as LooseTag, F as Fqn, o as ElementId, n as ElementKind, y as DeploymentKind, b as AnyLayouted, J as RelationId$1, m as StrictViewId, k as _type, j as _stage, K as LooseElementId, O as LooseDeploymentId, x as DeploymentFqn, t as toComputed, a as AnyComputed, Q as Stage, D as DeploymentId, V as ViewId, T as Tag, c as AnyParsed, P as ProjectId$1, X as LooseViewId, U as Unknown, d as Aux, g as UnknownParsed, e as UnknownComputed, f as UnknownLayouted } from './core.CDOKQTW6.mjs';
4
- import { d as RelationId, P as ProjectId, a as IconUrl, N as NodeId, G as GroupElementKind, j as EdgeId, k as StepEdgeId, V as ViewId$1 } from './core.DX-WYEPA.mjs';
2
+ import { L as LikeC4Styles } from './core.or6-EHsb.mjs';
3
+ import { A as Any, R as RelationKind, r as Tags, H as Metadata, C as MetadataKey, I as LooseTag, F as Fqn, a as ElementId, E as ElementKind, y as DeploymentKind, c as AnyLayouted, J as RelationId$1, S as StrictViewId, n as _type, m as _stage, K as LooseElementId, O as LooseDeploymentId, x as DeploymentFqn, t as toComputed, b as AnyComputed, Q as Stage, D as DeploymentId, V as ViewId, T as Tag, d as AnyParsed, P as ProjectId$1, X as LooseViewId, U as Unknown, e as Aux, i as UnknownParsed, g as UnknownComputed, h as UnknownLayouted } from './core.BkSYCfRg.mjs';
4
+ import { d as RelationId, P as ProjectId, a as IconUrl, j as NodeId, G as GroupElementKind, k as EdgeId, l as StepEdgeId, V as ViewId$1 } from './core.CDdf8izT.mjs';
5
5
  import { D as DefaultMap } from './core.CywrQs86.mjs';
6
- import { b as RichTextOrEmpty, p as LayoutedView, W as ViewManualLayoutSnapshot, Q as LayoutedViewDriftReason, r as ComputedView, u as ViewWithType, P as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, L as LayoutedLikeC4ModelData, d as DeployedInstance, h as DeploymentRelationship, e as DeploymentElement, D as DeploymentNode, l as LikeC4ModelDump, n as AuxFromDump } from './core.CKNmSm2W.mjs';
6
+ import { b as RichTextOrEmpty, L as LayoutedView, V as ViewManualLayoutSnapshot, r as ComputedView, v as ViewWithType, P as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, c as LayoutedLikeC4ModelData, e as DeployedInstance, j as DeploymentRelationship, f as DeploymentElement, D as DeploymentNode, m as LikeC4ModelDump, o as AuxFromDump } from './core.5gPDaaG5.mjs';
7
7
  import { c as IteratorLike, L as Link, N as NonEmptyArray } from './core.DB0Ue5Wx.mjs';
8
- import { Q as Color, v as RelationshipLineType, y as RelationshipArrowType, u as ElementShape, W as WhereOperator } from './core.BnOetIAR.mjs';
9
- import { g as Relationship, f as Element, E as ElementStyle, K as ComputedNodeStyle, B as BBox, a7 as DynamicViewDisplayVariant, o as LikeC4Project, S as Specification, M as ModelGlobals } from './core.BMtVqKl7.mjs';
8
+ import { C as Color, f as RelationshipLineType, g as RelationshipArrowType, h as ElementShape, W as WhereOperator } from './core.9U0HL3oG.mjs';
9
+ import { R as Relationship, f as Element, E as ElementStyle, C as ComputedNodeStyle, a6 as DynamicViewDisplayVariant, n as LikeC4Project, S as Specification, M as ModelGlobals } from './core.DE-g9oFF.mjs';
10
+ import { B as BBox } from './core.BPGOjone.mjs';
10
11
  import { FqnRef } from '../types/fqnRef.mjs';
11
12
 
12
13
  type RelationshipsIterator<A extends Any> = IteratorLike<RelationshipModel<A>>;
@@ -469,7 +470,8 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
469
470
  */
470
471
  get includedTags(): Tags<A>;
471
472
  /**
472
- * The original view (auto-layouted).
473
+ * The original view from the model.
474
+ * In case of layouted model, this is the latest auto-layouted view without manual changes applied
473
475
  * @see {@link $layouted} should be used for rendering in the UI
474
476
  */
475
477
  get $view(): V;
@@ -479,15 +481,11 @@ declare class LikeC4ViewModel<A extends Any = Any, V extends $View<A> = $View<A>
479
481
  */
480
482
  get $layouted(): V;
481
483
  get hasManualLayout(): boolean;
484
+ get hasLayoutDrifts(): boolean;
482
485
  /**
483
486
  * If view has manual layout, returns it with manual layout applied
484
487
  */
485
- get manualLayouted(): V | null;
486
- /**
487
- * Returns the layout drift reasons, if any
488
- * (Only for layouted views with manual layout)
489
- */
490
- get driftReasons(): readonly LayoutedViewDriftReason[];
488
+ get $manual(): V | null;
491
489
  roots(): NodesIterator<A, V>;
492
490
  /**
493
491
  * Iterate over all nodes that have children.
@@ -1121,6 +1119,10 @@ declare class LikeC4Model<A extends Any = Any> {
1121
1119
  * model.findView('index')
1122
1120
  */
1123
1121
  findView(viewId: LooseViewId<A>): $ViewModel<A> | null;
1122
+ /**
1123
+ * Returns manual layout snapshot for given view ID, if any.
1124
+ */
1125
+ findManualLayout(viewId: LooseViewId<A>): ViewManualLayoutSnapshot | null;
1124
1126
  /**
1125
1127
  * Returns a view folder by its path.
1126
1128
  * Path is extracted from the view title, e.g. "Group 1/Group 2/View" -> "Group 1/Group 2"
@@ -1257,4 +1259,4 @@ declare namespace LikeC4Model {
1257
1259
  type AnyRelation<M = Any> = M extends Any ? RelationshipModel<M> | DeploymentRelationModel<M> : never;
1258
1260
  }
1259
1261
 
1260
- export { type AnyRelationshipModel as A, type DeploymentElementModel as D, ElementModel as E, type IncomingFilter as I, LikeC4Model as L, NestedElementOfDeployedInstanceModel as N, type OutgoingFilter as O, RelationshipModel as R, type WithMetadata as W, DeploymentNodeModel as a, DeployedInstanceModel as b, DeploymentRelationModel as c, LikeC4ViewModel as d, NodeModel as e, EdgeModel as f, type AnyLikeC4Model as g, RelationshipsAccum as h, type DeploymentRelationEndpoint as i, LikeC4DeploymentModel as j, LikeC4ViewsFolder as k, type DeploymentOrFqn as l, type EdgeOrId as m, type ElementOrFqn as n, type NodeOrId as o, type WithTags as p };
1262
+ export { type AnyRelationshipModel as A, DeploymentNodeModel as D, ElementModel as E, type IncomingFilter as I, LikeC4ViewModel as L, NestedElementOfDeployedInstanceModel as N, type OutgoingFilter as O, RelationshipModel as R, type WithMetadata as W, DeployedInstanceModel as a, DeploymentRelationModel as b, NodeModel as c, EdgeModel as d, type DeploymentElementModel as e, LikeC4Model as f, type AnyLikeC4Model as g, RelationshipsAccum as h, type DeploymentRelationEndpoint as i, LikeC4DeploymentModel as j, LikeC4ViewsFolder as k, type DeploymentOrFqn as l, type EdgeOrId as m, type ElementOrFqn as n, type NodeOrId as o, type WithTags as p };
@@ -0,0 +1,46 @@
1
+ type Point = readonly [x: number, y: number];
2
+ interface XYPoint {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ interface BBox {
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ }
12
+ declare namespace BBox {
13
+ function center({ x, y, width, height }: BBox): XYPoint;
14
+ /**
15
+ * Returns the four corner points of the box in clockwise order starting from top-left
16
+ */
17
+ function toPoints({ x, y, width, height }: BBox): [XYPoint, XYPoint, XYPoint, XYPoint];
18
+ function fromPoints(points: Point[]): BBox;
19
+ function merge(...boxes: BBox[]): BBox;
20
+ function fromRectBox(rect: RectBox): BBox;
21
+ function toRectBox(box: BBox): RectBox;
22
+ function expand(box: BBox, plus: number): BBox;
23
+ function shrink(box: BBox, minus: number): BBox;
24
+ /**
25
+ * Returns true if `a` includes `b` (i.e. `b` is inside `a`)
26
+ */
27
+ function includes(a: BBox, b: BBox): boolean;
28
+ }
29
+ interface RectBox {
30
+ x1: number;
31
+ y1: number;
32
+ x2: number;
33
+ y2: number;
34
+ }
35
+ declare namespace RectBox {
36
+ function center({ x1, y1, x2, y2 }: RectBox): XYPoint;
37
+ function fromPoints(points: Point[]): RectBox;
38
+ function merge(...boxes: RectBox[]): RectBox;
39
+ function toBBox(box: RectBox): BBox;
40
+ /**
41
+ * Returns true if `a` includes `b` (i.e. `b` is inside `a`)
42
+ */
43
+ function includes(a: RectBox, b: RectBox): boolean;
44
+ }
45
+
46
+ export { BBox as B, type Point as P, RectBox as R, type XYPoint as X };
@@ -1,6 +1,5 @@
1
1
  import { g as getDefaultExportFromCjs } from './core.B85MJLTf.mjs';
2
- import { r as requireForeach } from './core.CR3PmPzr.mjs';
3
- import { r as requireIterator } from './core.BdPcbSkN.mjs';
2
+ import { r as requireForeach, b as requireIterator } from './core.CBLX4mT8.mjs';
4
3
 
5
4
  /**
6
5
  * Mnemonist BiMap
@@ -0,0 +1,7 @@
1
+ import { t as t$1, a as t$2 } from './core.3ZhnKAlZ.mjs';
2
+
3
+ function t(t,n){let r=n.length-t.length;if(r===1){let[r,...i]=n;return t$1(r,{lazy:t,lazyArgs:i})}if(r===0){let r={lazy:t,lazyArgs:n};return Object.assign(t=>t$1(t,r),r)}throw Error(`Wrong number of arguments`)}
4
+
5
+ function n(...e){return t(r,e)}function r(){let t=new Set;return n=>t.has(n)?t$2:(t.add(n),{done:false,hasNext:true,next:n})}
6
+
7
+ export { n };
@@ -1,6 +1,6 @@
1
1
  import { IfNever, IsNever, IsLiteral } from 'type-fest';
2
2
  import { C as Coalesce, L as Link } from './core.DB0Ue5Wx.mjs';
3
- import { D as DeploymentFqn$1, F as Fqn$1, d as RelationId$1, N as NodeId$1, j as EdgeId$1, P as ProjectId$1, V as ViewId$1, T as Tag$1, E as ElementKind$1, b as DeploymentKind$1, c as RelationshipKind, M as MarkdownOrString } from './core.DX-WYEPA.mjs';
3
+ import { V as ViewId$1, F as Fqn$1, D as DeploymentFqn$1, j as NodeId$1, k as EdgeId$1, d as RelationId$1, P as ProjectId$1, T as Tag$1, E as ElementKind$1, b as DeploymentKind$1, c as RelationshipKind, M as MarkdownOrString } from './core.CDdf8izT.mjs';
4
4
 
5
5
  /**
6
6
  * Determines the stage of the model:
@@ -297,4 +297,4 @@ declare namespace _aux {
297
297
  export { type _aux_AllKinds as AllKinds, type _aux_Any as Any, type Any as AnyAux, type _aux_AnyComputed as AnyComputed, type _aux_AnyLayouted as AnyLayouted, type _aux_AnyOnStage as AnyOnStage, type _aux_AnyParsed as AnyParsed, type _aux_AnySpec as AnySpec, type _aux_Aux as Aux, type _aux_DeploymentFqn as DeploymentFqn, type _aux_DeploymentId as DeploymentId, type _aux_DeploymentKind as DeploymentKind, type _aux_EdgeId as EdgeId, type _aux_ElementId as ElementId, type _aux_ElementKind as ElementKind, type _aux_Fqn as Fqn, type _aux_LooseDeploymentId as LooseDeploymentId, type _aux_LooseDeploymentKind as LooseDeploymentKind, type _aux_LooseElementId as LooseElementId, type _aux_LooseElementKind as LooseElementKind, type _aux_LooseLiteral as LooseLiteral, type _aux_LooseRelationKind as LooseRelationKind, type _aux_LooseTag as LooseTag, type _aux_LooseTags as LooseTags, type _aux_LooseViewId as LooseViewId, type _aux_Metadata as Metadata, type _aux_MetadataKey as MetadataKey, type _aux_Never as Never, type _aux_NodeId as NodeId, type _aux_OrString as OrString, type _aux_PickByStage as PickByStage, type _aux_ProjectId as ProjectId, type _aux_RelationId as RelationId, type _aux_RelationKind as RelationKind, type _aux_Spec as Spec, type _aux_SpecAux as SpecAux, type _aux_Stage as Stage, type DeploymentFqn as StrictDeploymentFqn, type _aux_StrictDeploymentKind as StrictDeploymentKind, type _aux_StrictElementKind as StrictElementKind, type Fqn as StrictFqn, type _aux_StrictProjectId as StrictProjectId, type _aux_StrictRelationKind as StrictRelationKind, type _aux_StrictTag as StrictTag, type _aux_StrictViewId as StrictViewId, type _aux_Tag as Tag, type _aux_Tags as Tags, type _aux_Unknown as Unknown, type _aux_UnknownComputed as UnknownComputed, type _aux_UnknownLayouted as UnknownLayouted, type _aux_UnknownParsed as UnknownParsed, type _aux_ViewId as ViewId, type _aux_WithDescriptionAndTech as WithDescriptionAndTech, type _aux_WithLinks as WithLinks, type _aux_WithMetadata as WithMetadata, type _aux_WithNotation as WithNotation, type _aux_WithOptionalLinks as WithOptionalLinks, type _aux_WithOptionalTags as WithOptionalTags, type _aux_WithTags as WithTags, _aux_preferDescription as preferDescription, _aux_preferSummary as preferSummary, type _aux_setProject as setProject, type _aux_setStage as setStage, type _aux_toComputed as toComputed, type _aux_toLayouted as toLayouted, type _aux_toParsed as toParsed };
298
298
  }
299
299
 
300
- export { type AnyOnStage as $, type Any as A, type Never as B, type MetadataKey as C, type DeploymentId as D, type ExtractOnStage as E, type Fqn as F, type WithTags as G, type Metadata as H, type LooseTag as I, type RelationId as J, type LooseElementId as K, type LooseLiteral as L, type ModelStage as M, type NodeId as N, type LooseDeploymentId as O, type ProjectId as P, type Stage as Q, type RelationKind as R, type SpecAux as S, type Tag as T, type Unknown as U, type ViewId as V, type WithDescriptionAndTech as W, type LooseViewId as X, type setProject as Y, type AnySpec as Z, _aux as _, type AnyComputed as a, type PickByStage as a0, type setStage as a1, type toParsed as a2, type toLayouted as a3, type Spec as a4, type StrictProjectId as a5, type StrictTag as a6, type StrictElementKind as a7, type StrictDeploymentKind as a8, type StrictRelationKind as a9, type WithLinks as aa, type OrString as ab, type LooseTags as ac, type LooseElementKind as ad, type LooseDeploymentKind as ae, type LooseRelationKind as af, type AnyLayouted as b, type AnyParsed as c, type Aux as d, type UnknownComputed as e, type UnknownLayouted as f, type UnknownParsed as g, preferSummary as h, isOnStage as i, _stage as j, _type as k, _layout as l, type StrictViewId as m, type ElementKind as n, type ElementId as o, preferDescription as p, type AllKinds as q, type Tags as r, type WithOptionalTags as s, type toComputed as t, type WithOptionalLinks as u, type WithMetadata as v, type WithNotation as w, type DeploymentFqn as x, type DeploymentKind as y, type EdgeId as z };
300
+ export { type AnyOnStage as $, type Any as A, type Never as B, type MetadataKey as C, type DeploymentId as D, type ElementKind as E, type Fqn as F, type WithTags as G, type Metadata as H, type LooseTag as I, type RelationId as J, type LooseElementId as K, type LooseLiteral as L, type ModelStage as M, type NodeId as N, type LooseDeploymentId as O, type ProjectId as P, type Stage as Q, type RelationKind as R, type StrictViewId as S, type Tag as T, type Unknown as U, type ViewId as V, type WithDescriptionAndTech as W, type LooseViewId as X, type setProject as Y, type AnySpec as Z, _aux as _, type ElementId as a, type PickByStage as a0, type setStage as a1, type toParsed as a2, type toLayouted as a3, type Spec as a4, type StrictProjectId as a5, type StrictTag as a6, type StrictElementKind as a7, type StrictDeploymentKind as a8, type StrictRelationKind as a9, type WithLinks as aa, type OrString as ab, type LooseTags as ac, type LooseElementKind as ad, type LooseDeploymentKind as ae, type LooseRelationKind as af, type AnyComputed as b, type AnyLayouted as c, type AnyParsed as d, type Aux as e, type SpecAux as f, type UnknownComputed as g, type UnknownLayouted as h, type UnknownParsed as i, preferSummary as j, type ExtractOnStage as k, isOnStage as l, _stage as m, _type as n, _layout as o, preferDescription as p, type AllKinds as q, type Tags as r, type WithOptionalTags as s, type toComputed as t, type WithOptionalLinks as u, type WithMetadata as v, type WithNotation as w, type DeploymentFqn as x, type DeploymentKind as y, type EdgeId as z };
@@ -0,0 +1,5 @@
1
+ import { t as t$1 } from './core.BsSXS-_R.mjs';
2
+
3
+ function t(...t){return t$1(n,t)}function n(e,t){let n=[...e];return n.sort(t),n}
4
+
5
+ export { t };
@@ -1,5 +1,5 @@
1
1
  import { I as IterableContainer, R as ReorderedArray, N as NonEmptyArray } from './core.DB0Ue5Wx.mjs';
2
- import { F as Fqn } from './core.DX-WYEPA.mjs';
2
+ import { F as Fqn } from './core.CDdf8izT.mjs';
3
3
  import { SetRequired, SetNonNullable } from 'type-fest';
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
+ import { d as defu, m as memoizeProp } from './core.CLSZtnFh.mjs';
1
2
  import { t as t$2, a as t$3 } from './core.BsSXS-_R.mjs';
2
3
  import { i as invariant } from './core.D4npX2q8.mjs';
3
- import { m as memoizeProp } from './core.BR4zXDH-.mjs';
4
4
 
5
5
  function t$1(...t){return t$2(n$1,t)}function n$1(e,t){let n={};for(let[r,i]of e.entries())n[i]=t(i,r,e);return n}
6
6
 
@@ -140,7 +140,7 @@ class Color {
140
140
  }
141
141
 
142
142
  // this gets updated automatically
143
- const version = '3.1.2';
143
+ const version = '3.2.0';
144
144
 
145
145
  const chroma = (...args) => {
146
146
  return new Color(...args);
@@ -1762,6 +1762,7 @@ function scale (colors) {
1762
1762
  let _nacol = chroma('#ccc');
1763
1763
  let _spread = 0;
1764
1764
  // const _fixed = false;
1765
+ let _positions = [0, 1];
1765
1766
  let _domain = [0, 1];
1766
1767
  let _pos = [];
1767
1768
  let _padding = [0, 0];
@@ -1930,9 +1931,9 @@ function scale (colors) {
1930
1931
  if (classes != null) {
1931
1932
  if (type(classes) === 'array') {
1932
1933
  _classes = classes;
1933
- _domain = [classes[0], classes[classes.length - 1]];
1934
+ _positions = [classes[0], classes[classes.length - 1]];
1934
1935
  } else {
1935
- const d = chroma.analyze(_domain);
1936
+ const d = chroma.analyze(_positions);
1936
1937
  if (classes === 0) {
1937
1938
  _classes = [d.min, d.max];
1938
1939
  } else {
@@ -1946,8 +1947,11 @@ function scale (colors) {
1946
1947
 
1947
1948
  f.domain = function (domain) {
1948
1949
  if (!arguments.length) {
1950
+ // return original domain
1949
1951
  return _domain;
1950
1952
  }
1953
+ // store original domain so we can return it later
1954
+ _domain = domain.slice(0);
1951
1955
  _min = domain[0];
1952
1956
  _max = domain[domain.length - 1];
1953
1957
  _pos = [];
@@ -1978,7 +1982,7 @@ function scale (colors) {
1978
1982
  }
1979
1983
  }
1980
1984
  }
1981
- _domain = [_min, _max];
1985
+ _positions = [_min, _max];
1982
1986
  return f;
1983
1987
  };
1984
1988
 
@@ -2074,8 +2078,8 @@ function scale (colors) {
2074
2078
  } else if (numColors === 1) {
2075
2079
  result = [f(0.5)];
2076
2080
  } else if (numColors > 1) {
2077
- const dm = _domain[0];
2078
- const dd = _domain[1] - dm;
2081
+ const dm = _positions[0];
2082
+ const dd = _positions[1] - dm;
2079
2083
  result = __range__(0, numColors).map((i) =>
2080
2084
  f(dm + (i / (numColors - 1)) * dd)
2081
2085
  );
@@ -2092,7 +2096,7 @@ function scale (colors) {
2092
2096
  samples.push((_classes[i - 1] + _classes[i]) * 0.5);
2093
2097
  }
2094
2098
  } else {
2095
- samples = _domain;
2099
+ samples = _positions;
2096
2100
  }
2097
2101
  result = samples.map((v) => f(v));
2098
2102
  }
@@ -2408,10 +2412,14 @@ const digits = '0123456789abcdef';
2408
2412
 
2409
2413
  const { floor: floor$1, random } = Math;
2410
2414
 
2411
- const random$1 = () => {
2415
+ /**
2416
+ * Generates a random color.
2417
+ * @param {() => number} rng - A random number generator function.
2418
+ */
2419
+ const random$1 = (rng = random) => {
2412
2420
  let code = '#';
2413
2421
  for (let i = 0; i < 6; i++) {
2414
- code += digits.charAt(floor$1(random() * 16));
2422
+ code += digits.charAt(floor$1(rng() * 16));
2415
2423
  }
2416
2424
  return new Color(code, 'hex');
2417
2425
  };
@@ -3553,9 +3561,9 @@ const ElementColors = {
3553
3561
  };
3554
3562
 
3555
3563
  const gray = {
3556
- line: "#6E6E6E",
3557
- labelBg: "#18191b",
3558
- label: "#C6C6C6"
3564
+ line: "#8D8D8D",
3565
+ labelBg: "#18191B",
3566
+ label: "#C9C9C9"
3559
3567
  };
3560
3568
  const slate = {
3561
3569
  line: "#64748b",
@@ -3779,62 +3787,6 @@ const defaultTheme = {
3779
3787
  }
3780
3788
  };
3781
3789
 
3782
- function isPlainObject(value) {
3783
- if (value === null || typeof value !== "object") {
3784
- return false;
3785
- }
3786
- const prototype = Object.getPrototypeOf(value);
3787
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
3788
- return false;
3789
- }
3790
- if (Symbol.iterator in value) {
3791
- return false;
3792
- }
3793
- if (Symbol.toStringTag in value) {
3794
- return Object.prototype.toString.call(value) === "[object Module]";
3795
- }
3796
- return true;
3797
- }
3798
-
3799
- function _defu(baseObject, defaults, namespace = ".", merger) {
3800
- if (!isPlainObject(defaults)) {
3801
- return _defu(baseObject, {}, namespace, merger);
3802
- }
3803
- const object = Object.assign({}, defaults);
3804
- for (const key in baseObject) {
3805
- if (key === "__proto__" || key === "constructor") {
3806
- continue;
3807
- }
3808
- const value = baseObject[key];
3809
- if (value === null || value === void 0) {
3810
- continue;
3811
- }
3812
- if (merger && merger(object, key, value, namespace)) {
3813
- continue;
3814
- }
3815
- if (Array.isArray(value) && Array.isArray(object[key])) {
3816
- object[key] = [...value, ...object[key]];
3817
- } else if (isPlainObject(value) && isPlainObject(object[key])) {
3818
- object[key] = _defu(
3819
- value,
3820
- object[key],
3821
- (namespace ? `${namespace}.` : "") + key.toString(),
3822
- merger
3823
- );
3824
- } else {
3825
- object[key] = value;
3826
- }
3827
- }
3828
- return object;
3829
- }
3830
- function createDefu(merger) {
3831
- return (...arguments_) => (
3832
- // eslint-disable-next-line unicorn/no-array-reduce
3833
- arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
3834
- );
3835
- }
3836
- const defu = createDefu();
3837
-
3838
3790
  function ensureSizes({
3839
3791
  size,
3840
3792
  padding,
@@ -3989,4 +3941,4 @@ class LikeC4Styles {
3989
3941
  }
3990
3942
  }
3991
3943
 
3992
- export { BorderStyles as B, ElementShapes as E, LikeC4Styles as L, RelationshipArrowTypes as R, Sizes as S, ThemeColors as T, t as a, defaultTheme as b, computeColorValues as c, defu as d, ensureSizes as e, isCustomColor as f, isThemeColor as i, styleDefaults as s, t$1 as t };
3944
+ export { BorderStyles as B, ElementShapes as E, LikeC4Styles as L, RelationshipArrowTypes as R, Sizes as S, ThemeColors as T, t as a, isCustomColor as b, computeColorValues as c, defaultTheme as d, ensureSizes as e, isThemeColor as i, styleDefaults as s, t$1 as t };
@@ -1,6 +1,6 @@
1
- import { E as ElementModel, D as DeploymentElementModel } from './core.DjAM-S6a.mjs';
2
- import { A as Any } from './core.CDOKQTW6.mjs';
3
- import { F as Fqn } from './core.DX-WYEPA.mjs';
1
+ import { E as ElementModel, e as DeploymentElementModel } from './core.BLG-ADpi.mjs';
2
+ import { A as Any } from './core.BkSYCfRg.mjs';
3
+ import { F as Fqn } from './core.CDdf8izT.mjs';
4
4
 
5
5
  interface Connection<Elem = ElementModel<Any> | DeploymentElementModel<Any>, Id = string> {
6
6
  readonly id: Id;