Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-intl

Package Overview
Dependencies
Maintainers
8
Versions
345
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intl - npm Package Compare versions

Comparing version 6.8.9 to 7.0.0

32

index.d.ts

@@ -0,17 +1,15 @@

import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
import { CustomFormatConfig, FormatDateOptions, MessageDescriptor } from '@formatjs/intl';
import * as React from 'react';
import { MessageDescriptor, CustomFormatConfig, FormatDateOptions } from '@formatjs/intl';
import { IntlListFormatOptions } from '@formatjs/intl-listformat';
import { DisplayNamesOptions } from '@formatjs/intl-displaynames';
import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
import injectIntl, { Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps } from './src/components/injectIntl';
import useIntl from './src/components/useIntl';
import { createIntl } from './src/components/createIntl';
import FormattedDateTimeRange from './src/components/dateTimeRange';
import injectIntl, { Context as IntlContext, Provider as RawIntlProvider, WithIntlProps, WrappedComponentProps } from './src/components/injectIntl';
import FormattedMessage from './src/components/message';
import FormattedPlural from './src/components/plural';
import IntlProvider from './src/components/provider';
import { createIntl } from './src/components/createIntl';
import FormattedRelativeTime from './src/components/relative';
import FormattedPlural from './src/components/plural';
import FormattedMessage from './src/components/message';
import FormattedDateTimeRange from './src/components/dateTimeRange';
export { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, WithIntlProps, WrappedComponentProps, createIntl, injectIntl, useIntl, };
export { IntlConfig, ResolvedIntlConfig, IntlShape } from './src/types';
export { createIntlCache, MessageDescriptor, IntlCache, Formatters, IntlFormatters, FormatDisplayNameOptions, FormatListOptions, FormatPluralOptions, FormatRelativeTimeOptions, FormatNumberOptions, FormatDateOptions, CustomFormatConfig, CustomFormats, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';
import useIntl from './src/components/useIntl';
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';
export { IntlConfig, IntlShape, ResolvedIntlConfig } from './src/types';
export { createIntl, FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, injectIntl, IntlContext, IntlProvider, RawIntlProvider, useIntl, WithIntlProps, WrappedComponentProps, };
export declare function defineMessages<K extends keyof any, T = MessageDescriptor, U extends Record<K, T> = Record<K, T>>(msgs: U): U;

@@ -31,7 +29,7 @@ export declare function defineMessage<T extends MessageDescriptor>(msg: T): T;

}>;
export declare const FormattedList: React.FC<IntlListFormatOptions & {
export declare const FormattedList: React.FC<Intl.ListFormatOptions & {
value: readonly React.ReactNode[];
}>;
export declare const FormattedDisplayName: React.FC<DisplayNamesOptions & {
value: string | number | Record<string, unknown>;
export declare const FormattedDisplayName: React.FC<Intl.DisplayNamesOptions & {
value: string;
}>;

@@ -46,4 +44,4 @@ export declare const FormattedDateParts: React.FC<FormatDateOptions & {

}>;
export { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';
export type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
export type { PrimitiveType } from 'intl-messageformat';
export { FormattedListParts, FormattedNumberParts, } from './src/components/createFormattedComponent';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
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;
exports.FormattedNumberParts = exports.FormattedListParts = exports.FormattedTimeParts = exports.FormattedDateParts = exports.FormattedDisplayName = exports.FormattedList = exports.FormattedNumber = exports.FormattedTime = exports.FormattedDate = exports.useIntl = exports.RawIntlProvider = exports.IntlProvider = exports.IntlContext = exports.injectIntl = exports.FormattedRelativeTime = exports.FormattedPlural = exports.FormattedMessage = exports.FormattedDateTimeRange = exports.createIntl = exports.UnsupportedFormatterError = exports.ReactIntlErrorCode = exports.ReactIntlError = exports.MissingTranslationError = exports.MissingDataError = exports.MessageFormatError = exports.InvalidConfigError = exports.createIntlCache = void 0;
exports.defineMessages = defineMessages;

@@ -8,29 +8,29 @@ exports.defineMessage = defineMessage;

var createFormattedComponent_1 = require("./src/components/createFormattedComponent");
var createIntl_1 = require("./src/components/createIntl");
Object.defineProperty(exports, "createIntl", { enumerable: true, get: function () { return createIntl_1.createIntl; } });
var dateTimeRange_1 = tslib_1.__importDefault(require("./src/components/dateTimeRange"));
exports.FormattedDateTimeRange = dateTimeRange_1.default;
var injectIntl_1 = tslib_1.__importStar(require("./src/components/injectIntl"));
exports.injectIntl = injectIntl_1.default;
Object.defineProperty(exports, "IntlContext", { enumerable: true, get: function () { return injectIntl_1.Context; } });
Object.defineProperty(exports, "RawIntlProvider", { enumerable: true, get: function () { return injectIntl_1.Provider; } });
Object.defineProperty(exports, "IntlContext", { enumerable: true, get: function () { return injectIntl_1.Context; } });
var useIntl_1 = tslib_1.__importDefault(require("./src/components/useIntl"));
exports.useIntl = useIntl_1.default;
var message_1 = tslib_1.__importDefault(require("./src/components/message"));
exports.FormattedMessage = message_1.default;
var plural_1 = tslib_1.__importDefault(require("./src/components/plural"));
exports.FormattedPlural = plural_1.default;
var provider_1 = tslib_1.__importDefault(require("./src/components/provider"));
exports.IntlProvider = provider_1.default;
var createIntl_1 = require("./src/components/createIntl");
Object.defineProperty(exports, "createIntl", { enumerable: true, get: function () { return createIntl_1.createIntl; } });
var relative_1 = tslib_1.__importDefault(require("./src/components/relative"));
exports.FormattedRelativeTime = relative_1.default;
var plural_1 = tslib_1.__importDefault(require("./src/components/plural"));
exports.FormattedPlural = plural_1.default;
var message_1 = tslib_1.__importDefault(require("./src/components/message"));
exports.FormattedMessage = message_1.default;
var dateTimeRange_1 = tslib_1.__importDefault(require("./src/components/dateTimeRange"));
exports.FormattedDateTimeRange = dateTimeRange_1.default;
var useIntl_1 = tslib_1.__importDefault(require("./src/components/useIntl"));
exports.useIntl = useIntl_1.default;
var intl_1 = require("@formatjs/intl");
Object.defineProperty(exports, "createIntlCache", { enumerable: true, get: function () { return intl_1.createIntlCache; } });
Object.defineProperty(exports, "UnsupportedFormatterError", { enumerable: true, get: function () { return intl_1.UnsupportedFormatterError; } });
Object.defineProperty(exports, "InvalidConfigError", { enumerable: true, get: function () { return intl_1.InvalidConfigError; } });
Object.defineProperty(exports, "MessageFormatError", { enumerable: true, get: function () { return intl_1.MessageFormatError; } });
Object.defineProperty(exports, "MissingDataError", { enumerable: true, get: function () { return intl_1.MissingDataError; } });
Object.defineProperty(exports, "MessageFormatError", { enumerable: true, get: function () { return intl_1.MessageFormatError; } });
Object.defineProperty(exports, "MissingTranslationError", { enumerable: true, get: function () { return intl_1.MissingTranslationError; } });
Object.defineProperty(exports, "ReactIntlError", { enumerable: true, get: function () { return intl_1.IntlError; } });
Object.defineProperty(exports, "ReactIntlErrorCode", { enumerable: true, get: function () { return intl_1.IntlErrorCode; } });
Object.defineProperty(exports, "ReactIntlError", { enumerable: true, get: function () { return intl_1.IntlError; } });
Object.defineProperty(exports, "UnsupportedFormatterError", { enumerable: true, get: function () { return intl_1.UnsupportedFormatterError; } });
function defineMessages(msgs) {

@@ -51,3 +51,3 @@ return msgs;

var createFormattedComponent_2 = require("./src/components/createFormattedComponent");
Object.defineProperty(exports, "FormattedListParts", { enumerable: true, get: function () { return createFormattedComponent_2.FormattedListParts; } });
Object.defineProperty(exports, "FormattedNumberParts", { enumerable: true, get: function () { return createFormattedComponent_2.FormattedNumberParts; } });
Object.defineProperty(exports, "FormattedListParts", { enumerable: true, get: function () { return createFormattedComponent_2.FormattedListParts; } });

@@ -0,17 +1,15 @@

import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
import { CustomFormatConfig, FormatDateOptions, MessageDescriptor } from '@formatjs/intl';
import * as React from 'react';
import { MessageDescriptor, CustomFormatConfig, FormatDateOptions } from '@formatjs/intl';
import { IntlListFormatOptions } from '@formatjs/intl-listformat';
import { DisplayNamesOptions } from '@formatjs/intl-displaynames';
import { NumberFormatOptions } from '@formatjs/ecma402-abstract';
import injectIntl, { Provider as RawIntlProvider, Context as IntlContext, WithIntlProps, WrappedComponentProps } from './src/components/injectIntl';
import useIntl from './src/components/useIntl';
import { createIntl } from './src/components/createIntl';
import FormattedDateTimeRange from './src/components/dateTimeRange';
import injectIntl, { Context as IntlContext, Provider as RawIntlProvider, WithIntlProps, WrappedComponentProps } from './src/components/injectIntl';
import FormattedMessage from './src/components/message';
import FormattedPlural from './src/components/plural';
import IntlProvider from './src/components/provider';
import { createIntl } from './src/components/createIntl';
import FormattedRelativeTime from './src/components/relative';
import FormattedPlural from './src/components/plural';
import FormattedMessage from './src/components/message';
import FormattedDateTimeRange from './src/components/dateTimeRange';
export { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, WithIntlProps, WrappedComponentProps, createIntl, injectIntl, useIntl, };
export { IntlConfig, ResolvedIntlConfig, IntlShape } from './src/types';
export { createIntlCache, MessageDescriptor, IntlCache, Formatters, IntlFormatters, FormatDisplayNameOptions, FormatListOptions, FormatPluralOptions, FormatRelativeTimeOptions, FormatNumberOptions, FormatDateOptions, CustomFormatConfig, CustomFormats, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';
import useIntl from './src/components/useIntl';
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';
export { IntlConfig, IntlShape, ResolvedIntlConfig } from './src/types';
export { createIntl, FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, injectIntl, IntlContext, IntlProvider, RawIntlProvider, useIntl, WithIntlProps, WrappedComponentProps, };
export declare function defineMessages<K extends keyof any, T = MessageDescriptor, U extends Record<K, T> = Record<K, T>>(msgs: U): U;

@@ -31,7 +29,7 @@ export declare function defineMessage<T extends MessageDescriptor>(msg: T): T;

}>;
export declare const FormattedList: React.FC<IntlListFormatOptions & {
export declare const FormattedList: React.FC<Intl.ListFormatOptions & {
value: readonly React.ReactNode[];
}>;
export declare const FormattedDisplayName: React.FC<DisplayNamesOptions & {
value: string | number | Record<string, unknown>;
export declare const FormattedDisplayName: React.FC<Intl.DisplayNamesOptions & {
value: string;
}>;

@@ -46,4 +44,4 @@ export declare const FormattedDateParts: React.FC<FormatDateOptions & {

}>;
export { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';
export type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
export type { PrimitiveType } from 'intl-messageformat';
export { FormattedListParts, FormattedNumberParts, } from './src/components/createFormattedComponent';
import { createFormattedComponent, createFormattedDateTimePartsComponent, } from './src/components/createFormattedComponent';
import injectIntl, { Provider as RawIntlProvider, Context as IntlContext, } from './src/components/injectIntl';
import useIntl from './src/components/useIntl';
import { createIntl } from './src/components/createIntl';
import FormattedDateTimeRange from './src/components/dateTimeRange';
import injectIntl, { Context as IntlContext, Provider as RawIntlProvider, } from './src/components/injectIntl';
import FormattedMessage from './src/components/message';
import FormattedPlural from './src/components/plural';
import IntlProvider from './src/components/provider';
import { createIntl } from './src/components/createIntl';
import FormattedRelativeTime from './src/components/relative';
import FormattedPlural from './src/components/plural';
import FormattedMessage from './src/components/message';
import FormattedDateTimeRange from './src/components/dateTimeRange';
export { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, createIntl, injectIntl, useIntl, };
export { createIntlCache, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';
import useIntl from './src/components/useIntl';
export { createIntlCache, InvalidConfigError, MessageFormatError, MissingDataError, MissingTranslationError, IntlError as ReactIntlError, IntlErrorCode as ReactIntlErrorCode, UnsupportedFormatterError, } from '@formatjs/intl';
export { createIntl, FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, injectIntl, IntlContext, IntlProvider, RawIntlProvider, useIntl, };
export function defineMessages(msgs) {

@@ -26,2 +26,2 @@ return msgs;

export var FormattedTimeParts = createFormattedDateTimePartsComponent('formatTime');
export { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';
export { FormattedListParts, FormattedNumberParts, } from './src/components/createFormattedComponent';

@@ -0,5 +1,4 @@

import { FormatDateOptions, FormatDisplayNameOptions, FormatListOptions, FormatNumberOptions } from '@formatjs/intl';
import * as React from 'react';
import { FormatDateOptions, FormatNumberOptions, FormatListOptions, FormatDisplayNameOptions } from '@formatjs/intl';
import { IntlShape } from '../types';
import { Part } from '@formatjs/intl-listformat';
type Formatter = {

@@ -18,3 +17,3 @@ formatDate: FormatDateOptions;

value: Parameters<IntlShape['formatList']>[0];
children(val: Part[]): React.ReactElement | null;
children(val: ReturnType<Intl.ListFormat['formatToParts']>): React.ReactElement | null;
}>;

@@ -21,0 +20,0 @@ export declare function createFormattedDateTimePartsComponent<Name extends 'formatDate' | 'formatTime'>(name: Name): React.FC<Formatter[Name] & {

@@ -22,3 +22,3 @@ import { IntlCache } from '@formatjs/intl';

static displayName: string;
static defaultProps: Pick<import("../types").ResolvedIntlConfig, "timeZone" | "onError" | "fallbackOnEmptyString" | "formats" | "messages" | "defaultLocale" | "defaultFormats" | "textComponent">;
static defaultProps: Pick<import("../types").ResolvedIntlConfig, "timeZone" | "fallbackOnEmptyString" | "formats" | "messages" | "defaultLocale" | "defaultFormats" | "onError" | "textComponent">;
private cache;

@@ -25,0 +25,0 @@ state: State;

{
"name": "react-intl",
"version": "6.8.9",
"version": "7.0.0",
"description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",

@@ -118,3 +118,3 @@ "keywords": [

"license": "BSD-3-Clause",
"homepage": "https://formatjs.io/docs/react-intl",
"homepage": "https://formatjs.github.io/docs/react-intl",
"bugs": {

@@ -136,16 +136,10 @@ "url": "https://github.com/formatjs/formatjs/issues"

"tslib": "2",
"@formatjs/ecma402-abstract": "2.2.4",
"@formatjs/intl": "2.10.15",
"@formatjs/intl-displaynames": "6.8.5",
"intl-messageformat": "10.7.7",
"@formatjs/intl": "3.0.0",
"@formatjs/icu-messageformat-parser": "2.9.4",
"@formatjs/intl-listformat": "7.7.5",
"intl-messageformat": "10.7.7"
"@formatjs/ecma402-abstract": "2.2.4"
},
"devDependencies": {
"@formatjs/intl-relativetimeformat": "11.4.5",
"@formatjs/intl-numberformat": "8.14.5"
},
"peerDependencies": {
"react": "^16.6.0 || 17 || 18",
"typescript": "^4.7 || 5"
"typescript": "5"
},

@@ -152,0 +146,0 @@ "peerDependenciesMeta": {

# React Intl
We've migrated the docs to https://formatjs.io/docs/getting-started/installation.
We've migrated the docs to https://formatjs.github.io/docs/getting-started/installation.

@@ -0,5 +1,4 @@

import { FormatDateOptions, FormatDisplayNameOptions, FormatListOptions, FormatNumberOptions } from '@formatjs/intl';
import * as React from 'react';
import { FormatDateOptions, FormatNumberOptions, FormatListOptions, FormatDisplayNameOptions } from '@formatjs/intl';
import { IntlShape } from '../types';
import { Part } from '@formatjs/intl-listformat';
type Formatter = {

@@ -18,3 +17,3 @@ formatDate: FormatDateOptions;

value: Parameters<IntlShape['formatList']>[0];
children(val: Part[]): React.ReactElement | null;
children(val: ReturnType<Intl.ListFormat['formatToParts']>): React.ReactElement | null;
}>;

@@ -21,0 +20,0 @@ export declare function createFormattedDateTimePartsComponent<Name extends 'formatDate' | 'formatTime'>(name: Name): React.FC<Formatter[Name] & {

@@ -22,3 +22,3 @@ import { IntlCache } from '@formatjs/intl';

static displayName: string;
static defaultProps: Pick<import("../types").ResolvedIntlConfig, "timeZone" | "onError" | "fallbackOnEmptyString" | "formats" | "messages" | "defaultLocale" | "defaultFormats" | "textComponent">;
static defaultProps: Pick<import("../types").ResolvedIntlConfig, "timeZone" | "fallbackOnEmptyString" | "formats" | "messages" | "defaultLocale" | "defaultFormats" | "onError" | "textComponent">;
private cache;

@@ -25,0 +25,0 @@ state: State;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc