@evlop/commons 1.0.132 → 1.0.135
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/constants/i18ninstance.d.ts +1 -1
- package/dist/src/constants/i18ninstance.d.ts.map +1 -1
- package/dist/src/constants/i18ninstance.js +4 -3
- package/dist/src/constants/i18ninstance.js.map +1 -1
- package/dist/src/constants/index.d.ts +1 -1
- package/dist/src/constants/index.d.ts.map +1 -1
- package/dist/src/constants/index.js +2 -2
- package/dist/src/constants/index.js.map +1 -1
- package/dist/src/contexts/DataContext.d.ts +1 -1
- package/dist/src/contexts/DataContext.d.ts.map +1 -1
- package/dist/src/contexts/DataContext.js +2 -2
- package/dist/src/contexts/DataContext.js.map +1 -1
- package/dist/src/providers/I18nProvider.d.ts +4 -0
- package/dist/src/providers/I18nProvider.d.ts.map +1 -0
- package/dist/src/providers/I18nProvider.js +55 -0
- package/dist/src/providers/I18nProvider.js.map +1 -0
- package/dist/src/providers/Scope.d.ts +4 -0
- package/dist/src/providers/Scope.d.ts.map +1 -1
- package/dist/src/providers/Scope.js +5 -1
- package/dist/src/providers/Scope.js.map +1 -1
- package/dist/src/providers/Scopes.d.ts +11 -0
- package/dist/src/providers/Scopes.d.ts.map +1 -0
- package/dist/src/providers/Scopes.js +38 -0
- package/dist/src/providers/Scopes.js.map +1 -0
- package/dist/src/providers/index.d.ts +3 -1
- package/dist/src/providers/index.d.ts.map +1 -1
- package/dist/src/providers/index.js +3 -1
- package/dist/src/providers/index.js.map +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18ninstance.d.ts","sourceRoot":"","sources":["../../../src/constants/i18ninstance.ts"],"names":[],"mappings":"AAEA,
|
1
|
+
{"version":3,"file":"i18ninstance.d.ts","sourceRoot":"","sources":["../../../src/constants/i18ninstance.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,wBAA2B,CAAC;AAMrD,eAAe,YAAY,CAAC"}
|
@@ -3,11 +3,12 @@ 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 = void 0;
|
6
7
|
const i18next_1 = __importDefault(require("i18next"));
|
7
|
-
|
8
|
-
i18nInstance.init({
|
8
|
+
exports.i18nInstance = i18next_1.default.createInstance();
|
9
|
+
exports.i18nInstance.init({
|
9
10
|
fallbackLng: ['en', 'EN'],
|
10
11
|
defaultNS: "common",
|
11
12
|
});
|
12
|
-
exports.default = i18nInstance;
|
13
|
+
exports.default = exports.i18nInstance;
|
13
14
|
//# sourceMappingURL=i18ninstance.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"i18ninstance.js","sourceRoot":"","sources":["../../../src/constants/i18ninstance.ts"],"names":[],"mappings":"
|
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,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACzB,SAAS,EAAE,QAAQ;CACtB,CAAC,CAAC;AAEH,kBAAe,oBAAY,CAAC"}
|
@@ -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 {
|
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,U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,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.
|
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,5 +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, "
|
23
|
+
Object.defineProperty(exports, "i18nInstance", { enumerable: true, get: function () { return i18ninstance_1.i18nInstance; } });
|
24
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,QAA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HAAA,OAAO,OAAY;AAC5B,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
declare const DataContext: import("react").Context<{}>;
|
2
2
|
export declare const DataProvider: import("react").Provider<{}>;
|
3
|
-
export declare const
|
3
|
+
export declare const DataConsumer: import("react").Consumer<{}>;
|
4
4
|
export default DataContext;
|
5
5
|
//# sourceMappingURL=DataContext.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DataContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/DataContext.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW,6BAAoB,CAAC;AAEtC,eAAO,MAAM,YAAY,8BAAuB,CAAC;AAEjD,eAAO,MAAM,
|
1
|
+
{"version":3,"file":"DataContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/DataContext.tsx"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW,6BAAoB,CAAC;AAEtC,eAAO,MAAM,YAAY,8BAAuB,CAAC;AAEjD,eAAO,MAAM,YAAY,8BAAuB,CAAC;AAEjD,eAAe,WAAW,CAAA"}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.DataConsumer = exports.DataProvider = void 0;
|
4
4
|
const react_1 = require("react");
|
5
5
|
const DataContext = react_1.createContext({});
|
6
6
|
exports.DataProvider = DataContext.Provider;
|
7
|
-
exports.
|
7
|
+
exports.DataConsumer = DataContext.Consumer;
|
8
8
|
exports.default = DataContext;
|
9
9
|
//# sourceMappingURL=DataContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DataContext.js","sourceRoot":"","sources":["../../../src/contexts/DataContext.tsx"],"names":[],"mappings":";;;AAAA,iCAAoC;AAEpC,MAAM,WAAW,GAAG,qBAAa,CAAC,EAAE,CAAC,CAAC;AAEzB,QAAA,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC;AAEpC,QAAA,
|
1
|
+
{"version":3,"file":"DataContext.js","sourceRoot":"","sources":["../../../src/contexts/DataContext.tsx"],"names":[],"mappings":";;;AAAA,iCAAoC;AAEpC,MAAM,WAAW,GAAG,qBAAa,CAAC,EAAE,CAAC,CAAC;AAEzB,QAAA,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC;AAEpC,QAAA,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC;AAEjD,kBAAe,WAAW,CAAA"}
|
@@ -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 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E,uBAAuB,CAAC,CAAA;YAClD,sBAAY,CAAC,GAAG,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAA;QACtD,CAAC,CAAC;IACR,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,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,CAAC,8BAAC,qBAAa,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,IACxC,QAAQ,CACG,CAAC,CAAC;AACtB,CAAC,CAAA;AA7BY,QAAA,YAAY,gBA6BxB;AAED,kBAAe,oBAAY,CAAC"}
|
@@ -3,6 +3,10 @@ interface ScopeProps {
|
|
3
3
|
name: string;
|
4
4
|
value: any;
|
5
5
|
}
|
6
|
+
/**
|
7
|
+
* @description use is to provide single scopes name and value
|
8
|
+
*/
|
6
9
|
export declare const Scope: React.FunctionComponent<ScopeProps>;
|
10
|
+
export declare const ScopeProvider: React.FunctionComponent<ScopeProps>;
|
7
11
|
export default Scope;
|
8
12
|
//# sourceMappingURL=Scope.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../../src/providers/Scope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAIrC,UAAU,UAAU;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;CACd;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAerD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
1
|
+
{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../../src/providers/Scope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAIrC,UAAU,UAAU;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;CACd;AAED;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAerD,CAAC;AAEF,eAAO,MAAM,aAAa,qCAAQ,CAAC;AAEnC,eAAe,KAAK,CAAC"}
|
@@ -19,15 +19,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
19
|
return result;
|
20
20
|
};
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
-
exports.Scope = void 0;
|
22
|
+
exports.ScopeProvider = exports.Scope = void 0;
|
23
23
|
const react_1 = __importStar(require("react"));
|
24
24
|
const contexts_1 = require("../contexts");
|
25
25
|
const hooks_1 = require("../hooks");
|
26
|
+
/**
|
27
|
+
* @description use is to provide single scopes name and value
|
28
|
+
*/
|
26
29
|
const Scope = ({ name, value, children }) => {
|
27
30
|
const scope = hooks_1.useScope();
|
28
31
|
const newScope = react_1.useMemo(() => (Object.assign(Object.assign({}, scope), { [name]: value })), [scope, name, value]);
|
29
32
|
return (react_1.default.createElement(contexts_1.DataProvider, { value: newScope }, children));
|
30
33
|
};
|
31
34
|
exports.Scope = Scope;
|
35
|
+
exports.ScopeProvider = exports.Scope;
|
32
36
|
exports.default = exports.Scope;
|
33
37
|
//# sourceMappingURL=Scope.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Scope.js","sourceRoot":"","sources":["../../../src/providers/Scope.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqC;AACrC,0CAAyC;AACzC,oCAAkC;
|
1
|
+
{"version":3,"file":"Scope.js","sourceRoot":"","sources":["../../../src/providers/Scope.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqC;AACrC,0CAAyC;AACzC,oCAAkC;AAOlC;;GAEG;AACI,MAAM,KAAK,GAAwC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAG,QAAQ,EAAC,EAAE,EAAE;IACnF,MAAM,KAAK,GAAG,gBAAQ,EAAE,CAAC;IAEzB,MAAM,QAAQ,GAAG,eAAO,CAAC,GAAE,EAAE,CAAA,iCAElB,KAAK,KACR,CAAC,IAAI,CAAC,EAAE,KAAK,IAEpB,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzB,OAAO,CACH,8BAAC,uBAAY,IAAC,KAAK,EAAE,QAAQ,IACxB,QAAQ,CACE,CAClB,CAAC;AACN,CAAC,CAAC;AAfW,QAAA,KAAK,SAehB;AAEW,QAAA,aAAa,GAAG,aAAK,CAAC;AAEnC,kBAAe,aAAK,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
interface ScopesProps {
|
3
|
+
values: Object;
|
4
|
+
}
|
5
|
+
/**
|
6
|
+
* @description use is to provide multiple scopes
|
7
|
+
*/
|
8
|
+
export declare const Scopes: React.FunctionComponent<ScopesProps>;
|
9
|
+
export declare const ScopesProvider: React.FunctionComponent<ScopesProps>;
|
10
|
+
export default Scopes;
|
11
|
+
//# sourceMappingURL=Scopes.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Scopes.d.ts","sourceRoot":"","sources":["../../../src/providers/Scopes.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAIrC,UAAU,WAAW;IACjB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAUvD,CAAC;AAEF,eAAO,MAAM,cAAc,sCAAS,CAAC;AAErC,eAAe,MAAM,CAAC"}
|
@@ -0,0 +1,38 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
22
|
+
exports.ScopesProvider = exports.Scopes = void 0;
|
23
|
+
const lodash_1 = require("lodash");
|
24
|
+
const react_1 = __importStar(require("react"));
|
25
|
+
const contexts_1 = require("../contexts");
|
26
|
+
const hooks_1 = require("../hooks");
|
27
|
+
/**
|
28
|
+
* @description use is to provide multiple scopes
|
29
|
+
*/
|
30
|
+
const Scopes = ({ values, children }) => {
|
31
|
+
const scope = hooks_1.useScope();
|
32
|
+
const newScope = react_1.useMemo(() => lodash_1.assign({}, scope, values), [scope, values]);
|
33
|
+
return (react_1.default.createElement(contexts_1.DataProvider, { value: newScope }, children));
|
34
|
+
};
|
35
|
+
exports.Scopes = Scopes;
|
36
|
+
exports.ScopesProvider = exports.Scopes;
|
37
|
+
exports.default = exports.Scopes;
|
38
|
+
//# sourceMappingURL=Scopes.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Scopes.js","sourceRoot":"","sources":["../../../src/providers/Scopes.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,+CAAqC;AACrC,0CAAyC;AACzC,oCAAkC;AAMlC;;GAEG;AACI,MAAM,MAAM,GAAyC,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAC,EAAE,EAAE;IAC/E,MAAM,KAAK,GAAG,gBAAQ,EAAE,CAAC;IAEzB,MAAM,QAAQ,GAAG,eAAO,CAAC,GAAE,EAAE,CAAC,eAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAE1E,OAAO,CACH,8BAAC,uBAAY,IAAC,KAAK,EAAE,QAAQ,IACxB,QAAQ,CACE,CAClB,CAAC;AACN,CAAC,CAAC;AAVW,QAAA,MAAM,UAUjB;AAEW,QAAA,cAAc,GAAG,cAAM,CAAC;AAErC,kBAAe,cAAM,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,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"}
|
@@ -10,6 +10,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
11
|
};
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
__exportStar(require("./Scope"), exports);
|
14
13
|
__exportStar(require("./DataSource"), exports);
|
14
|
+
__exportStar(require("./Scope"), exports);
|
15
|
+
__exportStar(require("./Scopes"), exports);
|
16
|
+
__exportStar(require("./I18nProvider"), exports);
|
15
17
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,0CAAwB;AACxB,2CAAyB;AACzB,iDAA+B"}
|