react-intl 6.8.5 → 6.8.7
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 +3 -3
- package/lib/src/components/message.js +1 -1
- package/lib/src/components/message.js.map +1 -1
- package/lib/src/types.d.ts +4 -1
- package/package.json +9 -9
- package/src/components/message.d.ts +3 -3
- package/src/components/message.js +1 -1
- package/src/components/message.js.map +1 -1
- package/src/types.d.ts +4 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { FormatXMLElementFn, Options as IntlMessageFormatOptions, PrimitiveType } from 'intl-messageformat';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { MessageDescriptor } from '@formatjs/intl';
|
|
4
|
-
export interface Props<V extends Record<string, any> = Record<string, React.ReactNode | PrimitiveType | FormatXMLElementFn<React.ReactNode
|
|
4
|
+
export interface Props<V extends Record<string, any> = Record<string, React.ReactNode | PrimitiveType | FormatXMLElementFn<React.ReactNode>>> extends MessageDescriptor {
|
|
5
5
|
values?: V;
|
|
6
6
|
tagName?: React.ElementType<any>;
|
|
7
|
-
children?(nodes: React.ReactNode[]): React.
|
|
7
|
+
children?(nodes: React.ReactNode[]): React.ReactNode | null;
|
|
8
8
|
ignoreTag?: IntlMessageFormatOptions['ignoreTag'];
|
|
9
9
|
}
|
|
10
10
|
declare const MemoizedFormattedMessage: React.ComponentType<Props>;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { __rest } from "tslib";
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
import useIntl from './useIntl';
|
|
9
8
|
import { shallowEqual } from '../utils';
|
|
9
|
+
import useIntl from './useIntl';
|
|
10
10
|
function areEqual(prevProps, nextProps) {
|
|
11
11
|
var values = prevProps.values, otherProps = __rest(prevProps, ["values"]);
|
|
12
12
|
var nextValues = nextProps.values, nextOtherProps = __rest(nextProps, ["values"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/components/message.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;;
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/components/message.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;;AAOH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAA;AACrC,OAAO,OAAO,MAAM,WAAW,CAAA;AAc/B,SAAS,QAAQ,CAAC,SAAgB,EAAE,SAAgB;IAC3C,IAAA,MAAM,GAAmB,SAAS,OAA5B,EAAK,UAAU,UAAI,SAAS,EAAnC,UAAuB,CAAD,CAAa;IAClC,IAAQ,UAAU,GAAuB,SAAS,OAAhC,EAAK,cAAc,UAAI,SAAS,EAAnD,UAAuC,CAAD,CAAa;IACzD,OAAO,CACL,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC;QAChC,YAAY,CAAC,UAAiB,EAAE,cAAc,CAAC,CAChD,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAY;IACpC,IAAM,IAAI,GAAG,OAAO,EAAE,CAAA;IACf,IAAA,aAAa,GAA0C,IAAI,cAA9C,EAAE,KAAwC,IAAI,cAAR,EAArB,IAAI,mBAAG,KAAK,CAAC,QAAQ,KAAA,CAAQ;IAEhE,IAAA,EAAE,GAOA,KAAK,GAPL,EACF,WAAW,GAMT,KAAK,YANI,EACX,cAAc,GAKZ,KAAK,eALO,EACd,MAAM,GAIJ,KAAK,OAJD,EACN,QAAQ,GAGN,KAAK,SAHC,EACR,KAEE,KAAK,QAFkB,EAAhB,SAAS,mBAAG,IAAI,KAAA,EACzB,SAAS,GACP,KAAK,UADE,CACF;IAET,IAAM,UAAU,GAAG,EAAC,EAAE,IAAA,EAAE,WAAW,aAAA,EAAE,cAAc,gBAAA,EAAC,CAAA;IACpD,IAAI,KAAK,GAAoB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE;QAC7D,SAAS,WAAA;KACV,CAAC,CAAA;IAEF,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;IACzD,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,oBAAC,SAAS,QAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAa,CAAA;IAC/D,CAAC;IACD,OAAO,0CAAG,KAAK,CAAI,CAAA;AACrB,CAAC;AACD,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAA;AAEjD,IAAM,wBAAwB,GAA+B,KAAK,CAAC,IAAI,CACrE,gBAAgB,EAChB,QAAQ,CACT,CAAA;AACD,wBAAwB,CAAC,WAAW,GAAG,0BAA0B,CAAA;AAEjE,eAAe,wBAAwB,CAAA"}
|
package/lib/src/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ResolvedIntlConfig as CoreResolvedIntlConfig, Formatters, IntlFormatters, MessageDescriptor } from '@formatjs/intl';
|
|
2
|
+
import { FormatXMLElementFn, Options as IntlMessageFormatOptions, PrimitiveType } from 'intl-messageformat';
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
import { ResolvedIntlConfig as CoreResolvedIntlConfig, IntlFormatters, Formatters } from '@formatjs/intl';
|
|
3
4
|
import { DEFAULT_INTL_CONFIG } from './utils';
|
|
4
5
|
export type IntlConfig = Omit<ResolvedIntlConfig, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>;
|
|
5
6
|
export interface ResolvedIntlConfig extends CoreResolvedIntlConfig<React.ReactNode> {
|
|
@@ -7,5 +8,7 @@ export interface ResolvedIntlConfig extends CoreResolvedIntlConfig<React.ReactNo
|
|
|
7
8
|
wrapRichTextChunksInFragment?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface IntlShape extends ResolvedIntlConfig, IntlFormatters<React.ReactNode> {
|
|
11
|
+
formatMessage(this: void, descriptor: MessageDescriptor, values?: Record<string, PrimitiveType | FormatXMLElementFn<string, string>>, opts?: IntlMessageFormatOptions): string;
|
|
12
|
+
formatMessage(this: void, descriptor: MessageDescriptor, values?: Record<string, React.ReactNode | PrimitiveType | FormatXMLElementFn<string, React.ReactNode>>, opts?: IntlMessageFormatOptions): Array<React.ReactNode>;
|
|
10
13
|
formatters: Formatters;
|
|
11
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.7",
|
|
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",
|
|
@@ -132,16 +132,16 @@
|
|
|
132
132
|
"@types/react": "16 || 17 || 18",
|
|
133
133
|
"hoist-non-react-statics": "3",
|
|
134
134
|
"tslib": "2",
|
|
135
|
-
"@formatjs/intl
|
|
136
|
-
"@formatjs/intl": "
|
|
137
|
-
"@formatjs/
|
|
138
|
-
"@formatjs/
|
|
139
|
-
"intl-messageformat": "10.7.
|
|
140
|
-
"@formatjs/icu-messageformat-parser": "2.9.
|
|
135
|
+
"@formatjs/intl": "2.10.14",
|
|
136
|
+
"@formatjs/intl-displaynames": "6.8.4",
|
|
137
|
+
"@formatjs/ecma402-abstract": "2.2.3",
|
|
138
|
+
"@formatjs/intl-listformat": "7.7.4",
|
|
139
|
+
"intl-messageformat": "10.7.6",
|
|
140
|
+
"@formatjs/icu-messageformat-parser": "2.9.3"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
|
-
"@formatjs/intl-
|
|
144
|
-
"@formatjs/intl-
|
|
143
|
+
"@formatjs/intl-relativetimeformat": "11.4.4",
|
|
144
|
+
"@formatjs/intl-numberformat": "8.14.4"
|
|
145
145
|
},
|
|
146
146
|
"peerDependencies": {
|
|
147
147
|
"react": "^16.6.0 || 17 || 18",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { FormatXMLElementFn, Options as IntlMessageFormatOptions, PrimitiveType } from 'intl-messageformat';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { MessageDescriptor } from '@formatjs/intl';
|
|
4
|
-
export interface Props<V extends Record<string, any> = Record<string, React.ReactNode | PrimitiveType | FormatXMLElementFn<React.ReactNode
|
|
4
|
+
export interface Props<V extends Record<string, any> = Record<string, React.ReactNode | PrimitiveType | FormatXMLElementFn<React.ReactNode>>> extends MessageDescriptor {
|
|
5
5
|
values?: V;
|
|
6
6
|
tagName?: React.ElementType<any>;
|
|
7
|
-
children?(nodes: React.ReactNode[]): React.
|
|
7
|
+
children?(nodes: React.ReactNode[]): React.ReactNode | null;
|
|
8
8
|
ignoreTag?: IntlMessageFormatOptions['ignoreTag'];
|
|
9
9
|
}
|
|
10
10
|
declare const MemoizedFormattedMessage: React.ComponentType<Props>;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
var tslib_1 = require("tslib");
|
|
9
9
|
var React = tslib_1.__importStar(require("react"));
|
|
10
|
-
var useIntl_1 = tslib_1.__importDefault(require("./useIntl"));
|
|
11
10
|
var utils_1 = require("../utils");
|
|
11
|
+
var useIntl_1 = tslib_1.__importDefault(require("./useIntl"));
|
|
12
12
|
function areEqual(prevProps, nextProps) {
|
|
13
13
|
var values = prevProps.values, otherProps = tslib_1.__rest(prevProps, ["values"]);
|
|
14
14
|
var nextValues = nextProps.values, nextOtherProps = tslib_1.__rest(nextProps, ["values"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["message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KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;IACzD,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,oBAAC,SAAS,QAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAa,CAAA;IAC/D,CAAC;IACD,OAAO,0CAAG,KAAK,CAAI,CAAA;AACrB,CAAC;AACD,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAA;AAEjD,IAAM,wBAAwB,GAA+B,KAAK,CAAC,IAAI,CACrE,gBAAgB,EAChB,QAAQ,CACT,CAAA;AACD,wBAAwB,CAAC,WAAW,GAAG,0BAA0B,CAAA;AAEjE,kBAAe,wBAAwB,CAAA"}
|
package/src/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ResolvedIntlConfig as CoreResolvedIntlConfig, Formatters, IntlFormatters, MessageDescriptor } from '@formatjs/intl';
|
|
2
|
+
import { FormatXMLElementFn, Options as IntlMessageFormatOptions, PrimitiveType } from 'intl-messageformat';
|
|
1
3
|
import * as React from 'react';
|
|
2
|
-
import { ResolvedIntlConfig as CoreResolvedIntlConfig, IntlFormatters, Formatters } from '@formatjs/intl';
|
|
3
4
|
import { DEFAULT_INTL_CONFIG } from './utils';
|
|
4
5
|
export type IntlConfig = Omit<ResolvedIntlConfig, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>;
|
|
5
6
|
export interface ResolvedIntlConfig extends CoreResolvedIntlConfig<React.ReactNode> {
|
|
@@ -7,5 +8,7 @@ export interface ResolvedIntlConfig extends CoreResolvedIntlConfig<React.ReactNo
|
|
|
7
8
|
wrapRichTextChunksInFragment?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface IntlShape extends ResolvedIntlConfig, IntlFormatters<React.ReactNode> {
|
|
11
|
+
formatMessage(this: void, descriptor: MessageDescriptor, values?: Record<string, PrimitiveType | FormatXMLElementFn<string, string>>, opts?: IntlMessageFormatOptions): string;
|
|
12
|
+
formatMessage(this: void, descriptor: MessageDescriptor, values?: Record<string, React.ReactNode | PrimitiveType | FormatXMLElementFn<string, React.ReactNode>>, opts?: IntlMessageFormatOptions): Array<React.ReactNode>;
|
|
10
13
|
formatters: Formatters;
|
|
11
14
|
}
|