@evlop/commons 1.0.140 → 1.0.141

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  export declare const I18nProvider: React.FC;
3
3
  export default I18nProvider;
4
- //# sourceMappingURL=index.d.ts.map
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,KAAkD,MAAM,OAAO,CAAC;AAOvE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EA8ChC,CAAA;AAED,eAAe,YAAY,CAAC"}
@@ -26,11 +26,10 @@ exports.I18nProvider = void 0;
26
26
  const lodash_1 = require("lodash");
27
27
  const react_1 = __importStar(require("react"));
28
28
  const react_redux_1 = require("react-redux");
29
- const i18ninstance_1 = __importDefault(require("../../constants/i18ninstance"));
30
- const useConfig_1 = require("../../hooks/useConfig");
31
- const reducers_1 = require("../../reducers");
32
- const Scope_1 = require("./../Scope");
33
- const useDirectionSwitcher_1 = __importDefault(require("./useDirectionSwitcher"));
29
+ const i18ninstance_1 = __importDefault(require("../constants/i18ninstance"));
30
+ const useConfig_1 = require("../hooks/useConfig");
31
+ const reducers_1 = require("../reducers");
32
+ const Scope_1 = require("./Scope");
34
33
  const I18nProvider = ({ children }) => {
35
34
  const dispatch = react_redux_1.useDispatch();
36
35
  const i18nResources = useConfig_1.useConfig('i18n');
@@ -47,8 +46,6 @@ const I18nProvider = ({ children }) => {
47
46
  setLanguage(i18ninstance_1.default.language);
48
47
  }
49
48
  }, [language]);
50
- // switch between rtl and ltr based on current language
51
- useDirectionSwitcher_1.default(language);
52
49
  react_1.useEffect(() => {
53
50
  const languageChangeHandeller = (lng) => setLanguage(lng);
54
51
  i18ninstance_1.default.on("languageChanged", languageChangeHandeller);
@@ -71,4 +68,4 @@ const I18nProvider = ({ children }) => {
71
68
  };
72
69
  exports.I18nProvider = I18nProvider;
73
70
  exports.default = exports.I18nProvider;
74
- //# sourceMappingURL=index.js.map
71
+ //# 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,+CAAuE;AACvE,6CAAqD;AACrD,6EAAqD;AACrD,kDAA+C;AAC/C,0CAA8C;AAC9C,mCAAwC;AAEjC,MAAM,YAAY,GAAa,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;IACnD,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,CAAC,CAAC;IAEf,iBAAS,CAAC,GAAE,EAAE;QACV,MAAM,uBAAuB,GAAG,CAAC,GAAU,EAAC,EAAE,CAAC,WAAW,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xB;AAED,kBAAe,oBAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.140",
3
+ "version": "1.0.141",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/I18nProvider/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAQvE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAiDhC,CAAA;AAED,eAAe,YAAY,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/providers/I18nProvider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA+B;AAC/B,+CAAuE;AACvE,6CAAqD;AACrD,gFAAwD;AACxD,qDAAkD;AAClD,6CAAiD;AACjD,sCAA2C;AAC3C,kFAA0D;AAEnD,MAAM,YAAY,GAAa,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;IACnD,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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AC,CACtD,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,SAAS,GAAG,eAAO,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"}
@@ -1,2 +0,0 @@
1
- export default function useDirectionSwitcher(lng: string): void;
2
- //# sourceMappingURL=useDirectionSwitcher.app.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDirectionSwitcher.app.d.ts","sourceRoot":"","sources":["../../../../src/providers/I18nProvider/useDirectionSwitcher.app.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,GAAG,EAAE,MAAM,QAgBvD"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const lodash_1 = require("lodash");
4
- const react_1 = require("react");
5
- const react_native_1 = require("react-native");
6
- const { AppConstants } = react_native_1.NativeModules;
7
- const activeDirection = react_native_1.I18nManager.isRTL ? 'rtl' : 'ltr';
8
- const rtLanguages = ["ar", "arc", "ckb", "dv", "fa", "ha", "he", "khw", "ks", "ps", "sd", "ur", "uz_af", "yi"];
9
- const requiresReloadOnDirectionChange = react_native_1.Platform.select({ ios: true, android: true, default: false });
10
- function useDirectionSwitcher(lng) {
11
- const languageDirection = react_1.useMemo(() => {
12
- return lodash_1.includes(rtLanguages, lodash_1.lowerCase(lng)) ? 'rtl' : 'ltr';
13
- }, [lng]);
14
- react_1.useEffect(() => {
15
- if (languageDirection === activeDirection)
16
- return;
17
- react_native_1.I18nManager.forceRTL(languageDirection === 'rtl');
18
- if (requiresReloadOnDirectionChange) {
19
- react_native_1.Alert.alert("Language direction changed", `You need to reload the app to switch layout to ${languageDirection === 'rtl' ? 'Right to left' : "Left to right"}.`, [{ text: "Okay", onPress: () => AppConstants.reload() },]);
20
- }
21
- }, [languageDirection]);
22
- }
23
- exports.default = useDirectionSwitcher;
24
- //# sourceMappingURL=useDirectionSwitcher.app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDirectionSwitcher.app.js","sourceRoot":"","sources":["../../../../src/providers/I18nProvider/useDirectionSwitcher.app.ts"],"names":[],"mappings":";;AAAA,mCAA6C;AAC7C,iCAA2C;AAC3C,+CAA2E;AAC3E,MAAM,EAAC,YAAY,EAAC,GAAG,4BAAa,CAAC;AAIrC,MAAM,eAAe,GAAc,0BAAW,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAErE,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAE/G,MAAM,+BAA+B,GAAG,uBAAQ,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC,CAAC;AAEpG,SAAwB,oBAAoB,CAAC,GAAW;IACpD,MAAM,iBAAiB,GAAG,eAAO,CAAY,GAAE,EAAE;QAC7C,OAAO,iBAAQ,CAAC,WAAW,EAAE,kBAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACjE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,iBAAS,CAAC,GAAE,EAAE;QACV,IAAG,iBAAiB,KAAK,eAAe;YAAE,OAAO;QACjD,0BAAW,CAAC,QAAQ,CAAC,iBAAiB,KAAK,KAAK,CAAC,CAAC;QAClD,IAAG,+BAA+B,EAAC;YAC/B,oBAAK,CAAC,KAAK,CACP,4BAA4B,EAC5B,kDAAkD,iBAAiB,KAAK,KAAK,CAAA,CAAC,CAAC,eAAe,CAAA,CAAC,CAAC,eAAe,GAAG,EAClH,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,EAAC,EAAE,CACzD,CAAC;SACL;IACL,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAC5B,CAAC;AAhBD,uCAgBC"}
@@ -1,2 +0,0 @@
1
- export default function useDirectionSwitcher(lng: string): void;
2
- //# sourceMappingURL=useDirectionSwitcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDirectionSwitcher.d.ts","sourceRoot":"","sources":["../../../../src/providers/I18nProvider/useDirectionSwitcher.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,GAAG,EAAE,MAAM,QAEvD"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function useDirectionSwitcher(lng) {
4
- }
5
- exports.default = useDirectionSwitcher;
6
- //# sourceMappingURL=useDirectionSwitcher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDirectionSwitcher.js","sourceRoot":"","sources":["../../../../src/providers/I18nProvider/useDirectionSwitcher.ts"],"names":[],"mappings":";;AACA,SAAwB,oBAAoB,CAAC,GAAW;AAExD,CAAC;AAFD,uCAEC"}