react-intl 5.25.0 → 6.0.2
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/lib/src/components/message.d.ts +4 -4
- package/lib/src/components/message.d.ts.map +1 -1
- package/lib/src/components/provider.d.ts +2 -2
- package/lib/src/components/provider.d.ts.map +1 -1
- package/lib/src/components/provider.js +12 -11
- package/package.json +9 -9
- package/react-intl.iife.js +6667 -2439
- package/src/components/message.d.ts +4 -4
- package/src/components/message.d.ts.map +1 -1
- package/src/components/provider.d.ts +2 -2
- package/src/components/provider.d.ts.map +1 -1
- package/src/components/provider.js +12 -11
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Options as IntlMessageFormatOptions } from 'intl-messageformat';
|
|
2
|
+
import type { FormatXMLElementFn, Options as IntlMessageFormatOptions, PrimitiveType } from 'intl-messageformat';
|
|
3
3
|
import { MessageDescriptor } from '@formatjs/intl';
|
|
4
|
-
export interface Props<V extends Record<string, any> = Record<string, React.ReactNode
|
|
4
|
+
export interface Props<V extends Record<string, any> = Record<string, React.ReactNode | PrimitiveType | FormatXMLElementFn<React.ReactNode, React.ReactNode>>> extends MessageDescriptor {
|
|
5
5
|
values?: V;
|
|
6
6
|
tagName?: React.ElementType<any>;
|
|
7
|
-
children?(nodes: React.
|
|
7
|
+
children?(nodes: React.ReactNode[]): React.ReactElement | null;
|
|
8
8
|
ignoreTag?: IntlMessageFormatOptions['ignoreTag'];
|
|
9
9
|
}
|
|
10
|
-
declare const MemoizedFormattedMessage: React.NamedExoticComponent<Props<Record<string, React.ReactNode>>>;
|
|
10
|
+
declare const MemoizedFormattedMessage: React.NamedExoticComponent<Props<Record<string, string | number | boolean | Date | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal | FormatXMLElementFn<React.ReactNode, React.ReactNode> | null | undefined>>>;
|
|
11
11
|
export default MemoizedFormattedMessage;
|
|
12
12
|
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/react-intl/src/components/message.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/react-intl/src/components/message.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EACV,kBAAkB,EAClB,OAAO,IAAI,wBAAwB,EACnC,aAAa,EACd,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAA;AAIhD,MAAM,WAAW,KAAK,CACpB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CACpC,MAAM,EACJ,KAAK,CAAC,SAAS,GACf,aAAa,GACb,kBAAkB,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CACvD,CACD,SAAQ,iBAAiB;IACzB,MAAM,CAAC,EAAE,CAAC,CAAA;IACV,OAAO,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IAChC,QAAQ,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;IAC9D,SAAS,CAAC,EAAE,wBAAwB,CAAC,WAAW,CAAC,CAAA;CAClD;AAwCD,QAAA,MAAM,wBAAwB,8QAAgD,CAAA;AAG9E,eAAe,wBAAwB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { IntlConfig, IntlShape } from '../types';
|
|
2
|
+
import type { IntlConfig, IntlShape, ResolvedIntlConfig } from '../types';
|
|
3
3
|
import { IntlCache, CreateIntlFn } from '@formatjs/intl';
|
|
4
4
|
interface State {
|
|
5
5
|
/**
|
|
@@ -25,7 +25,7 @@ interface State {
|
|
|
25
25
|
export declare const createIntl: CreateIntlFn<React.ReactNode, IntlConfig, IntlShape>;
|
|
26
26
|
export default class IntlProvider extends React.PureComponent<React.PropsWithChildren<IntlConfig>, State> {
|
|
27
27
|
static displayName: string;
|
|
28
|
-
static defaultProps: Pick<
|
|
28
|
+
static defaultProps: Pick<ResolvedIntlConfig, "timeZone" | "fallbackOnEmptyString" | "formats" | "messages" | "defaultLocale" | "defaultFormats" | "onError" | "textComponent">;
|
|
29
29
|
private cache;
|
|
30
30
|
state: State;
|
|
31
31
|
static getDerivedStateFromProps(props: Readonly<IntlConfig>, { prevConfig, cache }: State): Partial<State> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/react-intl/src/components/provider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/react-intl/src/components/provider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,KAAK,EAAC,UAAU,EAAE,SAAS,EAAE,kBAAkB,EAAC,MAAM,UAAU,CAAA;AACvE,OAAO,EAEL,SAAS,EAET,YAAY,EAGb,MAAM,gBAAgB,CAAA;AAQvB,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,SAAS,CAAA;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;;OAIG;IACH,UAAU,EAAE,UAAU,CAAA;CACvB;AAmED;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,YAAY,CACnC,KAAK,CAAC,SAAS,EACf,UAAU,EACV,SAAS,CAsCV,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK,CAAC,aAAa,CAG3D,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,EACnC,KAAK,CACN;IACC,MAAM,CAAC,WAAW,SAAiB;IACnC,MAAM,CAAC,YAAY,6JAAsB;IACzC,OAAO,CAAC,KAAK,CAA+B;IAC5C,KAAK,EAAE,KAAK,CAIX;IAED,MAAM,CAAC,wBAAwB,CAC7B,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,EAC3B,EAAC,UAAU,EAAE,KAAK,EAAC,EAAE,KAAK,GACzB,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI;IAWxB,MAAM,IAAI,GAAG,CAAC,OAAO;CAItB"}
|
|
@@ -61,17 +61,18 @@ export var createIntl = function (_a, cache) {
|
|
|
61
61
|
var rawDefaultRichTextElements = _a.defaultRichTextElements, config = __rest(_a, ["defaultRichTextElements"]);
|
|
62
62
|
var defaultRichTextElements = assignUniqueKeysToFormatXMLElementFnArgument(rawDefaultRichTextElements);
|
|
63
63
|
var coreIntl = coreCreateIntl(__assign(__assign(__assign({}, DEFAULT_INTL_CONFIG), config), { defaultRichTextElements: defaultRichTextElements }), cache);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
var resolvedConfig = {
|
|
65
|
+
locale: coreIntl.locale,
|
|
66
|
+
timeZone: coreIntl.timeZone,
|
|
67
|
+
fallbackOnEmptyString: coreIntl.fallbackOnEmptyString,
|
|
68
|
+
formats: coreIntl.formats,
|
|
69
|
+
defaultLocale: coreIntl.defaultLocale,
|
|
70
|
+
defaultFormats: coreIntl.defaultFormats,
|
|
71
|
+
messages: coreIntl.messages,
|
|
72
|
+
onError: coreIntl.onError,
|
|
73
|
+
defaultRichTextElements: defaultRichTextElements,
|
|
74
|
+
};
|
|
75
|
+
return __assign(__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig, coreIntl.formatters), $t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });
|
|
75
76
|
};
|
|
76
77
|
var IntlProvider = /** @class */ (function (_super) {
|
|
77
78
|
__extends(IntlProvider, _super);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.2",
|
|
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,19 +128,19 @@
|
|
|
128
128
|
"types": "index.d.ts",
|
|
129
129
|
"sideEffects": false,
|
|
130
130
|
"dependencies": {
|
|
131
|
-
"@formatjs/ecma402-abstract": "1.11.
|
|
132
|
-
"@formatjs/icu-messageformat-parser": "2.
|
|
133
|
-
"@formatjs/intl": "2.2.
|
|
134
|
-
"@formatjs/intl-displaynames": "
|
|
135
|
-
"@formatjs/intl-listformat": "
|
|
131
|
+
"@formatjs/ecma402-abstract": "1.11.6",
|
|
132
|
+
"@formatjs/icu-messageformat-parser": "2.1.2",
|
|
133
|
+
"@formatjs/intl": "2.2.4",
|
|
134
|
+
"@formatjs/intl-displaynames": "6.0.1",
|
|
135
|
+
"@formatjs/intl-listformat": "7.0.1",
|
|
136
136
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
137
137
|
"@types/react": "16 || 17 || 18",
|
|
138
138
|
"hoist-non-react-statics": "^3.3.2",
|
|
139
|
-
"intl-messageformat": "
|
|
140
|
-
"tslib": "
|
|
139
|
+
"intl-messageformat": "10.0.1",
|
|
140
|
+
"tslib": "2.4.0"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
|
-
"react": "^16.
|
|
143
|
+
"react": "^16.6.0 || 17 || 18",
|
|
144
144
|
"typescript": "^4.5"
|
|
145
145
|
},
|
|
146
146
|
"peerDependenciesMeta": {
|