@evlop/commons 1.0.172 → 1.0.174

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  export declare const REGISTER_ICON = "REGISTER_ICON";
2
- export declare const REGISTER_ICONS = "REGISTER_ICON";
2
+ export declare const REGISTER_ICONS = "REGISTER_ICONS";
3
3
  export declare function registerIcon(icon: any): {
4
4
  type: string;
5
5
  icon: any;
@@ -8,8 +8,8 @@ export declare function registerIcons(icons: any[]): {
8
8
  type: string;
9
9
  icons: any[];
10
10
  };
11
- export declare const getIcons: (() => Promise<any>) & import("lodash").MemoizedFunction;
12
- export declare function fetchIcons(): (dispatch: Function) => void;
11
+ export declare const getIcons: (() => Promise<any[]>) & import("lodash").MemoizedFunction;
12
+ export declare function fetchIcons(): (dispatch: Function) => Promise<void>;
13
13
  declare const _default: (state: any, action: any) => any;
14
14
  export default _default;
15
15
  //# sourceMappingURL=icons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG;;;EAKrC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE;;;EAKzC;AAED,eAAO,MAAM,QAAQ,0DAA6F,CAAA;AAClH,wBAAgB,UAAU,eACJ,QAAQ,UAK7B;;AAKD,wBAeC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,wBAAgB,YAAY,CAAC,IAAI,EAAE,GAAG;;;EAKrC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE;;;EAKzC;AAED,eAAO,MAAM,QAAQ,4DAalB,CAAA;AAEH,wBAAgB,UAAU,eACE,QAAQ,mBAInC;;AAKD,wBAeC"}
@@ -1,4 +1,24 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
2
22
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
24
  };
@@ -7,7 +27,7 @@ exports.fetchIcons = exports.getIcons = exports.registerIcons = exports.register
7
27
  const lodash_1 = require("lodash");
8
28
  const axios_1 = __importDefault(require("../helpers/axios"));
9
29
  exports.REGISTER_ICON = 'REGISTER_ICON';
10
- exports.REGISTER_ICONS = 'REGISTER_ICON';
30
+ exports.REGISTER_ICONS = 'REGISTER_ICONS';
11
31
  function registerIcon(icon) {
12
32
  return {
13
33
  type: exports.REGISTER_ICON,
@@ -22,13 +42,19 @@ function registerIcons(icons) {
22
42
  };
23
43
  }
24
44
  exports.registerIcons = registerIcons;
25
- exports.getIcons = lodash_1.memoize(() => axios_1.default.get('https://cdn.evlop.com/assets-info/icons.json?v=9').then(r => r.data));
45
+ exports.getIcons = lodash_1.memoize(() => axios_1.default.get('https://cdn.evlop.com/assets-info/icons.min.json?v=9').then(r => {
46
+ const iconsMin = r.data;
47
+ const icons = Object.keys(iconsMin).reduce((acc, key) => {
48
+ const _a = iconsMin[key], { c } = _a, rest = __rest(_a, ["c"]);
49
+ return [...acc, ...Object.keys(c).map((name) => (Object.assign(Object.assign({ id: `${key}:${name}` }, rest), { n: name, c: c[name] })))];
50
+ }, []);
51
+ return icons;
52
+ }));
26
53
  function fetchIcons() {
27
- return (dispatch) => {
28
- exports.getIcons().then(icons => {
29
- dispatch(registerIcons(icons));
30
- });
31
- };
54
+ return (dispatch) => __awaiter(this, void 0, void 0, function* () {
55
+ const icons = yield exports.getIcons();
56
+ dispatch(registerIcons(icons));
57
+ });
32
58
  }
33
59
  exports.fetchIcons = fetchIcons;
34
60
  let initialState = [];
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../src/reducers/icons.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAAwD;AACxD,6DAAqC;AAExB,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,cAAc,GAAG,eAAe,CAAC;AAE9C,SAAgB,YAAY,CAAC,IAAS;IAClC,OAAO;QACH,IAAI,EAAE,qBAAa;QACnB,IAAI;KACP,CAAC;AACN,CAAC;AALD,oCAKC;AAED,SAAgB,aAAa,CAAC,KAAY;IACtC,OAAO;QACH,IAAI,EAAE,sBAAc;QACpB,KAAK;KACR,CAAC;AACN,CAAC;AALD,sCAKC;AAEY,QAAA,QAAQ,GAAG,gBAAO,CAAC,GAAE,EAAE,CAAA,eAAK,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;AAClH,SAAgB,UAAU;IACtB,OAAO,CAAC,QAAkB,EAAC,E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M,QAAQ,GAAG,eAAM,CAAC,CAAC,GAAG,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;YACtD,eAAM,CAAC,QAAQ,EAAE,cAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;SACnB;QACD,KAAK,sBAAc,CAAC,CAAA;YAChB,MAAM,QAAQ,GAAG,eAAM,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;YAC1D,eAAM,CAAC,QAAQ,EAAE,cAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;YACxC,OAAO,QAAQ,CAAC;SACnB;QACD;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.172",
3
+ "version": "1.0.174",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {