@lingui/react 5.3.3 → 5.4.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/dist/index-rsc.d.cts +2 -2
- package/dist/index-rsc.d.mts +2 -2
- package/dist/index-rsc.d.ts +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/server.d.cts +2 -2
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/shared/{react.db1293d4.d.cts → react.34bf68ab.d.cts} +2 -2
- package/dist/shared/{react.db1293d4.d.mts → react.34bf68ab.d.mts} +2 -2
- package/dist/shared/{react.db1293d4.d.ts → react.34bf68ab.d.ts} +2 -2
- package/macro/index.d.ts +5 -5
- package/package.json +5 -4
package/dist/index-rsc.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransProps, b as I18nContext } from './shared/react.
|
|
2
|
-
export { d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.
|
|
1
|
+
import { T as TransProps, b as I18nContext } from './shared/react.34bf68ab.cjs';
|
|
2
|
+
export { d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.34bf68ab.cjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import '@lingui/core';
|
|
5
5
|
|
package/dist/index-rsc.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransProps, b as I18nContext } from './shared/react.
|
|
2
|
-
export { d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.
|
|
1
|
+
import { T as TransProps, b as I18nContext } from './shared/react.34bf68ab.mjs';
|
|
2
|
+
export { d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.34bf68ab.mjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import '@lingui/core';
|
|
5
5
|
|
package/dist/index-rsc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransProps, b as I18nContext } from './shared/react.
|
|
2
|
-
export { d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.
|
|
1
|
+
import { T as TransProps, b as I18nContext } from './shared/react.34bf68ab.js';
|
|
2
|
+
export { d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.34bf68ab.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import '@lingui/core';
|
|
5
5
|
|
package/dist/index.cjs
CHANGED
|
@@ -23,11 +23,11 @@ const useLinguiInternal = (devErrorMessage) => {
|
|
|
23
23
|
function useLingui() {
|
|
24
24
|
return useLinguiInternal();
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
function I18nProvider({
|
|
27
27
|
i18n,
|
|
28
28
|
defaultComponent,
|
|
29
29
|
children
|
|
30
|
-
})
|
|
30
|
+
}) {
|
|
31
31
|
const latestKnownLocale = React__default.useRef(i18n.locale);
|
|
32
32
|
const makeContext = React__default.useCallback(
|
|
33
33
|
() => ({
|
|
@@ -56,7 +56,7 @@ const I18nProvider = ({
|
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
58
|
return /* @__PURE__ */ React__default.createElement(LinguiContext.Provider, { value: context }, children);
|
|
59
|
-
}
|
|
59
|
+
}
|
|
60
60
|
|
|
61
61
|
function Trans(props) {
|
|
62
62
|
let errMessage = void 0;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransProps } from './shared/react.
|
|
2
|
-
export { b as I18nContext, I as I18nProvider, a as I18nProviderProps, L as LinguiContext, d as TransRenderCallbackOrComponent, c as TransRenderProps, u as useLingui } from './shared/react.
|
|
1
|
+
import { T as TransProps } from './shared/react.34bf68ab.cjs';
|
|
2
|
+
export { b as I18nContext, I as I18nProvider, a as I18nProviderProps, L as LinguiContext, d as TransRenderCallbackOrComponent, c as TransRenderProps, u as useLingui } from './shared/react.34bf68ab.cjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import '@lingui/core';
|
|
5
5
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransProps } from './shared/react.
|
|
2
|
-
export { b as I18nContext, I as I18nProvider, a as I18nProviderProps, L as LinguiContext, d as TransRenderCallbackOrComponent, c as TransRenderProps, u as useLingui } from './shared/react.
|
|
1
|
+
import { T as TransProps } from './shared/react.34bf68ab.mjs';
|
|
2
|
+
export { b as I18nContext, I as I18nProvider, a as I18nProviderProps, L as LinguiContext, d as TransRenderCallbackOrComponent, c as TransRenderProps, u as useLingui } from './shared/react.34bf68ab.mjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import '@lingui/core';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TransProps } from './shared/react.
|
|
2
|
-
export { b as I18nContext, I as I18nProvider, a as I18nProviderProps, L as LinguiContext, d as TransRenderCallbackOrComponent, c as TransRenderProps, u as useLingui } from './shared/react.
|
|
1
|
+
import { T as TransProps } from './shared/react.34bf68ab.js';
|
|
2
|
+
export { b as I18nContext, I as I18nProvider, a as I18nProviderProps, L as LinguiContext, d as TransRenderCallbackOrComponent, c as TransRenderProps, u as useLingui } from './shared/react.34bf68ab.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import '@lingui/core';
|
|
5
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -17,11 +17,11 @@ const useLinguiInternal = (devErrorMessage) => {
|
|
|
17
17
|
function useLingui() {
|
|
18
18
|
return useLinguiInternal();
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
function I18nProvider({
|
|
21
21
|
i18n,
|
|
22
22
|
defaultComponent,
|
|
23
23
|
children
|
|
24
|
-
})
|
|
24
|
+
}) {
|
|
25
25
|
const latestKnownLocale = React.useRef(i18n.locale);
|
|
26
26
|
const makeContext = React.useCallback(
|
|
27
27
|
() => ({
|
|
@@ -50,7 +50,7 @@ const I18nProvider = ({
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
return /* @__PURE__ */ React.createElement(LinguiContext.Provider, { value: context }, children);
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
54
|
|
|
55
55
|
function Trans(props) {
|
|
56
56
|
let errMessage = void 0;
|
package/dist/server.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as I18nContext } from './shared/react.
|
|
2
|
-
export { e as TransNoContext, T as TransProps, d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.
|
|
1
|
+
import { b as I18nContext } from './shared/react.34bf68ab.cjs';
|
|
2
|
+
export { e as TransNoContext, T as TransProps, d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.34bf68ab.cjs';
|
|
3
3
|
import { I18n } from '@lingui/core';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as I18nContext } from './shared/react.
|
|
2
|
-
export { e as TransNoContext, T as TransProps, d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.
|
|
1
|
+
import { b as I18nContext } from './shared/react.34bf68ab.mjs';
|
|
2
|
+
export { e as TransNoContext, T as TransProps, d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.34bf68ab.mjs';
|
|
3
3
|
import { I18n } from '@lingui/core';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as I18nContext } from './shared/react.
|
|
2
|
-
export { e as TransNoContext, T as TransProps, d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.
|
|
1
|
+
import { b as I18nContext } from './shared/react.34bf68ab.js';
|
|
2
|
+
export { e as TransNoContext, T as TransProps, d as TransRenderCallbackOrComponent, c as TransRenderProps } from './shared/react.34bf68ab.js';
|
|
3
3
|
import { I18n } from '@lingui/core';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ComponentType
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
2
|
import { MessageOptions, I18n } from '@lingui/core';
|
|
3
3
|
|
|
4
4
|
type TransRenderProps = {
|
|
@@ -47,6 +47,6 @@ type I18nProviderProps = Omit<I18nContext, "_"> & {
|
|
|
47
47
|
};
|
|
48
48
|
declare const LinguiContext: React.Context<I18nContext | null>;
|
|
49
49
|
declare function useLingui(): I18nContext;
|
|
50
|
-
declare
|
|
50
|
+
declare function I18nProvider({ i18n, defaultComponent, children, }: I18nProviderProps): React.JSX.Element | null;
|
|
51
51
|
|
|
52
52
|
export { I18nProvider as I, LinguiContext as L, type TransProps as T, type I18nProviderProps as a, type I18nContext as b, type TransRenderProps as c, type TransRenderCallbackOrComponent as d, TransNoContext as e, useLingui as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ComponentType
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
2
|
import { MessageOptions, I18n } from '@lingui/core';
|
|
3
3
|
|
|
4
4
|
type TransRenderProps = {
|
|
@@ -47,6 +47,6 @@ type I18nProviderProps = Omit<I18nContext, "_"> & {
|
|
|
47
47
|
};
|
|
48
48
|
declare const LinguiContext: React.Context<I18nContext | null>;
|
|
49
49
|
declare function useLingui(): I18nContext;
|
|
50
|
-
declare
|
|
50
|
+
declare function I18nProvider({ i18n, defaultComponent, children, }: I18nProviderProps): React.JSX.Element | null;
|
|
51
51
|
|
|
52
52
|
export { I18nProvider as I, LinguiContext as L, type TransProps as T, type I18nProviderProps as a, type I18nContext as b, type TransRenderProps as c, type TransRenderCallbackOrComponent as d, TransNoContext as e, useLingui as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ComponentType
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
2
|
import { MessageOptions, I18n } from '@lingui/core';
|
|
3
3
|
|
|
4
4
|
type TransRenderProps = {
|
|
@@ -47,6 +47,6 @@ type I18nProviderProps = Omit<I18nContext, "_"> & {
|
|
|
47
47
|
};
|
|
48
48
|
declare const LinguiContext: React.Context<I18nContext | null>;
|
|
49
49
|
declare function useLingui(): I18nContext;
|
|
50
|
-
declare
|
|
50
|
+
declare function I18nProvider({ i18n, defaultComponent, children, }: I18nProviderProps): React.JSX.Element | null;
|
|
51
51
|
|
|
52
52
|
export { I18nProvider as I, LinguiContext as L, type TransProps as T, type I18nProviderProps as a, type I18nContext as b, type TransRenderProps as c, type TransRenderCallbackOrComponent as d, TransNoContext as e, useLingui as u };
|
package/macro/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode
|
|
1
|
+
import type { ReactNode } from "react"
|
|
2
2
|
import type { TransRenderCallbackOrComponent, I18nContext } from "@lingui/react"
|
|
3
3
|
import type {
|
|
4
4
|
MacroMessageDescriptor,
|
|
@@ -52,7 +52,7 @@ type SelectChoiceProps = {
|
|
|
52
52
|
* <Trans id="custom.id">Hello {username}.</Trans>
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
export const Trans:
|
|
55
|
+
export const Trans: (props: TransProps) => ReactNode
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Props of Plural macro are transformed into plural format.
|
|
@@ -67,7 +67,7 @@ export const Trans: FC<TransProps>
|
|
|
67
67
|
* <Trans id="{numBooks, plural, one {Book} other {Books}}" values={{ numBooks }} />
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
|
-
export const Plural:
|
|
70
|
+
export const Plural: (props: PluralChoiceProps) => ReactNode
|
|
71
71
|
/**
|
|
72
72
|
* Props of SelectOrdinal macro are transformed into selectOrdinal format.
|
|
73
73
|
*
|
|
@@ -86,7 +86,7 @@ export const Plural: VFC<PluralChoiceProps>
|
|
|
86
86
|
* />
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
|
-
export const SelectOrdinal:
|
|
89
|
+
export const SelectOrdinal: (props: PluralChoiceProps) => ReactNode
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Props of Select macro are transformed into select format
|
|
@@ -105,7 +105,7 @@ export const SelectOrdinal: VFC<PluralChoiceProps>
|
|
|
105
105
|
* />
|
|
106
106
|
* ```
|
|
107
107
|
*/
|
|
108
|
-
export const Select:
|
|
108
|
+
export const Select: (props: SelectChoiceProps) => ReactNode
|
|
109
109
|
|
|
110
110
|
declare function _t(descriptor: MacroMessageDescriptor): string
|
|
111
111
|
declare function _t(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React components for translations",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"build": "rimraf ./dist && unbuild",
|
|
31
31
|
"stub": "unbuild --stub"
|
|
32
32
|
},
|
|
33
|
+
"homepage": "https://lingui.dev",
|
|
33
34
|
"repository": {
|
|
34
35
|
"type": "git",
|
|
35
36
|
"url": "git+https://github.com/lingui/js-lingui.git",
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
"macro/index.js"
|
|
79
80
|
],
|
|
80
81
|
"peerDependencies": {
|
|
81
|
-
"@lingui/babel-plugin-lingui-macro": "5.
|
|
82
|
+
"@lingui/babel-plugin-lingui-macro": "5.4.0",
|
|
82
83
|
"babel-plugin-macros": "2 || 3",
|
|
83
84
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
84
85
|
},
|
|
@@ -92,7 +93,7 @@
|
|
|
92
93
|
},
|
|
93
94
|
"dependencies": {
|
|
94
95
|
"@babel/runtime": "^7.20.13",
|
|
95
|
-
"@lingui/core": "5.
|
|
96
|
+
"@lingui/core": "5.4.0"
|
|
96
97
|
},
|
|
97
98
|
"devDependencies": {
|
|
98
99
|
"@lingui/jest-mocks": "*",
|
|
@@ -104,5 +105,5 @@
|
|
|
104
105
|
"react-dom": "^18.2.0",
|
|
105
106
|
"unbuild": "2.0.0"
|
|
106
107
|
},
|
|
107
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "ce0d17bd0874f5f4f01fd073749f29087835a315"
|
|
108
109
|
}
|