gt-react 2.0.190 → 2.0.191
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/client/GTProvider.d.ts +3 -4
- package/dist/client/GTProvider.d.ts.map +1 -1
- package/dist/client/GTProvider.js +19 -1
- package/dist/client/GTProvider.js.map +1 -1
- package/dist/config/I18NConfig.d.ts +10 -2
- package/dist/config/I18NConfig.d.ts.map +1 -1
- package/dist/config/I18NConfig.js +23 -5
- package/dist/config/I18NConfig.js.map +1 -1
- package/dist/config/SheetManager.js +1 -1
- package/dist/config/SheetManager.js.map +1 -1
- package/dist/config/local/getConfigData.d.ts.map +1 -1
- package/dist/config/local/getConfigData.js +4 -10
- package/dist/config/local/getConfigData.js.map +1 -1
- package/dist/config/local/getDictionaryEntry.d.ts +2 -0
- package/dist/config/local/getDictionaryEntry.d.ts.map +1 -0
- package/dist/config/local/getDictionaryEntry.js +14 -0
- package/dist/config/local/getDictionaryEntry.js.map +1 -0
- package/dist/config/local/readLocalFile.d.ts +7 -0
- package/dist/config/local/readLocalFile.d.ts.map +1 -0
- package/dist/config/local/readLocalFile.js +26 -0
- package/dist/config/local/readLocalFile.js.map +1 -0
- package/dist/dict/dict.d.ts +6 -0
- package/dist/dict/dict.d.ts.map +1 -0
- package/dist/dict/dict.js +43 -0
- package/dist/dict/dict.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/middleware/createNextMiddleware.d.ts +1 -1
- package/dist/middleware/createNextMiddleware.d.ts.map +1 -1
- package/dist/middleware/createNextMiddleware.js +32 -43
- package/dist/middleware/createNextMiddleware.js.map +1 -1
- package/dist/next/dict.d.ts +6 -0
- package/dist/next/dict.d.ts.map +1 -0
- package/dist/next/dict.js +41 -0
- package/dist/next/dict.js.map +1 -0
- package/dist/next/imports/imports.d.ts +5 -5
- package/dist/next/imports/imports.d.ts.map +1 -1
- package/dist/next/imports/imports.js +44 -69
- package/dist/next/imports/imports.js.map +1 -1
- package/dist/next/nextT.d.ts +6 -0
- package/dist/next/nextT.d.ts.map +1 -0
- package/dist/next/nextT.js +41 -0
- package/dist/next/nextT.js.map +1 -0
- package/dist/next/requestFunctions.d.ts +6 -6
- package/dist/next/requestFunctions.d.ts.map +1 -1
- package/dist/next/requestFunctions.js +28 -41
- package/dist/next/requestFunctions.js.map +1 -1
- package/dist/next/t.d.ts +5 -0
- package/dist/next/t.d.ts.map +1 -0
- package/dist/next/t.js +46 -0
- package/dist/next/t.js.map +1 -0
- package/dist/next.d.ts +2 -1
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +3 -1
- package/dist/next.js.map +1 -1
- package/dist/primitives/value/client/RenderClientVariable.d.ts.map +1 -1
- package/dist/primitives/value/client/RenderClientVariable.js +4 -0
- package/dist/primitives/value/client/RenderClientVariable.js.map +1 -1
- package/dist/server/ServerI18N.js +1 -1
- package/dist/server/ServerI18N.js.map +1 -1
- package/dist/server/t.d.ts +7 -0
- package/dist/server/t.d.ts.map +1 -0
- package/dist/server/t.js +60 -0
- package/dist/server/t.js.map +1 -0
- package/dist/t/t.d.ts +6 -0
- package/dist/t/t.d.ts.map +1 -0
- package/dist/t/t.js +54 -0
- package/dist/t/t.js.map +1 -0
- package/package.json +1 -1
- package/scratchpad.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNextMiddleware.js","sourceRoot":"","sources":["../../src/middleware/createNextMiddleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createNextMiddleware.js","sourceRoot":"","sources":["../../src/middleware/createNextMiddleware.ts"],"names":[],"mappings":";;AAuDA,uCAyHC;AAhLD,2DAAyE;AACzE,qDAAyH;AAEzH;;;;;GAKG;AACH,SAAS,aAAa,CAAC,QAAgB;IACnC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACtD,OAAO,OAA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+1 @@
|
|
|
1
|
+
{"version":3,"file":"dict.d.ts","sourceRoot":"","sources":["../../src/next/dict.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,wBAA8B,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAUlJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.default = nextDict;
|
|
27
|
+
const I18NConfig_1 = __importDefault(require("../config/I18NConfig"));
|
|
28
|
+
const dict_1 = __importDefault(require("../dict/dict"));
|
|
29
|
+
const requestFunctions_1 = require("./requestFunctions");
|
|
30
|
+
function nextDict(id, _a) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
var { userLanguage } = _a, options = __rest(_a, ["userLanguage"]);
|
|
33
|
+
const currentLanguage = userLanguage || ((0, requestFunctions_1.getUserLanguageNext)()) || I18NConfig_1.default.getDefaultLanguage();
|
|
34
|
+
const domain = (options === null || options === void 0 ? void 0 : options.domain) || ((0, requestFunctions_1.getDomainNext)()) || '';
|
|
35
|
+
if (domain) {
|
|
36
|
+
options.domain = domain;
|
|
37
|
+
}
|
|
38
|
+
return yield (0, dict_1.default)(id, Object.assign({ userLanguage: currentLanguage }, options));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=dict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dict.js","sourceRoot":"","sources":["../../src/next/dict.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,2BAUC;AAfD,sEAA8C;AAC9C,wDAAgC;AAChC,yDAAwE;AAGxE,SAA8B,QAAQ,CAAC,EAAU,EAAE,EAA2E;;YAA3E,EAAE,YAAY,OAA6D,EAAxD,OAAO,cAA1B,gBAA4B,CAAF;QAEzE,MAAM,eAAe,GAAW,YAAY,IAAI,CAAC,IAAA,sCAAmB,GAAE,CAAC,IAAI,oBAAU,CAAC,kBAAkB,EAAE,CAAC;QAC3G,MAAM,MAAM,GAAW,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,KAAI,CAAC,IAAA,gCAAa,GAAE,CAAC,IAAI,EAAE,CAAC;QAElE,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QAC5B,CAAC;QAED,OAAO,MAAM,IAAA,cAAI,EAAC,EAAE,kBAAI,YAAY,EAAE,eAAe,IAAK,OAAO,EAAG,CAAC;IACzE,CAAC;CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function getNextHeaders():
|
|
2
|
-
export declare function getNextCookies():
|
|
3
|
-
export declare function getNextResponse():
|
|
4
|
-
export declare function getNextRequestCookies():
|
|
5
|
-
export declare function getNextResponseCookies():
|
|
1
|
+
export declare function getNextHeaders(): (() => Headers) | null;
|
|
2
|
+
export declare function getNextCookies(): (() => any) | null;
|
|
3
|
+
export declare function getNextResponse(): any;
|
|
4
|
+
export declare function getNextRequestCookies(): any;
|
|
5
|
+
export declare function getNextResponseCookies(): any;
|
|
6
6
|
//# sourceMappingURL=imports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../../src/next/imports/imports.ts"],"names":[],"mappings":"AAkBA,
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../../src/next/imports/imports.ts"],"names":[],"mappings":"AAkBA,wBAAgB,cAAc,WAjBV,OAAO,SAoB1B;AAED,wBAAgB,cAAc,WAvBV,GAAG,SA0BtB;AAoBD,wBAAgB,eAAe,QAG9B;AAsBD,wBAAgB,qBAAqB,QAGpC;AAED,wBAAgB,sBAAsB,QAGrC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.getNextHeaders = getNextHeaders;
|
|
13
4
|
exports.getNextCookies = getNextCookies;
|
|
@@ -17,93 +8,77 @@ exports.getNextResponseCookies = getNextResponseCookies;
|
|
|
17
8
|
let cookies = null;
|
|
18
9
|
let headers = null;
|
|
19
10
|
/**
|
|
20
|
-
*
|
|
11
|
+
* Load the 'next/headers' module
|
|
21
12
|
*/
|
|
22
13
|
function loadNextHeaders() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
cookies = nextHeaders.cookies;
|
|
29
|
-
}
|
|
14
|
+
try {
|
|
15
|
+
if (!headers || !cookies) {
|
|
16
|
+
const nextHeaders = require('next/headers');
|
|
17
|
+
headers = nextHeaders.headers;
|
|
18
|
+
cookies = nextHeaders.cookies;
|
|
30
19
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.warn('next/headers is not available. Running in non-Next.js environment.');
|
|
23
|
+
}
|
|
35
24
|
}
|
|
36
25
|
function getNextHeaders() {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return headers;
|
|
41
|
-
});
|
|
26
|
+
if (!headers)
|
|
27
|
+
loadNextHeaders();
|
|
28
|
+
return headers;
|
|
42
29
|
}
|
|
43
30
|
function getNextCookies() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return cookies;
|
|
48
|
-
});
|
|
31
|
+
if (!cookies)
|
|
32
|
+
loadNextHeaders();
|
|
33
|
+
return cookies;
|
|
49
34
|
}
|
|
50
35
|
//
|
|
51
36
|
let NextResponse = null;
|
|
52
37
|
/**
|
|
53
|
-
*
|
|
38
|
+
* Load the 'next/server' module
|
|
54
39
|
*/
|
|
55
40
|
function loadNextServer() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
NextResponse = server.NextResponse;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
console.warn('next/server is not available. Running in non-Next.js environment.');
|
|
41
|
+
try {
|
|
42
|
+
if (!NextResponse) {
|
|
43
|
+
const server = require('next/server');
|
|
44
|
+
NextResponse = server.NextResponse;
|
|
65
45
|
}
|
|
66
|
-
}
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.warn('next/server is not available. Running in non-Next.js environment.');
|
|
49
|
+
}
|
|
67
50
|
}
|
|
68
51
|
function getNextResponse() {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return NextResponse;
|
|
73
|
-
});
|
|
52
|
+
if (!NextResponse)
|
|
53
|
+
loadNextServer();
|
|
54
|
+
return NextResponse;
|
|
74
55
|
}
|
|
75
56
|
//
|
|
76
57
|
let ResponseCookies = null;
|
|
77
58
|
let RequestCookies = null;
|
|
78
59
|
/**
|
|
79
|
-
*
|
|
60
|
+
* Load the 'next/dist/server/web/spec-extension/cookies' module
|
|
80
61
|
*/
|
|
81
62
|
function loadNextSpecExtensionCookies() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
RequestCookies = cookies.RequestCookies;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
console.warn('next/server is not available. Running in non-Next.js environment.');
|
|
63
|
+
try {
|
|
64
|
+
if (!ResponseCookies) {
|
|
65
|
+
const cookies = require('next/dist/server/web/spec-extension/cookies');
|
|
66
|
+
ResponseCookies = cookies.ResponseCookies;
|
|
67
|
+
RequestCookies = cookies.RequestCookies;
|
|
92
68
|
}
|
|
93
|
-
}
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
console.warn('next/server is not available. Running in non-Next.js environment.');
|
|
72
|
+
}
|
|
94
73
|
}
|
|
95
74
|
function getNextRequestCookies() {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return RequestCookies;
|
|
100
|
-
});
|
|
75
|
+
if (!RequestCookies)
|
|
76
|
+
loadNextSpecExtensionCookies();
|
|
77
|
+
return RequestCookies;
|
|
101
78
|
}
|
|
102
79
|
function getNextResponseCookies() {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return ResponseCookies;
|
|
107
|
-
});
|
|
80
|
+
if (!ResponseCookies)
|
|
81
|
+
loadNextSpecExtensionCookies();
|
|
82
|
+
return ResponseCookies;
|
|
108
83
|
}
|
|
109
84
|
//# sourceMappingURL=imports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../../src/next/imports/imports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../../src/next/imports/imports.ts"],"names":[],"mappings":";;AAkBA,wCAGC;AAED,wCAGC;AAoBD,0CAGC;AAsBD,sDAGC;AAED,wDAGC;AA/ED,IAAI,OAAO,GAAuB,IAAI,CAAC;AACvC,IAAI,OAAO,GAA2B,IAAI,CAAC;AAE3C;;GAEG;AACH,SAAS,eAAe;IACpB,IAAI,CAAC;QACD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;YACvB,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;YAC5C,OAAO,GAAG,WAAW,CAAC,OAA0B,CAAC;YACjD,OAAO,GAAG,WAAW,CAAC,OAAsB,CAAC;QACjD,CAAC;IACL,CAAC;IAAC,OAAO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cAAc;QAAE,4BAA4B,EAAE,CAAC;IACpD,OAAO,cAAc,CAAC;AAC1B,CAAC;AAED,SAAgB,sBAAsB;IAClC,IAAI,CAAC,eAAe;QAAE,4BAA4B,EAAE,CAAC;IACrD,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextT.d.ts","sourceRoot":"","sources":["../../src/next/nextT.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,wBAA8B,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAU/I"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.default = nextT;
|
|
27
|
+
const I18NConfig_1 = __importDefault(require("../config/I18NConfig"));
|
|
28
|
+
const t_1 = __importDefault(require("../t/t"));
|
|
29
|
+
const requestFunctions_1 = require("./requestFunctions");
|
|
30
|
+
function nextT(id, _a) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
var { userLanguage } = _a, options = __rest(_a, ["userLanguage"]);
|
|
33
|
+
const currentLanguage = userLanguage || ((0, requestFunctions_1.getUserLanguageNext)()) || I18NConfig_1.default.getDefaultLanguage();
|
|
34
|
+
const domain = (options === null || options === void 0 ? void 0 : options.domain) || ((0, requestFunctions_1.getDomainNext)()) || '';
|
|
35
|
+
if (domain) {
|
|
36
|
+
options.domain = domain;
|
|
37
|
+
}
|
|
38
|
+
return yield (0, t_1.default)(id, Object.assign({ userLanguage: currentLanguage }, options));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=nextT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextT.js","sourceRoot":"","sources":["../../src/next/nextT.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAUC;AAfD,sEAA8C;AAC9C,+CAAuB;AACvB,yDAAwE;AAGxE,SAA8B,KAAK,CAAC,EAAU,EAAE,EAA2E;;YAA3E,EAAE,YAAY,OAA6D,EAAxD,OAAO,cAA1B,gBAA4B,CAAF;QAEtE,MAAM,eAAe,GAAW,YAAY,IAAI,CAAC,IAAA,sCAAmB,GAAE,CAAC,IAAI,oBAAU,CAAC,kBAAkB,EAAE,CAAC;QAC3G,MAAM,MAAM,GAAW,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,KAAI,CAAC,IAAA,gCAAa,GAAE,CAAC,IAAI,EAAE,CAAC;QAElE,IAAI,MAAM,EAAE,CAAC;YACT,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QAC5B,CAAC;QAED,OAAO,MAAM,IAAA,WAAC,EAAC,EAAE,kBAAI,YAAY,EAAE,eAAe,IAAK,OAAO,EAAG,CAAC;IACtE,CAAC;CAAA"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Retrieves the 'accept-language' header from the headers list.
|
|
3
3
|
* If the 'next/headers' module is not available, it attempts to load it. If the
|
|
4
4
|
* headers function is available, it returns the primary language from the 'accept-language'
|
|
5
5
|
* header. If the headers function or 'accept-language' header is not available, returns null.
|
|
6
6
|
*
|
|
7
|
-
* @returns {
|
|
7
|
+
* @returns {string | null} A promise that resolves to the primary language from the
|
|
8
8
|
* 'accept-language' header, or null if not available.
|
|
9
9
|
*/
|
|
10
|
-
export declare function getUserLanguageNext():
|
|
10
|
+
export declare function getUserLanguageNext(): string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Retrieves the 'host' header from the headers list.
|
|
13
13
|
* If the 'next/headers' module is not available, it attempts to load it. If the
|
|
14
14
|
* headers function is available, it returns the value of the 'host' header.
|
|
15
15
|
* If the headers function or 'host' header is not available, returns null.
|
|
16
16
|
*
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {string | null} A promise that resolves to the value of the 'host' header,
|
|
18
18
|
* or null if not available.
|
|
19
19
|
*/
|
|
20
|
-
export declare function getDomainNext():
|
|
20
|
+
export declare function getDomainNext(): string | null;
|
|
21
21
|
//# sourceMappingURL=requestFunctions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestFunctions.d.ts","sourceRoot":"","sources":["../../src/next/requestFunctions.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,
|
|
1
|
+
{"version":3,"file":"requestFunctions.d.ts","sourceRoot":"","sources":["../../src/next/requestFunctions.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAiB5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAK7C"}
|
|
@@ -1,13 +1,4 @@
|
|
|
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -17,54 +8,50 @@ exports.getDomainNext = getDomainNext;
|
|
|
17
8
|
const I18NConfig_1 = __importDefault(require("../config/I18NConfig"));
|
|
18
9
|
const imports_1 = require("./imports/imports");
|
|
19
10
|
/**
|
|
20
|
-
*
|
|
11
|
+
* Retrieves the 'accept-language' header from the headers list.
|
|
21
12
|
* If the 'next/headers' module is not available, it attempts to load it. If the
|
|
22
13
|
* headers function is available, it returns the primary language from the 'accept-language'
|
|
23
14
|
* header. If the headers function or 'accept-language' header is not available, returns null.
|
|
24
15
|
*
|
|
25
|
-
* @returns {
|
|
16
|
+
* @returns {string | null} A promise that resolves to the primary language from the
|
|
26
17
|
* 'accept-language' header, or null if not available.
|
|
27
18
|
*/
|
|
28
19
|
function getUserLanguageNext() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return userLanguageCookie.value;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
console.warn(error);
|
|
20
|
+
var _a;
|
|
21
|
+
try {
|
|
22
|
+
const cookies = (0, imports_1.getNextCookies)();
|
|
23
|
+
if (cookies) {
|
|
24
|
+
const cookieStore = cookies();
|
|
25
|
+
const userLanguageCookie = cookieStore.get('generaltranslation-userlanguage');
|
|
26
|
+
if (userLanguageCookie === null || userLanguageCookie === void 0 ? void 0 : userLanguageCookie.value)
|
|
27
|
+
return userLanguageCookie.value;
|
|
42
28
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return
|
|
50
|
-
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.warn(error);
|
|
32
|
+
}
|
|
33
|
+
const headers = (0, imports_1.getNextHeaders)();
|
|
34
|
+
if (!headers)
|
|
35
|
+
return I18NConfig_1.default.getDefaultLanguage();
|
|
36
|
+
const headerList = headers();
|
|
37
|
+
const acceptedLanguages = (_a = headerList.get('accept-language')) === null || _a === void 0 ? void 0 : _a.split(',').map(item => { var _a; return (_a = item.split(';')) === null || _a === void 0 ? void 0 : _a[0].trim(); });
|
|
38
|
+
const userLanguage = I18NConfig_1.default.getUserLanguage(acceptedLanguages);
|
|
39
|
+
return userLanguage;
|
|
51
40
|
}
|
|
52
41
|
/**
|
|
53
|
-
*
|
|
42
|
+
* Retrieves the 'host' header from the headers list.
|
|
54
43
|
* If the 'next/headers' module is not available, it attempts to load it. If the
|
|
55
44
|
* headers function is available, it returns the value of the 'host' header.
|
|
56
45
|
* If the headers function or 'host' header is not available, returns null.
|
|
57
46
|
*
|
|
58
|
-
* @returns {
|
|
47
|
+
* @returns {string | null} A promise that resolves to the value of the 'host' header,
|
|
59
48
|
* or null if not available.
|
|
60
49
|
*/
|
|
61
50
|
function getDomainNext() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return headerList.get('host') || null;
|
|
68
|
-
});
|
|
51
|
+
const headers = (0, imports_1.getNextHeaders)();
|
|
52
|
+
if (!headers)
|
|
53
|
+
return null;
|
|
54
|
+
const headerList = headers();
|
|
55
|
+
return headerList.get('host') || null;
|
|
69
56
|
}
|
|
70
57
|
//# sourceMappingURL=requestFunctions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestFunctions.js","sourceRoot":"","sources":["../../src/next/requestFunctions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestFunctions.js","sourceRoot":"","sources":["../../src/next/requestFunctions.ts"],"names":[],"mappings":";;;;;AAYA,kDAiBC;AAWD,sCAKC;AA7CD,sEAA8C;AAC9C,+CAAmE;AAEnE;;;;;;;;GAQG;AACH,SAAgB,mBAAmB;;IAC/B,IAAI,CAAC;QACD,MAAM,OAAO,GAAG,IAAA,wBAAc,GAAE,CAAC;QACjC,IAAI,OAAO,EAAE,CAAC;YACV,MAAM,WAAW,GAAG,OAAO,EAAE,CAAC;YAC9B,MAAM,kBAAkB,GAAG,WAAW,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;YAC9E,IAAI,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,KAAK;gBAAE,OAAO,kBAAkB,CAAC,KAAK,CAAC;QACnE,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,wBAAc,GAAE,CAAC;IACjC,IAAI,CAAC,OAAO;QAAE,OAAO,oBAAU,CAAC,kBAAkB,EAAE,CAAC;IACrD,MAAM,UAAU,GAAG,OAAO,EAAE,CAAC;IAC7B,MAAM,iBAAiB,GAAG,MAAA,UAAU,CAAC,GAAG,CAAC,iBAAiB,CAAC,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,0CAAG,CAAC,EAAE,IAAI,EAAE,CAAA,EAAA,CAAC,CAAC;IACjH,MAAM,YAAY,GAAG,oBAAU,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;IACnE,OAAO,YAAY,CAAC;AACxB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,aAAa;IACzB,MAAM,OAAO,GAAG,IAAA,wBAAc,GAAE,CAAC;IACjC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,UAAU,GAAG,OAAO,EAAE,CAAC;IAC7B,OAAO,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;AAC1C,CAAC"}
|
package/dist/next/t.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"t.d.ts","sourceRoot":"","sources":["../../src/next/t.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMzC,wBAA8B,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,KAAK,EAAE,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAcrG"}
|
package/dist/next/t.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.default = t;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const NextI18N_1 = __importDefault(require("./NextI18N"));
|
|
29
|
+
const intl_1 = __importDefault(require("./intl"));
|
|
30
|
+
const I18NConfig_1 = __importDefault(require("../config/I18NConfig"));
|
|
31
|
+
const t_1 = require("../server/t");
|
|
32
|
+
function t(id, _a) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
var props = __rest(_a, []);
|
|
35
|
+
const dictionary = I18NConfig_1.default.getDictionary();
|
|
36
|
+
const entry = (0, t_1.getDictionaryEntry)(id, dictionary);
|
|
37
|
+
if (!entry)
|
|
38
|
+
return null;
|
|
39
|
+
if (typeof entry === 'string')
|
|
40
|
+
return yield (0, intl_1.default)(entry, Object.assign({ id: id }, props));
|
|
41
|
+
return (
|
|
42
|
+
/* @ts-expect-error Server Component */
|
|
43
|
+
(0, jsx_runtime_1.jsx)(NextI18N_1.default, Object.assign({ id: id }, props, { children: entry })));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=t.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"t.js","sourceRoot":"","sources":["../../src/next/t.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,oBAcC;;AAnBD,0DAAkC;AAClC,kDAA8B;AAC9B,sEAA8C;AAC9C,mCAAiD;AAEjD,SAA8B,CAAC,CAAC,EAAU,EAAE,EAAqC;;YAA/B,KAAK,cAAX,EAAa,CAAF;QAEnD,MAAM,UAAU,GAAG,oBAAU,CAAC,aAAa,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,IAAA,sBAAkB,EAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QAExB,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,MAAM,IAAA,cAAQ,EAAC,KAAK,kBAAI,EAAE,EAAE,EAAE,IAAK,KAAK,EAAG,CAAA;QAEjF,OAAO;QACH,uCAAuC;QACvC,uBAAC,kBAAQ,kBAAC,EAAE,EAAE,EAAE,IAAM,KAAK,cACtB,KAAK,IACC,CACd,CAAA;IACL,CAAC;CAAA"}
|
package/dist/next.d.ts
CHANGED
|
@@ -8,5 +8,6 @@ import Variable from "./primitives/variable/variable/Variable";
|
|
|
8
8
|
import CurrencyVariable from "./primitives/variable/currency/CurrencyVariable";
|
|
9
9
|
import DateVariable from "./primitives/variable/date/DateVariable";
|
|
10
10
|
import NumberVariable from "./primitives/variable/number/NumberVariable";
|
|
11
|
-
|
|
11
|
+
import nextDict from "./next/dict";
|
|
12
|
+
export { NextI18N as I18N, nextIntl as intl, nextDict as dict, NextGTProvider as GTProvider, Numeric, Value, Private, Variable, NumberVariable, DateVariable, CurrencyVariable, };
|
|
12
13
|
//# sourceMappingURL=next.d.ts.map
|
package/dist/next.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,KAAK,MAAM,0BAA0B,CAAC;AAC7C,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,QAAQ,MAAM,yCAAyC,CAAC;AAC/D,OAAO,gBAAgB,MAAM,iDAAiD,CAAC;AAC/E,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,cAAc,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,KAAK,MAAM,0BAA0B,CAAC;AAC7C,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,QAAQ,MAAM,yCAAyC,CAAC;AAC/D,OAAO,gBAAgB,MAAM,iDAAiD,CAAC;AAC/E,OAAO,YAAY,MAAM,yCAAyC,CAAC;AACnE,OAAO,cAAc,MAAM,6CAA6C,CAAC;AACzE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EACH,QAAQ,IAAI,IAAI,EAChB,QAAQ,IAAI,IAAI,EAAE,QAAQ,IAAI,IAAI,EAClC,cAAc,IAAI,UAAU,EAC5B,OAAO,EAAE,KAAK,EAAE,OAAO,EACvB,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,GAE3D,CAAC"}
|
package/dist/next.js
CHANGED
|
@@ -3,7 +3,7 @@ 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.CurrencyVariable = exports.DateVariable = exports.NumberVariable = exports.Variable = exports.Private = exports.Value = exports.Numeric = exports.GTProvider = exports.intl = exports.I18N = void 0;
|
|
6
|
+
exports.CurrencyVariable = exports.DateVariable = exports.NumberVariable = exports.Variable = exports.Private = exports.Value = exports.Numeric = exports.GTProvider = exports.dict = exports.intl = exports.I18N = void 0;
|
|
7
7
|
const NextI18N_1 = __importDefault(require("./next/NextI18N"));
|
|
8
8
|
exports.I18N = NextI18N_1.default;
|
|
9
9
|
const intl_1 = __importDefault(require("./next/intl"));
|
|
@@ -24,4 +24,6 @@ const DateVariable_1 = __importDefault(require("./primitives/variable/date/DateV
|
|
|
24
24
|
exports.DateVariable = DateVariable_1.default;
|
|
25
25
|
const NumberVariable_1 = __importDefault(require("./primitives/variable/number/NumberVariable"));
|
|
26
26
|
exports.NumberVariable = NumberVariable_1.default;
|
|
27
|
+
const dict_1 = __importDefault(require("./next/dict"));
|
|
28
|
+
exports.dict = dict_1.default;
|
|
27
29
|
//# sourceMappingURL=next.js.map
|
package/dist/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAuC;
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAuC;AAavB,eAbT,kBAAQ,CAaK;AAZpB,uDAAmC;AAanB,eAbT,cAAQ,CAaK;AAZpB,2EAAmD;AAa7B,qBAbf,wBAAc,CAaW;AAZhC,2EAAmD;AAa/C,kBAbG,iBAAO,CAaH;AAZX,qEAA6C;AAYhC,gBAZN,eAAK,CAYM;AAXlB,2EAAmD;AAW/B,kBAXb,iBAAO,CAWa;AAV3B,uFAA+D;AAW3D,mBAXG,kBAAQ,CAWH;AAVZ,uGAA+E;AAUnC,2BAVrC,0BAAgB,CAUqC;AAT5D,2FAAmE;AASrC,uBATvB,sBAAY,CASuB;AAR1C,iGAAyE;AAQ3D,yBARP,wBAAc,CAQO;AAP5B,uDAAmC;AAID,eAJ3B,cAAQ,CAIuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderClientVariable.d.ts","sourceRoot":"","sources":["../../../../src/primitives/value/client/RenderClientVariable.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"RenderClientVariable.d.ts","sourceRoot":"","sources":["../../../../src/primitives/value/client/RenderClientVariable.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAA;AAgD7D,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,GAAG,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,GAAG,SAAS,CAenI"}
|
|
@@ -30,6 +30,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
30
30
|
exports.default = RenderClientVariable;
|
|
31
31
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
32
32
|
const react_1 = __importStar(require("react"));
|
|
33
|
+
const ClientVariable_1 = __importDefault(require("../../variable/variable/ClientVariable"));
|
|
33
34
|
const ClientNumberVariable_1 = __importDefault(require("../../variable/number/ClientNumberVariable"));
|
|
34
35
|
const ClientDateVariable_1 = __importDefault(require("../../variable/date/ClientDateVariable"));
|
|
35
36
|
const ClientCurrencyVariable_1 = __importDefault(require("../../variable/currency/ClientCurrencyVariable"));
|
|
@@ -59,6 +60,7 @@ function SingleChild({ children, variables }) {
|
|
|
59
60
|
if (variableType === "currency") {
|
|
60
61
|
return (0, jsx_runtime_1.jsx)(ClientCurrencyVariable_1.default, { defaultValue: value, name: props['data-gt-variable-name'], currency: props['data-gt-variable-currency'] });
|
|
61
62
|
}
|
|
63
|
+
return (0, jsx_runtime_1.jsx)(ClientVariable_1.default, { defaultValue: value, name: props['data-gt-variable-name'] });
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
}
|
|
@@ -73,6 +75,8 @@ function SingleChild({ children, variables }) {
|
|
|
73
75
|
function RenderClientVariable({ children, variables }) {
|
|
74
76
|
const [renderedChildren, setRenderedChildren] = (0, react_1.useState)(children);
|
|
75
77
|
(0, react_1.useEffect)(() => {
|
|
78
|
+
console.log(children);
|
|
79
|
+
console.log(variables);
|
|
76
80
|
setRenderedChildren(react_1.default.Children.map(children, child => (0, jsx_runtime_1.jsx)(SingleChild, { variables: variables, children: child })));
|
|
77
81
|
}, [children, variables]);
|
|
78
82
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: renderedChildren }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderClientVariable.js","sourceRoot":"","sources":["../../../../src/primitives/value/client/RenderClientVariable.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RenderClientVariable.js","sourceRoot":"","sources":["../../../../src/primitives/value/client/RenderClientVariable.tsx"],"names":[],"mappings":";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