@evlop/commons 1.0.134 → 1.0.135

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,3 @@
1
- export * from './I18nManager';
2
1
  export * from './EmptyComponent';
3
2
  export * from './hoc';
4
3
  export * from './SkipSSR';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.tsx"],"names":[],"mappings":"AAgBA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.tsx"],"names":[],"mappings":"AAgBA,cAAc,kBAAkB,CAAC;AAEjC,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC"}
@@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  // export * from './FontChooser';
27
27
  // export * from './FontSizeChooser';
28
28
  // export * from './SubToolbar';
29
- __exportStar(require("./I18nManager"), exports);
30
29
  __exportStar(require("./EmptyComponent"), exports);
31
30
  // export * from './BackgroundCho';
32
31
  __exportStar(require("./hoc"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8BAA8B;AAC9B,iCAAiC;AACjC,qCAAqC;AACrC,qCAAqC;AACrC,uCAAuC;AACvC,mCAAmC;AACnC,iCAAiC;AACjC,mCAAmC;AACnC,iCAAiC;AACjC,sCAAsC;AACtC,wCAAwC;AACxC,kCAAkC;AAClC,iCAAiC;AACjC,iCAAiC;AACjC,qCAAqC;AACrC,gCAAgC;AAChC,gDAA8B;AAC9B,mDAAiC;AACjC,mCAAmC;AACnC,wCAAsB;AACtB,4CAA0B;AAE1B,4CAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8BAA8B;AAC9B,iCAAiC;AACjC,qCAAqC;AACrC,qCAAqC;AACrC,uCAAuC;AACvC,mCAAmC;AACnC,iCAAiC;AACjC,mCAAmC;AACnC,iCAAiC;AACjC,sCAAsC;AACtC,wCAAwC;AACxC,kCAAkC;AAClC,iCAAiC;AACjC,iCAAiC;AACjC,qCAAqC;AACrC,gCAAgC;AAChC,mDAAiC;AACjC,mCAAmC;AACnC,wCAAsB;AACtB,4CAA0B;AAE1B,4CAA4C"}
@@ -11,5 +11,5 @@ export declare const TYPE_COMPONENT = "type/component";
11
11
  export declare const DATA_SOURCE_KEY_NAMESPACE = "a0aec1c8-4fed-4d5d-b399-504887b3b8e4";
12
12
  export { API_BASE_URL, SOCKET_URL };
13
13
  export { default as iconInfo } from './iconInfo';
14
- export { default as i18ninstance, i18nInstance } from './i18ninstance';
14
+ export { i18nInstance } from './i18ninstance';
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAI9D,eAAO,MAAM,MAAM,SAAiC,CAAC;AAErD,eAAO,MAAM,MAAM,SAA0E,CAAC;AAE9F,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAG/C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,eAAO,MAAM,yBAAyB,yCAAyC,CAAC;AAChF,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,CAAA;AAEjC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAI9D,eAAO,MAAM,MAAM,SAAiC,CAAC;AAErD,eAAO,MAAM,MAAM,SAA0E,CAAC;AAE9F,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAG/C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,eAAO,MAAM,yBAAyB,yCAAyC,CAAC;AAChF,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,CAAA;AAEjC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.i18nInstance = exports.i18ninstance = exports.iconInfo = exports.SOCKET_URL = exports.API_BASE_URL = exports.DATA_SOURCE_KEY_NAMESPACE = exports.TYPE_COMPONENT = exports.HORIZONTAL_LAYOUT = exports.VERTICAL_LAYOUT = exports.DIRECTION_LEFT = exports.DIRECTION_BOTTOM = exports.DIRECTION_RIGHT = exports.DIRECTION_TOP = exports.IS_SSR = exports.isNode = void 0;
6
+ exports.i18nInstance = exports.iconInfo = exports.SOCKET_URL = exports.API_BASE_URL = exports.DATA_SOURCE_KEY_NAMESPACE = exports.TYPE_COMPONENT = exports.HORIZONTAL_LAYOUT = exports.VERTICAL_LAYOUT = exports.DIRECTION_LEFT = exports.DIRECTION_BOTTOM = exports.DIRECTION_RIGHT = exports.DIRECTION_TOP = exports.IS_SSR = exports.isNode = void 0;
7
7
  const platformSpecific_1 = require("./platformSpecific");
8
8
  Object.defineProperty(exports, "API_BASE_URL", { enumerable: true, get: function () { return platformSpecific_1.API_BASE_URL; } });
9
9
  Object.defineProperty(exports, "SOCKET_URL", { enumerable: true, get: function () { return platformSpecific_1.SOCKET_URL; } });
@@ -20,6 +20,5 @@ exports.DATA_SOURCE_KEY_NAMESPACE = "a0aec1c8-4fed-4d5d-b399-504887b3b8e4";
20
20
  var iconInfo_1 = require("./iconInfo");
21
21
  Object.defineProperty(exports, "iconInfo", { enumerable: true, get: function () { return __importDefault(iconInfo_1).default; } });
22
22
  var i18ninstance_1 = require("./i18ninstance");
23
- Object.defineProperty(exports, "i18ninstance", { enumerable: true, get: function () { return __importDefault(i18ninstance_1).default; } });
24
23
  Object.defineProperty(exports, "i18nInstance", { enumerable: true, get: function () { return i18ninstance_1.i18nInstance; } });
25
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":";;;;;;AAAA,yDAA8D;AAoBtD,6FApBC,+BAAY,OAoBD;AAAE,2FApBC,6BAAU,OAoBD;AAhBnB,QAAA,MAAM,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC;AAExC,QAAA,MAAM,GAAG,cAAM,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEjF,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAGlC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAElC,QAAA,yBAAyB,GAAG,sCAAsC,CAAC;AAGhF,uCAAiD;AAAxC,qHAAA,OAAO,OAAY;AAC5B,+CAAuE;AAA9D,6HAAA,OAAO,OAAgB;AAAE,4GAAA,YAAY,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":";;;;;;AAAA,yDAA8D;AAoBtD,6FApBC,+BAAY,OAoBD;AAAE,2FApBC,6BAAU,OAoBD;AAhBnB,QAAA,MAAM,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC;AAExC,QAAA,MAAM,GAAG,cAAM,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEjF,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAGlC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAElC,QAAA,yBAAyB,GAAG,sCAAsC,CAAC;AAGhF,uCAAiD;AAAxC,qHAAA,OAAO,OAAY;AAC5B,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const I18nProvider: React.FC;
3
+ export default I18nProvider;
4
+ //# sourceMappingURL=I18nProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"I18nProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/I18nProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EA6BhC,CAAA;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.I18nProvider = void 0;
26
+ const lodash_1 = require("lodash");
27
+ const react_1 = __importStar(require("react"));
28
+ const i18ninstance_1 = __importDefault(require("../constants/i18ninstance"));
29
+ const useConfig_1 = require("../hooks/useConfig");
30
+ const Scope_1 = require("./Scope");
31
+ const I18nProvider = ({ children }) => {
32
+ const i18nResources = useConfig_1.useConfig('i18n');
33
+ const [state, setState] = react_1.useState({ language: i18ninstance_1.default.language, v: Date.now() });
34
+ react_1.useEffect(() => {
35
+ const languageChangeHandeller = (lng) => setState(s => (Object.assign(Object.assign({}, s), { language: lng })));
36
+ i18ninstance_1.default.on("languageChanged", languageChangeHandeller);
37
+ return () => i18ninstance_1.default.off("languageChanged", languageChangeHandeller);
38
+ }, []);
39
+ react_1.useEffect(() => {
40
+ const resourceChangeHandeller = () => setState(s => (Object.assign(Object.assign({}, s), { v: Date.now() })));
41
+ i18ninstance_1.default.on("added", resourceChangeHandeller);
42
+ i18ninstance_1.default.on("removed", resourceChangeHandeller);
43
+ return () => {
44
+ i18ninstance_1.default.off("added", resourceChangeHandeller);
45
+ i18ninstance_1.default.off("removed", resourceChangeHandeller);
46
+ };
47
+ }, []);
48
+ react_1.useEffect(() => {
49
+ lodash_1.forEach(i18nResources, (values, language) => i18ninstance_1.default.addResources(language, 'common', values));
50
+ }, [i18nResources]);
51
+ return (react_1.default.createElement(Scope_1.ScopeProvider, { name: "i18n", value: state }, children));
52
+ };
53
+ exports.I18nProvider = I18nProvider;
54
+ exports.default = exports.I18nProvider;
55
+ //# sourceMappingURL=I18nProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"I18nProvider.js","sourceRoot":"","sources":["../../../src/providers/I18nProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA+B;AAC/B,+CAAiD;AACjD,6EAAqD;AACrD,kDAA+C;AAC/C,mCAAwC;AAEjC,MAAM,YAAY,GAAa,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;IACnD,MAAM,aAAa,GAAG,qBAAS,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,gBAAQ,CAAC,EAAC,QAAQ,EAAE,sBAAY,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,EAAC,CAAC,CAAC;IAErF,iBAAS,CAAC,GAAE,EAAE;QACV,MAAM,uBAAuB,GAAG,CAAC,GAAU,EAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA,EAAE,CAAA,iCAAK,CAAC,KAAE,QAAQ,EAAE,GAAG,IAAE,CAAC,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# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
@@ -13,4 +13,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./DataSource"), exports);
14
14
  __exportStar(require("./Scope"), exports);
15
15
  __exportStar(require("./Scopes"), exports);
16
+ __exportStar(require("./I18nProvider"), exports);
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,0CAAwB;AACxB,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,0CAAwB;AACxB,2CAAyB;AACzB,iDAA+B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.134",
3
+ "version": "1.0.135",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const I18nManager: React.FC;
3
- export default I18nManager;
4
- //# sourceMappingURL=I18nManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18nManager.d.ts","sourceRoot":"","sources":["../../../src/components/I18nManager.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAU/B,CAAA;AAED,eAAe,WAAW,CAAC"}
@@ -1,20 +0,0 @@
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.I18nManager = void 0;
7
- const lodash_1 = require("lodash");
8
- const react_1 = require("react");
9
- const i18ninstance_1 = __importDefault(require("../constants/i18ninstance"));
10
- const useConfig_1 = require("../hooks/useConfig");
11
- const I18nManager = () => {
12
- const i18nResources = useConfig_1.useConfig('i18n');
13
- react_1.useEffect(() => {
14
- lodash_1.forEach(i18nResources, (values, language) => i18ninstance_1.default.addResources(language, 'common', values));
15
- }, [i18nResources]);
16
- return null;
17
- };
18
- exports.I18nManager = I18nManager;
19
- exports.default = exports.I18nManager;
20
- //# sourceMappingURL=I18nManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18nManager.js","sourceRoot":"","sources":["../../../src/components/I18nManager.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAA+B;AAC/B,iCAAuC;AACvC,6EAAqD;AACrD,kDAA+C;AAExC,MAAM,WAAW,GAAa,GAAG,EAAE;IACxC,MAAM,aAAa,GAAG,qBAAS,CAAC,MAAM,CAAC,CAAC;IAExC,iBAAS,CAAC,GAAG,EAAE;QACb,gBAAO,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,CAC1C,sBAAY,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CACtD,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,IAAI,CAAC;AACd,CAAC,CAAA;AAVY,QAAA,WAAW,eAUvB;AAED,kBAAe,mBAAW,CAAC"}