sample-piral 1.5.0-beta.6565 → 1.5.0-beta.6569

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.
@@ -6587,12 +6587,12 @@ function installPiralDebug(options) {
6587
6587
  debug: debugApiVersion,
6588
6588
  instance: {
6589
6589
  name: "sample-piral",
6590
- version: "1.5.0-beta.6565",
6590
+ version: "1.5.0-beta.6569",
6591
6591
  dependencies: "reactstrap,tslib,react,react-dom,react-router,react-router-dom"
6592
6592
  },
6593
6593
  build: {
6594
- date: "2024-01-22T15:08:40.934Z",
6595
- cli: "1.5.0-beta.6565",
6594
+ date: "2024-01-22T17:23:38.883Z",
6595
+ cli: "1.5.0-beta.6569",
6596
6596
  compat: "1"
6597
6597
  }
6598
6598
  };
@@ -6892,15 +6892,17 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
6892
6892
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6893
6893
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6894
6894
  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; }
6895
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
6895
6896
 
6896
6897
  function installPiletEmulator(requestPilets, options) {
6897
6898
  var addPilet = options.addPilet,
6898
6899
  removePilet = options.removePilet,
6899
6900
  integrate = options.integrate,
6900
6901
  _options$piletApiFall = options.piletApiFallback,
6901
- piletApiFallback = _options$piletApiFall === void 0 ? '/$pilet-api' : _options$piletApiFall;
6902
+ piletApiFallback = _options$piletApiFall === void 0 ? 'https://feed.piral.cloud/api/v1/pilet/emulator-website' : _options$piletApiFall;
6902
6903
  integrate(function () {
6903
6904
  // check if pilets should be loaded
6905
+ var dbgPiletApiKey = 'dbg:pilet-api';
6904
6906
  var loadPilets = sessionStorage.getItem('dbg:load-pilets') === 'on';
6905
6907
  var noPilets = function noPilets() {
6906
6908
  return Promise.resolve([]);
@@ -6908,7 +6910,7 @@ function installPiletEmulator(requestPilets, options) {
6908
6910
  var requester = loadPilets ? requestPilets : noPilets;
6909
6911
  var promise = requester();
6910
6912
  // the window['dbg:pilet-api'] should point to an API address used as a proxy, fall back to '/$pilet-api' if unavailable
6911
- var piletApi = window['dbg:pilet-api'] || piletApiFallback;
6913
+ var piletApi = window[dbgPiletApiKey] || sessionStorage.getItem(dbgPiletApiKey) || piletApiFallback;
6912
6914
  // either take a full URI or make it an absolute path relative to the current origin
6913
6915
  var initialTarget = /^https?:/.test(piletApi) ? piletApi : "".concat(location.origin).concat(piletApi[0] === '/' ? '' : '/').concat(piletApi);
6914
6916
  var updateTarget = initialTarget.replace('http', 'ws');
@@ -6918,7 +6920,7 @@ function installPiletEmulator(requestPilets, options) {
6918
6920
  var appendix = fetch(initialTarget).then(function (res) {
6919
6921
  return res.json();
6920
6922
  }).then(function (item) {
6921
- return Array.isArray(item) ? item : [item];
6923
+ return Array.isArray(item) ? item : item && _typeof(item) === 'object' ? Array.isArray(item.items) ? item.items : [item] : [];
6922
6924
  });
6923
6925
  ws.onmessage = function (_ref) {
6924
6926
  var data = _ref.data;
@@ -66620,4 +66622,4 @@ root.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(piral
66620
66622
 
66621
66623
  /******/ })()
66622
66624
  ;
66623
- //# sourceMappingURL=index.0e6612.js.map
66625
+ //# sourceMappingURL=index.d16c36.js.map