@likec4/core 1.40.0 → 1.42.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 (257) hide show
  1. package/builder/package.json +4 -0
  2. package/compute-view/package.json +4 -0
  3. package/compute-view/relationships/package.json +4 -0
  4. package/dist/builder/index.d.mts +83 -20
  5. package/dist/builder/index.mjs +210 -126
  6. package/dist/compute-view/index.d.mts +8 -7
  7. package/dist/compute-view/index.mjs +14 -11
  8. package/dist/compute-view/relationships-view/index.d.mts +9 -8
  9. package/dist/compute-view/relationships-view/index.mjs +6 -6
  10. package/dist/index.d.mts +7 -7
  11. package/dist/index.mjs +12 -12
  12. package/dist/model/connection/deployment/index.d.mts +11 -10
  13. package/dist/model/connection/deployment/index.mjs +2 -2
  14. package/dist/model/connection/index.d.mts +12 -11
  15. package/dist/model/connection/index.mjs +3 -3
  16. package/dist/model/connection/model/index.d.mts +11 -10
  17. package/dist/model/connection/model/index.mjs +2 -2
  18. package/dist/model/index.d.mts +14 -14
  19. package/dist/model/index.mjs +4 -5
  20. package/dist/shared/{core.DHQ32OHa.mjs → core.01VTr9qu.mjs} +10 -29
  21. package/dist/shared/core.1vX5a9AY.mjs +86 -0
  22. package/dist/shared/{core.BVNaR17u.mjs → core.B7KhhkRY.mjs} +1 -1
  23. package/dist/shared/core.B85MJLTf.mjs +5 -0
  24. package/dist/shared/{core.BIAlzwKc.mjs → core.BIqHjQiH.mjs} +85 -45
  25. package/dist/shared/core.BKlholso.mjs +3 -0
  26. package/dist/shared/core.BR4zXDH-.mjs +13 -0
  27. package/dist/shared/{core.yHe79zEl.mjs → core.BYNkXQ8A.mjs} +21 -12
  28. package/dist/shared/core.BazD6cot.mjs +14 -0
  29. package/dist/shared/{core.BuoXfSMj.mjs → core.BbE4y-yl.mjs} +1 -1
  30. package/dist/shared/core.BoYfZOBm.mjs +3 -0
  31. package/dist/shared/core.BsSXS-_R.mjs +7 -0
  32. package/dist/shared/{core.T-eLZTW_.mjs → core.BzTakU3I.mjs} +15 -7
  33. package/dist/shared/{core.4u1dVmfX.mjs → core.C2TiyjI6.mjs} +2 -2
  34. package/dist/shared/{core.DLpidoWc.mjs → core.C3JowhaZ.mjs} +3 -3
  35. package/dist/shared/{core.CNGyqkJh.mjs → core.C4x8aaWa.mjs} +3 -1
  36. package/dist/shared/{core.BB6zA-UU.mjs → core.C8YY6Uub.mjs} +38 -9
  37. package/dist/shared/{core.FPITT8Vx.mjs → core.C8sl5Y8Z.mjs} +144 -61
  38. package/dist/shared/{core.DuR3R-xJ.mjs → core.CNgZvKb8.mjs} +3 -5176
  39. package/dist/shared/{core.BbThmf6M.d.mts → core.CQngdcuj.d.mts} +85 -4
  40. package/dist/shared/{core.Be1n9a0i.mjs → core.C_Ni6yHl.mjs} +5 -4
  41. package/dist/shared/core.CbT8JVYL.mjs +5 -0
  42. package/dist/shared/core.CqAJJpK_.mjs +3 -0
  43. package/dist/shared/{core.CySf-2gP.d.mts → core.D0PjZzIS.d.mts} +52 -15
  44. package/dist/shared/{core.DrvfVXkh.d.mts → core.D5fzJWbF.d.mts} +11 -2
  45. package/dist/shared/{core.DrVOJuxX.d.mts → core.DACpKp35.d.mts} +5 -5
  46. package/dist/shared/core.DFi2dOTl.mjs +39548 -0
  47. package/dist/shared/{core.D704WZES.d.mts → core.DIol3syK.d.mts} +2 -2
  48. package/dist/shared/{core.DlG1xWt2.mjs → core.DMMOWQqc.mjs} +3 -2
  49. package/dist/shared/core.DNbUPnve.mjs +3990 -0
  50. package/dist/shared/{core.CCD1ID81.mjs → core.DRJma0Ol.mjs} +4 -3
  51. package/dist/shared/{core.DgttqsJc.mjs → core.DRhg-gVU.mjs} +9 -9
  52. package/dist/shared/core.DSO_rTC2.mjs +5322 -0
  53. package/dist/shared/{core.vWJTxpLV.d.mts → core.D_vkffV4.d.mts} +4 -2
  54. package/dist/shared/core.DdMJk7nx.d.mts +476 -0
  55. package/dist/shared/{core.D_fI5Lf6.d.mts → core.Dgs6-nuz.d.mts} +24 -4
  56. package/dist/shared/{core.Be4Jy9Qx.mjs → core.FZ305VYd.mjs} +2 -2
  57. package/dist/shared/core.OHD4KXm9.mjs +5 -0
  58. package/dist/shared/{core.GTgsmXS_.mjs → core.QJD_fcrc.mjs} +2 -2
  59. package/dist/shared/core.RfnaEmgA.mjs +7 -0
  60. package/dist/shared/core.fHR_8Tnq.d.mts +450 -0
  61. package/dist/shared/{core.D0EgVMQK.mjs → core.lRvxPoao.mjs} +14 -12
  62. package/dist/shared/{core.CaT0SUUK.mjs → core.rCeaAqgW.mjs} +1 -84
  63. package/dist/shared/{core.kxeJe0OY.d.mts → core.s9uwOt60.d.mts} +4 -4
  64. package/dist/shared/core.yna0OdV5.d.mts +98 -0
  65. package/dist/styles/index.d.mts +106 -0
  66. package/dist/styles/index.mjs +1 -0
  67. package/dist/types/_aux.d.mts +2 -2
  68. package/dist/types/_aux.mjs +1 -5
  69. package/dist/types/expression-model.d.mts +3 -4
  70. package/dist/types/expression.d.mts +3 -4
  71. package/dist/types/fqnRef.d.mts +2 -2
  72. package/dist/types/fqnRef.mjs +3 -3
  73. package/dist/types/index.d.mts +8 -8
  74. package/dist/types/index.mjs +151 -6
  75. package/dist/types/scalar.mjs +3 -2
  76. package/dist/utils/graphology/index.d.mts +1864 -0
  77. package/dist/utils/graphology/index.mjs +1 -0
  78. package/dist/utils/index.d.mts +11 -6
  79. package/dist/utils/index.mjs +21 -37
  80. package/dist/utils/iterable/index.d.mts +1 -1
  81. package/dist/utils/iterable/index.mjs +45 -7
  82. package/model/package.json +4 -0
  83. package/package.json +42 -24
  84. package/styles/package.json +4 -0
  85. package/types/package.json +4 -0
  86. package/utils/graphology/package.json +4 -0
  87. package/utils/package.json +4 -0
  88. package/dist/shared/core.6_Vp2iiN.mjs +0 -172
  89. package/dist/shared/core.Bpou6c2f.d.mts +0 -850
  90. package/dist/shared/core.CUw_2J9j.mjs +0 -47
  91. package/dist/shared/core.CzdwsPmY.d.mts +0 -69
  92. package/dist/shared/core.DoM6aM9N.mjs +0 -7
  93. package/dist/shared/core.ILwny7BV.mjs +0 -38
  94. package/dist/theme/index.d.mts +0 -11
  95. package/dist/theme/index.mjs +0 -232
  96. package/src/builder/Builder.deployment.ts +0 -224
  97. package/src/builder/Builder.deploymentModel.ts +0 -449
  98. package/src/builder/Builder.element.ts +0 -241
  99. package/src/builder/Builder.model.ts +0 -494
  100. package/src/builder/Builder.ts +0 -870
  101. package/src/builder/Builder.view-common.ts +0 -273
  102. package/src/builder/Builder.view-deployment.ts +0 -135
  103. package/src/builder/Builder.view-element.ts +0 -202
  104. package/src/builder/Builder.views.ts +0 -399
  105. package/src/builder/Builder.with.ts +0 -156
  106. package/src/builder/_types.ts +0 -320
  107. package/src/builder/index.ts +0 -11
  108. package/src/compute-view/compute-view.ts +0 -80
  109. package/src/compute-view/deployment-view/_types.ts +0 -38
  110. package/src/compute-view/deployment-view/clean-connections.ts +0 -236
  111. package/src/compute-view/deployment-view/compute.ts +0 -94
  112. package/src/compute-view/deployment-view/memory/index.ts +0 -9
  113. package/src/compute-view/deployment-view/memory/memory.ts +0 -96
  114. package/src/compute-view/deployment-view/predicates/deploymentRefs-where.ts +0 -18
  115. package/src/compute-view/deployment-view/predicates/deploymentRefs.ts +0 -154
  116. package/src/compute-view/deployment-view/predicates/index.ts +0 -8
  117. package/src/compute-view/deployment-view/predicates/relation-direct.ts +0 -243
  118. package/src/compute-view/deployment-view/predicates/relation-in-out.ts +0 -70
  119. package/src/compute-view/deployment-view/predicates/relation-incoming.ts +0 -101
  120. package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +0 -95
  121. package/src/compute-view/deployment-view/predicates/relation-where.ts +0 -18
  122. package/src/compute-view/deployment-view/predicates/utils.ts +0 -282
  123. package/src/compute-view/deployment-view/predicates/wildcard.ts +0 -41
  124. package/src/compute-view/deployment-view/stages/stage-exclude.ts +0 -5
  125. package/src/compute-view/deployment-view/stages/stage-final.ts +0 -245
  126. package/src/compute-view/deployment-view/stages/stage-include.ts +0 -95
  127. package/src/compute-view/deployment-view/utils.ts +0 -286
  128. package/src/compute-view/dynamic-view/compute.ts +0 -312
  129. package/src/compute-view/element-view/_types.ts +0 -47
  130. package/src/compute-view/element-view/clean-connections.ts +0 -117
  131. package/src/compute-view/element-view/compute.ts +0 -324
  132. package/src/compute-view/element-view/memory/NodeGroup.ts +0 -31
  133. package/src/compute-view/element-view/memory/index.ts +0 -10
  134. package/src/compute-view/element-view/memory/memory.ts +0 -178
  135. package/src/compute-view/element-view/memory/stage-exclude.ts +0 -59
  136. package/src/compute-view/element-view/memory/stage-final.ts +0 -129
  137. package/src/compute-view/element-view/memory/stage-include.ts +0 -130
  138. package/src/compute-view/element-view/predicates/_utils.ts +0 -91
  139. package/src/compute-view/element-view/predicates/element-expand.ts +0 -29
  140. package/src/compute-view/element-view/predicates/element-kind-tag.ts +0 -27
  141. package/src/compute-view/element-view/predicates/element-ref.ts +0 -24
  142. package/src/compute-view/element-view/predicates/relation-direct.ts +0 -321
  143. package/src/compute-view/element-view/predicates/relation-in-out.ts +0 -64
  144. package/src/compute-view/element-view/predicates/relation-in.ts +0 -115
  145. package/src/compute-view/element-view/predicates/relation-out.ts +0 -119
  146. package/src/compute-view/element-view/predicates/wildcard.ts +0 -88
  147. package/src/compute-view/element-view/utils.ts +0 -65
  148. package/src/compute-view/index.ts +0 -4
  149. package/src/compute-view/memory/AbstractMemory.ts +0 -45
  150. package/src/compute-view/memory/AbstractStageExclude.ts +0 -215
  151. package/src/compute-view/memory/AbstractStageInclude.ts +0 -200
  152. package/src/compute-view/memory/_types.ts +0 -148
  153. package/src/compute-view/memory/index.ts +0 -5
  154. package/src/compute-view/memory/ops.ts +0 -43
  155. package/src/compute-view/relationships-view/_types.ts +0 -16
  156. package/src/compute-view/relationships-view/compute.ts +0 -159
  157. package/src/compute-view/relationships-view/index.ts +0 -3
  158. package/src/compute-view/relationships-view/layout.ts +0 -357
  159. package/src/compute-view/relationships-view/utils.ts +0 -73
  160. package/src/compute-view/utils/ancestorsOfNode.ts +0 -19
  161. package/src/compute-view/utils/applyCustomElementProperties.ts +0 -107
  162. package/src/compute-view/utils/applyCustomRelationProperties.ts +0 -58
  163. package/src/compute-view/utils/applyViewRuleStyles.ts +0 -73
  164. package/src/compute-view/utils/buildComputedNodes.ts +0 -153
  165. package/src/compute-view/utils/buildElementNotations.ts +0 -63
  166. package/src/compute-view/utils/elementExpressionToPredicate.ts +0 -50
  167. package/src/compute-view/utils/link-nodes-with-edges.ts +0 -56
  168. package/src/compute-view/utils/merge-props-from-relationships.ts +0 -161
  169. package/src/compute-view/utils/relationExpressionToPredicates.ts +0 -55
  170. package/src/compute-view/utils/resolve-extended-views.ts +0 -85
  171. package/src/compute-view/utils/resolve-global-rules.ts +0 -88
  172. package/src/compute-view/utils/topological-sort.ts +0 -256
  173. package/src/compute-view/utils/view-hash.ts +0 -45
  174. package/src/compute-view/utils/with-readable-edges.ts +0 -40
  175. package/src/index.ts +0 -32
  176. package/src/model/DeploymentElementModel.ts +0 -682
  177. package/src/model/DeploymentModel.ts +0 -393
  178. package/src/model/ElementModel.ts +0 -293
  179. package/src/model/LikeC4Model.ts +0 -882
  180. package/src/model/RelationModel.ts +0 -152
  181. package/src/model/connection/Connection.ts +0 -72
  182. package/src/model/connection/deployment/DeploymentConnectionModel.ts +0 -185
  183. package/src/model/connection/deployment/find.ts +0 -120
  184. package/src/model/connection/deployment/index.ts +0 -8
  185. package/src/model/connection/index.ts +0 -22
  186. package/src/model/connection/model/ConnectionModel.ts +0 -158
  187. package/src/model/connection/model/find.ts +0 -117
  188. package/src/model/connection/model/index.ts +0 -8
  189. package/src/model/connection/ops.ts +0 -276
  190. package/src/model/guards.ts +0 -77
  191. package/src/model/index.ts +0 -72
  192. package/src/model/types.ts +0 -67
  193. package/src/model/utils.ts +0 -66
  194. package/src/model/view/EdgeModel.ts +0 -120
  195. package/src/model/view/LikeC4ViewModel.ts +0 -361
  196. package/src/model/view/LikeC4ViewsFolder.ts +0 -151
  197. package/src/model/view/NodeModel.ts +0 -247
  198. package/src/theme/element.ts +0 -61
  199. package/src/theme/index.ts +0 -127
  200. package/src/theme/relationships.ts +0 -54
  201. package/src/types/RichText.ts +0 -206
  202. package/src/types/_aux.ts +0 -291
  203. package/src/types/_common.ts +0 -80
  204. package/src/types/const.ts +0 -34
  205. package/src/types/expression-model.ts +0 -294
  206. package/src/types/expression.ts +0 -313
  207. package/src/types/fqnRef.ts +0 -91
  208. package/src/types/geometry.ts +0 -159
  209. package/src/types/global.ts +0 -21
  210. package/src/types/index.ts +0 -42
  211. package/src/types/model-data.ts +0 -77
  212. package/src/types/model-deployment.ts +0 -88
  213. package/src/types/model-dump.ts +0 -79
  214. package/src/types/model-logical.ts +0 -135
  215. package/src/types/model-spec.ts +0 -85
  216. package/src/types/operators.ts +0 -156
  217. package/src/types/project.ts +0 -14
  218. package/src/types/scalar.ts +0 -162
  219. package/src/types/styles.ts +0 -122
  220. package/src/types/view-changes.ts +0 -32
  221. package/src/types/view-common.ts +0 -157
  222. package/src/types/view-computed.ts +0 -118
  223. package/src/types/view-layouted.ts +0 -98
  224. package/src/types/view-parsed.deployment.ts +0 -39
  225. package/src/types/view-parsed.dynamic.ts +0 -89
  226. package/src/types/view-parsed.element.ts +0 -65
  227. package/src/types/view.ts +0 -113
  228. package/src/utils/common-head.ts +0 -22
  229. package/src/utils/compare-natural.ts +0 -60
  230. package/src/utils/const.ts +0 -1
  231. package/src/utils/fqn.ts +0 -302
  232. package/src/utils/getOrCreate.ts +0 -8
  233. package/src/utils/guards.ts +0 -9
  234. package/src/utils/index.ts +0 -68
  235. package/src/utils/invariant.ts +0 -29
  236. package/src/utils/iterable/_types.ts +0 -5
  237. package/src/utils/iterable/filter.ts +0 -55
  238. package/src/utils/iterable/find.ts +0 -38
  239. package/src/utils/iterable/first.ts +0 -48
  240. package/src/utils/iterable/flat.ts +0 -17
  241. package/src/utils/iterable/head.ts +0 -22
  242. package/src/utils/iterable/index.ts +0 -15
  243. package/src/utils/iterable/map.ts +0 -40
  244. package/src/utils/iterable/reduce.ts +0 -24
  245. package/src/utils/iterable/some.ts +0 -36
  246. package/src/utils/iterable/to.ts +0 -19
  247. package/src/utils/iterable/unique.ts +0 -23
  248. package/src/utils/markdown/index.ts +0 -2
  249. package/src/utils/markdown/to-html.ts +0 -32
  250. package/src/utils/markdown/to-text.ts +0 -14
  251. package/src/utils/memoize-prop.ts +0 -30
  252. package/src/utils/mnemonist.ts +0 -9
  253. package/src/utils/object-hash.ts +0 -14
  254. package/src/utils/promises.ts +0 -24
  255. package/src/utils/relations.ts +0 -36
  256. package/src/utils/set.ts +0 -83
  257. package/src/utils/string-hash.ts +0 -16
@@ -0,0 +1 @@
1
+ export { G as Graph } from '../../shared/core.CNgZvKb8.mjs';
@@ -1,6 +1,6 @@
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, k as commonAncestor, l as compareByFqnHierarchically, o as compareFqnHierarchically, q as hierarchyDistance, r as hierarchyLevel, i as invariant, b as isAncestor, c as isDescendantOf, d as isNonEmptyArray, e as isSameHierarchy, f as isString, m as memoizeProp, n as nameFromFqn, h as nonNullable, g as nonexhaustive, p as parentFqn, t as sortByFqnHierarchically, s as sortNaturalByFqn, j as sortParentsFirst } from '../shared/core.vWJTxpLV.mjs';
3
- import { N as NonEmptyArray } from '../shared/core.DrvfVXkh.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, 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.D_vkffV4.mjs';
3
+ import { N as NonEmptyArray } from '../shared/core.D5fzJWbF.mjs';
4
4
  export { ifilter, ifind, ifirst, iflat, ihead, imap, ireduce, isome, iunique, toArray, toSet } from './iterable/index.mjs';
5
5
  export { i as isIterable } from '../shared/core.DXhDWKFZ.mjs';
6
6
  import '../shared/core.DX-WYEPA.mjs';
@@ -70,18 +70,19 @@ declare function delay(): Promise<string>;
70
70
  declare function delay(ms: number): Promise<string>;
