react-intl 7.1.9 → 7.1.11

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 CHANGED
@@ -9,6 +9,7 @@ import FormattedPlural from './src/components/plural';
9
9
  import IntlProvider from './src/components/provider';
10
10
  import FormattedRelativeTime from './src/components/relative';
11
11
  import useIntl from './src/components/useIntl';
12
+ import { IntlShape } from './src/types';
12
13
  export { createIntlCache, CustomFormatConfig, CustomFormats, FormatDateOptions, FormatDisplayNameOptions, FormatListOptions, FormatNumberOptions, FormatPluralOptions, FormatRelativeTimeOptions, Formatters, IntlCache, IntlFormatters, InvalidConfigError, MessageDescriptor, MessageFormatError, MissingDataError, MissingTranslationError, IntlError as ReactIntlError, IntlErrorCode as ReactIntlErrorCode, UnsupportedFormatterError, } from '@formatjs/intl';
13
14
  export { IntlConfig, IntlShape, ResolvedIntlConfig } from './src/types';
14
15
  export { createIntl, FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, injectIntl, IntlContext, IntlProvider, RawIntlProvider, useIntl, WithIntlProps, WrappedComponentProps, };
@@ -23,7 +24,7 @@ export declare const FormattedTime: React.FC<Intl.DateTimeFormatOptions & Custom
23
24
  children?(formattedTime: string): React.ReactElement | null;
24
25
  }>;
25
26
  export declare const FormattedNumber: React.FC<Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'> & {
26
- value: number;
27
+ value: Parameters<IntlShape['formatNumber']>[0];
27
28
  children?(formattedNumber: string): React.ReactElement | null;
28
29
  }>;
29
30
  export declare const FormattedList: React.FC<Intl.ListFormatOptions & {
package/lib/index.d.ts CHANGED
@@ -9,6 +9,7 @@ import FormattedPlural from './src/components/plural';
9
9
  import IntlProvider from './src/components/provider';
10
10
  import FormattedRelativeTime from './src/components/relative';
11
11
  import useIntl from './src/components/useIntl';
12
+ import { IntlShape } from './src/types';
12
13
  export { createIntlCache, CustomFormatConfig, CustomFormats, FormatDateOptions, FormatDisplayNameOptions, FormatListOptions, FormatNumberOptions, FormatPluralOptions, FormatRelativeTimeOptions, Formatters, IntlCache, IntlFormatters, InvalidConfigError, MessageDescriptor, MessageFormatError, MissingDataError, MissingTranslationError, IntlError as ReactIntlError, IntlErrorCode as ReactIntlErrorCode, UnsupportedFormatterError, } from '@formatjs/intl';
13
14
  export { IntlConfig, IntlShape, ResolvedIntlConfig } from './src/types';
14
15
  export { createIntl, FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, injectIntl, IntlContext, IntlProvider, RawIntlProvider, useIntl, WithIntlProps, WrappedComponentProps, };
@@ -23,7 +24,7 @@ export declare const FormattedTime: React.FC<Intl.DateTimeFormatOptions & Custom
23
24
  children?(formattedTime: string): React.ReactElement | null;
24
25
  }>;
25
26
  export declare const FormattedNumber: React.FC<Omit<NumberFormatOptions, 'localeMatcher'> & CustomFormatConfig<'number'> & {
26
- value: number;
27
+ value: Parameters<IntlShape['formatNumber']>[0];
27
28
  children?(formattedNumber: string): React.ReactElement | null;
28
29
  }>;
29
30
  export declare const FormattedList: React.FC<Intl.ListFormatOptions & {
@@ -22,7 +22,7 @@ function FormattedMessage(props) {
22
22
  ignoreTag: ignoreTag,
23
23
  });
24
24
  if (typeof children === 'function') {
25
- return children(nodes);
25
+ return children(Array.isArray(nodes) ? nodes : [nodes]);
26
26
  }
27
27
  if (Component) {
28
28
  return React.createElement(Component, null, nodes);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-intl",
3
3
  "description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",
4
- "version": "7.1.9",
4
+ "version": "7.1.11",
5
5
  "license": "BSD-3-Clause",
6
6
  "author": "Eric Ferraiuolo <edf@ericf.me>",
7
7
  "sideEffects": false,
@@ -12,13 +12,13 @@
12
12
  "hoist-non-react-statics": "^3.3.2",
13
13
  "tslib": "^2.8.0",
14
14
  "intl-messageformat": "10.7.16",
15
- "@formatjs/ecma402-abstract": "2.3.4",
16
15
  "@formatjs/icu-messageformat-parser": "2.11.2",
17
- "@formatjs/intl": "3.1.5"
16
+ "@formatjs/intl": "3.1.6",
17
+ "@formatjs/ecma402-abstract": "2.3.4"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "react": "16 || 17 || 18 || 19",
21
- "typescript": "5.8.2"
21
+ "typescript": "^5.6.0"
22
22
  },
23
23
  "browserslist": [
24
24
  "ie 11"
@@ -4633,7 +4633,7 @@ var ReactIntl = (() => {
4633
4633
  ignoreTag
4634
4634
  });
4635
4635
  if (typeof children === "function") {
4636
- return children(nodes);
4636
+ return children(Array.isArray(nodes) ? nodes : [nodes]);
4637
4637
  }
4638
4638
  if (Component) {
4639
4639
  return React6.createElement(Component, null, nodes);
@@ -24,7 +24,7 @@ function FormattedMessage(props) {
24
24
  ignoreTag: ignoreTag,
25
25
  });
26
26
  if (typeof children === 'function') {
27
- return children(nodes);
27
+ return children(Array.isArray(nodes) ? nodes : [nodes]);
28
28
  }
29
29
  if (Component) {
30
30
  return React.createElement(Component, null, nodes);