@likec4/core 1.45.0 → 1.46.2

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 (64) hide show
  1. package/dist/builder/index.d.mts +8 -7
  2. package/dist/builder/index.mjs +8 -7
  3. package/dist/compute-view/index.d.mts +8 -7
  4. package/dist/compute-view/index.mjs +5 -5
  5. package/dist/compute-view/relationships-view/index.d.mts +8 -7
  6. package/dist/geometry/index.d.mts +109 -0
  7. package/dist/geometry/index.mjs +328 -0
  8. package/dist/index.d.mts +10 -8
  9. package/dist/index.mjs +9 -8
  10. package/dist/model/connection/deployment/index.d.mts +10 -9
  11. package/dist/model/connection/deployment/index.mjs +2 -2
  12. package/dist/model/connection/index.d.mts +11 -10
  13. package/dist/model/connection/index.mjs +3 -3
  14. package/dist/model/connection/model/index.d.mts +10 -9
  15. package/dist/model/connection/model/index.mjs +2 -2
  16. package/dist/model/index.d.mts +12 -11
  17. package/dist/model/index.mjs +4 -4
  18. package/dist/shared/{core.DnCLhN8C.d.mts → core.5gPDaaG5.d.mts} +5 -4
  19. package/dist/shared/{core.CQPEY2wQ.mjs → core.78IWAHAE.mjs} +1 -1
  20. package/dist/shared/{core.0zAQeenX.d.mts → core.9U0HL3oG.d.mts} +2 -2
  21. package/dist/shared/{core.DqlrMlsf.mjs → core.BFd1lU9R.mjs} +1 -1
  22. package/dist/shared/core.BPGOjone.d.mts +46 -0
  23. package/dist/shared/{core.DIE3F6sw.mjs → core.BYdtmqY5.mjs} +1 -2
  24. package/dist/shared/{core.B73yxfPi.d.mts → core.BkSYCfRg.d.mts} +1 -1
  25. package/dist/shared/{core.5ZQ-r3Oa.d.mts → core.BqtAzeAh.d.mts} +1 -1
  26. package/dist/shared/{core.DEieYfbG.mjs → core.BspBF3SJ.mjs} +22 -70
  27. package/dist/shared/{core.CR3PmPzr.mjs → core.CBLX4mT8.mjs} +3811 -15032
  28. package/dist/shared/{core.DX-WYEPA.d.mts → core.CDdf8izT.d.mts} +4 -2
  29. package/dist/shared/core.CLSZtnFh.mjs +69 -0
  30. package/dist/shared/{core.D_f4F48-.mjs → core.CRhT4Iio.mjs} +10 -7
  31. package/dist/shared/{core.DrUt0Lbi.mjs → core.CmGY9blO.mjs} +198 -291
  32. package/dist/shared/{core.C_Ni6yHl.mjs → core.D0WZutNd.mjs} +3 -1
  33. package/dist/shared/{core.mUnpvHtA.d.mts → core.DE-g9oFF.d.mts} +19 -49
  34. package/dist/shared/{core.M9ayqQZa.mjs → core.DEK-BO3_.mjs} +4 -5
  35. package/dist/shared/{core.CpURdWRM.d.mts → core.DK3pdsTf.d.mts} +8 -6
  36. package/dist/shared/{core.vzLtp8i3.mjs → core.DSalPD6v.mjs} +259 -189
  37. package/dist/shared/{core.CRI1AjFj.mjs → core.DVfPJPJj.mjs} +33 -30
  38. package/dist/shared/{core.Cog93roC.d.mts → core.DezoCAzf.d.mts} +3 -3
  39. package/dist/shared/{core.BGFjN3nv.d.mts → core.I8sCl3WM.d.mts} +3 -3
  40. package/dist/shared/{core.t3qfsVvn.d.mts → core.e5GJ61_a.d.mts} +3 -3
  41. package/dist/shared/{core.BuQZczj6.mjs → core.om36dXXW.mjs} +5 -2
  42. package/dist/shared/{core.Dvh1H0T2.d.mts → core.or6-EHsb.d.mts} +2 -2
  43. package/dist/shared/{core.DViDmiAu.mjs → core.xeuDd__E.mjs} +1 -2
  44. package/dist/shared/{core.CWwSgOzF.mjs → core.xgoPk2RG.mjs} +165 -135
  45. package/dist/styles/index.d.mts +7 -6
  46. package/dist/styles/index.mjs +1 -1
  47. package/dist/types/_aux.d.mts +2 -2
  48. package/dist/types/expression-model.d.mts +3 -3
  49. package/dist/types/expression.d.mts +3 -3
  50. package/dist/types/fqnRef.d.mts +2 -2
  51. package/dist/types/fqnRef.mjs +1 -1
  52. package/dist/types/index.d.mts +11 -9
  53. package/dist/types/index.mjs +6 -180
  54. package/dist/types/scalar.d.mts +1 -1
  55. package/dist/types/scalar.mjs +1 -1
  56. package/dist/utils/graphology/index.mjs +1 -1
  57. package/dist/utils/index.d.mts +3 -3
  58. package/dist/utils/index.mjs +5 -5
  59. package/dist/utils/iterable/index.d.mts +17 -1
  60. package/dist/utils/iterable/index.mjs +17 -1
  61. package/geometry/package.json +4 -0
  62. package/package.json +20 -12
  63. package/dist/shared/core.BR4zXDH-.mjs +0 -13
  64. package/dist/shared/core.BdPcbSkN.mjs +0 -118
@@ -1,6 +1,6 @@
1
- export { j as Expression, F as FqnExpr, P as PredicateSelector, i as RelationExpr } from '../shared/core.0zAQeenX.mjs';
2
- import '../shared/core.B73yxfPi.mjs';
1
+ export { j as Expression, F as FqnExpr, P as PredicateSelector, i as RelationExpr } from '../shared/core.9U0HL3oG.mjs';
2
+ import '../shared/core.BkSYCfRg.mjs';
3
3
  import '../shared/core.DB0Ue5Wx.mjs';