71
71
  declare function delay(randomFrom: number, randomTo: number): Promise<string>;
72
72
  declare function promiseNextTick(): Promise<void>;
73
+ declare function onNextTick(fn: () => Promise<void> | void): void;
73
74
 
74
75
  type RelationshipLike = {
75
76
  source: {
76
- model: string;
77
+ id: string;
77
78
  };
78
79
  target: {
79
- model: string;
80
+ id: string;
80
81
  };
81
82
  };
82
83
  /**
83
84
  * Compares two relations hierarchically.
84
- * From the most general (implicit) to the most specific.
85
+ * From the most general (implicit) to the most specific (deepest in the tree)
85
86
  */
86
87
  declare const compareRelations: <T extends RelationshipLike>(a: T, b: T) => number;
87
88
 
@@ -95,6 +96,10 @@ declare function union<T>(...sets: ReadonlySet<T>[]): Set<T>;
95
96
  * Keeps order from the first set
96
97
  */
97
98
  declare function intersection<T>(first: ReadonlySet<T>, ...sets: NonEmptyArray<ReadonlySet<NoInfer<T>>>): Set<T>;
99
+ /**
100
+ * Returns new set as a difference of two sets (A-B)
101
+ * Keeps order from the first set
102
+ */
98
103
  declare function difference<T>(a: ReadonlySet<T>, b: ReadonlySet<NoInfer<T>>): Set<T>;
