gt-react 4.2.7 → 4.2.8
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/branches/plurals/Plural.d.ts +0 -2
- package/dist/branches/plurals/Plural.d.ts.map +1 -1
- package/dist/branches/plurals/Plural.js +0 -2
- package/dist/branches/plurals/Plural.js.map +1 -1
- package/dist/inline/T.d.ts +2 -8
- package/dist/inline/T.d.ts.map +1 -1
- package/dist/inline/T.js +14 -4
- package/dist/inline/T.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
*
|
|
16
16
|
* @param {any} [children] - Fallback content to render if no matching plural branch is found.
|
|
17
17
|
* @param {number} [n] - The number used to determine the plural form. This is required for pluralization to work.
|
|
18
|
-
* @param {object} [branches] - An object containing possible plural branches, typically including `one` for singular
|
|
19
|
-
* and `other` for plural forms, but it may vary depending on the locale.
|
|
20
18
|
* @returns {JSX.Element} The rendered content corresponding to the plural form of `n`, or the fallback content.
|
|
21
19
|
* @throws {Error} If `n` is not provided or not a valid number.
|
|
22
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plural.d.ts","sourceRoot":"","sources":["../../../src/branches/plurals/Plural.tsx"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"Plural.d.ts","sourceRoot":"","sources":["../../../src/branches/plurals/Plural.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,MAAM,CAAC,EACZ,QAAQ,EAAE,CAAC,EAAE,GAAG,KAAK,EACxB,EAAE;IACC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB,2CAYA;kBAlBQ,MAAM;;;AAsBf,eAAe,MAAM,CAAC"}
|
|
@@ -36,8 +36,6 @@ var useDefaultLocale_1 = __importDefault(require("../../hooks/useDefaultLocale")
|
|
|
36
36
|
*
|
|
37
37
|
* @param {any} [children] - Fallback content to render if no matching plural branch is found.
|
|
38
38
|
* @param {number} [n] - The number used to determine the plural form. This is required for pluralization to work.
|
|
39
|
-
* @param {object} [branches] - An object containing possible plural branches, typically including `one` for singular
|
|
40
|
-
* and `other` for plural forms, but it may vary depending on the locale.
|
|
41
39
|
* @returns {JSX.Element} The rendered content corresponding to the plural form of `n`, or the fallback content.
|
|
42
40
|
* @throws {Error} If `n` is not provided or not a valid number.
|
|
43
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plural.js","sourceRoot":"","sources":["../../../src/branches/plurals/Plural.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;;AAEZ,2CAAiD;AACjD,oEAA8C;AAC9C,kFAA4D;AAE5D
|
|
1
|
+
{"version":3,"file":"Plural.js","sourceRoot":"","sources":["../../../src/branches/plurals/Plural.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;;AAEZ,2CAAiD;AACjD,oEAA8C;AAC9C,kFAA4D;AAE5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,MAAM,CAAC,EAMf;IALG,IAAA,QAAQ,cAAA,EAAE,CAAC,OAAA,EAAK,KAAK,cADT,iBAEf,CADwB;IAMb,IAA2B,kBAAkB,GAAkB,KAAK,2BAAvB,EAAK,QAAQ,UAAK,KAAK,EAAtE,2BAA8D,CAAF,CAAW;IAC7E,IAAM,MAAM,GAAG,IAAA,mBAAS,GAAE,CAAC;IAC3B,IAAM,aAAa,GAAG,IAAA,0BAAgB,GAAE,CAAC;IACzC,IAAI,OAAO,CAAC,KAAK,QAAQ;QACrB,MAAM,IAAI,KAAK,CAAC,iCAAyB,QAAQ,8BAAwB,CAAC,CAAC;IAC/E,IAAM,MAAM,GAAG,IAAA,0BAAe,EAAC,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,QAAQ,CAAC,IAAI,QAAQ,CAAC;IACjF,OAAO,CACH,4DAA+B,kBAAkB,eAAa,CAAC,sBAAoB,QAAQ,YACtF,MAAM,GACJ,CACV,CAAC;AACN,CAAC;AAED,MAAM,CAAC,gBAAgB,GAAG,QAAQ,CAAC;AAEnC,kBAAe,MAAM,CAAC"}
|
package/dist/inline/T.d.ts
CHANGED
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @param {string} [id] - Required identifier for the translation string.
|
|
6
6
|
* @param {React.ReactNode} children - The content to be translated or displayed.
|
|
7
|
-
* @param {
|
|
8
|
-
* @param {Object} [variablesOptions] - Optional formatting options for numeric or date variables.
|
|
9
|
-
* @param {any} [context] - Additional context for translation key generation.
|
|
7
|
+
* @param {any} [context] - Additional context used for translation.
|
|
10
8
|
* @param {Object} [props] - Additional props for the component.
|
|
11
9
|
* @returns {JSX.Element} The rendered translation or fallback content based on the provided configuration.
|
|
12
10
|
*
|
|
@@ -29,13 +27,9 @@
|
|
|
29
27
|
* ```
|
|
30
28
|
*
|
|
31
29
|
*/
|
|
32
|
-
export default function T({ children, id,
|
|
30
|
+
export default function T({ children, id, ...props }: {
|
|
33
31
|
children?: any;
|
|
34
32
|
id: string;
|
|
35
|
-
variables?: Record<string, any>;
|
|
36
|
-
variablesOptions?: {
|
|
37
|
-
[key: string]: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
|
|
38
|
-
};
|
|
39
33
|
context?: string;
|
|
40
34
|
[key: string]: any;
|
|
41
35
|
}): JSX.Element;
|
package/dist/inline/T.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"T.d.ts","sourceRoot":"","sources":["../../src/inline/T.tsx"],"names":[],"mappings":"AAWA
|
|
1
|
+
{"version":3,"file":"T.d.ts","sourceRoot":"","sources":["../../src/inline/T.tsx"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC,EACtB,QAAQ,EAAE,EAAE,EAAE,GAAG,KAAK,EACzB,EAAE;IACC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,GAAG,GAAG,CAAC,OAAO,CA8Cd"}
|
package/dist/inline/T.js
CHANGED
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -32,9 +43,7 @@ var react_2 = require("react");
|
|
|
32
43
|
*
|
|
33
44
|
* @param {string} [id] - Required identifier for the translation string.
|
|
34
45
|
* @param {React.ReactNode} children - The content to be translated or displayed.
|
|
35
|
-
* @param {
|
|
36
|
-
* @param {Object} [variablesOptions] - Optional formatting options for numeric or date variables.
|
|
37
|
-
* @param {any} [context] - Additional context for translation key generation.
|
|
46
|
+
* @param {any} [context] - Additional context used for translation.
|
|
38
47
|
* @param {Object} [props] - Additional props for the component.
|
|
39
48
|
* @returns {JSX.Element} The rendered translation or fallback content based on the provided configuration.
|
|
40
49
|
*
|
|
@@ -58,10 +67,11 @@ var react_2 = require("react");
|
|
|
58
67
|
*
|
|
59
68
|
*/
|
|
60
69
|
function T(_a) {
|
|
61
|
-
var children = _a.children, id = _a.id,
|
|
70
|
+
var children = _a.children, id = _a.id, props = __rest(_a, ["children", "id"]);
|
|
62
71
|
if (!id) {
|
|
63
72
|
throw new Error("Client-side <T> with no provided 'id' prop. Children: ".concat(children));
|
|
64
73
|
}
|
|
74
|
+
var variables = props.variables, variablesOptions = props.variablesOptions;
|
|
65
75
|
var translations = (0, GTContext_1.default)("<T id=\"".concat(id, "\"> used on the client-side outside of <GTProvider>")).translations;
|
|
66
76
|
var t = (0, useGT_1.default)();
|
|
67
77
|
if (!children) {
|
package/dist/inline/T.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"T.js","sourceRoot":"","sources":["../../src/inline/T.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"T.js","sourceRoot":"","sources":["../../src/inline/T.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,oBAqDC;;AA7FD,gDAA0B;AAC1B,yDAAoD;AACpD,+EAAyD;AACzD,iEAA2C;AAC3C,sGAAgF;AAChF,wCAA8C;AAC9C,oEAAiD;AACjD,4GAAsF;AACtF,yDAAmC;AACnC,+BAAgC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,SAAwB,CAAC,CAAC,EAOzB;IANG,IAAA,QAAQ,cAAA,EAAE,EAAE,QAAA,EAAK,KAAK,cADA,kBAEzB,CADyB;IAQtB,IAAI,CAAC,EAAE,EAAE,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,gEAAyD,QAAQ,CAAE,CAAC,CAAA;IACxF,CAAC;IAEO,IAAA,SAAS,GAAuB,KAAK,UAA5B,EAAE,gBAAgB,GAAK,KAAK,iBAAV,CA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