react-intl 4.7.2 → 4.7.6
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/CHANGELOG.md +35 -0
- package/dist/components/plural.d.ts +2 -2
- package/dist/components/plural.d.ts.map +1 -1
- package/dist/components/plural.js +4 -1
- package/dist/components/plural.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react-intl.api.md +6 -6
- package/dist/react-intl.d.ts +20 -6
- package/dist/react-intl.js +5 -2
- package/dist/react-intl.js.map +1 -1
- package/dist/react-intl.min.js +1 -1
- package/dist/react-intl.min.js.map +1 -1
- package/lib/components/plural.d.ts +2 -2
- package/lib/components/plural.d.ts.map +1 -1
- package/lib/components/plural.js +4 -1
- package/lib/components/plural.js.map +1 -1
- package/lib/index.d.ts +7 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/react-intl.d.ts +6 -6
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +14 -14
- package/src/components/plural.tsx +6 -2
- package/src/index.ts +14 -7
|
@@ -12,8 +12,8 @@ interface Props extends FormatPluralOptions {
|
|
|
12
12
|
many?: React.ReactNode;
|
|
13
13
|
children?(value: React.ReactNode): React.ReactElement | null;
|
|
14
14
|
}
|
|
15
|
-
declare const
|
|
15
|
+
declare const FormattedPluralWithIntl: React.FC<WithIntlProps<Props>> & {
|
|
16
16
|
WrappedComponent: React.ComponentType<Props>;
|
|
17
17
|
};
|
|
18
|
-
export default
|
|
18
|
+
export default FormattedPluralWithIntl;
|
|
19
19
|
//# sourceMappingURL=plural.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plural.d.ts","sourceRoot":"","sources":["../../src/components/plural.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAiB,EAAC,aAAa,EAAC,MAAM,cAAc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,YAAY,GAAG,IAAI,CAAC;CAC9D;AA+BD,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG;IAC9D,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;CAClB,CAAC;AAE9B,eAAe,uBAAuB,CAAC"}
|
package/lib/components/plural.js
CHANGED
|
@@ -22,5 +22,8 @@ FormattedPlural.defaultProps = {
|
|
|
22
22
|
type: 'cardinal',
|
|
23
23
|
};
|
|
24
24
|
FormattedPlural.displayName = 'FormattedPlural';
|
|
25
|
-
|
|
25
|
+
// Explicitly annotate type here to workaround API extractor's inability to handle `import('./someModule')`
|
|
26
|
+
// type annotations when rolling up DTS file.
|
|
27
|
+
var FormattedPluralWithIntl = withIntl(FormattedPlural);
|
|
28
|
+
export default FormattedPluralWithIntl;
|
|
26
29
|
//# sourceMappingURL=plural.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plural.js","sourceRoot":"","sources":["../../src/components/plural.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAyB,MAAM,cAAc,CAAC;AAerD,IAAM,eAAe,GAAoB,UAAA,KAAK;IAE1C,IAAA,mBAAK,EACL,mBAAK,EACL,yBAAQ,EACR,eAAyC,EAAlC,8BAAY,EAAE,uBAAoB,CACjC;IAEV,IAAM,cAAc,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,IAAM,eAAe,GAAG,KAAK,CAAC,cAAuB,CAAC,IAAI,KAAK,CAAC;IAEhE,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;QAClC,OAAO,QAAQ,CAAC,eAAe,CAAC,CAAC;KAClC;IACD,IAAI,IAAI,EAAE;QACR,OAAO,oBAAC,IAAI,QAAE,eAAe,CAAQ,CAAC;KACvC;IACD,+DAA+D;IAC/D,OAAO,eAAsB,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG;IAC7B,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,
|
|
1
|
+
{"version":3,"file":"plural.js","sourceRoot":"","sources":["../../src/components/plural.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAyB,MAAM,cAAc,CAAC;AAerD,IAAM,eAAe,GAAoB,UAAA,KAAK;IAE1C,IAAA,mBAAK,EACL,mBAAK,EACL,yBAAQ,EACR,eAAyC,EAAlC,8BAAY,EAAE,uBAAoB,CACjC;IAEV,IAAM,cAAc,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,IAAM,eAAe,GAAG,KAAK,CAAC,cAAuB,CAAC,IAAI,KAAK,CAAC;IAEhE,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;QAClC,OAAO,QAAQ,CAAC,eAAe,CAAC,CAAC;KAClC;IACD,IAAI,IAAI,EAAE;QACR,OAAO,oBAAC,IAAI,QAAE,eAAe,CAAQ,CAAC;KACvC;IACD,+DAA+D;IAC/D,OAAO,eAAsB,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG;IAC7B,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAEhD,2GAA2G;AAC3G,6CAA6C;AAC7C,IAAM,uBAAuB,GAEzB,QAAQ,CAAC,eAAe,CAAC,CAAC;AAE9B,eAAe,uBAAuB,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
export * from './types';
|
|
3
3
|
export declare function defineMessages<T, U extends Record<string, T>>(msgs: U): U;
|
|
4
4
|
export declare function defineMessage<T>(msg: T): T;
|
|
5
|
-
import { CustomFormatConfig } from './types';
|
|
5
|
+
import { CustomFormatConfig, FormatDateOptions } from './types';
|
|
6
6
|
import { NumberFormatOptions } from '@formatjs/intl-numberformat';
|
|
7
7
|
import { IntlListFormatOptions } from '@formatjs/intl-listformat';
|
|
8
8
|
import { DisplayNamesOptions } from '@formatjs/intl-displaynames/lib';
|
|
@@ -25,13 +25,13 @@ export declare const FormattedList: React.FC<IntlListFormatOptions & {
|
|
|
25
25
|
export declare const FormattedDisplayName: React.FC<DisplayNamesOptions & {
|
|
26
26
|
value: string | number | object;
|
|
27
27
|
}>;
|
|
28
|
-
export declare const FormattedDateParts: React.FC<
|
|
29
|
-
value:
|
|
30
|
-
children(val: Intl.DateTimeFormatPart[]): React.ReactElement
|
|
28
|
+
export declare const FormattedDateParts: React.FC<FormatDateOptions & {
|
|
29
|
+
value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
|
|
30
|
+
children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
|
|
31
31
|
}>;
|
|
32
|
-
export declare const FormattedTimeParts: React.FC<
|
|
33
|
-
value:
|
|
34
|
-
children(val: Intl.DateTimeFormatPart[]): React.ReactElement
|
|
32
|
+
export declare const FormattedTimeParts: React.FC<FormatDateOptions & {
|
|
33
|
+
value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
|
|
34
|
+
children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
|
|
35
35
|
}>;
|
|
36
36
|
export { FormattedNumberParts } from './components/createFormattedComponent';
|
|
37
37
|
export { default as FormattedRelativeTime } from './components/relative';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAA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AAe,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AACxC,cAAc,SAAS,CAAC"}
|
package/lib/react-intl.d.ts
CHANGED
|
@@ -55,9 +55,9 @@ export declare const FormattedDate: React_2.FC<DateTimeFormatOptions & CustomFor
|
|
|
55
55
|
value: string | number | Date | undefined;
|
|
56
56
|
}>;
|
|
57
57
|
|
|
58
|
-
export declare const FormattedDateParts: React_2.FC<
|
|
59
|
-
value:
|
|
60
|
-
children(val: Intl.DateTimeFormatPart[]): React_2.ReactElement
|
|
58
|
+
export declare const FormattedDateParts: React_2.FC<FormatDateOptions & {
|
|
59
|
+
value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
|
|
60
|
+
children(val: Intl.DateTimeFormatPart[]): React_2.ReactElement | null;
|
|
61
61
|
}>;
|
|
62
62
|
|
|
63
63
|
export declare const FormattedDisplayName: React_2.FC<DisplayNamesOptions_2 & {
|
|
@@ -105,9 +105,9 @@ export declare const FormattedTime: React_2.FC<DateTimeFormatOptions & CustomFor
|
|
|
105
105
|
value: string | number | Date | undefined;
|
|
106
106
|
}>;
|
|
107
107
|
|
|
108
|
-
export declare const FormattedTimeParts: React_2.FC<
|
|
109
|
-
value:
|
|
110
|
-
children(val: Intl.DateTimeFormatPart[]): React_2.ReactElement
|
|
108
|
+
export declare const FormattedTimeParts: React_2.FC<FormatDateOptions & {
|
|
109
|
+
value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
|
|
110
|
+
children(val: Intl.DateTimeFormatPart[]): React_2.ReactElement | null;
|
|
111
111
|
}>;
|
|
112
112
|
|
|
113
113
|
declare type Formatter = {
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.6",
|
|
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",
|
|
@@ -133,18 +133,18 @@
|
|
|
133
133
|
"types": "./lib/react-intl.d.ts",
|
|
134
134
|
"sideEffects": false,
|
|
135
135
|
"dependencies": {
|
|
136
|
-
"@formatjs/intl-datetimeformat": "^1.
|
|
137
|
-
"@formatjs/intl-displaynames": "^2.2.
|
|
138
|
-
"@formatjs/intl-listformat": "^2.2.
|
|
139
|
-
"@formatjs/intl-numberformat": "^4.2.
|
|
140
|
-
"@formatjs/intl-relativetimeformat": "^5.2.
|
|
141
|
-
"@formatjs/intl-utils": "^3.
|
|
136
|
+
"@formatjs/intl-datetimeformat": "^1.3.3",
|
|
137
|
+
"@formatjs/intl-displaynames": "^2.2.9",
|
|
138
|
+
"@formatjs/intl-listformat": "^2.2.9",
|
|
139
|
+
"@formatjs/intl-numberformat": "^4.2.11",
|
|
140
|
+
"@formatjs/intl-relativetimeformat": "^5.2.11",
|
|
141
|
+
"@formatjs/intl-utils": "^3.5.0",
|
|
142
142
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
143
143
|
"@types/invariant": "^2.2.31",
|
|
144
144
|
"hoist-non-react-statics": "^3.3.2",
|
|
145
|
-
"intl-format-cache": "^4.2.
|
|
146
|
-
"intl-messageformat": "^8.
|
|
147
|
-
"intl-messageformat-parser": "^5.1
|
|
145
|
+
"intl-format-cache": "^4.2.43",
|
|
146
|
+
"intl-messageformat": "^8.4.1",
|
|
147
|
+
"intl-messageformat-parser": "^5.2.1",
|
|
148
148
|
"shallow-equal": "^1.2.1"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
@@ -167,9 +167,8 @@
|
|
|
167
167
|
"ie 11"
|
|
168
168
|
],
|
|
169
169
|
"devDependencies": {
|
|
170
|
-
"@formatjs/intl-pluralrules": "^2.2.
|
|
171
|
-
"@microsoft/api-documenter": "^7.
|
|
172
|
-
"@microsoft/api-extractor": "^7.7.13",
|
|
170
|
+
"@formatjs/intl-pluralrules": "^2.2.11",
|
|
171
|
+
"@microsoft/api-documenter": "^7.8.14",
|
|
173
172
|
"@types/benchmark": "^1.0.31",
|
|
174
173
|
"@types/enzyme": "^3.10.5",
|
|
175
174
|
"@types/jest": "^25.2.1",
|
|
@@ -177,6 +176,7 @@
|
|
|
177
176
|
"@types/react": "^16.9.34",
|
|
178
177
|
"@types/react-dom": "^16.9.6",
|
|
179
178
|
"benchmark": "^2.1.4",
|
|
179
|
+
"core-js": "^3.6.5",
|
|
180
180
|
"cross-env": "^7.0.2",
|
|
181
181
|
"enzyme": "^3.11.0",
|
|
182
182
|
"enzyme-adapter-react-16": "^1.15.2",
|
|
@@ -197,5 +197,5 @@
|
|
|
197
197
|
"tslib": "^1.11.1",
|
|
198
198
|
"typescript": "3.8"
|
|
199
199
|
},
|
|
200
|
-
"gitHead": "
|
|
200
|
+
"gitHead": "76e649f2f673c1344fe29ccf739d4b4ebd573ead"
|
|
201
201
|
}
|
|
@@ -47,6 +47,10 @@ FormattedPlural.defaultProps = {
|
|
|
47
47
|
|
|
48
48
|
FormattedPlural.displayName = 'FormattedPlural';
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
// Explicitly annotate type here to workaround API extractor's inability to handle `import('./someModule')`
|
|
51
|
+
// type annotations when rolling up DTS file.
|
|
52
|
+
const FormattedPluralWithIntl: React.FC<WithIntlProps<Props>> & {
|
|
51
53
|
WrappedComponent: React.ComponentType<Props>;
|
|
52
|
-
};
|
|
54
|
+
} = withIntl(FormattedPlural);
|
|
55
|
+
|
|
56
|
+
export default FormattedPluralWithIntl;
|
package/src/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
createFormattedComponent,
|
|
16
16
|
createFormattedDateTimePartsComponent,
|
|
17
17
|
} from './components/createFormattedComponent';
|
|
18
|
-
import {CustomFormatConfig} from './types';
|
|
18
|
+
import {CustomFormatConfig, FormatDateOptions} from './types';
|
|
19
19
|
import {NumberFormatOptions} from '@formatjs/intl-numberformat';
|
|
20
20
|
import {IntlListFormatOptions} from '@formatjs/intl-listformat';
|
|
21
21
|
import {DisplayNamesOptions} from '@formatjs/intl-displaynames/lib';
|
|
@@ -58,12 +58,19 @@ export const FormattedDisplayName: React.FC<
|
|
|
58
58
|
value: string | number | object;
|
|
59
59
|
}
|
|
60
60
|
> = createFormattedComponent('formatDisplayName');
|
|
61
|
-
export const FormattedDateParts
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
);
|
|
61
|
+
export const FormattedDateParts: React.FC<
|
|
62
|
+
FormatDateOptions & {
|
|
63
|
+
value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
|
|
64
|
+
children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
|
|
65
|
+
}
|
|
66
|
+
> = createFormattedDateTimePartsComponent('formatDate');
|
|
67
|
+
export const FormattedTimeParts: React.FC<
|
|
68
|
+
FormatDateOptions & {
|
|
69
|
+
value: Parameters<Intl.DateTimeFormat['format']>[0] | string;
|
|
70
|
+
children(val: Intl.DateTimeFormatPart[]): React.ReactElement | null;
|
|
71
|
+
}
|
|
72
|
+
> = createFormattedDateTimePartsComponent('formatTime');
|
|
73
|
+
|
|
67
74
|
export {FormattedNumberParts} from './components/createFormattedComponent';
|
|
68
75
|
export {default as FormattedRelativeTime} from './components/relative';
|
|
69
76
|
export {default as FormattedPlural} from './components/plural';
|