@evlop/commons 1.0.235 → 1.0.237
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/constants/index.d.ts +0 -1
- package/dist/src/constants/index.d.ts.map +1 -1
- package/dist/src/constants/index.js +1 -3
- package/dist/src/constants/index.js.map +1 -1
- package/dist/src/helpers/handlebarHelpers.js +1 -1
- package/dist/src/helpers/handlebarHelpers.js.map +1 -1
- package/dist/src/helpers/handlebarHelpers.test.d.ts.map +1 -1
- package/dist/src/helpers/handlebarHelpers.test.js +1 -1
- package/dist/src/helpers/handlebarHelpers.test.js.map +1 -1
- package/dist/src/helpers/i18ninstance.d.ts.map +1 -0
- package/dist/src/helpers/i18ninstance.js.map +1 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/index.js +1 -0
- package/dist/src/helpers/index.js.map +1 -1
- package/dist/src/hooks/useTranslation.js +2 -5
- package/dist/src/hooks/useTranslation.js.map +1 -1
- package/dist/src/providers/I18nProvider.js +11 -14
- package/dist/src/providers/I18nProvider.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/constants/i18ninstance.d.ts.map +0 -1
- package/dist/src/constants/i18ninstance.js.map +0 -1
- /package/dist/src/{constants → helpers}/i18ninstance.d.ts +0 -0
- /package/dist/src/{constants → helpers}/i18ninstance.js +0 -0
@@ -11,5 +11,4 @@ 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, BUILD_VERSION };
|
13
13
|
export { default as iconInfo, IconIdentifier, getIconInfo } from './iconInfo';
|
14
|
-
export { i18nInstance } from './i18ninstance';
|
15
14
|
//# 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,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QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,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.
|
6
|
+
exports.getIconInfo = exports.iconInfo = exports.BUILD_VERSION = 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; } });
|
@@ -21,6 +21,4 @@ exports.DATA_SOURCE_KEY_NAMESPACE = "a0aec1c8-4fed-4d5d-b399-504887b3b8e4";
|
|
21
21
|
var iconInfo_1 = require("./iconInfo");
|
22
22
|
Object.defineProperty(exports, "iconInfo", { enumerable: true, get: function () { return __importDefault(iconInfo_1).default; } });
|
23
23
|
Object.defineProperty(exports, "getIconInfo", { enumerable: true, get: function () { return iconInfo_1.getIconInfo; } });
|
24
|
-
var i18ninstance_1 = require("./i18ninstance");
|
25
|
-
Object.defineProperty(exports, "i18nInstance", { enumerable: true, get: function () { return i18ninstance_1.i18nInstance; } });
|
26
24
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":";;;;;;AAAA,yDAA6E;AAoBrE,6FApBC,+BAAY,OAoBD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,GAAG,iBAAiB,CAAC;AACpC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAElC,QAAA,yBAAyB,GAAG,sCAAsC,CAAC;AAGhF,uCAA8E;AAArE,qHAAA,OAAO,OAAY;AAAkB,uGAAA,WAAW,OAAA"}
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const handlebars_min_js_1 = __importDefault(require("handlebars/dist/handlebars.min.js"));
|
7
7
|
const moment_1 = __importDefault(require("moment"));
|
8
8
|
const lodash_1 = require("lodash");
|
9
|
-
const i18ninstance_1 = __importDefault(require("
|
9
|
+
const i18ninstance_1 = __importDefault(require("./i18ninstance"));
|
10
10
|
handlebars_min_js_1.default.registerHelper('json', function (context) {
|
11
11
|
return JSON.stringify(context, null, 2);
|
12
12
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"handlebarHelpers.js","sourceRoot":"","sources":["../../../src/helpers/handlebarHelpers.ts"],"names":[],"mappings":";;;;;AAAA,0FAA2D;AAC3D,oDAA4B;AAC5B,mCAA+B;AAC/B,
|
1
|
+
{"version":3,"file":"handlebarHelpers.js","sourceRoot":"","sources":["../../../src/helpers/handlebarHelpers.ts"],"names":[],"mappings":";;;;;AAAA,0FAA2D;AAC3D,oDAA4B;AAC5B,mCAA+B;AAC/B,kEAA0C;AAE1C,2BAAU,CAAC,cAAc,CAAC,MAAM,EAAE,UAAS,OAAO;IAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC,CAAC;AAEH,2BAAU,CAAC,cAAc,CAAC,MAAM,EAAE,UAAS,IAAI,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM;IACrE,MAAM,UAAU,GAAW,OAAO,MAAM,KAAK,QAAQ,CAAA,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;IACtE,MAAM,UAAU,GAAG,gBAAM,CAAC,IAAI,CAAC,CAAC;IAChC,IAAG,CAAC,UAAU,CAAC,OAAO,EAAE;QAAE,OAAO,IAAI,CAAC;IACtC,QAAO,UAAU,EAAC;QACd,KAAK,UAAU;YACX,OAAO,UAAU,CAAC,OAAO,EAAE,CAAC;QAChC;YACI,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;KAC5C;AACL,CAAC,CAAC,CAAC;AAEH,2BAAU,CAAC,cAAc,CAAC,MAAM,EAAE,UAAS,GAAG,MAAqB;IAC/D,OAAO,gBAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA,EAAE,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,eAAe,CAAC;AACjC,2BAAU,CAAC,cAAc,CAAC,WAAW,EAAE,UAAS,OAAe;IAC3D,IAAG,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AAEH,iCAAiC;AACjC,2BAAU,CAAC,cAAc,CAAC,GAAG,EAAE,UAAS,GAAW,EAAE,OAAY;IAC7D,OAAO,sBAAY,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC,CAAC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"handlebarHelpers.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/handlebarHelpers.test.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"handlebarHelpers.test.d.ts","sourceRoot":"","sources":["../../../src/helpers/handlebarHelpers.test.ts"],"names":[],"mappings":"AAGA,OAAO,oBAAoB,CAAC"}
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const chai_1 = require("chai");
|
7
7
|
const handlebars_min_js_1 = __importDefault(require("handlebars/dist/handlebars.min.js"));
|
8
8
|
const moment_1 = __importDefault(require("moment"));
|
9
|
-
const i18ninstance_1 = __importDefault(require("../constants/i18ninstance"));
|
10
9
|
require("./handlebarHelpers");
|
10
|
+
const i18ninstance_1 = __importDefault(require("./i18ninstance"));
|
11
11
|
describe('Test handlebar temaplates', function () {
|
12
12
|
it('scan returns last value if none available before that', () => {
|
13
13
|
const stringValue = "{{scan a b c}}";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"handlebarHelpers.test.js","sourceRoot":"","sources":["../../../src/helpers/handlebarHelpers.test.ts"],"names":[],"mappings":";;;;;AAAA,+BAA4B;AAC5B,0FAA2D;AAC3D,oDAA4B;AAC5B,
|
1
|
+
{"version":3,"file":"handlebarHelpers.test.js","sourceRoot":"","sources":["../../../src/helpers/handlebarHelpers.test.ts"],"names":[],"mappings":";;;;;AAAA,+BAA4B;AAC5B,0FAA2D;AAC3D,oDAA4B;AAC5B,8BAA4B;AAC5B,kEAA0C;AAE1C,QAAQ,CAAC,2BAA2B,EAAE;IAClC,EAAE,CAAC,wDAAwD,EAAE,GAAE,EAAE;QAC7D,MAAM,WAAW,GAAG,gBAAgB,CAAC;QACrC,MAAM,QAAQ,GAAG,2BAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACjD,MAAM,eAAe,GAAG,QAAQ,CAAC,EAAC,CAAC,EAAE,KAAK,EAAC,CAAC,CAAC;QAE7C,aAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uCAAuC,EAAE,GAAE,EAAE;QAC5C,MAAM,WAAW,GAAG,gBAAgB,CAAC;QACrC,MAAM,QAAQ,GAAG,2BAAU,CAAC,OAAO,CAAC,WAAW,CAAC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":"","sources":["../../../src/helpers/i18ninstance.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAEjB,QAAA,YAAY,GAAG,iBAAO,CAAC,cAAc,EAAE,CAAC;AACrD,oBAAY,CAAC,IAAI,CAAC;IACd,iBAAiB,EAAE,IAAI;IACvB,GAAG,EAAE,IAAI;IACT,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC;IACpC,SAAS,EAAE,QAAQ;IACnB,aAAa,EAAC;QACV,WAAW,EAAE,KAAK;KACrB;IACD,KAAK,EAAC;QACF,WAAW,EAAE,KAAK;KACrB;CACJ,CAAC,CAAC;AAEH,kBAAe,oBAAY,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
@@ -21,4 +21,5 @@ __exportStar(require("./analytics"), exports);
|
|
21
21
|
__exportStar(require("./remoteAction"), exports);
|
22
22
|
__exportStar(require("./pathHelper"), exports);
|
23
23
|
__exportStar(require("./iconHelper"), exports);
|
24
|
+
__exportStar(require("./i18ninstance"), exports);
|
24
25
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC;AACnC,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB;AACzB,gDAA8B;AAC9B,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,+CAA6B;AAC7B,+CAA6B"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC;AACnC,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB;AACzB,gDAA8B;AAC9B,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,+CAA6B;AAC7B,+CAA6B;AAC7B,iDAA+B"}
|
@@ -1,16 +1,13 @@
|
|
1
1
|
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
3
|
exports.useTranslation = void 0;
|
7
4
|
const react_1 = require("react");
|
8
|
-
const i18ninstance_1 = __importDefault(require("../constants/i18ninstance"));
|
9
5
|
const useScope_1 = require("./useScope");
|
6
|
+
const helpers_1 = require("../helpers");
|
10
7
|
const useTranslation = () => {
|
11
8
|
const i18n = useScope_1.useScope('i18n');
|
12
9
|
const translate = react_1.useCallback((key, options) => {
|
13
|
-
return
|
10
|
+
return helpers_1.i18nInstance.t(key, options);
|
14
11
|
}, [i18n]);
|
15
12
|
return translate;
|
16
13
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/hooks/useTranslation.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/hooks/useTranslation.tsx"],"names":[],"mappings":";;;AACA,iCAAoC;AACpC,yCAAsC;AACtC,wCAA0C;AAEnC,MAAM,cAAc,GAAG,GAAE,EAAE;IAC9B,MAAM,IAAI,GAAG,mBAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAc,mBAAW,CAAC,CAAC,GAAQ,EAAE,OAAa,EAAC,EAAE;QAChE,OAAO,sBAAY,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IACvC,CAAC,EAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAEX,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AAPW,QAAA,cAAc,kBAOzB;AAEF,kBAAe,sBAAc,CAAC"}
|
@@ -18,18 +18,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
18
|
__setModuleDefault(result, mod);
|
19
19
|
return result;
|
20
20
|
};
|
21
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
-
};
|
24
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
25
22
|
exports.I18nProvider = void 0;
|
26
23
|
const lodash_1 = require("lodash");
|
27
24
|
const react_1 = __importStar(require("react"));
|
28
25
|
const react_redux_1 = require("react-redux");
|
29
|
-
const i18ninstance_1 = __importDefault(require("../constants/i18ninstance"));
|
30
26
|
const useConfig_1 = require("../hooks/useConfig");
|
31
27
|
const reducers_1 = require("../reducers");
|
32
28
|
const Scope_1 = require("./Scope");
|
29
|
+
const helpers_1 = require("../helpers");
|
33
30
|
const I18nProvider = ({ children }) => {
|
34
31
|
const dispatch = react_redux_1.useDispatch();
|
35
32
|
const i18nResources = useConfig_1.useConfig('i18n');
|
@@ -37,32 +34,32 @@ const I18nProvider = ({ children }) => {
|
|
37
34
|
const language = react_redux_1.useSelector(s => s.session.data.language);
|
38
35
|
const setLanguage = react_1.useCallback((lng) => dispatch(reducers_1.setSessionValue('language', lng)), [dispatch]);
|
39
36
|
react_1.useEffect(() => {
|
40
|
-
if (language ===
|
37
|
+
if (language === helpers_1.i18nInstance.language)
|
41
38
|
return;
|
42
39
|
if (language) {
|
43
|
-
|
40
|
+
helpers_1.i18nInstance.changeLanguage(language);
|
44
41
|
}
|
45
42
|
else {
|
46
|
-
setLanguage(
|
43
|
+
setLanguage(helpers_1.i18nInstance.language);
|
47
44
|
}
|
48
45
|
}, [language]);
|
49
46
|
react_1.useEffect(() => {
|
50
47
|
const languageChangeHandeller = (lng) => setLanguage(lng);
|
51
|
-
|
52
|
-
return () =>
|
48
|
+
helpers_1.i18nInstance.on("languageChanged", languageChangeHandeller);
|
49
|
+
return () => helpers_1.i18nInstance.off("languageChanged", languageChangeHandeller);
|
53
50
|
}, [setLanguage]);
|
54
51
|
const updatei18nResourceVersion = react_1.useCallback(lodash_1.debounce(() => setVersion(Date.now()), 250), []);
|
55
52
|
react_1.useEffect(() => {
|
56
53
|
const resourceChangeHandeller = () => updatei18nResourceVersion();
|
57
|
-
|
58
|
-
|
54
|
+
helpers_1.i18nInstance.on("added", resourceChangeHandeller);
|
55
|
+
helpers_1.i18nInstance.on("removed", resourceChangeHandeller);
|
59
56
|
return () => {
|
60
|
-
|
61
|
-
|
57
|
+
helpers_1.i18nInstance.off("added", resourceChangeHandeller);
|
58
|
+
helpers_1.i18nInstance.off("removed", resourceChangeHandeller);
|
62
59
|
};
|
63
60
|
}, [updatei18nResourceVersion]);
|
64
61
|
react_1.useEffect(() => {
|
65
|
-
lodash_1.forEach(i18nResources, (values, language) =>
|
62
|
+
lodash_1.forEach(i18nResources, (values, language) => helpers_1.i18nInstance.addResources(language, 'common', values));
|
66
63
|
updatei18nResourceVersion();
|
67
64
|
}, [i18nResources, updatei18nResourceVersion]);
|
68
65
|
const i18nScope = react_1.useMemo(() => ({ v: version, language }), [version, language]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"I18nProvider.js","sourceRoot":"","sources":["../../../src/providers/I18nProvider.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"I18nProvider.js","sourceRoot":"","sources":["../../../src/providers/I18nProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAyC;AACzC,+CAAuE;AACvE,6CAAqD;AACrD,kDAA+C;AAC/C,0CAA8C;AAC9C,mCAAwC;AACxC,wCAA0C;AAMnC,MAAM,YAAY,GAAgC,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;IACtE,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,qBAAS,CAAC,MAAM,CAAC,CAAC;IAExC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,gBAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,yBAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC1D,MAAM,WAAW,GAAG,mBAAW,CAAC,CAAC,GAAW,EAAC,EAAE,CAAA,QAAQ,CAAC,0BAAe,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEtG,iBAAS,CAAC,GAAE,EAAE;QACZ,IAAG,QAAQ,KAAK,sBAAY,CAAC,QAAQ;YAAE,OAAO;QAE9C,IAAG,QAAQ,EAAE;YACX,sBAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;SACvC;aAAK;YACJ,WAAW,CAAC,sBAAY,CAAC,QAAQ,CAAC,CAAC;SACpC;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAA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,CAAC,GAAE,EAAE,CAAA,CAAC,EAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAC,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE7E,OAAO,CAAC,8BAAC,qBAAa,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,SAAS,IAC5C,QAAQ,CACG,CAAC,CAAC;AACtB,CAAC,CAAA;AAjDY,QAAA,YAAY,gBAiDxB;AAED,kBAAe,oBAAY,CAAC"}
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"i18ninstance.d.ts","sourceRoot":"","sources":["../../../src/constants/i18ninstance.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,wBAA2B,CAAC;AAcrD,eAAe,YAAY,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"i18ninstance.js","sourceRoot":"","sources":["../../../src/constants/i18ninstance.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAEjB,QAAA,YAAY,GAAG,iBAAO,CAAC,cAAc,EAAE,CAAC;AACrD,oBAAY,CAAC,IAAI,CAAC;IACd,iBAAiB,EAAE,IAAI;IACvB,GAAG,EAAE,IAAI;IACT,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC;IACpC,SAAS,EAAE,QAAQ;IACnB,aAAa,EAAC;QACV,WAAW,EAAE,KAAK;KACrB;IACD,KAAK,EAAC;QACF,WAAW,EAAE,KAAK;KACrB;CACJ,CAAC,CAAC;AAEH,kBAAe,oBAAY,CAAC"}
|
File without changes
|
File without changes
|