4
4
  import './fqnRef.mjs';
5
- import '../shared/core.DX-WYEPA.mjs';
5
+ import '../shared/core.CDdf8izT.mjs';
6
6
  import 'type-fest';
@@ -1,7 +1,7 @@
1
- import { A as Any, a as ElementId, P as ProjectId, F as Fqn, D as DeploymentId } from '../shared/core.B73yxfPi.mjs';
1
+ import { A as Any, a as ElementId, P as ProjectId, F as Fqn, D as DeploymentId } from '../shared/core.BkSYCfRg.mjs';
2
2
  import { E as ExclusiveUnion } from '../shared/core.DB0Ue5Wx.mjs';
3
3
  import 'type-fest';
4
- import '../shared/core.DX-WYEPA.mjs';
4
+ import '../shared/core.CDdf8izT.mjs';
5
5
 
6
6
  type AnyAux = Any;
7
7
  declare namespace FqnRef {
@@ -1,5 +1,5 @@
1
1
  import { e } from '../shared/core.CqAJJpK_.mjs';
2
- import { a as GlobalFqn } from '../shared/core.C_Ni6yHl.mjs';
2
+ import { a as GlobalFqn } from '../shared/core.D0WZutNd.mjs';
3
3
 
4
4
  var FqnRef;
5
5
  ((FqnRef2) => {
@@ -1,16 +1,18 @@
1
1
  import { N as NonEmptyArray } from '../shared/core.DB0Ue5Wx.mjs';
2
2
  export { C as Coalesce, E as ExclusiveUnion, I as IterableContainer, c as IteratorLike, K as KeysOf, L as Link, b as NTuple, a as NonEmptyReadonlyArray, P as Predicate, R as ReorderedArray, e as exact } from '../shared/core.DB0Ue5Wx.mjs';
3
- export { A as Any, A as AnyAux, b as AnyComputed, c as AnyLayouted, d as AnyParsed, e as Aux, k as ExtractOnStage, L as LooseLiteral, M as ModelStage, f as SpecAux, U as Unknown, g as UnknownComputed, h as UnknownLayouted, i as UnknownParsed, o as _layout, m as _stage, n as _type, _ as aux, l as isOnStage, p as preferDescription, j as preferSummary } from '../shared/core.B73yxfPi.mjs';
4
- import { B as BorderStyle, h as ElementShape, T as ThemeColor } from '../shared/core.0zAQeenX.mjs';
5
- export { A as AndOperator, z as BorderStyles, C as Color, G as ColorLiteral, U as CustomColor, Q as CustomColorDefinitions, E as ElementColorValues, D as ElementShapes, k as EqualOperator, j as Expression, u as Filterable, F as FqnExpr, H as HexColor, K as KindEqual, b as LikeC4StyleDefaults, L as LikeC4StylesConfig, a as LikeC4Theme, N as NotOperator, v as OperatorPredicate, O as OrOperator, o as Participant, p as ParticipantOperator, P as PredicateSelector, i as RelationExpr, g as RelationshipArrowType, I as RelationshipArrowTypes, R as RelationshipColorValues, f as RelationshipLineType, e as ShapeSize, y as Size, x as Sizes, S as SpacingSize, l as TagEqual, d as TextSize, c as ThemeColorValues, J as ThemeColors, W as WhereOperator, s as isAndOperator, V as isCustomColor, n as isKindEqual, r as isNotOperator, t as isOrOperator, q as isParticipantOperator, m as isTagEqual, M as isThemeColor, w as whereOperatorAsPredicate } from '../shared/core.0zAQeenX.mjs';
3
+ export { A as Any, A as AnyAux, b as AnyComputed, c as AnyLayouted, d as AnyParsed, e as Aux, k as ExtractOnStage, L as LooseLiteral, M as ModelStage, f as SpecAux, U as Unknown, g as UnknownComputed, h as UnknownLayouted, i as UnknownParsed, o as _layout, m as _stage, n as _type, _ as aux, l as isOnStage, p as preferDescription, j as preferSummary } from '../shared/core.BkSYCfRg.mjs';
4
+ import { B as BorderStyle, h as ElementShape, T as ThemeColor } from '../shared/core.9U0HL3oG.mjs';
5
+ export { A as AndOperator, z as BorderStyles, C as Color, G as ColorLiteral, U as CustomColor, Q as CustomColorDefinitions, E as ElementColorValues, D as ElementShapes, k as EqualOperator, j as Expression, u as Filterable, F as FqnExpr, H as HexColor, K as KindEqual, b as LikeC4StyleDefaults, L as LikeC4StylesConfig, a as LikeC4Theme, N as NotOperator, v as OperatorPredicate, O as OrOperator, o as Participant, p as ParticipantOperator, P as PredicateSelector, i as RelationExpr, g as RelationshipArrowType, I as RelationshipArrowTypes, R as RelationshipColorValues, f as RelationshipLineType, e as ShapeSize, y as Size, x as Sizes, S as SpacingSize, l as TagEqual, d as TextSize, c as ThemeColorValues, J as ThemeColors, W as WhereOperator, s as isAndOperator, V as isCustomColor, n as isKindEqual, r as isNotOperator, t as isOrOperator, q as isParticipantOperator, m as isTagEqual, M as isThemeColor, w as whereOperatorAsPredicate } from '../shared/core.9U0HL3oG.mjs';
6
6
  export { ModelExpression, ModelFqnExpr, ModelRelationExpr } from './expression-model.mjs';
7
7
  export { FqnRef } from './fqnRef.mjs';
8
- import { v as AutoLayoutDirection } from '../shared/core.mUnpvHtA.mjs';
9
- export { A as AbstractRelationship, q as AnyExcludePredicate, p as AnyIncludePredicate, r as AnyViewRuleStyle, B as BBox, I as BaseParsedViewProperties, H as BaseViewProperties, W as ComputedDeploymentView, Y as ComputedDynamicView, Q as ComputedEdge, U as ComputedElementView, O as ComputedNode, C as ComputedNodeStyle, Z as DynamicStep, $ as DynamicStepsParallel, _ as DynamicStepsSeries, a7 as DynamicViewDisplayVariant, a5 as DynamicViewIncludeRule, a6 as DynamicViewRule, a1 as DynamicViewStep, f as Element, i as ElementSpecification, E as ElementStyle, aa as ElementViewExcludePredicate, a9 as ElementViewIncludePredicate, ab as ElementViewPredicate, af as ElementViewRule, ac as ElementViewRuleGroup, ae as ElementViewRuleStyle, b as GlobalDynamicPredicates, G as GlobalPredicateId, a as GlobalPredicates, c as GlobalStyleID, d as GlobalStyles, o as LikeC4Project, n as LikeC4ProjectManualLayoutsConfig, m as LikeC4ProjectStyleDefaults, L as LikeC4ProjectStylesConfig, l as LikeC4ProjectTheme, M as ModelGlobals, h as ModelRelation, N as NodeNotation, a8 as ParsedDynamicView, ag as ParsedElementView, P as Point, R as RectBox, g as Relationship, k as RelationshipSpecification, S as Specification, T as TagSpecification, z as ViewAutoLayout, D as ViewManualLayout, x as ViewRuleAutoLayout, t as ViewRuleGlobalPredicateRef, V as ViewRuleGlobalStyle, F as ViewType, K as ViewWithHash, J as ViewWithNotation, X as XYPoint, e as ensureSizes, a0 as getParallelStepsPrefix, w as isAutoLayoutDirection, a2 as isDynamicStep, a3 as isDynamicStepsParallel, a4 as isDynamicStepsSeries, j as isTagColorSpecified, y as isViewRuleAutoLayout, u as isViewRuleGlobalPredicateRef, s as isViewRuleGlobalStyle, ad as isViewRuleGroup } from '../shared/core.mUnpvHtA.mjs';
10
- import { L as LayoutedView } from '../shared/core.DnCLhN8C.mjs';
11
- export { t as AnyView, o as AuxFromDump, A as AuxFromLikeC4ModelData, C as ComputedLikeC4ModelData, r as ComputedView, e as DeployedInstance, f as DeploymentElement, g as DeploymentElementRef, D as DeploymentNode, k as DeploymentRelation, j as DeploymentRelationship, Y as DeploymentViewExcludePredicate, X as DeploymentViewIncludePredicate, Z as DeploymentViewPredicate, $ as DeploymentViewRule, _ as DeploymentViewRuleStyle, K as DiagramEdge, W as DiagramEdgeDriftReason, J as DiagramNode, U as DiagramNodeDriftReason, M as LayoutType, O as LayoutedDeploymentView, Q as LayoutedDynamicView, N as LayoutedElementView, c as LayoutedLikeC4ModelData, T as LayoutedViewDriftReason, d as LikeC4ModelData, m as LikeC4ModelDump, p as LikeC4View, a0 as ParsedDeploymentView, P as ParsedLikeC4ModelData, p as ParsedView, s as ProcessedView, n as ProjectDump, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty, l as SpecTypesFromDump, S as SpecificationDump, V as ViewManualLayoutSnapshot, u as ViewOnStage, w as ViewRule, x as ViewRulePredicate, v as ViewWithType, B as isComputedView, h as isDeployedInstance, i as isDeploymentNode, H as isDeploymentView, q as isDiagramView, I as isDynamicView, E as isElementView, G as isExtendsElementView, q as isLayoutedView, F as isScopedElementView, y as isViewRulePredicate, z as isViewRuleStyle } from '../shared/core.DnCLhN8C.mjs';
12
- import { F as Fqn, D as DeploymentFqn } from '../shared/core.DX-WYEPA.mjs';
13
- export { A as AnyFqn, B as BuiltInIcon, b as DeploymentKind, j as EdgeId, E as ElementKind, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, N as NodeId, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, k as StepEdgeId, S as StepEdgeIdLiteral, m as StepEdgeKind, T as Tag, V as ViewId, o as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, n as isStepEdgeId, s as scalar, h as splitGlobalFqn, l as stepEdgeId } from '../shared/core.DX-WYEPA.mjs';
8
+ import { w as AutoLayoutDirection } from '../shared/core.DE-g9oFF.mjs';
9
+ export { A as AbstractRelationship, p as AnyExcludePredicate, o as AnyIncludePredicate, q as AnyViewRuleStyle, I as BaseParsedViewProperties, H as BaseViewProperties, W as ComputedDeploymentView, X as ComputedDynamicView, P as ComputedEdge, U as ComputedElementView, O as ComputedNode, C as ComputedNodeStyle, Q as ComputedRankConstraint, Y as DynamicStep, _ as DynamicStepsParallel, Z as DynamicStepsSeries, a6 as DynamicViewDisplayVariant, a4 as DynamicViewIncludeRule, a5 as DynamicViewRule, a0 as DynamicViewStep, f as Element, h as ElementSpecification, E as ElementStyle, a9 as ElementViewExcludePredicate, a8 as ElementViewIncludePredicate, aa as ElementViewPredicate, ag as ElementViewRule, ab as ElementViewRuleGroup, ae as ElementViewRuleRank, ad as ElementViewRuleStyle, b as GlobalDynamicPredicates, G as GlobalPredicateId, a as GlobalPredicates, c as GlobalStyleID, d as GlobalStyles, n as LikeC4Project, m as LikeC4ProjectManualLayoutsConfig, l as LikeC4ProjectStyleDefaults, L as LikeC4ProjectStylesConfig, k as LikeC4ProjectTheme, M as ModelGlobals, g as ModelRelation, N as NodeNotation, a7 as ParsedDynamicView, ah as ParsedElementView, u as RankValue, R as Relationship, j as RelationshipSpecification, S as Specification, T as TagSpecification, B as ViewAutoLayout, D as ViewManualLayout, y as ViewRuleAutoLayout, s as ViewRuleGlobalPredicateRef, V as ViewRuleGlobalStyle, v as ViewRuleRank, F as ViewType, K as ViewWithHash, J as ViewWithNotation, e as ensureSizes, $ as getParallelStepsPrefix, x as isAutoLayoutDirection, a1 as isDynamicStep, a2 as isDynamicStepsParallel, a3 as isDynamicStepsSeries, i as isTagColorSpecified, z as isViewRuleAutoLayout, t as isViewRuleGlobalPredicateRef, r as isViewRuleGlobalStyle, ac as isViewRuleGroup, af as isViewRuleRank } from '../shared/core.DE-g9oFF.mjs';
10
+ import { L as LayoutedView } from '../shared/core.5gPDaaG5.mjs';
11
+ export { t as AnyView, o as AuxFromDump, A as AuxFromLikeC4ModelData, C as ComputedLikeC4ModelData, r as ComputedView, e as DeployedInstance, f as DeploymentElement, g as DeploymentElementRef, D as DeploymentNode, k as DeploymentRelation, j as DeploymentRelationship, Y as DeploymentViewExcludePredicate, X as DeploymentViewIncludePredicate, Z as DeploymentViewPredicate, $ as DeploymentViewRule, _ as DeploymentViewRuleStyle, K as DiagramEdge, W as DiagramEdgeDriftReason, J as DiagramNode, U as DiagramNodeDriftReason, M as LayoutType, O as LayoutedDeploymentView, Q as LayoutedDynamicView, N as LayoutedElementView, c as LayoutedLikeC4ModelData, T as LayoutedViewDriftReason, d as LikeC4ModelData, m as LikeC4ModelDump, p as LikeC4View, a0 as ParsedDeploymentView, P as ParsedLikeC4ModelData, p as ParsedView, s as ProcessedView, n as ProjectDump, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty, l as SpecTypesFromDump, S as SpecificationDump, V as ViewManualLayoutSnapshot, u as ViewOnStage, w as ViewRule, x as ViewRulePredicate, v as ViewWithType, B as isComputedView, h as isDeployedInstance, i as isDeploymentNode, H as isDeploymentView, q as isDiagramView, I as isDynamicView, E as isElementView, G as isExtendsElementView, q as isLayoutedView, F as isScopedElementView, y as isViewRulePredicate, z as isViewRuleStyle } from '../shared/core.5gPDaaG5.mjs';
12
+ import { F as Fqn, D as DeploymentFqn } from '../shared/core.CDdf8izT.mjs';
13
+ export { A as AnyFqn, B as BuiltInIcon, b as DeploymentKind, k as EdgeId, E as ElementKind, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, j as NodeId, N as NoneIcon, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, l as StepEdgeId, S as StepEdgeIdLiteral, n as StepEdgeKind, T as Tag, V as ViewId, p as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, o as isStepEdgeId, s as scalar, h as splitGlobalFqn, m as stepEdgeId } from '../shared/core.CDdf8izT.mjs';
14
+ export { B as BBox, P as Point, R as RectBox, X as XYPoint } from '../shared/core.BPGOjone.mjs';
15
+ export { Vector, VectorValue, vector } from '../geometry/index.mjs';
14
16
  import 'type-fest';
15
17
 
16
18
  declare namespace ViewChange {
@@ -1,191 +1,17 @@
1
- export { R as RichText, e as exact } from '../shared/core.M9ayqQZa.mjs';
1
+ export { R as RichText, e as exact } from '../shared/core.DEK-BO3_.mjs';
2
2
  export { preferDescription, preferSummary } from './_aux.mjs';
3
3
  export { b as _layout, _ as _stage, a as _type, j as isAndOperator, n as isComputedView, d as isDeployedInstance, c as isDeploymentNode, s as isDeploymentView, o as isDiagramView, t as isDynamicView, p as isElementView, r as isExtendsElementView, f as isKindEqual, o as isLayoutedView, h as isNotOperator, i as isOnStage, k as isOrOperator, g as isParticipantOperator, q as isScopedElementView, e as isTagEqual, l as isViewRulePredicate, m as isViewRuleStyle, w as whereOperatorAsPredicate } from '../shared/core.DH7TXqXf.mjs';
4
4
  export { Expression, FqnExpr, RelationExpr } from './expression.mjs';
5
5
  export { ModelExpression, ModelFqnExpr, ModelRelationExpr } from './expression-model.mjs';
6
6
  export { FqnRef } from './fqnRef.mjs';
7
- import { a as t } from '../shared/core.BsSXS-_R.mjs';
8
- import { i as invariant } from '../shared/core.D4npX2q8.mjs';
9
- export { e as ensureSizes } from '../shared/core.DEieYfbG.mjs';
10
- export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, N as NodeId, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, g as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, e as isStepEdgeId, s as scalar, c as splitGlobalFqn, d as stepEdgeId } from '../shared/core.C_Ni6yHl.mjs';
11
- export { g as getParallelStepsPrefix, b as isAutoLayoutDirection, d as isDynamicStep, e as isDynamicStepsParallel, f as isDynamicStepsSeries, c as isViewRuleAutoLayout, a as isViewRuleGlobalPredicateRef, i as isViewRuleGlobalStyle, h as isViewRuleGroup } from '../shared/core.BuQZczj6.mjs';
12
-
13
- var BBox;
14
- ((BBox2) => {
15
- function center({ x, y, width, height }) {
16
- return {
17
- x: x + width / 2,
18
- y: y + height / 2
19
- };
20
- }
21
- BBox2.center = center;
22
- function toPoints({ x, y, width, height }) {
23
- return [
24
- { x, y },
25
- // Top left
26
- { x: x + width, y },
27
- // Top right
28
- { x: x + width, y: y + height },
29
- // Bottom right
30
- { x, y: y + height }
31
- // Bottom left
32
- ];
33
- }
34
- BBox2.toPoints = toPoints;
35
- function fromPoints(points) {
36
- const { x1, y1, x2, y2 } = RectBox.fromPoints(points);
37
- return {
38
- x: x1,
39
- y: y1,
40
- width: x2 - x1,
41
- height: y2 - y1
42
- };
43
- }
44
- BBox2.fromPoints = fromPoints;
45
- function merge(...boxes) {
46
- invariant(t(boxes, 1), "No boxes provided");
47
- if (boxes.length === 1) {
48
- return boxes[0];
49
- }
50
- let minX = boxes[0].x;
51
- let minY = boxes[0].y;
52
- let maxX = boxes[0].x + boxes[0].width;
53
- let maxY = boxes[0].y + boxes[0].height;
54
- for (let i = 1; i < boxes.length; i++) {
55
- const box = boxes[i];
56
- minX = Math.min(minX, box.x);
57
- minY = Math.min(minY, box.y);
58
- maxX = Math.max(maxX, box.x + box.width);
59
- maxY = Math.max(maxY, box.y + box.height);
60
- }
61
- return {
62
- x: Math.floor(minX),
63
- y: Math.floor(minY),
64
- width: Math.round(maxX - minX),
65
- height: Math.round(maxY - minY)
66
- };
67
- }
68
- BBox2.merge = merge;
69
- function fromRectBox(rect) {
70
- return {
71
- x: Math.min(rect.x1, rect.x2),
72
- y: Math.min(rect.y1, rect.y2),
73
- width: Math.abs(rect.x2 - rect.x1),
74
- height: Math.abs(rect.y2 - rect.y1)
75
- };
76
- }
77
- BBox2.fromRectBox = fromRectBox;
78
- function toRectBox(box) {
79
- return {
80
- x1: box.x,
81
- y1: box.y,
82
- x2: box.x + box.width,
83
- y2: box.y + box.height
84
- };
85
- }
86
- BBox2.toRectBox = toRectBox;
87
- function expand(box, plus) {
88
- if (plus === 0) {
89
- return box;
90
- }
91
- return {
92
- x: box.x - plus,
93
- y: box.y - plus,
94
- width: box.width + plus * 2,
95
- height: box.height + plus * 2
96
- };
97
- }
98
- BBox2.expand = expand;
99
- function shrink(box, minus) {
100
- if (minus === 0) {
101
- return box;
102
- }
103
- return {
104
- x: box.x + minus,
105
- y: box.y + minus,
106
- width: box.width - minus * 2,
107
- height: box.height - minus * 2
108
- };
109
- }
110
- BBox2.shrink = shrink;
111
- function includes(a, b) {
112
- if (a === b) {
113
- return true;
114
- }
115
- return a.x <= b.x && a.y <= b.y && a.x + a.width >= b.x + b.width && a.y + a.height >= b.y + b.height;
116
- }
117
- BBox2.includes = includes;
118
- })(BBox || (BBox = {}));
119
- var RectBox;
120
- ((RectBox2) => {
121
- function center({ x1, y1, x2, y2 }) {
122
- return {
123
- x: (x1 + x2) / 2,
124
- y: (y1 + y2) / 2
125
- };
126
- }
127
- RectBox2.center = center;
128
- function fromPoints(points) {
129
- invariant(points.length > 0, "At least one point is required");
130
- let minX = Infinity;
131
- let minY = Infinity;
132
- let maxX = -Infinity;
133
- let maxY = -Infinity;
134
- for (const [x, y] of points) {
135
- minX = Math.min(minX, x);
136
- minY = Math.min(minY, y);
137
- maxX = Math.max(maxX, x);
138
- maxY = Math.max(maxY, y);
139
- }
140
- return {
141
- x1: minX,
142
- y1: minY,
143
- x2: maxX,
144
- y2: maxY
145
- };
146
- }
147
- RectBox2.fromPoints = fromPoints;
148
- function merge(...boxes) {
149
- invariant(boxes.length > 0, "No boxes provided");
150
- let minX = Infinity;
151
- let minY = Infinity;
152
- let maxX = -Infinity;
153
- let maxY = -Infinity;
154
- for (const box of boxes) {
155
- minX = Math.min(minX, box.x1);
156
- minY = Math.min(minY, box.y1);
157
- maxX = Math.max(maxX, box.x2);
158
- maxY = Math.max(maxY, box.y2);
159
- }
160
- return {
161
- x1: minX,
162
- y1: minY,
163
- x2: maxX,
164
- y2: maxY
165
- };
166
- }
167
- RectBox2.merge = merge;
168
- function toBBox(box) {
169
- return {
170
- x: box.x1,
171
- y: box.y1,
172
- width: box.x2 - box.x1,
173
- height: box.y2 - box.y1
174
- };
175
- }
176
- RectBox2.toBBox = toBBox;
177
- function includes(a, b) {
178
- if (a === b) {
179
- return true;
180
- }
181
- return a.x1 <= b.x1 && a.y1 <= b.y1 && a.x2 >= b.x2 && a.y2 >= b.y2;
182
- }
183
- RectBox2.includes = includes;
184
- })(RectBox || (RectBox = {}));
7
+ export { e as ensureSizes } from '../shared/core.BspBF3SJ.mjs';
8
+ export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, d as NodeId, N as NoneIcon, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, h as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, g as isStepEdgeId, s as scalar, c as splitGlobalFqn, e as stepEdgeId } from '../shared/core.D0WZutNd.mjs';
9
+ export { g as getParallelStepsPrefix, b as isAutoLayoutDirection, d as isDynamicStep, e as isDynamicStepsParallel, f as isDynamicStepsSeries, c as isViewRuleAutoLayout, a as isViewRuleGlobalPredicateRef, i as isViewRuleGlobalStyle, h as isViewRuleGroup, j as isViewRuleRank } from '../shared/core.om36dXXW.mjs';
10
+ export { BBox, RectBox, Vector, vector } from '../geometry/index.mjs';
185
11
 
186
12
  function isTagColorSpecified(spec) {
187
13
  const color = typeof spec === "string" ? spec : spec.color;
188
14
  return color.startsWith("#") || color.startsWith("rgb");
189
15
  }
190
16
 
191
- export { BBox, RectBox, isTagColorSpecified };
17
+ export { isTagColorSpecified };
@@ -1,2 +1,2 @@
1
1
  import 'type-fest';
2
- export { A as AnyFqn, B as BuiltInIcon, D as DeploymentFqn, b as DeploymentKind, j as EdgeId, E as ElementKind, F as Fqn, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, N as NodeId, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, k as StepEdgeId, S as StepEdgeIdLiteral, m as StepEdgeKind, T as Tag, V as ViewId, o as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, n as isStepEdgeId, h as splitGlobalFqn, l as stepEdgeId } from '../shared/core.DX-WYEPA.mjs';
2
+ export { A as AnyFqn, B as BuiltInIcon, D as DeploymentFqn, b as DeploymentKind, k as EdgeId, E as ElementKind, F as Fqn, e as GlobalFqn, G as GroupElementKind, I as Icon, a as IconUrl, M as MarkdownOrString, j as NodeId, N as NoneIcon, P as ProjectId, d as RelationId, R as RelationKind, c as RelationshipKind, l as StepEdgeId, S as StepEdgeIdLiteral, n as StepEdgeKind, T as Tag, V as ViewId, p as extractStep, f as flattenMarkdownOrString, g as isGlobalFqn, i as isGroupElementKind, o as isStepEdgeId, h as splitGlobalFqn, m as stepEdgeId } from '../shared/core.CDdf8izT.mjs';
@@ -1,4 +1,4 @@
1
1
  import '../shared/core.CqAJJpK_.mjs';
2
2
  import '../shared/core.BKlholso.mjs';
3
3
  import '../shared/core.D4npX2q8.mjs';
4
- export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, N as NodeId, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, g as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, e as isStepEdgeId, c as splitGlobalFqn, d as stepEdgeId } from '../shared/core.C_Ni6yHl.mjs';
4
+ export { D as DeploymentFqn, E as EdgeId, F as Fqn, a as GlobalFqn, G as GroupElementKind, d as NodeId, N as NoneIcon, P as ProjectId, R as RelationId, S as StepEdgeKind, V as ViewId, h as extractStep, f as flattenMarkdownOrString, b as isGlobalFqn, i as isGroupElementKind, g as isStepEdgeId, c as splitGlobalFqn, e as stepEdgeId } from '../shared/core.D0WZutNd.mjs';
@@ -1 +1 @@
1
- export { G as Graph } from '../../shared/core.DrUt0Lbi.mjs';
1
+ export { G as Graph } from '../../shared/core.CmGY9blO.mjs';
@@ -1,9 +1,9 @@
1
1
  export { D as DefaultMap } from '../shared/core.CywrQs86.mjs';
2
- export { B as BiMap, D as DefaultWeakMap, L as LinkedList, M as MultiMap, Q as Queue, a as ancestorsFqn, l as commonAncestor, o as compareByFqnHierarchically, q as compareFqnHierarchically, h as hasProp, r as hierarchyDistance, t as hierarchyLevel, i as invariant, b as isAncestor, v as isAnyOf, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, j as nonNullable, g as nonexhaustive, p as parentFqn, u as sortByFqnHierarchically, s as sortNaturalByFqn, k as sortParentsFirst } from '../shared/core.5ZQ-r3Oa.mjs';
2
+ export { B as BiMap, D as DefaultWeakMap, L as LinkedList, M as MultiMap, Q as Queue, a as ancestorsFqn, l as commonAncestor, o as compareByFqnHierarchically, q as compareFqnHierarchically, h as hasProp, r as hierarchyDistance, t as hierarchyLevel, i as invariant, b as isAncestor, v as isAnyOf, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, j as nonNullable, g as nonexhaustive, p as parentFqn, u as sortByFqnHierarchically, s as sortNaturalByFqn, k as sortParentsFirst } from '../shared/core.BqtAzeAh.mjs';
3
3
  import { N as NonEmptyArray } from '../shared/core.DB0Ue5Wx.mjs';
4
- export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isome, iunique, toArray, toSet } from './iterable/index.mjs';
4
+ export { ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, ireduce, isome, iunique, toArray, toSet } from './iterable/index.mjs';
5
5
  export { i as isIterable } from '../shared/core.DXhDWKFZ.mjs';
