@likec4/core 1.47.0 → 1.48.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 (181) hide show
  1. package/LICENSE +1 -1
  2. package/dist/_chunks/Builder.view-element.mjs +3284 -0
  3. package/dist/_chunks/LikeC4Model.d.mts +1287 -0
  4. package/dist/_chunks/LikeC4Styles.mjs +691 -0
  5. package/dist/_chunks/RichText.d.mts +84 -0
  6. package/dist/_chunks/RichText.mjs +148 -0
  7. package/dist/_chunks/_aux.d.mts +289 -0
  8. package/dist/_chunks/_aux.mjs +18 -0
  9. package/dist/_chunks/_types.d.mts +781 -0
  10. package/dist/_chunks/_types2.d.mts +38 -0
  11. package/dist/_chunks/assignTagColors.mjs +24 -0
  12. package/dist/_chunks/calcDriftsFromSnapshot.mjs +379 -0
  13. package/dist/_chunks/connection.mjs +0 -0
  14. package/dist/_chunks/const.d.mts +43 -0
  15. package/dist/_chunks/const.mjs +33 -0
  16. package/dist/_chunks/expression-model.d.mts +192 -0
  17. package/dist/_chunks/expression-model.mjs +103 -0
  18. package/dist/_chunks/expression.d.mts +347 -0
  19. package/dist/_chunks/expression.mjs +107 -0
  20. package/dist/_chunks/find.d.mts +82 -0
  21. package/dist/_chunks/find.mjs +646 -0
  22. package/dist/_chunks/find2.d.mts +78 -0
  23. package/dist/_chunks/find2.mjs +287 -0
  24. package/dist/_chunks/fqnRef.d.mts +58 -0
  25. package/dist/_chunks/fqnRef.mjs +41 -0
  26. package/dist/_chunks/geometry.mjs +335 -0
  27. package/dist/_chunks/index.d.mts +169 -0
  28. package/dist/_chunks/index2.d.mts +937 -0
  29. package/dist/_chunks/index3.d.mts +146 -0
  30. package/dist/_chunks/index4.d.mts +62 -0
  31. package/dist/_chunks/index5.d.mts +42 -0
  32. package/dist/_chunks/index6.d.mts +43 -0
  33. package/dist/{shared/core.OtRNdMxy.d.mts → _chunks/index7.d.mts} +113 -197
  34. package/dist/_chunks/index8.d.mts +144 -0
  35. package/dist/_chunks/invariant.mjs +18 -0
  36. package/dist/_chunks/iterable.mjs +146 -0
  37. package/dist/_chunks/libs/@mantine/colors-generator.mjs +3416 -0
  38. package/dist/_chunks/libs/@ungap/structured-clone.mjs +213 -0
  39. package/dist/_chunks/libs/bail.mjs +14 -0
  40. package/dist/_chunks/libs/ccount.mjs +25 -0
  41. package/dist/_chunks/libs/character-entities-html4.mjs +263 -0
  42. package/dist/_chunks/libs/character-entities-legacy.mjs +117 -0
  43. package/dist/_chunks/libs/character-entities.mjs +2136 -0
  44. package/dist/_chunks/libs/comma-separated-tokens.mjs +18 -0
  45. package/dist/_chunks/libs/decode-named-character-reference.mjs +21 -0
  46. package/dist/_chunks/libs/defu.mjs +42 -0
  47. package/dist/_chunks/libs/devlop.mjs +5 -0
  48. package/dist/_chunks/libs/escape-string-regexp.mjs +8 -0
  49. package/dist/_chunks/libs/extend.mjs +77 -0
  50. package/dist/_chunks/libs/graphology-dag.mjs +703 -0
  51. package/dist/_chunks/libs/graphology-types.d.mts +601 -0
  52. package/dist/_chunks/libs/graphology.d.mts +6 -0
  53. package/dist/_chunks/libs/graphology.mjs +4565 -0
  54. package/dist/_chunks/libs/hast-util-sanitize.mjs +863 -0
  55. package/dist/_chunks/libs/hast-util-to-html.mjs +2696 -0
  56. package/dist/_chunks/libs/is-plain-obj.mjs +9 -0
  57. package/dist/_chunks/libs/longest-streak.mjs +30 -0
  58. package/dist/_chunks/libs/markdown-table.mjs +290 -0
  59. package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +653 -0
  60. package/dist/_chunks/libs/mdast-util-from-markdown.mjs +8522 -0
  61. package/dist/_chunks/libs/mdast-util-gfm.mjs +2393 -0
  62. package/dist/_chunks/libs/mdast-util-to-hast.mjs +1803 -0
  63. package/dist/_chunks/libs/micromark-extension-gfm.mjs +2243 -0
  64. package/dist/_chunks/libs/mnemonist.d.mts +254 -0
  65. package/dist/_chunks/libs/mnemonist.mjs +1978 -0
  66. package/dist/_chunks/libs/natural-compare-lite.mjs +42 -0
  67. package/dist/_chunks/libs/rehype-sanitize.mjs +29 -0
  68. package/dist/_chunks/libs/rehype-stringify.mjs +34 -0
  69. package/dist/_chunks/libs/remark-gfm.mjs +36 -0
  70. package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +100 -0
  71. package/dist/_chunks/libs/remark-parse.mjs +39 -0
  72. package/dist/_chunks/libs/remark-rehype.mjs +171 -0
  73. package/dist/_chunks/libs/remeda.mjs +702 -0
  74. package/dist/_chunks/libs/trough.mjs +158 -0
  75. package/dist/_chunks/libs/unified.mjs +2212 -0
  76. package/dist/_chunks/mnemonist.d.mts +1 -0
  77. package/dist/_chunks/mnemonist.mjs +0 -0
  78. package/dist/_chunks/model.mjs +1898 -0
  79. package/dist/_chunks/model2.mjs +0 -0
  80. package/dist/_chunks/relationships-view.mjs +132 -0
  81. package/dist/_chunks/rolldown-runtime.mjs +42 -0
  82. package/dist/{shared/core.C_3y3eqV.d.mts → _chunks/scalar.d.mts} +13 -43
  83. package/dist/_chunks/scalar.mjs +84 -0
  84. package/dist/_chunks/utils.mjs +483 -0
  85. package/dist/builder/index.d.mts +11 -775
  86. package/dist/builder/index.mjs +631 -1022
  87. package/dist/compute-view/index.d.mts +85 -56
  88. package/dist/compute-view/index.mjs +247 -214
  89. package/dist/compute-view/relationships-view/index.d.mts +16 -51
  90. package/dist/compute-view/relationships-view/index.mjs +6 -184
  91. package/dist/geometry/index.d.mts +2 -109
  92. package/dist/geometry/index.mjs +2 -327
  93. package/dist/index.d.mts +18 -20
  94. package/dist/index.mjs +27 -18
  95. package/dist/model/connection/deployment/index.d.mts +12 -15
  96. package/dist/model/connection/deployment/index.mjs +9 -2
  97. package/dist/model/connection/index.d.mts +14 -75
  98. package/dist/model/connection/index.mjs +10 -3
  99. package/dist/model/connection/model/index.d.mts +12 -15
  100. package/dist/model/connection/model/index.mjs +8 -2
  101. package/dist/model/index.d.mts +15 -57
  102. package/dist/model/index.mjs +11 -4
  103. package/dist/styles/index.d.mts +9 -117
  104. package/dist/styles/index.mjs +26 -59
  105. package/dist/types/RichText.d.mts +3 -0
  106. package/dist/types/RichText.mjs +7 -0
  107. package/dist/types/_aux.d.mts +3 -4
  108. package/dist/types/_aux.mjs +2 -7
  109. package/dist/types/expression-model.d.mts +6 -190
  110. package/dist/types/expression-model.mjs +6 -108
  111. package/dist/types/expression.d.mts +5 -6
  112. package/dist/types/expression.mjs +6 -112
  113. package/dist/types/fqnRef.d.mts +4 -60
  114. package/dist/types/fqnRef.mjs +6 -44
  115. package/dist/types/index.d.mts +9 -47
  116. package/dist/types/index.mjs +14 -16
  117. package/dist/types/scalar.d.mts +2 -2
  118. package/dist/types/scalar.mjs +7 -4
  119. package/dist/utils/graphology/index.d.mts +2 -1864
  120. package/dist/utils/graphology/index.mjs +3 -1
  121. package/dist/utils/index.d.mts +11 -124
  122. package/dist/utils/index.mjs +16 -43
  123. package/dist/utils/iterable/index.d.mts +9 -132
  124. package/dist/utils/iterable/index.mjs +2 -61
  125. package/dist/utils/mnemonist.d.mts +2 -0
  126. package/dist/utils/mnemonist.mjs +12 -0
  127. package/package.json +17 -22
  128. package/compute-view/relationships/package.json +0 -4
  129. package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
  130. package/dist/shared/core.78IWAHAE.mjs +0 -332
  131. package/dist/shared/core.B85MJLTf.mjs +0 -5
  132. package/dist/shared/core.BFd1lU9R.mjs +0 -29
  133. package/dist/shared/core.BKlholso.mjs +0 -3
  134. package/dist/shared/core.BNN-3vPH.mjs +0 -1255
  135. package/dist/shared/core.BPGOjone.d.mts +0 -46
  136. package/dist/shared/core.BP_QHEXs.mjs +0 -785
  137. package/dist/shared/core.BbE4y-yl.mjs +0 -177
  138. package/dist/shared/core.Bdy3hhTc.mjs +0 -28382
  139. package/dist/shared/core.BfCKSW-g.d.mts +0 -1266
  140. package/dist/shared/core.BhNcrwzK.mjs +0 -7
  141. package/dist/shared/core.BkVA6gjl.mjs +0 -5
  142. package/dist/shared/core.BoYfZOBm.mjs +0 -3
  143. package/dist/shared/core.BsSXS-_R.mjs +0 -7
  144. package/dist/shared/core.C3JowhaZ.mjs +0 -32
  145. package/dist/shared/core.C4x8aaWa.mjs +0 -27
  146. package/dist/shared/core.CAgYpDtM.d.mts +0 -98
  147. package/dist/shared/core.CHf8VEa3.mjs +0 -1206
  148. package/dist/shared/core.CLSZtnFh.mjs +0 -69
  149. package/dist/shared/core.CbT8JVYL.mjs +0 -5
  150. package/dist/shared/core.CdNCAwq7.mjs +0 -176
  151. package/dist/shared/core.CmGY9blO.mjs +0 -6717
  152. package/dist/shared/core.CmPXpJ8l.mjs +0 -21
  153. package/dist/shared/core.Coi_LOUZ.mjs +0 -7
  154. package/dist/shared/core.CqAJJpK_.mjs +0 -3
  155. package/dist/shared/core.CywrQs86.d.mts +0 -31
  156. package/dist/shared/core.D00YbOhQ.d.mts +0 -300
  157. package/dist/shared/core.D0WZutNd.mjs +0 -94
  158. package/dist/shared/core.D4npX2q8.mjs +0 -18
  159. package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
  160. package/dist/shared/core.DC5IAaDT.d.mts +0 -334
  161. package/dist/shared/core.DE9qzhn8.d.mts +0 -83
  162. package/dist/shared/core.DGcIbsj4.mjs +0 -3946
  163. package/dist/shared/core.DH7TXqXf.mjs +0 -136
  164. package/dist/shared/core.DKhRkHRN.d.mts +0 -41
  165. package/dist/shared/core.DRJma0Ol.mjs +0 -22
  166. package/dist/shared/core.DU5SRqNF.mjs +0 -2209
  167. package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
  168. package/dist/shared/core.DbfO90vF.mjs +0 -434
  169. package/dist/shared/core.DcS-0zys.mjs +0 -10
  170. package/dist/shared/core.Dh119QSP.mjs +0 -4995
  171. package/dist/shared/core.DjcWextK.mjs +0 -1371
  172. package/dist/shared/core.Dojz4bvg.d.mts +0 -504
  173. package/dist/shared/core.FZ305VYd.mjs +0 -21
  174. package/dist/shared/core.RfnaEmgA.mjs +0 -7
  175. package/dist/shared/core.btEq3i3f.mjs +0 -300
  176. package/dist/shared/core.oSV6SRfk.mjs +0 -13
  177. package/dist/shared/core.om36dXXW.mjs +0 -41
  178. package/dist/shared/core.osFs8tU7.d.mts +0 -466
  179. package/dist/shared/core.q10OP9oJ.mjs +0 -5
  180. package/dist/shared/core.tpvDGvdC.d.mts +0 -87
  181. package/dist/shared/core.uFk_o9X6.mjs +0 -13
