gt-react 3.1.98 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/client/ClientProvider.d.ts.map +1 -1
  2. package/dist/client/ClientProvider.js +14 -18
  3. package/dist/client/ClientProvider.js.map +1 -1
  4. package/dist/client/client-only/GTClientProvider.d.ts +1 -2
  5. package/dist/client/client-only/GTClientProvider.d.ts.map +1 -1
  6. package/dist/client/client-only/GTClientProvider.js +16 -31
  7. package/dist/client/client-only/GTClientProvider.js.map +1 -1
  8. package/dist/client/errors/createComponentError.d.ts +2 -0
  9. package/dist/client/errors/createComponentError.d.ts.map +1 -0
  10. package/dist/client/errors/createComponentError.js +7 -0
  11. package/dist/client/errors/createComponentError.js.map +1 -0
  12. package/dist/client/helpers/renderClientChildren.d.ts.map +1 -1
  13. package/dist/client/helpers/renderClientChildren.js.map +1 -1
  14. package/dist/client/hooks/useGT.js +1 -1
  15. package/dist/client/hooks/useGT.js.map +1 -1
  16. package/dist/client/plural/ClientPlural.d.ts +1 -4
  17. package/dist/client/plural/ClientPlural.d.ts.map +1 -1
  18. package/dist/client/plural/ClientPlural.js +2 -3
  19. package/dist/client/plural/ClientPlural.js.map +1 -1
  20. package/dist/client/value/ClientValue.d.ts.map +1 -1
  21. package/dist/client/value/ClientValue.js +1 -2
  22. package/dist/client/value/ClientValue.js.map +1 -1
  23. package/dist/client-index.d.ts +11 -0
  24. package/dist/client-index.d.ts.map +1 -0
  25. package/dist/client-index.js +140 -0
  26. package/dist/client-index.js.map +1 -0
  27. package/dist/config/I18NConfiguration.d.ts.map +1 -1
  28. package/dist/config/I18NConfiguration.js +9 -0
  29. package/dist/config/I18NConfiguration.js.map +1 -1
  30. package/dist/config/RemoteDictionaryManager.js +1 -1
  31. package/dist/config/RemoteDictionaryManager.js.map +1 -1
  32. package/dist/dictionary/cloneDictionary.js +1 -1
  33. package/dist/dictionary/cloneDictionary.js.map +1 -1
  34. package/dist/dictionary/createTFunction.d.ts.map +1 -1
  35. package/dist/dictionary/createTFunction.js +10 -8
  36. package/dist/dictionary/createTFunction.js.map +1 -1
  37. package/dist/dictionary/getDictionaryReference.d.ts.map +1 -0
  38. package/dist/dictionary/getDictionaryReference.js.map +1 -0
  39. package/dist/dictionary/getEntryMetadata.d.ts.map +1 -0
  40. package/dist/dictionary/getEntryMetadata.js.map +1 -0
  41. package/dist/dictionary/getEntryTranslationType.d.ts.map +1 -0
  42. package/dist/dictionary/getEntryTranslationType.js.map +1 -0
  43. package/dist/internal/addGTIdentifier.d.ts.map +1 -0
  44. package/dist/{primitives/translation → internal}/addGTIdentifier.js +6 -12
  45. package/dist/internal/addGTIdentifier.js.map +1 -0
  46. package/dist/internal/calculateHash.d.ts.map +1 -0
  47. package/dist/internal/calculateHash.js.map +1 -0
  48. package/dist/internal/determineLocale.d.ts.map +1 -0
  49. package/dist/internal/determineLocale.js.map +1 -0
  50. package/dist/internal/flattenDictionary.d.ts.map +1 -0
  51. package/dist/internal/flattenDictionary.js.map +1 -0
  52. package/dist/internal/writeChildrenAsObjects.d.ts.map +1 -0
  53. package/dist/{primitives/translation → internal}/writeChildrenAsObjects.js +5 -21
  54. package/dist/internal/writeChildrenAsObjects.js.map +1 -0
  55. package/dist/internal.d.ts +7 -0
  56. package/dist/internal.d.ts.map +1 -0
  57. package/dist/{index.js → internal.js} +6 -6
  58. package/dist/internal.js.map +1 -0
  59. package/dist/next/requestFunctions.js +1 -1
  60. package/dist/next/requestFunctions.js.map +1 -1
  61. package/dist/{next.d.ts → next.server.d.ts} +4 -4
  62. package/dist/next.server.d.ts.map +1 -0
  63. package/dist/{next.js → next.server.js} +8 -8
  64. package/dist/next.server.js.map +1 -0
  65. package/dist/primitives/variables/getPluralBranch.d.ts +1 -6
  66. package/dist/primitives/variables/getPluralBranch.d.ts.map +1 -1
  67. package/dist/primitives/variables/getPluralBranch.js +1 -18
  68. package/dist/primitives/variables/getPluralBranch.js.map +1 -1
  69. package/dist/server/inline/T.d.ts.map +1 -1
  70. package/dist/server/inline/T.js +6 -22
  71. package/dist/server/inline/T.js.map +1 -1
  72. package/dist/server/inline/renderChildren.js +4 -4
  73. package/dist/server/inline/renderChildren.js.map +1 -1
  74. package/dist/server/plural/InnerPlural.d.ts +1 -3
  75. package/dist/server/plural/InnerPlural.d.ts.map +1 -1
  76. package/dist/server/plural/InnerPlural.js +2 -2
  77. package/dist/server/plural/InnerPlural.js.map +1 -1
  78. package/dist/server/plural/createPluralComponent.d.ts +1 -1
  79. package/dist/server/plural/createPluralComponent.d.ts.map +1 -1
  80. package/dist/server/plural/createPluralComponent.js +2 -2
  81. package/dist/server/plural/createPluralComponent.js.map +1 -1
  82. package/dist/server/provider/GTProvider.d.ts +0 -1
  83. package/dist/server/provider/GTProvider.d.ts.map +1 -1
  84. package/dist/server/provider/GTProvider.js +21 -17
  85. package/dist/server/provider/GTProvider.js.map +1 -1
  86. package/dist/server/translate/createTranslateFunction.d.ts +2 -2
  87. package/dist/server/translate/createTranslateFunction.d.ts.map +1 -1
  88. package/dist/server/translate/createTranslateFunction.js +17 -24
  89. package/dist/server/translate/createTranslateFunction.js.map +1 -1
  90. package/dist/server/value/InnerValue.d.ts.map +1 -1
  91. package/dist/server/value/InnerValue.js.map +1 -1
  92. package/dist/server/value/renderVariable.js +4 -4
  93. package/dist/server/value/renderVariable.js.map +1 -1
  94. package/dist/server/variables/Currency.d.ts.map +1 -0
  95. package/dist/server/variables/Currency.js.map +1 -0
  96. package/dist/server/variables/DateTime.d.ts.map +1 -0
  97. package/dist/server/variables/DateTime.js.map +1 -0
  98. package/dist/server/variables/Num.d.ts.map +1 -0
  99. package/dist/server/variables/Num.js.map +1 -0
  100. package/dist/server/variables/Var.d.ts.map +1 -0
  101. package/dist/server/variables/Var.js.map +1 -0
  102. package/dist/server-index.d.ts +11 -0
  103. package/dist/server-index.d.ts.map +1 -0
  104. package/dist/server-index.js +289 -0
  105. package/dist/server-index.js.map +1 -0
  106. package/dist/types/GeneralTranslationInterface.d.ts +46 -40
  107. package/dist/types/GeneralTranslationInterface.d.ts.map +1 -1
  108. package/dist/types/{CreateGTProps.d.ts → InitGTProps.d.ts} +3 -3
  109. package/dist/types/InitGTProps.d.ts.map +1 -0
  110. package/dist/types/{CreateGTProps.js → InitGTProps.js} +1 -1
  111. package/dist/types/InitGTProps.js.map +1 -0
  112. package/package.json +23 -20
  113. package/scratchpad.js +13 -0
  114. package/dist/index/determineLocale.d.ts.map +0 -1
  115. package/dist/index/determineLocale.js.map +0 -1
  116. package/dist/index.d.ts +0 -7
  117. package/dist/index.d.ts.map +0 -1
  118. package/dist/index.js.map +0 -1
  119. package/dist/next.d.ts.map +0 -1
  120. package/dist/next.js.map +0 -1
  121. package/dist/primitives/calculateHash.d.ts.map +0 -1
  122. package/dist/primitives/calculateHash.js.map +0 -1
  123. package/dist/primitives/dictionary/flattenDictionary.d.ts.map +0 -1
  124. package/dist/primitives/dictionary/flattenDictionary.js.map +0 -1
  125. package/dist/primitives/dictionary/getDictionaryReference.d.ts.map +0 -1
  126. package/dist/primitives/dictionary/getDictionaryReference.js.map +0 -1
  127. package/dist/primitives/rendering/getEntryMetadata.d.ts.map +0 -1
  128. package/dist/primitives/rendering/getEntryMetadata.js.map +0 -1
  129. package/dist/primitives/rendering/getEntryTranslationType.d.ts.map +0 -1
  130. package/dist/primitives/rendering/getEntryTranslationType.js.map +0 -1
  131. package/dist/primitives/translation/addGTIdentifier.d.ts.map +0 -1
  132. package/dist/primitives/translation/addGTIdentifier.js.map +0 -1
  133. package/dist/primitives/translation/writeChildrenAsObjects.d.ts.map +0 -1
  134. package/dist/primitives/translation/writeChildrenAsObjects.js.map +0 -1
  135. package/dist/server/variables/Currency/Currency.d.ts.map +0 -1
  136. package/dist/server/variables/Currency/Currency.js.map +0 -1
  137. package/dist/server/variables/Currency/createCurrencyComponent.d.ts +0 -8
  138. package/dist/server/variables/Currency/createCurrencyComponent.d.ts.map +0 -1
  139. package/dist/server/variables/Currency/createCurrencyComponent.js +0 -40
  140. package/dist/server/variables/Currency/createCurrencyComponent.js.map +0 -1
  141. package/dist/server/variables/DateTime/DateTime.d.ts.map +0 -1
  142. package/dist/server/variables/DateTime/DateTime.js.map +0 -1
  143. package/dist/server/variables/DateTime/createDateTimeComponent.d.ts +0 -8
  144. package/dist/server/variables/DateTime/createDateTimeComponent.d.ts.map +0 -1
  145. package/dist/server/variables/DateTime/createDateTimeComponent.js +0 -40
  146. package/dist/server/variables/DateTime/createDateTimeComponent.js.map +0 -1
  147. package/dist/server/variables/Num/Num.d.ts.map +0 -1
  148. package/dist/server/variables/Num/Num.js.map +0 -1
  149. package/dist/server/variables/Num/createNumComponent.d.ts +0 -8
  150. package/dist/server/variables/Num/createNumComponent.d.ts.map +0 -1
  151. package/dist/server/variables/Num/createNumComponent.js +0 -41
  152. package/dist/server/variables/Num/createNumComponent.js.map +0 -1
  153. package/dist/server/variables/Var/Var.d.ts.map +0 -1
  154. package/dist/server/variables/Var/Var.js.map +0 -1
  155. package/dist/server/variables/Var/createVarComponent.d.ts +0 -7
  156. package/dist/server/variables/Var/createVarComponent.d.ts.map +0 -1
  157. package/dist/server/variables/Var/createVarComponent.js +0 -40
  158. package/dist/server/variables/Var/createVarComponent.js.map +0 -1
  159. package/dist/server.d.ts +0 -45
  160. package/dist/server.d.ts.map +0 -1
  161. package/dist/server.js +0 -169
  162. package/dist/server.js.map +0 -1
  163. package/dist/types/CreateGTProps.d.ts.map +0 -1
  164. package/dist/types/CreateGTProps.js.map +0 -1
  165. /package/dist/{primitives/dictionary → dictionary}/getDictionaryReference.d.ts +0 -0
  166. /package/dist/{primitives/dictionary → dictionary}/getDictionaryReference.js +0 -0
  167. /package/dist/{primitives/rendering → dictionary}/getEntryMetadata.d.ts +0 -0
  168. /package/dist/{primitives/rendering → dictionary}/getEntryMetadata.js +0 -0
  169. /package/dist/{primitives/rendering → dictionary}/getEntryTranslationType.d.ts +0 -0
  170. /package/dist/{primitives/rendering → dictionary}/getEntryTranslationType.js +0 -0
  171. /package/dist/{primitives/translation → internal}/addGTIdentifier.d.ts +0 -0
  172. /package/dist/{primitives → internal}/calculateHash.d.ts +0 -0
  173. /package/dist/{primitives → internal}/calculateHash.js +0 -0
  174. /package/dist/{index → internal}/determineLocale.d.ts +0 -0
  175. /package/dist/{index → internal}/determineLocale.js +0 -0
  176. /package/dist/{primitives/dictionary → internal}/flattenDictionary.d.ts +0 -0
  177. /package/dist/{primitives/dictionary → internal}/flattenDictionary.js +0 -0
  178. /package/dist/{primitives/translation → internal}/writeChildrenAsObjects.d.ts +0 -0
  179. /package/dist/server/variables/{Currency/Currency.d.ts → Currency.d.ts} +0 -0
  180. /package/dist/server/variables/{Currency/Currency.js → Currency.js} +0 -0
  181. /package/dist/server/variables/{DateTime/DateTime.d.ts → DateTime.d.ts} +0 -0
  182. /package/dist/server/variables/{DateTime/DateTime.js → DateTime.js} +0 -0
  183. /package/dist/server/variables/{Num/Num.d.ts → Num.d.ts} +0 -0
  184. /package/dist/server/variables/{Num/Num.js → Num.js} +0 -0
  185. /package/dist/server/variables/{Var/Var.d.ts → Var.d.ts} +0 -0
  186. /package/dist/server/variables/{Var/Var.js → Var.js} +0 -0
