@omegagrid/core 0.4.3 → 0.4.4

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.
@@ -10,5 +10,6 @@ export * as actions from './actions';
10
10
  export * as utils from './utils';
11
11
  export * as matrix from './matrix';
12
12
  export * as events from './events';
13
+ export * from './scriptLoader';
13
14
  export * from './linkedList';
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -39,5 +39,6 @@ exports.actions = __importStar(require("./actions"));
39
39
  exports.utils = __importStar(require("./utils"));
40
40
  exports.matrix = __importStar(require("./matrix"));
41
41
  exports.events = __importStar(require("./events"));
42
+ __exportStar(require("./scriptLoader"), exports);
42
43
  __exportStar(require("./linkedList"), exports);
43
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6B;AAC7B,+CAA+B;AAC/B,qDAAqC;AACrC,iDAAiC;AACjC,6CAA6B;AAC7B,gDAAgC;AAChC,+CAA+B;AAC/B,mDAAmC;AACnC,qDAAqC;AACrC,iDAAiC;AACjC,mDAAmC;AACnC,mDAAmC;AACnC,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6B;AAC7B,+CAA+B;AAC/B,qDAAqC;AACrC,iDAAiC;AACjC,6CAA6B;AAC7B,gDAAgC;AAChC,+CAA+B;AAC/B,mDAAmC;AACnC,qDAAqC;AACrC,iDAAiC;AACjC,mDAAmC;AACnC,mDAAmC;AACnC,iDAA+B;AAC/B,+CAA6B"}
@@ -0,0 +1,6 @@
1
+ export declare class ScriptLoader {
2
+ #private;
3
+ static scripts: Map<string, boolean>;
4
+ static load(url: string): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=scriptLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scriptLoader.d.ts","sourceRoot":"","sources":["../../src/common/scriptLoader.ts"],"names":[],"mappings":"AAEA,qBAAa,YAAY;;IAExB,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;WAGxB,IAAI,CAAC,GAAG,EAAE,MAAM;CA4B7B"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
7
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
+ if (kind === "m") throw new TypeError("Private method is not writable");
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
+ };
13
+ var _a, _ScriptLoader_resolutions;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ScriptLoader = void 0;
16
+ const utils_1 = require("./utils");
17
+ class ScriptLoader {
18
+ static async load(url) {
19
+ if (!__classPrivateFieldGet(this, _a, "f", _ScriptLoader_resolutions))
20
+ __classPrivateFieldSet(this, _a, new Map(), "f", _ScriptLoader_resolutions);
21
+ if (!this.scripts)
22
+ this.scripts = new Map();
23
+ if (this.scripts.has(url))
24
+ return;
25
+ return new Promise((resolve, reject) => {
26
+ const resolutions = __classPrivateFieldGet(this, _a, "f", _ScriptLoader_resolutions).get(url) || [];
27
+ resolutions.push([resolve, reject]);
28
+ __classPrivateFieldGet(this, _a, "f", _ScriptLoader_resolutions).set(url, resolutions);
29
+ if (resolutions.length > 1)
30
+ return;
31
+ const script = document.createElement('script');
32
+ script.src = url;
33
+ script.onload = () => {
34
+ __classPrivateFieldGet(this, _a, "f", _ScriptLoader_resolutions).get(url).forEach(([resolve]) => resolve());
35
+ __classPrivateFieldGet(this, _a, "f", _ScriptLoader_resolutions).delete(url);
36
+ };
37
+ script.onerror = (error) => {
38
+ const err = (0, utils_1.isString)(error) ? new Error(error) : error;
39
+ __classPrivateFieldGet(this, _a, "f", _ScriptLoader_resolutions).get(url).forEach(([_, reject]) => reject(err));
40
+ __classPrivateFieldGet(this, _a, "f", _ScriptLoader_resolutions).delete(url);
41
+ };
42
+ document.head.appendChild(script);
43
+ });
44
+ }
45
+ }
46
+ exports.ScriptLoader = ScriptLoader;
47
+ _a = ScriptLoader;
48
+ _ScriptLoader_resolutions = { value: void 0 };
49
+ //# sourceMappingURL=scriptLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scriptLoader.js","sourceRoot":"","sources":["../../src/common/scriptLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAmC;AAEnC,MAAa,YAAY;IAKxB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAW;QAC5B,IAAI,CAAC,uBAAA,IAAI,qCAAa;YAAE,uBAAA,IAAI,MAAgB,IAAI,GAAG,EAAE,iCAAA,CAAC;QACtD,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5C,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO;QAElC,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC5C,MAAM,WAAW,GAAG,uBAAA,IAAI,qCAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE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/core",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Core components",
6
6
  "main": "./dist/index.js",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@fortawesome/fontawesome-svg-core": "6.4.2",
39
- "@omegagrid/localize": "^0.4.3",
39
+ "@omegagrid/localize": "^0.4.4",
40
40
  "@riovir/wc-fontawesome": "^0.1.9",
41
41
  "color": "^4.2.3",
42
42
  "date-fns": "^3.2.0",