99
104
  declare function equals<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): boolean;
100
105
  declare function symmetricDifference<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): Set<T>;
@@ -115,4 +120,4 @@ declare function markdownToHtml(markdown: string): string;
115
120
  */
116
121
  declare function markdownToText(markdown: string): string;
117
122
 
118
- export { Stack, commonHead, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equals as equalsSet, getOrCreate, intersection, markdownToHtml, markdownToText, objectHash, promiseNextTick, stringHash, symmetricDifference, union };
123
+ export { Stack, commonHead, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equals as equalsSet, getOrCreate, intersection, markdownToHtml, markdownToText, objectHash, onNextTick, promiseNextTick, stringHash, symmetricDifference, union };
@@ -1,26 +1,27 @@
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, o as objectHash } from '../shared/core.BB6zA-UU.mjs';
3
- import { g as commonAncestor, h as compareFqnHierarchically } from '../shared/core.DgttqsJc.mjs';
4
- export { a as ancestorsFqn, l as compareByFqnHierarchically, j as compareNatural, k as compareNaturalHierarchically, m as hierarchyDistance, o as hierarchyLevel, i as isAncestor, b as isDescendantOf, c as isNonEmptyArray, d as isSameHierarchy, e as isString, n as nameFromFqn, p as parentFqn, q as sortByFqnHierarchically, s as sortNaturalByFqn, f as sortParentsFirst } from '../shared/core.DgttqsJc.mjs';
2
+ export { S as Stack, c as commonHead, a as compareRelations, o as objectHash } from '../shared/core.C8YY6Uub.mjs';
3
+ export { a as ancestorsFqn, k as commonAncestor, l as compareByFqnHierarchically, m as compareFqnHierarchically, g as compareNatural, j as compareNaturalHierarchically, h as hasProp, o as hierarchyDistance, q as hierarchyLevel, i as isAncestor, b as isDescendantOf, c as isNonEmptyArray, d as isSameHierarchy, e as isString, n as nameFromFqn, p as parentFqn, r as sortByFqnHierarchically, s as sortNaturalByFqn, f as sortParentsFirst } from '../shared/core.DRhg-gVU.mjs';
5
4
  export { g as getOrCreate } from '../shared/core.DcS-0zys.mjs';
