react-intl 6.4.1 → 6.4.3

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.
@@ -26,4 +26,3 @@ export declare function createFormattedComponent<Name extends keyof Formatter>(n
26
26
  children?(val: string): React.ReactElement | null;
27
27
  }>;
28
28
  export {};
29
- //# sourceMappingURL=createFormattedComponent.d.ts.map
@@ -8,4 +8,3 @@ interface Props extends FormatDateOptions {
8
8
  }
9
9
  declare const FormattedDateTimeRange: React.FC<Props>;
10
10
  export default FormattedDateTimeRange;
11
- //# sourceMappingURL=dateTimeRange.d.ts.map
@@ -2,6 +2,10 @@ import * as React from 'react';
2
2
  import { IntlShape } from '../types';
3
3
  declare global {
4
4
  interface Window {
5
+ /**
6
+ * Set this to `true` prior to mounting to bypass using a globally-exposed context.
7
+ */
8
+ __REACT_INTL_BYPASS_GLOBAL_CONTEXT__: boolean | undefined;
5
9
  __REACT_INTL_CONTEXT__: React.Context<IntlShape> | undefined;
6
10
  }
7
11
  }
@@ -33,4 +37,3 @@ export default function injectIntl<IntlPropName extends string = 'intl', P exten
33
37
  export default function injectIntl<IntlPropName extends string = 'intl', P extends WrappedComponentProps<IntlPropName> = WrappedComponentProps<any>, T extends React.ComponentType<P> = any>(WrappedComponent: React.ComponentType<P>, options?: Opts<IntlPropName, true>): React.ForwardRefExoticComponent<React.PropsWithoutRef<WithIntlProps<React.PropsWithChildren<P>>> & React.RefAttributes<T>> & {
34
38
  WrappedComponent: React.ComponentType<P>;
35
39
  };
36
- //# sourceMappingURL=injectIntl.d.ts.map
@@ -10,7 +10,7 @@ function getDisplayName(Component) {
10
10
  }
11
11
  // This is primarily dealing with packaging systems where multiple copies of react-intl
12
12
  // might exist
13
- var IntlContext = typeof window !== 'undefined'
13
+ var IntlContext = typeof window !== 'undefined' && !window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__
14
14
  ? window.__REACT_INTL_CONTEXT__ ||
15
15
  (window.__REACT_INTL_CONTEXT__ = React.createContext(null))
16
16
  : React.createContext(null);
@@ -7,6 +7,5 @@ export interface Props<V extends Record<string, any> = Record<string, React.Reac
7
7
  children?(nodes: React.ReactNode[]): React.ReactElement | null;
8
8
  ignoreTag?: IntlMessageFormatOptions['ignoreTag'];
9
9
  }
10
- declare const MemoizedFormattedMessage: React.NamedExoticComponent<Props<Record<string, string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal | Date | FormatXMLElementFn<React.ReactNode, React.ReactNode> | null | undefined>>>;
10
+ declare const MemoizedFormattedMessage: React.NamedExoticComponent<Props<Record<string, string | number | boolean | Date | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal | FormatXMLElementFn<React.ReactNode, React.ReactNode> | null | undefined>>>;
11
11
  export default MemoizedFormattedMessage;
12
- //# sourceMappingURL=message.d.ts.map
@@ -12,4 +12,3 @@ interface Props extends FormatPluralOptions {
12
12
  }
13
13
  declare const FormattedPlural: React.FC<Props>;
14
14
  export default FormattedPlural;
15
- //# sourceMappingURL=plural.d.ts.map
@@ -32,4 +32,3 @@ export default class IntlProvider extends React.PureComponent<React.PropsWithChi
32
32
  render(): JSX.Element;
33
33
  }
34
34
  export {};
35
- //# sourceMappingURL=provider.d.ts.map
@@ -9,4 +9,3 @@ export interface Props extends FormatRelativeTimeOptions {
9
9
  }
10
10
  declare const FormattedRelativeTime: React.FC<Props>;
11
11
  export default FormattedRelativeTime;
12
- //# sourceMappingURL=relative.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { IntlShape } from '../types';
2
2
  export default function useIntl(): IntlShape;
3
- //# sourceMappingURL=useIntl.d.ts.map
package/src/types.d.ts CHANGED
@@ -9,4 +9,3 @@ export interface ResolvedIntlConfig extends CoreResolvedIntlConfig<React.ReactNo
9
9
  export interface IntlShape extends ResolvedIntlConfig, IntlFormatters<React.ReactNode> {
10
10
  formatters: Formatters;
11
11
  }
12
- //# sourceMappingURL=types.d.ts.map
package/src/utils.d.ts CHANGED
@@ -11,4 +11,3 @@ export declare const DEFAULT_INTL_CONFIG: Pick<ResolvedIntlConfig, 'fallbackOnEm
11
11
  */
12
12
  export declare function assignUniqueKeysToParts(formatXMLElementFn: FormatXMLElementFn<React.ReactNode>): FormatXMLElementFn<React.ReactNode>;
13
13
  export declare function shallowEqual<T extends Record<string, unknown> = Record<string, unknown>>(objA?: T, objB?: T): boolean;
14
- //# sourceMappingURL=utils.d.ts.map