@dualbox/editor 1.0.40 → 1.0.42
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/html/editor.html +114 -109
- package/js/dist/GraphEditor.js +330 -275
- package/js/dist/GraphEditor.min.js +329 -274
- package/js/src/GraphEditor.js +28 -5
- package/js/src/m/GraphModel.js +160 -157
- package/js/src/v/Selector.js +56 -44
- package/js/src/v/templates/addNode.vue +1 -1
- package/js/src/v/templates/editMainSettings.vue +23 -5
- package/js/src/v/templates/editNodeSettings.vue +29 -16
- package/js/src/v/templates/graphNode.vue +21 -10
- package/js/src/v/templates/main.vue +1 -2
- package/lib/draco/1.3.5/draco_decoder.js +31 -0
- package/lib/draco/1.3.5/draco_decoder.wasm +0 -0
- package/lib/draco/1.3.5/draco_decoder_gltf.js +31 -0
- package/lib/draco/1.3.5/draco_decoder_gltf.wasm +0 -0
- package/lib/draco/1.3.5/draco_encoder.js +33 -0
- package/lib/draco/1.3.5/draco_wasm_wrapper.js +117 -0
- package/lib/draco/1.3.5/draco_wasm_wrapper_gltf.js +117 -0
- package/package.json +1 -1
package/js/src/GraphEditor.js
CHANGED
|
@@ -206,7 +206,23 @@ class DualboxEditor {
|
|
|
206
206
|
|
|
207
207
|
this.loadCorePackages();
|
|
208
208
|
|
|
209
|
+
// if defined, call progress callback when needed
|
|
210
|
+
// signature: onLoadProgress(stepName, percentage);
|
|
211
|
+
this.onLoadProgress = attrs.onLoadProgress || function (stepName, numberDone, numberTotal) {
|
|
212
|
+
if (numberDone && numberTotal) {
|
|
213
|
+
console.log(`[LOAD] ${stepName}: ${numberDone}/${numberTotal}`);
|
|
214
|
+
} else {
|
|
215
|
+
console.log(`[LOAD] ${stepName}`);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
209
219
|
if (attrs.json) {
|
|
220
|
+
this.onLoadProgress((step, nbDone, nbTotal) => {
|
|
221
|
+
if (attrs.onLoadProgress) {
|
|
222
|
+
p.onLoadProgress(step, nbDone, nbTotal);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
210
226
|
this.onReady(() => {
|
|
211
227
|
var p = this.setApp(attrs.json);
|
|
212
228
|
if (attrs.onLoaded) {
|
|
@@ -228,10 +244,10 @@ class DualboxEditor {
|
|
|
228
244
|
|
|
229
245
|
var pkgName = "@dualbox/dualbox";
|
|
230
246
|
await this.loadPackage(pkgName);
|
|
231
|
-
if (
|
|
232
|
-
this.DualBox = window.DualBox = this.require(pkgName);
|
|
233
|
-
} else {
|
|
247
|
+
if (window.DualBox && window.DualBox.start) {
|
|
234
248
|
this.DualBox = window.DualBox;
|
|
249
|
+
} else {
|
|
250
|
+
this.DualBox = window.DualBox = this.require(pkgName);
|
|
235
251
|
}
|
|
236
252
|
_.each(this.DualBox.core, async corePackage => {
|
|
237
253
|
await this.loadPackage(corePackage.name);
|
|
@@ -250,11 +266,18 @@ class DualboxEditor {
|
|
|
250
266
|
// return a Promise
|
|
251
267
|
loadPackages(json) {
|
|
252
268
|
var promises = []; // array of promises
|
|
253
|
-
this.promises =
|
|
269
|
+
this.promises = [];
|
|
270
|
+
|
|
271
|
+
var nbPackages = 0;
|
|
272
|
+
var nbLoaded = 0;
|
|
254
273
|
|
|
255
274
|
var parser = new AppParser(json);
|
|
256
275
|
parser.eachComponent((name, version) => {
|
|
257
|
-
|
|
276
|
+
nbPackages++;
|
|
277
|
+
promises.push(this.loadPackage(name, version).then(() => {
|
|
278
|
+
nbLoaded++;
|
|
279
|
+
this.onLoadProgress("Loading application", nbLoaded, nbPackages);
|
|
280
|
+
}));
|
|
258
281
|
});
|
|
259
282
|
|
|
260
283
|
return Promise.all(promises);
|