@likec4/core 1.46.4 → 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.
- package/LICENSE +1 -1
- package/dist/_chunks/Builder.view-element.mjs +3284 -0
- package/dist/_chunks/LikeC4Model.d.mts +1287 -0
- package/dist/_chunks/LikeC4Styles.mjs +691 -0
- package/dist/_chunks/RichText.d.mts +84 -0
- package/dist/_chunks/RichText.mjs +148 -0
- package/dist/_chunks/_aux.d.mts +289 -0
- package/dist/_chunks/_aux.mjs +18 -0
- package/dist/_chunks/_types.d.mts +781 -0
- package/dist/_chunks/_types2.d.mts +38 -0
- package/dist/_chunks/assignTagColors.mjs +24 -0
- package/dist/_chunks/calcDriftsFromSnapshot.mjs +379 -0
- package/dist/_chunks/connection.mjs +0 -0
- package/dist/_chunks/const.d.mts +43 -0
- package/dist/_chunks/const.mjs +33 -0
- package/dist/_chunks/expression-model.d.mts +192 -0
- package/dist/_chunks/expression-model.mjs +103 -0
- package/dist/_chunks/expression.d.mts +347 -0
- package/dist/_chunks/expression.mjs +107 -0
- package/dist/_chunks/find.d.mts +82 -0
- package/dist/_chunks/find.mjs +646 -0
- package/dist/_chunks/find2.d.mts +78 -0
- package/dist/_chunks/find2.mjs +287 -0
- package/dist/_chunks/fqnRef.d.mts +58 -0
- package/dist/_chunks/fqnRef.mjs +41 -0
- package/dist/_chunks/geometry.mjs +335 -0
- package/dist/_chunks/index.d.mts +169 -0
- package/dist/_chunks/index2.d.mts +937 -0
- package/dist/_chunks/index3.d.mts +146 -0
- package/dist/_chunks/index4.d.mts +62 -0
- package/dist/_chunks/index5.d.mts +42 -0
- package/dist/_chunks/index6.d.mts +43 -0
- package/dist/{shared/core.OtRNdMxy.d.mts → _chunks/index7.d.mts} +113 -197
- package/dist/_chunks/index8.d.mts +144 -0
- package/dist/_chunks/invariant.mjs +18 -0
- package/dist/_chunks/iterable.mjs +146 -0
- package/dist/_chunks/libs/@mantine/colors-generator.mjs +3416 -0
- package/dist/_chunks/libs/@ungap/structured-clone.mjs +213 -0
- package/dist/_chunks/libs/bail.mjs +14 -0
- package/dist/_chunks/libs/ccount.mjs +25 -0
- package/dist/_chunks/libs/character-entities-html4.mjs +263 -0
- package/dist/_chunks/libs/character-entities-legacy.mjs +117 -0
- package/dist/_chunks/libs/character-entities.mjs +2136 -0
- package/dist/_chunks/libs/comma-separated-tokens.mjs +18 -0
- package/dist/_chunks/libs/decode-named-character-reference.mjs +21 -0
- package/dist/_chunks/libs/defu.mjs +42 -0
- package/dist/_chunks/libs/devlop.mjs +5 -0
- package/dist/_chunks/libs/escape-string-regexp.mjs +8 -0
- package/dist/_chunks/libs/extend.mjs +77 -0
- package/dist/_chunks/libs/graphology-dag.mjs +703 -0
- package/dist/_chunks/libs/graphology-types.d.mts +601 -0
- package/dist/_chunks/libs/graphology.d.mts +6 -0
- package/dist/_chunks/libs/graphology.mjs +4565 -0
- package/dist/_chunks/libs/hast-util-sanitize.mjs +863 -0
- package/dist/_chunks/libs/hast-util-to-html.mjs +2696 -0
- package/dist/_chunks/libs/is-plain-obj.mjs +9 -0
- package/dist/_chunks/libs/longest-streak.mjs +30 -0
- package/dist/_chunks/libs/markdown-table.mjs +290 -0
- package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +653 -0
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +8522 -0
- package/dist/_chunks/libs/mdast-util-gfm.mjs +2393 -0
- package/dist/_chunks/libs/mdast-util-to-hast.mjs +1803 -0
- package/dist/_chunks/libs/micromark-extension-gfm.mjs +2243 -0
- package/dist/_chunks/libs/mnemonist.d.mts +254 -0
- package/dist/_chunks/libs/mnemonist.mjs +1978 -0
- package/dist/_chunks/libs/natural-compare-lite.mjs +42 -0
- package/dist/_chunks/libs/rehype-sanitize.mjs +29 -0
- package/dist/_chunks/libs/rehype-stringify.mjs +34 -0
- package/dist/_chunks/libs/remark-gfm.mjs +36 -0
- package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +100 -0
- package/dist/_chunks/libs/remark-parse.mjs +39 -0
- package/dist/_chunks/libs/remark-rehype.mjs +171 -0
- package/dist/_chunks/libs/remeda.mjs +702 -0
- package/dist/_chunks/libs/trough.mjs +158 -0
- package/dist/_chunks/libs/unified.mjs +2212 -0
- package/dist/_chunks/mnemonist.d.mts +1 -0
- package/dist/_chunks/mnemonist.mjs +0 -0
- package/dist/_chunks/model.mjs +1898 -0
- package/dist/_chunks/model2.mjs +0 -0
- package/dist/_chunks/relationships-view.mjs +132 -0
- package/dist/_chunks/rolldown-runtime.mjs +42 -0
- package/dist/{shared/core.C_3y3eqV.d.mts → _chunks/scalar.d.mts} +13 -43
- package/dist/_chunks/scalar.mjs +84 -0
- package/dist/_chunks/utils.mjs +483 -0
- package/dist/builder/index.d.mts +11 -773
- package/dist/builder/index.mjs +631 -978
- package/dist/compute-view/index.d.mts +90 -27
- package/dist/compute-view/index.mjs +253 -83
- package/dist/compute-view/relationships-view/index.d.mts +16 -51
- package/dist/compute-view/relationships-view/index.mjs +6 -184
- package/dist/geometry/index.d.mts +2 -109
- package/dist/geometry/index.mjs +2 -327
- package/dist/index.d.mts +18 -20
- package/dist/index.mjs +27 -18
- package/dist/model/connection/deployment/index.d.mts +12 -15
- package/dist/model/connection/deployment/index.mjs +9 -2
- package/dist/model/connection/index.d.mts +14 -75
- package/dist/model/connection/index.mjs +10 -3
- package/dist/model/connection/model/index.d.mts +12 -15
- package/dist/model/connection/model/index.mjs +8 -2
- package/dist/model/index.d.mts +15 -57
- package/dist/model/index.mjs +11 -4
- package/dist/styles/index.d.mts +9 -117
- package/dist/styles/index.mjs +26 -59
- package/dist/types/RichText.d.mts +3 -0
- package/dist/types/RichText.mjs +7 -0
- package/dist/types/_aux.d.mts +3 -4
- package/dist/types/_aux.mjs +2 -7
- package/dist/types/expression-model.d.mts +6 -190
- package/dist/types/expression-model.mjs +6 -108
- package/dist/types/expression.d.mts +5 -6
- package/dist/types/expression.mjs +6 -112
- package/dist/types/fqnRef.d.mts +4 -60
- package/dist/types/fqnRef.mjs +6 -44
- package/dist/types/index.d.mts +9 -47
- package/dist/types/index.mjs +14 -16
- package/dist/types/scalar.d.mts +2 -2
- package/dist/types/scalar.mjs +7 -4
- package/dist/utils/graphology/index.d.mts +2 -1864
- package/dist/utils/graphology/index.mjs +3 -1
- package/dist/utils/index.d.mts +11 -124
- package/dist/utils/index.mjs +16 -43
- package/dist/utils/iterable/index.d.mts +9 -132
- package/dist/utils/iterable/index.mjs +2 -61
- package/dist/utils/mnemonist.d.mts +2 -0
- package/dist/utils/mnemonist.mjs +12 -0
- package/package.json +18 -22
- package/compute-view/relationships/package.json +0 -4
- package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
- package/dist/shared/core.78IWAHAE.mjs +0 -332
- package/dist/shared/core.B85MJLTf.mjs +0 -5
- package/dist/shared/core.BFd1lU9R.mjs +0 -29
- package/dist/shared/core.BKlholso.mjs +0 -3
- package/dist/shared/core.BPGOjone.d.mts +0 -46
- package/dist/shared/core.BYdtmqY5.mjs +0 -1255
- package/dist/shared/core.BZCgljZd.d.mts +0 -83
- package/dist/shared/core.BbE4y-yl.mjs +0 -177
- package/dist/shared/core.BhNcrwzK.mjs +0 -7
- package/dist/shared/core.BkVA6gjl.mjs +0 -5
- package/dist/shared/core.BoYfZOBm.mjs +0 -3
- package/dist/shared/core.BsSXS-_R.mjs +0 -7
- package/dist/shared/core.BspBF3SJ.mjs +0 -3944
- package/dist/shared/core.BvPm_-u3.d.mts +0 -334
- package/dist/shared/core.C-Jdx7xo.d.mts +0 -1263
- package/dist/shared/core.C3JowhaZ.mjs +0 -32
- package/dist/shared/core.C4x8aaWa.mjs +0 -27
- package/dist/shared/core.CBLX4mT8.mjs +0 -28411
- package/dist/shared/core.CLSZtnFh.mjs +0 -69
- package/dist/shared/core.CRhT4Iio.mjs +0 -785
- package/dist/shared/core.CbT8JVYL.mjs +0 -5
- package/dist/shared/core.CdNCAwq7.mjs +0 -176
- package/dist/shared/core.ClTP6-TN.d.mts +0 -87
- package/dist/shared/core.CmGY9blO.mjs +0 -6717
- package/dist/shared/core.CmPXpJ8l.mjs +0 -21
- package/dist/shared/core.Coi_LOUZ.mjs +0 -7
- package/dist/shared/core.CqAJJpK_.mjs +0 -3
- package/dist/shared/core.Ctj2S3bD.d.mts +0 -466
- package/dist/shared/core.CywrQs86.d.mts +0 -31
- package/dist/shared/core.D00YbOhQ.d.mts +0 -300
- package/dist/shared/core.D0WZutNd.mjs +0 -94
- package/dist/shared/core.D4npX2q8.mjs +0 -18
- package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
- package/dist/shared/core.DEK-BO3_.mjs +0 -1206
- package/dist/shared/core.DH7TXqXf.mjs +0 -136
- package/dist/shared/core.DRJma0Ol.mjs +0 -22
- package/dist/shared/core.DSalPD6v.mjs +0 -1352
- package/dist/shared/core.DVfPJPJj.mjs +0 -2200
- package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
- package/dist/shared/core.DbfO90vF.mjs +0 -434
- package/dist/shared/core.DcS-0zys.mjs +0 -10
- package/dist/shared/core.DeDCYTDR.d.mts +0 -98
- package/dist/shared/core.DpKY_3NF.d.mts +0 -504
- package/dist/shared/core.Dt0v3djy.d.mts +0 -41
- package/dist/shared/core.FZ305VYd.mjs +0 -21
- package/dist/shared/core.RfnaEmgA.mjs +0 -7
- package/dist/shared/core.oSV6SRfk.mjs +0 -13
- package/dist/shared/core.om36dXXW.mjs +0 -41
- package/dist/shared/core.q10OP9oJ.mjs +0 -5
- package/dist/shared/core.uFk_o9X6.mjs +0 -13
- package/dist/shared/core.xeuDd__E.mjs +0 -300
- package/dist/shared/core.xgoPk2RG.mjs +0 -4989
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
import { a as t } from './core.BsSXS-_R.mjs';
|
|
2
|
-
|
|
3
|
-
var set = {};
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Mnemonist Set
|
|
7
|
-
* ==============
|
|
8
|
-
*
|
|
9
|
-
* Useful function related to sets such as union, intersection and so on...
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
var hasRequiredSet;
|
|
13
|
-
|
|
14
|
-
function requireSet () {
|
|
15
|
-
if (hasRequiredSet) return set;
|
|
16
|
-
hasRequiredSet = 1;
|
|
17
|
-
(function (exports$1) {
|
|
18
|
-
// TODO: optimize versions for less variadicities
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Variadic function computing the intersection of multiple sets.
|
|
22
|
-
*
|
|
23
|
-
* @param {...Set} sets - Sets to intersect.
|
|
24
|
-
* @return {Set} - The intesection.
|
|
25
|
-
*/
|
|
26
|
-
exports$1.intersection = function() {
|
|
27
|
-
if (arguments.length < 2)
|
|
28
|
-
throw new Error('mnemonist/Set.intersection: needs at least two arguments.');
|
|
29
|
-
|
|
30
|
-
var I = new Set();
|
|
31
|
-
|
|
32
|
-
// First we need to find the smallest set
|
|
33
|
-
var smallestSize = Infinity,
|
|
34
|
-
smallestSet = null;
|
|
35
|
-
|
|
36
|
-
var s, i, l = arguments.length;
|
|
37
|
-
|
|
38
|
-
for (i = 0; i < l; i++) {
|
|
39
|
-
s = arguments[i];
|
|
40
|
-
|
|
41
|
-
// If one of the set has no items, we can stop right there
|
|
42
|
-
if (s.size === 0)
|
|
43
|
-
return I;
|
|
44
|
-
|
|
45
|
-
if (s.size < smallestSize) {
|
|
46
|
-
smallestSize = s.size;
|
|
47
|
-
smallestSet = s;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Now we need to intersect this set with the others
|
|
52
|
-
var iterator = smallestSet.values(),
|
|
53
|
-
step,
|
|
54
|
-
item,
|
|
55
|
-
add,
|
|
56
|
-
set;
|
|
57
|
-
|
|
58
|
-
// TODO: we can optimize by iterating each next time over the current intersection
|
|
59
|
-
// but this probably means more RAM to consume since we'll create n-1 sets rather than
|
|
60
|
-
// only the one.
|
|
61
|
-
while ((step = iterator.next(), !step.done)) {
|
|
62
|
-
item = step.value;
|
|
63
|
-
add = true;
|
|
64
|
-
|
|
65
|
-
for (i = 0; i < l; i++) {
|
|
66
|
-
set = arguments[i];
|
|
67
|
-
|
|
68
|
-
if (set === smallestSet)
|
|
69
|
-
continue;
|
|
70
|
-
|
|
71
|
-
if (!set.has(item)) {
|
|
72
|
-
add = false;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (add)
|
|
78
|
-
I.add(item);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return I;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Variadic function computing the union of multiple sets.
|
|
86
|
-
*
|
|
87
|
-
* @param {...Set} sets - Sets to unite.
|
|
88
|
-
* @return {Set} - The union.
|
|
89
|
-
*/
|
|
90
|
-
exports$1.union = function() {
|
|
91
|
-
if (arguments.length < 2)
|
|
92
|
-
throw new Error('mnemonist/Set.union: needs at least two arguments.');
|
|
93
|
-
|
|
94
|
-
var U = new Set();
|
|
95
|
-
|
|
96
|
-
var i, l = arguments.length;
|
|
97
|
-
|
|
98
|
-
var iterator,
|
|
99
|
-
step;
|
|
100
|
-
|
|
101
|
-
for (i = 0; i < l; i++) {
|
|
102
|
-
iterator = arguments[i].values();
|
|
103
|
-
|
|
104
|
-
while ((step = iterator.next(), !step.done))
|
|
105
|
-
U.add(step.value);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return U;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Function computing the difference between two sets.
|
|
113
|
-
*
|
|
114
|
-
* @param {Set} A - First set.
|
|
115
|
-
* @param {Set} B - Second set.
|
|
116
|
-
* @return {Set} - The difference.
|
|
117
|
-
*/
|
|
118
|
-
exports$1.difference = function(A, B) {
|
|
119
|
-
|
|
120
|
-
// If first set is empty
|
|
121
|
-
if (!A.size)
|
|
122
|
-
return new Set();
|
|
123
|
-
|
|
124
|
-
if (!B.size)
|
|
125
|
-
return new Set(A);
|
|
126
|
-
|
|
127
|
-
var D = new Set();
|
|
128
|
-
|
|
129
|
-
var iterator = A.values(),
|
|
130
|
-
step;
|
|
131
|
-
|
|
132
|
-
while ((step = iterator.next(), !step.done)) {
|
|
133
|
-
if (!B.has(step.value))
|
|
134
|
-
D.add(step.value);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return D;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Function computing the symmetric difference between two sets.
|
|
142
|
-
*
|
|
143
|
-
* @param {Set} A - First set.
|
|
144
|
-
* @param {Set} B - Second set.
|
|
145
|
-
* @return {Set} - The symmetric difference.
|
|
146
|
-
*/
|
|
147
|
-
exports$1.symmetricDifference = function(A, B) {
|
|
148
|
-
var S = new Set();
|
|
149
|
-
|
|
150
|
-
var iterator = A.values(),
|
|
151
|
-
step;
|
|
152
|
-
|
|
153
|
-
while ((step = iterator.next(), !step.done)) {
|
|
154
|
-
if (!B.has(step.value))
|
|
155
|
-
S.add(step.value);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
iterator = B.values();
|
|
159
|
-
|
|
160
|
-
while ((step = iterator.next(), !step.done)) {
|
|
161
|
-
if (!A.has(step.value))
|
|
162
|
-
S.add(step.value);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return S;
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Function returning whether A is a subset of B.
|
|
170
|
-
*
|
|
171
|
-
* @param {Set} A - First set.
|
|
172
|
-
* @param {Set} B - Second set.
|
|
173
|
-
* @return {boolean}
|
|
174
|
-
*/
|
|
175
|
-
exports$1.isSubset = function(A, B) {
|
|
176
|
-
var iterator = A.values(),
|
|
177
|
-
step;
|
|
178
|
-
|
|
179
|
-
// Shortcuts
|
|
180
|
-
if (A === B)
|
|
181
|
-
return true;
|
|
182
|
-
|
|
183
|
-
if (A.size > B.size)
|
|
184
|
-
return false;
|
|
185
|
-
|
|
186
|
-
while ((step = iterator.next(), !step.done)) {
|
|
187
|
-
if (!B.has(step.value))
|
|
188
|
-
return false;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
return true;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Function returning whether A is a superset of B.
|
|
196
|
-
*
|
|
197
|
-
* @param {Set} A - First set.
|
|
198
|
-
* @param {Set} B - Second set.
|
|
199
|
-
* @return {boolean}
|
|
200
|
-
*/
|
|
201
|
-
exports$1.isSuperset = function(A, B) {
|
|
202
|
-
return exports$1.isSubset(B, A);
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Function adding the items of set B to the set A.
|
|
207
|
-
*
|
|
208
|
-
* @param {Set} A - First set.
|
|
209
|
-
* @param {Set} B - Second set.
|
|
210
|
-
*/
|
|
211
|
-
exports$1.add = function(A, B) {
|
|
212
|
-
var iterator = B.values(),
|
|
213
|
-
step;
|
|
214
|
-
|
|
215
|
-
while ((step = iterator.next(), !step.done))
|
|
216
|
-
A.add(step.value);
|
|
217
|
-
|
|
218
|
-
return;
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Function subtracting the items of set B from the set A.
|
|
223
|
-
*
|
|
224
|
-
* @param {Set} A - First set.
|
|
225
|
-
* @param {Set} B - Second set.
|
|
226
|
-
*/
|
|
227
|
-
exports$1.subtract = function(A, B) {
|
|
228
|
-
var iterator = B.values(),
|
|
229
|
-
step;
|
|
230
|
-
|
|
231
|
-
while ((step = iterator.next(), !step.done))
|
|
232
|
-
A.delete(step.value);
|
|
233
|
-
|
|
234
|
-
return;
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Function intersecting the items of A & B.
|
|
239
|
-
*
|
|
240
|
-
* @param {Set} A - First set.
|
|
241
|
-
* @param {Set} B - Second set.
|
|
242
|
-
*/
|
|
243
|
-
exports$1.intersect = function(A, B) {
|
|
244
|
-
var iterator = A.values(),
|
|
245
|
-
step;
|
|
246
|
-
|
|
247
|
-
while ((step = iterator.next(), !step.done)) {
|
|
248
|
-
if (!B.has(step.value))
|
|
249
|
-
A.delete(step.value);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
return;
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Function disjuncting the items of A & B.
|
|
257
|
-
*
|
|
258
|
-
* @param {Set} A - First set.
|
|
259
|
-
* @param {Set} B - Second set.
|
|
260
|
-
*/
|
|
261
|
-
exports$1.disjunct = function(A, B) {
|
|
262
|
-
var iterator = A.values(),
|
|
263
|
-
step;
|
|
264
|
-
|
|
265
|
-
var toRemove = [];
|
|
266
|
-
|
|
267
|
-
while ((step = iterator.next(), !step.done)) {
|
|
268
|
-
if (B.has(step.value))
|
|
269
|
-
toRemove.push(step.value);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
iterator = B.values();
|
|
273
|
-
|
|
274
|
-
while ((step = iterator.next(), !step.done)) {
|
|
275
|
-
if (!A.has(step.value))
|
|
276
|
-
A.add(step.value);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
for (var i = 0, l = toRemove.length; i < l; i++)
|
|
280
|
-
A.delete(toRemove[i]);
|
|
281
|
-
|
|
282
|
-
return;
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Function returning the size of the intersection of A & B.
|
|
287
|
-
*
|
|
288
|
-
* @param {Set} A - First set.
|
|
289
|
-
* @param {Set} B - Second set.
|
|
290
|
-
* @return {number}
|
|
291
|
-
*/
|
|
292
|
-
exports$1.intersectionSize = function(A, B) {
|
|
293
|
-
var tmp;
|
|
294
|
-
|
|
295
|
-
// We need to know the smallest set
|
|
296
|
-
if (A.size > B.size) {
|
|
297
|
-
tmp = A;
|
|
298
|
-
A = B;
|
|
299
|
-
B = tmp;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
if (A.size === 0)
|
|
303
|
-
return 0;
|
|
304
|
-
|
|
305
|
-
if (A === B)
|
|
306
|
-
return A.size;
|
|
307
|
-
|
|
308
|
-
var iterator = A.values(),
|
|
309
|
-
step;
|
|
310
|
-
|
|
311
|
-
var I = 0;
|
|
312
|
-
|
|
313
|
-
while ((step = iterator.next(), !step.done)) {
|
|
314
|
-
if (B.has(step.value))
|
|
315
|
-
I++;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
return I;
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Function returning the size of the union of A & B.
|
|
323
|
-
*
|
|
324
|
-
* @param {Set} A - First set.
|
|
325
|
-
* @param {Set} B - Second set.
|
|
326
|
-
* @return {number}
|
|
327
|
-
*/
|
|
328
|
-
exports$1.unionSize = function(A, B) {
|
|
329
|
-
var I = exports$1.intersectionSize(A, B);
|
|
330
|
-
|
|
331
|
-
return A.size + B.size - I;
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Function returning the Jaccard similarity between A & B.
|
|
336
|
-
*
|
|
337
|
-
* @param {Set} A - First set.
|
|
338
|
-
* @param {Set} B - Second set.
|
|
339
|
-
* @return {number}
|
|
340
|
-
*/
|
|
341
|
-
exports$1.jaccard = function(A, B) {
|
|
342
|
-
var I = exports$1.intersectionSize(A, B);
|
|
343
|
-
|
|
344
|
-
if (I === 0)
|
|
345
|
-
return 0;
|
|
346
|
-
|
|
347
|
-
var U = A.size + B.size - I;
|
|
348
|
-
|
|
349
|
-
return I / U;
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* Function returning the overlap coefficient between A & B.
|
|
354
|
-
*
|
|
355
|
-
* @param {Set} A - First set.
|
|
356
|
-
* @param {Set} B - Second set.
|
|
357
|
-
* @return {number}
|
|
358
|
-
*/
|
|
359
|
-
exports$1.overlap = function(A, B) {
|
|
360
|
-
var I = exports$1.intersectionSize(A, B);
|
|
361
|
-
|
|
362
|
-
if (I === 0)
|
|
363
|
-
return 0;
|
|
364
|
-
|
|
365
|
-
return I / Math.min(A.size, B.size);
|
|
366
|
-
};
|
|
367
|
-
} (set));
|
|
368
|
-
return set;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
var setExports = /*@__PURE__*/ requireSet();
|
|
372
|
-
|
|
373
|
-
function union(...sets) {
|
|
374
|
-
let result = /* @__PURE__ */ new Set();
|
|
375
|
-
for (const set of sets) {
|
|
376
|
-
for (const value of set) {
|
|
377
|
-
result.add(value);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
return result;
|
|
381
|
-
}
|
|
382
|
-
function intersection(first, ...sets) {
|
|
383
|
-
let result = /* @__PURE__ */ new Set();
|
|
384
|
-
if (first.size === 0) {
|
|
385
|
-
return result;
|
|
386
|
-
}
|
|
387
|
-
let other = t(sets, 2) ? setExports.intersection(...sets) : sets[0];
|
|
388
|
-
if (other.size === 0) {
|
|
389
|
-
return result;
|
|
390
|
-
}
|
|
391
|
-
for (const value of first) {
|
|
392
|
-
if (other.has(value)) {
|
|
393
|
-
result.add(value);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
return result;
|
|
397
|
-
}
|
|
398
|
-
function difference(a, b) {
|
|
399
|
-
if (a.size === 0) {
|
|
400
|
-
return /* @__PURE__ */ new Set();
|
|
401
|
-
}
|
|
402
|
-
if (b.size === 0) {
|
|
403
|
-
return new Set(a);
|
|
404
|
-
}
|
|
405
|
-
let result = /* @__PURE__ */ new Set();
|
|
406
|
-
for (const value of a) {
|
|
407
|
-
if (!b.has(value)) {
|
|
408
|
-
result.add(value);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
return result;
|
|
412
|
-
}
|
|
413
|
-
function equals(a, b) {
|
|
414
|
-
return a.size === b.size && [...a].every((value) => b.has(value));
|
|
415
|
-
}
|
|
416
|
-
function symmetricDifference(a, b) {
|
|
417
|
-
return setExports.symmetricDifference(a, b);
|
|
418
|
-
}
|
|
419
|
-
function hasIntersection(a, b) {
|
|
420
|
-
if (a.size === 0 || b.size === 0) {
|
|
421
|
-
return false;
|
|
422
|
-
}
|
|
423
|
-
if (b.size < a.size) {
|
|
424
|
-
[a, b] = [b, a];
|
|
425
|
-
}
|
|
426
|
-
for (const value of a) {
|
|
427
|
-
if (b.has(value)) {
|
|
428
|
-
return true;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
return false;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
export { difference as d, equals as e, hasIntersection as h, intersection as i, symmetricDifference as s, union as u };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { L as LikeC4StylesConfig, a as LikeC4Theme, b as LikeC4StyleDefaults, E as ElementColorValues, R as RelationshipColorValues, T as ThemeColor, c as ThemeColorValues, d as TextSize, S as SpacingSize, e as ShapeSize } from './core.BvPm_-u3.mjs';
|
|
2
|
-
import { LiteralUnion } from 'type-fest';
|
|
3
|
-
import { L as LikeC4ProjectStylesConfig, C as ComputedNodeStyle } from './core.DpKY_3NF.mjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Styles of a LikeC4 project
|
|
7
|
-
*
|
|
8
|
-
* Accepts an array of LikeC4ProjectStylesConfig objects as a parameter
|
|
9
|
-
* and constructs a LikeC4Styles merged with the default styles.
|
|
10
|
-
*
|
|
11
|
-
* The class provides methods to get the default element colors, relationship
|
|
12
|
-
* colors, group colors, font size in pixels, padding in pixels, and to compute
|
|
13
|
-
* the ThemeColorValues from a given color.
|
|
14
|
-
*/
|
|
15
|
-
declare class LikeC4Styles {
|
|
16
|
-
protected config: LikeC4StylesConfig;
|
|
17
|
-
readonly theme: LikeC4Theme;
|
|
18
|
-
readonly defaults: LikeC4StyleDefaults;
|
|
19
|
-
static readonly DEFAULT: LikeC4Styles;
|
|
20
|
-
static from(...configs: Array<LikeC4ProjectStylesConfig | undefined | null>): LikeC4Styles;
|
|
21
|
-
private constructor();
|
|
22
|
-
/**
|
|
23
|
-
* Default element colors
|
|
24
|
-
*/
|
|
25
|
-
get elementColors(): ElementColorValues;
|
|
26
|
-
/**
|
|
27
|
-
* Default relationship colors
|
|
28
|
-
*/
|
|
29
|
-
get relationshipColors(): RelationshipColorValues;
|
|
30
|
-
/**
|
|
31
|
-
* Default group colors
|
|
32
|
-
*/
|
|
33
|
-
get groupColors(): ElementColorValues;
|
|
34
|
-
isDefaultColor(color: LiteralUnion<ThemeColor, string>): color is ThemeColor;
|
|
35
|
-
/**
|
|
36
|
-
* Get color values
|
|
37
|
-
*
|
|
38
|
-
* @param color - The color to use
|
|
39
|
-
* @default color From the defaults
|
|
40
|
-
*/
|
|
41
|
-
colors(color?: LiteralUnion<ThemeColor, string>): ThemeColorValues;
|
|
42
|
-
/**
|
|
43
|
-
* Get font size in pixels
|
|
44
|
-
*
|
|
45
|
-
* @param textSize - The text size to use
|
|
46
|
-
* @default textSize From the defaults
|
|
47
|
-
*/
|
|
48
|
-
fontSize(textSize?: TextSize): number;
|
|
49
|
-
/**
|
|
50
|
-
* Get padding in pixels
|
|
51
|
-
*
|
|
52
|
-
* @param paddingSize - The padding size to use
|
|
53
|
-
* @default paddingSize From the defaults
|
|
54
|
-
*/
|
|
55
|
-
padding(paddingSize?: SpacingSize): number;
|
|
56
|
-
isThemeColor(color: string): color is ThemeColor;
|
|
57
|
-
/**
|
|
58
|
-
* Calculate sizes and values based on the node styles
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* const { sizes, values } = styles.nodeSizes(node.style)
|
|
63
|
-
*
|
|
64
|
-
* // sizes
|
|
65
|
-
* sizes.size // enum Size
|
|
66
|
-
* sizes.padding // enum SpacingSize
|
|
67
|
-
* sizes.textSize // enum TextSize
|
|
68
|
-
*
|
|
69
|
-
* // values
|
|
70
|
-
* values.sizes // { width: number, height: number }
|
|
71
|
-
* values.padding // number
|
|
72
|
-
* values.textSize // number
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
nodeSizes(nodestyles: ComputedNodeStyle): {
|
|
76
|
-
sizes: Omit<ComputedNodeStyle, "size" | "padding" | "textSize"> & Required<{
|
|
77
|
-
readonly size?: ShapeSize;
|
|
78
|
-
readonly padding?: SpacingSize;
|
|
79
|
-
readonly textSize?: TextSize;
|
|
80
|
-
}>;
|
|
81
|
-
values: {
|
|
82
|
-
sizes: {
|
|
83
|
-
readonly width: number;
|
|
84
|
-
readonly height: number;
|
|
85
|
-
};
|
|
86
|
-
padding: number;
|
|
87
|
-
textSize: number;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Compute ThemeColorValues from a given color
|
|
92
|
-
* @param color - HEX, RGB, RGBA, etc.
|
|
93
|
-
*/
|
|
94
|
-
computeFrom(color: string): ThemeColorValues;
|
|
95
|
-
equals(other: LikeC4Styles): boolean;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export { LikeC4Styles as L };
|