use-intl 4.0.0-beta-77949ef → 4.0.0-beta-9e73cbe

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,5 +1,5 @@
1
- import { r as resolveNamespace, e as createBaseTranslator, d as createCache, b as createIntlFormatters, f as defaultGetMessageFallback, g as defaultOnError } from './initializeConfig-N-uKzgAH.js';
2
- export { I as IntlError, a as IntlErrorCode, c as createFormatter, i as initializeConfig } from './initializeConfig-N-uKzgAH.js';
1
+ import { r as resolveNamespace, e as createBaseTranslator, d as createCache, b as createIntlFormatters, f as defaultGetMessageFallback, g as defaultOnError } from './initializeConfig-CRD6euuK.js';
2
+ export { I as IntlError, a as IntlErrorCode, c as createFormatter, i as initializeConfig } from './initializeConfig-CRD6euuK.js';
3
3
 
4
4
 
5
5
 
@@ -1,4 +1,4 @@
1
- export { I as IntlError, a as IntlErrorCode, d as _createCache, b as _createIntlFormatters, c as createFormatter, i as initializeConfig } from './initializeConfig-N-uKzgAH.js';
1
+ export { I as IntlError, a as IntlErrorCode, d as _createCache, b as _createIntlFormatters, c as createFormatter, i as initializeConfig } from './initializeConfig-CRD6euuK.js';
2
2
  export { createTranslator, hasLocale } from './core.js';
3
3
  export { IntlProvider, useFormatter, useLocale, useMessages, useNow, useTimeZone, useTranslations } from './react.js';
4
4
 
@@ -525,9 +525,7 @@ function createFormatter(props) {
525
525
  return new Date();
526
526
  }
527
527
  }
528
- function relativeTime(/** The date time that needs to be formatted. */
529
- date, /** The reference point in time to which `date` will be formatted in relation to. If this value is absent, a globally configured `now` value or alternatively the current time will be used. */
530
- nowOrOptions) {
528
+ function relativeTime(date, nowOrOptions) {
531
529
  try {
532
530
  let nowDate, unit;
533
531
  const opts = {};
@@ -1,5 +1,5 @@
1
1
  import { createContext, useContext, useMemo, useState, useEffect } from 'react';
2
- import { d as createCache, b as createIntlFormatters, i as initializeConfig, r as resolveNamespace, I as IntlError, a as IntlErrorCode, e as createBaseTranslator, c as createFormatter } from './initializeConfig-N-uKzgAH.js';
2
+ import { d as createCache, b as createIntlFormatters, i as initializeConfig, r as resolveNamespace, I as IntlError, a as IntlErrorCode, e as createBaseTranslator, c as createFormatter } from './initializeConfig-CRD6euuK.js';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
5
5
 
@@ -27,7 +27,10 @@ export default function createFormatter(props: Props): {
27
27
  (value: number | bigint, options?: NumberFormatOptions): string;
28
28
  (value: number | bigint, format?: FormatNames["number"], options?: NumberFormatOptions): string;
29
29
  };
30
- relativeTime: (date: number | Date, nowOrOptions?: RelativeTimeFormatOptions["now"] | RelativeTimeFormatOptions) => string;
30
+ relativeTime: {
31
+ (date: number | Date, now?: RelativeTimeFormatOptions["now"]): string;
32
+ (date: number | Date, options?: RelativeTimeFormatOptions): string;
33
+ };
31
34
  list: {
32
35
  <Value extends string | ReactElement<any, string | import("react").JSXElementConstructor<any>>>(value: Iterable<Value>, options?: Intl.ListFormatOptions): Value extends string ? string : Iterable<ReactElement>;
33
36
  <Value extends string | ReactElement<any, string | import("react").JSXElementConstructor<any>>>(value: Iterable<Value>, format?: FormatNames["list"], options?: Intl.ListFormatOptions): Value extends string ? string : Iterable<ReactElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-intl",
3
- "version": "4.0.0-beta-77949ef",
3
+ "version": "4.0.0-beta-9e73cbe",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "description": "Internationalization (i18n) for React",
@@ -64,5 +64,5 @@
64
64
  "peerDependencies": {
65
65
  "react": "^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
66
66
  },
67
- "gitHead": "1c5f6e1ccef3db9cff75f14da2a590329faf03cf"
67
+ "gitHead": "31d0b2dfc66357f02a07f0b434f85dc8f0a7dad3"
68
68
  }