gt-react 2.0.209 → 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 (346) 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 +1 -3
  23. package/dist/I18N/resolvers/I18NResolver.d.ts.map +1 -0
  24. package/dist/{server → I18N}/resolvers/I18NResolver.js +3 -11
  25. package/dist/I18N/resolvers/I18NResolver.js.map +1 -0
  26. package/dist/client/ClientProvider.d.ts +4 -1
  27. package/dist/client/ClientProvider.d.ts.map +1 -1
  28. package/dist/client/ClientProvider.js +2 -2
  29. package/dist/client/ClientProvider.js.map +1 -1
  30. package/dist/client/GTProvider.d.ts +8 -3
  31. package/dist/client/GTProvider.d.ts.map +1 -1
  32. package/dist/client/GTProvider.js +31 -14
  33. package/dist/client/GTProvider.js.map +1 -1
  34. package/dist/client/createGTProviderComponent.d.ts +11 -0
  35. package/dist/client/createGTProviderComponent.d.ts.map +1 -0
  36. package/dist/client/createGTProviderComponent.js +30 -0
  37. package/dist/client/createGTProviderComponent.js.map +1 -0
  38. package/dist/client/hooks/useDefaultLocale.d.ts +5 -0
  39. package/dist/client/hooks/useDefaultLocale.d.ts.map +1 -0
  40. package/dist/client/hooks/useDefaultLocale.js +17 -0
  41. package/dist/client/hooks/useDefaultLocale.js.map +1 -0
  42. package/dist/client/hooks/useGT.d.ts +10 -0
  43. package/dist/client/hooks/useGT.d.ts.map +1 -0
  44. package/dist/client/hooks/useGT.js +28 -0
  45. package/dist/client/hooks/useGT.js.map +1 -0
  46. package/dist/client/hooks/useLocale.d.ts +5 -0
  47. package/dist/client/hooks/useLocale.d.ts.map +1 -0
  48. package/dist/client/hooks/useLocale.js +17 -0
  49. package/dist/client/hooks/useLocale.js.map +1 -0
  50. package/dist/{primitives/numeric/client → client/primitives/numeric}/ClientNumeric.d.ts +2 -2
  51. package/dist/{primitives/numeric/client → client/primitives/numeric}/ClientNumeric.d.ts.map +1 -1
  52. package/dist/{primitives/numeric/client → client/primitives/numeric}/ClientNumeric.js +9 -8
  53. package/dist/client/primitives/numeric/ClientNumeric.js.map +1 -0
  54. package/dist/{primitives/value/client → client/primitives/value}/ClientValue.d.ts +1 -1
  55. package/dist/{primitives/value/client → client/primitives/value}/ClientValue.d.ts.map +1 -1
  56. package/dist/{primitives/value/client → client/primitives/value}/ClientValue.js +3 -3
  57. package/dist/{primitives/value/client → client/primitives/value}/ClientValue.js.map +1 -1
  58. package/dist/{primitives/value/client → client/primitives/value}/RenderClientVariable.d.ts.map +1 -1
  59. package/dist/{primitives/value/client → client/primitives/value}/RenderClientVariable.js +35 -18
  60. package/dist/client/primitives/value/RenderClientVariable.js.map +1 -0
  61. package/dist/client/primitives/variables/ClientCurrencyVariable.d.ts.map +1 -0
  62. package/dist/{primitives/variable/currency → client/primitives/variables}/ClientCurrencyVariable.js +7 -4
  63. package/dist/client/primitives/variables/ClientCurrencyVariable.js.map +1 -0
  64. package/dist/client/primitives/variables/ClientDateVariable.d.ts.map +1 -0
  65. package/dist/{primitives/variable/date → client/primitives/variables}/ClientDateVariable.js +7 -4
  66. package/dist/client/primitives/variables/ClientDateVariable.js.map +1 -0
  67. package/dist/client/primitives/variables/ClientNumberVariable.d.ts.map +1 -0
  68. package/dist/{primitives/variable/number → client/primitives/variables}/ClientNumberVariable.js +7 -5
  69. package/dist/client/primitives/variables/ClientNumberVariable.js.map +1 -0
  70. package/dist/{primitives/variable/variable → client/primitives/variables}/ClientVariable.d.ts +2 -2
  71. package/dist/client/primitives/variables/ClientVariable.d.ts.map +1 -0
  72. package/dist/{primitives/variable/variable → client/primitives/variables}/ClientVariable.js +3 -3
  73. package/dist/client/primitives/variables/ClientVariable.js.map +1 -0
  74. package/dist/client.d.ts +10 -10
  75. package/dist/client.d.ts.map +1 -1
  76. package/dist/client.js +15 -15
  77. package/dist/client.js.map +1 -1
  78. package/dist/config/DictionaryManager.d.ts +16 -0
  79. package/dist/config/DictionaryManager.d.ts.map +1 -0
  80. package/dist/config/{SheetManager.js → DictionaryManager.js} +25 -23
  81. package/dist/config/DictionaryManager.js.map +1 -0
  82. package/dist/config/I18NConfiguration.d.ts +104 -0
  83. package/dist/config/I18NConfiguration.d.ts.map +1 -0
  84. package/dist/config/I18NConfiguration.js +277 -0
  85. package/dist/config/I18NConfiguration.js.map +1 -0
  86. package/dist/config/determineLocale.d.ts +2 -0
  87. package/dist/config/determineLocale.d.ts.map +1 -0
  88. package/dist/config/determineLocale.js +32 -0
  89. package/dist/config/determineLocale.js.map +1 -0
  90. package/dist/dictionary/createDictFunction.d.ts +3 -0
  91. package/dist/dictionary/createDictFunction.d.ts.map +1 -0
  92. package/dist/dictionary/createDictFunction.js +9 -0
  93. package/dist/dictionary/createDictFunction.js.map +1 -0
  94. package/dist/dictionary/createTFunction.d.ts +6 -0
  95. package/dist/dictionary/createTFunction.d.ts.map +1 -0
  96. package/dist/dictionary/createTFunction.js +11 -0
  97. package/dist/dictionary/createTFunction.js.map +1 -0
  98. package/dist/dictionary/getDictionaryEntry.d.ts +2 -0
  99. package/dist/dictionary/getDictionaryEntry.d.ts.map +1 -0
  100. package/dist/dictionary/getDictionaryEntry.js +14 -0
  101. package/dist/dictionary/getDictionaryEntry.js.map +1 -0
  102. package/dist/index.d.ts +39 -12
  103. package/dist/index.d.ts.map +1 -1
  104. package/dist/index.js +130 -23
  105. package/dist/index.js.map +1 -1
  106. package/dist/intl/createIntlFunction.d.ts +6 -0
  107. package/dist/intl/createIntlFunction.d.ts.map +1 -0
  108. package/dist/{dict/dict.js → intl/createIntlFunction.js} +15 -17
  109. package/dist/intl/createIntlFunction.js.map +1 -0
  110. package/dist/local/getDefaultFromEnv.d.ts.map +1 -0
  111. package/dist/local/getDefaultFromEnv.js.map +1 -0
  112. package/dist/middleware/createNextMiddleware.d.ts +3 -5
  113. package/dist/middleware/createNextMiddleware.d.ts.map +1 -1
  114. package/dist/middleware/createNextMiddleware.js +24 -28
  115. package/dist/middleware/createNextMiddleware.js.map +1 -1
  116. package/dist/next/requestFunctions.d.ts +2 -2
  117. package/dist/next/requestFunctions.d.ts.map +1 -1
  118. package/dist/next/requestFunctions.js +12 -12
  119. package/dist/next/requestFunctions.js.map +1 -1
  120. package/dist/next.d.ts +38 -13
  121. package/dist/next.d.ts.map +1 -1
  122. package/dist/next.js +58 -27
  123. package/dist/next.js.map +1 -1
  124. package/dist/primitives/helpers/defaultVariableNames.d.ts.map +1 -0
  125. package/dist/primitives/helpers/defaultVariableNames.js.map +1 -0
  126. package/dist/primitives/{numeric → helpers}/getNumericBranch.d.ts +1 -1
  127. package/dist/primitives/{numeric → helpers}/getNumericBranch.d.ts.map +1 -1
  128. package/dist/primitives/{numeric → helpers}/getNumericBranch.js +8 -8
  129. package/dist/primitives/helpers/getNumericBranch.js.map +1 -0
  130. package/dist/primitives/helpers/getValueBranch.d.ts.map +1 -0
  131. package/dist/primitives/helpers/getValueBranch.js.map +1 -0
  132. package/dist/primitives/helpers/isValidReactNode.d.ts.map +1 -0
  133. package/dist/primitives/helpers/isValidReactNode.js.map +1 -0
  134. package/dist/primitives/numeric/Numeric.d.ts +5 -7
  135. package/dist/primitives/numeric/Numeric.d.ts.map +1 -1
  136. package/dist/primitives/numeric/Numeric.js +10 -12
  137. package/dist/primitives/numeric/Numeric.js.map +1 -1
  138. package/dist/primitives/numeric/createNumericComponent.d.ts +8 -0
  139. package/dist/primitives/numeric/createNumericComponent.d.ts.map +1 -0
  140. package/dist/primitives/numeric/createNumericComponent.js +29 -0
  141. package/dist/primitives/numeric/createNumericComponent.js.map +1 -0
  142. package/dist/primitives/private/createPrivateComponent.d.ts +9 -0
  143. package/dist/primitives/private/createPrivateComponent.d.ts.map +1 -0
  144. package/dist/primitives/private/createPrivateComponent.js +11 -0
  145. package/dist/primitives/private/createPrivateComponent.js.map +1 -0
  146. package/dist/primitives/value/Value.d.ts +4 -2
  147. package/dist/primitives/value/Value.d.ts.map +1 -1
  148. package/dist/primitives/value/Value.js +5 -5
  149. package/dist/primitives/value/Value.js.map +1 -1
  150. package/dist/primitives/value/createValueComponent.d.ts +8 -0
  151. package/dist/primitives/value/createValueComponent.d.ts.map +1 -0
  152. package/dist/primitives/value/createValueComponent.js +29 -0
  153. package/dist/primitives/value/createValueComponent.js.map +1 -0
  154. package/dist/primitives/value/renderVariable.d.ts +2 -1
  155. package/dist/primitives/value/renderVariable.d.ts.map +1 -1
  156. package/dist/primitives/value/renderVariable.js +19 -17
  157. package/dist/primitives/value/renderVariable.js.map +1 -1
  158. package/dist/primitives/{variable/currency → variables/CurrencyVariable}/CurrencyVariable.d.ts +4 -3
  159. package/dist/primitives/variables/CurrencyVariable/CurrencyVariable.d.ts.map +1 -0
  160. package/dist/primitives/{variable/currency → variables/CurrencyVariable}/CurrencyVariable.js +4 -11
  161. package/dist/primitives/variables/CurrencyVariable/CurrencyVariable.js.map +1 -0
  162. package/dist/primitives/variables/CurrencyVariable/createCurrencyVariableComponent.d.ts +8 -0
  163. package/dist/primitives/variables/CurrencyVariable/createCurrencyVariableComponent.d.ts.map +1 -0
  164. package/dist/primitives/variables/CurrencyVariable/createCurrencyVariableComponent.js +29 -0
  165. package/dist/primitives/variables/CurrencyVariable/createCurrencyVariableComponent.js.map +1 -0
  166. package/dist/primitives/{variable/date → variables/DateVariable}/DateVariable.d.ts +4 -3
  167. package/dist/primitives/variables/DateVariable/DateVariable.d.ts.map +1 -0
  168. package/dist/primitives/{variable/date → variables/DateVariable}/DateVariable.js +4 -11
  169. package/dist/primitives/variables/DateVariable/DateVariable.js.map +1 -0
  170. package/dist/primitives/variables/DateVariable/createDateVariableComponent.d.ts +8 -0
  171. package/dist/primitives/variables/DateVariable/createDateVariableComponent.d.ts.map +1 -0
  172. package/dist/primitives/variables/DateVariable/createDateVariableComponent.js +29 -0
  173. package/dist/primitives/variables/DateVariable/createDateVariableComponent.js.map +1 -0
  174. package/dist/primitives/{variable/number → variables/NumberVariable}/NumberVariable.d.ts +5 -4
  175. package/dist/primitives/variables/NumberVariable/NumberVariable.d.ts.map +1 -0
  176. package/dist/primitives/{variable/number → variables/NumberVariable}/NumberVariable.js +5 -12
  177. package/dist/primitives/variables/NumberVariable/NumberVariable.js.map +1 -0
  178. package/dist/primitives/variables/NumberVariable/createNumberVariableComponent.d.ts +8 -0
  179. package/dist/primitives/variables/NumberVariable/createNumberVariableComponent.d.ts.map +1 -0
  180. package/dist/primitives/variables/NumberVariable/createNumberVariableComponent.js +30 -0
  181. package/dist/primitives/variables/NumberVariable/createNumberVariableComponent.js.map +1 -0
  182. package/dist/primitives/{variable/variable → variables/Variable}/Variable.d.ts +1 -1
  183. package/dist/primitives/variables/Variable/Variable.d.ts.map +1 -0
  184. package/dist/primitives/{variable/variable → variables/Variable}/Variable.js +2 -2
  185. package/dist/primitives/variables/Variable/Variable.js.map +1 -0
  186. package/dist/primitives/variables/Variable/createVariableComponent.d.ts +7 -0
  187. package/dist/primitives/variables/Variable/createVariableComponent.d.ts.map +1 -0
  188. package/dist/primitives/variables/Variable/createVariableComponent.js +29 -0
  189. package/dist/primitives/variables/Variable/createVariableComponent.js.map +1 -0
  190. package/dist/types/CreateGTProps.d.ts +17 -0
  191. package/dist/types/CreateGTProps.d.ts.map +1 -0
  192. package/dist/types/CreateGTProps.js +3 -0
  193. package/dist/types/CreateGTProps.js.map +1 -0
  194. package/dist/types/CreateI18NConfigProps.d.ts +2 -0
  195. package/dist/types/CreateI18NConfigProps.d.ts.map +1 -0
  196. package/dist/types/CreateI18NConfigProps.js +4 -0
  197. package/dist/types/CreateI18NConfigProps.js.map +1 -0
  198. package/dist/types/GTInterface.d.ts +29 -0
  199. package/dist/types/GTInterface.d.ts.map +1 -0
  200. package/dist/types/GTInterface.js +3 -0
  201. package/dist/types/GTInterface.js.map +1 -0
  202. package/dist/types/GeneralTranslationInterface.d.ts +179 -0
  203. package/dist/types/GeneralTranslationInterface.d.ts.map +1 -0
  204. package/dist/types/GeneralTranslationInterface.js +3 -0
  205. package/dist/types/GeneralTranslationInterface.js.map +1 -0
  206. package/dist/types/VariableInterface.d.ts +100 -0
  207. package/dist/types/VariableInterface.d.ts.map +1 -0
  208. package/dist/types/VariableInterface.js +3 -0
  209. package/dist/types/VariableInterface.js.map +1 -0
  210. package/package.json +2 -2
  211. package/tsconfig.json +2 -0
  212. package/dist/client/useDefaultLanguage.d.ts +0 -2
  213. package/dist/client/useDefaultLanguage.d.ts.map +0 -1
  214. package/dist/client/useDefaultLanguage.js +0 -14
  215. package/dist/client/useDefaultLanguage.js.map +0 -1
  216. package/dist/client/useGT.d.ts +0 -2
  217. package/dist/client/useGT.d.ts.map +0 -1
  218. package/dist/client/useGT.js +0 -14
  219. package/dist/client/useGT.js.map +0 -1
  220. package/dist/client/useUserLanguage.d.ts +0 -2
  221. package/dist/client/useUserLanguage.d.ts.map +0 -1
  222. package/dist/client/useUserLanguage.js +0 -14
  223. package/dist/client/useUserLanguage.js.map +0 -1
  224. package/dist/config/I18NConfig.d.ts +0 -122
  225. package/dist/config/I18NConfig.d.ts.map +0 -1
  226. package/dist/config/I18NConfig.js +0 -279
  227. package/dist/config/I18NConfig.js.map +0 -1
  228. package/dist/config/SheetManager.d.ts +0 -16
  229. package/dist/config/SheetManager.d.ts.map +0 -1
  230. package/dist/config/SheetManager.js.map +0 -1
  231. package/dist/config/local/getConfigData.d.ts +0 -8
  232. package/dist/config/local/getConfigData.d.ts.map +0 -1
  233. package/dist/config/local/getConfigData.js +0 -29
  234. package/dist/config/local/getConfigData.js.map +0 -1
  235. package/dist/config/local/getDefaultFromEnv.d.ts.map +0 -1
  236. package/dist/config/local/getDefaultFromEnv.js.map +0 -1
  237. package/dist/config/local/getLocalI18NSheet.d.ts +0 -10
  238. package/dist/config/local/getLocalI18NSheet.d.ts.map +0 -1
  239. package/dist/config/local/getLocalI18NSheet.js +0 -34
  240. package/dist/config/local/getLocalI18NSheet.js.map +0 -1
  241. package/dist/config/local/readLocalFile.d.ts +0 -8
  242. package/dist/config/local/readLocalFile.d.ts.map +0 -1
  243. package/dist/config/local/readLocalFile.js +0 -54
  244. package/dist/config/local/readLocalFile.js.map +0 -1
  245. package/dist/config/placeholderCache.d.ts +0 -8
  246. package/dist/config/placeholderCache.d.ts.map +0 -1
  247. package/dist/config/placeholderCache.js +0 -71
  248. package/dist/config/placeholderCache.js.map +0 -1
  249. package/dist/dict/dict.d.ts +0 -6
  250. package/dist/dict/dict.d.ts.map +0 -1
  251. package/dist/dict/dict.js.map +0 -1
  252. package/dist/intl/intl.d.ts +0 -14
  253. package/dist/intl/intl.d.ts.map +0 -1
  254. package/dist/intl/intl.js +0 -43
  255. package/dist/intl/intl.js.map +0 -1
  256. package/dist/loading/LoadingNotification.d.ts +0 -4
  257. package/dist/loading/LoadingNotification.d.ts.map +0 -1
  258. package/dist/loading/LoadingNotification.js +0 -38
  259. package/dist/loading/LoadingNotification.js.map +0 -1
  260. package/dist/next/NextGTProvider.d.ts +0 -15
  261. package/dist/next/NextGTProvider.d.ts.map +0 -1
  262. package/dist/next/NextGTProvider.js +0 -48
  263. package/dist/next/NextGTProvider.js.map +0 -1
  264. package/dist/next/NextI18N.d.ts +0 -15
  265. package/dist/next/NextI18N.d.ts.map +0 -1
  266. package/dist/next/NextI18N.js +0 -48
  267. package/dist/next/NextI18N.js.map +0 -1
  268. package/dist/next/getUserLanguage.d.ts +0 -6
  269. package/dist/next/getUserLanguage.d.ts.map +0 -1
  270. package/dist/next/getUserLanguage.js +0 -18
  271. package/dist/next/getUserLanguage.js.map +0 -1
  272. package/dist/next/nextDict.d.ts +0 -6
  273. package/dist/next/nextDict.d.ts.map +0 -1
  274. package/dist/next/nextDict.js +0 -41
  275. package/dist/next/nextDict.js.map +0 -1
  276. package/dist/next/nextIntl.d.ts +0 -8
  277. package/dist/next/nextIntl.d.ts.map +0 -1
  278. package/dist/next/nextIntl.js +0 -30
  279. package/dist/next/nextIntl.js.map +0 -1
  280. package/dist/primitives/numeric/client/ClientNumeric.js.map +0 -1
  281. package/dist/primitives/numeric/getNumericBranch.js.map +0 -1
  282. package/dist/primitives/value/client/RenderClientVariable.js.map +0 -1
  283. package/dist/primitives/value/getValueBranch.d.ts.map +0 -1
  284. package/dist/primitives/value/getValueBranch.js.map +0 -1
  285. package/dist/primitives/value/isValidReactNode.d.ts.map +0 -1
  286. package/dist/primitives/value/isValidReactNode.js.map +0 -1
  287. package/dist/primitives/variable/currency/ClientCurrencyVariable.d.ts.map +0 -1
  288. package/dist/primitives/variable/currency/ClientCurrencyVariable.js.map +0 -1
  289. package/dist/primitives/variable/currency/CurrencyVariable.d.ts.map +0 -1
  290. package/dist/primitives/variable/currency/CurrencyVariable.js.map +0 -1
  291. package/dist/primitives/variable/date/ClientDateVariable.d.ts.map +0 -1
  292. package/dist/primitives/variable/date/ClientDateVariable.js.map +0 -1
  293. package/dist/primitives/variable/date/DateVariable.d.ts.map +0 -1
  294. package/dist/primitives/variable/date/DateVariable.js.map +0 -1
  295. package/dist/primitives/variable/defaultVariableNames.d.ts.map +0 -1
  296. package/dist/primitives/variable/defaultVariableNames.js.map +0 -1
  297. package/dist/primitives/variable/number/ClientNumberVariable.d.ts.map +0 -1
  298. package/dist/primitives/variable/number/ClientNumberVariable.js.map +0 -1
  299. package/dist/primitives/variable/number/NumberVariable.d.ts.map +0 -1
  300. package/dist/primitives/variable/number/NumberVariable.js.map +0 -1
  301. package/dist/primitives/variable/variable/ClientVariable.d.ts.map +0 -1
  302. package/dist/primitives/variable/variable/ClientVariable.js.map +0 -1
  303. package/dist/primitives/variable/variable/Variable.d.ts.map +0 -1
  304. package/dist/primitives/variable/variable/Variable.js.map +0 -1
  305. package/dist/server/ServerI18N.d.ts +0 -18
  306. package/dist/server/ServerI18N.d.ts.map +0 -1
  307. package/dist/server/ServerI18N.js.map +0 -1
  308. package/dist/server/getDefaultLanguage.d.ts +0 -5
  309. package/dist/server/getDefaultLanguage.d.ts.map +0 -1
  310. package/dist/server/getDefaultLanguage.js +0 -14
  311. package/dist/server/getDefaultLanguage.js.map +0 -1
  312. package/dist/server/helpers/addGTIdentifier.d.ts.map +0 -1
  313. package/dist/server/helpers/addGTIdentifier.js.map +0 -1
  314. package/dist/server/helpers/generateHash.d.ts.map +0 -1
  315. package/dist/server/helpers/generateHash.js.map +0 -1
  316. package/dist/server/helpers/writeChildrenAsObjects.d.ts.map +0 -1
  317. package/dist/server/helpers/writeChildrenAsObjects.js.map +0 -1
  318. package/dist/server/renderChildren.d.ts.map +0 -1
  319. package/dist/server/renderChildren.js.map +0 -1
  320. package/dist/server/resolvers/I18NResolver.d.ts.map +0 -1
  321. package/dist/server/resolvers/I18NResolver.js.map +0 -1
  322. package/dist/server/resolvers/loading/Loader.d.ts +0 -8
  323. package/dist/server/resolvers/loading/Loader.d.ts.map +0 -1
  324. package/dist/server/resolvers/loading/Loader.js +0 -38
  325. package/dist/server/resolvers/loading/Loader.js.map +0 -1
  326. package/dist/server/resolvers/loading/LoadingNotification.d.ts +0 -5
  327. package/dist/server/resolvers/loading/LoadingNotification.d.ts.map +0 -1
  328. package/dist/server/resolvers/loading/LoadingNotification.js +0 -319
  329. package/dist/server/resolvers/loading/LoadingNotification.js.map +0 -1
  330. package/scratchpad.js +0 -33
  331. /package/dist/{server → I18N}/helpers/generateHash.d.ts +0 -0
  332. /package/dist/{server → I18N}/helpers/generateHash.js +0 -0
  333. /package/dist/{server → I18N}/helpers/writeChildrenAsObjects.d.ts +0 -0
  334. /package/dist/{server → I18N}/renderChildren.d.ts +0 -0
  335. /package/dist/{primitives/value/client → client/primitives/value}/RenderClientVariable.d.ts +0 -0
  336. /package/dist/{primitives/variable/currency → client/primitives/variables}/ClientCurrencyVariable.d.ts +0 -0
  337. /package/dist/{primitives/variable/date → client/primitives/variables}/ClientDateVariable.d.ts +0 -0
  338. /package/dist/{primitives/variable/number → client/primitives/variables}/ClientNumberVariable.d.ts +0 -0
  339. /package/dist/{config/local → local}/getDefaultFromEnv.d.ts +0 -0
  340. /package/dist/{config/local → local}/getDefaultFromEnv.js +0 -0
  341. /package/dist/primitives/{variable → helpers}/defaultVariableNames.d.ts +0 -0
  342. /package/dist/primitives/{variable → helpers}/defaultVariableNames.js +0 -0
  343. /package/dist/primitives/{value → helpers}/getValueBranch.d.ts +0 -0
  344. /package/dist/primitives/{value → helpers}/getValueBranch.js +0 -0
  345. /package/dist/primitives/{value → helpers}/isValidReactNode.d.ts +0 -0
  346. /package/dist/primitives/{value → helpers}/isValidReactNode.js +0 -0