6
- import '../shared/core.DX-WYEPA.mjs';
6
+ import '../shared/core.CDdf8izT.mjs';
7
7
  import 'type-fest';
8
8
 
9
9
  /**
@@ -1,22 +1,22 @@
1
1
  export { i as invariant, a as nonNullable, n as nonexhaustive } from '../shared/core.D4npX2q8.mjs';
2
- export { S as Stack, c as commonHead, a as compareRelations, o as objectHash } from '../shared/core.DViDmiAu.mjs';
2
+ export { S as Stack, c as commonHead, a as compareRelations, o as objectHash } from '../shared/core.xeuDd__E.mjs';
3
3
  export { c as compareNatural, b as compareNaturalHierarchically } from '../shared/core.3ZhnKAlZ.mjs';
4
4
  export { a as ancestorsFqn, g as commonAncestor, j as compareByFqnHierarchically, k as compareFqnHierarchically, h as hasProp, l as hierarchyDistance, m as hierarchyLevel, i as isAncestor, q as isAnyOf, b as isDescendantOf, c as isNonEmptyArray, d as isSameHierarchy, e as isString, n as nameFromFqn, p as parentFqn, o as sortByFqnHierarchically, s as sortNaturalByFqn, f as sortParentsFirst } from '../shared/core.CdNCAwq7.mjs';
5
5
  export { g as getOrCreate } from '../shared/core.DcS-0zys.mjs';
6
- export { m as memoizeProp } from '../shared/core.BR4zXDH-.mjs';
6
+ export { m as memoizeProp } from '../shared/core.CLSZtnFh.mjs';
7
7
  export { d as difference, e as equalsSet, i as intersection, s as symmetricDifference, u as union } from '../shared/core.DbfO90vF.mjs';
8
8
  export { s as stringHash } from '../shared/core.oSV6SRfk.mjs';
9
- export { b as BiMap, d as DefaultWeakMap, l as LinkedList, m as MultiMap, q as Queue } from '../shared/core.DIE3F6sw.mjs';
9
+ export { b as BiMap, d as DefaultWeakMap, l as LinkedList, m as MultiMap, q as Queue } from '../shared/core.BYdtmqY5.mjs';
10
10
  export { D as DefaultMap } from '../shared/core.BbE4y-yl.mjs';
11
11
  export { i as ifilter } from '../shared/core.DRJma0Ol.mjs';
12
12
  export { i as ifind } from '../shared/core.CmPXpJ8l.mjs';
13
- export { ifirst, ireduce } from './iterable/index.mjs';
13
+ export { ifirst, iflatMap, ireduce } from './iterable/index.mjs';
14
14
  export { i as iflat, a as iunique } from '../shared/core.C4x8aaWa.mjs';
15
15
  export { i as ihead } from '../shared/core.uFk_o9X6.mjs';
16
16
  export { i as imap, a as toArray, t as toSet } from '../shared/core.C3JowhaZ.mjs';
17
17
  export { i as isIterable } from '../shared/core.RfnaEmgA.mjs';
18
18
  export { i as isome } from '../shared/core.FZ305VYd.mjs';
19
- export { m as markdownToHtml, a as markdownToText } from '../shared/core.CR3PmPzr.mjs';
19
+ export { m as markdownToHtml, a as markdownToText } from '../shared/core.CBLX4mT8.mjs';
20
20
 
21
21
  function e(e,t){let n=Math.ceil(e),r=Math.floor(t);if(r<n)throw RangeError(`randomInteger: The range [${e.toString()},${t.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}
22
22
 
@@ -58,6 +58,22 @@ declare function ifirst<T>(iterable: Iterable<T>, count: number): IteratorLike<T
58
58
  declare function iflat(): <T>(iterable: Iterable<IteratorLike<T>>) => IteratorLike<T>;
59
59
  declare function iflat<T>(iterable: Iterable<IteratorLike<T>>): IteratorLike<T>;
60
60
 
61
+ type FlatMapFunction<T, S> = (item: T) => Iterable<S>;
62
+ /**
63
+ * Maps an iterable using a mapper function and flattens the result by one level.
64
+ * Composable first version of `iflatMap`.
65
+ * @signature
66
+ * iflatMap(mapper)(data)
67
+ */
68
+ declare function iflatMap<T, S>(mapper: FlatMapFunction<T, S>): (iterable: Iterable<T>) => IteratorLike<S>;
69
+ /**
70
+ * Maps an iterable using a mapper function and flattens the result by one level.
71
+ * Data first version of `iflatMap`.
72
+ * @signature
73
+ * iflatMap(data, mapper)
74
+ */
75
+ declare function iflatMap<T, S>(iterable: Iterable<T>, mapper: FlatMapFunction<T, S>): IteratorLike<S>;
76
+
61
77
  declare function ihead<T>(): (iterable: Iterable<T>) => T | undefined;
