sample-piral 0.14.15-beta.3790 → 0.14.15

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.
@@ -3621,7 +3621,7 @@ function createInstance() {
3621
3621
  var createApi = apiFactory(context, usedPlugins);
3622
3622
  var root = createApi({
3623
3623
  name: 'root',
3624
- version: "0.14.15-beta.3790" || 0,
3624
+ version: "0.14.15" || 0,
3625
3625
  spec: ''
3626
3626
  });
3627
3627
  var options = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.createPiletOptions)({
@@ -9246,18 +9246,6 @@ __webpack_require__.r(__webpack_exports__);
9246
9246
  /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./state */ "../../utilities/piral-debug-utils/esm/state.js");
9247
9247
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9248
9248
 
9249
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9250
-
9251
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9252
-
9253
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9254
-
9255
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9256
-
9257
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
9258
-
9259
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
9260
-
9261
9249
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
9262
9250
 
9263
9251
 
@@ -9394,21 +9382,34 @@ function installPiralDebug(options) {
9394
9382
  });
9395
9383
  };
9396
9384
 
9385
+ var activatePilet = function activatePilet(pilet) {
9386
+ try {
9387
+ var _createApi = options.createApi;
9388
+
9389
+ var newApi = _createApi(pilet);
9390
+
9391
+ injectPilet(pilet);
9392
+ pilet.setup(newApi);
9393
+ } catch (error) {
9394
+ console.error(error);
9395
+ }
9396
+ };
9397
+
9397
9398
  var togglePilet = function togglePilet(name) {
9398
9399
  var pilet = getPilets().find(function (m) {
9399
9400
  return m.name === name;
9400
9401
  });
9401
9402
 
9402
- if (pilet.disabled) {
9403
- try {
9404
- var _createApi = options.createApi;
9405
-
9406
- var newApi = _createApi(pilet);
9407
-
9408
- injectPilet(pilet.original);
9409
- pilet.original.setup(newApi);
9410
- } catch (error) {
9411
- console.error(error);
9403
+ if (!pilet) {// nothing to do, obviously invalid call
9404
+ } else if (pilet.disabled) {
9405
+ if (pilet.original) {
9406
+ // everything is fine, let's use the cached version
9407
+ activatePilet(pilet.original);
9408
+ } else {
9409
+ // something fishy is going on - let's just try to activate the same pilet
9410
+ activatePilet(Object.assign(Object.assign({}, pilet), {
9411
+ disabled: false
9412
+ }));
9412
9413
  }
9413
9414
  } else {
9414
9415
  injectPilet({
@@ -9430,17 +9431,8 @@ function installPiralDebug(options) {
9430
9431
  };
9431
9432
 
9432
9433
  var appendPilet = function appendPilet(meta) {
9433
- var createApi = options.createApi,
9434
- loadPilet = options.loadPilet;
9435
- loadPilet(meta).then(function (pilet) {
9436
- try {
9437
- var newApi = createApi(pilet);
9438
- injectPilet(pilet);
9439
- pilet.setup(newApi);
9440
- } catch (error) {
9441
- console.error(error);
9442
- }
9443
- });
9434
+ var loadPilet = options.loadPilet;
9435
+ loadPilet(meta).then(activatePilet);
9444
9436
  };
9445
9437
 
9446
9438
  var toggleVisualize = function toggleVisualize() {
@@ -9485,25 +9477,27 @@ function installPiralDebug(options) {
9485
9477
 
9486
9478
  var url = args[0],
9487
9479
  parent = args[1];
9480
+ var result = systemResolve.call.apply(systemResolve, [this].concat(args));
9488
9481
 
9489
9482
  if (parent) {
9490
- depMap[parent] = depMap[parent] || {};
9491
- depMap[parent][url] = true;
9483
+ var deps = depMap[parent] || {};
9484
+ deps[url] = result;
9485
+ depMap[parent] = deps;
9492
9486
  }
9493
9487
 
9494
- return systemResolve.call.apply(systemResolve, [this].concat(args));
9488
+ return result;
9495
9489
  };
9496
9490
 
9497
9491
  var debugApi = {
9498
9492
  debug: debugApiVersion,
9499
9493
  instance: {
9500
9494
  name: "sample-piral",
9501
- version: "0.14.15-beta.3790",
9495
+ version: "0.14.15",
9502
9496
  dependencies: "reactstrap,react,react-dom,react-router,react-router-dom,history,tslib,path-to-regexp,@libre/atom,@dbeining/react-atom"
9503
9497
  },
9504
9498
  build: {
9505
- date: "2022-03-04T13:50:19.633Z",
9506
- cli: "0.14.14",
9499
+ date: "2022-03-05T09:07:26.770Z",
9500
+ cli: "0.14.15",
9507
9501
  compat: "0.14"
9508
9502
  },
9509
9503
  pilets: {
@@ -9559,11 +9553,26 @@ function installPiralDebug(options) {
9559
9553
  var dependencyMap = {};
9560
9554
 
9561
9555
  var addDeps = function addDeps(pilet, dependencies) {
9562
- var oldDeps = dependencyMap[pilet] || [];
9563
- var newDeps = Object.keys(dependencies).filter(function (depName) {
9564
- return !oldDeps.includes(depName);
9565
- });
9566
- dependencyMap[pilet] = [].concat(_toConsumableArray(oldDeps), _toConsumableArray(newDeps));
9556
+ var deps = dependencyMap[pilet] || [];
9557
+
9558
+ var _loop = function _loop() {
9559
+ var depName = _Object$keys[_i];
9560
+
9561
+ if (!deps.some(function (m) {
9562
+ return m.demanded === depName;
9563
+ })) {
9564
+ deps.push({
9565
+ demanded: depName,
9566
+ resolved: dependencies[depName]
9567
+ });
9568
+ }
9569
+ };
9570
+
9571
+ for (var _i = 0, _Object$keys = Object.keys(dependencies); _i < _Object$keys.length; _i++) {
9572
+ _loop();
9573
+ }
9574
+
9575
+ dependencyMap[pilet] = deps;
9567
9576
  };
9568
9577
 
9569
9578
  var pilets = getPilets().map(function (pilet) {
@@ -80901,4 +80910,4 @@ var layout_1 = __webpack_require__(/*! ./layout */ "./src/layout.tsx");
80901
80910
 
80902
80911
  /******/ })()
80903
80912
  ;
80904
- //# sourceMappingURL=index.8d39d5.js.map
80913
+ //# sourceMappingURL=index.c0e0dd.js.map