gt-react 2.0.210 → 3.0.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 (358) hide show
  1. package/README.md +0 -0
  2. package/dist/I18N/ServerI18N.d.ts +12 -0
  3. package/dist/I18N/ServerI18N.d.ts.map +1 -0
  4. package/dist/{server → I18N}/ServerI18N.js +19 -34
  5. package/dist/I18N/ServerI18N.js.map +1 -0
  6. package/dist/I18N/createI18NComponent.d.ts +9 -0
  7. package/dist/I18N/createI18NComponent.d.ts.map +1 -0
  8. package/dist/I18N/createI18NComponent.js +29 -0
  9. package/dist/I18N/createI18NComponent.js.map +1 -0
  10. package/dist/{server → I18N}/helpers/addGTIdentifier.d.ts +1 -1
  11. package/dist/I18N/helpers/addGTIdentifier.d.ts.map +1 -0
  12. package/dist/{server → I18N}/helpers/addGTIdentifier.js +3 -1
  13. package/dist/I18N/helpers/addGTIdentifier.js.map +1 -0
  14. package/dist/I18N/helpers/generateHash.d.ts.map +1 -0
  15. package/dist/I18N/helpers/generateHash.js.map +1 -0
  16. package/dist/I18N/helpers/writeChildrenAsObjects.d.ts.map +1 -0
  17. package/dist/{server → I18N}/helpers/writeChildrenAsObjects.js +2 -2
  18. package/dist/I18N/helpers/writeChildrenAsObjects.js.map +1 -0
  19. package/dist/I18N/renderChildren.d.ts.map +1 -0
  20. package/dist/{server → I18N}/renderChildren.js +14 -14
  21. package/dist/I18N/renderChildren.js.map +1 -0
  22. package/dist/{server → I18N}/resolvers/I18NResolver.d.ts +0 -2
  23. package/dist/I18N/resolvers/I18NResolver.d.ts.map +1 -0
  24. package/dist/I18N/resolvers/I18NResolver.js.map +1 -0
  25. package/dist/client/ClientProvider.d.ts +4 -1
  26. package/dist/client/ClientProvider.d.ts.map +1 -1
  27. package/dist/client/ClientProvider.js +2 -2
  28. package/dist/client/ClientProvider.js.map +1 -1
  29. package/dist/client/GTProvider.d.ts +8 -3
  30. package/dist/client/GTProvider.d.ts.map +1 -1
  31. package/dist/client/GTProvider.js +31 -14
  32. package/dist/client/GTProvider.js.map +1 -1
  33. package/dist/client/createGTProviderComponent.d.ts +11 -0
  34. package/dist/client/createGTProviderComponent.d.ts.map +1 -0
  35. package/dist/client/createGTProviderComponent.js +30 -0
  36. package/dist/client/createGTProviderComponent.js.map +1 -0
  37. package/dist/client/hooks/useDefaultLocale.d.ts +5 -0
  38. package/dist/client/hooks/useDefaultLocale.d.ts.map +1 -0
  39. package/dist/client/hooks/useDefaultLocale.js +17 -0
  40. package/dist/client/hooks/useDefaultLocale.js.map +1 -0
  41. package/dist/client/hooks/useGT.d.ts +10 -0
  42. package/dist/client/hooks/useGT.d.ts.map +1 -0
  43. package/dist/client/hooks/useGT.js +28 -0
  44. package/dist/client/hooks/useGT.js.map +1 -0
  45. package/dist/client/hooks/useLocale.d.ts +5 -0
  46. package/dist/client/hooks/useLocale.d.ts.map +1 -0
  47. package/dist/client/hooks/useLocale.js +17 -0
  48. package/dist/client/hooks/useLocale.js.map +1 -0
  49. package/dist/{primitives/numeric/client → client/primitives/numeric}/ClientNumeric.d.ts +2 -2
  50. package/dist/{primitives/numeric/client → client/primitives/numeric}/ClientNumeric.d.ts.map +1 -1
  51. package/dist/{primitives/numeric/client → client/primitives/numeric}/ClientNumeric.js +9 -8
  52. package/dist/client/primitives/numeric/ClientNumeric.js.map +1 -0
  53. package/dist/{primitives/value/client → client/primitives/value}/ClientValue.d.ts +1 -1
  54. package/dist/{primitives/value/client → client/primitives/value}/ClientValue.d.ts.map +1 -1
  55. package/dist/{primitives/value/client → client/primitives/value}/ClientValue.js +3 -3
  56. package/dist/{primitives/value/client → client/primitives/value}/ClientValue.js.map +1 -1
  57. package/dist/{primitives/value/client → client/primitives/value}/RenderClientVariable.d.ts.map +1 -1
  58. package/dist/{primitives/value/client → client/primitives/value}/RenderClientVariable.js +35 -18
  59. package/dist/client/primitives/value/RenderClientVariable.js.map +1 -0
  60. package/dist/client/primitives/variables/ClientCurrencyVariable.d.ts.map +1 -0
  61. package/dist/{primitives/variable/currency → client/primitives/variables}/ClientCurrencyVariable.js +7 -4
  62. package/dist/client/primitives/variables/ClientCurrencyVariable.js.map +1 -0
  63. package/dist/client/primitives/variables/ClientDateVariable.d.ts.map +1 -0
  64. package/dist/{primitives/variable/date → client/primitives/variables}/ClientDateVariable.js +7 -4
  65. package/dist/client/primitives/variables/ClientDateVariable.js.map +1 -0
  66. package/dist/client/primitives/variables/ClientNumberVariable.d.ts.map +1 -0
  67. package/dist/{primitives/variable/number → client/primitives/variables}/ClientNumberVariable.js +7 -5
  68. package/dist/client/primitives/variables/ClientNumberVariable.js.map +1 -0
  69. package/dist/{primitives/variable/variable → client/primitives/variables}/ClientVariable.d.ts +2 -2
  70. package/dist/client/primitives/variables/ClientVariable.d.ts.map +1 -0
  71. package/dist/{primitives/variable/variable → client/primitives/variables}/ClientVariable.js +3 -3
  72. package/dist/client/primitives/variables/ClientVariable.js.map +1 -0
  73. package/dist/client.d.ts +10 -10
  74. package/dist/client.d.ts.map +1 -1
  75. package/dist/client.js +15 -15
  76. package/dist/client.js.map +1 -1
  77. package/dist/config/DictionaryManager.d.ts +16 -0
  78. package/dist/config/DictionaryManager.d.ts.map +1 -0
  79. package/dist/config/{SheetManager.js → DictionaryManager.js} +25 -23
  80. package/dist/config/DictionaryManager.js.map +1 -0
  81. package/dist/config/I18NConfiguration.d.ts +104 -0
  82. package/dist/config/I18NConfiguration.d.ts.map +1 -0
  83. package/dist/config/I18NConfiguration.js +277 -0
  84. package/dist/config/I18NConfiguration.js.map +1 -0
  85. package/dist/config/determineLocale.d.ts +2 -0
  86. package/dist/config/determineLocale.d.ts.map +1 -0
  87. package/dist/config/determineLocale.js +32 -0
  88. package/dist/config/determineLocale.js.map +1 -0
  89. package/dist/dictionary/createDictFunction.d.ts +3 -0
  90. package/dist/dictionary/createDictFunction.d.ts.map +1 -0
  91. package/dist/dictionary/createDictFunction.js +9 -0
  92. package/dist/dictionary/createDictFunction.js.map +1 -0
  93. package/dist/dictionary/createTFunction.d.ts +6 -0
  94. package/dist/dictionary/createTFunction.d.ts.map +1 -0
  95. package/dist/dictionary/createTFunction.js +11 -0
  96. package/dist/dictionary/createTFunction.js.map +1 -0
  97. package/dist/dictionary/getDictionaryEntry.d.ts +2 -0
  98. package/dist/dictionary/getDictionaryEntry.d.ts.map +1 -0
  99. package/dist/dictionary/getDictionaryEntry.js +14 -0
  100. package/dist/dictionary/getDictionaryEntry.js.map +1 -0
  101. package/dist/index.d.ts +39 -12
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +130 -23
  104. package/dist/index.js.map +1 -1
  105. package/dist/intl/createIntlFunction.d.ts +6 -0
  106. package/dist/intl/createIntlFunction.d.ts.map +1 -0
  107. package/dist/{dict/dict.js → intl/createIntlFunction.js} +15 -17
  108. package/dist/intl/createIntlFunction.js.map +1 -0
  109. package/dist/local/getDefaultFromEnv.d.ts.map +1 -0
  110. package/dist/local/getDefaultFromEnv.js.map +1 -0
  111. package/dist/middleware/createNextMiddleware.d.ts +3 -5
  112. package/dist/middleware/createNextMiddleware.d.ts.map +1 -1
  113. package/dist/middleware/createNextMiddleware.js +24 -28
  114. package/dist/middleware/createNextMiddleware.js.map +1 -1
  115. package/dist/next/requestFunctions.d.ts +2 -2
  116. package/dist/next/requestFunctions.d.ts.map +1 -1
  117. package/dist/next/requestFunctions.js +12 -12
  118. package/dist/next/requestFunctions.js.map +1 -1
  119. package/dist/next.d.ts +38 -13
  120. package/dist/next.d.ts.map +1 -1
  121. package/dist/next.js +58 -27
  122. package/dist/next.js.map +1 -1
  123. package/dist/primitives/helpers/defaultVariableNames.d.ts.map +1 -0
  124. package/dist/primitives/helpers/defaultVariableNames.js.map +1 -0
  125. package/dist/primitives/{numeric → helpers}/getNumericBranch.d.ts +1 -1
  126. package/dist/primitives/{numeric → helpers}/getNumericBranch.d.ts.map +1 -1
  127. package/dist/primitives/{numeric → helpers}/getNumericBranch.js +8 -8
  128. package/dist/primitives/helpers/getNumericBranch.js.map +1 -0
  129. package/dist/primitives/helpers/getValueBranch.d.ts.map +1 -0
  130. package/dist/primitives/helpers/getValueBranch.js.map +1 -0
  131. package/dist/primitives/helpers/isValidReactNode.d.ts.map +1 -0
  132. package/dist/primitives/helpers/isValidReactNode.js.map +1 -0
  133. package/dist/primitives/numeric/Numeric.d.ts +5 -7
  134. package/dist/primitives/numeric/Numeric.d.ts.map +1 -1
  135. package/dist/primitives/numeric/Numeric.js +10 -12
  136. package/dist/primitives/numeric/Numeric.js.map +1 -1
  137. package/dist/primitives/numeric/createNumericComponent.d.ts +8 -0
  138. package/dist/primitives/numeric/createNumericComponent.d.ts.map +1 -0
  139. package/dist/primitives/numeric/createNumericComponent.js +29 -0
  140. package/dist/primitives/numeric/createNumericComponent.js.map +1 -0
  141. package/dist/primitives/private/createPrivateComponent.d.ts +9 -0
  142. package/dist/primitives/private/createPrivateComponent.d.ts.map +1 -0
  143. package/dist/primitives/private/createPrivateComponent.js +11 -0
  144. package/dist/primitives/private/createPrivateComponent.js.map +1 -0
  145. package/dist/primitives/value/Value.d.ts +4 -2
  146. package/dist/primitives/value/Value.d.ts.map +1 -1
  147. package/dist/primitives/value/Value.js +5 -5
  148. package/dist/primitives/value/Value.js.map +1 -1
  149. package/dist/primitives/value/createValueComponent.d.ts +8 -0
  150. package/dist/primitives/value/createValueComponent.d.ts.map +1 -0
  151. package/dist/primitives/value/createValueComponent.js +29 -0
  152. package/dist/primitives/value/createValueComponent.js.map +1 -0
  153. package/dist/primitives/value/renderVariable.d.ts +2 -1
  154. package/dist/primitives/value/renderVariable.d.ts.map +1 -1
  155. package/dist/primitives/value/renderVariable.js +19 -17
  156. package/dist/primitives/value/renderVariable.js.map +1 -1
  157. package/dist/primitives/{variable/currency → variables/CurrencyVariable}/CurrencyVariable.d.ts +4 -3
  158. package/dist/primitives/variables/CurrencyVariable/CurrencyVariable.d.ts.map +1 -0
  159. package/dist/primitives/{variable/currency → variables/CurrencyVariable}/CurrencyVariable.js +4 -11
  160. package/dist/primitives/variables/CurrencyVariable/CurrencyVariable.js.map +1 -0
  161. package/dist/primitives/variables/CurrencyVariable/createCurrencyVariableComponent.d.ts +8 -0
  162. package/dist/primitives/variables/CurrencyVariable/createCurrencyVariableComponent.d.ts.map +1 -0
  163. package/dist/primitives/variables/CurrencyVariable/createCurrencyVariableComponent.js +29 -0
  164. package/dist/primitives/variables/CurrencyVariable/createCurrencyVariableComponent.js.map +1 -0
  165. package/dist/primitives/{variable/date → variables/DateVariable}/DateVariable.d.ts +4 -3
  166. package/dist/primitives/variables/DateVariable/DateVariable.d.ts.map +1 -0
  167. package/dist/primitives/{variable/date → variables/DateVariable}/DateVariable.js +4 -11
  168. package/dist/primitives/variables/DateVariable/DateVariable.js.map +1 -0
  169. package/dist/primitives/variables/DateVariable/createDateVariableComponent.d.ts +8 -0
  170. package/dist/primitives/variables/DateVariable/createDateVariableComponent.d.ts.map +1 -0
  171. package/dist/primitives/variables/DateVariable/createDateVariableComponent.js +29 -0
  172. package/dist/primitives/variables/DateVariable/createDateVariableComponent.js.map +1 -0
  173. package/dist/primitives/{variable/number → variables/NumberVariable}/NumberVariable.d.ts +5 -4
  174. package/dist/primitives/variables/NumberVariable/NumberVariable.d.ts.map +1 -0
  175. package/dist/primitives/{variable/number → variables/NumberVariable}/NumberVariable.js +5 -12
  176. package/dist/primitives/variables/NumberVariable/NumberVariable.js.map +1 -0
  177. package/dist/primitives/variables/NumberVariable/createNumberVariableComponent.d.ts +8 -0
  178. package/dist/primitives/variables/NumberVariable/createNumberVariableComponent.d.ts.map +1 -0
  179. package/dist/primitives/variables/NumberVariable/createNumberVariableComponent.js +30 -0
  180. package/dist/primitives/variables/NumberVariable/createNumberVariableComponent.js.map +1 -0
  181. package/dist/primitives/{variable/variable → variables/Variable}/Variable.d.ts +1 -1
  182. package/dist/primitives/variables/Variable/Variable.d.ts.map +1 -0
  183. package/dist/primitives/{variable/variable → variables/Variable}/Variable.js +2 -2
  184. package/dist/primitives/variables/Variable/Variable.js.map +1 -0
  185. package/dist/primitives/variables/Variable/createVariableComponent.d.ts +7 -0
  186. package/dist/primitives/variables/Variable/createVariableComponent.d.ts.map +1 -0
  187. package/dist/primitives/variables/Variable/createVariableComponent.js +29 -0
  188. package/dist/primitives/variables/Variable/createVariableComponent.js.map +1 -0
  189. package/dist/types/CreateGTProps.d.ts +17 -0
  190. package/dist/types/CreateGTProps.d.ts.map +1 -0
  191. package/dist/types/CreateGTProps.js +3 -0
  192. package/dist/types/CreateGTProps.js.map +1 -0
  193. package/dist/types/CreateI18NConfigProps.d.ts +2 -0
  194. package/dist/types/CreateI18NConfigProps.d.ts.map +1 -0
  195. package/dist/types/CreateI18NConfigProps.js +4 -0
  196. package/dist/types/CreateI18NConfigProps.js.map +1 -0
  197. package/dist/types/GTInterface.d.ts +29 -0
  198. package/dist/types/GTInterface.d.ts.map +1 -0
  199. package/dist/types/GTInterface.js +3 -0
  200. package/dist/types/GTInterface.js.map +1 -0
  201. package/dist/types/GeneralTranslationInterface.d.ts +179 -0
  202. package/dist/types/GeneralTranslationInterface.d.ts.map +1 -0
  203. package/dist/types/GeneralTranslationInterface.js +3 -0
  204. package/dist/types/GeneralTranslationInterface.js.map +1 -0
  205. package/dist/types/VariableInterface.d.ts +100 -0
  206. package/dist/types/VariableInterface.d.ts.map +1 -0
  207. package/dist/types/VariableInterface.js +3 -0
  208. package/dist/types/VariableInterface.js.map +1 -0
  209. package/package.json +2 -2
  210. package/tsconfig.json +2 -0
  211. package/dist/client/useDefaultLanguage.d.ts +0 -2
  212. package/dist/client/useDefaultLanguage.d.ts.map +0 -1
  213. package/dist/client/useDefaultLanguage.js +0 -14
  214. package/dist/client/useDefaultLanguage.js.map +0 -1
  215. package/dist/client/useGT.d.ts +0 -2
  216. package/dist/client/useGT.d.ts.map +0 -1
  217. package/dist/client/useGT.js +0 -14
  218. package/dist/client/useGT.js.map +0 -1
  219. package/dist/client/useUserLanguage.d.ts +0 -2
  220. package/dist/client/useUserLanguage.d.ts.map +0 -1
  221. package/dist/client/useUserLanguage.js +0 -14
  222. package/dist/client/useUserLanguage.js.map +0 -1
  223. package/dist/config/I18NConfig.d.ts +0 -122
  224. package/dist/config/I18NConfig.d.ts.map +0 -1
  225. package/dist/config/I18NConfig.js +0 -279
  226. package/dist/config/I18NConfig.js.map +0 -1
  227. package/dist/config/SheetManager.d.ts +0 -16
  228. package/dist/config/SheetManager.d.ts.map +0 -1
  229. package/dist/config/SheetManager.js.map +0 -1
  230. package/dist/config/local/getConfigData.d.ts +0 -8
  231. package/dist/config/local/getConfigData.d.ts.map +0 -1
  232. package/dist/config/local/getConfigData.js +0 -29
  233. package/dist/config/local/getConfigData.js.map +0 -1
  234. package/dist/config/local/getDefaultFromEnv.d.ts.map +0 -1
  235. package/dist/config/local/getDefaultFromEnv.js.map +0 -1
  236. package/dist/config/local/getLocalI18NSheet.d.ts +0 -10
  237. package/dist/config/local/getLocalI18NSheet.d.ts.map +0 -1
  238. package/dist/config/local/getLocalI18NSheet.js +0 -34
  239. package/dist/config/local/getLocalI18NSheet.js.map +0 -1
  240. package/dist/config/local/readLocalFile.d.ts +0 -8
  241. package/dist/config/local/readLocalFile.d.ts.map +0 -1
  242. package/dist/config/local/readLocalFile.js +0 -54
  243. package/dist/config/local/readLocalFile.js.map +0 -1
  244. package/dist/config/placeholderCache.d.ts +0 -8
  245. package/dist/config/placeholderCache.d.ts.map +0 -1
  246. package/dist/config/placeholderCache.js +0 -71
  247. package/dist/config/placeholderCache.js.map +0 -1
  248. package/dist/dict/dict.d.ts +0 -6
  249. package/dist/dict/dict.d.ts.map +0 -1
  250. package/dist/dict/dict.js.map +0 -1
  251. package/dist/intl/intl.d.ts +0 -14
  252. package/dist/intl/intl.d.ts.map +0 -1
  253. package/dist/intl/intl.js +0 -43
  254. package/dist/intl/intl.js.map +0 -1
  255. package/dist/loading/LoadingNotification.d.ts +0 -4
  256. package/dist/loading/LoadingNotification.d.ts.map +0 -1
  257. package/dist/loading/LoadingNotification.js +0 -38
  258. package/dist/loading/LoadingNotification.js.map +0 -1
  259. package/dist/next/NextGTProvider.d.ts +0 -15
  260. package/dist/next/NextGTProvider.d.ts.map +0 -1
  261. package/dist/next/NextGTProvider.js +0 -48
  262. package/dist/next/NextGTProvider.js.map +0 -1
  263. package/dist/next/NextI18N.d.ts +0 -15
  264. package/dist/next/NextI18N.d.ts.map +0 -1
  265. package/dist/next/NextI18N.js +0 -48
  266. package/dist/next/NextI18N.js.map +0 -1
  267. package/dist/next/getUserLanguage.d.ts +0 -6
  268. package/dist/next/getUserLanguage.d.ts.map +0 -1
  269. package/dist/next/getUserLanguage.js +0 -18
  270. package/dist/next/getUserLanguage.js.map +0 -1
  271. package/dist/next/nextDict.d.ts +0 -6
  272. package/dist/next/nextDict.d.ts.map +0 -1
  273. package/dist/next/nextDict.js +0 -41
  274. package/dist/next/nextDict.js.map +0 -1
  275. package/dist/next/nextIntl.d.ts +0 -8
  276. package/dist/next/nextIntl.d.ts.map +0 -1
  277. package/dist/next/nextIntl.js +0 -30
  278. package/dist/next/nextIntl.js.map +0 -1
  279. package/dist/primitives/numeric/client/ClientNumeric.js.map +0 -1
  280. package/dist/primitives/numeric/getNumericBranch.js.map +0 -1
  281. package/dist/primitives/value/client/RenderClientVariable.js.map +0 -1
  282. package/dist/primitives/value/getValueBranch.d.ts.map +0 -1
  283. package/dist/primitives/value/getValueBranch.js.map +0 -1
  284. package/dist/primitives/value/isValidReactNode.d.ts.map +0 -1
  285. package/dist/primitives/value/isValidReactNode.js.map +0 -1
  286. package/dist/primitives/variable/currency/ClientCurrencyVariable.d.ts.map +0 -1
  287. package/dist/primitives/variable/currency/ClientCurrencyVariable.js.map +0 -1
  288. package/dist/primitives/variable/currency/CurrencyVariable.d.ts.map +0 -1
  289. package/dist/primitives/variable/currency/CurrencyVariable.js.map +0 -1
  290. package/dist/primitives/variable/date/ClientDateVariable.d.ts.map +0 -1
  291. package/dist/primitives/variable/date/ClientDateVariable.js.map +0 -1
  292. package/dist/primitives/variable/date/DateVariable.d.ts.map +0 -1
  293. package/dist/primitives/variable/date/DateVariable.js.map +0 -1
  294. package/dist/primitives/variable/defaultVariableNames.d.ts.map +0 -1
  295. package/dist/primitives/variable/defaultVariableNames.js.map +0 -1
  296. package/dist/primitives/variable/number/ClientNumberVariable.d.ts.map +0 -1
  297. package/dist/primitives/variable/number/ClientNumberVariable.js.map +0 -1
  298. package/dist/primitives/variable/number/NumberVariable.d.ts.map +0 -1
  299. package/dist/primitives/variable/number/NumberVariable.js.map +0 -1
  300. package/dist/primitives/variable/variable/ClientVariable.d.ts.map +0 -1
  301. package/dist/primitives/variable/variable/ClientVariable.js.map +0 -1
  302. package/dist/primitives/variable/variable/Variable.d.ts.map +0 -1
  303. package/dist/primitives/variable/variable/Variable.js.map +0 -1
  304. package/dist/server/ServerI18N.d.ts +0 -18
  305. package/dist/server/ServerI18N.d.ts.map +0 -1
  306. package/dist/server/ServerI18N.js.map +0 -1
  307. package/dist/server/getDefaultLanguage.d.ts +0 -5
  308. package/dist/server/getDefaultLanguage.d.ts.map +0 -1
  309. package/dist/server/getDefaultLanguage.js +0 -14
  310. package/dist/server/getDefaultLanguage.js.map +0 -1
  311. package/dist/server/helpers/addGTIdentifier.d.ts.map +0 -1
  312. package/dist/server/helpers/addGTIdentifier.js.map +0 -1
  313. package/dist/server/helpers/generateHash.d.ts.map +0 -1
  314. package/dist/server/helpers/generateHash.js.map +0 -1
  315. package/dist/server/helpers/writeChildrenAsObjects.d.ts.map +0 -1
  316. package/dist/server/helpers/writeChildrenAsObjects.js.map +0 -1
  317. package/dist/server/renderChildren.d.ts.map +0 -1
  318. package/dist/server/renderChildren.js.map +0 -1
  319. package/dist/server/resolvers/I18NResolver.d.ts.map +0 -1
  320. package/dist/server/resolvers/I18NResolver.js.map +0 -1
  321. package/dist/server/resolvers/loading/Loader.d.ts +0 -8
  322. package/dist/server/resolvers/loading/Loader.d.ts.map +0 -1
  323. package/dist/server/resolvers/loading/Loader.js +0 -38
  324. package/dist/server/resolvers/loading/Loader.js.map +0 -1
  325. package/dist/server/resolvers/loading/LoadingNotification.d.ts +0 -9
  326. package/dist/server/resolvers/loading/LoadingNotification.d.ts.map +0 -1
  327. package/dist/server/resolvers/loading/LoadingNotification.js +0 -68
  328. package/dist/server/resolvers/loading/LoadingNotification.js.map +0 -1
  329. package/dist/server/resolvers/loading/NotificationRenderer.d.ts +0 -6
  330. package/dist/server/resolvers/loading/NotificationRenderer.d.ts.map +0 -1
  331. package/dist/server/resolvers/loading/NotificationRenderer.js +0 -22
  332. package/dist/server/resolvers/loading/NotificationRenderer.js.map +0 -1
  333. package/dist/server/resolvers/loading/appendNotification.d.ts +0 -2
  334. package/dist/server/resolvers/loading/appendNotification.d.ts.map +0 -1
  335. package/dist/server/resolvers/loading/appendNotification.js +0 -15
  336. package/dist/server/resolvers/loading/appendNotification.js.map +0 -1
  337. package/dist/server/resolvers/loading/translations.d.ts +0 -3
  338. package/dist/server/resolvers/loading/translations.d.ts.map +0 -1
  339. package/dist/server/resolvers/loading/translations.js +0 -222
  340. package/dist/server/resolvers/loading/translations.js.map +0 -1
  341. package/scratchpad.js +0 -33
  342. /package/dist/{server → I18N}/helpers/generateHash.d.ts +0 -0
  343. /package/dist/{server → I18N}/helpers/generateHash.js +0 -0
  344. /package/dist/{server → I18N}/helpers/writeChildrenAsObjects.d.ts +0 -0
  345. /package/dist/{server → I18N}/renderChildren.d.ts +0 -0
  346. /package/dist/{server → I18N}/resolvers/I18NResolver.js +0 -0
  347. /package/dist/{primitives/value/client → client/primitives/value}/RenderClientVariable.d.ts +0 -0
  348. /package/dist/{primitives/variable/currency → client/primitives/variables}/ClientCurrencyVariable.d.ts +0 -0
  349. /package/dist/{primitives/variable/date → client/primitives/variables}/ClientDateVariable.d.ts +0 -0
  350. /package/dist/{primitives/variable/number → client/primitives/variables}/ClientNumberVariable.d.ts +0 -0
  351. /package/dist/{config/local → local}/getDefaultFromEnv.d.ts +0 -0
  352. /package/dist/{config/local → local}/getDefaultFromEnv.js +0 -0
  353. /package/dist/primitives/{variable → helpers}/defaultVariableNames.d.ts +0 -0
  354. /package/dist/primitives/{variable → helpers}/defaultVariableNames.js +0 -0
  355. /package/dist/primitives/{value → helpers}/getValueBranch.d.ts +0 -0
  356. /package/dist/primitives/{value → helpers}/getValueBranch.js +0 -0
  357. /package/dist/primitives/{value → helpers}/isValidReactNode.d.ts +0 -0
  358. /package/dist/primitives/{value → helpers}/isValidReactNode.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateI18NConfigProps.js","sourceRoot":"","sources":["../../src/types/CreateI18NConfigProps.ts"],"names":[],"mappings":";;AAsBA,kBAAe,qBAAqB,CAAC"}