@@ -0,0 +1,289 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.initGT = initGT;
29
+ exports.initVariables = initVariables;
30
+ var jsx_runtime_1 = require("react/jsx-runtime");
31
+ var client_1 = require("./client");
32
+ var createComponentError_1 = __importDefault(require("./client/errors/createComponentError"));
33
+ var ClientCurrency_1 = __importDefault(require("./client/variables/ClientCurrency"));
34
+ var ClientDateTime_1 = __importDefault(require("./client/variables/ClientDateTime"));
35
+ var ClientNum_1 = __importDefault(require("./client/variables/ClientNum"));
36
+ var ClientVar_1 = __importDefault(require("./client/variables/ClientVar"));
37
+ var getDefaultFromEnv_1 = __importDefault(require("./config/local/getDefaultFromEnv"));
38
+ var defaultGTProps_1 = __importDefault(require("./types/defaultGTProps"));
39
+ // ----- SINGLETONS ----- //
40
+ var I18NConfig = null;
41
+ var createTComponent = null;
42
+ var createTranslationFunction = null;
43
+ var createValueComponent = null;
44
+ var createPluralComponent = null;
45
+ var createTFunction = null;
46
+ var createGTProviderComponent = null;
47
+ var VarComponent = null;
48
+ var NumComponent = null;
49
+ var CurrencyComponent = null;
50
+ var DateTimeComponent = null;
51
+ // ----- HELPER FUNCTIONS ----- //
52
+ var isClient = function () { return typeof window !== 'undefined'; };
53
+ // ----- MAIN FUNCTIONS ----- //
54
+ function initGT(_a) {
55
+ if (_a === void 0) { _a = {
56
+ apiKey: defaultGTProps_1.default.apiKey,
57
+ projectID: defaultGTProps_1.default.projectID,
58
+ cacheURL: defaultGTProps_1.default.cacheURL,
59
+ baseURL: defaultGTProps_1.default.baseURL,
60
+ remoteSource: defaultGTProps_1.default.remoteSource,
61
+ automaticTranslation: defaultGTProps_1.default.automaticTranslation,
62
+ defaultLocale: defaultGTProps_1.default.defaultLocale,
63
+ getLocale: defaultGTProps_1.default.getLocale,
64
+ renderPrevious: defaultGTProps_1.default.renderPrevious,
65
+ renderMethod: defaultGTProps_1.default.renderMethod,
66
+ renderTimeout: defaultGTProps_1.default.renderTimeout,
67
+ dictionaryName: defaultGTProps_1.default.dictionaryName,
68
+ dictionary: defaultGTProps_1.default.dictionary,
69
+ maxConcurrentRequests: defaultGTProps_1.default.maxConcurrentRequests,
70
+ batchInterval: defaultGTProps_1.default.batchInterval,
71
+ getMetadata: defaultGTProps_1.default.getMetadata
72
+ }; }
73
+ var
74
+ // Cloud integration
75
+ _b = _a.apiKey,
76
+ // Cloud integration
77
+ apiKey = _b === void 0 ? defaultGTProps_1.default.apiKey : _b, _c = _a.projectID, projectID = _c === void 0 ? defaultGTProps_1.default.projectID : _c, _d = _a.cacheURL, cacheURL = _d === void 0 ? defaultGTProps_1.default.cacheURL : _d, _e = _a.baseURL, baseURL = _e === void 0 ? defaultGTProps_1.default.baseURL : _e, _f = _a.remoteSource, remoteSource = _f === void 0 ? defaultGTProps_1.default.remoteSource : _f, _g = _a.automaticTranslation, automaticTranslation = _g === void 0 ? defaultGTProps_1.default.automaticTranslation : _g,
78
+ // Locale info
79
+ approvedLocales = _a.approvedLocales, _h = _a.defaultLocale, defaultLocale = _h === void 0 ? (approvedLocales === null || approvedLocales === void 0 ? void 0 : approvedLocales[0]) || defaultGTProps_1.default.defaultLocale : _h, _j = _a.getLocale, getLocale = _j === void 0 ? function () { return 'en-US'; } : _j,
80
+ // Rendering
81
+ _k = _a.renderPrevious,
82
+ // Rendering
83
+ renderPrevious = _k === void 0 ? defaultGTProps_1.default.renderPrevious : _k, _l = _a.renderMethod, renderMethod = _l === void 0 ? defaultGTProps_1.default.renderMethod : _l, // "replace", "hang", "subtle"
84
+ _m = _a.renderTimeout, // "replace", "hang", "subtle"
85
+ renderTimeout = _m === void 0 ? defaultGTProps_1.default.renderTimeout : _m,
86
+ // Dictionaries
87
+ _o = _a.dictionaryName,
88
+ // Dictionaries
89
+ dictionaryName = _o === void 0 ? defaultGTProps_1.default.dictionaryName : _o, _p = _a.dictionary, dictionary = _p === void 0 ? defaultGTProps_1.default.dictionary : _p, translations = _a.translations,
90
+ // Batching config
91
+ _q = _a.maxConcurrentRequests,
92
+ // Batching config
93
+ maxConcurrentRequests = _q === void 0 ? defaultGTProps_1.default.maxConcurrentRequests : _q, _r = _a.batchInterval, batchInterval = _r === void 0 ? defaultGTProps_1.default.batchInterval : _r,
94
+ // Other metadata
95
+ _s = _a.getMetadata,
96
+ // Other metadata
97
+ getMetadata = _s === void 0 ? defaultGTProps_1.default.getMetadata : _s, metadata = __rest(_a, ["apiKey", "projectID", "cacheURL", "baseURL", "remoteSource", "automaticTranslation", "approvedLocales", "defaultLocale", "getLocale", "renderPrevious", "renderMethod", "renderTimeout", "dictionaryName", "dictionary", "translations", "maxConcurrentRequests", "batchInterval", "getMetadata"]);
98
+ var initI18NConfig = function () {
99
+ if (I18NConfig)
100
+ return I18NConfig;
101
+ I18NConfig = new (require('./config/I18NConfiguration').default)(__assign({ apiKey: apiKey, projectID: projectID, cacheURL: cacheURL, baseURL: baseURL, remoteSource: remoteSource, automaticTranslation: automaticTranslation, getLocale: getLocale, defaultLocale: defaultLocale, approvedLocales: approvedLocales, renderPrevious: renderPrevious, renderMethod: renderMethod, renderTimeout: renderTimeout, dictionary: dictionary, dictionaryName: (0, getDefaultFromEnv_1.default)('GT_DICTIONARY_NAME') || dictionaryName, // override from .env
102
+ translations: translations, maxConcurrentRequests: maxConcurrentRequests, batchInterval: batchInterval, getMetadata: getMetadata }, metadata));
103
+ };
104
+ var T = function (params) {
105
+ if (isClient()) {
106
+ return (0, createComponentError_1.default)('T')(params);
107
+ }
108
+ else {
109
+ initI18NConfig();
110
+ return (createTComponent || (createTComponent = require('./server/inline/createTComponent').default))(I18NConfig)(params);
111
+ }
112
+ };
113
+ var translate = function () {
114
+ var params = [];
115
+ for (var _i = 0; _i < arguments.length; _i++) {
116
+ params[_i] = arguments[_i];
117
+ }
118
+ if (isClient()) {
119
+ throw new Error("translate(".concat(JSON.stringify(params === null || params === void 0 ? void 0 : params[0]), ") on the client-side can't access your API keys."));
120
+ }
121
+ else {
122
+ initI18NConfig();
123
+ return (createTranslationFunction || (createTranslationFunction = require('./server/translate/createTranslateFunction').default))(I18NConfig).apply(void 0, params);
124
+ }
125
+ };
126
+ var Value = function (params) {
127
+ if (isClient()) {
128
+ return (0, createComponentError_1.default)('Value')(params);
129
+ }
130
+ else {
131
+ initI18NConfig();
132
+ return (createValueComponent || (createValueComponent = require('./server/value/createValueComponent').default))(T, I18NConfig.getLocale(), I18NConfig.getDefaultLocale())(params);
133
+ }
134
+ };
135
+ var Plural = function (params) {
136
+ if (isClient()) {
137
+ return (0, createComponentError_1.default)('Plural')(params);
138
+ }
139
+ else {
140
+ initI18NConfig();
141
+ return (createPluralComponent || (createPluralComponent = require('./server/plural/createPluralComponent').default))(T, I18NConfig.getLocale(), I18NConfig.getDefaultLocale())(params);
142
+ }
143
+ };
144
+ var t = function () {
145
+ var params = [];
146
+ for (var _i = 0; _i < arguments.length; _i++) {
147
+ params[_i] = arguments[_i];
148
+ }
149
+ if (isClient()) {
150
+ throw new Error("t(\"".concat(params === null || params === void 0 ? void 0 : params[0], "\") on the client-side, which won't work because of how React handles hooks. Try t = getGT() or useGT() to get the t() function instead."));
151
+ }
152
+ else {
153
+ initI18NConfig();
154
+ return (createTFunction || (createTFunction = require('./dictionary/createTFunction').default))(I18NConfig, T, translate).apply(void 0, params);
155
+ }
156
+ };
157
+ var getGT = function () {
158
+ var params = [];
159
+ for (var _i = 0; _i < arguments.length; _i++) {
160
+ params[_i] = arguments[_i];
161
+ }
162
+ if (isClient()) {
163
+ return client_1.useGT;
164
+ }
165
+ else {
166
+ initI18NConfig();
167
+ return (params[0] ? (createTFunction || (createTFunction = require('./dictionary/createTFunction').default))(I18NConfig, T, translate, I18NConfig.getDictionaryEntry(params[0])) : t);
168
+ }
169
+ };
170
+ var GTProvider = function (params) {
171
+ if (isClient()) {
172
+ var children = params.children, props = __rest(params, ["children"]);
173
+ return ((0, jsx_runtime_1.jsx)(client_1.GTClientProvider, __assign({ projectID: projectID, dictionary: dictionary, dictionaryName: dictionaryName, approvedLocales: approvedLocales, defaultLocale: defaultLocale, remoteSource: remoteSource, cacheURL: cacheURL, translations: translations }, props, { children: children })));
174
+ }
175
+ else {
176
+ initI18NConfig();
177
+ return (createGTProviderComponent || (createGTProviderComponent = require('./server/provider/createGTProviderComponent').default))(I18NConfig)(params);
178
+ }
179
+ };
180
+ var getDefaultLocale = function () {
181
+ if (isClient()) {
182
+ return (0, client_1.useDefaultLocale)();
183
+ }
184
+ else {
185
+ initI18NConfig();
186
+ return I18NConfig.getDefaultLocale();
187
+ }
188
+ };
189
+ return {
190
+ T: T,
191
+ translate: translate,
192
+ Value: Value,
193
+ Plural: Plural,
194
+ t: t,
195
+ getGT: getGT,
196
+ GTProvider: GTProvider,
197
+ getLocale: function () {
198
+ if (isClient()) {
199
+ return (0, client_1.useLocale)();
200
+ }
201
+ else {
202
+ initI18NConfig();
203
+ return I18NConfig.getLocale();
204
+ }
205
+ },
206
+ getDefaultLocale: getDefaultLocale
207
+ };
208
+ }
209
+ function initVariables(_a) {
210
+ var _b = _a === void 0 ? {
211
+ defaultLocale: defaultGTProps_1.default.defaultLocale,
212
+ getLocale: defaultGTProps_1.default.getLocale
213
+ } : _a, approvedLocales = _b.approvedLocales, _c = _b.defaultLocale, defaultLocale = _c === void 0 ? (approvedLocales === null || approvedLocales === void 0 ? void 0 : approvedLocales[0]) || defaultGTProps_1.default.defaultLocale : _c, _d = _b.getLocale, getLocale = _d === void 0 ? function () { return defaultLocale; } : _d;
214
+ var Var = function (params) {
215
+ if (params === void 0) { params = {}; }
216
+ var children = params.children, props = __rest(params, ["children"]);
217
+ if (isClient()) {
218
+ return ((0, jsx_runtime_1.jsx)(ClientVar_1.default, __assign({}, props, { children: children })));
219
+ }
220
+ else {
221
+ var Var_1 = (VarComponent || (VarComponent = require('./server/variables/Var').default));
222
+ return ((0, jsx_runtime_1.jsx)(Var_1, __assign({}, props, { children: children })));
223
+ }
224
+ };
225
+ Var.gtTransformation = "variable-variable";
226
+ var Num = function (params) {
227
+ if (params === void 0) { params = {}; }
228
+ var children = params.children, props = __rest(params, ["children"]);
229
+ if (isClient()) {
230
+ return ((0, jsx_runtime_1.jsx)(ClientNum_1.default, __assign({}, props, { children: children })));
231
+ }
232
+ else {
233
+ var locales = [getLocale(), defaultLocale];
234
+ var Num_1 = (NumComponent || (NumComponent = require('./server/variables/Num').default));
235
+ return ((0, jsx_runtime_1.jsx)(Num_1, __assign({ locales: locales }, props, { children: children })));
236
+ }
237
+ };
238
+ Num.gtTransformation = "variable-number";
239
+ var DateTime = function (params) {
240
+ if (params === void 0) { params = {}; }
241
+ var children = params.children, props = __rest(params, ["children"]);
242
+ if (isClient()) {
243
+ return ((0, jsx_runtime_1.jsx)(ClientDateTime_1.default, __assign({}, props, { children: children })));
244
+ }
245
+ else {
246
+ var locales = [getLocale(), defaultLocale];
247
+ var DateTime_1 = (DateTimeComponent || (DateTimeComponent = require('./server/variables/DateTime').default));
248
+ return ((0, jsx_runtime_1.jsx)(DateTime_1, __assign({ locales: locales }, props, { children: children })));
249
+ }
250
+ };
251
+ DateTime.gtTransformation = "variable-datetime";
252
+ var Currency = function (params) {
253
+ if (params === void 0) { params = {}; }
254
+ var children = params.children, props = __rest(params, ["children"]);
255
+ if (isClient()) {
256
+ return ((0, jsx_runtime_1.jsx)(ClientCurrency_1.default, __assign({}, props, { children: children })));
257
+ }
258
+ else {
259
+ var locales = [getLocale(), defaultLocale];
260
+ var Currency_1 = (CurrencyComponent || (CurrencyComponent = require('./server/variables/Currency').default));
261
+ return ((0, jsx_runtime_1.jsx)(Currency_1, __assign({ locales: locales }, props, { children: children })));
262
+ }
263
+ };
264
+ Currency.gtTransformation = "variable-currency";
265
+ var getDefaultLocale = function () {
266
+ if (isClient()) {
267
+ return (0, client_1.useDefaultLocale)();
268
+ }
269
+ else {
270
+ return defaultLocale;
271
+ }
272
+ };
273
+ return {
274
+ Var: Var,
275
+ Num: Num,
276
+ Currency: Currency,
277
+ DateTime: DateTime,
278
+ getLocale: function () {
279
+ if (isClient()) {
280
+ return (0, client_1.useLocale)();
281
+ }
282
+ else {
283
+ return getLocale();
284
+ }
285
+ },
286
+ getDefaultLocale: getDefaultLocale
287
+ };
288
+ }
289
+ //# sourceMappingURL=server-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-index.js","sourceRoot":"","sources":["../src/server-index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,wBAkLC;AAED,sCAgHC;;AA9UD,mCAAgF;AAChF,8FAAwE;AACxE,qFAA+D;AAC/D,qFAA+D;AAC/D,2EAAqD;AACrD,2EAAqD;AACrD,uFAAiE;AACjE,0EAAoD;AAKpD,4BAA4B;AAE5B,IAAI,UAAU,GAAQ,IAAI,CAAC;AAE3B,IAAI,gBAAgB,GAAQ,IAAI,CAAC;AAEjC,IAAI,yBAAyB,GAAQ,IAAI,CAAC;AAE1C,IAAI,oBAAoB,GAAQ,IAAI,CAAC;AAErC,IAAI,qBAAqB,GAAQ,IAAI,CAAC;AAEtC,IAAI,eAAe,GAAQ,IAAI,CAAC;AAEhC,IAAI,yBAAyB,GAAQ,IAAI,CAAC;AAE1C,IAAI,YAAY,GAAQ,IAAI,CAAC;AAE7B,IAAI,YAAY,GAAQ,IAAI,CAAC;AAE7B,IAAI,iBAAiB,GAAQ,IAAI,CAAC;AAElC,IAAI,iBAAiB,GAAQ,IAAI,CAAC;AAElC,kCAAkC;AAElC,IAAM,QAAQ,GAAG,cAAe,OAAA,OAAO,MAAM,KAAK,WAAW,EAA7B,CAA6B,CAAC;AAE9D,gCAAgC;AAEhC,SAAgB,MAAM,CAAC,EA2CtB;IA3CsB,mBAAA,EAAA;QA2BnB,MAAM,EAAE,wBAAc,CAAC,MAAM;QAC7B,SAAS,EAAE,wBAAc,CAAC,SAAS;QACnC,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;YACb,OAAO,CACH,uBAAC,wBAAc,eAAK,KAAK,cACpB,QAAQ,IACI,CACpB,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,IAAM,OAAO,GAAG,CAAC,SAAS,EAAE,EAAE,aAAa,CAAC,CAAC;YAC7C,IAAM,UAAQ,GAAG,CAAC,iBAAiB,KAAjB,iBAAiB,GAAM,OAAO,CAAC,6BAA6B,CAAC,CAAC,OAAO,EAAE,CAAA;YACzF,OAAO,CACH,uBAAC,UAAQ,aAAC,OAAO,EAAE,OAAO,IAAM,KAAK,cAChC,QAAQ,IACF,CACd,CAAA;QACL,CAAC;IACL,CAAC,CAAA;IACD,QAAQ,CAAC,gBAAgB,GAAG,mBAAmB,CAAC;IAEhD,IAAM,gBAAgB,GAAG;QACrB,IAAI,QAAQ,EAAE,EAAE,CAAC;YACb,OAAO,IAAA,yBAAgB,GAAE,CAAC;QAC9B,CAAC;aAAM,CAAC;YACJ,OAAO,aAAa,CAAC;QACzB,CAAC;IACL,CAAC,CAAA;IAED,OAAO;QACH,GAAG,KAAA;QAAE,GAAG,KAAA;QAAE,QAAQ,UAAA;QAAE,QAAQ,UAAA;QAC5B,SAAS,EAAE;YACP,IAAI,QAAQ,EAAE,EAAE,CAAC;gBACb,OAAO,IAAA,kBAAS,GAAE,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACJ,OAAO,SAAS,EAAE,CAAC;YACvB,CAAC;QACL,CAAC;QAAE,gBAAgB,kBAAA;KACtB,CAAA;AAEL,CAAC"}
@@ -1,35 +1,27 @@
1
1
  import { ComponentType, ReactNode } from 'react';
