codenotch-react 1.0.64 → 1.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Auml.d.ts","sourceRoot":"","sources":["../../src/components/Auml.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,0EAA0E,CAAC;AAE3G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,UAAU,UAAU;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,UAAU;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,qBAAa,IAAK,SAAQ,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAE7D,kBAAkB,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;gBAEnC,KAAK,EAAE,UAAU;IAa7B,iBAAiB;IAIjB,oBAAoB;IAoCpB,oBAAoB;IAOpB,QAAQ,CAAC,CAAC,EAAE,eAAe;IAS3B,cAAc;;;IAMd,wBAAwB,IAAI,MAAM,GAAG,IAAI;IAqCzC,2BAA2B,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM;IAO/D,QAAQ,CAAC,EAAE,EAAE,MAAM;IAmBnB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAUtB,MAAM;IAmDN,oBAAoB;IAkBd,mBAAmB;CAoC5B"}
1
+ {"version":3,"file":"Auml.d.ts","sourceRoot":"","sources":["../../src/components/Auml.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,0EAA0E,CAAC;AAE3G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASzD,UAAU,UAAU;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,UAAU,UAAU;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,qBAAa,IAAK,SAAQ,KAAK,CAAC,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAE7D,kBAAkB,EAAE,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;gBAEnC,KAAK,EAAE,UAAU;IAa7B,iBAAiB;IAIjB,oBAAoB;IAoCpB,oBAAoB;IAOpB,QAAQ,CAAC,CAAC,EAAE,eAAe;IAS3B,cAAc;;;IAMd,wBAAwB,IAAI,MAAM,GAAG,IAAI;IAqCzC,2BAA2B,CAAC,kBAAkB,EAAE,MAAM,GAAG,MAAM;IAO/D,QAAQ,CAAC,EAAE,EAAE,MAAM;IAmBnB,QAAQ,CAAC,KAAK,EAAE,MAAM;IAUtB,MAAM;IAoDN,oBAAoB;IAkBd,mBAAmB;CAoC5B"}
@@ -136,6 +136,7 @@ class Auml extends react_1.default.Component {
136
136
  auml = I18nUtils_1.default.compileAuml(auml, this.props.env);
137
137
  if (this.props.verbose === true) {
138
138
  console.log("Compiled AUML with i18n variables: ", auml);
139
+ console.log("i18n variables: ", this.props.env.i18n);
139
140
  }
140
141
  }
141
142
  catch (err) {
@@ -1,6 +1,7 @@
1
1
  import { ICodenotchEnv } from "..";
2
2
  export default abstract class I18nUtils {
3
3
  static compileAuml(auml: string, env: ICodenotchEnv): string;
4
+ private static revertI18n;
4
5
  private static injectI18n;
5
6
  }
6
7
  //# sourceMappingURL=I18nUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"I18nUtils.d.ts","sourceRoot":"","sources":["../../src/utils/I18nUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAgB,MAAM,IAAI,CAAC;AAEhE,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,SAAS;WAErB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM;IAOnE,OAAO,CAAC,MAAM,CAAC,UAAU;CAqB5B"}
1
+ {"version":3,"file":"I18nUtils.d.ts","sourceRoot":"","sources":["../../src/utils/I18nUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAgB,MAAM,IAAI,CAAC;AAEhE,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,SAAS;WAErB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,MAAM;IAOnE,OAAO,CAAC,MAAM,CAAC,UAAU;IAkBzB,OAAO,CAAC,MAAM,CAAC,UAAU;CAqB5B"}
@@ -5,8 +5,21 @@ class I18nUtils {
5
5
  auml = this.injectI18n(auml, env);
6
6
  return auml;
7
7
  }
8
+ static revertI18n(i18n) {
9
+ let result = {};
10
+ for (let language in i18n) {
11
+ let translations = i18n[language];
12
+ for (let key in translations) {
13
+ if (!result[key]) {
14
+ result[key] = {};
15
+ }
16
+ result[key][language] = translations[key];
17
+ }
18
+ }
19
+ return result;
20
+ }
8
21
  static injectI18n(auml, env) {
9
- let i18n = env.i18n ?? {};
22
+ let i18n = this.revertI18n(env.i18n ?? {});
10
23
  if (Object.keys(i18n).length === 0) {
11
24
  // No i18n variables, return original auml
12
25
  return auml;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codenotch-react",
3
- "version": "1.0.64",
3
+ "version": "1.0.66",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Codenotch SA",