@@ -0,0 +1,29 @@
1
+ export default interface GTInterface {
2
+ /** React component for internationalization */
3
+ I18N: React.ComponentType<any>;
4
+ /** Internationalization function */
5
+ intl: (key: string, options?: Record<string, any>) => Promise<string>;
6
+ /** Provider component for GlobalThis */
7
+ GTProvider: React.ComponentType<any>;
8
+ /** Translation function */
9
+ t: (key: string, options?: Record<string, any>) => any;
10
+ /** Dictionary function */
11
+ dict: (key: string) => any;
12
+ /** Component for rendering localized values */
13
+ Value: React.ComponentType<any>;
14
+ /** Component for rendering localized numeric values */
15
+ Numeric: React.ComponentType<any>;
16
+ /** Component for rendering variables */
17
+ Variable: React.ComponentType<any>;
18
+ /** Component for rendering number variables */
19
+ NumberVariable: React.ComponentType<any>;
20
+ /** Component for rendering date variables */
21
+ DateVariable: React.ComponentType<any>;
22
+ /** Component for rendering currency variables */
23
+ CurrencyVariable: React.ComponentType<any>;
24
+ /** Function to get the current locale */
25
+ getLocale: () => string;
26
+ /** Function to get the default locale */
27
+ getDefaultLocale: () => string;
28
+ }
29
+ //# sourceMappingURL=GTInterface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GTInterface.d.ts","sourceRoot":"","sources":["../../src/types/GTInterface.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,WAAW;IAEhC,+CAA+C;IAC/C,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAE/B,oCAAoC;IACpC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtE,wCAAwC;IACxC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAErC,2BAA2B;IAC3B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC;IAEvD,0BAA0B;IAC1B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;IAE3B,+CAA+C;IAC/C,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEhC,uDAAuD;IACvD,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAElC,wCAAwC;IACxC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEnC,+CAA+C;IAC/C,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEzC,6CAA6C;IAC7C,YAAY,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAEvC,iDAAiD;IACjD,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAE3C,yCAAyC;IACzC,SAAS,EAAE,MAAM,MAAM,CAAC;IAExB,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,MAAM,CAAC;CAElC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=GTInterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GTInterface.js","sourceRoot":"","sources":["../../src/types/GTInterface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,179 @@
1
+ import { ComponentType } from 'react';
2
+ export default interface GeneralTranslation {
3
+ /**
4
+ * The `<I18N>` component. Translates its ReactNode children into the user's locale.
5
+ *
6
+ * `children?` - (any) - Children to translate.
7
+ *
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.
9
+ *
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.
11
+ */
12
+ I18N: ComponentType<{
13
+ children?: any;
14
+ id?: string;
15
+ [key: string]: any;
16
+ }>;
17
+ /**
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.
23
+ *
24
+ * `options.targetLanguage?` - (string) - A BCP 47 language tag which represents the language to translate into. Defaults to the user's locale.
25
+ *
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
+ */
28
+ intl: (content: string, options?: {
29
+ targetLanguage?: string;
30
+ id?: string;
31
+ [key: string]: any;
32
+ }) => Promise<string>;
33
+ /**
34
+ * 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
+ *
36
+ * If `id` or `dictionary` components are not provided, translations of all entries in the default `createGT` dictionary are provided.
37
+ *
38
+ * These translations can be accessed on the client using the `useGT` hook.
39
+ *
40
+ * `children?` - (any) - Children to which context is provided.
41
+ *
42
+ * `id?` - (string) - If provided, only the items in the initial dictionary which fall under that ID will be provided to the client, alongside any additional items in the `dictionary` prop. Any new translations created by this component will be assigned (`id + '.'`) as a prefix.
43
+ *
44
+ * `dictionary?` - (Record<string, any>) - Object representing a dictionary, where keys are strings and the values are strings or React children, which are translated and sent to the client. Advanced: dictionary entries can also be arbitrary promises which are resolved and provided the client.
45
+ *
46
+ * `...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.
47
+ */
48
+ GTProvider: ComponentType<{
49
+ children?: any;
50
+ id?: string;
51
+ dictionary?: Record<string, any>;
52
+ [key: string]: any;
53
+ }>;
54
+ /**
55
+ * Server-side function which gets an entry from the default dictionary and wraps it in the `<I18N>` component.
56
+ *
57
+ * `id` - (string) - ID of the item in the dictionary.
58
+ *
59
+ * `options?` - ({ [key: string]: any }) - Other parameters which override the global `gt-react` configuration. See https://docs.generaltranslation.com for a full list.
60
+ */
61
+ t: (id: string, options?: Record<string, any>) => any;
62
+ /**
63
+ * Server-side function which gets an entry from the default dictionary, in its original language.
64
+ *
65
+ * `id` - (string) - ID of the item in the dictionary.
66
+ */
67
+ dict: (id: string) => any;
68
+ /**
69
+ * Component for rendering localized values.
70
+ *
71
+ * `children?` - (any) - The default content to render if no conditions are met.
72
+ *
73
+ * `branches?` - (Record<string, any>) - An object containing conditional branches to render. Keys represent condition names, and values are the corresponding content.
74
+ *
75
+ * `values?` - (Record<string, any>) - A set of values used for conditional rendering.
76
+ */
77
+ Value: ComponentType<{
78
+ children?: any;
79
+ branches?: Record<string, any>;
80
+ values?: Record<string, any>;
81
+ }>;
82
+ /**
83
+ * Component for rendering localized numeric values.
84
+ *
85
+ * `children?` - (any) - The default content to render if no numeric conditions are met.
86
+ *
87
+ * `n` - (number) - The number to evaluate against defined ranges or conditions.
88
+ *
89
+ * `ranges?` - ({ min: number, max: number, children: any }[]) - An array of range objects for determining which branch to render based on the number `n`.
90
+ **/
91
+ Numeric: ComponentType<{
92
+ children?: any;
93
+ n: number;
94
+ ranges?: {
95
+ min: number;
96
+ max: number;
97
+ children: any;
98
+ }[];
99
+ }>;
100
+ /**
101
+ * Component for rendering variables.
102
+ *
103
+ * `children?` - (any) - The content to render if provided. Overrides `defaultValue`.
104
+ *
105
+ * `name?` - (string) - The name of the variable, used for identifying the component.
106
+ *
107
+ * `defaultValue?` - (any) - The default value to display if `children` is not provided.
108
+ **/
109
+ Variable: ComponentType<{
110
+ children?: any;
111
+ name?: string;
112
+ defaultValue?: any;
113
+ }>;
114
+ /**
115
+ * Component for rendering number variables.
116
+ *
117
+ * `children?` - (any) - The content to render if provided. Overrides `defaultValue`.
118
+ *
119
+ * `name?` - (string) - The name of the variable, used for identifying the component.
120
+ *
121
+ * `defaultValue?` - (any) - The default value to display if `children` is not provided. This can be a number or a string representation of a number.
122
+ *
123
+ * `options?` - (Record<string, any>) - Additional options for `Intl.NumberFormat` for formatting the number.
124
+ **/
125
+ NumberVariable: ComponentType<{
126
+ children?: any;
127
+ name?: string;
128
+ defaultValue?: any;
129
+ options?: Record<string, any>;
130
+ }>;
131
+ /**
132
+ * Component for rendering date variables.
133
+ *
134
+ * `children?` - (any) - The content to render if provided. Overrides `defaultValue`.
135
+ *
136
+ * `name?` - (string) - The name of the variable, used for identifying the component.
137
+ *
138
+ * `defaultValue?` - (any) - The default value to display if `children` is not provided. This can be a number (Unix timestamp), string, or Date object.
139
+ *
140
+ * `options?` - (Record<string, any>) - Additional options for `Intl.DateTimeFormat` for formatting the date.
141
+ **/
142
+ DateVariable: ComponentType<{
143
+ children?: any;
144
+ name?: string;
145
+ defaultValue?: any;
146
+ options?: Record<string, any>;
147
+ }>;
148
+ /**
149
+ * Component for rendering currency variables.
150
+ *
151
+ * `children?` - (any) - The content to render if provided. Overrides `defaultValue`.
152
+ *
153
+ * `name?` - (string) - The name of the variable, used for identifying the component.
154
+ *
155
+ * `defaultValue?` - (any) - The default value to display if `children` is not provided. This should be a number or a string representation of a number.
156
+ *
157
+ * `currency?` - (string) - The currency code to use for formatting. Defaults to "USD".
158
+ *
159
+ * `options?` - (Record<string, any>) - Additional options for `Intl.NumberFormat` for formatting the currency.
160
+ **/
161
+ CurrencyVariable: ComponentType<{
162
+ children?: any;
163
+ name?: string;
164
+ defaultValue?: any;
165
+ currency?: string;
166
+ options?: Record<string, any>;
167
+ }>;
168
+ /**
169
+ * Server-side function which gets the user's current locale.
170
+ * Returns a BCP 47 language code representing the user's language, e.g. `en-US`.
171
+ **/
172
+ getLocale: () => string;
173
+ /**
174
+ * Server-side function which gets the application's default locale.
175
+ * Returns a BCP 47 language code representing a language, e.g. `en-US`.
176
+ **/
177
+ getDefaultLocale: () => string;
178
+ }
179
+ //# sourceMappingURL=GeneralTranslationInterface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneralTranslationInterface.d.ts","sourceRoot":"","sources":["../../src/types/GeneralTranslationInterface.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=GeneralTranslationInterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneralTranslationInterface.js","sourceRoot":"","sources":["../../src/types/GeneralTranslationInterface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,100 @@
1
+ import { ComponentType } from 'react';
2
+ export default interface Variables {
3
+ /**
4
+ * Component for rendering localized values.
5
+ *
6
+ * `children?` - (any) - The default content to render if no conditions are met.
7
+ *
8
+ * `branches?` - (Record<string, any>) - An object containing conditional branches to render. Keys represent condition names, and values are the corresponding content.
9
+ *
10
+ * `values?` - (Record<string, any>) - A set of values used for conditional rendering.
11
+ */
12
+ Value: ComponentType<{
13
+ children?: any;
14
+ branches?: Record<string, any>;
15
+ values?: Record<string, any>;
16
+ }>;
17
+ /**
18
+ * Component for rendering localized numeric values.
19
+ *
20
+ * `children?` - (any) - The default content to render if no numeric conditions are met.
21
+ *
22
+ * `n` - (number) - The number to evaluate against defined ranges or conditions.
23
+ *
24
+ * `ranges?` - (Range[]) - An array of range objects for determining which branch to render based on the number `n`.
25
+ */
26
+ Numeric: ComponentType<{
27
+ children?: any;
28
+ n: number;
29
+ ranges?: Range[];
30
+ }>;
31
+ /**
32
+ * Component for rendering variables.
33
+ *
34
+ * `children?` - (any) - The content to render if provided. Overrides `defaultValue`.
35
+ *
36
+ * `name?` - (string) - The name of the variable, used for identifying the component.
37
+ *
38
+ * `defaultValue?` - (any) - The default value to display if `children` is not provided.
39
+ */
40
+ Variable: ComponentType<{
41
+ children?: any;
42
+ name?: string;
43
+ defaultValue?: any;
44
+ }>;
45
+ /**
46
+ * Component for rendering number variables.
47
+ *
48
+ * `children?` - (any) - The content to render if provided. Overrides `defaultValue`.
49
+ *
50
+ * `name?` - (string) - The name of the variable, used for identifying the component.
51
+ *
52
+ * `defaultValue?` - (any) - The default value to display if `children` is not provided. This can be a number or a string representation of a number.
53
+ *
54
+ * `options?` - (Record<string, any>) - Additional options for `Intl.NumberFormat` for formatting the number.
55
+ */
56
+ NumberVariable: ComponentType<{
57
+ children?: any;
58
+ name?: string;
59
+ defaultValue?: any;
60
+ options?: Record<string, any>;
61
+ }>;
62
+ /**
63
+ * Component for rendering date variables.
64
+ *
65
+ * `children?` - (any) - The content to render if provided. Overrides `defaultValue`.
66
+ *
67
+ * `name?` - (string) - The name of the variable, used for identifying the component.
68
+ *
69
+ * `defaultValue?` - (any) - The default value to display if `children` is not provided. This can be a number (Unix timestamp), string, or Date object.
70
+ *
71
+ * `options?` - (Record<string, any>) - Additional options for `Intl.DateTimeFormat` for formatting the date.
72
+ */
73
+ DateVariable: ComponentType<{
74
+ children?: any;
75
+ name?: string;
76
+ defaultValue?: any;
77
+ options?: Record<string, any>;
78
+ }>;
79
+ /**
80
+ * Component for rendering currency variables.
81
+ *
82
+ * `children?` - (any) - The content to render if provided. Overrides `defaultValue`.
83
+ *
84
+ * `name?` - (string) - The name of the variable, used for identifying the component.
85
+ *
86
+ * `defaultValue?` - (any) - The default value to display if `children` is not provided. This should be a number or a string representation of a number.
87
+ *
88
+ * `currency?` - (string) - The currency code to use for formatting. Defaults to "USD".
89
+ *
90
+ * `options?` - (Record<string, any>) - Additional options for `Intl.NumberFormat` for formatting the currency.
91
+ */
92
+ CurrencyVariable: ComponentType<{
93
+ children?: any;
94
+ name?: string;
95
+ defaultValue?: any;
96
+ currency?: string;
97
+ options?: Record<string, any>;
98
+ }>;
99
+ }
100
+ //# sourceMappingURL=VariableInterface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VariableInterface.d.ts","sourceRoot":"","sources":["../../src/types/VariableInterface.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,MAAM,CAAC,OAAO,WAAW,SAAS;IAE9B;;;;;;;;OAQG;IACH,KAAK,EAAE,aAAa,CAAC;QACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAChC,CAAC,CAAC;IAEH;;;;;;;;OAQG;IACH,OAAO,EAAE,aAAa,CAAC;QACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,CAAC,EAAE,MAAM,CAAC;QACV,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;KACpB,CAAC,CAAC;IAEH;;;;;;;;OAQG;IACH,QAAQ,EAAE,aAAa,CAAC;QACpB,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,GAAG,CAAC;KACtB,CAAC,CAAC;IAEH;;;;;;;;;;OAUG;IACH,cAAc,EAAE,aAAa,CAAC;QAC1B,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACjC,CAAC,CAAC;IAEH;;;;;;;;;;OAUG;IACH,YAAY,EAAE,aAAa,CAAC;QACxB,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACjC,CAAC,CAAC;IAEH;;;;;;;;;;;;OAYG;IACH,gBAAgB,EAAE,aAAa,CAAC;QAC5B,QAAQ,CAAC,EAAE,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,GAAG,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACjC,CAAC,CAAC;CAEN"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=VariableInterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VariableInterface.js","sourceRoot":"","sources":["../../src/types/VariableInterface.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt-react",
3
- "version": "2.0.210",
3
+ "version": "3.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -89,6 +89,6 @@
89
89
  "i18n"
