@commercetools-frontend/i18n 20.9.0 → 20.10.3

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.
@@ -45,7 +45,7 @@ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInsta
45
45
  var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
46
46
 
47
47
  // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
48
- var version = '20.9.0';
48
+ var version = '20.10.3';
49
49
 
50
50
  var extractLanguageTagFromLocale = function extractLanguageTagFromLocale(locale) {
51
51
  return _includesInstanceProperty__default['default'](locale).call(locale, '-') ? locale.split('-')[0] : locale;
@@ -361,10 +361,13 @@ var useAsyncIntlMessages = function useAsyncIntlMessages(_ref) {
361
361
  case 8:
362
362
  _context.prev = 8;
363
363
  _context.t0 = _context["catch"](0);
364
- setState({
365
- isLoading: false,
366
- error: _context.t0
367
- });
364
+
365
+ if (_context.t0 instanceof Error) {
366
+ setState({
367
+ isLoading: false,
368
+ error: _context.t0
369
+ });
370
+ }
368
371
 
369
372
  case 11:
370
373
  case "end":
@@ -45,7 +45,7 @@ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInsta
45
45
  var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
46
46
 
47
47
  // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
48
- var version = '20.9.0';
48
+ var version = '20.10.3';
49
49
 
50
50
  var extractLanguageTagFromLocale = function extractLanguageTagFromLocale(locale) {
51
51
  return _includesInstanceProperty__default['default'](locale).call(locale, '-') ? locale.split('-')[0] : locale;
@@ -361,10 +361,13 @@ var useAsyncIntlMessages = function useAsyncIntlMessages(_ref) {
361
361
  case 8:
362
362
  _context.prev = 8;
363
363
  _context.t0 = _context["catch"](0);
364
- setState({
365
- isLoading: false,
366
- error: _context.t0
367
- });
364
+
365
+ if (_context.t0 instanceof Error) {
366
+ setState({
367
+ isLoading: false,
368
+ error: _context.t0
369
+ });
370
+ }
368
371
 
369
372
  case 11:
370
373
  case "end":
@@ -12,7 +12,7 @@ import { jsx, Fragment } from '@emotion/react/jsx-runtime';
12
12
  import { defineMessages } from 'react-intl';
13
13
 
14
14
  // NOTE: This string will be replaced in the `prepare` script by the `scripts/version.js` file.
15
- var version = '20.9.0';
15
+ var version = '20.10.3';
16
16
 
17
17
  var extractLanguageTagFromLocale = function extractLanguageTagFromLocale(locale) {
18
18
  return _includesInstanceProperty(locale).call(locale, '-') ? locale.split('-')[0] : locale;
@@ -328,10 +328,13 @@ var useAsyncIntlMessages = function useAsyncIntlMessages(_ref) {
328
328
  case 8:
329
329
  _context.prev = 8;
330
330
  _context.t0 = _context["catch"](0);
331
- setState({
332
- isLoading: false,
333
- error: _context.t0
334
- });
331
+
332
+ if (_context.t0 instanceof Error) {
333
+ setState({
334
+ isLoading: false,
335
+ error: _context.t0
336
+ });
337
+ }
335
338
 
336
339
  case 11:
337
340
  case "end":
@@ -1,23 +1,23 @@
1
- import type { MessageFormatElement } from 'intl-messageformat-parser';
2
- import { ReactNode } from 'react';
3
- export declare type TMessageTranslations = Record<string, string> | Record<string, MessageFormatElement[]>;
4
- export declare type TMessageTranslationsAsync = (locale: string) => Promise<TMessageTranslations>;
5
- export declare type TRenderFunctionResult = {
6
- isLoading: boolean;
7
- locale?: string;
8
- messages?: TMessageTranslations;
9
- };
10
- export declare type Props = {
11
- locale?: string;
12
- applicationMessages: {
13
- [locale: string]: TMessageTranslations;
14
- } | TMessageTranslationsAsync;
15
- children: (state: TRenderFunctionResult) => ReactNode;
16
- };
17
- declare const useAsyncLocaleData: ({ locale, applicationMessages, }: Pick<Props, 'locale' | 'applicationMessages'>) => {
18
- isLoading: boolean;
19
- messages: import("../utils").TMessageTranslations;
20
- error: Error | undefined;
21
- };
22
- declare const AsyncLocaleData: (props: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
23
- export { AsyncLocaleData, useAsyncLocaleData };
1
+ import type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
+ import { ReactNode } from 'react';
3
+ export declare type TMessageTranslations = Record<string, string> | Record<string, MessageFormatElement[]>;
4
+ export declare type TMessageTranslationsAsync = (locale: string) => Promise<TMessageTranslations>;
5
+ export declare type TRenderFunctionResult = {
6
+ isLoading: boolean;
7
+ locale?: string;
8
+ messages?: TMessageTranslations;
9
+ };
10
+ export declare type Props = {
11
+ locale?: string;
12
+ applicationMessages: {
13
+ [locale: string]: TMessageTranslations;
14
+ } | TMessageTranslationsAsync;
15
+ children: (state: TRenderFunctionResult) => ReactNode;
16
+ };
17
+ declare const useAsyncLocaleData: ({ locale, applicationMessages, }: Pick<Props, 'locale' | 'applicationMessages'>) => {
18
+ isLoading: boolean;
19
+ messages: import("../utils").TMessageTranslations;
20
+ error: Error | undefined;
21
+ };
22
+ declare const AsyncLocaleData: (props: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
23
+ export { AsyncLocaleData, useAsyncLocaleData };
@@ -1,2 +1,2 @@
1
- export { AsyncLocaleData, useAsyncLocaleData } from './async-locale-data';
2
- export { default as useAsyncIntlMessages } from './use-async-intl-messages';
1
+ export { AsyncLocaleData, useAsyncLocaleData } from './async-locale-data';
2
+ export { default as useAsyncIntlMessages } from './use-async-intl-messages';
@@ -1,14 +1,14 @@
1
- import type { MessageFormatElement } from 'intl-messageformat-parser';
2
- export declare type TMessageTranslations = Record<string, string> | Record<string, MessageFormatElement[]>;
3
- export declare type TMessageTranslationsAsync = (locale: string) => Promise<TMessageTranslations>;
4
- export declare type TState = {
5
- isLoading: boolean;
6
- messages?: TMessageTranslations;
7
- error?: Error;
8
- };
9
- export declare type THookOptions = {
10
- locale?: string;
11
- loader: TMessageTranslationsAsync;
12
- };
13
- declare const useAsyncIntlMessages: ({ locale, loader }: THookOptions) => TState;
14
- export default useAsyncIntlMessages;
1
+ import type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
+ export declare type TMessageTranslations = Record<string, string> | Record<string, MessageFormatElement[]>;
3
+ export declare type TMessageTranslationsAsync = (locale: string) => Promise<TMessageTranslations>;
4
+ export declare type TState = {
5
+ isLoading: boolean;
6
+ messages?: TMessageTranslations;
7
+ error?: Error;
8
+ };
9
+ export declare type THookOptions = {
10
+ locale?: string;
11
+ loader: TMessageTranslationsAsync;
12
+ };
13
+ declare const useAsyncIntlMessages: ({ locale, loader }: THookOptions) => TState;
14
+ export default useAsyncIntlMessages;
@@ -1,2 +1,2 @@
1
- import type { Props } from './async-locale-data/async-locale-data';
2
- export declare type TAsyncLocaleDataProps = Props;
1
+ import type { Props } from './async-locale-data/async-locale-data';
2
+ export declare type TAsyncLocaleDataProps = Props;
@@ -1,4 +1,4 @@
1
- export { default as version } from './version';
2
- export * from './export-types';
3
- export { AsyncLocaleData, useAsyncLocaleData, useAsyncIntlMessages, } from './async-locale-data';
4
- export { default as sharedMessages } from './shared-messages';
1
+ export { default as version } from './version';
2
+ export * from './export-types';
3
+ export { AsyncLocaleData, useAsyncLocaleData, useAsyncIntlMessages, } from './async-locale-data';
4
+ export { default as sharedMessages } from './shared-messages';
@@ -1,4 +1,4 @@
1
- import type { MessageFormatElement } from 'intl-messageformat-parser';
2
- declare type MergedMessages = Record<string, string> | Record<string, MessageFormatElement[]>;
3
- export default function loadI18n(locale: string): Promise<MergedMessages>;
4
- export {};
1
+ import type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
+ declare type MergedMessages = Record<string, string> | Record<string, MessageFormatElement[]>;
3
+ export default function loadI18n(locale: string): Promise<MergedMessages>;
4
+ export {};
@@ -1,75 +1,75 @@
1
- declare const messages: {
2
- cancel: {
3
- id: string;
4
- defaultMessage: string;
5
- };
6
- revert: {
7
- id: string;
8
- defaultMessage: string;
9
- };
10
- confirm: {
11
- id: string;
12
- defaultMessage: string;
13
- };
14
- save: {
15
- id: string;
16
- defaultMessage: string;
17
- };
18
- update: {
19
- id: string;
20
- defaultMessage: string;
21
- };
22
- create: {
23
- id: string;
24
- defaultMessage: string;
25
- };
26
- delete: {
27
- id: string;
28
- defaultMessage: string;
29
- };
30
- add: {
31
- id: string;
32
- defaultMessage: string;
33
- };
34
- remove: {
35
- id: string;
36
- defaultMessage: string;
37
- };
38
- close: {
39
- id: string;
40
- defaultMessage: string;
41
- };
42
- edit: {
43
- id: string;
44
- defaultMessage: string;
45
- };
46
- open: {
47
- id: string;
48
- defaultMessage: string;
49
- };
50
- activate: {
51
- id: string;
52
- defaultMessage: string;
53
- };
54
- deactivate: {
55
- id: string;
56
- defaultMessage: string;
57
- };
58
- active: {
59
- id: string;
60
- defaultMessage: string;
61
- };
62
- inactive: {
63
- id: string;
64
- defaultMessage: string;
65
- };
66
- enable: {
67
- id: string;
68
- defaultMessage: string;
69
- };
70
- disable: {
71
- id: string;
72
- defaultMessage: string;
73
- };
74
- };
75
- export default messages;
1
+ declare const messages: {
2
+ cancel: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ };
6
+ revert: {
7
+ id: string;
8
+ defaultMessage: string;
9
+ };
10
+ confirm: {
11
+ id: string;
12
+ defaultMessage: string;
13
+ };
14
+ save: {
15
+ id: string;
16
+ defaultMessage: string;
17
+ };
18
+ update: {
19
+ id: string;
20
+ defaultMessage: string;
21
+ };
22
+ create: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ };
26
+ delete: {
27
+ id: string;
28
+ defaultMessage: string;
29
+ };
30
+ add: {
31
+ id: string;
32
+ defaultMessage: string;
33
+ };
34
+ remove: {
35
+ id: string;
36
+ defaultMessage: string;
37
+ };
38
+ close: {
39
+ id: string;
40
+ defaultMessage: string;
41
+ };
42
+ edit: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ };
46
+ open: {
47
+ id: string;
48
+ defaultMessage: string;
49
+ };
50
+ activate: {
51
+ id: string;
52
+ defaultMessage: string;
53
+ };
54
+ deactivate: {
55
+ id: string;
56
+ defaultMessage: string;
57
+ };
58
+ active: {
59
+ id: string;
60
+ defaultMessage: string;
61
+ };
62
+ inactive: {
63
+ id: string;
64
+ defaultMessage: string;
65
+ };
66
+ enable: {
67
+ id: string;
68
+ defaultMessage: string;
69
+ };
70
+ disable: {
71
+ id: string;
72
+ defaultMessage: string;
73
+ };
74
+ };
75
+ export default messages;
@@ -1,6 +1,6 @@
1
- import type { MessageFormatElement } from 'intl-messageformat-parser';
2
- export declare type TMessageTranslations = Record<string, string> | Record<string, MessageFormatElement[]>;
3
- export declare const extractLanguageTagFromLocale: (locale: string) => string;
4
- export declare const mergeMessages: (...messages: TMessageTranslations[]) => TMessageTranslations;
5
- export declare const mapLocaleToMomentLocale: (locale: string) => string;
6
- export declare const mapLocaleToIntlLocale: (locale: string) => string;
1
+ import type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
+ export declare type TMessageTranslations = Record<string, string> | Record<string, MessageFormatElement[]>;
3
+ export declare const extractLanguageTagFromLocale: (locale: string) => string;
4
+ export declare const mergeMessages: (...messages: TMessageTranslations[]) => TMessageTranslations;
5
+ export declare const mapLocaleToMomentLocale: (locale: string) => string;
6
+ export declare const mapLocaleToIntlLocale: (locale: string) => string;
@@ -1,2 +1,2 @@
1
- declare const _default: "20.9.0";
2
- export default _default;
1
+ declare const _default: "20.10.3";
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/i18n",
3
- "version": "20.9.0",
3
+ "version": "20.10.3",
4
4
  "description": "MC i18n messages",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -35,21 +35,21 @@
35
35
  "compile-data": "formatjs compile-folder --format=$(pwd)/transifex-transformer.js --ast data compiled-data"
36
36
  },
37
37
  "dependencies": {
38
- "@babel/runtime": "7.14.8",
39
- "@babel/runtime-corejs3": "7.14.8",
38
+ "@babel/runtime": "7.15.4",
39
+ "@babel/runtime-corejs3": "7.15.4",
40
40
  "@commercetools-community-kit/i18n": "^0.2.7",
41
- "@commercetools-frontend/sentry": "20.8.0",
41
+ "@commercetools-frontend/sentry": "20.10.3",
42
42
  "@commercetools-uikit/i18n": "^12.0.7",
43
- "@emotion/react": "11.4.0",
43
+ "@emotion/react": "11.4.1",
44
+ "@formatjs/icu-messageformat-parser": "2.0.12",
44
45
  "@types/prop-types": "^15.7.3",
45
- "@types/react": "^17.0.7",
46
+ "@types/react": "^17.0.16",
46
47
  "moment": "^2.29.1",
47
48
  "prop-types": "15.7.2"
48
49
  },
49
50
  "devDependencies": {
50
- "intl-messageformat-parser": "6.4.4",
51
51
  "react": "17.0.2",
52
- "react-intl": "5.20.6"
52
+ "react-intl": "5.20.12"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "react": "17.x",