formeo 5.1.0 → 5.1.1

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.
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 5.0.3
4
+ Version: 5.1.0
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
@@ -6064,7 +6064,7 @@ Author: Draggable https://draggable.io
6064
6064
  var name$1, version$2, type, main, module$1, unpkg, exports$1, files, homepage, repository, author, contributors, bugs, description, keywords, ignore, config, scripts, devDependencies, dependencies, release, commitlint, package_default;
6065
6065
  var init_package = __esmMin((() => {
6066
6066
  name$1 = "formeo";
6067
- version$2 = "5.0.3";
6067
+ version$2 = "5.1.0";
6068
6068
  type = "module";
6069
6069
  main = "dist/formeo.cjs.js";
6070
6070
  module$1 = "dist/formeo.es.js";
@@ -11984,7 +11984,7 @@ Author: Draggable https://draggable.io
11984
11984
  }));
11985
11985
  //#endregion
11986
11986
  //#region src/lib/js/common/loaders.js
11987
- var loaded, ajax, onLoadStylesheet, onLoadJavascript, insertScript, insertStyle, insertScripts, insertStyles, insertIcons, fetchIcons, LOADER_MAP, fetchDependencies, fetchFormeoStyle;
11987
+ var loaded, AJAX_TIMEOUT_MS, ajax, onLoadStylesheet, onLoadJavascript, insertScript, insertStyle, insertScripts, insertStyles, insertIcons, fetchIcons, LOADER_MAP, fetchDependencies, fetchFormeoStyle;
11988
11988
  var init_loaders = __esmMin((() => {
11989
11989
  init_constants();
11990
11990
  init_dom();
@@ -11994,12 +11994,14 @@ Author: Draggable https://draggable.io
11994
11994
  css: /* @__PURE__ */ new Set(),
11995
11995
  formeoSprite: null
11996
11996
  };
11997
- ajax = (fileUrl, callback, onError = noop) => {
11997
+ AJAX_TIMEOUT_MS = 1e4;
11998
+ ajax = (fileUrl, callback, onError = noop, timeoutMs = AJAX_TIMEOUT_MS) => {
11998
11999
  return new Promise((resolve) => {
11999
- return fetch(fileUrl).then((data) => {
12000
+ const signal = typeof AbortSignal !== "undefined" && AbortSignal.timeout ? AbortSignal.timeout(timeoutMs) : void 0;
12001
+ return fetch(fileUrl, signal ? { signal } : void 0).then((data) => {
12000
12002
  if (!data.ok) return resolve(onError(data));
12001
12003
  resolve(callback ? callback(data) : data);
12002
- }).catch((err) => onError(err));
12004
+ }).catch((err) => resolve(onError(err)));
12003
12005
  });
12004
12006
  };
12005
12007
  onLoadStylesheet = (elem, cb) => {