6
- export { b as markdownToHtml, a as markdownToText, m as memoizeProp } from '../shared/core.CUw_2J9j.mjs';
7
- import { randomInteger } from 'remeda';
8
- export { d as difference, e as equalsSet, i as intersection, a as stringHash, s as symmetricDifference, u as union } from '../shared/core.4u1dVmfX.mjs';
9
- export { b as BiMap, d as DefaultWeakMap, l as LinkedList, m as MultiMap, q as Queue } from '../shared/core.DlG1xWt2.mjs';
10
- export { D as DefaultMap } from '../shared/core.BuoXfSMj.mjs';
11
- export { i as ifilter } from '../shared/core.CCD1ID81.mjs';
12
- export { i as ifind, a as ihead } from '../shared/core.GTgsmXS_.mjs';
13
- export { i as ifirst, a as ireduce } from '../shared/core.ILwny7BV.mjs';
14
- export { i as iflat, a as iunique } from '../shared/core.CNGyqkJh.mjs';
15
- export { i as imap, t as toArray, a as toSet } from '../shared/core.DLpidoWc.mjs';
16
- export { i as isIterable } from '../shared/core.DoM6aM9N.mjs';
17
- export { i as isome } from '../shared/core.Be4Jy9Qx.mjs';
5
+ export { m as memoizeProp } from '../shared/core.BR4zXDH-.mjs';
6
+ export { d as difference, e as equalsSet, i as intersection, a as stringHash, s as symmetricDifference, u as union } from '../shared/core.C2TiyjI6.mjs';
7
+ export { b as BiMap, d as DefaultWeakMap, l as LinkedList, m as MultiMap, q as Queue } from '../shared/core.DMMOWQqc.mjs';
8
+ export { D as DefaultMap } from '../shared/core.BbE4y-yl.mjs';
9
+ export { i as ifilter } from '../shared/core.DRJma0Ol.mjs';
10
+ export { i as ifind, a as ihead } from '../shared/core.QJD_fcrc.mjs';
11
+ export { ifirst, ireduce } from './iterable/index.mjs';
12
+ export { i as iflat, a as iunique } from '../shared/core.C4x8aaWa.mjs';
13
+ export { i as imap, a as toArray, t as toSet } from '../shared/core.C3JowhaZ.mjs';
14
+ export { i as isIterable } from '../shared/core.RfnaEmgA.mjs';
15
+ export { i as isome } from '../shared/core.FZ305VYd.mjs';
16
+ export { m as markdownToHtml, a as markdownToText } from '../shared/core.DFi2dOTl.mjs';
17
+
18
+ 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)}
18
19
 
19
20
  const DELAY = "LIKEC4_DELAY";
