@likec4/core 1.41.0 → 1.42.1

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 (255) 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 +13 -11
  5. package/dist/builder/index.mjs +111 -91
  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 +11 -11
  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.Ae86Y3tB.mjs → core.01VTr9qu.mjs} +8 -26
  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.DA5vzwZ9.mjs → core.BIqHjQiH.mjs} +56 -42
  25. package/dist/shared/core.BKlholso.mjs +3 -0
  26. package/dist/shared/core.BR4zXDH-.mjs +13 -0
  27. package/dist/shared/{core.CXy1NLUG.mjs → core.BYNkXQ8A.mjs} +21 -12
  28. package/dist/shared/{core.BuoXfSMj.mjs → core.BbE4y-yl.mjs} +1 -1
  29. package/dist/shared/core.BoYfZOBm.mjs +3 -0
  30. package/dist/shared/core.BsSXS-_R.mjs +7 -0
  31. package/dist/shared/{core.DJp8fgok.mjs → core.BzTakU3I.mjs} +14 -10
  32. package/dist/shared/{core.4u1dVmfX.mjs → core.C2TiyjI6.mjs} +2 -2
  33. package/dist/shared/{core.DLpidoWc.mjs → core.C3JowhaZ.mjs} +3 -3
  34. package/dist/shared/{core.CNGyqkJh.mjs → core.C4x8aaWa.mjs} +3 -1
  35. package/dist/shared/{core.BB6zA-UU.mjs → core.C8YY6Uub.mjs} +38 -9
  36. package/dist/shared/{core.Asc11Mjy.mjs → core.C8sl5Y8Z.mjs} +122 -58
  37. package/dist/shared/{core.BvMRMo7Z.mjs → core.CNgZvKb8.mjs} +3 -5198
  38. package/dist/shared/{core.CUG6vpyL.d.mts → core.CQngdcuj.d.mts} +85 -4
  39. package/dist/shared/{core.Be1n9a0i.mjs → core.C_Ni6yHl.mjs} +5 -4
  40. package/dist/shared/core.CbT8JVYL.mjs +5 -0
  41. package/dist/shared/core.CqAJJpK_.mjs +3 -0
  42. package/dist/shared/{core.BXsxn-hf.d.mts → core.D0PjZzIS.d.mts} +27 -15
  43. package/dist/shared/{core.DgesAwC8.d.mts → core.D5fzJWbF.d.mts} +2 -2
  44. package/dist/shared/{core.hfOE3RfK.d.mts → core.DACpKp35.d.mts} +5 -5
  45. package/dist/shared/core.DFi2dOTl.mjs +39548 -0
  46. package/dist/shared/{core.xSQO0XYD.d.mts → core.DIol3syK.d.mts} +2 -2
  47. package/dist/shared/{core.DlG1xWt2.mjs → core.DMMOWQqc.mjs} +3 -2
  48. package/dist/shared/core.DNbUPnve.mjs +3990 -0
  49. package/dist/shared/{core.CCD1ID81.mjs → core.DRJma0Ol.mjs} +4 -3
  50. package/dist/shared/{core.DgttqsJc.mjs → core.DRhg-gVU.mjs} +9 -9
  51. package/dist/shared/core.DSO_rTC2.mjs +5322 -0
  52. package/dist/shared/{core.FUPplpae.d.mts → core.D_vkffV4.d.mts} +4 -2
  53. package/dist/shared/core.DdMJk7nx.d.mts +476 -0
  54. package/dist/shared/{core.BhpgpOep.d.mts → core.Dgs6-nuz.d.mts} +2 -2
  55. package/dist/shared/{core.Be4Jy9Qx.mjs → core.FZ305VYd.mjs} +2 -2
  56. package/dist/shared/core.OHD4KXm9.mjs +5 -0
  57. package/dist/shared/{core.GTgsmXS_.mjs → core.QJD_fcrc.mjs} +2 -2
  58. package/dist/shared/core.RfnaEmgA.mjs +7 -0
  59. package/dist/shared/core.fHR_8Tnq.d.mts +450 -0
  60. package/dist/shared/{core.D0EgVMQK.mjs → core.lRvxPoao.mjs} +14 -12
  61. package/dist/shared/{core.CaT0SUUK.mjs → core.rCeaAqgW.mjs} +1 -84
  62. package/dist/shared/{core.zxTBF_PD.d.mts → core.s9uwOt60.d.mts} +4 -4
  63. package/dist/shared/core.yna0OdV5.d.mts +98 -0
  64. package/dist/styles/index.d.mts +106 -0
  65. package/dist/styles/index.mjs +1 -0
  66. package/dist/types/_aux.d.mts +2 -2
  67. package/dist/types/expression-model.d.mts +3 -4
  68. package/dist/types/expression.d.mts +3 -4
  69. package/dist/types/fqnRef.d.mts +2 -2
  70. package/dist/types/fqnRef.mjs +3 -3
  71. package/dist/types/index.d.mts +8 -8
  72. package/dist/types/index.mjs +150 -5
  73. package/dist/types/scalar.mjs +3 -2
  74. package/dist/utils/graphology/index.d.mts +1864 -0
  75. package/dist/utils/graphology/index.mjs +1 -0
  76. package/dist/utils/index.d.mts +11 -6
  77. package/dist/utils/index.mjs +21 -37
  78. package/dist/utils/iterable/index.d.mts +1 -1
  79. package/dist/utils/iterable/index.mjs +45 -7
  80. package/model/package.json +4 -0
  81. package/package.json +42 -24
  82. package/styles/package.json +4 -0
  83. package/types/package.json +4 -0
  84. package/utils/graphology/package.json +4 -0
  85. package/utils/package.json +4 -0
  86. package/dist/shared/core.6_Vp2iiN.mjs +0 -172
  87. package/dist/shared/core.CUw_2J9j.mjs +0 -47
  88. package/dist/shared/core.CzdwsPmY.d.mts +0 -69
  89. package/dist/shared/core.D-ZGWDDt.d.mts +0 -831
  90. package/dist/shared/core.DoM6aM9N.mjs +0 -7
  91. package/dist/shared/core.ILwny7BV.mjs +0 -38
  92. package/dist/theme/index.d.mts +0 -11
  93. package/dist/theme/index.mjs +0 -232
  94. package/src/builder/Builder.deployment.ts +0 -224
  95. package/src/builder/Builder.deploymentModel.ts +0 -449
  96. package/src/builder/Builder.element.ts +0 -241
  97. package/src/builder/Builder.model.ts +0 -494
  98. package/src/builder/Builder.ts +0 -946
  99. package/src/builder/Builder.view-common.ts +0 -273
  100. package/src/builder/Builder.view-deployment.ts +0 -135
  101. package/src/builder/Builder.view-element.ts +0 -202
  102. package/src/builder/Builder.views.ts +0 -399
  103. package/src/builder/Builder.with.ts +0 -156
  104. package/src/builder/_types.ts +0 -324
  105. package/src/builder/index.ts +0 -11
  106. package/src/compute-view/compute-view.ts +0 -80
  107. package/src/compute-view/deployment-view/_types.ts +0 -38
  108. package/src/compute-view/deployment-view/clean-connections.ts +0 -236
  109. package/src/compute-view/deployment-view/compute.ts +0 -94
  110. package/src/compute-view/deployment-view/memory/index.ts +0 -9
  111. package/src/compute-view/deployment-view/memory/memory.ts +0 -96
  112. package/src/compute-view/deployment-view/predicates/deploymentRefs-where.ts +0 -18
  113. package/src/compute-view/deployment-view/predicates/deploymentRefs.ts +0 -154
  114. package/src/compute-view/deployment-view/predicates/index.ts +0 -8
  115. package/src/compute-view/deployment-view/predicates/relation-direct.ts +0 -243
  116. package/src/compute-view/deployment-view/predicates/relation-in-out.ts +0 -70
  117. package/src/compute-view/deployment-view/predicates/relation-incoming.ts +0 -101
  118. package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +0 -95
  119. package/src/compute-view/deployment-view/predicates/relation-where.ts +0 -18
  120. package/src/compute-view/deployment-view/predicates/utils.ts +0 -282
  121. package/src/compute-view/deployment-view/predicates/wildcard.ts +0 -41
  122. package/src/compute-view/deployment-view/stages/stage-exclude.ts +0 -5
  123. package/src/compute-view/deployment-view/stages/stage-final.ts +0 -245
  124. package/src/compute-view/deployment-view/stages/stage-include.ts +0 -95
  125. package/src/compute-view/deployment-view/utils.ts +0 -297
  126. package/src/compute-view/dynamic-view/compute.ts +0 -312
  127. package/src/compute-view/element-view/_types.ts +0 -47
  128. package/src/compute-view/element-view/clean-connections.ts +0 -117
  129. package/src/compute-view/element-view/compute.ts +0 -324
  130. package/src/compute-view/element-view/memory/NodeGroup.ts +0 -31
  131. package/src/compute-view/element-view/memory/index.ts +0 -10
  132. package/src/compute-view/element-view/memory/memory.ts +0 -178
  133. package/src/compute-view/element-view/memory/stage-exclude.ts +0 -59
  134. package/src/compute-view/element-view/memory/stage-final.ts +0 -129
  135. package/src/compute-view/element-view/memory/stage-include.ts +0 -130
  136. package/src/compute-view/element-view/predicates/_utils.ts +0 -91
  137. package/src/compute-view/element-view/predicates/element-expand.ts +0 -29
  138. package/src/compute-view/element-view/predicates/element-kind-tag.ts +0 -27
  139. package/src/compute-view/element-view/predicates/element-ref.ts +0 -24
  140. package/src/compute-view/element-view/predicates/relation-direct.ts +0 -321
  141. package/src/compute-view/element-view/predicates/relation-in-out.ts +0 -64
  142. package/src/compute-view/element-view/predicates/relation-in.ts +0 -115
  143. package/src/compute-view/element-view/predicates/relation-out.ts +0 -119
  144. package/src/compute-view/element-view/predicates/wildcard.ts +0 -88
  145. package/src/compute-view/element-view/utils.ts +0 -65
  146. package/src/compute-view/index.ts +0 -4
  147. package/src/compute-view/memory/AbstractMemory.ts +0 -45
  148. package/src/compute-view/memory/AbstractStageExclude.ts +0 -215
  149. package/src/compute-view/memory/AbstractStageInclude.ts +0 -200
  150. package/src/compute-view/memory/_types.ts +0 -148
  151. package/src/compute-view/memory/index.ts +0 -5
  152. package/src/compute-view/memory/ops.ts +0 -43
  153. package/src/compute-view/relationships-view/_types.ts +0 -16
  154. package/src/compute-view/relationships-view/compute.ts +0 -159
  155. package/src/compute-view/relationships-view/index.ts +0 -3
  156. package/src/compute-view/relationships-view/layout.ts +0 -358
  157. package/src/compute-view/relationships-view/utils.ts +0 -73
  158. package/src/compute-view/utils/ancestorsOfNode.ts +0 -19
  159. package/src/compute-view/utils/applyCustomElementProperties.ts +0 -107
  160. package/src/compute-view/utils/applyCustomRelationProperties.ts +0 -58
  161. package/src/compute-view/utils/applyViewRuleStyles.ts +0 -73
  162. package/src/compute-view/utils/buildComputedNodes.ts +0 -166
  163. package/src/compute-view/utils/buildElementNotations.ts +0 -64
  164. package/src/compute-view/utils/elementExpressionToPredicate.ts +0 -50
  165. package/src/compute-view/utils/link-nodes-with-edges.ts +0 -56
  166. package/src/compute-view/utils/merge-props-from-relationships.ts +0 -161
  167. package/src/compute-view/utils/relationExpressionToPredicates.ts +0 -55
  168. package/src/compute-view/utils/resolve-extended-views.ts +0 -85
  169. package/src/compute-view/utils/resolve-global-rules.ts +0 -88
  170. package/src/compute-view/utils/topological-sort.ts +0 -256
  171. package/src/compute-view/utils/view-hash.ts +0 -45
  172. package/src/compute-view/utils/with-readable-edges.ts +0 -40
  173. package/src/index.ts +0 -32
  174. package/src/model/DeploymentElementModel.ts +0 -712
  175. package/src/model/DeploymentModel.ts +0 -393
  176. package/src/model/ElementModel.ts +0 -316
  177. package/src/model/LikeC4Model.ts +0 -882
  178. package/src/model/RelationModel.ts +0 -152
  179. package/src/model/connection/Connection.ts +0 -72
  180. package/src/model/connection/deployment/DeploymentConnectionModel.ts +0 -185
  181. package/src/model/connection/deployment/find.ts +0 -120
  182. package/src/model/connection/deployment/index.ts +0 -8
  183. package/src/model/connection/index.ts +0 -22
  184. package/src/model/connection/model/ConnectionModel.ts +0 -158
  185. package/src/model/connection/model/find.ts +0 -117
  186. package/src/model/connection/model/index.ts +0 -8
  187. package/src/model/connection/ops.ts +0 -276
  188. package/src/model/guards.ts +0 -77
  189. package/src/model/index.ts +0 -72
  190. package/src/model/types.ts +0 -67
  191. package/src/model/utils.ts +0 -66
  192. package/src/model/view/EdgeModel.ts +0 -121
  193. package/src/model/view/LikeC4ViewModel.ts +0 -361
  194. package/src/model/view/LikeC4ViewsFolder.ts +0 -151
  195. package/src/model/view/NodeModel.ts +0 -247
  196. package/src/theme/element.ts +0 -61
  197. package/src/theme/index.ts +0 -127
  198. package/src/theme/relationships.ts +0 -54
  199. package/src/types/RichText.ts +0 -205
  200. package/src/types/_aux.ts +0 -317
  201. package/src/types/_common.ts +0 -102
  202. package/src/types/const.ts +0 -34
  203. package/src/types/expression-model.ts +0 -294
  204. package/src/types/expression.ts +0 -313
  205. package/src/types/fqnRef.ts +0 -91
  206. package/src/types/geometry.ts +0 -159
  207. package/src/types/global.ts +0 -21
  208. package/src/types/index.ts +0 -44
  209. package/src/types/model-data.ts +0 -77
  210. package/src/types/model-deployment.ts +0 -78
  211. package/src/types/model-dump.ts +0 -79
  212. package/src/types/model-logical.ts +0 -126
  213. package/src/types/model-spec.ts +0 -88
  214. package/src/types/operators.ts +0 -156
  215. package/src/types/project.ts +0 -14
  216. package/src/types/scalar.ts +0 -162
  217. package/src/types/styles.ts +0 -122
  218. package/src/types/view-changes.ts +0 -32
  219. package/src/types/view-common.ts +0 -157
  220. package/src/types/view-computed.ts +0 -126
  221. package/src/types/view-layouted.ts +0 -94
  222. package/src/types/view-parsed.deployment.ts +0 -39
  223. package/src/types/view-parsed.dynamic.ts +0 -89
  224. package/src/types/view-parsed.element.ts +0 -65
  225. package/src/types/view.ts +0 -113
  226. package/src/utils/common-head.ts +0 -22
  227. package/src/utils/compare-natural.ts +0 -60
  228. package/src/utils/const.ts +0 -1
  229. package/src/utils/fqn.ts +0 -302
  230. package/src/utils/getOrCreate.ts +0 -8
  231. package/src/utils/guards.ts +0 -9
  232. package/src/utils/index.ts +0 -68
  233. package/src/utils/invariant.ts +0 -29
  234. package/src/utils/iterable/_types.ts +0 -5
  235. package/src/utils/iterable/filter.ts +0 -55
  236. package/src/utils/iterable/find.ts +0 -38
  237. package/src/utils/iterable/first.ts +0 -48
  238. package/src/utils/iterable/flat.ts +0 -17
  239. package/src/utils/iterable/head.ts +0 -22
  240. package/src/utils/iterable/index.ts +0 -15
  241. package/src/utils/iterable/map.ts +0 -40
  242. package/src/utils/iterable/reduce.ts +0 -24
  243. package/src/utils/iterable/some.ts +0 -36
  244. package/src/utils/iterable/to.ts +0 -19
  245. package/src/utils/iterable/unique.ts +0 -23
  246. package/src/utils/markdown/index.ts +0 -2
  247. package/src/utils/markdown/to-html.ts +0 -32
  248. package/src/utils/markdown/to-text.ts +0 -14
  249. package/src/utils/memoize-prop.ts +0 -30
  250. package/src/utils/mnemonist.ts +0 -9
  251. package/src/utils/object-hash.ts +0 -14
  252. package/src/utils/promises.ts +0 -24
  253. package/src/utils/relations.ts +0 -36
  254. package/src/utils/set.ts +0 -83
  255. package/src/utils/string-hash.ts +0 -16
