react-intl 10.1.17 → 10.1.19
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/package.json +4 -4
- package/react-intl.iife.js +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.19",
|
|
4
4
|
"description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"format",
|
|
@@ -130,9 +130,9 @@
|
|
|
130
130
|
"./server": "./server.js"
|
|
131
131
|
},
|
|
132
132
|
"dependencies": {
|
|
133
|
-
"@formatjs/icu-messageformat-parser": "3.5.
|
|
134
|
-
"@formatjs/intl": "4.1.
|
|
135
|
-
"intl-messageformat": "11.2.
|
|
133
|
+
"@formatjs/icu-messageformat-parser": "3.5.16",
|
|
134
|
+
"@formatjs/intl": "4.1.18",
|
|
135
|
+
"intl-messageformat": "11.2.13"
|
|
136
136
|
},
|
|
137
137
|
"peerDependencies": {
|
|
138
138
|
"@types/react": ">=18.0.0",
|
package/react-intl.iife.js
CHANGED
|
@@ -3027,13 +3027,21 @@ function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
|
|
|
3027
3027
|
time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone))
|
|
3028
3028
|
};
|
|
3029
3029
|
}
|
|
3030
|
+
function getMessageDescriptorContext(messageDescriptor) {
|
|
3031
|
+
const { defaultMessage } = messageDescriptor;
|
|
3032
|
+
try {
|
|
3033
|
+
return defaultMessage !== void 0 ? `\nDefault Message: ${typeof defaultMessage === "string" ? defaultMessage : JSON.stringify(defaultMessage)}` : `\nMessage Descriptor: ${JSON.stringify(messageDescriptor)}`;
|
|
3034
|
+
} catch {
|
|
3035
|
+
return "";
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3030
3038
|
const formatMessage$1 = ({ locale, formats, messages, defaultLocale, defaultFormats, fallbackOnEmptyString, onError, timeZone, defaultRichTextElements }, state, messageDescriptor = { id: "" }, values, opts) => {
|
|
3031
3039
|
const { id: msgId, defaultMessage } = messageDescriptor;
|
|
3032
|
-
invariant$1(
|
|
3040
|
+
if (!msgId) invariant$1(false, `[@formatjs/intl] An \`id\` must be provided to format a message. You can either:
|
|
3033
3041
|
1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.github.io/docs/tooling/babel-plugin)
|
|
3034
3042
|
or [@formatjs/ts-transformer](https://formatjs.github.io/docs/tooling/ts-transformer) OR
|
|
3035
3043
|
2. Configure your \`eslint\` config to include [eslint-plugin-formatjs](https://formatjs.github.io/docs/tooling/linter#enforce-id)
|
|
3036
|
-
to autofix this issue`);
|
|
3044
|
+
to autofix this issue${getMessageDescriptorContext(messageDescriptor)}`);
|
|
3037
3045
|
const id = String(msgId);
|
|
3038
3046
|
const message = messages && Object.prototype.hasOwnProperty.call(messages, id) && messages[id];
|
|
3039
3047
|
if (Array.isArray(message) && message.length === 1 && message[0].type === TYPE.literal) return message[0].value;
|