react-intl 6.7.1 → 6.8.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.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ exports.FormattedListParts = exports.FormattedNumberParts = exports.FormattedTimeParts = exports.FormattedDateParts = exports.FormattedDisplayName = exports.FormattedList = exports.FormattedNumber = exports.FormattedTime = exports.FormattedDate = 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
+ exports.defineMessages = defineMessages;
5
+ exports.defineMessage = defineMessage;
4
6
  var tslib_1 = require("tslib");
5
7
  var createFormattedComponent_1 = require("./src/components/createFormattedComponent");
6
8
  var injectIntl_1 = tslib_1.__importStar(require("./src/components/injectIntl"));
@@ -33,11 +35,9 @@ Object.defineProperty(exports, "ReactIntlError", { enumerable: true, get: functi
33
35
  function defineMessages(msgs) {
34
36
  return msgs;
35
37
  }
36
- exports.defineMessages = defineMessages;
37
38
  function defineMessage(msg) {
38
39
  return msg;
39
40
  }
40
- exports.defineMessage = defineMessage;
41
41
  // IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./src/types').CustomFormatConfig`
42
42
  exports.FormattedDate = (0, createFormattedComponent_1.createFormattedComponent)('formatDate');
43
43
  exports.FormattedTime = (0, createFormattedComponent_1.createFormattedComponent)('formatTime');
@@ -1,6 +1,6 @@
1
1
  import { __assign } from "tslib";
2
- import * as React from 'react';
3
2
  import hoistNonReactStatics from 'hoist-non-react-statics';
3
+ import * as React from 'react';
4
4
  import { invariantIntlContext } from '../utils';
5
5
  function getDisplayName(Component) {
6
6
  return Component.displayName || Component.name || 'Component';
@@ -27,7 +27,9 @@ export default function injectIntl(WrappedComponent, options) {
27
27
  WithIntl.displayName = "injectIntl(".concat(getDisplayName(WrappedComponent), ")");
28
28
  WithIntl.WrappedComponent = WrappedComponent;
29
29
  if (forwardRef) {
30
- return hoistNonReactStatics(React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);
30
+ return hoistNonReactStatics(
31
+ // @ts-expect-error
32
+ React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);
31
33
  }
32
34
  return hoistNonReactStatics(WithIntl, WrappedComponent);
33
35
  }
@@ -23,6 +23,6 @@ export default class IntlProvider extends React.PureComponent<React.PropsWithChi
23
23
  private cache;
24
24
  state: State;
25
25
  static getDerivedStateFromProps(props: Readonly<IntlConfig>, { prevConfig, cache }: State): Partial<State> | null;
26
- render(): JSX.Element;
26
+ render(): React.JSX.Element;
27
27
  }
28
28
  export {};
@@ -3,7 +3,7 @@ import { ResolvedIntlConfig as CoreResolvedIntlConfig, IntlFormatters, Formatter
3
3
  import { DEFAULT_INTL_CONFIG } from './utils';
4
4
  export type IntlConfig = Omit<ResolvedIntlConfig, keyof typeof DEFAULT_INTL_CONFIG> & Partial<typeof DEFAULT_INTL_CONFIG>;
5
5
  export interface ResolvedIntlConfig extends CoreResolvedIntlConfig<React.ReactNode> {
6
- textComponent?: React.ComponentType | keyof React.ReactHTML;
6
+ textComponent?: React.ComponentType | keyof React.JSX.IntrinsicElements;
7
7
  wrapRichTextChunksInFragment?: boolean;
8
8
  }
9
9
  export interface IntlShape extends ResolvedIntlConfig, IntlFormatters<React.ReactNode> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-intl",
3
- "version": "6.7.1",
3
+ "version": "6.8.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",
@@ -129,19 +129,19 @@
129
129
  "sideEffects": false,
130
130
  "dependencies": {
131
131
  "@types/hoist-non-react-statics": "^3.3.1",
132
- "@types/react": "16 || 17 || 18",
132
+ "@types/react": "^18.3.11",
133
133
  "hoist-non-react-statics": "^3.3.2",
134
- "tslib": "^2.4.0",
135
- "@formatjs/ecma402-abstract": "2.0.0",
136
- "@formatjs/intl": "2.10.6",
137
- "@formatjs/icu-messageformat-parser": "2.7.8",
138
- "@formatjs/intl-displaynames": "6.6.8",
139
- "intl-messageformat": "10.5.14",
140
- "@formatjs/intl-listformat": "7.5.7"
134
+ "tslib": "^2.7.0",
135
+ "@formatjs/ecma402-abstract": "2.2.0",
136
+ "@formatjs/intl": "2.10.8",
137
+ "@formatjs/intl-displaynames": "6.6.10",
138
+ "@formatjs/intl-listformat": "7.5.9",
139
+ "intl-messageformat": "10.7.0",
140
+ "@formatjs/icu-messageformat-parser": "2.7.10"
141
141
  },
142
142
  "devDependencies": {
143
- "@formatjs/intl-numberformat": "8.10.3",
144
- "@formatjs/intl-relativetimeformat": "11.2.14"
143
+ "@formatjs/intl-numberformat": "8.12.0",
144
+ "@formatjs/intl-relativetimeformat": "11.2.16"
145
145
  },
146
146
  "peerDependencies": {
147
147
  "react": "^16.6.0 || 17 || 18",