20
21
  function delay(...args) {
21
22
  let ms = 100;
22
23
  if (args.length === 2) {
23
- ms = randomInteger(args[0], args[1]);
24
+ ms = e(args[0], args[1]);
24
25
  } else if (args.length === 1) {
25
26
  ms = args[0];
26
27
  }
@@ -33,25 +34,8 @@ function delay(...args) {
33
34
  function promiseNextTick() {
34
35
  return Promise.resolve().then(() => void 0);
35
36
  }
37
+ function onNextTick(fn) {
38
+ void Promise.resolve().then(fn);
39
+ }
36
40
 
37
- const compareRelations = (a, b) => {
38
- const parentA = commonAncestor(a.source.model, a.target.model);
39
- const parentB = commonAncestor(b.source.model, b.target.model);
40
- if (parentA && !parentB) {
41
- return 1;
42
- }
43
- if (!parentA && parentB) {
44
- return -1;
45
- }
46
- const compareParents = parentA && parentB ? compareFqnHierarchically(parentA, parentB) : 0;
47
- if (compareParents !== 0) {
48
- return compareParents;
49
- }
50
- const compareSource = compareFqnHierarchically(a.source.model, b.source.model);
51
- if (compareSource !== 0) {
52
- return compareSource;
53
- }
54
- return compareFqnHierarchically(a.target.model, b.target.model);
55
- };
56
-
57
- export { commonAncestor, compareFqnHierarchically, compareRelations, delay, promiseNextTick };
41
+ export { delay, onNextTick, promiseNextTick };
@@ -1,5 +1,5 @@
1
1
  export { i as isIterable } from '../../shared/core.DXhDWKFZ.mjs';
2
- import { c as IteratorLike } from '../../shared/core.DrvfVXkh.mjs';
2
+ import { c as IteratorLike } from '../../shared/core.D5fzJWbF.mjs';
3
3
  import 'type-fest';
4
4
 
5
5
  /**
@@ -1,7 +1,45 @@
1
- export { i as isIterable } from '../../shared/core.DoM6aM9N.mjs';
2
- export { i as ifilter } from '../../shared/core.CCD1ID81.mjs';
3
- export { i as ifind, a as ihead } from '../../shared/core.GTgsmXS_.mjs';
4
- export { i as ifirst, a as ireduce } from '../../shared/core.ILwny7BV.mjs';
5
- export { i as iflat, a as iunique } from '../../shared/core.CNGyqkJh.mjs';
6
- export { i as imap, t as toArray, a as toSet } from '../../shared/core.DLpidoWc.mjs';
7
- export { i as isome } from '../../shared/core.Be4Jy9Qx.mjs';
1
+ export { i as isIterable } from '../../shared/core.RfnaEmgA.mjs';
2
+ import { e } from '../../shared/core.DRJma0Ol.mjs';
3
+ export { i as ifilter } from '../../shared/core.DRJma0Ol.mjs';
4
+ export { i as ifind, a as ihead } from '../../shared/core.QJD_fcrc.mjs';
5
+ import { i as invariant } from '../../shared/core.D4npX2q8.mjs';
6
+ import { e as e$1 } from '../../shared/core.C4x8aaWa.mjs';
7
+ export { i as iflat, a as iunique } from '../../shared/core.C4x8aaWa.mjs';
8
+ export { i as imap, a as toArray, t as toSet } from '../../shared/core.C3JowhaZ.mjs';
9
+ export { i as isome } from '../../shared/core.FZ305VYd.mjs';
10
+
11
+ function ifirst(arg1, arg2) {
12
+ const count = arg2 ?? arg1;
13
+ invariant(typeof count === "number" && count >= 0, "Count must be a non-negative number");
14
+ function* _first(iter) {
15
+ let taken = 0;
16
+ for (const value of iter) {
17
+ if (taken >= count) {
18
+ break;
19
+ }
20
+ yield value;
21
+ taken++;
22
+ }
23
+ return;
24
+ }
25
+ if (arg2 === void 0) {
26
+ return (iterable) => _first(iterable);
27
+ }
28
+ return _first(arg1);
29
+ }
30
+
31
+ function ireduce(arg1, arg2, arg3) {
32
+ const reducer = e$1(arg3) ? arg2 : arg1;
33
+ const initialValue = arg3 ?? arg2;
34
+ invariant(e(reducer));
35
+ function _reduce(iter) {
36
+ let acc = initialValue;
37
+ for (const value of iter) {
38
+ acc = reducer(acc, value);
39
+ }
40
+ return acc;
41
+ }
42
+ return e$1(arg3) ? _reduce(arg1) : _reduce;
43
+ }
44
+
45
+ export { ifirst, ireduce };
@@ -0,0 +1,4 @@
1
+ {
2
+ "types": "../dist/model/index.d.mts",
3
+ "module": "../dist/model/index.mjs"
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "1.40.0",
3
+ "version": "1.42.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -13,7 +13,7 @@
13
13
  "bugs": "https://github.com/likec4/likec4/issues",
14
14
  "files": [
15
15
  "dist",
16
- "src",
16
+ "**/package.json",
17
17
  "!**/*.spec.ts",
18
18
  "!**/*.test-d.ts",
19
19
  "!**/__test__/*",
@@ -63,12 +63,12 @@
63
63
  "default": "./dist/model/index.mjs"
64
64
  }
65
65
  },