@@ -1,279 +0,0 @@
1
- "use strict";
2
- // I18NConfig.ts
3
- // © General Translation, Inc. (2024)
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- var desc = Object.getOwnPropertyDescriptor(m, k);
7
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
- desc = { enumerable: true, get: function() { return m[k]; } };
9
- }
10
- Object.defineProperty(o, k2, desc);
11
- }) : (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- o[k2] = m[k];
14
- }));
15
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
- Object.defineProperty(o, "default", { enumerable: true, value: v });
17
- }) : function(o, v) {
18
- o["default"] = v;
19
- });
20
- var __importStar = (this && this.__importStar) || function (mod) {
21
- if (mod && mod.__esModule) return mod;
22
- var result = {};
23
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
- __setModuleDefault(result, mod);
25
- return result;
26
- };
27
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
28
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29
- return new (P || (P = Promise))(function (resolve, reject) {
30
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
31
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
32
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
33
- step((generator = generator.apply(thisArg, _arguments || [])).next());
34
- });
35
- };
36
- var __rest = (this && this.__rest) || function (s, e) {
37
- var t = {};
38
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
39
- t[p] = s[p];
40
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
41
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
42
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
43
- t[p[i]] = s[p[i]];
44
- }
45
- return t;
46
- };
47
- var __importDefault = (this && this.__importDefault) || function (mod) {
48
- return (mod && mod.__esModule) ? mod : { "default": mod };
49
- };
50
- Object.defineProperty(exports, "__esModule", { value: true });
51
- require("server-only");
52
- const generaltranslation_1 = __importStar(require("generaltranslation"));
53
- const getDefaultFromEnv_1 = __importDefault(require("./local/getDefaultFromEnv"));
54
- const getConfigData_1 = __importDefault(require("./local/getConfigData"));
55
- const placeholderCache_1 = __importDefault(require("./placeholderCache")); // replace with import { cache } from 'react' when it is released
56
- const getLocalI18NSheet_1 = __importDefault(require("./local/getLocalI18NSheet"));
57
- const SheetManager_1 = __importDefault(require("./SheetManager"));
58
- // Caching the I18N pages fetched locally
59
- const getI18NSheetFromFile = (0, placeholderCache_1.default)(getLocalI18NSheet_1.default);
60
- // Resolve errors in the batch request
61
- const resolveBatchError = (item) => {
62
- if (item.type === "react")
63
- return item.resolve(item.data.children);
64
- if (item.type === "intl")
65
- return item.resolve(item.data.content);
66
- return item.resolve("");
67
- };
68
- class I18NConfiguration {
69
- constructor(_a = {}) {
70
- var { apiKey = (0, getDefaultFromEnv_1.default)('GT_API_KEY'), projectID = (0, getDefaultFromEnv_1.default)('GT_PROJECT_ID'), defaultLanguage = 'en', cachedLanguage = defaultLanguage, approvedLanguages, maxConcurrentRequests = 2, batchInterval = 1000, cacheURL = "https://cache.gtx.dev", baseURL = "https://prod.gtx.dev", renderMethod = "replace", // "hang", "subtle"
71
- remoteSource = true, defaultPage = "", sheetFilepaths = {}, displayNotification = true } = _a, metadata = __rest(_a, ["apiKey", "projectID", "defaultLanguage", "cachedLanguage", "approvedLanguages", "maxConcurrentRequests", "batchInterval", "cacheURL", "baseURL", "renderMethod", "remoteSource", "defaultPage", "sheetFilepaths", "displayNotification"]);
72
- // User-settable
73
- this.apiKey = apiKey;
74
- this.projectID = projectID;
75
- this.defaultLanguage = defaultLanguage;
76
- this.cachedLanguage = cachedLanguage;
77
- this.approvedLanguages = approvedLanguages;
78
- this.cacheURL = cacheURL;
79
- this.baseURL = baseURL;
80
- this.renderMethod = renderMethod;
81
- this.remoteSource = remoteSource;
82
- this.defaultPage = (0, getDefaultFromEnv_1.default)('GT_DEFAULT_PAGE') || defaultPage;
83
- this.sheetFilepaths = sheetFilepaths;
84
- this.displayNotification = displayNotification;
85
- this.gt = new generaltranslation_1.default({ projectID: this.projectID, apiKey: this.apiKey, defaultLanguage: this.defaultLanguage, baseURL: this.baseURL });
86
- this.metadata = Object.assign({ projectID: this.projectID, defaultLanguage: this.defaultLanguage }, metadata);
87
- if (this.defaultPage)
88
- this.metadata.page = this.defaultPage;
89
- // Sheet manager
90
- this.sheetManager = new SheetManager_1.default({
91
- cacheURL: this.cacheURL,
92
- projectID: this.projectID
93
- });
94
- // Batching
95
- this.maxConcurrentRequests = maxConcurrentRequests;
96
- this.batchInterval = batchInterval;
97
- this._queue = [];
98
- this._activeRequests = 0;
99
- this._startBatching();
100
- }
101
- /**
102
- * Returns true if notification should be displayed, false otherwise
103
- * @returns {boolean}
104
- */
105
- getDisplayNotification() {
106
- return this.displayNotification;
107
- }
108
- /**
109
- * Get the default language
110
- * @returns {string} A language code
111
- */
112
- getDefaultLanguage() {
113
- return this.defaultLanguage;
114
- }
115
- /**
116
- * Set the most recently used language, for use in variables
117
- * @returns A language code
118
- */
119
- setCachedLanguage(language) {
120
- this.cachedLanguage = language;
121
- }
122
- /**
123
- * Get the most recently used language
124
- * @returns A language code
125
- */
126
- getUserLanguage() {
127
- return this.cachedLanguage || this.defaultLanguage;
128
- }
129
- /**
130
- * Given a list of languages (usually part of the user request), find the most appropriate approved language
131
- * @returns the user's most appropriate language.
132
- */
133
- determineUserLanguage(languageList) {
134
- if (!languageList)
135
- return this.defaultLanguage;
136
- if (typeof languageList === 'string')
137
- languageList = [languageList];
138
- if (!this.approvedLanguages)
139
- return languageList[0];
140
- for (const language of languageList) {
141
- for (const approvedLanguage of this.approvedLanguages) {
142
- if ((0, generaltranslation_1.isSameLanguage)(language, approvedLanguage)) {
143
- return approvedLanguage;
144
- }
145
- }
146
- }
147
- return this.defaultLanguage;
148
- }
149
- /**
150
- * Check if translation is required based on the user language
151
- * @param userLanguage - The language set by the user
152
- * @returns True if translation is required, otherwise false
153
- */
154
- translationRequired(userLanguage) {
155
- if (!this.projectID || !userLanguage)
156
- return false;
157
- if (this.approvedLanguages && !this.approvedLanguages.some(approvedLanguage => (0, generaltranslation_1.getLanguageName)(userLanguage) === (0, generaltranslation_1.getLanguageName)(approvedLanguage)))
158
- return false;
159
- if ((0, generaltranslation_1.getLanguageName)(userLanguage) === (0, generaltranslation_1.getLanguageName)(this.defaultLanguage))
160
- return false;
161
- return true;
162
- }
163
- /**
164
- * Get the entry in the I18N page for the user language, if it exists
165
- * @param userLanguage - The language set by the user
166
- * @param key - Key in the dictionary. For strings, the original language version of that string. For React children, a hash.
167
- * @param page - User-defined page for better I18N page structure.
168
- * @returns A promise that resolves to the value in the I18N page.
169
- */
170
- getI18NSheet(userLanguage_1) {
171
- return __awaiter(this, arguments, void 0, function* (userLanguage, page = this.defaultPage || "default") {
172
- if (this.sheetFilepaths[userLanguage]) {
173
- const filepath = typeof this.sheetFilepaths[userLanguage] === 'object' ? this.sheetFilepaths[userLanguage][page] : this.sheetFilepaths[userLanguage];
174
- return yield getI18NSheetFromFile(filepath);
175
- }
176
- if (this.remoteSource) {
177
- return yield this.sheetManager.getI18NSheet(userLanguage, page);
178
- }
179
- return null;
180
- });
181
- }
182
- /**
183
- * Get the entry in the I18N page for the user language, if it exists
184
- * @param userLanguage - The language set by the user
185
- * @param key - Key in the dictionary. For strings, the original language version of that string. For React children, a hash.
186
- * @param page - User-defined page for better I18N page structure.
187
- * @returns A promise that resolves to the value in the I18N page.
188
- */
189
- getI18NEntry(userLanguage_1, key_1) {
190
- return __awaiter(this, arguments, void 0, function* (userLanguage, key, id = key, page = this.defaultPage || "default") {
191
- const I18NSheet = yield this.getI18NSheet(userLanguage, page);
192
- if (I18NSheet && I18NSheet[id] && I18NSheet[id].k === key)
193
- return I18NSheet[id].t;
194
- return null;
195
- });
196
- }
197
- /**
198
- * Translate content into language
199
- * @param params - Parameters for translation
200
- * @returns Translated string
201
- */
202
- intl(params) {
203
- return __awaiter(this, void 0, void 0, function* () {
204
- return new Promise((resolve, reject) => {
205
- this._queue.push({ type: "intl", data: { content: params.content, targetLanguage: params.targetLanguage, projectID: this.projectID, metadata: Object.assign(Object.assign({}, params.metadata), this.metadata) }, resolve, reject });
206
- });
207
- });
208
- }
209
- /**
210
- * Translate the children components
211
- * @param params - Parameters for translation
212
- * @returns A promise that resolves when translation is complete
213
- */
214
- translateChildren(params) {
215
- return __awaiter(this, void 0, void 0, function* () {
216
- return new Promise((resolve, reject) => {
217
- this._queue.push({ type: "react", data: { children: params.children, targetLanguage: params.targetLanguage, metadata: Object.assign(Object.assign({}, params.metadata), this.metadata) }, resolve, reject });
218
- });
219
- });
220
- }
221
- /**
222
- * Send a batch request for React translation
223
- * @param batch - The batch of requests to be sent
224
- */
225
- _sendBatchRequest(batch) {
226
- return __awaiter(this, void 0, void 0, function* () {
227
- this._activeRequests++;
228
- try {
229
- const results = yield this.gt.bundleRequests(batch);
230
- batch.forEach((item, index) => {
231
- const result = results[index];
232
- if (!result || result.error)
233
- return resolveBatchError(item);
234
- if (result && typeof result === 'object') {
235
- item.resolve(result.translation);
236
- if (result.translation && result.language && result.reference) {
237
- this.sheetManager.setSheet(result.language, result.reference.page, result.reference.key, result.reference.id, result.translation);
238
- }
239
- }
240
- });
241
- }
242
- catch (error) {
243
- console.error(error);
244
- batch.forEach(resolveBatchError);
245
- }
246
- finally {
247
- this._activeRequests--;
248
- }
249
- });
250
- }
251
- /**
252
- * Start the batching process with a set interval
253
- */
254
- _startBatching() {
255
- setInterval(() => {
256
- if (this._queue.length > 0 && this._activeRequests < this.maxConcurrentRequests) {
257
- this._sendBatchRequest(this._queue);
258
- this._queue = [];
259
- }
260
- }, this.batchInterval);
261
- }
262
- /**
263
- * Get the render method
264
- * @returns The current render method
265
- */
266
- getRenderMethod() {
267
- return this.renderMethod;
268
- }
269
- /**
270
- * @returns True if the library is using a remote dictionary (e.g. from www.generaltranslation.com), false otherwise.
271
- */
272
- hasRemoteSource() {
273
- return this.remoteSource;
274
- }
275
- }
276
- // ----- EXPORTING A GLOBAL I18NCONFIGURATION INSTANCE ---- //
277
- const I18NConfig = new I18NConfiguration((0, getConfigData_1.default)());
278
- exports.default = I18NConfig;
279
- //# sourceMappingURL=I18NConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18NConfig.js","sourceRoot":"","sources":["../../src/config/I18NConfig.ts"],"names":[],"mappings":";AAAA,gBAAgB;AAChB,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErC,uBAAoB;AAEpB,yEAAyE;AAEzE,kFAA0D;AAC1D,0EAAkD;AAElD,0EAAuC,CAAC,iEAAiE;AACzG,kFAA0D;AAC1D,kEAA0C;AAE1C,yCAAyC;AACzC,MAAM,oBAAoB,GAAG,IAAA,0BAAK,EAAC,2BAAiB,CAAC,CAAC;AAEtD,sCAAsC;AACtC,MAAM,iBAAiB,GAAG,CAAC,IAAS,EAAE,EAAE;IACpC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnE,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChE,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC,CAAA;AAqBD,MAAM,iBAAiB;IAqBnB,YAAY,KAgBiB,EAAE;YAhBnB,EACR,MAAM,GAAG,IAAA,2BAAiB,EAAC,YAAY,CAAC,EACxC,SAAS,GAAG,IAAA,2BAAiB,EAAC,eAAe,CAAC,EAC9C,eAAe,GAAG,IAAI,EACtB,cAAc,GAAG,eAAe,EAChC,iBAAiB,EACjB,qBAAqB,GAAG,CAAC,EACzB,aAAa,GAAG,IAAI,EACpB,QAAQ,GAAG,uBAAuB,EAClC,OAAO,GAAG,sBAAsB,E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,IAAI,CAAC,MAAM,CAAC,CAAC;gBACpC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;YACrB,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3B,CAAC;IAED;;;MAGE;IACF,eAAe;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;MAEE;IACF,eAAe;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;CACJ;AAED,+DAA+D;AAE/D,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,IAAA,uBAAa,GAAE,CAAC,CAAC;AAE1D,kBAAe,UAAU,CAAC"}
@@ -1,16 +0,0 @@
1
- type SheetManagerParams = {
2
- cacheURL?: string;
3
- projectID: string;
4
- };
5
- export default class SheetManager {
6
- cacheURL: string;
7
- projectID: string;
8
- private pageMap;
9
- private fetchPromises;
10
- constructor({ cacheURL, projectID }: SheetManagerParams);
11
- _fetchI18NSheet(reference: string): Promise<Record<string, any> | null>;
12
- getI18NSheet(userLanguage: string, page: string): Promise<Record<string, any> | null>;
13
- setSheet(userLanguage: string, page: string, key: string, id: string | undefined, translation: any): void;
14
- }
15
- export {};
16
- //# sourceMappingURL=SheetManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SheetManager.d.ts","sourceRoot":"","sources":["../../src/config/SheetManager.ts"],"names":[],"mappings":"AAIA,KAAK,kBAAkB,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAE7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,aAAa,CAAmD;gBAE5D,EACR,QAAkC,EAClC,SAAS,EACZ,EAAE,kBAAkB;IAOf,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAA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AS,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,kCAAO,WAAW,KAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,IAAE,CAAC;IACrF,CAAC;CACJ;AA1DD,+BA0DC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Retrieves the configuration data from a specified file.
3
- * The file path is determined by an environment variable, defaulting to 'gt_config.json'.
4
- *
5
- * @returns {Record<string, any>} The configuration data as an object.
6
- */
7
- export default function getConfigData(): Record<string, any>;
8
- //# sourceMappingURL=getConfigData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getConfigData.d.ts","sourceRoot":"","sources":["../../../src/config/local/getConfigData.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAW3D"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = getConfigData;
7
- const getDefaultFromEnv_1 = __importDefault(require("./getDefaultFromEnv"));
8
- const fs_1 = __importDefault(require("fs"));
9
- const path_1 = __importDefault(require("path"));
10
- /**
11
- * Retrieves the configuration data from a specified file.
12
- * The file path is determined by an environment variable, defaulting to 'gt_config.json'.
13
- *
14
- * @returns {Record<string, any>} The configuration data as an object.
15
- */
16
- function getConfigData() {
17
- const filename = (0, getDefaultFromEnv_1.default)("GT_CONFIG_FILEPATH") || 'gt_config.json';
18
- const filepath = path_1.default.resolve(process.cwd(), filename);
19
- let data = {};
20
- try {
21
- const file = fs_1.default.readFileSync(filepath, 'utf-8');
22
- data = JSON.parse(file);
23
- return data;
24
- }
25
- catch (error) {
26
- return data;
27
- }
28
- }
29
- //# sourceMappingURL=getConfigData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getConfigData.js","sourceRoot":"","sources":["../../../src/config/local/getConfigData.ts"],"names":[],"mappings":";;;;;AAUA,gCAWC;AArBD,4EAAoD;AACpD,4CAAoB;AACpB,gDAAwB;AAExB;;;;;GAKG;AACH,SAAwB,aAAa;IACjC,MAAM,QAAQ,GAAW,IAAA,2BAAiB,EAAC,oBAAoB,CAAC,IAAI,gBAAgB,CAAC;IACrF,MAAM,QAAQ,GAAW,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC/D,IAAI,IAAI,GAAwB,EAAE,CAAC;IACnC,IAAI,CAAC;QACD,MAAM,IAAI,GAAW,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDefaultFromEnv.d.ts","sourceRoot":"","sources":["../../../src/config/local/getDefaultFromEnv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDefaultFromEnv.js","sourceRoot":"","sources":["../../../src/config/local/getDefaultFromEnv.ts"],"names":[],"mappings":";;AAUA,oCAKC;AAfD;;;;;;;;;GASG;AACH,SAAwB,iBAAiB,CAAC,QAAgB;;IACtD,IAAI,OAAO,OAAO,KAAK,WAAW,KAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,0CAAG,QAAQ,CAAC,CAAA,EAAE,CAAC;QAC7D,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAW,CAAC;IAC3C,CAAC;IACD,OAAO,EAAE,CAAC;AACd,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Reads and parses a JSON file located at the specified filepath.
3
- * If the file does not exist or an error occurs during reading/parsing,
4
- * the function logs the error and returns null.
5
- *
6
- * @param {string} filepath - The path to the JSON file.
7
- * @returns {Promise<object>} - The parsed JSON object or null if an error occurs.
8
- */
9
- export default function getLocalI18NSheet(filepath: string): Promise<any>;
10
- //# sourceMappingURL=getLocalI18NSheet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getLocalI18NSheet.d.ts","sourceRoot":"","sources":["../../../src/config/local/getLocalI18NSheet.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAA8B,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAQ9E"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.default = getLocalI18NSheet;
13
- const fs_1 = require("fs");
14
- /**
15
- * Reads and parses a JSON file located at the specified filepath.
16
- * If the file does not exist or an error occurs during reading/parsing,
17
- * the function logs the error and returns null.
18
- *
19
- * @param {string} filepath - The path to the JSON file.
20
- * @returns {Promise<object>} - The parsed JSON object or null if an error occurs.
21
- */
22
- function getLocalI18NSheet(filepath) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const file = yield fs_1.promises.readFile(filepath, 'utf-8');
26
- return JSON.parse(file) || {};
27
- }
28
- catch (error) {
29
- console.error(error);
30
- return null;
31
- }
32
- });
33
- }
34
- //# sourceMappingURL=getLocalI18NSheet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getLocalI18NSheet.js","sourceRoot":"","sources":["../../../src/config/local/getLocalI18NSheet.ts"],"names":[],"mappings":";;;;;;;;;;;AAUA,oCAQC;AAlBD,2BAA8B;AAE9B;;;;;;;GAOG;AACH,SAA8B,iBAAiB,CAAC,QAAgB;;QAC5D,IAAI,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,aAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;CAAA"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Load a local file with dynamic imports
3
- *
4
- * @param {string} filename - The name of the file to load.
5
- * @returns {Promise<Record<string, any>>} The configuration data as an object.
6
- */
7
- export default function loadLocalFile(filename: string): Promise<Record<string, any>>;
8
- //# sourceMappingURL=readLocalFile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readLocalFile.d.ts","sourceRoot":"","sources":["../../../src/config/local/readLocalFile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAA8B,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAQ1F"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.default = loadLocalFile;
36
- /**
37
- * Load a local file with dynamic imports
38
- *
39
- * @param {string} filename - The name of the file to load.
40
- * @returns {Promise<Record<string, any>>} The configuration data as an object.
41
- */
42
- function loadLocalFile(filename) {
43
- return __awaiter(this, void 0, void 0, function* () {
44
- try {
45
- const module = yield Promise.resolve(`${`./${filename}`}`).then(s => __importStar(require(s)));
46
- return module.default || module;
47
- }
48
- catch (error) {
49
- console.error('Error loading file:', error);
50
- return {};
51
- }
52
- });
53
- }
54
- //# sourceMappingURL=readLocalFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readLocalFile.js","sourceRoot":"","sources":["../../../src/config/local/readLocalFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,gCAQC;AAdD;;;;;GAKG;AACH,SAA8B,aAAa,CAAC,QAAgB;;QACxD,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,yBAAa,KAAK,QAAQ,EAAE,uCAAC,CAAC;YAC7C,OAAO,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;YAC5C,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;CAAA"}
@@ -1,8 +0,0 @@
1
- type CachedFunction<T extends (...args: any[]) => any> = {
2
- (...args: Parameters<T>): Promise<ReturnType<T>>;
3
- clear: (...args: Parameters<T>) => void;
4
- clearAll: () => void;
5
- };
6
- export default function cache<T extends (...args: any[]) => any>(f: T): CachedFunction<T>;
7
- export {};
8
- //# sourceMappingURL=placeholderCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"placeholderCache.d.ts","sourceRoot":"","sources":["../../src/config/placeholderCache.ts"],"names":[],"mappings":"AAwCA,KAAK,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI;IACrD,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CA2BxF"}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- // This is intended as a placeholder until React's native cache is out of experimental phase
3
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
- return new (P || (P = Promise))(function (resolve, reject) {
6
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
- step((generator = generator.apply(thisArg, _arguments || [])).next());
10
- });
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.default = cache;
14
- class PlaceholderCache {
15
- constructor() {
16
- this.cache = new Map();
17
- }
18
- set(functionKey, argsKey, value) {
19
- if (!this.cache.has(functionKey)) {
20
- this.cache.set(functionKey, new Map());
21
- }
22
- this.cache.get(functionKey).set(argsKey, value);
23
- }
24
- get(functionKey, argsKey) {
25
- var _a;
26
- return (_a = this.cache.get(functionKey)) === null || _a === void 0 ? void 0 : _a.get(argsKey);
27
- }
28
- has(functionKey, argsKey) {
29
- return this.cache.has(functionKey) && this.cache.get(functionKey).has(argsKey);
30
- }
31
- clear(functionKey, argsKey) {
32
- if (this.cache.has(functionKey)) {
33
- this.cache.get(functionKey).delete(argsKey);
34
- if (this.cache.get(functionKey).size === 0) {
35
- this.cache.delete(functionKey);
36
- }
37
- }
38
- }
39
- clearAll() {
40
- this.cache.clear();
41
- }
42
- }
43
- const placeholderCache = new PlaceholderCache();
44
- function cache(f) {
45
- const functionKey = f.toString();
46
- const cachedFunction = function (...args) {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- const argsKey = JSON.stringify(args);
49
- if (!placeholderCache.has(functionKey, argsKey) || placeholderCache.get(functionKey, argsKey) === null) {
50
- try {
51
- const result = yield f(...args);
52
- placeholderCache.set(functionKey, argsKey, result);
53
- return result;
54
- }
55
- catch (error) {
56
- throw new Error(`Error executing function: ${error}`);
57
- }
58
- }
59
- return placeholderCache.get(functionKey, argsKey);
60
- });
61
- };
62
- cachedFunction.clear = function (...args) {
63
- const argsKey = JSON.stringify(args);
64
- placeholderCache.clear(functionKey, argsKey);
65
- };
66
- cachedFunction.clearAll = function () {
67
- placeholderCache.clearAll();
68
- };
69
- return cachedFunction;
70
- }
71
- //# sourceMappingURL=placeholderCache.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"placeholderCache.js","sourceRoot":"","sources":["../../src/config/placeholderCache.ts"],"names":[],"mappings":";AAAA,4FAA4F;;;;;;;;;;;AA8C5F,wBA2BC;AAvED,MAAM,gBAAgB;IAGlB;QACI,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,GAAG,CAAC,WAAmB,EAAE,OAAe,EAAE,KAAU;QAChD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAED,GAAG,CAAC,WAAmB,EAAE,OAAe;;QACpC,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,0CAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,GAAG,CAAC,WAAmB,EAAE,OAAe;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpF,CAAC;IAED,KAA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AAE,OAAO,CAAkB,CAAC;QACvE,CAAC;KAAA,CAAC;IAEF,cAAc,CAAC,KAAK,GAAG,UAAU,GAAG,IAAmB;QACnD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrC,gBAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF,cAAc,CAAC,QAAQ,GAAG;QACtB,gBAAgB,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC,CAAC;IAEF,OAAO,cAAc,CAAC;AAC1B,CAAC"}
@@ -1,6 +0,0 @@
1
- import { ReactNode } from "react";
2
- export default function dict(id: string, { userLanguage, ...options }: {
3
- userLanguage: string;
4
- [key: string]: any;
5
- }): Promise<ReactNode>;
6
- //# sourceMappingURL=dict.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dict.d.ts","sourceRoot":"","sources":["../../src/dict/dict.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKzC,wBAA8B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAe7I"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dict.js","sourceRoot":"","sources":["../../src/dict/dict.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,uBAeC;;AAnBD,sEAA8C;AAE9C,wDAAgC;AAEhC,SAA8B,IAAI,CAAC,EAAU,EAAE,EAA0E;;YAA1E,EAAE,YAAY,OAA4D,EAAvD,OAAO,cAA1B,gBAA4B,CAAF;QAErE,MAAM,KAAK,GAAG,IAAI,CAAA,CAAC,qCAAqC;QAExD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,MAAM,IAAA,cAAI,EAAC,KAAK,EAAE,YAAY,kBAAI,EAAE,IAAK,OAAO,EAAG,CAAA;QAC9D,CAAC;QAED,OAAO;QACH,uCAAuC;QACvC,uBAAC,oBAAU,kBAAC,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,IAAM,OAAO,cACtD,KAAK,IACG,CAChB,CAAC;IAEN,CAAC;CAAA"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Fetches the translation of given content, or sends it to be translated if it doesn't exist already.
3
- * @param {Content} content - The content to be translated.
4
- * @param {string} userLanguage - The target language for translation.
5
- * @param {Record<string, any>} [metadata] - Optional metadata for translation.
6
- * @returns {Promise<string>} The translated content.
7
- */
8
- export default function intl(content: string, userLanguage: string, metadata?: {
9
- id?: string;
10
- page?: string;
11
- context?: string;
12
- [key: string]: any;
13
- }): Promise<string>;
14
- //# sourceMappingURL=intl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intl.d.ts","sourceRoot":"","sources":["../../src/intl/intl.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAA8B,IAAI,CAC9B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,QAAQ,GAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAO,GACpF,OAAO,CAAC,MAAM,CAAC,CAcjB"}