62
78
  /**
63
79
  * Finds the first element in the iterable that satisfies the predicate.
@@ -113,4 +129,4 @@ declare function toSet<T>(iterable: Iterable<T>): Set<T>;
113
129
  declare function iunique(): <T>(iterable: Iterable<T>) => IteratorLike<T>;
114
130
  declare function iunique<T>(iterable: Iterable<T>): IteratorLike<T>;
115
131
 
116
- export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isome, iunique, toArray, toSet };
132
+ export { ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, ireduce, isome, iunique, toArray, toSet };
@@ -29,6 +29,22 @@ function ifirst(arg1, arg2) {
29
29
  return _first(arg1);
30
30
  }
31
31
 
32
+ function iflatMap(arg1, arg2) {
33
+ const mapper = arg2 ?? arg1;
34
+ invariant(e(mapper));
35
+ function* _flatMap(iter) {
36
+ for (const value of iter) {
37
+ const mapped = mapper(value);
38
+ yield* mapped;
39
+ }
40
+ return;
41
+ }
42
+ if (!arg2) {
43
+ return _flatMap;
44
+ }
45
+ return _flatMap(arg1);
46
+ }
47
+
32
48
  function ireduce(arg1, arg2, arg3) {
33
49
  const reducer = e$1(arg3) ? arg2 : arg1;
34
50
  const initialValue = arg3 ?? arg2;
@@ -43,4 +59,4 @@ function ireduce(arg1, arg2, arg3) {
43
59
  return e$1(arg3) ? _reduce(arg1) : _reduce;
44
60
  }
45
61
 
46
- export { ifirst, ireduce };
62
+ export { ifirst, iflatMap, ireduce };
@@ -0,0 +1,4 @@
1
+ {
2
+ "types": "../dist/geometry/index.d.mts",
3
+ "module": "../dist/geometry/index.mjs"
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "1.45.0",
3
+ "version": "1.46.2",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -39,6 +39,14 @@
39
39
  "default": "./dist/builder/index.mjs"
40
40
  }
41
41
  },
42
+ "./geometry": {
43
+ "sources": "./src/geometry/index.ts",
44
+ "default": {
45
+ "types": "./dist/geometry/index.d.mts",
46
+ "import": "./dist/geometry/index.mjs",
47
+ "default": "./dist/geometry/index.mjs"
48
+ }
49
+ },
42
50
  "./compute-view/relationships": {
43
51
  "sources": "./src/compute-view/relationships-view/index.ts",
44
52
  "default": {
@@ -105,45 +113,45 @@
105
113
  "type-fest": "^4.41.0"
106
114
  },
107
115
  "devDependencies": {
108
- "@dagrejs/dagre": "1.1.5",
109
- "@mantine/colors-generator": "8.3.9",
116
+ "@dagrejs/dagre": "1.1.8",
117
+ "@mantine/colors-generator": "8.3.10",
110
118
  "@types/chroma-js": "^3.1.2",
111
119
  "@types/extend": "3.0.4",
112
120
  "@types/hast": "3.0.4",
113
121
  "@types/mdast": "4.0.4",
114
122
  "@types/natural-compare-lite": "^1.4.2",
115
- "@types/node": "~20.19.22",
123
+ "@types/node": "~22.19.1",
116
124
  "@types/object-hash": "^3.0.6",
117
125
  "@types/unist": "3.0.3",
118
- "chroma-js": "^3.1.2",
126
+ "chroma-js": "^3.2.0",
119
127
  "defu": "^6.1.4",
120
128
  "fdir": "6.4.0",
121
- "graphology": "^0.25.4",
129
+ "graphology": "^0.26.0",
122
130
  "graphology-dag": "^0.4.1",
123
131
  "graphology-types": "^0.24.8",
124
- "immer": "^10.2.0",
132
+ "immer": "^11.0.1",
125
133
  "mdast-util-from-markdown": "^2.0.2",
126
134
  "mdast-util-to-string": "^4.0.0",
127
135
  "mnemonist": "0.40.3",
128
136
  "natural-compare-lite": "^1.4.0",
129
137
  "object-hash": "^3.0.0",
130
138
  "obliterator": "^2.0.5",
131
- "oxlint": "1.29.0",
139
+ "oxlint": "1.33.0",
132
140
  "rehype-format": "5.0.1",
133
- "rehype-raw": "7.0.0",
134
141
  "rehype-sanitize": "^6.0.0",
135
142
  "rehype-stringify": "10.0.1",
136
143
  "remark-gfm": "4.0.1",
144
+ "remark-github-blockquote-alert": "^2.0.0",
137
145
  "remark-parse": "11.0.0",
138
146
  "remark-rehype": "11.1.2",
139
147
  "remeda": "^2.32.0",
140
- "turbo": "2.6.1",
148
+ "turbo": "2.6.3",
141
149
  "typescript": "5.9.3",
142
150
  "unbuild": "3.5.0",
143
151
  "unified": "11.0.5",
144
- "vitest": "4.0.13",
152
+ "vitest": "4.0.16",
145
153
  "@likec4/devops": "1.42.0",
146
- "@likec4/tsconfig": "1.45.0"
154
+ "@likec4/tsconfig": "1.46.1"
147
155
  },
148
156
  "scripts": {
149
157
  "typecheck": "tsc -b --verbose",
@@ -1,13 +0,0 @@
1
- function memoizeProp(obj, tag, fn) {
2
- const tagSymbol = typeof tag === "symbol" ? tag : Symbol.for(tag);
3
- if (!obj.hasOwnProperty(tagSymbol)) {
4
- Object.defineProperty(obj, tagSymbol, {
5
- enumerable: false,
6
- writable: false,
7
- value: fn()
8
- });
9
- }
10
- return obj[tagSymbol];
11
- }
12
-
13
- export { memoizeProp as m };
@@ -1,118 +0,0 @@
1
- var support = {};
2
-
3
- var hasRequiredSupport;
4
-
5
- function requireSupport () {
6
- if (hasRequiredSupport) return support;
7
- hasRequiredSupport = 1;
8
- support.ARRAY_BUFFER_SUPPORT = typeof ArrayBuffer !== 'undefined';
9
- support.SYMBOL_SUPPORT = typeof Symbol !== 'undefined';
10
- return support;
11
- }
12
-
13
- /**
14
- * Obliterator Iterator Class
15
- * ===========================
16
- *
17
- * Simple class representing the library's iterators.
18
- */
19
-
20
- var iterator;
21
- var hasRequiredIterator;
22
-
23
- function requireIterator () {
24
- if (hasRequiredIterator) return iterator;
25
- hasRequiredIterator = 1;
26
- /**
27
- * Iterator class.
28
- *
29
- * @constructor
30
- * @param {function} next - Next function.
31
- */
32
- function Iterator(next) {
33
- if (typeof next !== 'function')
34
- throw new Error('obliterator/iterator: expecting a function!');
35
-
36
- this.next = next;
37
- }
38
-
39
- /**
40
- * If symbols are supported, we add `next` to `Symbol.iterator`.
41
- */
42
- if (typeof Symbol !== 'undefined')
43
- Iterator.prototype[Symbol.iterator] = function () {
44
- return this;
45
- };
46
-
47
- /**
48
- * Returning an iterator of the given values.
49
- *
50
- * @param {any...} values - Values.
51
- * @return {Iterator}
52
- */
53
- Iterator.of = function () {
54
- var args = arguments,
55
- l = args.length,
56
- i = 0;
57
-
58
- return new Iterator(function () {
59
- if (i >= l) return {done: true};
60
-
61
- return {done: false, value: args[i++]};
62
- });
63
- };
64
-
65
- /**
66
- * Returning an empty iterator.
67
- *
68
- * @return {Iterator}
69
- */
70
- Iterator.empty = function () {
71
- var iterator = new Iterator(function () {
72
- return {done: true};
73
- });
74
-
75
- return iterator;
76
- };
77
-
78
- /**
79
- * Returning an iterator over the given indexed sequence.
80
- *
81
- * @param {string|Array} sequence - Target sequence.
82
- * @return {Iterator}
83
- */
84
- Iterator.fromSequence = function (sequence) {
85
- var i = 0,
86
- l = sequence.length;
87
-
88
- return new Iterator(function () {
89
- if (i >= l) return {done: true};
90
-
91
- return {done: false, value: sequence[i++]};
92
- });
93
- };
94
-
95
- /**
96
- * Returning whether the given value is an iterator.
97
- *
98
- * @param {any} value - Value.
99
- * @return {boolean}
100
- */
101
- Iterator.is = function (value) {
102
- if (value instanceof Iterator) return true;
103
-
104
- return (
105
- typeof value === 'object' &&
106
- value !== null &&
107
- typeof value.next === 'function'
108
- );
109
- };
110
-
111
- /**
112
- * Exporting.
113
- */
114
- iterator = Iterator;
115
- return iterator;
116
- }
117
-
118
- export { requireSupport as a, requireIterator as r };