66
- "./utils": {
67
- "sources": "./src/utils/index.ts",
66
+ "./styles": {
67
+ "sources": "./src/styles/index.ts",
68
68
  "default": {
69
- "types": "./dist/utils/index.d.mts",
70
- "import": "./dist/utils/index.mjs",
71
- "default": "./dist/utils/index.mjs"
69
+ "types": "./dist/styles/index.d.mts",
70
+ "import": "./dist/styles/index.mjs",
71
+ "default": "./dist/styles/index.mjs"
72
72
  }
73
73
  },
74
74
  "./types": {
@@ -79,8 +79,22 @@
79
79
  "default": "./dist/types/index.mjs"
80
80
  }
81
81
  },
82
- "./src": "./src/index.ts",
83
- "./src/*": "./src/*",
82
+ "./utils/graphology": {
83
+ "sources": "./src/utils/graphology/index.ts",
84
+ "default": {
85
+ "types": "./dist/utils/graphology/index.d.mts",
86
+ "import": "./dist/utils/graphology/index.mjs",
87
+ "default": "./dist/utils/graphology/index.mjs"
88
+ }
89
+ },
90
+ "./utils": {
91
+ "sources": "./src/utils/index.ts",
92
+ "default": {
93
+ "types": "./dist/utils/index.d.mts",
94
+ "import": "./dist/utils/index.mjs",
95
+ "default": "./dist/utils/index.mjs"
96
+ }
97
+ },
84
98
  "./package.json": "./package.json"
85
99
  },
86
100
  "publishConfig": {
@@ -88,6 +102,10 @@
88
102
  "access": "public"
89
103
  },
90
104
  "dependencies": {
105
+ "type-fest": "^4.41.0"
106
+ },
107
+ "devDependencies": {
108
+ "unified": "11.0.5",
91
109
  "mdast-util-from-markdown": "^2.0.2",
92
110
  "mdast-util-to-string": "^4.0.0",
93
111
  "rehype-format": "5.0.1",
@@ -97,23 +115,19 @@
97
115
  "remark-gfm": "4.0.1",
98
116
  "remark-parse": "11.0.0",
99
117
  "remark-rehype": "11.1.2",
100
- "type-fest": "^4.41.0",
101
- "unified": "11.0.5",
102
- "chroma-js": "^3.1.2",
103
- "remeda": "^2.30.0",
104
- "defu": "^6.1.4",
105
- "@mantine/colors-generator": "8.2.8"
106
- },
107
- "devDependencies": {
108
- "@types/chroma-js": "^3.1.1",
109
118
  "@dagrejs/dagre": "1.1.5",
119
+ "@mantine/colors-generator": "8.3.1",
120
+ "@types/chroma-js": "^3.1.1",
110
121
  "@types/extend": "3.0.4",
111
122
  "@types/hast": "3.0.4",
112
123
  "@types/mdast": "4.0.4",
113
124
  "@types/natural-compare-lite": "^1.4.2",
125
+ "@types/node": "~20.19.11",
114
126
  "@types/object-hash": "^3.0.6",
115
127
  "@types/unist": "3.0.3",
116
- "@types/node": "~20.19.11",
128
+ "chroma-js": "^3.1.2",
129
+ "defu": "^6.1.4",
130
+ "fdir": "6.4.0",
117
131
  "graphology": "^0.25.4",
118
132
  "graphology-dag": "^0.4.1",
119
133
  "graphology-types": "^0.24.8",
@@ -121,12 +135,14 @@
121
135
  "natural-compare-lite": "^1.4.0",
122
136
  "object-hash": "^3.0.0",
123
137
  "obliterator": "^2.0.5",
124
- "fdir": "6.4.0",
125
- "turbo": "2.5.6",
138
+ "oxlint": "1.18.0",
139
+ "remeda": "^2.31.1",
140
+ "turbo": "2.5.8",
126
141
  "typescript": "5.9.2",
127
142
  "unbuild": "3.5.0",
128
143
  "vitest": "3.2.4",
129
- "@likec4/tsconfig": "1.40.0"
144
+ "@likec4/devops": "1.41.0",
145
+ "@likec4/tsconfig": "1.42.0"
130
146
  },
131
147
  "scripts": {
132
148
  "typecheck": "tsc -b --verbose",
@@ -135,7 +151,9 @@
135
151
  "lint:package": "pnpx publint ./package.tgz",
136
152
  "test": "vitest run --no-isolate",
137
153
  "test:watch": "vitest",
138
- "clean": "pnpm rimraf dist lib",
154
+ "clean": "likec4ops clean",
139
155
  "pack": "pnpm pack"
140
- }
156
+ },
157
+ "types": "dist/index.d.mts",
158
+ "module": "dist/index.mjs"
141
159
  }
