@commercetools-frontend/i18n 24.7.1 → 24.8.0

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,2 +1,2 @@
1
- export * from "./declarations/src/index";
2
- //# sourceMappingURL=commercetools-frontend-i18n.cjs.d.ts.map
1
+ export * from "./declarations/src/index.js";
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy1mcm9udGVuZC1pMThuLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _pt = require('prop-types');
6
5
  var react = require('react');
7
6
  var sentry = require('@commercetools-frontend/sentry');
8
7
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
@@ -35,7 +34,6 @@ function _interopNamespace(e) {
35
34
  return Object.freeze(n);
36
35
  }
37
36
 
38
- var _pt__default = /*#__PURE__*/_interopDefault(_pt);
39
37
  var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
40
38
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
41
39
  var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
@@ -44,7 +42,7 @@ var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
44
42
  var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
45
43
 
46
44
  // NOTE: This string will be replaced on build time with the package version.
47
- var version = "24.7.1";
45
+ var version = "24.8.0";
48
46
 
49
47
  // @ts-nocheck
50
48
  /* THIS IS A GENERATED FILE */
@@ -366,11 +364,6 @@ const AsyncLocaleData = props => {
366
364
  })
367
365
  });
368
366
  };
369
- AsyncLocaleData.propTypes = {
370
- locale: _pt__default["default"].string,
371
- applicationMessages: _pt__default["default"].oneOfType([_pt__default["default"].objectOf(_pt__default["default"].any), _pt__default["default"].func]).isRequired,
372
- children: _pt__default["default"].func.isRequired
373
- };
374
367
 
375
368
  // TODO: move it to its own package, so that other people can also use it?
376
369
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _pt = require('prop-types');
6
5
  var react = require('react');
7
6
  var sentry = require('@commercetools-frontend/sentry');
8
7
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
@@ -35,7 +34,6 @@ function _interopNamespace(e) {
35
34
  return Object.freeze(n);
36
35
  }
37
36
 
38
- var _pt__default = /*#__PURE__*/_interopDefault(_pt);
39
37
  var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
40
38
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
41
39
  var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
@@ -44,7 +42,7 @@ var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
44
42
  var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
45
43
 
46
44
  // NOTE: This string will be replaced on build time with the package version.
47
- var version = "24.7.1";
45
+ var version = "24.8.0";
48
46
 
49
47
  // @ts-nocheck
50
48
  /* THIS IS A GENERATED FILE */
@@ -366,11 +364,6 @@ const AsyncLocaleData = props => {
366
364
  })
367
365
  });
368
366
  };
369
- AsyncLocaleData.propTypes = {
370
- locale: _pt__default["default"].string,
371
- applicationMessages: _pt__default["default"].oneOfType([_pt__default["default"].objectOf(_pt__default["default"].any), _pt__default["default"].func]).isRequired,
372
- children: _pt__default["default"].func.isRequired
373
- };
374
367
 
375
368
  // TODO: move it to its own package, so that other people can also use it?
376
369
 
@@ -1,4 +1,3 @@
1
- import _pt from 'prop-types';
2
1
  import { useState, useEffect, useCallback } from 'react';
3
2
  import { reportErrorToSentry } from '@commercetools-frontend/sentry';
4
3
  import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
@@ -12,7 +11,7 @@ import { jsx, Fragment } from '@emotion/react/jsx-runtime';
12
11
  import { defineMessages } from 'react-intl';
13
12
 
14
13
  // NOTE: This string will be replaced on build time with the package version.
15
- var version = "24.7.1";
14
+ var version = "24.8.0";
16
15
 
17
16
  // @ts-nocheck
18
17
  /* THIS IS A GENERATED FILE */
@@ -334,11 +333,6 @@ const AsyncLocaleData = props => {
334
333
  })
335
334
  });
336
335
  };
337
- AsyncLocaleData.propTypes = {
338
- locale: _pt.string,
339
- applicationMessages: _pt.oneOfType([_pt.objectOf(_pt.any), _pt.func]).isRequired,
340
- children: _pt.func.isRequired
341
- };
342
336
 
343
337
  // TODO: move it to its own package, so that other people can also use it?
344
338
 
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import type { TMessageTranslations } from '../export-types';
2
+ import type { TMessageTranslations } from "../export-types.js";
3
3
  export type TMessageTranslationsAsync = (locale: string) => Promise<TMessageTranslations>;
