@likec4/core 1.19.1 → 1.20.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/dist/builder/index.cjs +881 -0
- package/dist/builder/index.d.cts +503 -0
- package/dist/builder/index.d.mts +5 -4
- package/dist/builder/index.d.ts +5 -4
- package/dist/builder/{index.js → index.mjs} +14 -4
- package/dist/compute-view/index.cjs +86 -0
- package/dist/compute-view/index.d.cts +23 -0
- package/dist/compute-view/index.d.mts +3 -2
- package/dist/compute-view/index.d.ts +3 -2
- package/dist/compute-view/{index.js → index.mjs} +6 -5
- package/dist/index.cjs +4320 -0
- package/dist/index.d.cts +270 -0
- package/dist/index.d.mts +130 -4
- package/dist/index.d.ts +130 -4
- package/dist/{index.js → index.mjs} +512 -7
- package/dist/model/index.cjs +40 -0
- package/dist/model/index.d.cts +259 -0
- package/dist/model/index.d.mts +8 -3
- package/dist/model/index.d.ts +8 -3
- package/dist/model/index.mjs +1 -0
- package/dist/shared/core.B2QYWlYe.cjs +435 -0
- package/dist/shared/core.B72vUaNB.d.cts +850 -0
- package/dist/shared/core.BGus30EM.cjs +8027 -0
- package/dist/shared/core.BRuJ3Wzf.d.mts +12 -0
- package/dist/shared/{core.BZ9Msq7w.d.mts → core.BdbFkE_p.d.cts} +14 -4
- package/dist/shared/core.BvdNMbcA.d.cts +12 -0
- package/dist/shared/{object_hash.CE_oF3I3.js → core.BxvDITEI.mjs} +26 -389
- package/dist/shared/core.ByNgh-mC.d.cts +127 -0
- package/dist/shared/core.C9DCnJh8.cjs +908 -0
- package/dist/shared/{index.DafVOuVd.js → core.CqCTxzMY.mjs} +1111 -572
- package/dist/shared/core.D74xkKkG.d.cts +148 -0
- package/dist/shared/{core.C05RDLhi.d.ts → core.D_Gc58Gt.d.ts} +23 -5
- package/dist/shared/core.Damrzla-.d.ts +12 -0
- package/dist/shared/{core.CmYMqgha.d.mts → core.Dfzrh1VA.d.mts} +23 -5
- package/dist/shared/core.DsoCu540.cjs +26 -0
- package/dist/shared/{view.CyZrG8BJ.js → core.DunIMHRf.mjs} +27 -1
- package/dist/shared/{core.BIfgabEw.d.ts → core.ZWiGANIJ.d.ts} +14 -4
- package/dist/shared/core.gv1bMwCC.cjs +39 -0
- package/dist/shared/core.jy6z2iRn.d.mts +729 -0
- package/dist/shared/core.m3rCQAv6.mjs +37 -0
- package/dist/types/index.cjs +107 -0
- package/dist/types/index.d.cts +72 -0
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/{index.js → index.mjs} +1 -1
- package/dist/utils/index.cjs +95 -0
- package/dist/utils/index.d.cts +356 -0
- package/dist/utils/index.d.mts +1 -64
- package/dist/utils/index.d.ts +1 -64
- package/dist/utils/index.mjs +56 -0
- package/package.json +52 -26
- package/src/builder/Builder.view-common.ts +21 -1
- package/src/compute-view/deployment-view/__test__/fixture.ts +31 -3
- package/src/compute-view/deployment-view/_types.ts +2 -1
- package/src/compute-view/deployment-view/compute.ts +4 -36
- package/src/compute-view/deployment-view/predicates/index.ts +8 -0
- package/src/compute-view/deployment-view/predicates/relation-direct.ts +125 -99
- package/src/compute-view/deployment-view/predicates/relation-in-out.ts +16 -8
- package/src/compute-view/deployment-view/predicates/relation-incoming.ts +18 -12
- package/src/compute-view/deployment-view/predicates/relation-outgoing.ts +16 -9
- package/src/compute-view/deployment-view/predicates/relation-where.ts +18 -0
- package/src/compute-view/deployment-view/predicates/utils.ts +214 -0
- package/src/compute-view/element-view/__test__/fixture.ts +17 -4
- package/src/compute-view/element-view/compute.ts +3 -2
- package/src/compute-view/element-view/predicates.ts +520 -0
- package/src/compute-view/element-view/utils.ts +11 -7
- package/src/compute-view/index.ts +1 -0
- package/src/compute-view/relationships-view/_types.ts +16 -0
- package/src/compute-view/relationships-view/compute.ts +74 -0
- package/src/compute-view/relationships-view/layout.ts +357 -0
- package/src/compute-view/relationships-view/utils.ts +40 -0
- package/src/compute-view/utils/relationExpressionToPredicates.ts +11 -4
- package/src/index.ts +16 -0
- package/src/model/DeploymentElementModel.ts +18 -1
- package/src/model/ElementModel.ts +13 -0
- package/src/model/LikeC4Model.ts +2 -2
- package/src/model/RelationModel.ts +9 -0
- package/src/model/connection/deployment/DeploymentConnectionModel.ts +11 -1
- package/src/model/guards.ts +17 -1
- package/src/model/view/LikeC4ViewModel.ts +7 -1
- package/src/model/view/NodeModel.ts +5 -0
- package/src/types/deployments.ts +1 -0
- package/src/types/expression-v2.ts +12 -0
- package/src/types/index.ts +1 -0
- package/src/types/operators.ts +46 -6
- package/src/types/view.ts +2 -2
- package/src/utils/index.ts +0 -5
- package/src/utils/iterable/unique.ts +1 -7
- package/dist/model/index.js +0 -1
- package/dist/utils/index.js +0 -347
- /package/dist/shared/{chunk-RAAYCPUM.M-JWF7SS.js → core.M-JWF7SS.mjs} +0 -0
|
@@ -1,9 +1,514 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
1
|
+
import { b as requireIterator, e as requireForeach } from './shared/core.CqCTxzMY.mjs';
|
|
2
|
+
export { D as DefaultMap, f as LikeC4DeploymentModel, L as LikeC4Model, g as LikeC4ViewModel, S as Stack, c as computeView, a as computeViews, u as unsafeComputeView } from './shared/core.CqCTxzMY.mjs';
|
|
3
|
+
import { g as getDefaultExportFromCjs } from './shared/core.BxvDITEI.mjs';
|
|
4
|
+
export { h as ancestorsFqn, j as commonAncestor, e as commonHead, k as compareByFqnHierarchically, o as compareFqnHierarchically, f as compareNatural, I as difference, J as equalsSet, y as getOrCreate, a as hasAtLeast, q as hierarchyDistance, r as hierarchyLevel, B as ifilter, i as ifind, C as iflat, D as imap, K as intersection, s as isAncestor, u as isDescendantOf, E as isIterable, z as isNonEmptyArray, c as isSameHierarchy, A as isString, F as isome, G as iunique, n as nameFromFqn, O as objectHash, p as parentFqn, v as sortByFqnHierarchically, w as sortNaturalByFqn, x as sortParentsFirst, N as stringHash, L as symmetricDifference, H as toArray, t as toSet, M as union } from './shared/core.BxvDITEI.mjs';
|
|
5
|
+
export { i as invariant, a as nonNullable, n as nonexhaustive } from './shared/core.M-JWF7SS.mjs';
|
|
6
|
+
export { A as AsFqn, B as BorderStyles, Q as ComputedNode, S as ComputedView, N as DefaultArrowType, e as DefaultElementShape, O as DefaultLineStyle, P as DefaultRelationshipColor, d as DefaultThemeColor, D as DeploymentElement, T as DiagramNode, E as ElementKind, g as ElementShapes, f as Expr, C as ExpressionV2, F as FqnExpr, G as FqnRef, R as RelationExpr, U as extractStep, V as getBBoxCenter, W as getParallelStepsPrefix, H as isAndOperator, X as isAutoLayoutDirection, h as isCustomElement, j as isCustomRelationExpr, Y as isDeploymentView, Z as isDynamicView, _ as isDynamicViewParallelSteps, k as isElement, l as isElementKindExpr, b as isElementPredicateExpr, m as isElementRef, p as isElementTagExpr, a as isElementView, q as isElementWhere, r as isExpandedElementExpr, i as isExtendsElementView, t as isInOut, s as isIncoming, I as isKindEqual, J as isNotOperator, K as isOrOperator, u as isOutgoing, v as isRelation, w as isRelationExpression, x as isRelationPredicateExpr, y as isRelationWhere, c as isScopedElementView, $ as isStepEdgeId, L as isTagEqual, a0 as isViewRuleAutoLayout, a1 as isViewRuleGlobalPredicateRef, a2 as isViewRuleGlobalStyle, a3 as isViewRuleGroup, a4 as isViewRulePredicate, a5 as isViewRuleStyle, z as isWildcard, a6 as stepEdgeId, M as whereOperatorAsPredicate } from './shared/core.DunIMHRf.mjs';
|
|
7
|
+
export { c as computeRelationshipsView } from './shared/core.m3rCQAv6.mjs';
|
|
8
|
+
export { isThemeColor } from './types/index.mjs';
|
|
9
|
+
export { compareRelations, delay, ireduce } from './utils/index.mjs';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Mnemonist Linked List
|
|
13
|
+
* ======================
|
|
14
|
+
*
|
|
15
|
+
* Singly linked list implementation. Uses raw JavaScript objects as nodes
|
|
16
|
+
* as benchmarks proved it was the fastest thing to do.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
var linkedList$1;
|
|
20
|
+
var hasRequiredLinkedList;
|
|
21
|
+
|
|
22
|
+
function requireLinkedList () {
|
|
23
|
+
if (hasRequiredLinkedList) return linkedList$1;
|
|
24
|
+
hasRequiredLinkedList = 1;
|
|
25
|
+
var Iterator = requireIterator(),
|
|
26
|
+
forEach = requireForeach();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Linked List.
|
|
30
|
+
*
|
|
31
|
+
* @constructor
|
|
32
|
+
*/
|
|
33
|
+
function LinkedList() {
|
|
34
|
+
this.clear();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Method used to clear the list.
|
|
39
|
+
*
|
|
40
|
+
* @return {undefined}
|
|
41
|
+
*/
|
|
42
|
+
LinkedList.prototype.clear = function() {
|
|
43
|
+
|
|
44
|
+
// Properties
|
|
45
|
+
this.head = null;
|
|
46
|
+
this.tail = null;
|
|
47
|
+
this.size = 0;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Method used to get the first item of the list.
|
|
52
|
+
*
|
|
53
|
+
* @return {any}
|
|
54
|
+
*/
|
|
55
|
+
LinkedList.prototype.first = function() {
|
|
56
|
+
return this.head ? this.head.item : undefined;
|
|
57
|
+
};
|
|
58
|
+
LinkedList.prototype.peek = LinkedList.prototype.first;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Method used to get the last item of the list.
|
|
62
|
+
*
|
|
63
|
+
* @return {any}
|
|
64
|
+
*/
|
|
65
|
+
LinkedList.prototype.last = function() {
|
|
66
|
+
return this.tail ? this.tail.item : undefined;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Method used to add an item at the end of the list.
|
|
71
|
+
*
|
|
72
|
+
* @param {any} item - The item to add.
|
|
73
|
+
* @return {number}
|
|
74
|
+
*/
|
|
75
|
+
LinkedList.prototype.push = function(item) {
|
|
76
|
+
var node = {item: item, next: null};
|
|
77
|
+
|
|
78
|
+
if (!this.head) {
|
|
79
|
+
this.head = node;
|
|
80
|
+
this.tail = node;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
this.tail.next = node;
|
|
84
|
+
this.tail = node;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
this.size++;
|
|
88
|
+
|
|
89
|
+
return this.size;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Method used to add an item at the beginning of the list.
|
|
94
|
+
*
|
|
95
|
+
* @param {any} item - The item to add.
|
|
96
|
+
* @return {number}
|
|
97
|
+
*/
|
|
98
|
+
LinkedList.prototype.unshift = function(item) {
|
|
99
|
+
var node = {item: item, next: null};
|
|
100
|
+
|
|
101
|
+
if (!this.head) {
|
|
102
|
+
this.head = node;
|
|
103
|
+
this.tail = node;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
if (!this.head.next)
|
|
107
|
+
this.tail = this.head;
|
|
108
|
+
node.next = this.head;
|
|
109
|
+
this.head = node;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
this.size++;
|
|
113
|
+
|
|
114
|
+
return this.size;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Method used to retrieve & remove the first item of the list.
|
|
119
|
+
*
|
|
120
|
+
* @return {any}
|
|
121
|
+
*/
|
|
122
|
+
LinkedList.prototype.shift = function() {
|
|
123
|
+
if (!this.size)
|
|
124
|
+
return undefined;
|
|
125
|
+
|
|
126
|
+
var node = this.head;
|
|
127
|
+
|
|
128
|
+
this.head = node.next;
|
|
129
|
+
this.size--;
|
|
130
|
+
|
|
131
|
+
return node.item;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Method used to iterate over the list.
|
|
136
|
+
*
|
|
137
|
+
* @param {function} callback - Function to call for each item.
|
|
138
|
+
* @param {object} scope - Optional scope.
|
|
139
|
+
* @return {undefined}
|
|
140
|
+
*/
|
|
141
|
+
LinkedList.prototype.forEach = function(callback, scope) {
|
|
142
|
+
if (!this.size)
|
|
143
|
+
return;
|
|
144
|
+
|
|
145
|
+
scope = arguments.length > 1 ? scope : this;
|
|
146
|
+
|
|
147
|
+
var n = this.head,
|
|
148
|
+
i = 0;
|
|
149
|
+
|
|
150
|
+
while (n) {
|
|
151
|
+
callback.call(scope, n.item, i, this);
|
|
152
|
+
n = n.next;
|
|
153
|
+
i++;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Method used to convert the list into an array.
|
|
159
|
+
*
|
|
160
|
+
* @return {array}
|
|
161
|
+
*/
|
|
162
|
+
LinkedList.prototype.toArray = function() {
|
|
163
|
+
if (!this.size)
|
|
164
|
+
return [];
|
|
165
|
+
|
|
166
|
+
var array = new Array(this.size);
|
|
167
|
+
|
|
168
|
+
for (var i = 0, l = this.size, n = this.head; i < l; i++) {
|
|
169
|
+
array[i] = n.item;
|
|
170
|
+
n = n.next;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return array;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Method used to create an iterator over a list's values.
|
|
178
|
+
*
|
|
179
|
+
* @return {Iterator}
|
|
180
|
+
*/
|
|
181
|
+
LinkedList.prototype.values = function() {
|
|
182
|
+
var n = this.head;
|
|
183
|
+
|
|
184
|
+
return new Iterator(function() {
|
|
185
|
+
if (!n)
|
|
186
|
+
return {
|
|
187
|
+
done: true
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
var value = n.item;
|
|
191
|
+
n = n.next;
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
value: value,
|
|
195
|
+
done: false
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Method used to create an iterator over a list's entries.
|
|
202
|
+
*
|
|
203
|
+
* @return {Iterator}
|
|
204
|
+
*/
|
|
205
|
+
LinkedList.prototype.entries = function() {
|
|
206
|
+
var n = this.head,
|
|
207
|
+
i = 0;
|
|
208
|
+
|
|
209
|
+
return new Iterator(function() {
|
|
210
|
+
if (!n)
|
|
211
|
+
return {
|
|
212
|
+
done: true
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
var value = n.item;
|
|
216
|
+
n = n.next;
|
|
217
|
+
i++;
|
|
218
|
+
|
|
219
|
+
return {
|
|
220
|
+
value: [i - 1, value],
|
|
221
|
+
done: false
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Attaching the #.values method to Symbol.iterator if possible.
|
|
228
|
+
*/
|
|
229
|
+
if (typeof Symbol !== 'undefined')
|
|
230
|
+
LinkedList.prototype[Symbol.iterator] = LinkedList.prototype.values;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Convenience known methods.
|
|
234
|
+
*/
|
|
235
|
+
LinkedList.prototype.toString = function() {
|
|
236
|
+
return this.toArray().join(',');
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
LinkedList.prototype.toJSON = function() {
|
|
240
|
+
return this.toArray();
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
LinkedList.prototype.inspect = function() {
|
|
244
|
+
var array = this.toArray();
|
|
245
|
+
|
|
246
|
+
// Trick so that node displays the name of the constructor
|
|
247
|
+
Object.defineProperty(array, 'constructor', {
|
|
248
|
+
value: LinkedList,
|
|
249
|
+
enumerable: false
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
return array;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
if (typeof Symbol !== 'undefined')
|
|
256
|
+
LinkedList.prototype[Symbol.for('nodejs.util.inspect.custom')] = LinkedList.prototype.inspect;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Static @.from function taking an arbitrary iterable & converting it into
|
|
260
|
+
* a list.
|
|
261
|
+
*
|
|
262
|
+
* @param {Iterable} iterable - Target iterable.
|
|
263
|
+
* @return {LinkedList}
|
|
264
|
+
*/
|
|
265
|
+
LinkedList.from = function(iterable) {
|
|
266
|
+
var list = new LinkedList();
|
|
267
|
+
|
|
268
|
+
forEach(iterable, function(value) {
|
|
269
|
+
list.push(value);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
return list;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Exporting.
|
|
277
|
+
*/
|
|
278
|
+
linkedList$1 = LinkedList;
|
|
279
|
+
return linkedList$1;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
var linkedListExports = requireLinkedList();
|
|
283
|
+
const linkedList = /*@__PURE__*/getDefaultExportFromCjs(linkedListExports);
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Mnemonist Queue
|
|
287
|
+
* ================
|
|
288
|
+
*
|
|
289
|
+
* Queue implementation based on the ideas of Queue.js that seems to beat
|
|
290
|
+
* a LinkedList one in performance.
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
var queue$1;
|
|
294
|
+
var hasRequiredQueue;
|
|
295
|
+
|
|
296
|
+
function requireQueue () {
|
|
297
|
+
if (hasRequiredQueue) return queue$1;
|
|
298
|
+
hasRequiredQueue = 1;
|
|
299
|
+
var Iterator = requireIterator(),
|
|
300
|
+
forEach = requireForeach();
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Queue
|
|
304
|
+
*
|
|
305
|
+
* @constructor
|
|
306
|
+
*/
|
|
307
|
+
function Queue() {
|
|
308
|
+
this.clear();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Method used to clear the queue.
|
|
313
|
+
*
|
|
314
|
+
* @return {undefined}
|
|
315
|
+
*/
|
|
316
|
+
Queue.prototype.clear = function() {
|
|
317
|
+
|
|
318
|
+
// Properties
|
|
319
|
+
this.items = [];
|
|
320
|
+
this.offset = 0;
|
|
321
|
+
this.size = 0;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Method used to add an item to the queue.
|
|
326
|
+
*
|
|
327
|
+
* @param {any} item - Item to enqueue.
|
|
328
|
+
* @return {number}
|
|
329
|
+
*/
|
|
330
|
+
Queue.prototype.enqueue = function(item) {
|
|
331
|
+
|
|
332
|
+
this.items.push(item);
|
|
333
|
+
return ++this.size;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Method used to retrieve & remove the first item of the queue.
|
|
338
|
+
*
|
|
339
|
+
* @return {any}
|
|
340
|
+
*/
|
|
341
|
+
Queue.prototype.dequeue = function() {
|
|
342
|
+
if (!this.size)
|
|
343
|
+
return;
|
|
344
|
+
|
|
345
|
+
var item = this.items[this.offset];
|
|
346
|
+
|
|
347
|
+
if (++this.offset * 2 >= this.items.length) {
|
|
348
|
+
this.items = this.items.slice(this.offset);
|
|
349
|
+
this.offset = 0;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
this.size--;
|
|
353
|
+
|
|
354
|
+
return item;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Method used to retrieve the first item of the queue.
|
|
359
|
+
*
|
|
360
|
+
* @return {any}
|
|
361
|
+
*/
|
|
362
|
+
Queue.prototype.peek = function() {
|
|
363
|
+
if (!this.size)
|
|
364
|
+
return;
|
|
365
|
+
|
|
366
|
+
return this.items[this.offset];
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Method used to iterate over the queue.
|
|
371
|
+
*
|
|
372
|
+
* @param {function} callback - Function to call for each item.
|
|
373
|
+
* @param {object} scope - Optional scope.
|
|
374
|
+
* @return {undefined}
|
|
375
|
+
*/
|
|
376
|
+
Queue.prototype.forEach = function(callback, scope) {
|
|
377
|
+
scope = arguments.length > 1 ? scope : this;
|
|
378
|
+
|
|
379
|
+
for (var i = this.offset, j = 0, l = this.items.length; i < l; i++, j++)
|
|
380
|
+
callback.call(scope, this.items[i], j, this);
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
/*
|
|
384
|
+
* Method used to convert the queue to a JavaScript array.
|
|
385
|
+
*
|
|
386
|
+
* @return {array}
|
|
387
|
+
*/
|
|
388
|
+
Queue.prototype.toArray = function() {
|
|
389
|
+
return this.items.slice(this.offset);
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Method used to create an iterator over a queue's values.
|
|
394
|
+
*
|
|
395
|
+
* @return {Iterator}
|
|
396
|
+
*/
|
|
397
|
+
Queue.prototype.values = function() {
|
|
398
|
+
var items = this.items,
|
|
399
|
+
i = this.offset;
|
|
400
|
+
|
|
401
|
+
return new Iterator(function() {
|
|
402
|
+
if (i >= items.length)
|
|
403
|
+
return {
|
|
404
|
+
done: true
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
var value = items[i];
|
|
408
|
+
i++;
|
|
409
|
+
|
|
410
|
+
return {
|
|
411
|
+
value: value,
|
|
412
|
+
done: false
|
|
413
|
+
};
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Method used to create an iterator over a queue's entries.
|
|
419
|
+
*
|
|
420
|
+
* @return {Iterator}
|
|
421
|
+
*/
|
|
422
|
+
Queue.prototype.entries = function() {
|
|
423
|
+
var items = this.items,
|
|
424
|
+
i = this.offset,
|
|
425
|
+
j = 0;
|
|
426
|
+
|
|
427
|
+
return new Iterator(function() {
|
|
428
|
+
if (i >= items.length)
|
|
429
|
+
return {
|
|
430
|
+
done: true
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
var value = items[i];
|
|
434
|
+
i++;
|
|
435
|
+
|
|
436
|
+
return {
|
|
437
|
+
value: [j++, value],
|
|
438
|
+
done: false
|
|
439
|
+
};
|
|
440
|
+
});
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Attaching the #.values method to Symbol.iterator if possible.
|
|
445
|
+
*/
|
|
446
|
+
if (typeof Symbol !== 'undefined')
|
|
447
|
+
Queue.prototype[Symbol.iterator] = Queue.prototype.values;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Convenience known methods.
|
|
451
|
+
*/
|
|
452
|
+
Queue.prototype.toString = function() {
|
|
453
|
+
return this.toArray().join(',');
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
Queue.prototype.toJSON = function() {
|
|
457
|
+
return this.toArray();
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
Queue.prototype.inspect = function() {
|
|
461
|
+
var array = this.toArray();
|
|
462
|
+
|
|
463
|
+
// Trick so that node displays the name of the constructor
|
|
464
|
+
Object.defineProperty(array, 'constructor', {
|
|
465
|
+
value: Queue,
|
|
466
|
+
enumerable: false
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
return array;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
if (typeof Symbol !== 'undefined')
|
|
473
|
+
Queue.prototype[Symbol.for('nodejs.util.inspect.custom')] = Queue.prototype.inspect;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Static @.from function taking an arbitrary iterable & converting it into
|
|
477
|
+
* a queue.
|
|
478
|
+
*
|
|
479
|
+
* @param {Iterable} iterable - Target iterable.
|
|
480
|
+
* @return {Queue}
|
|
481
|
+
*/
|
|
482
|
+
Queue.from = function(iterable) {
|
|
483
|
+
var queue = new Queue();
|
|
484
|
+
|
|
485
|
+
forEach(iterable, function(value) {
|
|
486
|
+
queue.enqueue(value);
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
return queue;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Static @.of function taking an arbitrary number of arguments & converting it
|
|
494
|
+
* into a queue.
|
|
495
|
+
*
|
|
496
|
+
* @param {...any} args
|
|
497
|
+
* @return {Queue}
|
|
498
|
+
*/
|
|
499
|
+
Queue.of = function() {
|
|
500
|
+
return Queue.from(arguments);
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Exporting.
|
|
505
|
+
*/
|
|
506
|
+
queue$1 = Queue;
|
|
507
|
+
return queue$1;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
var queueExports = requireQueue();
|
|
511
|
+
const queue = /*@__PURE__*/getDefaultExportFromCjs(queueExports);
|
|
7
512
|
|
|
8
513
|
const { min: min$4, max: max$4 } = Math;
|
|
9
514
|
|
|
@@ -3669,4 +4174,4 @@ function computeColorValues(color) {
|
|
|
3669
4174
|
}
|
|
3670
4175
|
}
|
|
3671
4176
|
|
|
3672
|
-
export { ElementColors, RelationshipColors, computeColorValues, defaultTheme };
|
|
4177
|
+
export { ElementColors, linkedList as LinkedList, queue as Queue, RelationshipColors, computeColorValues, defaultTheme };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const model_index = require('../shared/core.BGus30EM.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "Connection", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return model_index.Connection; }
|
|
10
|
+
});
|
|
11
|
+
exports.ConnectionModel = model_index.ConnectionModel;
|
|
12
|
+
exports.DeployedInstanceModel = model_index.DeployedInstanceModel;
|
|
13
|
+
exports.DeploymentConnectionModel = model_index.DeploymentConnectionModel;
|
|
14
|
+
exports.DeploymentNodeModel = model_index.DeploymentNodeModel;
|
|
15
|
+
exports.DeploymentRelationModel = model_index.DeploymentRelationModel;
|
|
16
|
+
exports.EdgeModel = model_index.EdgeModel;
|
|
17
|
+
exports.ElementModel = model_index.ElementModel;
|
|
18
|
+
exports.LikeC4DeploymentModel = model_index.LikeC4DeploymentModel;
|
|
19
|
+
exports.LikeC4Model = model_index.LikeC4Model;
|
|
20
|
+
exports.LikeC4ViewModel = model_index.LikeC4ViewModel;
|
|
21
|
+
exports.NodeModel = model_index.NodeModel;
|
|
22
|
+
exports.RelationshipModel = model_index.RelationshipModel;
|
|
23
|
+
exports.deploymentConnection = model_index.find;
|
|
24
|
+
exports.differenceConnections = model_index.differenceConnections;
|
|
25
|
+
exports.findAscendingConnections = model_index.findAscendingConnections;
|
|
26
|
+
exports.findDeepestNestedConnection = model_index.findDeepestNestedConnection;
|
|
27
|
+
exports.findDescendantConnections = model_index.findDescendantConnections;
|
|
28
|
+
exports.hasSameSource = model_index.hasSameSource;
|
|
29
|
+
exports.hasSameSourceTarget = model_index.hasSameSourceTarget;
|
|
30
|
+
exports.hasSameTarget = model_index.hasSameTarget;
|
|
31
|
+
exports.isAnyInOut = model_index.isAnyInOut;
|
|
32
|
+
exports.isDeployedInstance = model_index.isDeployedInstance;
|
|
33
|
+
exports.isDeploymentNode = model_index.isDeploymentNode;
|
|
34
|
+
exports.isIncoming = model_index.isIncoming;
|
|
35
|
+
exports.isNestedConnection = model_index.isNestedConnection;
|
|
36
|
+
exports.isOutgoing = model_index.isOutgoing;
|
|
37
|
+
exports.mergeConnections = model_index.mergeConnections;
|
|
38
|
+
exports.modelConnection = model_index.find$1;
|
|
39
|
+
exports.sortConnectionsByBoundaryHierarchy = model_index.sortConnectionsByBoundaryHierarchy;
|
|
40
|
+
exports.sortDeepestFirst = model_index.sortDeepestFirst;
|