@dualbox/editor 1.0.23 → 1.0.24

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.
@@ -309,8 +309,21 @@ class DualboxEditor {
309
309
  }
310
310
  }
311
311
 
312
+ var loadScript = (pkg, cb) => {
313
+ if( attrs.load ) {
314
+ attrs.load( pkg.name, pkg.version, cb);
315
+ }
316
+ else {
317
+ cb();
318
+ }
319
+ }
320
+
321
+ // we need to find the package.json and make sure the script is loaded
312
322
  if( this.packages[name] ) {
313
- resolve(this.packages[name]);
323
+ loadScript(this.packages[name], (err) => {
324
+ if( err ) reject(err)
325
+ else resolve(this.packages[name]);
326
+ });
314
327
  }
315
328
  else {
316
329
  // mark the package as beeing resolved
@@ -320,7 +333,10 @@ class DualboxEditor {
320
333
  }
321
334
  else {
322
335
  this.packages[name] = result; // cache result
323
- resolve(result);
336
+ loadScript(this.packages[name], (err) => {
337
+ if( err ) reject(err)
338
+ else resolve(result);
339
+ });
324
340
  }
325
341
  });
326
342
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dualbox/editor",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Editor of Dualbox apps",
5
5
  "browser": "js/dist/GraphEditor.js",
6
6
  "main": "js/dist/GraphEditor.js",