react-intl 7.0.2 → 7.0.4

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.
@@ -1,6 +1,7 @@
1
1
  import { IntlCache } from '@formatjs/intl';
2
2
  import * as React from 'react';
3
3
  import type { IntlConfig, IntlShape } from '../types';
4
+ import { DefaultIntlConfig } from '../utils';
4
5
  interface State {
5
6
  /**
6
7
  * Explicit intl cache to prevent memory leaks
@@ -19,7 +20,7 @@ interface State {
19
20
  }
20
21
  export default class IntlProvider extends React.PureComponent<React.PropsWithChildren<IntlConfig>, State> {
21
22
  static displayName: string;
22
- static defaultProps: Pick<import("../types").ResolvedIntlConfig, "timeZone" | "fallbackOnEmptyString" | "formats" | "messages" | "defaultLocale" | "defaultFormats" | "onError" | "textComponent">;
23
+ static defaultProps: DefaultIntlConfig;
23
24
  private cache;
24
25
  state: State;
25
26
  static getDerivedStateFromProps(props: Readonly<IntlConfig>, { prevConfig, cache }: State): Partial<State> | null;
@@ -6,9 +6,9 @@
6
6
  import { __extends } from "tslib";
7
7
  import { createIntlCache } from '@formatjs/intl';
8
8
  import * as React from 'react';
9
- import { DEFAULT_INTL_CONFIG, invariantIntlContext, shallowEqual } from '../utils';
10
- import { Provider } from './injectIntl';
9
+ import { DEFAULT_INTL_CONFIG, invariantIntlContext, shallowEqual, } from '../utils';
11
10
  import { createIntl } from './createIntl';
11
+ import { Provider } from './injectIntl';
12
12
  function processIntlConfig(config) {
13
13
  return {
14
14
  locale: config.locale,
@@ -3,7 +3,8 @@ import * as React from 'react';
3
3
  import { ResolvedIntlConfig } from './types';
4
4
  export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition;
5
5
  export declare function invariantIntlContext(intl?: any): asserts intl;
6
- export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'textComponent' | 'defaultLocale' | 'defaultFormats' | 'onError'>;
6
+ export type DefaultIntlConfig = Pick<ResolvedIntlConfig, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'textComponent' | 'defaultLocale' | 'defaultFormats' | 'onError'>;
7
+ export declare const DEFAULT_INTL_CONFIG: DefaultIntlConfig;
7
8
  /**
8
9
  * Takes a `formatXMLElementFn`, and composes it in function, which passes
9
10
  * argument `parts` through, assigning unique key to each part, to prevent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-intl",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
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,10 +132,10 @@
132
132
  "@types/react": "16 || 17 || 18 || 19",
133
133
  "hoist-non-react-statics": "3",
134
134
  "tslib": "2",
135
- "@formatjs/ecma402-abstract": "2.2.5",
136
- "@formatjs/icu-messageformat-parser": "2.9.5",
137
- "@formatjs/intl": "3.0.2",
138
- "intl-messageformat": "10.7.8"
135
+ "intl-messageformat": "10.7.10",
136
+ "@formatjs/ecma402-abstract": "2.3.1",
137
+ "@formatjs/intl": "3.0.4",
138
+ "@formatjs/icu-messageformat-parser": "2.9.7"
139
139
  },
140
140
  "peerDependencies": {
141
141
  "react": "^16.6.0 || 17 || 18 || 19",
@@ -1,6 +1,7 @@
1
1
  import { IntlCache } from '@formatjs/intl';
2
2
  import * as React from 'react';
3
3
  import type { IntlConfig, IntlShape } from '../types';
4
+ import { DefaultIntlConfig } from '../utils';
4
5
  interface State {
5
6
  /**
6
7
  * Explicit intl cache to prevent memory leaks
@@ -19,7 +20,7 @@ interface State {
19
20
  }
20
21
  export default class IntlProvider extends React.PureComponent<React.PropsWithChildren<IntlConfig>, State> {
21
22
  static displayName: string;
22
- static defaultProps: Pick<import("../types").ResolvedIntlConfig, "timeZone" | "fallbackOnEmptyString" | "formats" | "messages" | "defaultLocale" | "defaultFormats" | "onError" | "textComponent">;
23
+ static defaultProps: DefaultIntlConfig;
23
24
  private cache;
24
25
  state: State;
25
26
  static getDerivedStateFromProps(props: Readonly<IntlConfig>, { prevConfig, cache }: State): Partial<State> | null;
@@ -9,8 +9,8 @@ var tslib_1 = require("tslib");
9
9
  var intl_1 = require("@formatjs/intl");
10
10
  var React = tslib_1.__importStar(require("react"));
11
11
  var utils_1 = require("../utils");
12
- var injectIntl_1 = require("./injectIntl");
13
12
  var createIntl_1 = require("./createIntl");
13
+ var injectIntl_1 = require("./injectIntl");
14
14
  function processIntlConfig(config) {
15
15
  return {
16
16
  locale: config.locale,
package/src/utils.d.ts CHANGED
@@ -3,7 +3,8 @@ import * as React from 'react';
3
3
  import { ResolvedIntlConfig } from './types';
4
4
  export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition;
5
5
  export declare function invariantIntlContext(intl?: any): asserts intl;
6
- export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'textComponent' | 'defaultLocale' | 'defaultFormats' | 'onError'>;
6
+ export type DefaultIntlConfig = Pick<ResolvedIntlConfig, 'fallbackOnEmptyString' | 'formats' | 'messages' | 'timeZone' | 'textComponent' | 'defaultLocale' | 'defaultFormats' | 'onError'>;
7
+ export declare const DEFAULT_INTL_CONFIG: DefaultIntlConfig;
7
8
  /**
8
9
  * Takes a `formatXMLElementFn`, and composes it in function, which passes
9
10
  * argument `parts` through, assigning unique key to each part, to prevent