gt-next 5.2.11 → 5.2.12-alpha.1
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/Branch.d.ts +4 -6
- package/dist/branches/Branch.d.ts.map +1 -1
- package/dist/branches/Branch.js +5 -6
- package/dist/branches/Branch.js.map +1 -1
- package/dist/branches/Plural.d.ts +9 -8
- package/dist/branches/Plural.d.ts.map +1 -1
- package/dist/branches/Plural.js +53 -11
- package/dist/branches/Plural.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -0
- package/dist/client.js.map +1 -1
- package/dist/config-dir/getI18NConfig.d.ts.map +1 -1
- package/dist/config-dir/getI18NConfig.js +1 -1
- package/dist/config-dir/getI18NConfig.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/middleware-dir/createNextMiddleware.d.ts +1 -1
- package/dist/middleware-dir/createNextMiddleware.d.ts.map +1 -1
- package/dist/middleware-dir/createNextMiddleware.js +1 -1
- package/dist/middleware-dir/createNextMiddleware.js.map +1 -1
- package/dist/next/getNextLocale.d.ts.map +1 -1
- package/dist/next/getNextLocale.js.map +1 -1
- package/dist/server-dir/variables/renderVariable.d.ts +3 -7
- package/dist/server-dir/variables/renderVariable.d.ts.map +1 -1
- package/dist/server-dir/variables/renderVariable.js +8 -8
- package/dist/server-dir/variables/renderVariable.js.map +1 -1
- package/dist/variables/Currency.d.ts +3 -9
- package/dist/variables/Currency.d.ts.map +1 -1
- package/dist/variables/Currency.js +61 -30
- package/dist/variables/Currency.js.map +1 -1
- package/dist/variables/DateTime.d.ts +4 -11
- package/dist/variables/DateTime.d.ts.map +1 -1
- package/dist/variables/DateTime.js +71 -50
- package/dist/variables/DateTime.js.map +1 -1
- package/dist/variables/Num.d.ts +3 -9
- package/dist/variables/Num.d.ts.map +1 -1
- package/dist/variables/Num.js +61 -30
- package/dist/variables/Num.js.map +1 -1
- package/dist/variables/Var.d.ts +4 -9
- package/dist/variables/Var.d.ts.map +1 -1
- package/dist/variables/Var.js +4 -22
- package/dist/variables/Var.js.map +1 -1
- package/package.json +2 -2
|
@@ -17,17 +17,15 @@
|
|
|
17
17
|
* If the `branch` prop is set to `"male"`, it will render `<p>He is happy.</p>`. If the `branch` is set to "female" it will render `<p>She is happy.</p>`. If the gender is not set or does not match any props, it renders the fallback content `<p>Fallback content</p>`.
|
|
18
18
|
*
|
|
19
19
|
* @param {any} [children] - Fallback content to render if no matching branch is found.
|
|
20
|
-
* @param {string} [name="branch"] - Optional name for the component, used for metadata or tracking purposes.
|
|
21
20
|
* @param {string} [branch] - The name of the branch to render. The component looks for this key in the `...branches` object.
|
|
22
|
-
* @param {
|
|
23
|
-
* @returns {JSX.Element} The rendered branch or fallback content.
|
|
21
|
+
* @param {...branches} [branches] - A spread object containing possible branches as keys and their corresponding content as values.
|
|
22
|
+
* @returns {React.JSX.Element} The rendered branch or fallback content.
|
|
24
23
|
*/
|
|
25
|
-
declare function Branch({ children,
|
|
24
|
+
declare function Branch({ children, branch, ...branches }: {
|
|
26
25
|
children?: any;
|
|
27
|
-
name?: string;
|
|
28
26
|
branch?: string;
|
|
29
27
|
[key: string]: any;
|
|
30
|
-
}):
|
|
28
|
+
}): React.JSX.Element;
|
|
31
29
|
declare namespace Branch {
|
|
32
30
|
var gtTransformation: string;
|
|
33
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Branch.d.ts","sourceRoot":"","sources":["../../src/branches/Branch.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Branch.d.ts","sourceRoot":"","sources":["../../src/branches/Branch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,MAAM,EACN,GAAG,QAAQ,EACZ,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAQpB;kBAhBQ,MAAM;;;AAmBf,eAAe,MAAM,CAAC"}
|
package/dist/branches/Branch.js
CHANGED
|
@@ -31,19 +31,18 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
31
31
|
* If the `branch` prop is set to `"male"`, it will render `<p>He is happy.</p>`. If the `branch` is set to "female" it will render `<p>She is happy.</p>`. If the gender is not set or does not match any props, it renders the fallback content `<p>Fallback content</p>`.
|
|
32
32
|
*
|
|
33
33
|
* @param {any} [children] - Fallback content to render if no matching branch is found.
|
|
34
|
-
* @param {string} [name="branch"] - Optional name for the component, used for metadata or tracking purposes.
|
|
35
34
|
* @param {string} [branch] - The name of the branch to render. The component looks for this key in the `...branches` object.
|
|
36
|
-
* @param {
|
|
37
|
-
* @returns {JSX.Element} The rendered branch or fallback content.
|
|
35
|
+
* @param {...branches} [branches] - A spread object containing possible branches as keys and their corresponding content as values.
|
|
36
|
+
* @returns {React.JSX.Element} The rendered branch or fallback content.
|
|
38
37
|
*/
|
|
39
38
|
function Branch(_a) {
|
|
40
|
-
var children = _a.children,
|
|
41
|
-
|
|
39
|
+
var children = _a.children, branch = _a.branch, branches = __rest(_a, ["children", "branch"]);
|
|
40
|
+
// const { 'data-_gt': generaltranslation, ...branches } = props;
|
|
42
41
|
branch = branch === null || branch === void 0 ? void 0 : branch.toString();
|
|
43
42
|
var renderedBranch = branch && typeof branches[branch] !== 'undefined'
|
|
44
43
|
? branches[branch]
|
|
45
44
|
: children;
|
|
46
|
-
return (
|
|
45
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: renderedBranch });
|
|
47
46
|
}
|
|
48
47
|
Branch.gtTransformation = 'branch';
|
|
49
48
|
exports.default = Branch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Branch.js","sourceRoot":"","sources":["../../src/branches/Branch.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"Branch.js","sourceRoot":"","sources":["../../src/branches/Branch.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,MAAM,CAAC,EAQf;IAPC,IAAA,QAAQ,cAAA,EACR,MAAM,YAAA,EACH,QAAQ,cAHG,sBAIf,CADY;IAMX,iEAAiE;IACjE,MAAM,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,EAAE,CAAC;IAC5B,IAAM,cAAc,GAClB,MAAM,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,WAAW;QAC/C,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;QAClB,CAAC,CAAC,QAAQ,CAAC;IACf,OAAO,2DAAG,cAAc,GAAI,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,gBAAgB,GAAG,QAAQ,CAAC;AACnC,kBAAe,MAAM,CAAC"}
|
|
@@ -6,27 +6,28 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```jsx
|
|
9
|
-
* <Plural
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* <Plural
|
|
10
|
+
* n={n}
|
|
11
|
+
* one={<>There is <Num value={n}/> item.</>}
|
|
12
|
+
* other={<>There are <Num value={n}/> items.</>}
|
|
13
|
+
* />
|
|
12
14
|
* ```
|
|
13
15
|
* In this example, if `n` is 1, it renders `"There is 1 item"`. If `n` is a different number, it renders
|
|
14
16
|
* `"There are {n} items"`.
|
|
15
17
|
*
|
|
16
18
|
* @param {any} [children] - Fallback content to render if no matching plural branch is found.
|
|
17
19
|
* @param {number} [n] - The number used to determine the plural form. This is required for pluralization to work.
|
|
18
|
-
* @param {
|
|
20
|
+
* @param {...branches} [branches] - A spread object containing possible plural branches, typically including `one` for singular
|
|
19
21
|
* and `other` for plural forms, but it may vary depending on the locale.
|
|
20
|
-
* @returns {Promise<JSX.Element>} The rendered content corresponding to the plural form of `n`, or the fallback content.
|
|
22
|
+
* @returns {Promise<React.JSX.Element>} The rendered content corresponding to the plural form of `n`, or the fallback content.
|
|
21
23
|
* @throws {Error} If `n` is not provided or not a valid number.
|
|
22
24
|
*/
|
|
23
|
-
declare function Plural({ children, n, locales, ...
|
|
25
|
+
declare function Plural({ children, n, locales, ...branches }: {
|
|
24
26
|
children?: any;
|
|
25
27
|
n?: number;
|
|
26
|
-
'data-_gt'?: any;
|
|
27
28
|
locales?: string[];
|
|
28
29
|
[key: string]: any;
|
|
29
|
-
}):
|
|
30
|
+
}): Promise<React.JSX.Element>;
|
|
30
31
|
declare namespace Plural {
|
|
31
32
|
var gtTransformation: string;
|
|
32
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plural.d.ts","sourceRoot":"","sources":["../../src/branches/Plural.tsx"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"Plural.d.ts","sourceRoot":"","sources":["../../src/branches/Plural.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAe,MAAM,CAAC,EACpB,QAAQ,EACR,CAAC,EACD,OAA8C,EAC9C,GAAG,QAAQ,EACZ,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAM7B;kBAhBc,MAAM;;;AAoBrB,eAAe,MAAM,CAAC"}
|
package/dist/branches/Plural.js
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
39
|
var t = {};
|
|
4
40
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -25,27 +61,33 @@ var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
|
|
|
25
61
|
*
|
|
26
62
|
* @example
|
|
27
63
|
* ```jsx
|
|
28
|
-
* <Plural
|
|
29
|
-
*
|
|
30
|
-
*
|
|
64
|
+
* <Plural
|
|
65
|
+
* n={n}
|
|
66
|
+
* one={<>There is <Num value={n}/> item.</>}
|
|
67
|
+
* other={<>There are <Num value={n}/> items.</>}
|
|
68
|
+
* />
|
|
31
69
|
* ```
|
|
32
70
|
* In this example, if `n` is 1, it renders `"There is 1 item"`. If `n` is a different number, it renders
|
|
33
71
|
* `"There are {n} items"`.
|
|
34
72
|
*
|
|
35
73
|
* @param {any} [children] - Fallback content to render if no matching plural branch is found.
|
|
36
74
|
* @param {number} [n] - The number used to determine the plural form. This is required for pluralization to work.
|
|
37
|
-
* @param {
|
|
75
|
+
* @param {...branches} [branches] - A spread object containing possible plural branches, typically including `one` for singular
|
|
38
76
|
* and `other` for plural forms, but it may vary depending on the locale.
|
|
39
|
-
* @returns {Promise<JSX.Element>} The rendered content corresponding to the plural form of `n`, or the fallback content.
|
|
77
|
+
* @returns {Promise<React.JSX.Element>} The rendered content corresponding to the plural form of `n`, or the fallback content.
|
|
40
78
|
* @throws {Error} If `n` is not provided or not a valid number.
|
|
41
79
|
*/
|
|
42
80
|
function Plural(_a) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
+
var branch;
|
|
83
|
+
var children = _a.children, n = _a.n, _b = _a.locales, locales = _b === void 0 ? [(0, getI18NConfig_1.default)().getDefaultLocale()] : _b, branches = __rest(_a, ["children", "n", "locales"]);
|
|
84
|
+
return __generator(this, function (_c) {
|
|
85
|
+
branch = (typeof n === 'number'
|
|
86
|
+
? (0, internal_1.getPluralBranch)(n, locales, branches)
|
|
87
|
+
: children) || children;
|
|
88
|
+
return [2 /*return*/, (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: branch })];
|
|
89
|
+
});
|
|
90
|
+
});
|
|
49
91
|
}
|
|
50
92
|
Plural.gtTransformation = 'plural';
|
|
51
93
|
exports.default = Plural;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plural.js","sourceRoot":"","sources":["../../src/branches/Plural.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Plural.js","sourceRoot":"","sources":["../../src/branches/Plural.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAoD;AACpD,8EAAwD;AAExD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAe,MAAM,CAAC,EAUrB;;;QATC,IAAA,QAAQ,cAAA,EACR,CAAC,OAAA,EACD,eAA8C,EAA9C,OAAO,mBAAG,CAAC,IAAA,uBAAa,GAAE,CAAC,gBAAgB,EAAE,CAAC,KAAA,EAC3C,QAAQ,cAJS,4BAKrB,CADY;;YAOL,MAAM,GACV,CAAC,OAAO,CAAC,KAAK,QAAQ;gBACpB,CAAC,CAAC,IAAA,0BAAe,EAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC;gBACvC,CAAC,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;YAC5B,sBAAO,2DAAG,MAAM,GAAI,EAAC;;;CACtB;AAED,MAAM,CAAC,gBAAgB,GAAG,QAAQ,CAAC;AAEnC,kBAAe,MAAM,CAAC"}
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACL,CAAC,EACD,KAAK,EACL,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,YAAY,EACZ,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,UAAU,IAAI,gBAAgB,EAC9B,CAAC,EACD,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,iBAAiB,GAClB,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
'use client';
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.useLocaleSelector = exports.LocaleSelector = exports.useDict = exports.useDefaultLocale = exports.useSetLocale = exports.useLocales = exports.useLocale = exports.useGT = exports.T = exports.GTClientProvider = void 0;
|
|
4
5
|
var client_1 = require("gt-react/client");
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,0CAWyB;AAIvB,kFAdA,UAAC,OAcA;AACD,sFAdA,cAAK,OAcA;AAKL,wFAlBA,gBAAO,OAkBA;AAJP,0FAbA,kBAAS,OAaA;AAGT,iGAfA,yBAAgB,OAeA;AAEhB,+FAhBA,uBAAc,OAgBA;AARA,iGAPd,mBAAU,OAOoB;AAI9B,2FAVA,mBAAU,OAUA;AACV,6FAVA,qBAAY,OAUA;AAIZ,kGAbA,0BAAiB,OAaA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getI18NConfig.d.ts","sourceRoot":"","sources":["../../src/config-dir/getI18NConfig.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AASpD,MAAM,CAAC,OAAO,UAAU,aAAa,IAAI,iBAAiB,
|
|
1
|
+
{"version":3,"file":"getI18NConfig.d.ts","sourceRoot":"","sources":["../../src/config-dir/getI18NConfig.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AASpD,MAAM,CAAC,OAAO,UAAU,aAAa,IAAI,iBAAiB,CAgEzD"}
|
|
@@ -40,7 +40,7 @@ function getI18NConfig() {
|
|
|
40
40
|
var projectId = process.env.GT_PROJECT_ID || '';
|
|
41
41
|
// Parse: apiKey, devApiKey
|
|
42
42
|
var apiKey = void 0, devApiKey = void 0;
|
|
43
|
-
var envApiKey = process.env.GT_API_KEY || '';
|
|
43
|
+
var envApiKey = process.env.GT_DEV_API_KEY || process.env.GT_API_KEY || '';
|
|
44
44
|
var apiKeyType = (_a = envApiKey === null || envApiKey === void 0 ? void 0 : envApiKey.split('-')) === null || _a === void 0 ? void 0 : _a[1];
|
|
45
45
|
if (apiKeyType === 'api') {
|
|
46
46
|
apiKey = envApiKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getI18NConfig.js","sourceRoot":"","sources":["../../src/config-dir/getI18NConfig.ts"],"names":[],"mappings":";;;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AS,GAAG,SAAS,CAAC;QACxB,CAAC;QAED,uBAAuB;QACvB,kEAAkE;QAClE,IAAM,aAAa,GAAG,kCAAwB,CAAC,aAAa,CAAC;QAE7D,iEAAiE;QACjE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;YAC3C,OAAO,CAAC,IAAI,CAAC,2BAAY,CAAC,CAAC;QAC7B,CAAC;QAED,oCAAoC;QACpC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,SAAS,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,iDAAkC,CAAC,CAAC;QACtD,CAAC;QAED,0BAA0B;QAC1B,SAAS,CAAC,wCAAwC,GAAG,IAAI,2BAAiB,uBACrE,kCAAwB,KAC3B,OAAO,EAAE,CAAC,aAAa,CAAC,EACxB,cAAc,EAAE,gCAAqB,EACrC,MAAM,QAAA,EACN,SAAS,WAAA,EACT,SAAS,WAAA,EACT,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,IAAI,EACd,oBAAoB,EAAE,UAAU,EAChC,qBAAqB,EAAE,KAAK,IAC5B,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC,wCAAwC,CAAC;AAC5D,CAAC"}
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,MAAM,sCAAsC,CAAC;AAarE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,YAAY,CAC1B,UAAU,GAAE,GAAQ,EACpB,KAAK,GAAE,iBAAsB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,MAAM,sCAAsC,CAAC;AAarE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,YAAY,CAC1B,UAAU,GAAE,GAAQ,EACpB,KAAK,GAAE,iBAAsB,OAoS9B;AAGD,eAAO,MAAM,MAAM,UAAW,iBAAiB,kBAAkB,GAAG,QACnC,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -89,7 +89,7 @@ function withGTConfig(nextConfig, props) {
|
|
|
89
89
|
// resolve project ID
|
|
90
90
|
var projectId = process.env.GT_PROJECT_ID;
|
|
91
91
|
// resolve API keys
|
|
92
|
-
var envApiKey = process.env.GT_API_KEY;
|
|
92
|
+
var envApiKey = process.env.GT_DEV_API_KEY || process.env.GT_API_KEY;
|
|
93
93
|
var apiKey, devApiKey;
|
|
94
94
|
if (envApiKey) {
|
|
95
95
|
var apiKeyType = (_a = envApiKey === null || envApiKey === void 0 ? void 0 : envApiKey.split('-')) === null || _a === void 0 ? void 0 : _a[1];
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,oCAsSC;AA7VD,8CAAwB;AACxB,0CAAoB;AAEpB,yGAAmF;AAEnF,sDAQ+B;AAC/B,2EAA2E;AAC3E,yDAA4E;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,SAAgB,YAAY,CAC1B,UAAoB,EACpB,KAA6B;;IAD7B,2BAAA,EAAA,eAAoB;IACpB,sBAAA,EAAA,UAA6B;IAE7B,+CAA+C;IAC/C,IAAI,YAAY,GAA+B,EAAE,CAAC;IAClD,IAAM,UAAU,GAAG,KAAK,CAAC,MAAM,IAAI,kCAAwB,CAAC,MAAM,CAAC;IACnE,IAAI,CAAC;QACH,IAAI,OAAO,UA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@ import { PathConfig } from './utils';
|
|
|
12
12
|
* @param {boolean} [config.prefixDefaultLocale=false] - Flag to enable or disable prefixing the default locale to the pathname, i.e., /en/about -> /about
|
|
13
13
|
* @returns {function} - A middleware function that processes the request and response.
|
|
14
14
|
*/
|
|
15
|
-
export default function createNextMiddleware({ localeRouting, prefixDefaultLocale, pathConfig, }
|
|
15
|
+
export default function createNextMiddleware({ localeRouting, prefixDefaultLocale, pathConfig, }?: {
|
|
16
16
|
localeRouting?: boolean;
|
|
17
17
|
prefixDefaultLocale?: boolean;
|
|
18
18
|
pathConfig?: PathConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNextMiddleware.d.ts","sourceRoot":"","sources":["../../src/middleware-dir/createNextMiddleware.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKxD,OAAO,EACL,UAAU,EAMX,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,aAAoB,EACpB,mBAA2B,EAC3B,UAAe,GAChB,
|
|
1
|
+
{"version":3,"file":"createNextMiddleware.d.ts","sourceRoot":"","sources":["../../src/middleware-dir/createNextMiddleware.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKxD,OAAO,EACL,UAAU,EAMX,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,aAAoB,EACpB,mBAA2B,EAC3B,UAAe,GAChB,GAAE;IACD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;CACpB,SAqEyB,WAAW,2BA4KzC"}
|
|
@@ -20,7 +20,7 @@ var utils_1 = require("./utils");
|
|
|
20
20
|
* @returns {function} - A middleware function that processes the request and response.
|
|
21
21
|
*/
|
|
22
22
|
function createNextMiddleware(_a) {
|
|
23
|
-
var _b = _a.localeRouting, localeRouting =
|
|
23
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.localeRouting, localeRouting = _c === void 0 ? true : _c, _d = _b.prefixDefaultLocale, prefixDefaultLocale = _d === void 0 ? false : _d, _e = _b.pathConfig, pathConfig = _e === void 0 ? {} : _e;
|
|
24
24
|
// i18n config
|
|
25
25
|
var envParams;
|
|
26
26
|
if (process.env._GENERALTRANSLATION_I18N_CONFIG_PARAMS) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNextMiddleware.js","sourceRoot":"","sources":["../../src/middleware-dir/createNextMiddleware.ts"],"names":[],"mappings":";;AAoCA,uCAyPC;AA7RD,yDAI4B;AAC5B,wDAGqC;AACrC,uDAAyE;AACzE,sCAAwD;AACxD,gDAG4B;AAC5B,iCAOiB;AAEjB;;;;;;;;;;;GAWG;AACH,SAAwB,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"createNextMiddleware.js","sourceRoot":"","sources":["../../src/middleware-dir/createNextMiddleware.ts"],"names":[],"mappings":";;AAoCA,uCAyPC;AA7RD,yDAI4B;AAC5B,wDAGqC;AACrC,uDAAyE;AACzE,sCAAwD;AACxD,gDAG4B;AAC5B,iCAOiB;AAEjB;;;;;;;;;;;GAWG;AACH,SAAwB,oBAAoB,CAAC,EAQvC;QARuC,qBAQzC,EAAE,KAAA,EAPJ,qBAAoB,EAApB,aAAa,mBAAG,IAAI,KAAA,EACpB,2BAA2B,EAA3B,mBAAmB,mBAAG,KAAK,KAAA,EAC3B,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA;IAMf,cAAc;IACd,IAAI,SAAS,CAAC;IACd,IAAI,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,CAAC;QACvD,IAAI,CAAC;YACH,SAAS,GAAG,IAAI,CAAC,KAAK,CACpB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U,CAAC,CAAC;gBACnD,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,2CAA+B,EAAE,MAAM,CAAC,CAAC;gBAC9D,IAAI,gBAAgB,EAAE,CAAC;oBACrB,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,yCAA6B,CAAC,CAAC;gBACzD,CAAC;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,YAAY;YACZ,OAAO,GAAG,CAAC;QACb,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNextLocale.d.ts","sourceRoot":"","sources":["../../src/next/getNextLocale.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,aAAa,EAAE,MAAM,YAAK,EAC1B,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"getNextLocale.d.ts","sourceRoot":"","sources":["../../src/next/getNextLocale.ts"],"names":[],"mappings":"AAOA;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,aAAa,EAAE,MAAM,YAAK,EAC1B,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,MAAM,CAAC,CA+BjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNextLocale.js","sourceRoot":"","sources":["../../src/next/getNextLocale.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"getNextLocale.js","sourceRoot":"","sources":["../../src/next/getNextLocale.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,sCAkCC;AAlDD,wCAAgD;AAChD,yDAAqD;AACrD,wDAGqC;AAErC;;;;;;;;GAQG;AACH,SAAsB,aAAa;wDACjC,aAA0B,E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
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
variableValue: any;
|
|
5
|
-
variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions;
|
|
6
|
-
locales: string[];
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { RenderVariable } from 'gt-react/internal';
|
|
2
|
+
declare const renderVariable: RenderVariable;
|
|
3
|
+
export default renderVariable;
|
|
8
4
|
//# sourceMappingURL=renderVariable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderVariable.d.ts","sourceRoot":"","sources":["../../../src/server-dir/variables/renderVariable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderVariable.d.ts","sourceRoot":"","sources":["../../../src/server-dir/variables/renderVariable.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,QAAA,MAAM,cAAc,EAAE,cA0BrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -3,23 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = renderVariable;
|
|
7
6
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
7
|
var Num_1 = __importDefault(require("../../variables/Num"));
|
|
9
8
|
var Var_1 = __importDefault(require("../../variables/Var"));
|
|
10
9
|
var Currency_1 = __importDefault(require("../../variables/Currency"));
|
|
11
10
|
var DateTime_1 = __importDefault(require("../../variables/DateTime"));
|
|
12
|
-
function
|
|
13
|
-
var variableType = _a.variableType,
|
|
11
|
+
var renderVariable = function (_a) {
|
|
12
|
+
var variableType = _a.variableType, variableValue = _a.variableValue, variableOptions = _a.variableOptions, locales = _a.locales;
|
|
14
13
|
if (variableType === 'number') {
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)(Num_1.default, {
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(Num_1.default, { options: variableOptions, locales: locales, children: variableValue }));
|
|
16
15
|
}
|
|
17
16
|
else if (variableType === 'datetime') {
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(DateTime_1.default, {
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(DateTime_1.default, { options: variableOptions, locales: locales, children: variableValue }));
|
|
19
18
|
}
|
|
20
19
|
else if (variableType === 'currency') {
|
|
21
|
-
return ((0, jsx_runtime_1.jsx)(Currency_1.default, {
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(Currency_1.default, { options: variableOptions, locales: locales, children: variableValue }));
|
|
22
21
|
}
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(Var_1.default, {
|
|
24
|
-
}
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(Var_1.default, { children: variableValue });
|
|
23
|
+
};
|
|
24
|
+
exports.default = renderVariable;
|
|
25
25
|
//# sourceMappingURL=renderVariable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderVariable.js","sourceRoot":"","sources":["../../../src/server-dir/variables/renderVariable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderVariable.js","sourceRoot":"","sources":["../../../src/server-dir/variables/renderVariable.tsx"],"names":[],"mappings":";;;;;;AAAA,4DAAsC;AACtC,4DAAsC;AACtC,sEAAgD;AAChD,sEAAgD;AAGhD,IAAM,cAAc,GAAmB,UAAC,EAKvC;QAJC,YAAY,kBAAA,EACZ,aAAa,mBAAA,EACb,eAAe,qBAAA,EACf,OAAO,aAAA;IAEP,IAAI,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,CACL,uBAAC,aAAG,IAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,YAC5C,aAAa,GACV,CACP,CAAC;IACJ,CAAC;SAAM,IAAI,YAAY,KAAK,UAAU,EAAE,CAAC;QACvC,OAAO,CACL,uBAAC,kBAAQ,IAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,YACjD,aAAa,GACL,CACZ,CAAC;IACJ,CAAC;SAAM,IAAI,YAAY,KAAK,UAAU,EAAE,CAAC;QACvC,OAAO,CACL,uBAAC,kBAAQ,IAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,YACjD,aAAa,GACL,CACZ,CAAC;IACJ,CAAC;IACD,OAAO,uBAAC,aAAG,cAAE,aAAa,GAAO,CAAC;AACpC,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* @example
|
|
5
5
|
* ```jsx
|
|
6
6
|
* <Currency
|
|
7
|
-
* name="price"
|
|
8
7
|
* currency="USD"
|
|
9
8
|
* >
|
|
10
9
|
* 1000
|
|
@@ -12,21 +11,16 @@
|
|
|
12
11
|
* ```
|
|
13
12
|
*
|
|
14
13
|
* @param {any} [children] - Optional content to render inside the currency component.
|
|
15
|
-
* @param {string} [name] - Optional name for the currency field.
|
|
16
|
-
* @param {any} [value] - The default value to be used.
|
|
17
14
|
* @param {string} [currency] - The currency type (e.g., USD, EUR, etc.).
|
|
18
15
|
* @param {Intl.NumberFormatOptions} [options] - Optional formatting options to customize how the currency is displayed.
|
|
19
|
-
* @returns {JSX.Element} The formatted currency component.
|
|
16
|
+
* @returns {Promise<React.JSX.Element>} The formatted currency component.
|
|
20
17
|
*/
|
|
21
|
-
declare function Currency({ children,
|
|
18
|
+
declare function Currency({ children, currency, options, locales, }: {
|
|
22
19
|
children?: any;
|
|
23
|
-
name?: string;
|
|
24
|
-
value?: any;
|
|
25
20
|
currency?: string;
|
|
26
21
|
options?: Intl.NumberFormatOptions;
|
|
27
22
|
locales?: string[];
|
|
28
|
-
|
|
29
|
-
}): React.JSX.Element;
|
|
23
|
+
}): Promise<React.JSX.Element>;
|
|
30
24
|
declare namespace Currency {
|
|
31
25
|
var gtTransformation: string;
|
|
32
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAe,QAAQ,CAAC,EACtB,QAAQ,EACR,QAAgB,EAChB,OAAY,EACZ,OAA8C,GAC/C,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAc7B;kBAxBc,QAAQ;;;AA4BvB,eAAe,QAAQ,CAAC"}
|
|
@@ -10,16 +10,50 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
50
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
+
if (ar || !(i in from)) {
|
|
52
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
+
ar[i] = from[i];
|
|
21
54
|
}
|
|
22
|
-
|
|
55
|
+
}
|
|
56
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
23
57
|
};
|
|
24
58
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -28,13 +62,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
62
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
63
|
var generaltranslation_1 = require("generaltranslation");
|
|
30
64
|
var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
|
|
65
|
+
var getLocale_1 = __importDefault(require("../request/getLocale"));
|
|
31
66
|
/**
|
|
32
67
|
* The `<Currency>` component renders a formatted currency string, allowing customization of name, default value, currency type, and formatting options.
|
|
33
68
|
*
|
|
34
69
|
* @example
|
|
35
70
|
* ```jsx
|
|
36
71
|
* <Currency
|
|
37
|
-
* name="price"
|
|
38
72
|
* currency="USD"
|
|
39
73
|
* >
|
|
40
74
|
* 1000
|
|
@@ -42,30 +76,27 @@ var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
|
|
|
42
76
|
* ```
|
|
43
77
|
*
|
|
44
78
|
* @param {any} [children] - Optional content to render inside the currency component.
|
|
45
|
-
* @param {string} [name] - Optional name for the currency field.
|
|
46
|
-
* @param {any} [value] - The default value to be used.
|
|
47
79
|
* @param {string} [currency] - The currency type (e.g., USD, EUR, etc.).
|
|
48
80
|
* @param {Intl.NumberFormatOptions} [options] - Optional formatting options to customize how the currency is displayed.
|
|
49
|
-
* @returns {JSX.Element} The formatted currency component.
|
|
81
|
+
* @returns {Promise<React.JSX.Element>} The formatted currency component.
|
|
50
82
|
*/
|
|
51
83
|
function Currency(_a) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
: undefined, style: { display: 'contents' }, suppressHydrationWarning: true, children: typeof formattedValue === 'string' ? formattedValue : undefined }));
|
|
84
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
85
|
+
var renderedValue, formattedValue;
|
|
86
|
+
var children = _b.children, _c = _b.currency, currency = _c === void 0 ? 'USD' : _c, _d = _b.options, options = _d === void 0 ? {} : _d, _e = _b.locales, locales = _e === void 0 ? [(0, getI18NConfig_1.default)().getDefaultLocale()] : _e;
|
|
87
|
+
return __generator(this, function (_f) {
|
|
88
|
+
switch (_f.label) {
|
|
89
|
+
case 0: return [4 /*yield*/, (0, getLocale_1.default)()];
|
|
90
|
+
case 1:
|
|
91
|
+
locales = __spreadArray.apply(void 0, [[_f.sent()], locales, true]);
|
|
92
|
+
renderedValue = typeof children === 'string' ? parseFloat(children) : children;
|
|
93
|
+
formattedValue = typeof renderedValue === 'number'
|
|
94
|
+
? (0, generaltranslation_1.formatCurrency)(renderedValue, currency, __assign({ locales: locales }, options))
|
|
95
|
+
: renderedValue;
|
|
96
|
+
return [2 /*return*/, (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: formattedValue })];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
69
100
|
}
|
|
70
101
|
Currency.gtTransformation = 'variable-currency';
|
|
71
102
|
exports.default = Currency;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Currency.js","sourceRoot":"","sources":["../../src/variables/Currency.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAoD;AACpD,8EAAwD;AACxD,mEAA6C;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,SAAe,QAAQ;wDAAC,EAUvB;;YATC,QAAQ,cAAA,EACR,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA,EACZ,eAA8C,EAA9C,OAAO,mBAAG,CAAC,IAAA,uBAAa,GAAE,CAAC,gBAAgB,EAAE,CAAC,KAAA;;;wBAOnC,qBAAM,IAAA,mBAAS,GAAE,EAAA;;oBAA5B,OAAO,iCAAI,SAAiB,GAAK,OAAO,QAAC,CAAC;oBAGpC,aAAa,GACjB,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;oBAG3D,cAAc,GAClB,OAAO,aAAa,KAAK,QAAQ;wBAC/B,CAAC,CAAC,IAAA,mCAAc,EAAC,aAAa,EAAE,QAAQ,aAAI,OAAO,SAAA,IAAK,OAAO,EAAG;wBAClE,CAAC,CAAC,aAAa,CAAC;oBAEpB,sBAAO,2DAAG,cAAc,GAAI,EAAC;;;;CAC9B;AAED,QAAQ,CAAC,gBAAgB,GAAG,mBAAmB,CAAC;AAEhD,kBAAe,QAAQ,CAAC"}
|
|
@@ -4,27 +4,20 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```jsx
|
|
7
|
-
* <DateTime
|
|
8
|
-
* name="createdAt"
|
|
9
|
-
* >
|
|
7
|
+
* <DateTime>
|
|
10
8
|
* {new Date()}
|
|
11
9
|
* </DateTime>
|
|
12
10
|
* ```
|
|
13
11
|
*
|
|
14
12
|
* @param {any} [children] - Optional content (typically a date) to render inside the component.
|
|
15
|
-
* @param {string} [name="date"] - Optional name for the date field, used for metadata purposes.
|
|
16
|
-
* @param {string|number|Date} [value] - The default value for the date. Can be a string, number (timestamp), or `Date` object.
|
|
17
13
|
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options for the date, following `Intl.DateTimeFormatOptions` specifications.
|
|
18
|
-
* @returns {Promise<JSX.Element>} The formatted date or time component.
|
|
14
|
+
* @returns {Promise<React.JSX.Element>} The formatted date or time component.
|
|
19
15
|
*/
|
|
20
|
-
declare function DateTime({ children,
|
|
16
|
+
declare function DateTime({ children, options, locales, }: {
|
|
21
17
|
children?: any;
|
|
22
|
-
name?: string;
|
|
23
|
-
value?: any;
|
|
24
18
|
options?: Intl.DateTimeFormatOptions;
|
|
25
19
|
locales?: string[];
|
|
26
|
-
|
|
27
|
-
}): React.JSX.Element;
|
|
20
|
+
}): Promise<React.JSX.Element>;
|
|
28
21
|
declare namespace DateTime {
|
|
29
22
|
var gtTransformation: string;
|
|
30
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTime.d.ts","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,iBAAe,QAAQ,CAAC,EACtB,QAAQ,EACR,OAAY,EACZ,OAA8C,GAC/C,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAoB7B;kBA5Bc,QAAQ;;;AAgCvB,eAAe,QAAQ,CAAC"}
|
|
@@ -10,16 +10,50 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
50
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
+
if (ar || !(i in from)) {
|
|
52
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
+
ar[i] = from[i];
|
|
21
54
|
}
|
|
22
|
-
|
|
55
|
+
}
|
|
56
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
23
57
|
};
|
|
24
58
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -28,62 +62,49 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
62
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
63
|
var generaltranslation_1 = require("generaltranslation");
|
|
30
64
|
var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
|
|
65
|
+
var getLocale_1 = __importDefault(require("../request/getLocale"));
|
|
31
66
|
/**
|
|
32
67
|
* The `<DateTime>` component renders a formatted date or time string, allowing customization of the name, default value, and formatting options.
|
|
33
68
|
* It utilizes the current locale and optional format settings to display the date.
|
|
34
69
|
*
|
|
35
70
|
* @example
|
|
36
71
|
* ```jsx
|
|
37
|
-
* <DateTime
|
|
38
|
-
* name="createdAt"
|
|
39
|
-
* >
|
|
72
|
+
* <DateTime>
|
|
40
73
|
* {new Date()}
|
|
41
74
|
* </DateTime>
|
|
42
75
|
* ```
|
|
43
76
|
*
|
|
44
77
|
* @param {any} [children] - Optional content (typically a date) to render inside the component.
|
|
45
|
-
* @param {string} [name="date"] - Optional name for the date field, used for metadata purposes.
|
|
46
|
-
* @param {string|number|Date} [value] - The default value for the date. Can be a string, number (timestamp), or `Date` object.
|
|
47
78
|
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options for the date, following `Intl.DateTimeFormatOptions` specifications.
|
|
48
|
-
* @returns {Promise<JSX.Element>} The formatted date or time component.
|
|
79
|
+
* @returns {Promise<React.JSX.Element>} The formatted date or time component.
|
|
49
80
|
*/
|
|
50
81
|
function DateTime(_a) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)("span", { "data-_gt": generaltranslation, "data-_gt-variable-name": name, "data-_gt-variable-type": 'date', "data-_gt-variable-options": JSON.stringify(options), "data-_gt-unformatted-value": isValidDate(dateValue) ? dateValue : undefined, style: { display: 'contents' }, suppressHydrationWarning: true, children: formattedValue }));
|
|
82
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
83
|
+
var final, dateValue, defaultValue;
|
|
84
|
+
var children = _b.children, _c = _b.options, options = _c === void 0 ? {} : _c, _d = _b.locales, locales = _d === void 0 ? [(0, getI18NConfig_1.default)().getDefaultLocale()] : _d;
|
|
85
|
+
return __generator(this, function (_e) {
|
|
86
|
+
switch (_e.label) {
|
|
87
|
+
case 0: return [4 /*yield*/, (0, getLocale_1.default)()];
|
|
88
|
+
case 1:
|
|
89
|
+
locales = __spreadArray.apply(void 0, [[_e.sent()], locales, true]);
|
|
90
|
+
defaultValue = children;
|
|
91
|
+
if (typeof defaultValue === 'number') {
|
|
92
|
+
dateValue = new Date(defaultValue);
|
|
93
|
+
}
|
|
94
|
+
else if (typeof defaultValue === 'string') {
|
|
95
|
+
dateValue = new Date(defaultValue);
|
|
96
|
+
}
|
|
97
|
+
else if (defaultValue instanceof Date) {
|
|
98
|
+
dateValue = defaultValue;
|
|
99
|
+
}
|
|
100
|
+
if (typeof dateValue !== 'undefined') {
|
|
101
|
+
final = (0, generaltranslation_1.formatDateTime)(dateValue, __assign({ locales: locales }, options)).replace(/[\u200F\u202B\u202E]/g, '');
|
|
102
|
+
}
|
|
103
|
+
return [2 /*return*/, (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: final })];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
77
107
|
}
|
|
78
108
|
DateTime.gtTransformation = 'variable-datetime';
|
|
79
109
|
exports.default = DateTime;
|
|
80
|
-
/**
|
|
81
|
-
* Checks if the input is a valid date object or a string that can be converted to a date.
|
|
82
|
-
* @param {any} input - The input to check.
|
|
83
|
-
* @returns {boolean} - Returns true if the input is a valid date, false otherwise.
|
|
84
|
-
*/
|
|
85
|
-
function isValidDate(input) {
|
|
86
|
-
var date = new Date(input);
|
|
87
|
-
return !isNaN(date.getTime());
|
|
88
|
-
}
|
|
89
110
|
//# sourceMappingURL=DateTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../src/variables/DateTime.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAoD;AACpD,8EAAwD;AACxD,mEAA6C;AAE7C;;;;;;;;;;;;;;GAcG;AACH,SAAe,QAAQ;wDAAC,EAQvB;;YAPC,QAAQ,cAAA,EACR,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA,EACZ,eAA8C,EAA9C,OAAO,mBAAG,CAAC,IAAA,uBAAa,GAAE,CAAC,gBAAgB,EAAE,CAAC,KAAA;;;wBAMnC,qBAAM,IAAA,mBAAS,GAAE,EAAA;;oBAA5B,OAAO,iCAAI,SAAiB,GAAK,OAAO,QAAC,CAAC;oBAItC,YAAY,GAAG,QAAQ,CAAC;oBAC5B,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;wBACrC,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;oBACrC,CAAC;yBAAM,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;wBAC5C,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;oBACrC,CAAC;yBAAM,IAAI,YAAY,YAAY,IAAI,EAAE,CAAC;wBACxC,SAAS,GAAG,YAAY,CAAC;oBAC3B,CAAC;oBACD,IAAI,OAAO,SAAS,KAAK,WAAW,EAAE,CAAC;wBACrC,KAAK,GAAG,IAAA,mCAAc,EAAC,SAAS,aAAI,OAAO,SAAA,IAAK,OAAO,EAAG,CAAC,OAAO,CAChE,uBAAuB,EACvB,EAAE,CACH,CAAC;oBACJ,CAAC;oBACD,sBAAO,2DAAG,KAAK,GAAI,EAAC;;;;CACrB;AAED,QAAQ,CAAC,gBAAgB,GAAG,mBAAmB,CAAC;AAEhD,kBAAe,QAAQ,CAAC"}
|
package/dist/variables/Num.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* @example
|
|
6
6
|
* ```jsx
|
|
7
7
|
* <Num
|
|
8
|
-
* name="quantity"
|
|
9
8
|
* options={{ style: "decimal", maximumFractionDigits: 2 }}
|
|
10
9
|
* >
|
|
11
10
|
* 1000
|
|
@@ -13,19 +12,14 @@
|
|
|
13
12
|
* ```
|
|
14
13
|
*
|
|
15
14
|
* @param {any} [children] - Optional content (typically a number) to render inside the component.
|
|
16
|
-
* @param {string} [name="n"] - Optional name for the number field, used for metadata purposes.
|
|
17
|
-
* @param {string|number} [value] - The default value for the number. Can be a string or number. Strings will be parsed to numbers.
|
|
18
15
|
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
|
19
|
-
* @returns {Promise<JSX.Element>} The formatted number component.
|
|
16
|
+
* @returns {Promise<React.JSX.Element>} The formatted number component.
|
|
20
17
|
*/
|
|
21
|
-
declare function Num({ children,
|
|
18
|
+
declare function Num({ children, options, locales, }: {
|
|
22
19
|
children?: any;
|
|
23
|
-
name?: string;
|
|
24
|
-
value?: any;
|
|
25
20
|
options?: Intl.NumberFormatOptions;
|
|
26
21
|
locales?: string[];
|
|
27
|
-
|
|
28
|
-
}): React.JSX.Element;
|
|
22
|
+
}): Promise<React.JSX.Element>;
|
|
29
23
|
declare namespace Num {
|
|
30
24
|
var gtTransformation: string;
|
|
31
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Num.d.ts","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Num.d.ts","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAe,GAAG,CAAC,EACjB,QAAQ,EACR,OAAY,EACZ,OAA8C,GAC/C,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAc7B;kBAtBc,GAAG;;;AA0BlB,eAAe,GAAG,CAAC"}
|
package/dist/variables/Num.js
CHANGED
|
@@ -10,16 +10,50 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
50
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
+
if (ar || !(i in from)) {
|
|
52
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
+
ar[i] = from[i];
|
|
21
54
|
}
|
|
22
|
-
|
|
55
|
+
}
|
|
56
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
23
57
|
};
|
|
24
58
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -28,6 +62,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
62
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
63
|
var generaltranslation_1 = require("generaltranslation");
|
|
30
64
|
var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
|
|
65
|
+
var getLocale_1 = __importDefault(require("../request/getLocale"));
|
|
31
66
|
/**
|
|
32
67
|
* The `<Num>` component renders a formatted number string, allowing customization of the name, default value, and formatting options.
|
|
33
68
|
* It formats the number according to the current locale and optionally passed formatting options.
|
|
@@ -35,7 +70,6 @@ var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
|
|
|
35
70
|
* @example
|
|
36
71
|
* ```jsx
|
|
37
72
|
* <Num
|
|
38
|
-
* name="quantity"
|
|
39
73
|
* options={{ style: "decimal", maximumFractionDigits: 2 }}
|
|
40
74
|
* >
|
|
41
75
|
* 1000
|
|
@@ -43,29 +77,26 @@ var getI18NConfig_1 = __importDefault(require("../config-dir/getI18NConfig"));
|
|
|
43
77
|
* ```
|
|
44
78
|
*
|
|
45
79
|
* @param {any} [children] - Optional content (typically a number) to render inside the component.
|
|
46
|
-
* @param {string} [name="n"] - Optional name for the number field, used for metadata purposes.
|
|
47
|
-
* @param {string|number} [value] - The default value for the number. Can be a string or number. Strings will be parsed to numbers.
|
|
48
80
|
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
|
49
|
-
* @returns {Promise<JSX.Element>} The formatted number component.
|
|
81
|
+
* @returns {Promise<React.JSX.Element>} The formatted number component.
|
|
50
82
|
*/
|
|
51
83
|
function Num(_a) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
: undefined, style: { display: 'contents' }, suppressHydrationWarning: true, children: formattedValue }));
|
|
84
|
+
return __awaiter(this, arguments, void 0, function (_b) {
|
|
85
|
+
var renderedValue, formattedValue;
|
|
86
|
+
var children = _b.children, _c = _b.options, options = _c === void 0 ? {} : _c, _d = _b.locales, locales = _d === void 0 ? [(0, getI18NConfig_1.default)().getDefaultLocale()] : _d;
|
|
87
|
+
return __generator(this, function (_e) {
|
|
88
|
+
switch (_e.label) {
|
|
89
|
+
case 0: return [4 /*yield*/, (0, getLocale_1.default)()];
|
|
90
|
+
case 1:
|
|
91
|
+
locales = __spreadArray.apply(void 0, [[_e.sent()], locales, true]);
|
|
92
|
+
renderedValue = typeof children === 'string' ? parseFloat(children) : children;
|
|
93
|
+
formattedValue = typeof renderedValue === 'number'
|
|
94
|
+
? (0, generaltranslation_1.formatNum)(renderedValue, __assign({ locales: locales }, options))
|
|
95
|
+
: renderedValue;
|
|
96
|
+
return [2 /*return*/, (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: formattedValue })];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
69
100
|
}
|
|
70
101
|
Num.gtTransformation = 'variable-number';
|
|
71
102
|
exports.default = Num;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Num.js","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Num.js","sourceRoot":"","sources":["../../src/variables/Num.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA+C;AAC/C,8EAAwD;AACxD,mEAA6C;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,SAAe,GAAG;wDAAC,EAQlB;;YAPC,QAAQ,cAAA,EACR,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA,EACZ,eAA8C,EAA9C,OAAO,mBAAG,CAAC,IAAA,uBAAa,GAAE,CAAC,gBAAgB,EAAE,CAAC,KAAA;;;wBAMnC,qBAAM,IAAA,mBAAS,GAAE,EAAA;;oBAA5B,OAAO,iCAAI,SAAiB,GAAK,OAAO,QAAC,CAAC;oBAGpC,aAAa,GACjB,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;oBAG3D,cAAc,GAClB,OAAO,aAAa,KAAK,QAAQ;wBAC/B,CAAC,CAAC,IAAA,8BAAS,EAAC,aAAa,aAAI,OAAO,SAAA,IAAK,OAAO,EAAG;wBACnD,CAAC,CAAC,aAAa,CAAC;oBAEpB,sBAAO,2DAAG,cAAc,GAAI,EAAC;;;;CAC9B;AAED,GAAG,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;AAEzC,kBAAe,GAAG,CAAC"}
|
package/dist/variables/Var.d.ts
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* The `<Var>` component renders a variable value, which can either be passed as `children` or a `value`.
|
|
3
4
|
* If `children` is provided, it will be used; otherwise, the `value` is rendered.
|
|
4
5
|
*
|
|
5
6
|
* @example
|
|
6
7
|
* ```jsx
|
|
7
|
-
* <Var
|
|
8
|
-
* name="username"
|
|
9
|
-
* >
|
|
8
|
+
* <Var>
|
|
10
9
|
* John
|
|
11
10
|
* </Var>
|
|
12
11
|
* ```
|
|
13
12
|
*
|
|
14
13
|
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `value`.
|
|
15
|
-
* @
|
|
16
|
-
* @param {any} [value] - The default value to be displayed if `children` is not provided.
|
|
17
|
-
* @returns {JSX.Element} The rendered variable component with either `children` or `value`.
|
|
14
|
+
* @returns {React.JSX.Element} The rendered variable component with either `children` or `value`.
|
|
18
15
|
*/
|
|
19
|
-
declare function Var({ children,
|
|
16
|
+
declare function Var({ children, }: {
|
|
20
17
|
children?: any;
|
|
21
|
-
name?: string;
|
|
22
|
-
value?: any;
|
|
23
18
|
'data-_gt'?: any;
|
|
24
19
|
}): React.JSX.Element;
|
|
25
20
|
declare namespace Var {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Var.d.ts","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Var.d.ts","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;;;;;GAaG;AACH,iBAAS,GAAG,CAAC,EACX,QAAQ,GACT,EAAE;IACD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAEpB;kBAPQ,GAAG;;;AAWZ,eAAe,GAAG,CAAC"}
|
package/dist/variables/Var.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
4
|
/**
|
|
@@ -18,24 +7,17 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
18
7
|
*
|
|
19
8
|
* @example
|
|
20
9
|
* ```jsx
|
|
21
|
-
* <Var
|
|
22
|
-
* name="username"
|
|
23
|
-
* >
|
|
10
|
+
* <Var>
|
|
24
11
|
* John
|
|
25
12
|
* </Var>
|
|
26
13
|
* ```
|
|
27
14
|
*
|
|
28
15
|
* @param {any} [children] - The content to render inside the component. If provided, it will take precedence over `value`.
|
|
29
|
-
* @
|
|
30
|
-
* @param {any} [value] - The default value to be displayed if `children` is not provided.
|
|
31
|
-
* @returns {JSX.Element} The rendered variable component with either `children` or `value`.
|
|
16
|
+
* @returns {React.JSX.Element} The rendered variable component with either `children` or `value`.
|
|
32
17
|
*/
|
|
33
18
|
function Var(_a) {
|
|
34
|
-
var children = _a.children
|
|
35
|
-
|
|
36
|
-
if (typeof children !== 'undefined' && typeof value === 'undefined')
|
|
37
|
-
value = children;
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)("span", { "data-_gt": generaltranslation, "data-_gt-variable-name": name, "data-_gt-variable-type": 'variable', style: { display: 'contents' }, suppressHydrationWarning: true, children: value }));
|
|
19
|
+
var children = _a.children;
|
|
20
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
39
21
|
}
|
|
40
22
|
Var.gtTransformation = 'variable-variable'; // keep this because Var is imported in other functions
|
|
41
23
|
exports.default = Var;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Var.js","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Var.js","sourceRoot":"","sources":["../../src/variables/Var.tsx"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;GAaG;AACH,SAAS,GAAG,CAAC,EAKZ;QAJC,QAAQ,cAAA;IAKR,OAAO,2DAAG,QAAQ,GAAI,CAAC;AACzB,CAAC;AAED,GAAG,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC,uDAAuD;AAEnG,kBAAe,GAAG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-next",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.12-alpha.1",
|
|
4
4
|
"description": "A Next.js library for automatic internationalization.",
|
|
5
5
|
"main": "dist/index.server.js",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@generaltranslation/supported-locales": "^2.0.7",
|
|
13
13
|
"generaltranslation": "^6.2.2",
|
|
14
|
-
"gt-react": "^9.2.
|
|
14
|
+
"gt-react": "^9.2.10-alpha.1"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"patch": "npm version patch",
|