2
2
  type GeneralTranslation = {
3
3
  /**
4
- * The `<T>` component. Translates its ReactNode children into the user's locale.
5
- *
6
- * `children?` - (any) - Children to translate.
4
+ * Server-side function which gets an entry from the default dictionary and wraps it in the `<T>` component.
7
5
  *
8
- * `id?` - (string) - Specifies an ID in the target dictionary for the created translation. Used to prevent storing unnecessary translations by overwriting previous translations with the same ID. Defaults to a hash of the component's children.
6
+ * `id` - (string) - ID of the item in the dictionary.
9
7
  *
10
- * `...props` - ([key: string]: any) - Optional metadata which will override the global `gt-react` configuration. See https://docs.generaltranslation.com for a full list of possible props.
8
+ * `options?` - ({ [key: string]: any }) - Variable values. See https://docs.generaltranslation.com for a full list.
11
9
  */
12
- T: ComponentType<{
13
- children?: any;
14
- id?: string;
10
+ t: (id: string, options?: {
11
+ n?: number;
15
12
  [key: string]: any;
16
- }>;
13
+ }) => any;
17
14
  /**
18
- * Translates a string asynchronously, storing the result in the translation dictionary.
19
- *
20
- * `content` - (string) - Text content to translate into the user's language.
21
- *
22
- * `options?` - ({ [key: string]: any }) - Other parameters. See https://docs.generaltranslation.com for a full list.
15
+ * Server-side function which prepares a `t()` function by prepending an ID. Useful with large nested dictionaries. You can also import `t()` directly.
16
+ * Equivalent to `useGT()` on the client-side.
23
17
  *
24
- * `options.targetLanguage?` - (string) - A BCP 47 language tag which represents the language to translate into. Defaults to the user's locale.
18
+ * `id` - (string) - ID to be prepended.
25
19
  *
26
- * `options.id?` - (string) - Specifies an ID in the target dictionary for the created translation. Used to prevent storing unnecessary translations by overwriting previous translations with the same ID. Defaults to `content`. (string)
27
20
  */
28
- translate: (content: string, options?: {
29
- targetLanguage?: string;
30
- id?: string;
21
+ getGT: (id?: string) => (id: string, options?: {
22
+ n?: number;
31
23
  [key: string]: any;
32
- }) => Promise<string>;
24
+ }) => any;
33
25
  /**
34
26
  * The `<GTProvider>` component. Used on the server, but all children must be client components (or able to run on the client). Provides translations and locale data to its children using React's context API. Children are able to use the `useGT`, `useLocale`, and `useDefaultLocale` hooks.
35
27
  *
@@ -51,27 +43,35 @@ type GeneralTranslation = {
51
43
  [key: string]: any;
52
44
  }>;
53
45
  /**
54
- * Server-side function which gets an entry from the default dictionary and wraps it in the `<T>` component.
46
+ * The `<T>` component. Translates its ReactNode children into the user's locale.
55
47
  *
56
- * `id` - (string) - ID of the item in the dictionary.
48
+ * `children?` - (any) - Children to translate.
57
49
  *
58
- * `options?` - ({ [key: string]: any }) - Variable values. See https://docs.generaltranslation.com for a full list.
50
+ * `id?` - (string) - Specifies an ID in the target dictionary for the created translation. Used to prevent storing unnecessary translations by overwriting previous translations with the same ID. Defaults to a hash of the component's children.
51
+ *
52
+ * `...props` - ([key: string]: any) - Optional metadata which will override the global `gt-react` configuration. See https://docs.generaltranslation.com for a full list of possible props.
59
53
  */
60
- t: (id: string, options?: {
61
- n?: number;
54
+ T: ComponentType<{
55
+ children?: any;
56
+ id?: string;
62
57
  [key: string]: any;
63
- }) => any;
58
+ }>;
64
59
  /**
65
- * Server-side function which prepares a `t()` function by prepending an ID. Useful with large nested dictionaries. You can also import `t()` directly.
66
- * Equivalent to `useGT()` on the client-side.
60
+ * Translates a string asynchronously, storing the result in the translation dictionary.
67
61
  *
68
- * `id` - (string) - ID to be prepended.
62
+ * `content` - (string) - Text content to translate into the user's language.
63
+ *
64
+ * `options?` - ({ [key: string]: any }) - Other parameters. See https://docs.generaltranslation.com for a full list.
69
65
  *
66
+ * `options.targetLanguage?` - (string) - A BCP 47 language tag which represents the language to translate into. Defaults to the user's locale.
67
+ *
68
+ * `options.id?` - (string) - Specifies an ID in the target dictionary for the created translation. Used to prevent storing unnecessary translations by overwriting previous translations with the same ID. Defaults to `content`. (string)
70
69
  */
71
- getGT: (id?: string) => (id: string, options?: {
72
- n?: number;
70
+ translate: (content: string, options?: {
71
+ targetLanguage?: string;
72
+ id?: string;
73
73
  [key: string]: any;
74
- }) => any;
74
+ }) => Promise<string>;
75
75
  /**
76
76
  * Type of <T> translation component which renders content around variables.
77
77
  *
@@ -88,10 +88,21 @@ type GeneralTranslation = {
88
88
  *
89
89
  * `children?` - (any) - The default content to render if no plural conditions are met.
90
90
  *
91
- * `n` - (number) - The number to evaluate against defined ranges or conditions.
91
+ * `n` - (number) - The number to evaluate against defined branches or conditions.
92
92
  *
93
- * `ranges?` - ({ min: number, max: number, children: any }[]) - An array of range objects for determining which branch to render based on the number `n`.
94
- **/
93
+ * `zero?` - (ReactNode) - Content to render when the number is zero.
94
+ *
95
+ * `one?` - (ReactNode) - Content to render when the number is one.
96
+ *
97
+ * `two?` - (ReactNode) - Content to render when the number is two.
98
+ *
99
+ * `few?` - (ReactNode) - Content to render when the number is considered "few".
100
+ *
101
+ * `many?` - (ReactNode) - Content to render when the number is considered "many".
102
+ *
103
+ * `other?` - (ReactNode) - Content to render when the number does not match any other conditions.
104
+ *
105
+ **/
95
106
  Plural: ComponentType<{
96
107
  children?: any;
97
108
  n: number;
@@ -101,11 +112,6 @@ type GeneralTranslation = {
101
112
  few?: ReactNode;
102
113
  many?: ReactNode;
103
114
  other?: ReactNode;
104
- ranges?: {
105
- min: number;
106
- max: number;
107
- children: any;
108
- }[];
109
115
  }>;
110
116
  /**
111
117
  * Server-side function which gets the user's current locale.
@@ -1 +1 @@
1
- {"version":3,"file":"GeneralTranslationInterface.d.ts","sourceRoot":"","sources":["../../src/types/GeneralTranslationInterface.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxD,KAAK,kBAAkB,GAAG;IAEtB;;;;;;;;MAQE;IACF,CAAC,EAAE,aAAa,CAAC;QACb,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC,CAAC;IAEH;;;;;;;;;;MAUE;IACF,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QACnC,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KACrB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtB;;;;;;;;;;;;;;MAcE;IACF,UAAU,EAAE,aAAa,CAAC;QACtB,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,EAAE,CAAC,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G,CAAA;KACrB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtB;;;;;;OAMG;IACH,KAAK,EAAE,aAAa,CAAC;QACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC/B,CAAC,CAAC;IAEH;;;;;;;;;;;;;;;;;;;QAmBI;IACJ,MAAM,EAAE,aAAa,CAAC;QAClB,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,CAAC,EAAE,MAAM,CAAC;QACV,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,GAAG,CAAC,EAAE,SAAS,CAAC;QAChB,GAAG,CAAC,EAAE,SAAS,CAAC;QAChB,GAAG,CAAC,EAAE,SAAS,CAAC;QAChB,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,KAAK,CAAC,EAAE,SAAS,CAAC;KACrB,CAAC,CAAC;IAEH;;;OAGG;IACH,SAAS,EAAE,MAAM,MAAM,CAAC;IAExB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,MAAM,CAAC;CAElC,CAAA;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,4 +1,4 @@
1
- type CreateGTProps = {
1
+ type InitGTProps = {
2
2
  apiKey?: string;
3
3
  projectID?: string;
4
4
  baseURL?: string;
@@ -19,5 +19,5 @@ type CreateGTProps = {
19
19
  getMetadata?: () => Record<string, any>;
20
20
  [key: string]: any;
21
21
  };
22
- export default CreateGTProps;
23
- //# sourceMappingURL=CreateGTProps.d.ts.map
22
+ export default InitGTProps;
23
+ //# sourceMappingURL=InitGTProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitGTProps.d.ts","sourceRoot":"","sources":["../../src/types/InitGTProps.ts"],"names":[],"mappings":"AAAA,KAAK,WAAW,GAAG;IAEf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC;IAEzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAElE,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB,CAAA;AAED,eAAe,WAAW,CAAC"}
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=CreateGTProps.js.map
3
+ //# sourceMappingURL=InitGTProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InitGTProps.js","sourceRoot":"","sources":["../../src/types/InitGTProps.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt-react",
3
- "version": "3.1.98",
3
+ "version": "3.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,36 +32,40 @@
32
32
  },
33
33
  "exports": {
34
34
  ".": {
35
- "import": "./dist/index.js",
36
- "require": "./dist/index.js"
35
+ "node": "./dist/server-index.js",
36
+ "browser": "./dist/client-index.js",
37
+ "types": "./dist/server-index.d.ts",
38
+ "default": "./dist/server-index.js"
39
+ },
40
+ "./internal": {
41
+ "types": "./dist/internal.d.ts",
42
+ "default": "./dist/internal.js"
37
43
  },
38
- "./client.js": "./dist/client.js",
39
44
  "./client": {
40
- "import": "./dist/client.js",
41
- "require": "./dist/client.js",
42
- "types": "./dist/client.d.ts"
45
+ "types": "./dist/client.d.ts",
46
+ "default": "./dist/client.js"
43
47
  },
44
- "./next.js": "./dist/next.js",
45
48
  "./next": {
46
- "import": "./dist/next.js",
47
- "require": "./dist/next.js",
48
- "types": "./dist/next.d.ts"
49
+ "node": "./dist/next.server.js",
50
+ "browser": "./dist/client-index.js",
51
+ "types": "./dist/next.server.d.ts",
52
+ "default": "./dist/next.server.js"
49
53
  },
50
- "./server.js": "./dist/server.js",
51
54
  "./server": {
52
- "import": "./dist/server.js",
53
- "require": "./dist/server.js",
54
- "types": "./dist/server.d.ts"
55
+ "browser": null,
56
+ "types": "./dist/server-index.d.ts",
57
+ "default": "./dist/server.js"
55
58
  },
56
- "./middleware.js": "./dist/middleware.js",
57
59
  "./middleware": {
58
- "import": "./dist/middleware.js",
59
- "require": "./dist/middleware.js",
60
- "types": "./dist/middleware.d.ts"
60
+ "types": "./dist/middleware.d.ts",
61
+ "default": "./dist/middleware.js"
61
62
  }
62
63
  },
63
64
  "typesVersions": {
64
65
  "*": {
66
+ "internal": [
67
+ "./dist/internal.d.ts"
68
+ ],
65
69
  "client": [
66
70
  "./dist/client.d.ts"
67
71
  ],
@@ -106,7 +110,6 @@
106
110
  ],
107
111
  "dependencies": {
108
112
  "generaltranslation": "latest",
109
- "server-only": "^0.0.1",
110
113
  "xxhash-wasm": "^1.0.2"
111
114
  }
112
115
  }
package/scratchpad.js CHANGED
@@ -1,5 +1,18 @@
1
1
  /*
2
2
 
3
+ import { initGT } from 'gt-react/next'
4
+ import dictionary from './dictionary';
5
+
6
+ export const { getGT } = initGT({
7
+ defaultLocale: 'en',
8
+ dictionary
9
+ });
10
+
11
+ and getGT, getLocale, getDefaultLocale, GTProvider should work ON BOTH CLIENT AND SERVER
12
+
13
+ */
14
+ /*
15
+
3
16
  FUTURE PROMPT
4
17
 
5
18
  I want to add TypeScript IDE autocomplete to my internationalization library. How it works is a user defines a dictionary.
@@ -1 +0,0 @@
1
- {"version":3,"file":"determineLocale.d.ts","sourceRoot":"","sources":["../../src/index/determineLocale.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,aAAa,GAAE,MAAW,GAAG,MAAM,CA4BnI"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"determineLocale.js","sourceRoot":"","sources":["../../src/index/determineLocale.ts"],"names":[],"mappings":";;AAUA,kCA4BC;AAtCD,yDAAoD;AAEpD;;;;;;;GAOG;AACH,SAAwB,eAAe,CAAC,eAA0B,EAAE,OAA2B,EAAE,aAA0B;IAA1B,8BAAA,EAAA,kBAA0B;IAEvH,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;IACrD,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,aAAa,CAAC;IAE9D,wCAAwC;IACxC,IAAI,CAAC,eAAe;QAAE,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;IAExC,2BAA2B;IAC3B,KAAqB,UAAO,EAAP,mBAAO,EAAP,qBAAO,EAAP,IAAO,EAAE,CAAC;QAA1B,IAAM,MAAM,gBAAA;QACb,KAA6B,UAAe,EAAf,mCAAe,EAAf,6BAAe,EAAf,IAAe,EAAE,CAAC;YAA1C,IAAM,cAAc,wBAAA;YACrB,IAAI,MAAM,KAAK,cAAc,EAAE,CAAC;gBAC5B,OAAO,cAAc,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC;IAED,+BAA+B;IAC/B,KAAqB,UAAO,EAAP,mBAAO,EAAP,qBAAO,EAAP,IAAO,EAAE,CAAC;QAA1B,IAAM,MAAM,gBAAA;QACb,KAA6B,UAAe,EAAf,mCAAe,EAAf,6BAAe,EAAf,IAAe,EAAE,CAAC;YAA1C,IAAM,cAAc,wBAAA;YACrB,IAAI,IAAA,mCAAc,EAAC,MAAM,EAAE,cAAc,CAAC,EAAE,CAAC;gBACzC,OAAO,cAAc,CAAC;YAC1B,CAAC;QACL,CAAC;IACL,CAAC;IAED,UAAU;IACV,OAAO,aAAa,CAAC;AACzB,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import determineLocale from "./index/determineLocale";
2
- import calculateHash from "./primitives/calculateHash";
3
- import flattenDictionary from "./primitives/dictionary/flattenDictionary";
4
- import addGTIdentifier from "./primitives/translation/addGTIdentifier";
5
- import writeChildrenAsObjects from "./primitives/translation/writeChildrenAsObjects";
6
- export { determineLocale, addGTIdentifier, writeChildrenAsObjects, flattenDictionary, calculateHash };
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAC1E,OAAO,eAAe,MAAM,0CAA0C,CAAC;AACvE,OAAO,sBAAsB,MAAM,iDAAiD,CAAC;AACrF,OAAO,EACH,eAAe,EACf,eAAe,EAAE,sBAAsB,EACvC,iBAAiB,EACjB,aAAa,EAChB,CAAA"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,4EAAsD;AAMlD,0BANG,yBAAe,CAMH;AALnB,6EAAuD;AAQnD,wBARG,uBAAa,CAQH;AAPjB,gGAA0E;AAMtE,4BANG,2BAAiB,CAMH;AALrB,6FAAuE;AAInE,0BAJG,yBAAe,CAIH;AAHnB,2GAAqF;AAGhE,iCAHd,gCAAsB,CAGc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AACrE,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,EACrB,eAAe,EACf,aAA4C,EAC5C,SAAS,EAAE,WAAW,EACtB,GAAG,QAAQ,EACd,GAAE,aAEF,GAAG,kBAAkB,CAIrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAC5B,eAAe,EACf,aAAa,EACb,SAAS,EACZ,GAAE;IACC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB,GAAG,SAAS,CAGjB"}
package/dist/next.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,4BAWC;AAWD,0CAWC;AA1DD,mCAA4F;AAC5F,4DAAuE;AAKvE;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,QAAQ,CAAC,EAOxB;IAPwB,mBAAA,EAAA;QAMrB,aAAa,EAAE,IAAI;KACtB;IANG,IAAA,eAAe,qBAAA,EACf,qBAA4C,EAA5C,aAAa,mBAAG,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAG,CAAC,CAAC,KAAI,IAAI,KAAA,EAC5C,SAAS,eAAA,EAAE,WAAW,iBAAA,EACnB,QAAQ,cAJU,gEAKxB,CADc;IAIX,IAAM,cAAc,GAAG,SAAS,IAAI,CAAC,cAAQ,OAAO,IAAA,gCAAa,EAAC,aAAa,EAAE,eAAe,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;IACrG,IAAM,gBAAgB,GAAG,WAAW,IAAI,CAAC,cAAQ,OAAO,EAAE,MAAM,EAAE,IAAA,gCAAa,GAAE,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;IACvF,OAAO,IAAA,iBAAY,aAAG,aAAa,eAAA,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,IAAK,QAAQ,EAAG,CAAC;AAClH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,EAQ1B;QAR0B,qBAQ5B,EAAE,KAAA,EAPF,eAAe,qBAAA,EACf,aAAa,mBAAA,EACb,SAAS,eAAA;IAMT,IAAM,cAAc,GAAG,SAAS,IAAI,CAAC,cAAQ,OAAO,IAAA,gCAAa,EAAC,aAAa,EAAE,eAAe,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;IACrG,OAAO,IAAA,wBAAmB,EAAC,EAAE,eAAe,iBAAA,EAAE,aAAa,eAAA,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;AAC9F,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateHash.d.ts","sourceRoot":"","sources":["../../src/primitives/calculateHash.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAA8B,aAAa,CAAC,iBAAiB,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAMnF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateHash.js","sourceRoot":"","sources":["../../src/primitives/calculateHash.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAA;IACD,IAAM,gBAAgB,GAAG,UAAC,QAAa;QACnC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IAC5F,CAAC,CAAA;IACD,OAAO,gBAAgB,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAChE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"flattenDictionary.d.ts","sourceRoot":"","sources":["../../../src/primitives/dictionary/flattenDictionary.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAE,MAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAgBnH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"flattenDictionary.js","sourceRoot":"","sources":["../../../src/primitives/dictionary/flattenDictionary.ts"],"names":[],"mappings":";;;;;AAQA,oCAgBC;AAxBD,gDAA0B;AAE1B;;;;;GAKG;AACH,SAAwB,iBAAiB,CAAC,UAA+B,EAAE,MAAmB;IAAnB,uBAAA,EAAA,WAAmB;IAC1F,IAAM,SAAS,GAAwB,EAAE,CAAC;IAE1C,KAAK,IAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YACjC,IAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,UAAG,MAAM,cAAI,GAAG,CAAE,CAAC,CAAC,CAAC,GAAG,CAAC;YAEjD,IAAI,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,eAAK,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACjJ,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;YACzE,CAAC;iBAAM,CAAC;gBACJ,SAAS,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;YACxC,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDictionaryReference.d.ts","sourceRoot":"","sources":["../../../src/primitives/dictionary/getDictionaryReference.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAE7F"}