@woosh/meep-engine 2.99.0 → 2.99.2
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/build/meep.cjs +16 -3
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +16 -3
- package/package.json +1 -1
- package/src/core/collection/array/isArrayEqual.d.ts +1 -0
- package/src/core/collection/array/isArrayEqual.d.ts.map +1 -1
- package/src/core/collection/array/isArrayEqual.js +11 -3
- package/src/core/collection/list/List.d.ts.map +1 -1
- package/src/core/collection/list/List.js +12 -1
- package/src/core/collection/list/List.spec.js +7 -0
- package/src/core/events/signal/Signal.d.ts +5 -2
- package/src/core/events/signal/Signal.d.ts.map +1 -1
- package/src/core/events/signal/Signal.js +1 -0
- package/src/core/events/signal/Signal.spec.js +88 -0
- package/src/core/model/node-graph/NodeGraph.d.ts +8 -4
- package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
- package/src/core/model/node-graph/NodeGraph.js +19 -1
- package/src/core/model/node-graph/node/NodeDescription.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeDescription.js +13 -4
- package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstance.js +3 -3
package/build/meep.module.js
CHANGED
|
@@ -1148,6 +1148,7 @@ class Signal {
|
|
|
1148
1148
|
* Please note that this will remove even all handlers, irrespective of where they were added from. If another script is attaching to the same signal, using this method will potentially break that code.
|
|
1149
1149
|
* For most use cases, prefer to use {@link remove} method instead, or make use of {@link SignalBinding} if you need to keep track of multiple handlers
|
|
1150
1150
|
* NOTE: Consider this method to be unsafe, only use it when you understand the implications
|
|
1151
|
+
* @deprecated
|
|
1151
1152
|
*/
|
|
1152
1153
|
removeAll() {
|
|
1153
1154
|
const handlers = this.handlers;
|
|
@@ -61689,6 +61690,17 @@ class List {
|
|
|
61689
61690
|
return new List(this.data);
|
|
61690
61691
|
}
|
|
61691
61692
|
|
|
61693
|
+
/**
|
|
61694
|
+
* Returns a shallow copy array with elements in range from start to end (end not included)
|
|
61695
|
+
* Same as {@link Array.prototype.slice}
|
|
61696
|
+
* @param {number} [start]
|
|
61697
|
+
* @param {number} [end]
|
|
61698
|
+
* @return {T[]}
|
|
61699
|
+
*/
|
|
61700
|
+
slice(start, end) {
|
|
61701
|
+
return this.data.slice(start, end);
|
|
61702
|
+
}
|
|
61703
|
+
|
|
61692
61704
|
/**
|
|
61693
61705
|
*
|
|
61694
61706
|
* @param {function(element:T):boolean} condition
|
|
@@ -97289,6 +97301,7 @@ ObjectPoolFactory.prototype.release = function (object) {
|
|
|
97289
97301
|
};
|
|
97290
97302
|
|
|
97291
97303
|
/**
|
|
97304
|
+
* Will invoke A.equals(B) on members if such exists
|
|
97292
97305
|
* @template T,R
|
|
97293
97306
|
* @param {T[]} first
|
|
97294
97307
|
* @param {R[]} second
|
|
@@ -97316,16 +97329,16 @@ function isArrayEqual(first, second) {
|
|
|
97316
97329
|
|
|
97317
97330
|
|
|
97318
97331
|
if (a === undefined) {
|
|
97319
|
-
//
|
|
97332
|
+
// A is undefined, and B is something else
|
|
97320
97333
|
return false;
|
|
97321
97334
|
}
|
|
97322
97335
|
|
|
97323
97336
|
if (a === null) {
|
|
97324
|
-
//
|
|
97337
|
+
// A is null and B is something else
|
|
97325
97338
|
return false;
|
|
97326
97339
|
}
|
|
97327
97340
|
|
|
97328
|
-
//try "equals" method
|
|
97341
|
+
// try "equals" method
|
|
97329
97342
|
if (typeof a.equals === "function") {
|
|
97330
97343
|
|
|
97331
97344
|
if (!a.equals(b)) {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isArrayEqual.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/isArrayEqual.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isArrayEqual.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/isArrayEqual.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,6DAFY,OAAO,CAqDlB"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
4
|
+
* Will invoke A.equals(B) on members if such exists
|
|
2
5
|
* @template T,R
|
|
3
6
|
* @param {T[]} first
|
|
4
7
|
* @param {R[]} second
|
|
5
8
|
* @return {boolean}
|
|
6
9
|
*/
|
|
7
10
|
export function isArrayEqual(first, second) {
|
|
11
|
+
assert.defined(first, 'first');
|
|
12
|
+
assert.isArray(first, 'first');
|
|
13
|
+
|
|
14
|
+
assert.defined(second, 'second');
|
|
15
|
+
assert.isArray(second, 'second');
|
|
8
16
|
|
|
9
17
|
const il = first.length;
|
|
10
18
|
|
|
@@ -26,16 +34,16 @@ export function isArrayEqual(first, second) {
|
|
|
26
34
|
|
|
27
35
|
|
|
28
36
|
if (a === undefined) {
|
|
29
|
-
//
|
|
37
|
+
// A is undefined, and B is something else
|
|
30
38
|
return false;
|
|
31
39
|
}
|
|
32
40
|
|
|
33
41
|
if (a === null) {
|
|
34
|
-
//
|
|
42
|
+
// A is null and B is something else
|
|
35
43
|
return false;
|
|
36
44
|
}
|
|
37
45
|
|
|
38
|
-
//try "equals" method
|
|
46
|
+
// try "equals" method
|
|
39
47
|
if (typeof a.equals === "function") {
|
|
40
48
|
|
|
41
49
|
if (!a.equals(b)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/list/List.js"],"names":[],"mappings":";AAaA;;;;GAIG;AACH;IAeI;;;OAGG;IACH,oBAHW,CAAC,EAAE,EAeb;IA9BD;;OAEG;IACH;QACI;;WAEG;eADO,OAAO,CAAC,EAAC,MAAM,CAAC;QAG1B;;WAEG;iBADO,OAAO,CAAC,EAAC,MAAM,CAAC;MAG5B;IAQE;;OAEG;IACH,MAFU,CAAC,EAAE,CAEuC;IAEpD;;;OAGG;IACH,QAFU,MAAM,CAEc;IAGlC;;;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;;OAIG;IACH,qBAHW,CAAC,EAAE,GACD,OAAO,CAanB;IAED;;;OAGG;IACH,WAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,YAHW,CAAC,GACC,MAAM,CAIlB;IAED;;;;;OAKG;IACH,wBAJoB,CAAC,4BAkBpB;IAED;;;;OAIG;IACH,qDAoBC;IAED,cAyBC;IAED;;;;;OAKG;IACH,gBAJW,KAAK,CAAC,CAAC,kDAuCjB;IAED;;;OAGG;IACH,YAFW,KAAK,CAAC,CAAC,GAAC,CAAC,EAAE,QAarB;IAED;;;OAGG;IACH,WAFa,CAAC,EAAE,CAIf;IAED,cAEC;IAED;;;;OAIG;IACH,oDAcC;IAED;;;OAGG;IACH,2CAcC;IAED;;;;OAIG;IACH,+DAaC;IAED;;;;OAIG;IACH,qEAIC;IAED;;;;OAIG;IACH,wEAQC;IAED;;;;OAIG;IACH,gEAFuB,CAAC,QAWvB;IAED;;;OAGG;IACH,QAFa,MAAM,CAclB;IAED;;;OAGG;IACH,SAFa,CAAC,GAAC,SAAS,CAIvB;IAED;;;OAGG;IACH,QAFY,CAAC,GAAC,SAAS,CAItB;IAED;;;OAGG;IACH,kCA8BC;IAED;;;;OAIG;IACH,eAHW,KAAK,CAAC,CAAC,GACL,MAAM,CA0BlB;CACJ;
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/list/List.js"],"names":[],"mappings":";AAaA;;;;GAIG;AACH;IAeI;;;OAGG;IACH,oBAHW,CAAC,EAAE,EAeb;IA9BD;;OAEG;IACH;QACI;;WAEG;eADO,OAAO,CAAC,EAAC,MAAM,CAAC;QAG1B;;WAEG;iBADO,OAAO,CAAC,EAAC,MAAM,CAAC;MAG5B;IAQE;;OAEG;IACH,MAFU,CAAC,EAAE,CAEuC;IAEpD;;;OAGG;IACH,QAFU,MAAM,CAEc;IAGlC;;;;OAIG;IACH,WAHW,MAAM,GACJ,CAAC,GAAC,SAAS,CAOvB;IAED;;;;OAIG;IAC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G;IACH,qBAHW,CAAC,EAAE,GACD,OAAO,CAanB;IAED;;;OAGG;IACH,WAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,YAHW,CAAC,GACC,MAAM,CAIlB;IAED;;;;;OAKG;IACH,wBAJoB,CAAC,4BAkBpB;IAED;;;;OAIG;IACH,qDAoBC;IAED,cAyBC;IAED;;;;;OAKG;IACH,gBAJW,KAAK,CAAC,CAAC,kDAuCjB;IAED;;;OAGG;IACH,YAFW,KAAK,CAAC,CAAC,GAAC,CAAC,EAAE,QAarB;IAED;;;OAGG;IACH,WAFa,CAAC,EAAE,CAIf;IAED,cAEC;IAED;;;;OAIG;IACH,oDAcC;IAED;;;OAGG;IACH,2CAcC;IAED;;;;OAIG;IACH,+DAaC;IAED;;;;OAIG;IACH,qEAIC;IAED;;;;OAIG;IACH,wEAQC;IAED;;;;OAIG;IACH,gEAFuB,CAAC,QAWvB;IAED;;;OAGG;IACH,QAFa,MAAM,CAclB;IAED;;;OAGG;IACH,SAFa,CAAC,GAAC,SAAS,CAIvB;IAED;;;OAGG;IACH,QAFY,CAAC,GAAC,SAAS,CAItB;IAED;;;OAGG;IACH,kCA8BC;IAED;;;;OAIG;IACH,eAHW,KAAK,CAAC,CAAC,GACL,MAAM,CA0BlB;CACJ;mBAn8BkB,+BAA+B"}
|
|
@@ -32,7 +32,7 @@ class List {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* @param {T
|
|
35
|
+
* @param {Array.<T>} [array]
|
|
36
36
|
* @constructor
|
|
37
37
|
*/
|
|
38
38
|
constructor(array) {
|
|
@@ -405,6 +405,17 @@ class List {
|
|
|
405
405
|
return new List(this.data);
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
+
/**
|
|
409
|
+
* Returns a shallow copy array with elements in range from start to end (end not included)
|
|
410
|
+
* Same as {@link Array.prototype.slice}
|
|
411
|
+
* @param {number} [start]
|
|
412
|
+
* @param {number} [end]
|
|
413
|
+
* @return {T[]}
|
|
414
|
+
*/
|
|
415
|
+
slice(start, end) {
|
|
416
|
+
return this.data.slice(start, end);
|
|
417
|
+
}
|
|
418
|
+
|
|
408
419
|
/**
|
|
409
420
|
*
|
|
410
421
|
* @param {function(element:T):boolean} condition
|
|
@@ -327,4 +327,11 @@ test("deepCopy", () => {
|
|
|
327
327
|
expect(a.first()).toBeDefined();
|
|
328
328
|
expect(a.first().v).toBe(7);
|
|
329
329
|
expect(a.first()).not.toBe(v);
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
test("slice", () => {
|
|
333
|
+
|
|
334
|
+
expect(new List([1, 2, 3, 4]).slice(1, 3)).toEqual([2, 3]);
|
|
335
|
+
expect(new List([3, 7, 11]).slice()).toEqual([3, 7, 11]);
|
|
336
|
+
|
|
330
337
|
});
|
|
@@ -39,14 +39,17 @@ export default class Signal<A = any, B = any, C = any, D = any, E = any, F = any
|
|
|
39
39
|
|
|
40
40
|
send4(a: A, b: B, c: C, d: D): void
|
|
41
41
|
|
|
42
|
-
send5(a: A, b: B, c: C, d: D, e: E): void
|
|
43
|
-
|
|
44
42
|
send6(a: A, b: B, c: C, d: D, e: E, f: F): void
|
|
45
43
|
|
|
44
|
+
send8(a: A, b: B, c: C, d: D, e: E, f: F, g: G, h: H): void
|
|
45
|
+
|
|
46
46
|
/**
|
|
47
47
|
* @deprecated use strongly typed dispatch methods instead (send0, send1 etc)
|
|
48
48
|
*/
|
|
49
49
|
dispatch(...params: any[]): void
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated
|
|
53
|
+
*/
|
|
51
54
|
removeAll(): void
|
|
52
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Signal.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/Signal.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Signal.d.ts","sourceRoot":"","sources":["../../../../../src/core/events/signal/Signal.js"],"names":[],"mappings":"AAulBA;;;;;;GAMG;AACH,yDALW,aAAa,EAAE,+BAGb,MAAM,CAoBlB;AAED;;;;;;GAMG;AACH,mEALW,aAAa,EAAE,0BAGb,MAAM,CAclB;AAiDD;;;;GAIG;AACH,2CAHW,aAAa,EAAE,sBA8BzB;AAnsBD;;;;GAIG;AACH;IACI;;;OAGG;IACH,iBAAc;IAEd;;;;OAIG;IACH,cAAU;IAWV;;;OAGG;IACH,yBAEC;IAfD;;;OAGG;IACH,sBAEC;IAYD;;;;OAIG;IACH,cAHW,MAAM;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;KAAY,SAClB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM;;KAAY,GAChB,OAAO,CAInB;IAGD;;;;;OAKG;IACH,4CAFa,OAAO,CAQnB;IAED,aAEC;IAED,eAEC;IAED;;;OAGG;IACH,eAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,yCAQC;IAED;;;;OAIG;IACH,sCAYC;IAED;;;;;OAKG;IACH,oCAFa,OAAO,CAUnB;IAED;;;;;;OAMG;IACH,kBAGC;IAED;;;OAGG;IACH,+BAQC;IAED;;;OAGG;IACH,cA4CC;IAED;;;;OAIG;IACH,sBA6CC;IAED;;;;OAIG;IACH,4BA4CC;IAED;;;;;OAKG;IACH,oCA4CC;IAED;;;;;;OAMG;IACH,4CA4CC;IAED;;;;;;;;OAQG;IACH,4DA4CC;IAED;;;;;;;;;;OAUG;IACH,4EA4CC;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,MAAM,CAalB;IAIL;;;OAGG;IACH,mBAFU,OAAO,CAEQ;CAPxB;;8BArkBiD,oBAAoB"}
|
|
@@ -180,6 +180,7 @@ export class Signal {
|
|
|
180
180
|
* Please note that this will remove even all handlers, irrespective of where they were added from. If another script is attaching to the same signal, using this method will potentially break that code.
|
|
181
181
|
* For most use cases, prefer to use {@link remove} method instead, or make use of {@link SignalBinding} if you need to keep track of multiple handlers
|
|
182
182
|
* NOTE: Consider this method to be unsafe, only use it when you understand the implications
|
|
183
|
+
* @deprecated
|
|
183
184
|
*/
|
|
184
185
|
removeAll() {
|
|
185
186
|
const handlers = this.handlers;
|
|
@@ -163,3 +163,91 @@ test("handlers should be executed in the order in which they are added", () => {
|
|
|
163
163
|
|
|
164
164
|
expect(marks).toEqual([1, 2]);
|
|
165
165
|
});
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
test("send0", () => {
|
|
169
|
+
|
|
170
|
+
function handler() {
|
|
171
|
+
|
|
172
|
+
expect(arguments.length).toEqual(0);
|
|
173
|
+
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const signal = new Signal();
|
|
177
|
+
|
|
178
|
+
signal.add(handler);
|
|
179
|
+
|
|
180
|
+
signal.send0();
|
|
181
|
+
});
|
|
182
|
+
test("send1", () => {
|
|
183
|
+
|
|
184
|
+
const call_param_list = [];
|
|
185
|
+
|
|
186
|
+
const signal = new Signal();
|
|
187
|
+
|
|
188
|
+
signal.add(Array.prototype.push, call_param_list);
|
|
189
|
+
|
|
190
|
+
signal.send1(7);
|
|
191
|
+
|
|
192
|
+
expect(call_param_list).toEqual([7]);
|
|
193
|
+
});
|
|
194
|
+
test("send2", () => {
|
|
195
|
+
|
|
196
|
+
const call_param_list = [];
|
|
197
|
+
|
|
198
|
+
const signal = new Signal();
|
|
199
|
+
|
|
200
|
+
signal.add(Array.prototype.push, call_param_list);
|
|
201
|
+
|
|
202
|
+
signal.send2(3, 7);
|
|
203
|
+
|
|
204
|
+
expect(call_param_list).toEqual([3, 7]);
|
|
205
|
+
});
|
|
206
|
+
test("send3", () => {
|
|
207
|
+
|
|
208
|
+
const call_param_list = [];
|
|
209
|
+
|
|
210
|
+
const signal = new Signal();
|
|
211
|
+
|
|
212
|
+
signal.add(Array.prototype.push, call_param_list);
|
|
213
|
+
|
|
214
|
+
signal.send3(3, 7, 11);
|
|
215
|
+
|
|
216
|
+
expect(call_param_list).toEqual([3, 7, 11]);
|
|
217
|
+
});
|
|
218
|
+
test("send4", () => {
|
|
219
|
+
|
|
220
|
+
const call_param_list = [];
|
|
221
|
+
|
|
222
|
+
const signal = new Signal();
|
|
223
|
+
|
|
224
|
+
signal.add(Array.prototype.push, call_param_list);
|
|
225
|
+
|
|
226
|
+
signal.send4(3, 7, 11, 13);
|
|
227
|
+
|
|
228
|
+
expect(call_param_list).toEqual([3, 7, 11, 13]);
|
|
229
|
+
});
|
|
230
|
+
test("send6", () => {
|
|
231
|
+
|
|
232
|
+
const call_param_list = [];
|
|
233
|
+
|
|
234
|
+
const signal = new Signal();
|
|
235
|
+
|
|
236
|
+
signal.add(Array.prototype.push, call_param_list);
|
|
237
|
+
|
|
238
|
+
signal.send6(3, 7, 11, 13, 17, 23);
|
|
239
|
+
|
|
240
|
+
expect(call_param_list).toEqual([3, 7, 11, 13, 17, 23]);
|
|
241
|
+
});
|
|
242
|
+
test("send8", () => {
|
|
243
|
+
|
|
244
|
+
const call_param_list = [];
|
|
245
|
+
|
|
246
|
+
const signal = new Signal();
|
|
247
|
+
|
|
248
|
+
signal.add(Array.prototype.push, call_param_list);
|
|
249
|
+
|
|
250
|
+
signal.send8(3, 7, 11, 13, 17, 23, 31, 37);
|
|
251
|
+
|
|
252
|
+
expect(call_param_list).toEqual([3, 7, 11, 13, 17, 23, 31, 37]);
|
|
253
|
+
});
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
export class NodeGraph {
|
|
2
2
|
/**
|
|
3
3
|
* @private
|
|
4
|
+
* @readonly
|
|
4
5
|
* @type {List<NodeInstance>}
|
|
5
6
|
*/
|
|
6
|
-
private nodes;
|
|
7
|
+
private readonly nodes;
|
|
7
8
|
/**
|
|
8
9
|
* @private
|
|
10
|
+
* @readonly
|
|
9
11
|
* @type {List<Connection>}
|
|
10
12
|
*/
|
|
11
|
-
private connections;
|
|
13
|
+
private readonly connections;
|
|
12
14
|
/**
|
|
13
15
|
*
|
|
14
16
|
* @type {IdPool}
|
|
17
|
+
* @readonly
|
|
15
18
|
* @private
|
|
16
19
|
*/
|
|
17
|
-
private __idpNodes;
|
|
20
|
+
private readonly __idpNodes;
|
|
18
21
|
/**
|
|
19
22
|
*
|
|
20
23
|
* @type {IdPool}
|
|
24
|
+
* @readonly
|
|
21
25
|
* @private
|
|
22
26
|
*/
|
|
23
|
-
private __idpConnections;
|
|
27
|
+
private readonly __idpConnections;
|
|
24
28
|
/**
|
|
25
29
|
* @readonly
|
|
26
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/NodeGraph.js"],"names":[],"mappings":"AASA;IAEI
|
|
1
|
+
{"version":3,"file":"NodeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/NodeGraph.js"],"names":[],"mappings":"AASA;IAEI;;;;OAIG;IACH,uBAAmB;IAEnB;;;;OAIG;IACH,6BAAyB;IAEzB;;;;;OAKG;IACH,4BAA0B;IAE1B;;;;;OAKG;IACH,kCAAgC;IAEhC;;OAEG;IACH;QACI;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;MAEL;IAEF;;OAEG;IACH,cAMC;IAED;;;OAGG;IACH,YAFW,SAAS,QAYnB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;;;OAMG;IACH,aAHW,SAAS,GACP;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAe5D;IAED;;;;;;;;OAQG;IACH,sCAJW,YAAY,EAAE,GAEZ;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAmF5D;IAED;;;;OAIG;IACH,8BAHoB,YAAY,+BAK/B;IAED;;;;OAIG;IACH,oCAHoB,UAAU,+BAK7B;IAED;;;OAGG;IACH,YAFY,YAAY,EAAE,CAIzB;IAED;;;OAGG;IACH,kBAFY,UAAU,EAAE,CAIvB;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAenB;IAED;;;;OAIG;IACH,qDAFa,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,0DAFa,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,YAAY,GAAC,SAAS,CAkBlC;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,YAAY,CAUxB;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,UAAU,GAAC,SAAS,CAgBhC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,WACN,MAAM,GACJ,4BAA0B,SAAS,CAY/C;IAED;;;;OAIG;IACH,mCAFa,MAAM,CAclB;IAED;;;OAGG;IACH,cAFW,YAAY,QAgBtB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CA4BnB;IAED;;;;;;;;OAQG;IACH,uCANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAqClB;IAED;;;;;;;OAOG;IACH,6BANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAoDlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,OAAO,CAuBnB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,UACN,MAAM,EAAE,GACN,MAAM,CAyBlB;IAGL;;;OAGG;IACH,sBAFU,OAAO,CAEc;CAN9B;6BA5nB4B,wBAAwB;2BAD1B,iBAAiB"}
|
|
@@ -11,12 +11,14 @@ export class NodeGraph {
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @private
|
|
14
|
+
* @readonly
|
|
14
15
|
* @type {List<NodeInstance>}
|
|
15
16
|
*/
|
|
16
17
|
nodes = new List();
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* @private
|
|
21
|
+
* @readonly
|
|
20
22
|
* @type {List<Connection>}
|
|
21
23
|
*/
|
|
22
24
|
connections = new List();
|
|
@@ -24,6 +26,7 @@ export class NodeGraph {
|
|
|
24
26
|
/**
|
|
25
27
|
*
|
|
26
28
|
* @type {IdPool}
|
|
29
|
+
* @readonly
|
|
27
30
|
* @private
|
|
28
31
|
*/
|
|
29
32
|
__idpNodes = new IdPool();
|
|
@@ -31,6 +34,7 @@ export class NodeGraph {
|
|
|
31
34
|
/**
|
|
32
35
|
*
|
|
33
36
|
* @type {IdPool}
|
|
37
|
+
* @readonly
|
|
34
38
|
* @private
|
|
35
39
|
*/
|
|
36
40
|
__idpConnections = new IdPool();
|
|
@@ -111,6 +115,9 @@ export class NodeGraph {
|
|
|
111
115
|
* @returns {{connections:Connection[], nodes:NodeInstance[]}}
|
|
112
116
|
*/
|
|
113
117
|
merge(other) {
|
|
118
|
+
assert.defined(other, 'other');
|
|
119
|
+
assert.notNull(other, 'other');
|
|
120
|
+
|
|
114
121
|
if (other === this) {
|
|
115
122
|
// can't merge with self, invalid operation
|
|
116
123
|
throw new Error("Can't merge with self, invalid operation");
|
|
@@ -131,7 +138,18 @@ export class NodeGraph {
|
|
|
131
138
|
* @param {Connection[]} [connections]
|
|
132
139
|
* @returns {{connections:Connection[], nodes:NodeInstance[]}} local created instances
|
|
133
140
|
*/
|
|
134
|
-
mergeFragment({
|
|
141
|
+
mergeFragment({
|
|
142
|
+
nodes,
|
|
143
|
+
connections = []
|
|
144
|
+
}) {
|
|
145
|
+
|
|
146
|
+
assert.defined(nodes, 'nodes');
|
|
147
|
+
assert.notNull(nodes, 'nodes');
|
|
148
|
+
assert.isArray(nodes, 'nodes');
|
|
149
|
+
|
|
150
|
+
assert.defined(connections, 'connections');
|
|
151
|
+
assert.notNull(connections, 'connections');
|
|
152
|
+
assert.isArray(connections, 'connections');
|
|
135
153
|
|
|
136
154
|
const previous_node_count = this.nodes.length;
|
|
137
155
|
const previous_connection_count = this.connections.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeDescription.js"],"names":[],"mappings":"AAwCA;IACI;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;OAMG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,iBAFU,IAAI,EAAE,CAEL;IAEX;;;OAGG;IACH,YAFU,wBAAwB,EAAE,CAEpB;IAEhB;;OAEG;IACH;QACI;;;WAGG;4BADO,OAAO,IAAI,CAAC;QAGtB;;;WAGG;8BADO,OAAO,IAAI,CAAC;MAGxB;IAEF;;;;OAIG;IACH,4CAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;;;;OAMG;IACH,sBALW,MAAM,QACN,qBAAqB,iBACrB,MAAM,GAAC,OAAO,GAAC,MAAM,GACnB,MAAM,CA0ClB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,wBAAwB,CAiBpC;IAGD;;;;;;OAMG;IACH,oDAHW,aAAa,GACX,MAAM,CA2BlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CAuBnB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,IAAI,GAAC,IAAI,CAgBrB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,IAAI,EAAE,CAwBjB;IAED;;;;OAIG;IACH,+BAHW,aAAa,GACZ,IAAI,EAAE,CAuBjB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,aACN,aAAa,GACZ,IAAI,GAAC,SAAS,CAmBzB;IAED;;;OAGG;IACH,YAFa,IAAI,EAAE,CAIlB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,
|
|
1
|
+
{"version":3,"file":"NodeDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeDescription.js"],"names":[],"mappings":"AAwCA;IACI;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;OAMG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,iBAFU,IAAI,EAAE,CAEL;IAEX;;;OAGG;IACH,YAFU,wBAAwB,EAAE,CAEpB;IAEhB;;OAEG;IACH;QACI;;;WAGG;4BADO,OAAO,IAAI,CAAC;QAGtB;;;WAGG;8BADO,OAAO,IAAI,CAAC;MAGxB;IAEF;;;;OAIG;IACH,4CAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,sBAEC;IAED;;;;;;OAMG;IACH,sBALW,MAAM,QACN,qBAAqB,iBACrB,MAAM,GAAC,OAAO,GAAC,MAAM,GACnB,MAAM,CA0ClB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,wBAAwB,CAiBpC;IAGD;;;;;;OAMG;IACH,oDAHW,aAAa,GACX,MAAM,CA2BlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CAuBnB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,IAAI,GAAC,IAAI,CAgBrB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,IAAI,EAAE,CAwBjB;IAED;;;;OAIG;IACH,+BAHW,aAAa,GACZ,IAAI,EAAE,CAuBjB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,aACN,aAAa,GACZ,IAAI,GAAC,SAAS,CAmBzB;IAED;;;OAGG;IACH,YAFa,IAAI,EAAE,CAIlB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAYnB;IAED,mBAEC;IAED;;;;MAMC;IAED;;;;;;OAMG;IACH,8BALW,EAAE,gCAaZ;IAKL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAR1C;;;;qBAxYoB,WAAW;yCADS,yCAAyC;mBAH/D,kCAAkC;sCAEf,sCAAsC;8BAG9C,oBAAoB"}
|
|
@@ -358,6 +358,11 @@ export class NodeDescription {
|
|
|
358
358
|
* @returns {boolean}
|
|
359
359
|
*/
|
|
360
360
|
equals(other) {
|
|
361
|
+
if (this === other) {
|
|
362
|
+
// fast shortcut
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
|
|
361
366
|
return this.id === other.id
|
|
362
367
|
&& this.name === other.name
|
|
363
368
|
&& isArrayEqual(this.ports, other.ports)
|
|
@@ -378,12 +383,16 @@ export class NodeDescription {
|
|
|
378
383
|
|
|
379
384
|
/**
|
|
380
385
|
*
|
|
381
|
-
* @param ports
|
|
382
|
-
* @param id
|
|
383
|
-
* @param name
|
|
386
|
+
* @param {[]} ports
|
|
387
|
+
* @param {number} id
|
|
388
|
+
* @param {string} name
|
|
384
389
|
* @param {NodeRegistry} registry
|
|
385
390
|
*/
|
|
386
|
-
fromJSON({ ports, id, name }, registry) {
|
|
391
|
+
fromJSON({ ports = [], id, name = "" }, registry) {
|
|
392
|
+
assert.isNonNegativeInteger(id, 'id');
|
|
393
|
+
assert.isString(name, 'name');
|
|
394
|
+
assert.isArray(ports, 'ports');
|
|
395
|
+
|
|
387
396
|
this.id = id;
|
|
388
397
|
this.name = name;
|
|
389
398
|
this.ports = ports.map(p => Port.fromJSON(p, registry));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeInstance.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstance.js"],"names":[],"mappings":"AAcA;;;;GAIG;AACH;IAEI;;;;OAIG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,6BAAmB;IAEnB;;;OAGG;IACH,WAFU,yBAAyB,EAAE,CAEtB;IAEf;;;OAGG;IACH,gBAAgB;IAEhB;;;OAGG;IACH,qBAAmB;IAEnB;;;OAGG;IACH,aAFU,gBAAgB,CAED;IAEzB;;;;;;OAMG;IACH,wBAFU,MAAM,CAEE;IAElB;;OAEG;IACH;QACI;;;WAGG;mCADO,OAAO,MAAM,WAAO;QAG9B;;;WAGG;iCADO,OAAO,MAAM,MAAI;QAG3B;;;WAGG;mCADO,OAAO,MAAM,MAAI;QAI3B;;;;WAIG;qCADO,
|
|
1
|
+
{"version":3,"file":"NodeInstance.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstance.js"],"names":[],"mappings":"AAcA;;;;GAIG;AACH;IAEI;;;;OAIG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,6BAAmB;IAEnB;;;OAGG;IACH,WAFU,yBAAyB,EAAE,CAEtB;IAEf;;;OAGG;IACH,gBAAgB;IAEhB;;;OAGG;IACH,qBAAmB;IAEnB;;;OAGG;IACH,aAFU,gBAAgB,CAED;IAEzB;;;;;;OAMG;IACH,wBAFU,MAAM,CAEE;IAElB;;OAEG;IACH;QACI;;;WAGG;mCADO,OAAO,MAAM,WAAO;QAG9B;;;WAGG;iCADO,OAAO,MAAM,MAAI;QAG3B;;;WAGG;mCADO,OAAO,MAAM,MAAI;QAI3B;;;;WAIG;qCADO,yCAAyC,YAAY,CAAC;MAGlE;IAEF;;;;;;OAMG;IACH,yBALW,MAAM,aACN,aAAa,UACb,YAAY,GACV,MAAM,CAsBlB;IAED;;;OAGG;IACH,gDAEC;IAED;;;OAGG;IACH,+CAEC;IAGD;;;OAGG;IACH,mCAEC;IAED;;;;OAIG;IACH,kCAEC;IAED;;;;OAIG;IACH,mBAHW,MAAM,oBAKhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,OAKhB;IAED;;;;OAIG;IACH,yBAHW,MAAM,KAOhB;IAED;;;;OAIG;IACH,2BAHW,MAAM,oBAmChB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAkBnB;IAED;;;OAGG;IACH,uCAQC;IAED,wBAIC;IAED;;;OAGG;IACH,mDAqCC;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,yBAAyB,GAAC,SAAS,CAe/C;IAED,eAEC;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAQnB;IAED,mBAEC;IAIL;;;OAGG;IACH,yBAFU,OAAO,CAEoB;CAPpC;0CA3VyC,gCAAgC;iBAHzD,kCAAkC;mBAChC,kCAAkC;8BAGvB,oBAAoB"}
|
|
@@ -86,9 +86,9 @@ export class NodeInstance {
|
|
|
86
86
|
parameterRemoved: new Signal(),
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
* fires: (newDescription:NodeDescription, oldDescription:NodeDescription|null)
|
|
89
|
+
* fires: (newDescription:NodeDescription, oldDescription:NodeDescription|null, this)
|
|
90
90
|
* @readonly
|
|
91
|
-
* @type {Signal<NodeDescription, NodeDescription>}
|
|
91
|
+
* @type {Signal<NodeDescription, NodeDescription, NodeInstance>}
|
|
92
92
|
*/
|
|
93
93
|
descriptionChanged: new Signal()
|
|
94
94
|
};
|
|
@@ -307,7 +307,7 @@ export class NodeInstance {
|
|
|
307
307
|
this.parameters[pd.id] = pd.defaultValue;
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
-
this.on.descriptionChanged.
|
|
310
|
+
this.on.descriptionChanged.send3(description, old_description, this);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
/**
|