@evlop/commons 1.0.114 → 1.0.117

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ export declare const encodeBase64: typeof btoa;
2
+ export declare const decodeBase64: typeof atob;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/helpers/base64/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,aAAO,CAAC;AACjC,eAAO,MAAM,YAAY,aAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeBase64 = exports.encodeBase64 = void 0;
4
+ exports.encodeBase64 = btoa;
5
+ exports.decodeBase64 = atob;
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/helpers/base64/index.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,IAAI,CAAC;AACpB,QAAA,YAAY,GAAG,IAAI,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const encodeBase64: any;
2
+ export declare const decodeBase64: any;
3
+ //# sourceMappingURL=index.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../../src/helpers/base64/index.native.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,KAAgB,CAAC;AAC1C,eAAO,MAAM,YAAY,KAAgB,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.decodeBase64 = exports.encodeBase64 = void 0;
7
+ const react_native_base64_1 = __importDefault(require("react-native-base64"));
8
+ exports.encodeBase64 = react_native_base64_1.default.encode;
9
+ exports.decodeBase64 = react_native_base64_1.default.decode;
10
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../../../src/helpers/base64/index.native.ts"],"names":[],"mappings":";;;;;;AAAA,8EAAyC;AAE5B,QAAA,YAAY,GAAG,6BAAM,CAAC,MAAM,CAAC;AAC7B,QAAA,YAAY,GAAG,6BAAM,CAAC,MAAM,CAAC"}
@@ -2,4 +2,5 @@ import './handlebarHelpers';
2
2
  export * from './functions';
3
3
  export * from './commonStyles';
4
4
  export * from './themeHelpers';
5
+ export * from './base64';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
@@ -14,4 +14,5 @@ require("./handlebarHelpers");
14
14
  __exportStar(require("./functions"), exports);
15
15
  __exportStar(require("./commonStyles"), exports);
16
16
  __exportStar(require("./themeHelpers"), exports);
17
+ __exportStar(require("./base64"), exports);
17
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,8BAA4B;AAC5B,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8BAA4B;AAC5B,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB"}
@@ -1 +1 @@
1
- {"version":3,"file":"useScope.d.ts","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,mBAAoB,MAAM,iBAAiB,GAAG,QAOlE,CAAC;AAEF,OAAO,EAAC,QAAQ,IAAI,OAAO,EAAC,CAAC"}
1
+ {"version":3,"file":"useScope.d.ts","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,mBAAoB,MAAM,iBAAiB,GAAG,QAMlE,CAAC;AAEF,OAAO,EAAC,QAAQ,IAAI,OAAO,EAAC,CAAC"}
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useData = exports.useScope = void 0;
4
+ const lodash_1 = require("lodash");
4
5
  const react_1 = require("react");
5
6
  const contexts_1 = require("../contexts");