@@ -1,69 +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
- function isPlainObject(value) {
14
- if (value === null || typeof value !== "object") {
15
- return false;
16
- }
17
- const prototype = Object.getPrototypeOf(value);
18
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
19
- return false;
20
- }
21
- if (Symbol.iterator in value) {
22
- return false;
23
- }
24
- if (Symbol.toStringTag in value) {
25
- return Object.prototype.toString.call(value) === "[object Module]";
26
- }
27
- return true;
28
- }
29
-
30
- function _defu(baseObject, defaults, namespace = ".", merger) {
31
- if (!isPlainObject(defaults)) {
32
- return _defu(baseObject, {}, namespace, merger);
33
- }
34
- const object = Object.assign({}, defaults);
35
- for (const key in baseObject) {
36
- if (key === "__proto__" || key === "constructor") {
37
- continue;
38
- }
39
- const value = baseObject[key];
40
- if (value === null || value === void 0) {
41
- continue;
42
- }
43
- if (merger && merger(object, key, value, namespace)) {
44
- continue;
45
- }
46
- if (Array.isArray(value) && Array.isArray(object[key])) {
47
- object[key] = [...value, ...object[key]];
48
- } else if (isPlainObject(value) && isPlainObject(object[key])) {
49
- object[key] = _defu(
50
- value,
51
- object[key],
52
- (namespace ? `${namespace}.` : "") + key.toString(),
53
- merger
54
- );
55
- } else {
56
- object[key] = value;
57
- }
58
- }
59
- return object;
60
- }
61
- function createDefu(merger) {
62
- return (...arguments_) => (
63
- // eslint-disable-next-line unicorn/no-array-reduce
64
- arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
65
- );
66
- }
67
- const defu = createDefu();
68
-
69
- export { defu as d, memoizeProp as m };
@@ -1,5 +0,0 @@
1
- import { t as t$1 } from './core.BsSXS-_R.mjs';
2
-
3
- function t(...t){return t$1(n,t,r)}const n=(e,t)=>e.map(t),r=e=>(t,n,r)=>({done:false,hasNext:true,next:e(t,n,r)});
4
-
5
- export { t };
@@ -1,176 +0,0 @@
1
- import { c as compareNatural } from './core.3ZhnKAlZ.mjs';
2
-
3
- function isString(value) {
4
- return value != null && typeof value === "string";
5
- }
6
- function isNonEmptyArray(arr) {
7
- return !!arr && Array.isArray(arr) && arr.length > 0;
8
- }
9
- function hasProp(value, path) {
10
- return value[path] != null;
11
- }
12
- function isAnyOf(...predicates) {
13
- return (value) => {
14
- return predicates.some((predicate) => predicate(value));
15
- };
16
- }
17
-
18
- function parentFqn(fqn) {
19
- const lastDot = fqn.lastIndexOf(".");
20
- if (lastDot > 0) {
21
- return fqn.slice(0, lastDot);
22
- }
23
- return null;
24
- }
25
- function nameFromFqn(fqn) {
26
- const lastDot = fqn.lastIndexOf(".");
27
- if (lastDot > 0) {
28
- return fqn.slice(lastDot + 1);
29
- } else {
30
- return fqn;
31
- }
32
- }
33
- const asString = (e) => isString(e) ? e : e.id;
34
- function isAncestor(arg1, arg2) {
35
- const arg1Id = asString(arg1);
36
- if (arg2) {
37
- const arg2Id = asString(arg2);
38
- return arg2Id.startsWith(arg1Id + ".");
39
- }
40
- return (ancestor) => {
41
- const ancestorId = asString(ancestor);
42
- return arg1Id.startsWith(ancestorId + ".");
43
- };
44
- }
45
- function isSameHierarchy(one, another) {
46
- if (!another) {
47
- return (b) => isSameHierarchy(one, b);
48
- }
49
- const first = asString(one);
50
- const second = asString(another);
51
- return first === second || second.startsWith(first + ".") || first.startsWith(second + ".");
52
- }
53
- function isDescendantOf(descedant, ancestor) {
54
- if (!ancestor) {
55
- return (d) => isAncestor(descedant, d);
56
- }
57
- return isAncestor(ancestor, descedant);
58
- }
59
- function hierarchyLevel(elementOfFqn) {
60
- const first = isString(elementOfFqn) ? elementOfFqn : elementOfFqn.id;
61
- return first.split(".").length;
62
- }
63
- function hierarchyDistance(one, another) {
64
- const first = isString(one) ? one : one.id;
65
- const second = isString(another) ? another : another.id;
66
- if (first === second) {
67
- return 0;
68
- }
69
- const firstDepth = hierarchyLevel(first);
70
- const secondDepth = hierarchyLevel(second);
71
- if (isSameHierarchy(first, second)) {
72
- return Math.abs(firstDepth - secondDepth);
73
- }
74
- const ancestor = commonAncestor(first, second);
75
- const ancestorDepth = ancestor ? hierarchyLevel(ancestor) : 0;
76
- return firstDepth + secondDepth - (2 * ancestorDepth + 1);
77
- }
78
- function commonAncestor(first, second) {
79
- const a = first.split(".");
80
- if (a.length < 2) {
81
- return null;
82
- }
83
- const b = second.split(".");
84
- if (b.length < 2) {
85
- return null;
86
- }
87
- let ancestor = [];
88
- for (let i = 0; i < Math.min(a.length, b.length) - 1 && a[i] === b[i]; i++) {
89
- ancestor.push(a[i]);
90
- }
91
- if (ancestor.length === 0) {
92
- return null;
93
- }
94
- return ancestor.join(".");
95
- }
96
- function ancestorsFqn(fqn) {
97
- const path = fqn.split(".");
98
- path.pop();
99
- if (path.length === 0) {
100
- return [];
101
- }
102
- return path.reduce((acc, part, idx) => {
103
- if (idx === 0) {
104
- acc.push(part);
105
- return acc;
106
- }
107
- acc.unshift(`${acc[0]}.${part}`);
108
- return acc;
109
- }, []);
110
- }
111
- function compareFqnHierarchically(a, b) {
112
- const depthA = a.split(".").length;
113
- const depthB = b.split(".").length;
114
- switch (true) {
115
- case depthA > depthB: {
116
- return 1;
117
- }
118
- case depthA < depthB: {
119
- return -1;
120
- }
121
- default: {
122
- return 0;
123
- }
124
- }
125
- }
126
- function compareByFqnHierarchically(a, b) {
127
- return compareFqnHierarchically(a.id, b.id);
128
- }
129
- function sortByFqnHierarchically(array) {
130
- return array.map((item) => ({ item, fqn: item.id.split(".") })).sort((a, b) => {
131
- return a.fqn.length - b.fqn.length;
132
- }).map(({ item }) => item);
133
- }
134
- function findTopAncestor(items, item) {
135
- let parent = item;
136
- for (const e of items) {
137
- if (isAncestor(e, parent)) {
138
- parent = e;
139
- }
140
- }
141
- return parent !== item ? parent : null;
142
- }
143
- function sortParentsFirst(array) {
144
- const result = [];
145
- const items = [...array];
146
- let item;
147
- while (item = items.shift()) {
148
- let parent;
149
- while (parent = findTopAncestor(items, item)) {
150
- result.push(items.splice(items.indexOf(parent), 1)[0]);
151
- }
152
- result.push(item);
153
- }
154
- return result;
155
- }
156
- function sortNaturalByFqn(array, sort) {
157
- if (!array || isString(array)) {
158
- const dir2 = array ?? "asc";
159
- return (arr) => sortNaturalByFqn(arr, dir2);
160
- }
161
- const dir = sort === "desc" ? -1 : 1;
162
- return array.map((item) => ({ item, fqn: item.id.split(".") })).sort((a, b) => {
163
- if (a.fqn.length !== b.fqn.length) {
164
- return (a.fqn.length - b.fqn.length) * dir;
165
- }
166
- for (let i = 0; i < a.fqn.length; i++) {
167
- const compare = compareNatural(a.fqn[i], b.fqn[i]);
168
- if (compare !== 0) {
169
- return compare;
170
- }
171
- }
172
- return 0;
173
- }).map(({ item }) => item);
174
- }
175
-
176
- export { ancestorsFqn as a, isDescendantOf as b, isNonEmptyArray as c, isSameHierarchy as d, isString as e, sortParentsFirst as f, commonAncestor as g, hasProp as h, isAncestor as i, compareByFqnHierarchically as j, compareFqnHierarchically as k, hierarchyDistance as l, hierarchyLevel as m, nameFromFqn as n, sortByFqnHierarchically as o, parentFqn as p, isAnyOf as q, sortNaturalByFqn as s };