@lingui/macro 3.13.1 → 3.14.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/global.d.ts +3 -3
- package/index.d.ts +4 -3
- package/macroJsx.js +6 -2
- package/package.json +2 -2
package/global.d.ts
CHANGED
|
@@ -119,9 +119,9 @@ declare module "@lingui/macro" {
|
|
|
119
119
|
* ```
|
|
120
120
|
* import { selectOrdinal } from "@lingui/macro";
|
|
121
121
|
* const message = selectOrdinal(count, {
|
|
122
|
-
* one: "
|
|
123
|
-
* two: "
|
|
124
|
-
* few: "
|
|
122
|
+
* one: "#st",
|
|
123
|
+
* two: "#nd",
|
|
124
|
+
* few: "#rd",
|
|
125
125
|
* other: "#th",
|
|
126
126
|
* });
|
|
127
127
|
* ```
|
package/index.d.ts
CHANGED
|
@@ -111,9 +111,9 @@ export function plural(value: number | string, options: ChoiceOptions): string
|
|
|
111
111
|
* ```
|
|
112
112
|
* import { selectOrdinal } from "@lingui/macro";
|
|
113
113
|
* const message = selectOrdinal(count, {
|
|
114
|
-
* one: "
|
|
115
|
-
* two: "
|
|
116
|
-
* few: "
|
|
114
|
+
* one: "#st",
|
|
115
|
+
* two: "#nd",
|
|
116
|
+
* few: "#rd",
|
|
117
117
|
* other: "#th",
|
|
118
118
|
* });
|
|
119
119
|
* ```
|
|
@@ -172,6 +172,7 @@ export type TransProps = {
|
|
|
172
172
|
comment?: string
|
|
173
173
|
values?: Record<string, unknown>
|
|
174
174
|
context?: string
|
|
175
|
+
children?: React.ReactNode
|
|
175
176
|
component?: React.ComponentType<TransRenderProps>
|
|
176
177
|
render?: (props: TransRenderProps) => ReactElement<any, any> | null
|
|
177
178
|
}
|
package/macroJsx.js
CHANGED
|
@@ -66,6 +66,10 @@ var MacroJSX = /*#__PURE__*/function () {
|
|
|
66
66
|
(0, _defineProperty2.default)(this, "types", void 0);
|
|
67
67
|
(0, _defineProperty2.default)(this, "expressionIndex", void 0);
|
|
68
68
|
(0, _defineProperty2.default)(this, "elementIndex", void 0);
|
|
69
|
+
(0, _defineProperty2.default)(this, "safeJsxAttribute", function (name, value) {
|
|
70
|
+
// This handles quoted JSX attributes and html entities.
|
|
71
|
+
return _this.types.jsxAttribute(_this.types.jsxIdentifier(name), _this.types.jsxExpressionContainer(_this.types.stringLiteral(value)));
|
|
72
|
+
});
|
|
69
73
|
(0, _defineProperty2.default)(this, "replacePath", function (path) {
|
|
70
74
|
var tokens = _this.tokenizeNode(path.node);
|
|
71
75
|
|
|
@@ -93,11 +97,11 @@ var MacroJSX = /*#__PURE__*/function () {
|
|
|
93
97
|
|
|
94
98
|
if (process.env.NODE_ENV !== "production") {
|
|
95
99
|
if (message) {
|
|
96
|
-
attributes.push(_this.
|
|
100
|
+
attributes.push(_this.safeJsxAttribute(_constants.MESSAGE, message));
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
} else {
|
|
100
|
-
attributes.push(_this.
|
|
104
|
+
attributes.push(_this.safeJsxAttribute(_constants.ID, message));
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
if (process.env.NODE_ENV !== "production") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lingui/macro",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"description": "Macro for generating messages in ICU MessageFormat syntax",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.11.2",
|
|
33
|
-
"@lingui/conf": "^3.
|
|
33
|
+
"@lingui/conf": "^3.14.0",
|
|
34
34
|
"ramda": "^0.27.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|