6
7
  const useScope = (scopeVariable, defaultValue) => {
7
8
  const scope = react_1.useContext(contexts_1.DataContext);
8
9
  if (scopeVariable) {
9
- const { [scopeVariable]: value = defaultValue } = scope;
10
- return value;
10
+ return lodash_1.get(scope, scopeVariable, defaultValue);
11
11
  }
12
12
  return scope;
13
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useScope.js","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,0CAA0C;AAEnC,MAAM,QAAQ,GAAG,CAAC,aAAsB,EAAE,YAAkB,EAAC,EAAE;IAClE,MAAM,KAAK,GAAS,kBAAU,CAAC,sBAAW,CAAC,CAAC;IAC5C,IAAG,aAAa,EAAC;QACb,MAAM,EAAC,CAAC,aAAa,CAAC,EAAE,KAAK,GAAG,YAAY,EAAC,GAAG,KAAK,CAAC;QACtD,OAAO,KAAK,CAAC;KAChB;IACD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAPW,QAAA,QAAQ,YAOnB;AAEkB,kBATP,gBAAQ,CASM"}
1
+ {"version":3,"file":"useScope.js","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":";;;AAAA,mCAA6B;AAC7B,iCAAmC;AACnC,0CAA0C;AAEnC,MAAM,QAAQ,GAAG,CAAC,aAAsB,EAAE,YAAkB,EAAC,EAAE;IAClE,MAAM,KAAK,GAAS,kBAAU,CAAC,sBAAW,CAAC,CAAC;IAC5C,IAAG,aAAa,EAAC;QACb,OAAO,YAAG,CAAC,KAAK,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;KAClD;IACD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB;AAEkB,kBARP,gBAAQ,CAQM"}
@@ -1 +1 @@
1
- {"version":3,"file":"initialState.native.d.ts","sourceRoot":"","sources":["../../../../src/reducers/config/initialState.native.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,kBAAkB;;;CAGvB,CAAA;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"initialState.native.d.ts","sourceRoot":"","sources":["../../../../src/reducers/config/initialState.native.tsx"],"names":[],"mappings":"AAeA,QAAA,MAAM,kBAAkB;;;CAGvB,CAAA;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const react_native_1 = require("react-native");
4
7
  const { AppConstants } = react_native_1.NativeModules;
5
- const configDataJSON = AppConstants.getConfigDataJSON();
8
+ const react_native_base64_1 = __importDefault(require("react-native-base64"));
6
9
  let configData = null;
7
10
  try {
8
- configData = JSON.parse(configDataJSON);
11
+ const configDataJSONBase64 = AppConstants.getConfigDataJSONBase64();
12
+ configData = JSON.parse(react_native_base64_1.default.decode(configDataJSONBase64));
9
13
  }
10
14
  catch (e) {
11
- console.log('Error redux initial state for config');
15
+ console.log('Error redux initial state for config', e);
12
16
  configData = {};
13
17
  }
14
18
  const configInitialState = {
@@ -1 +1 @@
1
- {"version":3,"file":"initialState.native.js","sourceRoot":"","sources":["../../../../src/reducers/config/initialState.native.tsx"],"names":[],"mappings":";;AAAA,+CAA2C;AAC3C,MAAM,EAAC,YAAY,EAAC,GAAG,4BAAa,CAAC;AAErC,MAAM,cAAc,GAAG,YAAY,CAAC,iBAAiB,EAAE,CAAC;AAExD,IAAI,UAAU,GAAG,IAAI,CAAC;AAEtB,IAAG;IACC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;CAC3C;AAAA,OAAM,CAAC,EAAC;IACL,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACpD,UAAU,GAAG,EAAE,CAAA;CAClB;AAED,MAAM,kBAAkB,GAAG;IACvB,MAAM,EAAE,EAAE;IACV,IAAI,EAAC,UAAU;CAClB,CAAA;AAED,kBAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"initialState.native.js","sourceRoot":"","sources":["../../../../src/reducers/config/initialState.native.tsx"],"names":[],"mappings":";;;;;AAAA,+CAA2C;AAC3C,MAAM,EAAC,YAAY,EAAC,GAAG,4BAAa,CAAC;AACrC,8EAAyC;AAGzC,IAAI,UAAU,GAAG,IAAI,CAAC;AAEtB,IAAG;IACC,MAAM,oBAAoB,GAAG,YAAY,CAAC,uBAAuB,EAAE,CAAC;IACpE,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,6BAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;CAChE;AAAA,OAAM,CAAC,EAAC;IACL,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,CAAC,CAAC,CAAC;IACvD,UAAU,GAAG,EAAE,CAAA;CAClB;AAED,MAAM,kBAAkB,GAAG;IACvB,MAAM,EAAE,EAAE;IACV,IAAI,EAAC,UAAU;CAClB,CAAA;AAED,kBAAe,kBAAkB,CAAC"}
@@ -1,19 +1,23 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const lodash_1 = require("lodash");
4
7
  const react_native_1 = require("react-native");
5
8
  const { AppConstants } = react_native_1.NativeModules;
6
- const configDataJSON = AppConstants.getPagesJSON();
9
+ const react_native_base64_1 = __importDefault(require("react-native-base64"));
7
10
  let pagesArray = [];
8
11
  let pagesById = {};
9
12
  try {
10
- pagesArray = JSON.parse(configDataJSON);
13
+ const configDataJSONBase64 = AppConstants.getPagesJSONBase64();
14
+ pagesArray = JSON.parse(react_native_base64_1.default.decode(configDataJSONBase64));
11
15
  if (!Array.isArray(pagesArray))
12
16
  throw new Error('Pages must be an array');
13
17
  pagesById = lodash_1.keyBy(pagesArray, 'id');
14
18
  }
15
19
  catch (e) {
16
- console.log('Error redux initial state for pages');
20
+ console.log('Error redux initial state for pages', e);
17
21
  pagesArray = [];
18
22
  pagesById = {};
19
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"initialState.native.js","sourceRoot":"","sources":["../../../../src/reducers/pages/initialState.native.tsx"],"names":[],"mappings":";;AAAA,mCAA+B;AAC/B,+CAA2C;AAC3C,MAAM,EAAC,YAAY,EAAC,GAAG,4BAAa,CAAC;AAErC,MAAM,cAAc,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC;AAEnD,IAAI,UAAU,GAAQ,EAAE,CAAC;AACzB,IAAI,SAAS,GAAQ,EAAE,CAAC;AAExB,IAAG;IACC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACxC,IAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACzE,SAAS,GAAG,cAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;CACvC;AAAA,OAAM,CAAC,EAAC;IACL,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACnD,UAAU,GAAG,EAAE,CAAC;IAChB,SAAS,GAAG,EAAE,CAAC;CAClB;AAED,MAAM,iBAAiB,GAAG,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,CAAA;AAElH,kBAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"initialState.native.js","sourceRoot":"","sources":["../../../../src/reducers/pages/initialState.native.tsx"],"names":[],"mappings":";;;;;AAAA,mCAA+B;AAC/B,+CAA2C;AAC3C,MAAM,EAAC,YAAY,EAAC,GAAG,4BAAa,CAAC;AACrC,8EAAyC;AAEzC,IAAI,UAAU,GAAQ,EAAE,CAAC;AACzB,IAAI,SAAS,GAAQ,EAAE,CAAC;AAExB,IAAG;IACC,MAAM,oBAAoB,GAAG,YAAY,CAAC,kBAAkB,EAAE,CAAC;IAC/D,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,6BAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC7D,IAAG,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACzE,SAAS,GAAG,cAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;CACvC;AAAA,OAAM,CAAC,EAAC;IACL,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,CAAC,CAAC,CAAC;IACtD,UAAU,GAAG,EAAE,CAAC;IAChB,SAAS,GAAG,EAAE,CAAC;CAClB;AAED,MAAM,iBAAiB,GAAG,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,CAAA;AAElH,kBAAe,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.114",
3
+ "version": "1.0.117",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {
@@ -27,7 +27,8 @@
27
27
  "optionalDependencies": {},
28
28
  "dependencies": {
29
29
  "@evlop/web-components": "^1.0.21",
30
- "moment": "^2.29.1"
30
+ "moment": "^2.29.1",
31
+ "react-native-base64": "^0.2.1"
31
32
  },
32
33
  "scripts": {
33
34
  "prepack": " rm -rf dist && tsc",