@likec4/core 1.47.0 → 1.49.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 (152) hide show
  1. package/LICENSE +1 -1
  2. package/dist/THIRD-PARTY-LICENSES.md +1012 -0
  3. package/dist/_chunks/Builder.view-element.mjs +2 -0
  4. package/dist/_chunks/LikeC4Model.d.mts +1283 -0
  5. package/dist/_chunks/RichText.mjs +1 -0
  6. package/dist/_chunks/_types.d.mts +777 -0
  7. package/dist/_chunks/_types2.d.mts +36 -0
  8. package/dist/_chunks/assignTagColors.mjs +1 -0
  9. package/dist/_chunks/calcDriftsFromSnapshot.mjs +1 -0
  10. package/dist/_chunks/guards.d.mts +2026 -0
  11. package/dist/_chunks/guards.mjs +4 -0
  12. package/dist/_chunks/index.d.mts +288 -0
  13. package/dist/_chunks/libs/@mantine/colors-generator.mjs +15 -0
  14. package/dist/_chunks/libs/@radix-ui/colors.mjs +1 -0
  15. package/dist/_chunks/libs/@ungap/structured-clone.mjs +1 -0
  16. package/dist/_chunks/libs/bail.mjs +1 -0
  17. package/dist/_chunks/libs/ccount.mjs +1 -0
  18. package/dist/_chunks/libs/character-entities-html4.mjs +1 -0
  19. package/dist/_chunks/libs/character-entities-legacy.mjs +1 -0
  20. package/dist/_chunks/libs/character-entities.mjs +2 -0
  21. package/dist/_chunks/libs/comma-separated-tokens.mjs +1 -0
  22. package/dist/_chunks/libs/decode-named-character-reference.mjs +1 -0
  23. package/dist/_chunks/libs/defu.mjs +1 -0
  24. package/dist/_chunks/libs/devlop.mjs +1 -0
  25. package/dist/_chunks/libs/escape-string-regexp.mjs +1 -0
  26. package/dist/_chunks/libs/extend.mjs +1 -0
  27. package/dist/_chunks/libs/graphology-dag.mjs +1 -0
  28. package/dist/_chunks/libs/graphology.mjs +1 -0
  29. package/dist/_chunks/libs/hast-util-sanitize.mjs +1 -0
  30. package/dist/_chunks/libs/hast-util-to-html.mjs +9 -0
  31. package/dist/_chunks/libs/is-plain-obj.mjs +1 -0
  32. package/dist/_chunks/libs/longest-streak.mjs +1 -0
  33. package/dist/_chunks/libs/markdown-table.mjs +2 -0
  34. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +1 -0
  35. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +3 -0
  36. package/dist/_chunks/libs/mdast-util-gfm.mjs +15 -0
  37. package/dist/_chunks/libs/mdast-util-to-hast.mjs +11 -0
  38. package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -0
  39. package/dist/_chunks/libs/mnemonist.d.mts +164 -0
  40. package/dist/_chunks/libs/mnemonist.mjs +1 -0
  41. package/dist/_chunks/libs/natural-compare-lite.mjs +9 -0
  42. package/dist/_chunks/libs/ohash.mjs +1 -0
  43. package/dist/_chunks/libs/rehype-sanitize.mjs +1 -0
  44. package/dist/_chunks/libs/rehype-stringify.mjs +1 -0
  45. package/dist/_chunks/libs/remark-gfm.mjs +1 -0
  46. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +3 -0
  47. package/dist/_chunks/libs/remark-parse.mjs +1 -0
  48. package/dist/_chunks/libs/remark-rehype.mjs +1 -0
  49. package/dist/_chunks/libs/remeda.mjs +1 -0
  50. package/dist/_chunks/libs/trough.mjs +1 -0
  51. package/dist/_chunks/libs/unified.mjs +1 -0
  52. package/dist/_chunks/rolldown-runtime.mjs +1 -0
  53. package/dist/_chunks/theme.d.mts +148 -0
  54. package/dist/_chunks/to-text.d.mts +404 -0
  55. package/dist/_chunks/to-text.mjs +1 -0
  56. package/dist/_chunks/vector.d.mts +198 -0
  57. package/dist/_chunks/vector.mjs +1 -0
  58. package/dist/builder/index.d.mts +5 -775
  59. package/dist/builder/index.mjs +1 -1053
  60. package/dist/compute-view/index.d.mts +156 -56
  61. package/dist/compute-view/index.mjs +2 -229
  62. package/dist/geometry/index.d.mts +2 -109
  63. package/dist/geometry/index.mjs +1 -328
  64. package/dist/index.d.mts +14 -20
  65. package/dist/index.mjs +1 -18
  66. package/dist/model/index.d.mts +5 -57
  67. package/dist/model/index.mjs +1 -4
  68. package/dist/styles/index.d.mts +3 -117
  69. package/dist/styles/index.mjs +1 -63
  70. package/dist/types/index.d.mts +3 -47
  71. package/dist/types/index.mjs +1 -17
  72. package/dist/utils/graphology/index.d.mts +2 -1864
  73. package/dist/utils/graphology/index.mjs +1 -1
  74. package/dist/utils/index.d.mts +4 -124
  75. package/dist/utils/index.mjs +1 -44
  76. package/package.json +20 -24
  77. package/compute-view/relationships/package.json +0 -4
  78. package/dist/compute-view/relationships-view/index.d.mts +0 -51
  79. package/dist/compute-view/relationships-view/index.mjs +0 -185
  80. package/dist/model/connection/deployment/index.d.mts +0 -15
  81. package/dist/model/connection/deployment/index.mjs +0 -2
  82. package/dist/model/connection/index.d.mts +0 -75
  83. package/dist/model/connection/index.mjs +0 -3
  84. package/dist/model/connection/model/index.d.mts +0 -15
  85. package/dist/model/connection/model/index.mjs +0 -2
  86. package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
  87. package/dist/shared/core.78IWAHAE.mjs +0 -332
  88. package/dist/shared/core.B85MJLTf.mjs +0 -5
  89. package/dist/shared/core.BFd1lU9R.mjs +0 -29
  90. package/dist/shared/core.BKlholso.mjs +0 -3
  91. package/dist/shared/core.BNN-3vPH.mjs +0 -1255
  92. package/dist/shared/core.BPGOjone.d.mts +0 -46
  93. package/dist/shared/core.BP_QHEXs.mjs +0 -785
  94. package/dist/shared/core.BbE4y-yl.mjs +0 -177
  95. package/dist/shared/core.Bdy3hhTc.mjs +0 -28382
  96. package/dist/shared/core.BfCKSW-g.d.mts +0 -1266
  97. package/dist/shared/core.BhNcrwzK.mjs +0 -7
  98. package/dist/shared/core.BkVA6gjl.mjs +0 -5
  99. package/dist/shared/core.BoYfZOBm.mjs +0 -3
  100. package/dist/shared/core.BsSXS-_R.mjs +0 -7
  101. package/dist/shared/core.C3JowhaZ.mjs +0 -32
  102. package/dist/shared/core.C4x8aaWa.mjs +0 -27
  103. package/dist/shared/core.CAgYpDtM.d.mts +0 -98
  104. package/dist/shared/core.CHf8VEa3.mjs +0 -1206
  105. package/dist/shared/core.CLSZtnFh.mjs +0 -69
  106. package/dist/shared/core.C_3y3eqV.d.mts +0 -139
  107. package/dist/shared/core.CbT8JVYL.mjs +0 -5
  108. package/dist/shared/core.CdNCAwq7.mjs +0 -176
  109. package/dist/shared/core.CmGY9blO.mjs +0 -6717
  110. package/dist/shared/core.CmPXpJ8l.mjs +0 -21
  111. package/dist/shared/core.Coi_LOUZ.mjs +0 -7
  112. package/dist/shared/core.CqAJJpK_.mjs +0 -3
  113. package/dist/shared/core.CywrQs86.d.mts +0 -31
  114. package/dist/shared/core.D00YbOhQ.d.mts +0 -300
  115. package/dist/shared/core.D0WZutNd.mjs +0 -94
  116. package/dist/shared/core.D4npX2q8.mjs +0 -18
  117. package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
  118. package/dist/shared/core.DC5IAaDT.d.mts +0 -334
  119. package/dist/shared/core.DE9qzhn8.d.mts +0 -83
  120. package/dist/shared/core.DGcIbsj4.mjs +0 -3946
  121. package/dist/shared/core.DH7TXqXf.mjs +0 -136
  122. package/dist/shared/core.DKhRkHRN.d.mts +0 -41
  123. package/dist/shared/core.DRJma0Ol.mjs +0 -22
  124. package/dist/shared/core.DU5SRqNF.mjs +0 -2209
  125. package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
  126. package/dist/shared/core.DbfO90vF.mjs +0 -434
  127. package/dist/shared/core.DcS-0zys.mjs +0 -10
  128. package/dist/shared/core.Dh119QSP.mjs +0 -4995
  129. package/dist/shared/core.DjcWextK.mjs +0 -1371
  130. package/dist/shared/core.Dojz4bvg.d.mts +0 -504
  131. package/dist/shared/core.FZ305VYd.mjs +0 -21
  132. package/dist/shared/core.OtRNdMxy.d.mts +0 -352
  133. package/dist/shared/core.RfnaEmgA.mjs +0 -7
  134. package/dist/shared/core.btEq3i3f.mjs +0 -300
  135. package/dist/shared/core.oSV6SRfk.mjs +0 -13
  136. package/dist/shared/core.om36dXXW.mjs +0 -41
  137. package/dist/shared/core.osFs8tU7.d.mts +0 -466
  138. package/dist/shared/core.q10OP9oJ.mjs +0 -5
  139. package/dist/shared/core.tpvDGvdC.d.mts +0 -87
  140. package/dist/shared/core.uFk_o9X6.mjs +0 -13
  141. package/dist/types/_aux.d.mts +0 -4
  142. package/dist/types/_aux.mjs +0 -8
  143. package/dist/types/expression-model.d.mts +0 -190
  144. package/dist/types/expression-model.mjs +0 -109
  145. package/dist/types/expression.d.mts +0 -6
  146. package/dist/types/expression.mjs +0 -113
  147. package/dist/types/fqnRef.d.mts +0 -60
  148. package/dist/types/fqnRef.mjs +0 -45
  149. package/dist/types/scalar.d.mts +0 -2
  150. package/dist/types/scalar.mjs +0 -4
  151. package/dist/utils/iterable/index.d.mts +0 -132
  152. package/dist/utils/iterable/index.mjs +0 -62
@@ -0,0 +1,198 @@
1
+ //#region src/geometry/types.d.ts
2
+ interface XYPoint {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ interface Dimensions {
7
+ width: number;
8
+ height: number;
9
+ }
10
+ type Point = readonly [x: number, y: number];
11
+ declare function isPoint(point: unknown): point is Point;
12
+ /**
13
+ * Converts between Point (tuple) and XYPoint (object) representations.
14
+ *
15
+ * @param point - The point to convert (either XYPoint or Point tuple)
16
+ * @returns The converted point in the alternate format
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // Convert tuple to object
21
+ * convertPoint([10, 20]) // returns { x: 10, y: 20 }
22
+ *
23
+ * // Convert object to tuple
24
+ * convertPoint({ x: 10, y: 20 }) // returns [10, 20]
25
+ * ```
26
+ */
27
+ declare function convertPoint(point: Point): XYPoint;
28
+ declare function convertPoint(point: XYPoint): Point;
29
+ //#endregion
30
+ //#region src/geometry/bbox.d.ts
31
+ interface BBox {
32
+ x: number;
33
+ y: number;
34
+ width: number;
35
+ height: number;
36
+ }
37
+ declare const BBox: {
38
+ center({
39
+ x,
40
+ y,
41
+ width,
42
+ height
43
+ }: BBox): XYPoint;
44
+ /**
45
+ * Returns the four corner points of the box in clockwise order starting from top-left
46
+ */
47
+ toPoints({
48
+ x,
49
+ y,
50
+ width,
51
+ height
52
+ }: BBox): [XYPoint, XYPoint, XYPoint, XYPoint];
53
+ fromPoints(points: Point[]): BBox;
54
+ merge(...boxes: BBox[]): BBox;
55
+ fromRectBox(rect: RectBox): BBox;
56
+ toRectBox(box: BBox): RectBox;
57
+ expand(box: BBox, plus: number): BBox;
58
+ shrink(box: BBox, minus: number): BBox;
59
+ /**
60
+ * Returns true if `a` includes `b` (i.e. `b` is inside `a`)
61
+ */
62
+ includes(a: BBox, b: BBox): boolean;
63
+ };
64
+ interface RectBox {
65
+ x1: number;
66
+ y1: number;
67
+ x2: number;
68
+ y2: number;
69
+ }
70
+ declare const RectBox: {
71
+ center({
72
+ x1,
73
+ y1,
74
+ x2,
75
+ y2
76
+ }: RectBox): XYPoint;
77
+ fromPoints(points: Point[]): RectBox;
78
+ merge(...boxes: RectBox[]): RectBox;
79
+ toBBox(box: RectBox): BBox;
80
+ /**
81
+ * Returns true if `a` includes `b` (i.e. `b` is inside `a`)
82
+ */
83
+ includes(a: RectBox, b: RectBox): boolean;
84
+ };
85
+ //#endregion
86
+ //#region src/geometry/vector.d.ts
87
+ interface VectorValue {
88
+ readonly x: number;
89
+ readonly y: number;
90
+ }
91
+ declare class Vector implements VectorValue {
92
+ readonly x: number;
93
+ readonly y: number;
94
+ constructor(x: number, y: number);
95
+ static create(position: VectorValue): Vector;
96
+ static create(x: number, y: number): Vector;
97
+ /**
98
+ * Adds two vectors.
99
+ * @param a The first vector.
100
+ * @param b The second vector.
101
+ * @returns The sum of the two vectors.
102
+ */
103
+ static add(a: VectorValue, b: VectorValue): VectorValue;
104
+ /**
105
+ * Subtracts two vectors.
106
+ * @param a The first vector.
107
+ * @param b The second vector.
108
+ * @returns The difference of the two vectors.
109
+ */
110
+ static subtract(a: VectorValue, b: VectorValue): VectorValue;
111
+ /**
112
+ * Multiplies a vector by a scalar.
113
+ * @param a The vector.
114
+ * @param b The scalar.
115
+ * @returns The scaled vector.
116
+ */
117
+ static multiply(a: VectorValue, b: number): VectorValue;
118
+ /**
119
+ * Divides a vector by a scalar.
120
+ * @param a The vector.
121
+ * @param b The scalar.
122
+ * @returns The scaled vector.
123
+ */
124
+ static divide(a: VectorValue, b: number): VectorValue;
125
+ /**
126
+ * Calculates the dot product of the vectors.
127
+ * @param a The first vector.
128
+ * @param b The second vector.
129
+ * @returns The dot product.
130
+ */
131
+ static dot(a: VectorValue, b: VectorValue): number;
132
+ /**
133
+ * Adds the given vector to this vector.
134
+ * @param b The vector to add.
135
+ * @returns A new vector that is the sum of this vector and the given vector.
136
+ */
137
+ add(b: VectorValue): Vector;
138
+ /**
139
+ * Subtracts the given vector from this vector.
140
+ * @param b The vector to subtract.
141
+ * @returns A new vector that is the difference of this vector and the given vector.
142
+ */
143
+ subtract(b: VectorValue): Vector;
144
+ /**
145
+ * Multiplies this vector by a scalar.
146
+ * @param b The scalar to multiply by.
147
+ * @returns A new vector that is the product of this vector and the given scalar.
148
+ */
149
+ multiply(b: number): Vector;
150
+ /**
151
+ * Divides this vector by a scalar.
152
+ * @param b The scalar to divide by.
153
+ * @returns A new vector that is the quotient of this vector and the given scalar.
154
+ */
155
+ divide(b: number): Vector;
156
+ /**
157
+ * Calculates the dot product of this vector and another vector.
158
+ * @param b The other vector.
159
+ * @returns The dot product.
160
+ */
161
+ dot(b: VectorValue): number;
162
+ /**
163
+ * Calculates the cross product of this vector and another vector.
164
+ * The cross product of two 2D vectors is a scalar value: a.x * b.y - a.y * b.x
165
+ * @param b The other vector.
166
+ * @returns The cross product as a scalar.
167
+ */
168
+ cross(b: VectorValue): number;
169
+ /**
170
+ * Calculates the length (magnitude) of this vector.
171
+ * @returns The length of the vector.
172
+ */
173
+ length(): number;
174
+ /**
175
+ * Normalizes the vector (makes it unit length, i.e., has a length of 1).
176
+ * @returns A new vector that is the normalized version of this vector.
177
+ */
178
+ normalize(): Vector;
179
+ /**
180
+ * Rounds the components of the vector to the nearest integers.
181
+ * @returns A new vector with rounded components.
182
+ */
183
+ round(): Vector;
184
+ /**
185
+ * Truncates the components of the vector (removes the decimal part).
186
+ * @returns A new vector with truncated components.
187
+ */
188
+ trunc(): Vector;
189
+ /**
190
+ * Converts the vector to a plain object.
191
+ * @returns An object with x and y properties.
192
+ */
193
+ toObject(): VectorValue;
194
+ }
195
+ declare function vector(source: VectorValue | Vector): Vector;
196
+ declare function vector(x: number, y: number): Vector;
197
+ //#endregion
198
+ export { RectBox as a, XYPoint as c, BBox as i, convertPoint as l, VectorValue as n, Dimensions as o, vector as r, Point as s, Vector as t, isPoint as u };
@@ -0,0 +1 @@
1
+ import{Q as t}from"./libs/remeda.mjs";import{Q as invariant}from"./to-text.mjs";function isPoint(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function convertPoint(e){return isPoint(e)?{x:e[0],y:e[1]}:[e.x,e.y]}const BBox={center({x:e,y:n,width:r,height:i}){return{x:e+r/2,y:n+i/2}},toPoints({x:e,y:n,width:r,height:i}){return[{x:e,y:n},{x:e+r,y:n},{x:e+r,y:n+i},{x:e,y:n+i}]},fromPoints(e){let{x1:n,y1:r,x2:i,y2:a}=RectBox.fromPoints(e);return{x:n,y:r,width:i-n,height:a-r}},merge(...r){if(invariant(t(r,1),`No boxes provided`),r.length===1)return r[0];let i=r[0].x,a=r[0].y,o=r[0].x+r[0].width,s=r[0].y+r[0].height;for(let e=1;e<r.length;e++){let n=r[e];i=Math.min(i,n.x),a=Math.min(a,n.y),o=Math.max(o,n.x+n.width),s=Math.max(s,n.y+n.height)}return{x:Math.floor(i),y:Math.floor(a),width:Math.round(o-i),height:Math.round(s-a)}},fromRectBox(e){return{x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x2-e.x1),height:Math.abs(e.y2-e.y1)}},toRectBox(e){return{x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height}},expand(e,n){return n===0?e:{x:e.x-n,y:e.y-n,width:e.width+n*2,height:e.height+n*2}},shrink(e,n){return n===0?e:{x:e.x+n,y:e.y+n,width:e.width-n*2,height:e.height-n*2}},includes(e,n){return e===n?!0:e.x<=n.x&&e.y<=n.y&&e.x+e.width>=n.x+n.width&&e.y+e.height>=n.y+n.height}},RectBox={center({x1:e,y1:n,x2:r,y2:i}){return{x:(e+r)/2,y:(n+i)/2}},fromPoints(e){invariant(e.length>0,`At least one point is required`);let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let[n,s]of e)r=Math.min(r,n),i=Math.min(i,s),a=Math.max(a,n),o=Math.max(o,s);return{x1:r,y1:i,x2:a,y2:o}},merge(...e){invariant(e.length>0,`No boxes provided`);let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let n of e)r=Math.min(r,n.x1),i=Math.min(i,n.y1),a=Math.max(a,n.x2),o=Math.max(o,n.y2);return{x1:r,y1:i,x2:a,y2:o}},toBBox(e){return{x:e.x1,y:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}},includes(e,n){return e===n?!0:e.x1<=n.x1&&e.y1<=n.y1&&e.x2>=n.x2&&e.y2>=n.y2}};var Vector=class e{constructor(e,r){this.x=e,this.y=r,invariant(typeof e==`number`&&!isNaN(e)&&isFinite(e)&&typeof r==`number`&&!isNaN(r)&&isFinite(r),`Invalid arguments for Vector: (${e}, ${r})`)}static create(...n){return n.length===2?new e(n[0],n[1]):new e(n[0].x,n[0].y)}static add(e,n){return{x:e.x+n.x,y:e.y+n.y}}static subtract(e,n){return{x:e.x-n.x,y:e.y-n.y}}static multiply(e,n){return{x:e.x*n,y:e.y*n}}static divide(e,n){return{x:e.x/n,y:e.y/n}}static dot(e,n){return e.x*n.x+e.y*n.y}add(n){return new e(this.x+n.x,this.y+n.y)}subtract(n){return new e(this.x-n.x,this.y-n.y)}multiply(n){return new e(this.x*n,this.y*n)}divide(n){return new e(this.x/n,this.y/n)}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}length(){return this.x===0&&this.y===0?0:Math.sqrt(this.x**2+this.y**2)}normalize(){let n=this.length();return n===0?new e(0,0):new e(this.x/n,this.y/n)}round(){return new e(Math.round(this.x),Math.round(this.y))}trunc(){return new e(Math.trunc(this.x),Math.trunc(this.y))}toObject(){return{x:this.x,y:this.y}}};function vector(...e){return e.length===1&&e[0]instanceof Vector?e[0]:e.length===2?new Vector(e[0],e[1]):new Vector(e[0].x,e[0].y)}export{convertPoint as a,RectBox as i,vector as n,isPoint as o,BBox as r,Vector as t};