@@ -0,0 +1,4 @@
1
+ {
2
+ "types": "../dist/styles/index.d.mts",
3
+ "module": "../dist/styles/index.mjs"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "types": "../dist/types/index.d.mts",
3
+ "module": "../dist/types/index.mjs"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "types": "../../dist/utils/graphology/index.d.mts",
3
+ "module": "../../dist/utils/graphology/index.mjs"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "types": "../dist/utils/index.d.mts",
3
+ "module": "../dist/utils/index.mjs"
4
+ }
@@ -1,172 +0,0 @@
1
- import { hasAtLeast } from 'remeda';
2
- import { i as invariant } from './core.D4npX2q8.mjs';
3
-
4
- var BBox;
5
- ((BBox2) => {
6
- function center({ x, y, width, height }) {
7
- return {
8
- x: x + width / 2,
9
- y: y + height / 2
10
- };
11
- }
12
- BBox2.center = center;
13
- function fromPoints(points) {
14
- const { x1, y1, x2, y2 } = RectBox.fromPoints(points);
15
- return {
16
- x: x1,
17
- y: y1,
18
- width: x2 - x1,
19
- height: y2 - y1
20
- };
21
- }
22
- BBox2.fromPoints = fromPoints;
23
- function merge(...boxes) {
24
- invariant(hasAtLeast(boxes, 1), "No boxes provided");
25
- if (boxes.length === 1) {
26
- return boxes[0];
27
- }
28
- let minX = Infinity;
29
- let minY = Infinity;
30
- let maxX = -Infinity;
31
- let maxY = -Infinity;
32
- for (const box of boxes) {
33
- minX = Math.min(minX, box.x);
34
- minY = Math.min(minY, box.y);
35
- maxX = Math.max(maxX, box.x + box.width);
36
- maxY = Math.max(maxY, box.y + box.height);
37
- }
38
- return {
39
- x: minX,
40
- y: minY,
41
- width: maxX - minX,
42
- height: maxY - minY
43
- };
44
- }
45
- BBox2.merge = merge;
46
- function toRectBox(box) {
47
- return {
48
- x1: box.x,
49
- y1: box.y,
50
- x2: box.x + box.width,
51
- y2: box.y + box.height
52
- };
53
- }
54
- BBox2.toRectBox = toRectBox;
55
- function expand(box, plus) {
56
- if (plus === 0) {
57
- return box;
58
- }
59
- return {
60
- x: box.x - plus,
61
- y: box.y - plus,
62
- width: box.width + plus * 2,
63
- height: box.height + plus * 2
64
- };
65
- }
66
- BBox2.expand = expand;
67
- function shrink(box, minus) {
68
- if (minus === 0) {
69
- return box;
70
- }
71
- return {
72
- x: box.x + minus,
73
- y: box.y + minus,
74
- width: box.width - minus * 2,
75
- height: box.height - minus * 2
76
- };
77
- }
78
- BBox2.shrink = shrink;
79
- })(BBox || (BBox = {}));
80
- var RectBox;
81
- ((RectBox2) => {
82
- function center({ x1, y1, x2, y2 }) {
83
- return {
84
- x: (x1 + x2) / 2,
85
- y: (y1 + y2) / 2
86
- };
87
- }
88
- RectBox2.center = center;
89
- function fromPoints(points) {
90
- invariant(points.length > 0, "At least one point is required");
91
- let minX = Infinity;
92
- let minY = Infinity;
93
- let maxX = -Infinity;
94
- let maxY = -Infinity;
95
- for (const [x, y] of points) {
96
- minX = Math.min(minX, x);
97
- minY = Math.min(minY, y);
98
- maxX = Math.max(maxX, x);
99
- maxY = Math.max(maxY, y);
100
- }
101
- return {
102
- x1: minX,
103
- y1: minY,
104
- x2: maxX,
105
- y2: maxY
106
- };
107
- }
108
- RectBox2.fromPoints = fromPoints;
109
- function merge(...boxes) {
110
- invariant(boxes.length > 0, "No boxes provided");
111
- let minX = Infinity;
112
- let minY = Infinity;
113
- let maxX = -Infinity;
114
- let maxY = -Infinity;
115
- for (const box of boxes) {
116
- minX = Math.min(minX, box.x1);
117
- minY = Math.min(minY, box.y1);
118
- maxX = Math.max(maxX, box.x2);
119
- maxY = Math.max(maxY, box.y2);
120
- }
121
- return {
122
- x1: minX,
123
- y1: minY,
124
- x2: maxX,
125
- y2: maxY
126
- };
127
- }
128
- RectBox2.merge = merge;
129
- function toBBox(box) {
130
- return {
131
- x: box.x1,
132
- y: box.y1,
133
- width: box.x2 - box.x1,
134
- height: box.y2 - box.y1
135
- };
136
- }
137
- RectBox2.toBBox = toBBox;
138
- })(RectBox || (RectBox = {}));
139
-
140
- function isTagColorSpecified(spec) {
141
- const color = typeof spec === "string" ? spec : spec.color;
142
- return color.startsWith("#") || color.startsWith("rgb");
143
- }
144
-
145
- const BorderStyles = ["solid", "dashed", "dotted", "none"];
146
- const ElementShapes = [
147
- "rectangle",
148
- "person",
149
- "browser",
150
- "mobile",
151
- "cylinder",
152
- "storage",
153
- "queue"
154
- ];
155
- const ThemeColors = [
156
- "amber",
157
- "blue",
158
- "gray",
159
- "slate",
160
- "green",
161
- "indigo",
162
- "muted",
163
- "primary",
164
- "red",
165
- "secondary",
166
- "sky"
167
- ];
168
- function isThemeColor(color) {
169
- return ThemeColors.includes(color);
170
- }
171
-
172
- export { BBox as B, ElementShapes as E, RectBox as R, ThemeColors as T, BorderStyles as a, isThemeColor as b, isTagColorSpecified as i };