4
4
  export type TRenderFunctionResult = {
5
5
  isLoading: boolean;
@@ -13,7 +13,7 @@ export type Props = {
13
13
  } | TMessageTranslationsAsync;
14
14
  children: (state: TRenderFunctionResult) => ReactNode;
15
15
  };
16
- declare const useAsyncLocaleData: ({ locale, applicationMessages, }: Pick<Props, 'locale' | 'applicationMessages'>) => {
16
+ declare const useAsyncLocaleData: ({ locale, applicationMessages, }: Pick<Props, "locale" | "applicationMessages">) => {
17
17
  isLoading: boolean;
18
18
  messages: TMessageTranslations;
19
19
  error: Error | undefined;
@@ -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.js";
2
+ export { default as useAsyncIntlMessages } from "./use-async-intl-messages.js";
@@ -1,4 +1,4 @@
1
- import type { TMessageTranslations } from '../export-types';
1
+ import type { TMessageTranslations } from "../export-types.js";
2
2
  export type TMessageTranslationsAsync = (locale: string) => Promise<TMessageTranslations>;
3
3
  export type TState = {
4
4
  isLoading: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
2
- import type { Props } from './async-locale-data/async-locale-data';
2
+ import type { Props } from "./async-locale-data/async-locale-data.js";
3
3
  export type TMessageStructuredJson = {
4
4
  string: string;
5
5
  developer_comment?: string;
@@ -1,5 +1,5 @@
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';
5
- export { parseChunkImport, mergeMessages, isStructuredJson, mapLocaleToIntlLocale, } from './utils';
1
+ export { default as version } from "./version.js";
2
+ export * from "./export-types.js";
3
+ export { AsyncLocaleData, useAsyncLocaleData, useAsyncIntlMessages, } from "./async-locale-data/index.js";
4
+ export { default as sharedMessages } from "./shared-messages.js";
5
+ export { parseChunkImport, mergeMessages, isStructuredJson, mapLocaleToIntlLocale, } from "./utils.js";
@@ -1,4 +1,4 @@
1
- import type { TI18NImportData, TMessageTranslations, TMessageStructuredJson } from './export-types';
1
+ import type { TI18NImportData, TMessageTranslations, TMessageStructuredJson } from "./export-types.js";
2
2
  export declare const extractLanguageTagFromLocale: (locale: string) => string;
3
3
  export declare const isStructuredJson: (message: TMessageTranslations | TMessageStructuredJson) => message is TMessageStructuredJson;
4
4
  export declare const parseChunkImport: (chunkImport: TI18NImportData) => TMessageTranslations;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/i18n",
3
- "version": "24.7.1",
3
+ "version": "24.8.0",
4
4
  "description": "MC i18n messages",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -32,18 +32,18 @@
32
32
  "@babel/runtime": "^7.22.15",
33
33
  "@babel/runtime-corejs3": "^7.22.15",
34
34
  "@commercetools-community-kit/i18n": "^0.3.0",
35
- "@commercetools-frontend/sentry": "24.7.1",
36
- "@commercetools-uikit/i18n": "20.0.0",
35
+ "@commercetools-frontend/sentry": "24.8.0",
36
+ "@commercetools-uikit/i18n": "^20.2.3",
37
37
  "@emotion/react": "^11.14.0",
38
- "@formatjs/icu-messageformat-parser": "2.7.8",
38
+ "@formatjs/icu-messageformat-parser": "2.11.2",
39
39
  "@types/prop-types": "^15.7.5",
40
40
  "@types/react": "^19.0.3",
41
41
  "moment": "^2.29.4",
42
42
  "prop-types": "15.8.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@formatjs/cli": "6.2.12",
46
- "@types/jest": "^29.5.4",
45
+ "@formatjs/cli": "6.7.2",
46
+ "@types/jest": "^29.5.14",
47
47
  "jest-mock": "29.7.0",
48
48
  "react": "19.0.0",
49
49
  "react-intl": "^7.1.4"
@@ -1 +0,0 @@
1
- {"version":3,"file":"commercetools-frontend-i18n.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
@@ -1,2 +0,0 @@
1
- import type { TMessageTranslations } from './export-types';
2
- export default function loadI18n(locale: string): Promise<TMessageTranslations>;
@@ -1,2 +0,0 @@
1
- declare function loadMomentLocales(locale: string): Promise<void>;
2
- export default loadMomentLocales;