gt-react 2.0.195 → 2.0.197

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.
Files changed (99) hide show
  1. package/dist/client/GTProvider.js +1 -1
  2. package/dist/client/GTProvider.js.map +1 -1
  3. package/dist/client/useUserLanguage.d.ts +2 -0
  4. package/dist/client/useUserLanguage.d.ts.map +1 -0
  5. package/dist/client/{useCurrentLanguage.js → useUserLanguage.js} +3 -3
  6. package/dist/client/useUserLanguage.js.map +1 -0
  7. package/dist/client.d.ts +2 -2
  8. package/dist/client.d.ts.map +1 -1
  9. package/dist/client.js +3 -3
  10. package/dist/client.js.map +1 -1
  11. package/dist/config/I18NConfig.d.ts +6 -6
  12. package/dist/config/I18NConfig.d.ts.map +1 -1
  13. package/dist/config/I18NConfig.js +8 -8
  14. package/dist/config/I18NConfig.js.map +1 -1
  15. package/dist/index.d.ts +2 -2
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +3 -3
  18. package/dist/index.js.map +1 -1
  19. package/dist/intl/intl.d.ts +2 -2
  20. package/dist/intl/intl.d.ts.map +1 -1
  21. package/dist/intl/intl.js +9 -9
  22. package/dist/intl/intl.js.map +1 -1
  23. package/dist/middleware.d.ts +2 -2
  24. package/dist/middleware.d.ts.map +1 -1
  25. package/dist/middleware.js +4 -25
  26. package/dist/middleware.js.map +1 -1
  27. package/dist/next/NextGTProvider.js +2 -2
  28. package/dist/next/NextGTProvider.js.map +1 -1
  29. package/dist/next/NextI18N.js +2 -2
  30. package/dist/next/NextI18N.js.map +1 -1
  31. package/dist/next/getUserLanguage.d.ts +6 -0
  32. package/dist/next/getUserLanguage.d.ts.map +1 -0
  33. package/dist/next/getUserLanguage.js +18 -0
  34. package/dist/next/getUserLanguage.js.map +1 -0
  35. package/dist/next/nextDict.js +2 -2
  36. package/dist/next/nextDict.js.map +1 -1
  37. package/dist/next/{intl.d.ts → nextIntl.d.ts} +2 -2
  38. package/dist/next/nextIntl.d.ts.map +1 -0
  39. package/dist/next/{nextT.js → nextIntl.js} +7 -18
  40. package/dist/next/nextIntl.js.map +1 -0
  41. package/dist/next/requestFunctions.js +1 -1
  42. package/dist/next/requestFunctions.js.map +1 -1
  43. package/dist/next.d.ts +4 -3
  44. package/dist/next.d.ts.map +1 -1
  45. package/dist/next.js +7 -5
  46. package/dist/next.js.map +1 -1
  47. package/dist/primitives/numeric/Numeric.d.ts.map +1 -1
  48. package/dist/primitives/numeric/Numeric.js +2 -1
  49. package/dist/primitives/numeric/Numeric.js.map +1 -1
  50. package/dist/primitives/numeric/client/ClientNumeric.js +4 -4
  51. package/dist/primitives/numeric/client/ClientNumeric.js.map +1 -1
  52. package/dist/primitives/variable/currency/ClientCurrencyVariable.js +3 -3
  53. package/dist/primitives/variable/currency/ClientCurrencyVariable.js.map +1 -1
  54. package/dist/primitives/variable/currency/CurrencyVariable.js +2 -2
  55. package/dist/primitives/variable/currency/CurrencyVariable.js.map +1 -1
  56. package/dist/primitives/variable/date/ClientDateVariable.js +3 -3
  57. package/dist/primitives/variable/date/ClientDateVariable.js.map +1 -1
  58. package/dist/primitives/variable/date/DateVariable.js +3 -3
  59. package/dist/primitives/variable/date/DateVariable.js.map +1 -1
  60. package/dist/primitives/variable/number/ClientNumberVariable.js +4 -4
  61. package/dist/primitives/variable/number/ClientNumberVariable.js.map +1 -1
  62. package/dist/primitives/variable/number/NumberVariable.js +3 -3
  63. package/dist/primitives/variable/number/NumberVariable.js.map +1 -1
  64. package/dist/server/ServerI18N.js +1 -1
  65. package/dist/server/ServerI18N.js.map +1 -1
  66. package/dist/server/getDefaultLanguage.d.ts +5 -0
  67. package/dist/server/getDefaultLanguage.d.ts.map +1 -0
  68. package/dist/server/getDefaultLanguage.js +14 -0
  69. package/dist/server/getDefaultLanguage.js.map +1 -0
  70. package/package.json +1 -1
  71. package/dist/client/useCurrentLanguage.d.ts +0 -2
  72. package/dist/client/useCurrentLanguage.d.ts.map +0 -1
  73. package/dist/client/useCurrentLanguage.js.map +0 -1
  74. package/dist/config/local/getDictionaryEntry.d.ts +0 -2
  75. package/dist/config/local/getDictionaryEntry.d.ts.map +0 -1
  76. package/dist/config/local/getDictionaryEntry.js +0 -14
  77. package/dist/config/local/getDictionaryEntry.js.map +0 -1
  78. package/dist/next/dict.d.ts +0 -6
  79. package/dist/next/dict.d.ts.map +0 -1
  80. package/dist/next/dict.js +0 -41
  81. package/dist/next/dict.js.map +0 -1
  82. package/dist/next/intl.d.ts.map +0 -1
  83. package/dist/next/intl.js +0 -47
  84. package/dist/next/intl.js.map +0 -1
  85. package/dist/next/nextT.d.ts +0 -6
  86. package/dist/next/nextT.d.ts.map +0 -1
  87. package/dist/next/nextT.js.map +0 -1
  88. package/dist/next/t.d.ts +0 -5
  89. package/dist/next/t.d.ts.map +0 -1
  90. package/dist/next/t.js +0 -46
  91. package/dist/next/t.js.map +0 -1
  92. package/dist/server/t.d.ts +0 -7
  93. package/dist/server/t.d.ts.map +0 -1
  94. package/dist/server/t.js +0 -60
  95. package/dist/server/t.js.map +0 -1
  96. package/dist/t/t.d.ts +0 -6
  97. package/dist/t/t.d.ts.map +0 -1
  98. package/dist/t/t.js +0 -54
  99. package/dist/t/t.js.map +0 -1
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
1
- import { ReactNode } from "react";
2
- export declare function getDictionaryEntry(id: string, dictionary: Record<string, any>): any;
3
- export default function t(id: string, { ...props }: {
4
- userLanguage: string;
5
- [key: string]: any;
6
- }): Promise<ReactNode>;
7
- //# sourceMappingURL=t.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"t.d.ts","sourceRoot":"","sources":["../../src/server/t.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKzC,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,CAUnF;AAED,wBAA8B,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,KAAK,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAiB3H"}
package/dist/server/t.js DELETED
@@ -1,60 +0,0 @@
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.getDictionaryEntry = getDictionaryEntry;
27
- exports.default = t;
28
- const jsx_runtime_1 = require("react/jsx-runtime");
29
- const ServerI18N_1 = __importDefault(require("./ServerI18N"));
30
- const I18NConfig_1 = __importDefault(require("../config/I18NConfig"));
31
- const intl_1 = __importDefault(require("../intl/intl"));
32
- function getDictionaryEntry(id, dictionary) {
33
- let current = dictionary;
34
- const entryPath = id.split('.');
35
- for (const [index, item] of entryPath.entries()) {
36
- if (!current)
37
- return null;
38
- if (index === entryPath.length - 1) {
39
- return (current === null || current === void 0 ? void 0 : current[item]) || null;
40
- }
41
- current = current[item];
42
- }
43
- }
44
- function t(id, _a) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- var props = __rest(_a, []);
47
- const dictionary = I18NConfig_1.default.getDictionary();
48
- const entry = getDictionaryEntry(id, dictionary);
49
- if (!entry) {
50
- console.warn(`t() unable to locate dictionary entry with id: ${id}`);
51
- return null;
52
- }
53
- if (typeof entry === 'string')
54
- return yield (0, intl_1.default)(entry, props.userLanguage, Object.assign({ id: id }, props));
55
- return (
56
- /* @ts-expect-error Server Component */
57
- (0, jsx_runtime_1.jsx)(ServerI18N_1.default, Object.assign({ id: id }, props, { children: entry })));
58
- });
59
- }
60
- //# sourceMappingURL=t.js.map
@@ -1 +0,0 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BAAC,EAAE,EAAE,EAAE,IAAM,KAAK,cACxB,KAAK,IACG,CAChB,CAAA;IACL,CAAC;CAAA"}
package/dist/t/t.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { ReactNode } from "react";
2
- export default function t(id: string, { userLanguage, ...options }: {
3
- userLanguage: string;
4
- [key: string]: any;
5
- }): Promise<ReactNode>;
6
- //# sourceMappingURL=t.d.ts.map
package/dist/t/t.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"t.d.ts","sourceRoot":"","sources":["../../src/t/t.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAezC,wBAA8B,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAiB1I"}
package/dist/t/t.js DELETED
@@ -1,54 +0,0 @@
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 ServerI18N_1 = __importDefault(require("../server/ServerI18N"));
29
- const I18NConfig_1 = __importDefault(require("../config/I18NConfig"));
30
- const intl_1 = __importDefault(require("../intl/intl"));
31
- function getDictionaryEntry(id, dictionary) {
32
- let current = dictionary;
33
- const pathNames = id.split('-');
34
- for (const item of pathNames) {
35
- if (!current)
36
- return null;
37
- current = (current === null || current === void 0 ? void 0 : current[item]) || null;
38
- }
39
- return current;
40
- }
41
- function t(id, _a) {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- var { userLanguage } = _a, options = __rest(_a, ["userLanguage"]);
44
- const dictionary = I18NConfig_1.default.getDictionary();
45
- const entry = getDictionaryEntry(id, dictionary);
46
- if (typeof entry === 'string') {
47
- return yield (0, intl_1.default)(entry, userLanguage, Object.assign({ id }, options));
48
- }
49
- return (
50
- /* @ts-expect-error Server Component */
51
- (0, jsx_runtime_1.jsx)(ServerI18N_1.default, Object.assign({ id: id, userLanguage: userLanguage }, options, { children: entry })));
52
- });
53
- }
54
- //# sourceMappingURL=t.js.map
package/dist/t/t.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"t.js","sourceRoot":"","sources":["../../src/t/t.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAeA,oBAiBC;;AA/BD,sEAA8C;AAC9C,sEAA8C;AAC9C,wDAAgC;AAEhC,SAAS,kBAAkB,CAAC,EAAU,EAAE,UAA+B;IACnE,IAAI,OAAO,GAAG,UAAU,CAAC;IACzB,MAAM,SAAS,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,OAAO,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,IAAI,CAAC,KAAI,IAAI,CAAC;IACtC,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,SAA8B,CAAC,CAAC,EAAU,EAAE,EAA0E;;YAA1E,EAAE,YAAY,OAA4D,EAAvD,OAAO,cAA1B,gBAA4B,CAAF;QAElE,MAAM,UAAU,GAAG,oBAAU,CAAC,aAAa,EAAE,CAAC;QAE9C,MAAM,KAAK,GAAG,kBAAkB,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAEjD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,MAAM,IAAA,cAAI,EAAC,KAAK,EAAE,YAAY,kBAAI,EAAE,IAAK,OAAO,EAAG,CAAA;QAC9D,CAAC;QAED,OAAO;QACH,uCAAuC;QACvC,uBAAC,oBAAU,kBAAC,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,IAAM,OAAO,cACtD,KAAK,IACG,CAChB,CAAC;IAEN,CAAC;CAAA"}