@lingui/react 4.4.0 → 4.4.2
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.cjs +5 -5
- package/dist/index.d.ts +3 -14
- package/dist/index.mjs +6 -5
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -116,10 +116,6 @@ function getElements(parts) {
|
|
|
116
116
|
}
|
|
117
117
|
const makeCounter = (count = 0, prefix = "") => () => `${prefix}_${count++}`;
|
|
118
118
|
|
|
119
|
-
function Trans(props) {
|
|
120
|
-
const lingui = useLingui();
|
|
121
|
-
return React.createElement(TransNoContext, { ...props, lingui });
|
|
122
|
-
}
|
|
123
119
|
function TransNoContext(props) {
|
|
124
120
|
const {
|
|
125
121
|
render,
|
|
@@ -180,8 +176,12 @@ const RenderFragment = ({ children }) => {
|
|
|
180
176
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
181
177
|
};
|
|
182
178
|
|
|
179
|
+
function Trans(props) {
|
|
180
|
+
const lingui = useLingui();
|
|
181
|
+
return React.createElement(TransNoContext, { ...props, lingui });
|
|
182
|
+
}
|
|
183
|
+
|
|
183
184
|
exports.I18nProvider = I18nProvider;
|
|
184
185
|
exports.LinguiContext = LinguiContext;
|
|
185
186
|
exports.Trans = Trans;
|
|
186
|
-
exports.TransNoContext = TransNoContext;
|
|
187
187
|
exports.useLingui = useLingui;
|
package/dist/index.d.ts
CHANGED
|
@@ -26,19 +26,6 @@ type TransProps = {
|
|
|
26
26
|
comment?: string;
|
|
27
27
|
children?: React.ReactNode;
|
|
28
28
|
} & TransRenderCallbackOrComponent;
|
|
29
|
-
declare function Trans(props: TransProps): React.ReactElement<any, any> | null;
|
|
30
|
-
/**
|
|
31
|
-
* Version of `<Trans>` component without using a Provider/Context React feature.
|
|
32
|
-
* Primarily made for support React Server Components (RSC)
|
|
33
|
-
*
|
|
34
|
-
* @experimental the api of this component is not stabilized yet.
|
|
35
|
-
*/
|
|
36
|
-
declare function TransNoContext(props: TransProps & {
|
|
37
|
-
lingui: {
|
|
38
|
-
i18n: I18n;
|
|
39
|
-
defaultComponent?: ComponentType<TransRenderProps>;
|
|
40
|
-
};
|
|
41
|
-
}): React.ReactElement<any, any> | null;
|
|
42
29
|
|
|
43
30
|
type I18nContext = {
|
|
44
31
|
i18n: I18n;
|
|
@@ -52,4 +39,6 @@ declare const LinguiContext: React.Context<I18nContext | null>;
|
|
|
52
39
|
declare function useLingui(): I18nContext;
|
|
53
40
|
declare const I18nProvider: FunctionComponent<I18nProviderProps>;
|
|
54
41
|
|
|
55
|
-
|
|
42
|
+
declare function Trans(props: TransProps): React.ReactElement<any, any> | null;
|
|
43
|
+
|
|
44
|
+
export { I18nContext, I18nProvider, I18nProviderProps, LinguiContext, Trans, TransProps, TransRenderCallbackOrComponent, TransRenderProps, useLingui };
|
package/dist/index.mjs
CHANGED
|
@@ -114,10 +114,6 @@ function getElements(parts) {
|
|
|
114
114
|
}
|
|
115
115
|
const makeCounter = (count = 0, prefix = "") => () => `${prefix}_${count++}`;
|
|
116
116
|
|
|
117
|
-
function Trans(props) {
|
|
118
|
-
const lingui = useLingui();
|
|
119
|
-
return React.createElement(TransNoContext, { ...props, lingui });
|
|
120
|
-
}
|
|
121
117
|
function TransNoContext(props) {
|
|
122
118
|
const {
|
|
123
119
|
render,
|
|
@@ -178,4 +174,9 @@ const RenderFragment = ({ children }) => {
|
|
|
178
174
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
179
175
|
};
|
|
180
176
|
|
|
181
|
-
|
|
177
|
+
function Trans(props) {
|
|
178
|
+
const lingui = useLingui();
|
|
179
|
+
return React.createElement(TransNoContext, { ...props, lingui });
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { I18nProvider, LinguiContext, Trans, useLingui };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/react",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React components for translations",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@babel/runtime": "^7.20.13",
|
|
66
|
-
"@lingui/core": "4.4.
|
|
66
|
+
"@lingui/core": "4.4.2"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@lingui/jest-mocks": "*",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"react-dom": "^18.2.0",
|
|
76
76
|
"unbuild": "^1.1.2"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "316a004ec82721fcceb8f3c4a5aeb4a48d367927"
|
|
79
79
|
}
|