@@ -1,17 +1,41 @@
1
- import { unique, isShallowEqual, isTruthy, isEmpty, hasAtLeast, values, last, entries, pipe, map, sort, split, sortBy, prop } from 'remeda';
2
- import { o as hierarchyLevel, n as nameFromFqn, i as isAncestor, g as commonAncestor, s as sortNaturalByFqn, f as sortParentsFirst, p as parentFqn, a as ancestorsFqn, k as compareNaturalHierarchically, j as compareNatural } from './core.DgttqsJc.mjs';
1
+ import { n as n$4, e as e$4, a as DeploymentNodeModel, b as DeployedInstanceModel, c as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.BIqHjQiH.mjs';
2
+ import { t as t$8, a as t$9 } from './core.BsSXS-_R.mjs';
3
+ import { e as e$3 } from './core.BKlholso.mjs';
4
+ import { c as splitGlobalFqn, g as extractStep, e as isStepEdgeId, i as isGroupElementKind, b as isGlobalFqn, a as GlobalFqn } from './core.C_Ni6yHl.mjs';
5
+ import { q as hierarchyLevel, n as nameFromFqn, i as isAncestor, k as commonAncestor, s as sortNaturalByFqn, f as sortParentsFirst, p as parentFqn, a as ancestorsFqn, j as compareNaturalHierarchically, g as compareNatural } from './core.DRhg-gVU.mjs';
6
+ import { m as memoizeProp } from './core.BR4zXDH-.mjs';
7
+ import { R as RichText, e as exact } from './core.01VTr9qu.mjs';
8
+ import { a as preferSummary, p as preferDescription } from './core.BazD6cot.mjs';
9
+ import { a as ihead, i as ifind } from './core.QJD_fcrc.mjs';
10
+ import { t as t$a } from './core.OHD4KXm9.mjs';
11
+ import { t as t$b } from './core.CbT8JVYL.mjs';
12
+ import { L as LikeC4Styles } from './core.DNbUPnve.mjs';
3
13
  import { g as getOrCreate } from './core.DcS-0zys.mjs';
4
- import { e as DeploymentNodeModel, c as DeployedInstanceModel, g as DeploymentRelationModel, N as NestedElementOfDeployedInstanceModel } from './core.DA5vzwZ9.mjs';
5
- import { D as DefaultMap } from './core.BuoXfSMj.mjs';
6
14
  import { i as invariant, a as nonNullable } from './core.D4npX2q8.mjs';
15
+ import { D as DefaultMap } from './core.BbE4y-yl.mjs';
7
16
  import { FqnRef } from '../types/fqnRef.mjs';
8
- import { b as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as whereOperatorAsPredicate } from './core.CXy1NLUG.mjs';
9
- import { m as memoizeProp } from './core.CUw_2J9j.mjs';
10
- import { i as ifilter } from './core.CCD1ID81.mjs';
11
- import { c as splitGlobalFqn, g as extractStep, e as isStepEdgeId, i as isGroupElementKind, b as isGlobalFqn, a as GlobalFqn } from './core.Be1n9a0i.mjs';
12
- import { a as DefaultElementShape, D as DefaultThemeColor, R as RichText, c as DefaultShapeSize, i as DefaultRelationshipColor, g as DefaultLineStyle } from './core.Ae86Y3tB.mjs';
13
- import { a as preferSummary, p as preferDescription } from './core.BazD6cot.mjs';
14
- import { a as ihead, i as ifind } from './core.GTgsmXS_.mjs';
17
+ import { b as isDeploymentNode, a as _type, _ as _stage, i as isOnStage, w as whereOperatorAsPredicate } from './core.BYNkXQ8A.mjs';
18
+ import { i as ifilter } from './core.DRJma0Ol.mjs';
19
+ import './core.B7KhhkRY.mjs';
20
+ import './core.lRvxPoao.mjs';
21
+
22
+ const e$2={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function t$7(e,t){let[n,...a]=t;if(!i$1(n)){let t=r$1(...a);return e(n,t)}let o=r$1(n,...a);return t=>e(t,o)}function r$1(t,n,...i){let a=typeof t==`function`?t:t[0],o=typeof t==`function`?`asc`:t[1],{[o]:s}=e$2,c=n===void 0?void 0:r$1(n,...i);return (e,t)=>{let n=a(e),r=a(t);return s(n,r)?1:s(r,n)?-1:c?.(e,t)??0}}function i$1(t){if(a(t))return true;if(typeof t!=`object`||!Array.isArray(t))return false;let[n,r,...i]=t;return a(n)&&typeof r==`string`&&r in e$2&&i.length===0}const a=e=>typeof e==`function`&&e.length===1;
23
+
24
+ function t$6(...t){return t$8(Object.entries,t)}
25
+
26
+ function t$5(...t){return t$8(n$3,t)}function n$3(e,t){if(e===t||Object.is(e,t))return true;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return false;if(e instanceof Map&&t instanceof Map)return r(e,t);if(e instanceof Set&&t instanceof Set)return i(e,t);let n=Object.keys(e);if(n.length!==Object.keys(t).length)return false;for(let r of n){if(!Object.hasOwn(t,r))return false;let{[r]:n}=e,{[r]:i}=t;if(n!==i||!Object.is(n,i))return false}return true}function r(e,t){if(e.size!==t.size)return false;for(let[n,r]of e){let e=t.get(n);if(r!==e||!Object.is(r,e))return false}return true}function i(e,t){if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}
27
+
28
+ function t$4(...t){return t$8(n$2,t)}const n$2=e=>e.at(-1);
29
+
30
+ function e$1(e,...n){return typeof e==`string`||typeof e==`number`||typeof e==`symbol`?r=>t$3(r,e,...n):t$3(e,...n)}function t$3(e,...t){let n=e;for(let e of t){if(n==null)return;n=n[e];}return n}
31
+
32
+ function t$2(...t){return t$8(n$1,t)}function n$1(e,t){let n=[...e];return n.sort(t),n}
33
+
34
+ function t$1(...t){return t$7(n,t)}const n=(e,t)=>[...e].sort(t);
35
+
36
+ function e(e,t,n){return typeof t==`number`||t===void 0?n=>n.split(e,t):e.split(t,n)}
37
+
38
+ function t(...t){return t$8(Object.values,t)}
15
39
 
16
40
  class ElementModel {
17
41
  constructor($model, $element) {
@@ -45,13 +69,13 @@ class ElementModel {
45
69
  return this.$element.kind;
46
70
  }
47
71
  get shape() {
48
- return this.$element.shape ?? DefaultElementShape;
72
+ return this.style.shape;
49
73
  }
50
74
  get color() {
51
- return this.$element.color ?? DefaultThemeColor;
75
+ return this.style.color;
52
76
  }
53
77
  get icon() {
54
- return this.$element.icon ?? null;
78
+ return this.style.icon ?? null;
55
79
  }
56
80
  /**
57
81
  * Returns all tags of the element.
@@ -59,7 +83,7 @@ class ElementModel {
59
83
  */
60
84
  get tags() {
61
85
  return memoizeProp(this, Symbol.for("tags"), () => {
62
- return unique([
86
+ return n$4([
63
87
  ...this.$element.tags ?? [],
64
88
  ...this.$model.specification.elements[this.$element.kind]?.tags ?? []
65
89
  ]);
@@ -73,7 +97,7 @@ class ElementModel {
73
97
  * (if one is missing - it falls back to another)
74
98
  */
75
99
  get hasSummary() {
76
- return !!this.$element.summary && !!this.$element.description && !isShallowEqual(this.$element.summary, this.$element.description);
100
+ return !!this.$element.summary && !!this.$element.description && !t$5(this.$element.summary, this.$element.description);
77
101
  }
78
102
  /**
79
103
  * Short description of the element.
@@ -102,10 +126,16 @@ class ElementModel {
102
126
  return this.parent === null;
103
127
  }
104
128
  get style() {
105
- return {
106
- size: DefaultShapeSize,
129
+ return memoizeProp(this, "style", () => exact({
130
+ shape: this.$model.$styles.defaults.shape,
131
+ color: this.$model.$styles.defaults.color,
132
+ border: this.$model.$styles.defaults.border,
133
+ opacity: this.$model.$styles.defaults.opacity,
134
+ size: this.$model.$styles.defaults.size,
135
+ padding: this.$model.$styles.defaults.padding,
136
+ textSize: this.$model.$styles.defaults.text,
107
137
  ...this.$element.style
108
- };
138
+ }));
109
139
  }
110
140
  isAncestorOf(another) {
111
141
  return isAncestor(this, another);
@@ -235,13 +265,13 @@ class ElementModel {
235
265
  * @returns true if the element is deployed
236
266
  */
237
267
  isDeployed() {
238
- return isTruthy(ihead(this.deployments()));
268
+ return e$3(ihead(this.deployments()));
239
269
  }
240
270
  deployments() {
241
271
  return this.$model.deployment.instancesOf(this);
242
272
  }
243
273
  hasMetadata() {
244
- return !!this.$element.metadata && !isEmpty(this.$element.metadata);
274
+ return !!this.$element.metadata && !e$4(this.$element.metadata);
245
275
  }
246
276
  getMetadata(field) {
247
277
  if (field) {
@@ -265,7 +295,7 @@ const splitViewTitle = (title) => {
265
295
  invariant(!title.includes("\n"), "View title cannot contain newlines");
266
296
  if (title.includes(VIEW_FOLDERS_SEPARATOR)) {
267
297
  const segments = title.split(VIEW_FOLDERS_SEPARATOR).map((s) => s.trim()).filter((s) => s.length > 0);
268
- if (hasAtLeast(segments, 1)) {
298
+ if (t$9(segments, 1)) {
269
299
  return segments;
270
300
  }
271
301
  return [""];
@@ -277,7 +307,7 @@ const normalizeViewPath = (title) => {
277
307
  };
278
308
  const getViewFolderPath = (title) => {
279
309
  const segments = splitViewTitle(title);
280
- if (!hasAtLeast(segments, 2)) {
310
+ if (!t$9(segments, 2)) {
281
311
  return null;
282
312
  }
283
313
  return segments.slice(0, -1).join(VIEW_FOLDERS_SEPARATOR);
@@ -293,7 +323,7 @@ class LikeC4DeploymentModel {
293
323
  constructor($model) {
294
324
  this.$model = $model;
295
325
  const $deployments = this.$deployments = $model.$data.deployments;
296
- const elements = values($deployments.elements);
326
+ const elements = t($deployments.elements);
297
327
  for (const element of sortParentsFirst(elements)) {
298
328
  const el = this.addElement(element);
299
329
  for (const tag of el.tags) {
@@ -303,7 +333,7 @@ class LikeC4DeploymentModel {
303
333
  this.#instancesOf.get(el.element.id).add(el);
304
334
  }
305
335
  }
306
- for (const relation of values($deployments.relations)) {
336
+ for (const relation of t($deployments.relations)) {
307
337
  const el = this.addRelation(relation);
308
338
  for (const tag of el.tags) {
309
339
  this.#allTags.get(tag).add(el);
@@ -331,6 +361,9 @@ class LikeC4DeploymentModel {
331
361
  );
332
362
  #nestedElementsOfDeployment = /* @__PURE__ */ new Map();
333
363
  $deployments;
364
+ get $styles() {
365
+ return this.$model.$styles;
366
+ }
334
367
  element(el) {
335
368
  if (el instanceof DeploymentNodeModel || el instanceof DeployedInstanceModel) {
336
369
  return el;
@@ -616,13 +649,13 @@ class RelationshipModel {
616
649
  return `${this.source.id} -> ${this.target.id}`;
617
650
  }
618
651
  get title() {
619
- if (!isTruthy(this.$relationship.title)) {
652
+ if (!e$3(this.$relationship.title)) {
620
653
  return null;
621
654
  }
622
655
  return this.$relationship.title;
623
656
  }
624
657
  get technology() {
625
- if (!isTruthy(this.$relationship.technology)) {
658
+ if (!e$3(this.$relationship.technology)) {
626
659
  return null;
627
660
  }
628
661
  return this.$relationship.technology;
@@ -643,10 +676,16 @@ class RelationshipModel {
643
676
  return this.$relationship.links ?? [];
644
677
  }
645
678
  get color() {
646
- return this.$relationship.color ?? DefaultRelationshipColor;
679
+ return this.$relationship.color ?? this.model.$styles.defaults.relationship.color;
647
680
  }
648
681
  get line() {
649
- return this.$relationship.line ?? DefaultLineStyle;
682
+ return this.$relationship.line ?? this.model.$styles.defaults.relationship.line;
683
+ }
684
+ get head() {
685
+ return this.$relationship.head ?? this.model.$styles.defaults.relationship.arrow;
686
+ }
687
+ get tail() {
688
+ return this.$relationship.tail;
650
689
  }
651
690
  /**
652
691
  * Iterate over all views that include this relationship.
@@ -666,7 +705,7 @@ class RelationshipModel {
666
705
  return true;
667
706
  }
668
707
  hasMetadata() {
669
- return !!this.$relationship.metadata && !isEmpty(this.$relationship.metadata);
708
+ return !!this.$relationship.metadata && !e$4(this.$relationship.metadata);
670
709
  }
671
710
  getMetadata(field) {
672
711
  if (field) {
@@ -719,10 +758,16 @@ class EdgeModel {
719
758
  return this.#edge.navigateTo ? this.view.$model.view(this.#edge.navigateTo) : null;
720
759
  }
721
760
  get color() {
722
- return this.#edge.color ?? "gray";
761
+ return this.#edge.color;
723
762
  }
724
763
  get line() {
725
- return this.#edge.line ?? "dashed";
764
+ return this.#edge.line ?? this.view.$model.$styles.defaults.relationship.line;
765
+ }
766
+ get head() {
767
+ return this.#edge.head ?? this.view.$model.$styles.defaults.relationship.arrow;
768
+ }
769
+ get tail() {
770
+ return this.#edge.tail;
726
771
  }
727
772
  isStep() {
728
773
  return isStepEdgeId(this.id);
@@ -888,13 +933,13 @@ class NodeModel {
888
933
  * Check if this node references to logical model element.
889
934
  */
890
935
  hasElement() {
891
- return isTruthy(this.#node.modelRef);
936
+ return e$3(this.#node.modelRef);
892
937
  }
893
938
  /**
894
939
  * Check if this node references to deployment element (Node or Instance).
895
940
  */
896
941
  hasDeployment() {
897
- return isTruthy(this.#node.deploymentRef);
942
+ return e$3(this.#node.deploymentRef);
898
943
  }
899
944
  /**
900
945
  * Check if this node references to deployed instance
@@ -1166,7 +1211,7 @@ class LikeC4ViewModel {
1166
1211
  return this.$view[_type] === "element";
1167
1212
  }
1168
1213
  isScopedElementView() {
1169
- return this.$view[_type] === "element" && isTruthy(this.$view.viewOf);
1214
+ return this.$view[_type] === "element" && e$3(this.$view.viewOf);
1170
1215
  }
1171
1216
  isDeploymentView() {
1172
1217
  return this.$view[_type] === "deployment";
@@ -1208,7 +1253,7 @@ class LikeC4ViewsFolder {
1208
1253
  this.$model = $model;
1209
1254
  this.path = path.join("/");
1210
1255
  this.isRoot = this.path === "";
1211
- this.title = last(path);
1256
+ this.title = t$4(path);
1212
1257
  if (this.isRoot) {
1213
1258
  this.parentPath = void 0;
1214
1259
  } else {
@@ -1263,7 +1308,7 @@ class LikeC4ViewsFolder {
1263
1308
  */
1264
1309
  get parent() {
1265
1310
  invariant(!this.isRoot, "Root view folder has no parent");
1266
- if (isEmpty(this.parentPath)) {
1311
+ if (e$4(this.parentPath)) {
1267
1312
  return null;
1268
1313
  }
1269
1314
  return this.$model.viewFolder(this.parentPath);
@@ -1384,13 +1429,13 @@ class LikeC4Model {
1384
1429
  $data;
1385
1430
  constructor($data) {
1386
1431
  this.$data = $data;
1387
- for (const [, element] of entries($data.elements)) {
1432
+ for (const [, element] of t$6($data.elements)) {
1388
1433
  const el = this.addElement(element);
1389
1434
  for (const tag of el.tags) {
1390
1435
  this._allTags.get(tag).add(el);
1391
1436
  }
1392
1437
  }
1393
- for (const [projectId, elements] of entries($data.imports ?? {})) {
1438
+ for (const [projectId, elements] of t$6($data.imports ?? {})) {
1394
1439
  for (const element of sortParentsFirst(elements)) {
1395
1440
  const el = this.addImportedElement(projectId, element);
1396
1441
  for (const tag of el.tags) {
@@ -1398,7 +1443,7 @@ class LikeC4Model {
1398
1443
  }
1399
1444
  }
1400
1445
  }
1401
- for (const relation of values($data.relations)) {
1446
+ for (const relation of t($data.relations)) {
1402
1447
  const el = this.addRelation(relation);
1403
1448
  for (const tag of el.tags) {
1404
1449
  this._allTags.get(tag).add(el);
@@ -1407,21 +1452,21 @@ class LikeC4Model {
1407
1452
  this.deployment = new LikeC4DeploymentModel(this);
1408
1453
  if (isOnStage($data, "computed") || isOnStage($data, "layouted")) {
1409
1454
  const compare = compareNaturalHierarchically(VIEW_FOLDERS_SEPARATOR);
1410
- const views = pipe(
1411
- values($data.views),
1412
- map((view) => ({
1455
+ const views = t$a(
1456
+ t($data.views),
1457
+ t$b((view) => ({
1413
1458
  view,
1414
1459
  path: normalizeViewPath(view.title ?? view.id),
1415
1460
  folderPath: view.title && getViewFolderPath(view.title) || ""
1416
1461
  })),
1417
1462
  // Sort hierarchically by groups, but keep same order within groups
1418
- sort((a, b) => compare(a.folderPath, b.folderPath))
1463
+ t$2((a, b) => compare(a.folderPath, b.folderPath))
1419
1464
  );
1420
1465
  const getOrCreateFolder = (path) => {
1421
1466
  let folder = this._viewFolders.get(path);
1422
1467
  if (!folder) {
1423
- const segments = split(path, VIEW_FOLDERS_SEPARATOR);
1424
- invariant(hasAtLeast(segments, 1), `View group path "${path}" must have at least one element`);
1468
+ const segments = e(path, VIEW_FOLDERS_SEPARATOR);
1469
+ invariant(t$9(segments, 1), `View group path "${path}" must have at least one element`);
1425
1470
  let defaultView;
1426
1471
  if (path === "") {
1427
1472
  defaultView = views.find((view) => view.view.id === "index");
@@ -1438,11 +1483,13 @@ class LikeC4Model {
1438
1483
  if (this._viewFolders.has(folderPath)) {
1439
1484
  continue;
1440
1485
  }
1441
- split(folderPath, VIEW_FOLDERS_SEPARATOR).reduce((parent, segment) => {
1442
- const path = [...parent, segment];
1443
- const folder = getOrCreateFolder(path.join(VIEW_FOLDERS_SEPARATOR));
1444
- this._viewFolderItems.get(parent.join(VIEW_FOLDERS_SEPARATOR)).add(folder);
1445
- return path;
1486
+ e(folderPath, VIEW_FOLDERS_SEPARATOR).reduce((segments, segment) => {
1487
+ const parent = segments.join(VIEW_FOLDERS_SEPARATOR);
1488
+ const path = e$4(parent) ? segment : parent + VIEW_FOLDERS_SEPARATOR + segment;
1489
+ const folder = getOrCreateFolder(path);
1490
+ this._viewFolderItems.get(parent).add(folder);
1491
+ segments.push(segment);
1492
+ return segments;
1446
1493
  }, []);
1447
1494
  }
1448
1495
  for (const { view, folderPath } of views) {
@@ -1479,6 +1526,23 @@ class LikeC4Model {
1479
1526
  get asLayouted() {
1480
1527
  return this;
1481
1528
  }
1529
+ /**
1530
+ * Returns the styles configuration for the project.
1531
+ */
1532
+ get $styles() {
1533
+ return memoizeProp(
1534
+ this,
1535
+ "styles",
1536
+ () => LikeC4Styles.from(
1537
+ this.$data.project.styles,
1538
+ this.$data.specification.customColors ? {
1539
+ theme: {
1540
+ colors: this.$data.specification.customColors
1541
+ }
1542
+ } : void 0
1543
+ )
1544
+ );
1545
+ }
1482
1546
  /**
1483
1547
  * Type guard the model to the parsed stage.
1484
1548
  */
@@ -1768,22 +1832,22 @@ class LikeC4Model {
1768
1832
  * Use {@link specification.tags} to get all defined tags
1769
1833
  */
1770
1834
  get tags() {
1771
- return memoizeProp(this, "tags", () => sort([...this._allTags.keys()], compareNatural));
1835
+ return memoizeProp(this, "tags", () => t$2([...this._allTags.keys()], compareNatural));
1772
1836
  }
1773
1837
  /**
1774
1838
  * Returns all tags used in the model, sorted by usage count (descending).
1775
1839
  */
1776
1840
  get tagsSortedByUsage() {
1777
- return memoizeProp(this, "tagsSortedByUsage", () => pipe(
1841
+ return memoizeProp(this, "tagsSortedByUsage", () => t$a(
1778
1842
  [...this._allTags.entries()],
1779
- map(([tag, tagged]) => ({
1843
+ t$b(([tag, tagged]) => ({
1780
1844
  tag,
1781
1845
  count: tagged.size,
1782
1846
  tagged
1783
1847
  })),
1784
- sort((a, b) => compareNatural(a.tag, b.tag)),
1785
- sortBy(
1786
- [prop("count"), "desc"]
1848
+ t$2((a, b) => compareNatural(a.tag, b.tag)),
1849
+ t$1(
1850
+ [e$1("count"), "desc"]
1787
1851
  )
1788
1852
  ));
1789
1853
  }
@@ -1999,4 +2063,4 @@ function isEdgeModel(edge) {
1999
2063
  return edge instanceof EdgeModel;
2000
2064
  }
2001
2065
 
2002
- export { ElementModel as E, LikeC4Model as L, NodeModel as N, RelationshipModel as R, VIEW_FOLDERS_SEPARATOR as V, LikeC4DeploymentModel as a, EdgeModel as b, LikeC4ViewModel as c, LikeC4ViewsFolder as d, extractViewTitleFromPath as e, isDeployedInstanceModel as f, getViewFolderPath as g, isDeploymentElementModel as h, isDeploymentNodeModel as i, isNestedElementOfDeployedInstanceModel as j, isDeploymentRelationModel as k, isRelationModel as l, isElementModel as m, normalizeViewPath as n, isLikeC4ViewModel as o, isNodeModel as p, isEdgeModel as q };
2066
+ export { ElementModel as E, LikeC4Model as L, NodeModel as N, RelationshipModel as R, VIEW_FOLDERS_SEPARATOR as V, t$6 as a, t$1 as b, t$4 as c, isNestedElementOfDeployedInstanceModel as d, e$1 as e, isDeployedInstanceModel as f, isDeploymentNodeModel as g, isDeploymentElementModel as h, isElementModel as i, LikeC4DeploymentModel as j, EdgeModel as k, LikeC4ViewModel as l, LikeC4ViewsFolder as m, extractViewTitleFromPath as n, getViewFolderPath as o, normalizeViewPath as p, isDeploymentRelationModel as q, isRelationModel as r, isLikeC4ViewModel as s, t, isNodeModel as u, isEdgeModel as v };