90
90
  ],
91
91
  "dependencies": {
92
- "generaltranslation": "^2.0.16"
92
+ "generaltranslation": "^2.0.17"
93
93
  }
94
94
  }
package/tsconfig.json CHANGED
@@ -13,6 +13,8 @@
13
13
  "sourceMap": true,
14
14
  "declaration": true,
15
15
  "declarationMap": true,
16
+ "removeComments": false,
17
+ "allowSyntheticDefaultImports": true,
16
18
  "jsx": "react-jsx"
17
19
  },
18
20
  "include": ["src/**/*"],
@@ -1,2 +0,0 @@
1
- export default function useDefaultLanguage(): string;
2
- //# sourceMappingURL=useDefaultLanguage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDefaultLanguage.d.ts","sourceRoot":"","sources":["../../src/client/useDefaultLanguage.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,MAAM,CAMnD"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- 'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.default = useDefaultLanguage;
5
- const react_1 = require("react");
6
- const ClientProvider_1 = require("./ClientProvider");
7
- function useDefaultLanguage() {
8
- const ctx = (0, react_1.useContext)(ClientProvider_1.GTContext);
9
- if (ctx === null || ctx === void 0 ? void 0 : ctx.defaultLanguage) {
10
- return ctx.defaultLanguage;
11
- }
12
- return "";
13
- }
14
- //# sourceMappingURL=useDefaultLanguage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDefaultLanguage.js","sourceRoot":"","sources":["../../src/client/useDefaultLanguage.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;AAKZ,qCAMC;AATD,iCAAmC;AACnC,qDAA6C;AAE7C,SAAwB,kBAAkB;IACtC,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,0BAAS,CAAC,CAAC;IAClC,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,eAAe,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,eAAe,CAAC;IAC/B,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC"}
@@ -1,2 +0,0 @@
1
- export default function useGT(): Function;
2
- //# sourceMappingURL=useGT.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useGT.d.ts","sourceRoot":"","sources":["../../src/client/useGT.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,KAAK,IAAI,QAAQ,CAMxC"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- 'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.default = useGT;
5
- const react_1 = require("react");
6
- const ClientProvider_1 = require("./ClientProvider");
7
- function useGT() {
8
- const ctx = (0, react_1.useContext)(ClientProvider_1.GTContext);
9
- if (ctx === null || ctx === void 0 ? void 0 : ctx.translate) {
10
- return (id) => ctx.translate(id);
11
- }
12
- return () => { };
13
- }
14
- //# sourceMappingURL=useGT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useGT.js","sourceRoot":"","sources":["../../src/client/useGT.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;AAKZ,wBAMC;AATD,iCAAmC;AACnC,qDAA6C;AAE7C,SAAwB,KAAK;IACzB,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,0BAAS,CAAC,CAAC;IAClC,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,SAAS,EAAE,CAAC;QACjB,OAAO,CAAC,EAAU,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;AACpB,CAAC"}
@@ -1,2 +0,0 @@
1
- export default function useUserLanguage(): string;
2
- //# sourceMappingURL=useUserLanguage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUserLanguage.d.ts","sourceRoot":"","sources":["../../src/client/useUserLanguage.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,eAAe,IAAI,MAAM,CAMhD"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- 'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.default = useUserLanguage;
5
- const react_1 = require("react");
6
- const ClientProvider_1 = require("./ClientProvider");
7
- function useUserLanguage() {
8
- const ctx = (0, react_1.useContext)(ClientProvider_1.GTContext);
9
- if (ctx === null || ctx === void 0 ? void 0 : ctx.userLanguage) {
10
- return ctx.userLanguage;
11
- }
12
- return "";
13
- }
14
- //# sourceMappingURL=useUserLanguage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUserLanguage.js","sourceRoot":"","sources":["../../src/client/useUserLanguage.ts"],"names":[],"mappings":";AAAA,YAAY,CAAA;;AAKZ,kCAMC;AATD,iCAAmC;AACnC,qDAA6C;AAE7C,SAAwB,eAAe;IACnC,MAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,0BAAS,CAAC,CAAC;IAClC,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,YAAY,EAAE,CAAC;QACpB,OAAO,GAAG,CAAC,YAAY,CAAC;IAC5B,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC"}
@@ -1,122 +0,0 @@
1
- import 'server-only';
2
- import GT from 'generaltranslation';
3
- import SheetManager from './SheetManager';
4
- type I18NConfigurationParams = {
5
- apiKey?: string;
6
- projectID?: string;
7
- defaultLanguage?: string;
8
- cachedLanguage?: string;
9
- approvedLanguages?: string[];
10
- maxConcurrentRequests?: number;
11
- batchInterval?: number;
12
- baseURL?: string;
13
- cacheURL?: string;
14
- remoteSource?: boolean;
15
- defaultPage?: string;
16
- sheetFilepaths?: Record<string, string>;
17
- displayNotification?: boolean;
18
- [key: string]: any;
19
- };
20
- declare class I18NConfiguration {
21
- apiKey: string;
22
- projectID: string;
23
- defaultLanguage: string;
24
- cachedLanguage: string;
25
- approvedLanguages: string[] | undefined;
26
- cacheURL: string;
27
- baseURL: string;
28
- renderMethod: string;
29
- remoteSource: boolean;
30
- defaultPage: string;
31
- sheetFilepaths: Record<string, string>;
32
- displayNotification: boolean;
33
- gt: GT;
34
- metadata: Record<string, any>;
35
- sheetManager: SheetManager;
36
- maxConcurrentRequests: number;
37
- batchInterval: number;
38
- _queue: Array<any>;
39
- _activeRequests: number;
40
- constructor({ apiKey, projectID, defaultLanguage, cachedLanguage, approvedLanguages, maxConcurrentRequests, batchInterval, cacheURL, baseURL, renderMethod, // "hang", "subtle"
41
- remoteSource, defaultPage, sheetFilepaths, displayNotification, ...metadata }?: I18NConfigurationParams);
42
- /**
43
- * Returns true if notification should be displayed, false otherwise
44
- * @returns {boolean}
45
- */
46
- getDisplayNotification(): boolean;
47
- /**
48
- * Get the default language
49
- * @returns {string} A language code
50
- */
51
- getDefaultLanguage(): string;
52
- /**
53
- * Set the most recently used language, for use in variables
54
- * @returns A language code
55
- */
56
- setCachedLanguage(language: string): void;
57
- /**
58
- * Get the most recently used language
59
- * @returns A language code
60
- */
61
- getUserLanguage(): string;
62
- /**
63
- * Given a list of languages (usually part of the user request), find the most appropriate approved language
64
- * @returns the user's most appropriate language.
65
- */
66
- determineUserLanguage(languageList: string[] | string | undefined): string;
67
- /**
68
- * Check if translation is required based on the user language
69
- * @param userLanguage - The language set by the user
70
- * @returns True if translation is required, otherwise false
71
- */
72
- translationRequired(userLanguage: string): boolean;
73
- /**
74
- * Get the entry in the I18N page for the user language, if it exists
75
- * @param userLanguage - The language set by the user
76
- * @param key - Key in the dictionary. For strings, the original language version of that string. For React children, a hash.
77
- * @param page - User-defined page for better I18N page structure.
78
- * @returns A promise that resolves to the value in the I18N page.
79
- */
80
- getI18NSheet(userLanguage: string, page?: string): Promise<Record<string, any> | null>;
81
- /**
82
- * Get the entry in the I18N page for the user language, if it exists
83
- * @param userLanguage - The language set by the user
84
- * @param key - Key in the dictionary. For strings, the original language version of that string. For React children, a hash.
85
- * @param page - User-defined page for better I18N page structure.
86
- * @returns A promise that resolves to the value in the I18N page.
87
- */
88
- getI18NEntry(userLanguage: string, key: string, id?: string, page?: string): Promise<any | null>;
89
- /**
90
- * Translate content into language
91
- * @param params - Parameters for translation
92
- * @returns Translated string
93
- */
94
- intl(params: any): Promise<string>;
95
- /**
96
- * Translate the children components
97
- * @param params - Parameters for translation
98
- * @returns A promise that resolves when translation is complete
99
- */
100
- translateChildren(params: any): Promise<any>;
101
- /**
102
- * Send a batch request for React translation
103
- * @param batch - The batch of requests to be sent
104
- */
105
- private _sendBatchRequest;
106
- /**
107
- * Start the batching process with a set interval
108
- */
109
- private _startBatching;
110
- /**
111
- * Get the render method
112
- * @returns The current render method
113
- */
114
- getRenderMethod(): string;
115
- /**
116
- * @returns True if the library is using a remote dictionary (e.g. from www.generaltranslation.com), false otherwise.
117
- */
118
- hasRemoteSource(): boolean;
119
- }
120
- declare const I18NConfig: I18NConfiguration;
121
- export default I18NConfig;
122
- //# sourceMappingURL=I18NConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18NConfig.d.ts","sourceRoot":"","sources":["../../src/config/I18NConfig.ts"],"names":[],"mappings":"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"}