@commercetools-frontend/l10n 24.7.2 → 24.8.1
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.
- package/dist/commercetools-frontend-l10n.cjs.d.ts +2 -2
- package/dist/commercetools-frontend-l10n.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-l10n.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-l10n.esm.js +1 -1
- package/dist/declarations/src/country-information.d.ts +0 -1
- package/dist/declarations/src/currency-information.d.ts +0 -1
- package/dist/declarations/src/index.d.ts +7 -7
- package/dist/declarations/src/language-information.d.ts +0 -1
- package/dist/declarations/src/localize.d.ts +1 -1
- package/dist/declarations/src/time-zone-information.d.ts +0 -1
- package/dist/declarations/src/utils.d.ts +3 -4
- package/package.json +6 -6
- package/dist/commercetools-frontend-l10n.cjs.d.ts.map +0 -1
- package/dist/declarations/src/create-l10n-injector/create-l10n-injector.d.ts +0 -17
- package/dist/declarations/src/create-l10n-injector/index.d.ts +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./declarations/src/index";
|
|
2
|
-
//# sourceMappingURL=
|
|
1
|
+
export * from "./declarations/src/index.js";
|
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy1mcm9udGVuZC1sMTBuLmNqcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi9kZWNsYXJhdGlvbnMvc3JjL2luZGV4LmQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
|
|
@@ -50,7 +50,7 @@ var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
|
50
50
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
51
51
|
|
|
52
52
|
// NOTE: This string will be replaced on build time with the package version.
|
|
53
|
-
var version = "24.
|
|
53
|
+
var version = "24.8.1";
|
|
54
54
|
|
|
55
55
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
56
56
|
const supportedLocales = ["en", "de", "es", "fr-FR", "pt-BR"];
|
|
@@ -50,7 +50,7 @@ var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
|
50
50
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
51
51
|
|
|
52
52
|
// NOTE: This string will be replaced on build time with the package version.
|
|
53
|
-
var version = "24.
|
|
53
|
+
var version = "24.8.1";
|
|
54
54
|
|
|
55
55
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
56
56
|
const supportedLocales = ["en", "de", "es", "fr-FR", "pt-BR"];
|
|
@@ -24,7 +24,7 @@ import moment from 'moment-timezone';
|
|
|
24
24
|
import omit from 'lodash/omit';
|
|
25
25
|
|
|
26
26
|
// NOTE: This string will be replaced on build time with the package version.
|
|
27
|
-
var version = "24.
|
|
27
|
+
var version = "24.8.1";
|
|
28
28
|
|
|
29
29
|
// https://babeljs.io/blog/2017/09/11/zero-config-with-babel-macros
|
|
30
30
|
const supportedLocales = ["en", "de", "es", "fr-FR", "pt-BR"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { default as version } from
|
|
2
|
-
export { getSupportedLocales, getSupportedLocale, getSymbolFromCurrency, } from
|
|
3
|
-
export { useCountries, withCountries, countriesShape, } from
|
|
4
|
-
export { useCurrencies, withCurrencies } from
|
|
5
|
-
export { useLanguages, withLanguages, languagesShape, } from
|
|
6
|
-
export { useTimeZones, withTimeZones, timeZonesShape, } from
|
|
7
|
-
export { applyTransformedLocalizedStrings, applyTransformedLocalizedFields, transformLocalizedFieldToLocalizedString, transformLocalizedStringToLocalizedField, formatLocalizedString, } from
|
|
1
|
+
export { default as version } from "./version.js";
|
|
2
|
+
export { getSupportedLocales, getSupportedLocale, getSymbolFromCurrency, } from "./utils.js";
|
|
3
|
+
export { useCountries, withCountries, countriesShape, } from "./country-information.js";
|
|
4
|
+
export { useCurrencies, withCurrencies } from "./currency-information.js";
|
|
5
|
+
export { useLanguages, withLanguages, languagesShape, } from "./language-information.js";
|
|
6
|
+
export { useTimeZones, withTimeZones, timeZonesShape, } from "./time-zone-information.js";
|
|
7
|
+
export { applyTransformedLocalizedStrings, applyTransformedLocalizedFields, transformLocalizedFieldToLocalizedString, transformLocalizedStringToLocalizedField, formatLocalizedString, } from "./localize.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocalizedString, LocalizedField, FieldNameTranformationMapping, FormatLocalizedStringOptions } from
|
|
1
|
+
import { LocalizedString, LocalizedField, FieldNameTranformationMapping, FormatLocalizedStringOptions } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Transforms a list of `LocalizedField` into a `LocalizedString` object
|
|
4
4
|
* [{ locale: 'sv', value: 'Hej' }] -> { sv: 'Hej' }
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
import type { Currencies, LocalizedString } from './types';
|
|
1
|
+
import type { TSupportedLocale } from "../supported-locales.js";
|
|
2
|
+
import type { Currencies, LocalizedString } from "./types.js";
|
|
4
3
|
export declare const mapLocaleToIntlLocale: (locale: string) => TSupportedLocale;
|
|
5
4
|
export declare function getSupportedLocales(): TSupportedLocale[];
|
|
6
5
|
export declare function getSupportedLocale(locale: string): TSupportedLocale;
|
|
7
6
|
export declare const getSymbolFromCurrency: (currencyCode: string, currencies: Currencies) => string;
|
|
8
|
-
export declare const getDisplayName: <Props extends {}>(Component:
|
|
7
|
+
export declare const getDisplayName: <Props extends {}>(Component: React.ComponentType<Props>) => string | undefined;
|
|
9
8
|
export declare const getPrimaryLocale: (locale: string) => string;
|
|
10
9
|
export declare const formatLocalizedFallbackHint: (value: string, locale: string) => string;
|
|
11
10
|
export declare const findFallbackLocale: (localizedString: LocalizedString, fallbackOrder: string[]) => string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/l10n",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.8.1",
|
|
4
4
|
"description": "React bindings to load l10n data",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -33,28 +33,28 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.22.15",
|
|
35
35
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
36
|
-
"@commercetools-frontend/sentry": "24.
|
|
36
|
+
"@commercetools-frontend/sentry": "24.8.1",
|
|
37
37
|
"@emotion/react": "^11.14.0",
|
|
38
38
|
"@types/lodash": "^4.14.198",
|
|
39
39
|
"@types/prop-types": "^15.7.5",
|
|
40
40
|
"@types/react": "^19.0.3",
|
|
41
41
|
"lodash": "4.17.21",
|
|
42
42
|
"moment": "^2.29.4",
|
|
43
|
-
"moment-timezone": "^0.
|
|
43
|
+
"moment-timezone": "^0.6.0",
|
|
44
44
|
"prop-types": "15.8.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/cldr": "^7.1.4",
|
|
48
|
-
"@types/jest": "^29.5.
|
|
48
|
+
"@types/jest": "^29.5.14",
|
|
49
49
|
"@types/prettier": "2.7.3",
|
|
50
50
|
"chalk": "4.1.2",
|
|
51
|
-
"cldr": "7.
|
|
51
|
+
"cldr": "7.9.0",
|
|
52
52
|
"deep-diff": "1.0.2",
|
|
53
53
|
"node-fetch": "2.7.0",
|
|
54
54
|
"prettier": "2.8.8",
|
|
55
55
|
"prompts": "^2.4.2",
|
|
56
56
|
"react": "19.0.0",
|
|
57
|
-
"rimraf": "
|
|
57
|
+
"rimraf": "6.0.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "19.x"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commercetools-frontend-l10n.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
type LoadLocale<LoadedData extends {}> = (locale: string) => Promise<LoadedData>;
|
|
3
|
-
type InjectorOptions<LoadedData extends {}> = {
|
|
4
|
-
displayName: string;
|
|
5
|
-
propKey: string;
|
|
6
|
-
propLoadingKey: string;
|
|
7
|
-
loadLocale: LoadLocale<LoadedData>;
|
|
8
|
-
};
|
|
9
|
-
export declare function createL10NHook<LoadedData extends {}>(loadLocale: LoadLocale<LoadedData>): (locale: string) => {
|
|
10
|
-
isLoading: boolean;
|
|
11
|
-
data: {};
|
|
12
|
-
};
|
|
13
|
-
export declare function createL10NInjector<LoadedData extends {}>({ displayName, propKey, propLoadingKey, loadLocale, }: InjectorOptions<LoadedData>): <Props extends {}>(mapPropsToLocale: (props: Props) => string) => (WrappedComponent: ComponentType<Props>) => {
|
|
14
|
-
(props: Props): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
15
|
-
displayName: string;
|
|
16
|
-
};
|
|
17
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createL10NHook, createL10NInjector } from './create-l10n-injector';
|