react-intl 5.21.0 → 5.23.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.
- package/index.d.ts +8 -7
- package/index.d.ts.map +1 -1
- package/index.js +19 -21
- package/lib/index.d.ts +8 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -7
- package/lib/src/components/injectIntl.js +1 -1
- package/package.json +8 -8
- package/react-intl.iife.js +34 -34
- package/src/components/injectIntl.js +1 -1
package/index.d.ts
CHANGED
|
@@ -3,13 +3,18 @@ import { MessageDescriptor, CustomFormatConfig, FormatDateOptions } from '@forma
|
|
|
3
3
|
import { IntlListFormatOptions } from '@formatjs/intl-listformat';
|
|
4
4
|
import { DisplayNamesOptions } from '@formatjs/intl-displaynames';
|
|
5
5
|
import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
|
|
6
|
+
import injectIntl, { Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps } from './src/components/injectIntl';
|
|
7
|
+
import useIntl from './src/components/useIntl';
|
|
8
|
+
import IntlProvider, { createIntl } from './src/components/provider';
|
|
9
|
+
import FormattedRelativeTime from './src/components/relative';
|
|
10
|
+
import FormattedPlural from './src/components/plural';
|
|
11
|
+
import FormattedMessage from './src/components/message';
|
|
12
|
+
import FormattedDateTimeRange from './src/components/dateTimeRange';
|
|
13
|
+
export { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, WithIntlProps, WrappedComponentProps, createIntl, injectIntl, useIntl, };
|
|
6
14
|
export { IntlConfig, ResolvedIntlConfig, IntlShape } from './src/types';
|
|
7
15
|
export { createIntlCache, MessageDescriptor, IntlCache, Formatters, IntlFormatters, FormatDisplayNameOptions, FormatListOptions, FormatPluralOptions, FormatRelativeTimeOptions, FormatNumberOptions, FormatDateOptions, CustomFormatConfig, CustomFormats, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';
|
|
8
16
|
export declare function defineMessages<K extends keyof any, T = MessageDescriptor, U extends Record<K, T> = Record<K, T>>(msgs: U): U;
|
|
9
17
|
export declare function defineMessage<T extends MessageDescriptor>(msg: T): T;
|
|
10
|
-
export { default as injectIntl, Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps, } from './src/components/injectIntl';
|
|
11
|
-
export { default as useIntl } from './src/components/useIntl';
|
|
12
|
-
export { default as IntlProvider, createIntl } from './src/components/provider';
|
|
13
18
|
export declare const FormattedDate: React.FC<Intl.DateTimeFormatOptions & CustomFormatConfig & {
|
|
14
19
|
value: string | number | Date | undefined;
|
|
15
20
|
}>;
|
|
@@ -34,9 +39,5 @@ export declare const FormattedTimeParts: React.FC<FormatDateOptions & {
|
|
|
34
39
|
children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
|
|
35
40
|
}>;
|
|
36
41
|
export { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';
|
|
37
|
-
export { default as FormattedRelativeTime } from './src/components/relative';
|
|
38
|
-
export { default as FormattedPlural } from './src/components/plural';
|
|
39
|
-
export { default as FormattedMessage } from './src/components/message';
|
|
40
|
-
export { default as FormattedDateTimeRange } from './src/components/dateTimeRange';
|
|
41
42
|
export type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
|
|
42
43
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/react-intl/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAA;AAC/D,OAAO,E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AC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAA;IAC5D,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,kBAAkB,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;CACpE,CACoD,CAAA;AAEvD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,2CAA2C,CAAA;AAClD,YAAY,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAA"}
|
package/index.js
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
3
|
+
exports.FormattedListParts = exports.FormattedNumberParts = exports.FormattedTimeParts = exports.FormattedDateParts = exports.FormattedDisplayName = exports.FormattedList = exports.FormattedNumber = exports.FormattedTime = exports.FormattedDate = exports.defineMessage = exports.defineMessages = exports.ReactIntlError = exports.ReactIntlErrorCode = exports.MissingTranslationError = exports.MessageFormatError = exports.MissingDataError = exports.InvalidConfigError = exports.UnsupportedFormatterError = exports.createIntlCache = exports.useIntl = exports.injectIntl = exports.createIntl = exports.RawIntlProvider = exports.IntlProvider = exports.IntlContext = exports.FormattedRelativeTime = exports.FormattedPlural = exports.FormattedMessage = exports.FormattedDateTimeRange = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
7
5
|
var createFormattedComponent_1 = require("./src/components/createFormattedComponent");
|
|
6
|
+
var injectIntl_1 = (0, tslib_1.__importStar)(require("./src/components/injectIntl"));
|
|
7
|
+
exports.injectIntl = injectIntl_1.default;
|
|
8
|
+
Object.defineProperty(exports, "RawIntlProvider", { enumerable: true, get: function () { return injectIntl_1.Provider; } });
|
|
9
|
+
Object.defineProperty(exports, "IntlContext", { enumerable: true, get: function () { return injectIntl_1.Context; } });
|
|
10
|
+
var useIntl_1 = (0, tslib_1.__importDefault)(require("./src/components/useIntl"));
|
|
11
|
+
exports.useIntl = useIntl_1.default;
|
|
12
|
+
var provider_1 = (0, tslib_1.__importStar)(require("./src/components/provider"));
|
|
13
|
+
exports.IntlProvider = provider_1.default;
|
|
14
|
+
Object.defineProperty(exports, "createIntl", { enumerable: true, get: function () { return provider_1.createIntl; } });
|
|
15
|
+
var relative_1 = (0, tslib_1.__importDefault)(require("./src/components/relative"));
|
|
16
|
+
exports.FormattedRelativeTime = relative_1.default;
|
|
17
|
+
var plural_1 = (0, tslib_1.__importDefault)(require("./src/components/plural"));
|
|
18
|
+
exports.FormattedPlural = plural_1.default;
|
|
19
|
+
var message_1 = (0, tslib_1.__importDefault)(require("./src/components/message"));
|
|
20
|
+
exports.FormattedMessage = message_1.default;
|
|
21
|
+
var dateTimeRange_1 = (0, tslib_1.__importDefault)(require("./src/components/dateTimeRange"));
|
|
22
|
+
exports.FormattedDateTimeRange = dateTimeRange_1.default;
|
|
8
23
|
var intl_1 = require("@formatjs/intl");
|
|
9
24
|
Object.defineProperty(exports, "createIntlCache", { enumerable: true, get: function () { return intl_1.createIntlCache; } });
|
|
10
25
|
Object.defineProperty(exports, "UnsupportedFormatterError", { enumerable: true, get: function () { return intl_1.UnsupportedFormatterError; } });
|
|
@@ -22,15 +37,6 @@ function defineMessage(msg) {
|
|
|
22
37
|
return msg;
|
|
23
38
|
}
|
|
24
39
|
exports.defineMessage = defineMessage;
|
|
25
|
-
var injectIntl_1 = require("./src/components/injectIntl");
|
|
26
|
-
Object.defineProperty(exports, "injectIntl", { enumerable: true, get: function () { return __importDefault(injectIntl_1).default; } });
|
|
27
|
-
Object.defineProperty(exports, "RawIntlProvider", { enumerable: true, get: function () { return injectIntl_1.Provider; } });
|
|
28
|
-
Object.defineProperty(exports, "IntlContext", { enumerable: true, get: function () { return injectIntl_1.Context; } });
|
|
29
|
-
var useIntl_1 = require("./src/components/useIntl");
|
|
30
|
-
Object.defineProperty(exports, "useIntl", { enumerable: true, get: function () { return __importDefault(useIntl_1).default; } });
|
|
31
|
-
var provider_1 = require("./src/components/provider");
|
|
32
|
-
Object.defineProperty(exports, "IntlProvider", { enumerable: true, get: function () { return __importDefault(provider_1).default; } });
|
|
33
|
-
Object.defineProperty(exports, "createIntl", { enumerable: true, get: function () { return provider_1.createIntl; } });
|
|
34
40
|
// IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./src/types').CustomFormatConfig`
|
|
35
41
|
exports.FormattedDate = (0, createFormattedComponent_1.createFormattedComponent)('formatDate');
|
|
36
42
|
exports.FormattedTime = (0, createFormattedComponent_1.createFormattedComponent)('formatTime');
|
|
@@ -43,11 +49,3 @@ exports.FormattedTimeParts = (0, createFormattedComponent_1.createFormattedDateT
|
|
|
43
49
|
var createFormattedComponent_2 = require("./src/components/createFormattedComponent");
|
|
44
50
|
Object.defineProperty(exports, "FormattedNumberParts", { enumerable: true, get: function () { return createFormattedComponent_2.FormattedNumberParts; } });
|
|
45
51
|
Object.defineProperty(exports, "FormattedListParts", { enumerable: true, get: function () { return createFormattedComponent_2.FormattedListParts; } });
|
|
46
|
-
var relative_1 = require("./src/components/relative");
|
|
47
|
-
Object.defineProperty(exports, "FormattedRelativeTime", { enumerable: true, get: function () { return __importDefault(relative_1).default; } });
|
|
48
|
-
var plural_1 = require("./src/components/plural");
|
|
49
|
-
Object.defineProperty(exports, "FormattedPlural", { enumerable: true, get: function () { return __importDefault(plural_1).default; } });
|
|
50
|
-
var message_1 = require("./src/components/message");
|
|
51
|
-
Object.defineProperty(exports, "FormattedMessage", { enumerable: true, get: function () { return __importDefault(message_1).default; } });
|
|
52
|
-
var dateTimeRange_1 = require("./src/components/dateTimeRange");
|
|
53
|
-
Object.defineProperty(exports, "FormattedDateTimeRange", { enumerable: true, get: function () { return __importDefault(dateTimeRange_1).default; } });
|
package/lib/index.d.ts
CHANGED
|
@@ -3,13 +3,18 @@ import { MessageDescriptor, CustomFormatConfig, FormatDateOptions } from '@forma
|
|
|
3
3
|
import { IntlListFormatOptions } from '@formatjs/intl-listformat';
|
|
4
4
|
import { DisplayNamesOptions } from '@formatjs/intl-displaynames';
|
|
5
5
|
import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
|
|
6
|
+
import injectIntl, { Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps } from './src/components/injectIntl';
|
|
7
|
+
import useIntl from './src/components/useIntl';
|
|
8
|
+
import IntlProvider, { createIntl } from './src/components/provider';
|
|
9
|
+
import FormattedRelativeTime from './src/components/relative';
|
|
10
|
+
import FormattedPlural from './src/components/plural';
|
|
11
|
+
import FormattedMessage from './src/components/message';
|
|
12
|
+
import FormattedDateTimeRange from './src/components/dateTimeRange';
|
|
13
|
+
export { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, WithIntlProps, WrappedComponentProps, createIntl, injectIntl, useIntl, };
|
|
6
14
|
export { IntlConfig, ResolvedIntlConfig, IntlShape } from './src/types';
|
|
7
15
|
export { createIntlCache, MessageDescriptor, IntlCache, Formatters, IntlFormatters, FormatDisplayNameOptions, FormatListOptions, FormatPluralOptions, FormatRelativeTimeOptions, FormatNumberOptions, FormatDateOptions, CustomFormatConfig, CustomFormats, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';
|
|
8
16
|
export declare function defineMessages<K extends keyof any, T = MessageDescriptor, U extends Record<K, T> = Record<K, T>>(msgs: U): U;
|
|
9
17
|
export declare function defineMessage<T extends MessageDescriptor>(msg: T): T;
|
|
10
|
-
export { default as injectIntl, Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps, } from './src/components/injectIntl';
|
|
11
|
-
export { default as useIntl } from './src/components/useIntl';
|
|
12
|
-
export { default as IntlProvider, createIntl } from './src/components/provider';
|
|
13
18
|
export declare const FormattedDate: React.FC<Intl.DateTimeFormatOptions & CustomFormatConfig & {
|
|
14
19
|
value: string | number | Date | undefined;
|
|
15
20
|
}>;
|
|
@@ -34,9 +39,5 @@ export declare const FormattedTimeParts: React.FC<FormatDateOptions & {
|
|
|
34
39
|
children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
|
|
35
40
|
}>;
|
|
36
41
|
export { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';
|
|
37
|
-
export { default as FormattedRelativeTime } from './src/components/relative';
|
|
38
|
-
export { default as FormattedPlural } from './src/components/plural';
|
|
39
|
-
export { default as FormattedMessage } from './src/components/message';
|
|
40
|
-
export { default as FormattedDateTimeRange } from './src/components/dateTimeRange';
|
|
41
42
|
export type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
|
|
42
43
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-intl/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAC,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAC,MAAM,aAAa,CAAA;AACrE,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,k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createFormattedDateTimePartsComponent, } from './src/components/createFormattedComponent';
|
|
2
|
+
import injectIntl, { Provider as RawIntlProvider, Context as IntlContext, } from './src/components/injectIntl';
|
|
3
|
+
import useIntl from './src/components/useIntl';
|
|
4
|
+
import IntlProvider, { createIntl } from './src/components/provider';
|
|
5
|
+
import FormattedRelativeTime from './src/components/relative';
|
|
6
|
+
import FormattedPlural from './src/components/plural';
|
|
7
|
+
import FormattedMessage from './src/components/message';
|
|
8
|
+
import FormattedDateTimeRange from './src/components/dateTimeRange';
|
|
9
|
+
export { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, createIntl, injectIntl, useIntl, };
|
|
2
10
|
export { createIntlCache, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';
|
|
3
11
|
export function defineMessages(msgs) {
|
|
4
12
|
return msgs;
|
|
@@ -6,9 +14,6 @@ export function defineMessages(msgs) {
|
|
|
6
14
|
export function defineMessage(msg) {
|
|
7
15
|
return msg;
|
|
8
16
|
}
|
|
9
|
-
export { default as injectIntl, Provider as RawIntlProvider, Context as IntlContext, } from './src/components/injectIntl';
|
|
10
|
-
export { default as useIntl } from './src/components/useIntl';
|
|
11
|
-
export { default as IntlProvider, createIntl } from './src/components/provider';
|
|
12
17
|
// IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./src/types').CustomFormatConfig`
|
|
13
18
|
export var FormattedDate = createFormattedComponent('formatDate');
|
|
14
19
|
export var FormattedTime = createFormattedComponent('formatTime');
|
|
@@ -19,7 +24,3 @@ export var FormattedDisplayName = createFormattedComponent('formatDisplayName');
|
|
|
19
24
|
export var FormattedDateParts = createFormattedDateTimePartsComponent('formatDate');
|
|
20
25
|
export var FormattedTimeParts = createFormattedDateTimePartsComponent('formatTime');
|
|
21
26
|
export { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';
|
|
22
|
-
export { default as FormattedRelativeTime } from './src/components/relative';
|
|
23
|
-
export { default as FormattedPlural } from './src/components/plural';
|
|
24
|
-
export { default as FormattedMessage } from './src/components/message';
|
|
25
|
-
export { default as FormattedDateTimeRange } from './src/components/dateTimeRange';
|
|
@@ -20,7 +20,7 @@ export default function injectIntl(WrappedComponent, options) {
|
|
|
20
20
|
var intlProp = (_a = {}, _a[intlPropName] = intl, _a);
|
|
21
21
|
return (React.createElement(WrappedComponent, __assign({}, props, intlProp, { ref: forwardRef ? props.forwardedRef : null })));
|
|
22
22
|
})); };
|
|
23
|
-
WithIntl.displayName = "injectIntl("
|
|
23
|
+
WithIntl.displayName = "injectIntl(".concat(getDisplayName(WrappedComponent), ")");
|
|
24
24
|
WithIntl.WrappedComponent = WrappedComponent;
|
|
25
25
|
if (forwardRef) {
|
|
26
26
|
return hoistNonReactStatics(React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.23.0",
|
|
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
|
"intl",
|
|
@@ -128,20 +128,20 @@
|
|
|
128
128
|
"types": "index.d.ts",
|
|
129
129
|
"sideEffects": false,
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@formatjs/ecma402-abstract": "1.
|
|
132
|
-
"@formatjs/icu-messageformat-parser": "2.0.
|
|
133
|
-
"@formatjs/intl": "1.
|
|
134
|
-
"@formatjs/intl-displaynames": "5.2.
|
|
135
|
-
"@formatjs/intl-listformat": "6.3.
|
|
131
|
+
"@formatjs/ecma402-abstract": "1.11.0",
|
|
132
|
+
"@formatjs/icu-messageformat-parser": "2.0.15",
|
|
133
|
+
"@formatjs/intl": "1.17.0",
|
|
134
|
+
"@formatjs/intl-displaynames": "5.2.6",
|
|
135
|
+
"@formatjs/intl-listformat": "6.3.6",
|
|
136
136
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
137
137
|
"@types/react": "16 || 17",
|
|
138
138
|
"hoist-non-react-statics": "^3.3.2",
|
|
139
|
-
"intl-messageformat": "9.
|
|
139
|
+
"intl-messageformat": "9.10.0",
|
|
140
140
|
"tslib": "^2.1.0"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
143
|
"react": "^16.3.0 || 17",
|
|
144
|
-
"typescript": "^4.
|
|
144
|
+
"typescript": "^4.5"
|
|
145
145
|
},
|
|
146
146
|
"peerDependenciesMeta": {
|
|
147
147
|
"typescript": {
|
package/react-intl.iife.js
CHANGED
|
@@ -435,7 +435,7 @@ var ReactIntl = (function() {
|
|
|
435
435
|
function UnicodeExtensionValue(extension, key) {
|
|
436
436
|
(0, utils_1.invariant)(key.length === 2, "key must have 2 elements");
|
|
437
437
|
var size = extension.length;
|
|
438
|
-
var searchValue = "-"
|
|
438
|
+
var searchValue = "-".concat(key, "-");
|
|
439
439
|
var pos = extension.indexOf(searchValue);
|
|
440
440
|
if (pos !== -1) {
|
|
441
441
|
var start = pos + 4;
|
|
@@ -462,7 +462,7 @@ var ReactIntl = (function() {
|
|
|
462
462
|
}
|
|
463
463
|
return extension.slice(start, end);
|
|
464
464
|
}
|
|
465
|
-
searchValue = "-"
|
|
465
|
+
searchValue = "-".concat(key);
|
|
466
466
|
pos = extension.indexOf(searchValue);
|
|
467
467
|
if (pos !== -1 && pos + 3 === size) {
|
|
468
468
|
return "";
|
|
@@ -496,13 +496,13 @@ var ReactIntl = (function() {
|
|
|
496
496
|
var supportedExtension = "-u";
|
|
497
497
|
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
498
498
|
var key = relevantExtensionKeys_1[_i];
|
|
499
|
-
(0, utils_1.invariant)(foundLocale in localeData, "Missing locale data for "
|
|
499
|
+
(0, utils_1.invariant)(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
|
|
500
500
|
var foundLocaleData = localeData[foundLocale];
|
|
501
|
-
(0, utils_1.invariant)(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data "
|
|
501
|
+
(0, utils_1.invariant)(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
|
|
502
502
|
var keyLocaleData = foundLocaleData[key];
|
|
503
|
-
(0, utils_1.invariant)(Array.isArray(keyLocaleData), "keyLocaleData for "
|
|
503
|
+
(0, utils_1.invariant)(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
|
|
504
504
|
var value = keyLocaleData[0];
|
|
505
|
-
(0, utils_1.invariant)(typeof value === "string" || value === null, "value must be string or null but got "
|
|
505
|
+
(0, utils_1.invariant)(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
|
|
506
506
|
var supportedExtensionAddition = "";
|
|
507
507
|
if (r.extension) {
|
|
508
508
|
var requestedValue = (0, UnicodeExtensionValue_1.UnicodeExtensionValue)(r.extension, key);
|
|
@@ -510,11 +510,11 @@ var ReactIntl = (function() {
|
|
|
510
510
|
if (requestedValue !== "") {
|
|
511
511
|
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
512
512
|
value = requestedValue;
|
|
513
|
-
supportedExtensionAddition = "-"
|
|
513
|
+
supportedExtensionAddition = "-".concat(key, "-").concat(value);
|
|
514
514
|
}
|
|
515
515
|
} else if (~requestedValue.indexOf("true")) {
|
|
516
516
|
value = "true";
|
|
517
|
-
supportedExtensionAddition = "-"
|
|
517
|
+
supportedExtensionAddition = "-".concat(key);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
}
|
|
@@ -836,8 +836,8 @@ var ReactIntl = (function() {
|
|
|
836
836
|
var S_UNICODE_REGEX = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-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80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
|
|
837
837
|
|
|
838
838
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/format_to_parts.js
|
|
839
|
-
var CARET_S_UNICODE_REGEX = new RegExp("^"
|
|
840
|
-
var S_DOLLAR_UNICODE_REGEX = new RegExp(S_UNICODE_REGEX.source
|
|
839
|
+
var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
|
|
840
|
+
var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
|
|
841
841
|
|
|
842
842
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
|
|
843
843
|
var import_intl_localematcher = __toModule(require_intl_localematcher());
|
|
@@ -1322,8 +1322,8 @@ var ReactIntl = (function() {
|
|
|
1322
1322
|
|
|
1323
1323
|
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/lib/parser.js
|
|
1324
1324
|
var _a;
|
|
1325
|
-
var SPACE_SEPARATOR_START_REGEX = new RegExp("^"
|
|
1326
|
-
var SPACE_SEPARATOR_END_REGEX = new RegExp(SPACE_SEPARATOR_REGEX.source
|
|
1325
|
+
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
|
|
1326
|
+
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
|
|
1327
1327
|
function createLocation(start, end) {
|
|
1328
1328
|
return { start: start, end: end };
|
|
1329
1329
|
}
|
|
@@ -1490,7 +1490,7 @@ var ReactIntl = (function() {
|
|
|
1490
1490
|
return {
|
|
1491
1491
|
val: {
|
|
1492
1492
|
type: TYPE.literal,
|
|
1493
|
-
value: "<"
|
|
1493
|
+
value: "<".concat(tagName, "/>"),
|
|
1494
1494
|
location: createLocation(startPosition, this.clonePosition())
|
|
1495
1495
|
},
|
|
1496
1496
|
err: null
|
|
@@ -1983,7 +1983,7 @@ var ReactIntl = (function() {
|
|
|
1983
1983
|
}
|
|
1984
1984
|
var code = codePointAt(this.message, offset);
|
|
1985
1985
|
if (code === void 0) {
|
|
1986
|
-
throw Error("Offset "
|
|
1986
|
+
throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
|
|
1987
1987
|
}
|
|
1988
1988
|
return code;
|
|
1989
1989
|
};
|
|
@@ -2033,7 +2033,7 @@ var ReactIntl = (function() {
|
|
|
2033
2033
|
};
|
|
2034
2034
|
Parser2.prototype.bumpTo = function(targetOffset) {
|
|
2035
2035
|
if (this.offset() > targetOffset) {
|
|
2036
|
-
throw Error("targetOffset "
|
|
2036
|
+
throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
2037
2037
|
}
|
|
2038
2038
|
targetOffset = Math.min(targetOffset, this.message.length);
|
|
2039
2039
|
while (true) {
|
|
@@ -2042,7 +2042,7 @@ var ReactIntl = (function() {
|
|
|
2042
2042
|
break;
|
|
2043
2043
|
}
|
|
2044
2044
|
if (offset > targetOffset) {
|
|
2045
|
-
throw Error("targetOffset "
|
|
2045
|
+
throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
|
|
2046
2046
|
}
|
|
2047
2047
|
this.bump();
|
|
2048
2048
|
if (this.isEOF()) {
|
|
@@ -2201,28 +2201,28 @@ var ReactIntl = (function() {
|
|
|
2201
2201
|
return _this;
|
|
2202
2202
|
}
|
|
2203
2203
|
FormatError2.prototype.toString = function() {
|
|
2204
|
-
return "[formatjs Error: "
|
|
2204
|
+
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
|
|
2205
2205
|
};
|
|
2206
2206
|
return FormatError2;
|
|
2207
2207
|
}(Error);
|
|
2208
2208
|
var InvalidValueError = function(_super) {
|
|
2209
2209
|
__extends(InvalidValueError2, _super);
|
|
2210
2210
|
function InvalidValueError2(variableId, value, options, originalMessage) {
|
|
2211
|
-
return _super.call(this, 'Invalid values for "'
|
|
2211
|
+
return _super.call(this, 'Invalid values for "'.concat(variableId, '": "').concat(value, '". Options are "').concat(Object.keys(options).join('", "'), '"'), ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
2212
2212
|
}
|
|
2213
2213
|
return InvalidValueError2;
|
|
2214
2214
|
}(FormatError);
|
|
2215
2215
|
var InvalidValueTypeError = function(_super) {
|
|
2216
2216
|
__extends(InvalidValueTypeError2, _super);
|
|
2217
2217
|
function InvalidValueTypeError2(value, type, originalMessage) {
|
|
2218
|
-
return _super.call(this, 'Value for "'
|
|
2218
|
+
return _super.call(this, 'Value for "'.concat(value, '" must be of type ').concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;
|
|
2219
2219
|
}
|
|
2220
2220
|
return InvalidValueTypeError2;
|
|
2221
2221
|
}(FormatError);
|
|
2222
2222
|
var MissingValueError = function(_super) {
|
|
2223
2223
|
__extends(MissingValueError2, _super);
|
|
2224
2224
|
function MissingValueError2(variableId, originalMessage) {
|
|
2225
|
-
return _super.call(this, 'The intl string context variable "'
|
|
2225
|
+
return _super.call(this, 'The intl string context variable "'.concat(variableId, '" was not provided to the string "').concat(originalMessage, '"'), ErrorCode.MISSING_VALUE, originalMessage) || this;
|
|
2226
2226
|
}
|
|
2227
2227
|
return MissingValueError2;
|
|
2228
2228
|
}(FormatError);
|
|
@@ -2349,7 +2349,7 @@ var ReactIntl = (function() {
|
|
|
2349
2349
|
continue;
|
|
2350
2350
|
}
|
|
2351
2351
|
if (isPluralElement(el)) {
|
|
2352
|
-
var opt = el.options["="
|
|
2352
|
+
var opt = el.options["=".concat(value)];
|
|
2353
2353
|
if (!opt) {
|
|
2354
2354
|
if (!Intl.PluralRules) {
|
|
2355
2355
|
throw new FormatError('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n', ErrorCode.MISSING_INTL_API, originalMessage);
|
|
@@ -2590,7 +2590,7 @@ var ReactIntl = (function() {
|
|
|
2590
2590
|
function IntlError2(code, message, exception) {
|
|
2591
2591
|
var _this = this;
|
|
2592
2592
|
var err = exception ? exception instanceof Error ? exception : new Error(String(exception)) : void 0;
|
|
2593
|
-
_this = _super.call(this, "[@formatjs/intl Error "
|
|
2593
|
+
_this = _super.call(this, "[@formatjs/intl Error ".concat(code, "] ").concat(message, " \n").concat(err ? "\n".concat(err.message, "\n").concat(err.stack) : "")) || this;
|
|
2594
2594
|
_this.code = code;
|
|
2595
2595
|
if (typeof Error.captureStackTrace === "function") {
|
|
2596
2596
|
Error.captureStackTrace(_this, IntlError2);
|
|
@@ -2623,14 +2623,14 @@ var ReactIntl = (function() {
|
|
|
2623
2623
|
var IntlFormatError = function(_super) {
|
|
2624
2624
|
__extends(IntlFormatError2, _super);
|
|
2625
2625
|
function IntlFormatError2(message, locale, exception) {
|
|
2626
|
-
return _super.call(this, IntlErrorCode.FORMAT_ERROR, message
|
|
2626
|
+
return _super.call(this, IntlErrorCode.FORMAT_ERROR, "".concat(message, " \nLocale: ").concat(locale, "\n"), exception) || this;
|
|
2627
2627
|
}
|
|
2628
2628
|
return IntlFormatError2;
|
|
2629
2629
|
}(IntlError);
|
|
2630
2630
|
var MessageFormatError = function(_super) {
|
|
2631
2631
|
__extends(MessageFormatError2, _super);
|
|
2632
2632
|
function MessageFormatError2(message, locale, descriptor, exception) {
|
|
2633
|
-
var _this = _super.call(this, message
|
|
2633
|
+
var _this = _super.call(this, "".concat(message, " \nMessageID: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, "\nDefault Message: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, "\nDescription: ").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, " \n"), locale, exception) || this;
|
|
2634
2634
|
_this.descriptor = descriptor;
|
|
2635
2635
|
return _this;
|
|
2636
2636
|
}
|
|
@@ -2639,7 +2639,7 @@ var ReactIntl = (function() {
|
|
|
2639
2639
|
var MissingTranslationError = function(_super) {
|
|
2640
2640
|
__extends(MissingTranslationError2, _super);
|
|
2641
2641
|
function MissingTranslationError2(descriptor, locale) {
|
|
2642
|
-
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, 'Missing message: "'
|
|
2642
|
+
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, 'Missing message: "'.concat(descriptor.id, '" for locale "').concat(locale, '", using ').concat(descriptor.defaultMessage ? "default message" : "id", " as fallback.")) || this;
|
|
2643
2643
|
_this.descriptor = descriptor;
|
|
2644
2644
|
return _this;
|
|
2645
2645
|
}
|
|
@@ -2794,7 +2794,7 @@ var ReactIntl = (function() {
|
|
|
2794
2794
|
if (format) {
|
|
2795
2795
|
return format;
|
|
2796
2796
|
}
|
|
2797
|
-
onError(new UnsupportedFormatterError("No "
|
|
2797
|
+
onError(new UnsupportedFormatterError("No ".concat(type, " format named: ").concat(name)));
|
|
2798
2798
|
}
|
|
2799
2799
|
|
|
2800
2800
|
// bazel-out/darwin-fastbuild/bin/packages/intl/lib/src/message.js
|
|
@@ -2848,7 +2848,7 @@ var ReactIntl = (function() {
|
|
|
2848
2848
|
var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);
|
|
2849
2849
|
return formatter.format(values);
|
|
2850
2850
|
} catch (e) {
|
|
2851
|
-
onError(new MessageFormatError('Error formatting default message for: "'
|
|
2851
|
+
onError(new MessageFormatError('Error formatting default message for: "'.concat(id, '", rendering default message verbatim'), locale, messageDescriptor, e));
|
|
2852
2852
|
return typeof defaultMessage === "string" ? defaultMessage : id;
|
|
2853
2853
|
}
|
|
2854
2854
|
}
|
|
@@ -2858,14 +2858,14 @@ var ReactIntl = (function() {
|
|
|
2858
2858
|
var formatter = state.getMessageFormat(message, locale, formats, __assign({ formatters: state }, opts || {}));
|
|
2859
2859
|
return formatter.format(values);
|
|
2860
2860
|
} catch (e) {
|
|
2861
|
-
onError(new MessageFormatError('Error formatting message: "'
|
|
2861
|
+
onError(new MessageFormatError('Error formatting message: "'.concat(id, '", using ').concat(defaultMessage ? "default message" : "id", " as fallback."), locale, messageDescriptor, e));
|
|
2862
2862
|
}
|
|
2863
2863
|
if (defaultMessage) {
|
|
2864
2864
|
try {
|
|
2865
2865
|
var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);
|
|
2866
2866
|
return formatter.format(values);
|
|
2867
2867
|
} catch (e) {
|
|
2868
|
-
onError(new MessageFormatError('Error formatting the default message for: "'
|
|
2868
|
+
onError(new MessageFormatError('Error formatting the default message for: "'.concat(id, '", rendering message verbatim'), locale, messageDescriptor, e));
|
|
2869
2869
|
}
|
|
2870
2870
|
}
|
|
2871
2871
|
if (typeof message === "string") {
|
|
@@ -3012,7 +3012,7 @@ var ReactIntl = (function() {
|
|
|
3012
3012
|
];
|
|
3013
3013
|
var now = Date.now();
|
|
3014
3014
|
function generateToken(i) {
|
|
3015
|
-
return now
|
|
3015
|
+
return "".concat(now, "_").concat(i, "_").concat(now);
|
|
3016
3016
|
}
|
|
3017
3017
|
function formatList(opts, getListFormat, values, options) {
|
|
3018
3018
|
if (options === void 0) {
|
|
@@ -3185,13 +3185,13 @@ var ReactIntl = (function() {
|
|
|
3185
3185
|
var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
|
|
3186
3186
|
if (!locale) {
|
|
3187
3187
|
if (onError) {
|
|
3188
|
-
onError(new InvalidConfigError('"locale" was not configured, using "'
|
|
3188
|
+
onError(new InvalidConfigError('"locale" was not configured, using "'.concat(defaultLocale, '" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details')));
|
|
3189
3189
|
}
|
|
3190
3190
|
resolvedConfig.locale = resolvedConfig.defaultLocale || "en";
|
|
3191
3191
|
} else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {
|
|
3192
|
-
onError(new MissingDataError('Missing locale data for locale: "'
|
|
3192
|
+
onError(new MissingDataError('Missing locale data for locale: "'.concat(locale, '" in Intl.NumberFormat. Using default locale: "').concat(defaultLocale, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details')));
|
|
3193
3193
|
} else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length && onError) {
|
|
3194
|
-
onError(new MissingDataError('Missing locale data for locale: "'
|
|
3194
|
+
onError(new MissingDataError('Missing locale data for locale: "'.concat(locale, '" in Intl.DateTimeFormat. Using default locale: "').concat(defaultLocale, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details')));
|
|
3195
3195
|
}
|
|
3196
3196
|
verifyConfigMessages(resolvedConfig);
|
|
3197
3197
|
return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });
|
|
@@ -3250,7 +3250,7 @@ var ReactIntl = (function() {
|
|
|
3250
3250
|
return React2.createElement(WrappedComponent, __assign({}, props, intlProp, { ref: forwardRef2 ? props.forwardedRef : null }));
|
|
3251
3251
|
});
|
|
3252
3252
|
};
|
|
3253
|
-
WithIntl.displayName = "injectIntl("
|
|
3253
|
+
WithIntl.displayName = "injectIntl(".concat(getDisplayName(WrappedComponent), ")");
|
|
3254
3254
|
WithIntl.WrappedComponent = WrappedComponent;
|
|
3255
3255
|
if (forwardRef2) {
|
|
3256
3256
|
return (0, import_hoist_non_react_statics.default)(React2.forwardRef(function(props, ref) {
|
|
@@ -23,7 +23,7 @@ function injectIntl(WrappedComponent, options) {
|
|
|
23
23
|
var intlProp = (_a = {}, _a[intlPropName] = intl, _a);
|
|
24
24
|
return (React.createElement(WrappedComponent, (0, tslib_1.__assign)({}, props, intlProp, { ref: forwardRef ? props.forwardedRef : null })));
|
|
25
25
|
})); };
|
|
26
|
-
WithIntl.displayName = "injectIntl("
|
|
26
|
+
WithIntl.displayName = "injectIntl(".concat(getDisplayName(WrappedComponent), ")");
|
|
27
27
|
WithIntl.WrappedComponent = WrappedComponent;
|
|
28
28
|
if (forwardRef) {
|
|
29
29
|
return (0, hoist_non_react_statics_1.default)(React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, (0, tslib_1.__assign)({}, props, { forwardedRef: ref }))); }), WrappedComponent);
|