@intlayer/core 6.1.6 → 7.0.0-canary.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 (600) hide show
  1. package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
  2. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs +213 -0
  3. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -0
  4. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs +95 -0
  5. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -0
  6. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs +46 -0
  7. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -0
  8. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs +33 -0
  9. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -0
  10. package/dist/cjs/deepTransformPlugins/getMaskContent.cjs +27 -0
  11. package/dist/cjs/deepTransformPlugins/getMaskContent.cjs.map +1 -0
  12. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs +45 -0
  13. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -0
  14. package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs +60 -0
  15. package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -0
  16. package/dist/cjs/deepTransformPlugins/index.cjs +25 -0
  17. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +107 -0
  18. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -0
  19. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +59 -91
  20. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
  21. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +13 -39
  22. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
  23. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +48 -94
  24. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
  25. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +24 -68
  26. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
  27. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +21 -56
  28. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
  29. package/dist/cjs/dictionaryManipulator/getNodeType.cjs +32 -49
  30. package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
  31. package/dist/cjs/dictionaryManipulator/getUnmergedDictionaryByKeyPath.cjs +18 -50
  32. package/dist/cjs/dictionaryManipulator/getUnmergedDictionaryByKeyPath.cjs.map +1 -1
  33. package/dist/cjs/dictionaryManipulator/index.cjs +28 -41
  34. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +69 -0
  35. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -0
  36. package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs +30 -0
  37. package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs.map +1 -0
  38. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +48 -0
  39. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -0
  40. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +29 -54
  41. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
  42. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +37 -63
  43. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
  44. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs +36 -76
  45. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
  46. package/dist/cjs/formatters/compact.cjs +24 -46
  47. package/dist/cjs/formatters/compact.cjs.map +1 -1
  48. package/dist/cjs/formatters/currency.cjs +28 -50
  49. package/dist/cjs/formatters/currency.cjs.map +1 -1
  50. package/dist/cjs/formatters/date.cjs +56 -79
  51. package/dist/cjs/formatters/date.cjs.map +1 -1
  52. package/dist/cjs/formatters/index.cjs +17 -37
  53. package/dist/cjs/formatters/list.cjs +29 -47
  54. package/dist/cjs/formatters/list.cjs.map +1 -1
  55. package/dist/cjs/formatters/number.cjs +17 -43
  56. package/dist/cjs/formatters/number.cjs.map +1 -1
  57. package/dist/cjs/formatters/percentage.cjs +22 -51
  58. package/dist/cjs/formatters/percentage.cjs.map +1 -1
  59. package/dist/cjs/formatters/relativeTime.cjs +28 -70
  60. package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
  61. package/dist/cjs/formatters/units.cjs +22 -48
  62. package/dist/cjs/formatters/units.cjs.map +1 -1
  63. package/dist/cjs/getStorageAttributes.cjs +116 -0
  64. package/dist/cjs/getStorageAttributes.cjs.map +1 -0
  65. package/dist/cjs/index.cjs +154 -45
  66. package/dist/cjs/interpreter/getCondition.cjs +30 -30
  67. package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
  68. package/dist/cjs/interpreter/getContent/deepTransform.cjs +38 -63
  69. package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
  70. package/dist/cjs/interpreter/getContent/getContent.cjs +31 -54
  71. package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -1
  72. package/dist/cjs/interpreter/getContent/index.cjs +13 -27
  73. package/dist/cjs/interpreter/getContent/plugins.cjs +135 -175
  74. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -1
  75. package/dist/cjs/interpreter/getDictionary.cjs +21 -39
  76. package/dist/cjs/interpreter/getDictionary.cjs.map +1 -1
  77. package/dist/cjs/interpreter/getEnumeration.cjs +69 -42
  78. package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
  79. package/dist/cjs/interpreter/getGender.cjs +33 -34
  80. package/dist/cjs/interpreter/getGender.cjs.map +1 -1
  81. package/dist/cjs/interpreter/getInsertion.cjs +18 -27
  82. package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
  83. package/dist/cjs/interpreter/getIntlayer.cjs +13 -48
  84. package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -1
  85. package/dist/cjs/interpreter/getNesting.cjs +26 -41
  86. package/dist/cjs/interpreter/getNesting.cjs.map +1 -1
  87. package/dist/cjs/interpreter/getTranslation.cjs +29 -32
  88. package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
  89. package/dist/cjs/interpreter/index.cjs +26 -39
  90. package/dist/cjs/localization/getBrowserLocale.cjs +144 -0
  91. package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -0
  92. package/dist/cjs/localization/getHTMLTextDir.cjs +49 -255
  93. package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
  94. package/dist/cjs/localization/getLocaleFromPath.cjs +40 -56
  95. package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
  96. package/dist/cjs/localization/getLocaleLang.cjs +18 -27
  97. package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
  98. package/dist/cjs/localization/getLocaleName.cjs +7 -32
  99. package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
  100. package/dist/cjs/localization/getLocalizedUrl.cjs +46 -47
  101. package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
  102. package/dist/cjs/localization/getMultilingualUrls.cjs +69 -65
  103. package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
  104. package/dist/cjs/localization/getPathWithoutLocale.cjs +53 -61
  105. package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
  106. package/dist/cjs/localization/index.cjs +26 -63
  107. package/dist/cjs/localization/localeDetector.cjs +108 -39
  108. package/dist/cjs/localization/localeDetector.cjs.map +1 -1
  109. package/dist/cjs/localization/localeMapper.cjs +118 -72
  110. package/dist/cjs/localization/localeMapper.cjs.map +1 -1
  111. package/dist/cjs/localization/localeResolver.cjs +26 -61
  112. package/dist/cjs/localization/localeResolver.cjs.map +1 -1
  113. package/dist/cjs/transpiler/condition/condition.cjs +26 -29
  114. package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
  115. package/dist/cjs/transpiler/condition/index.cjs +3 -23
  116. package/dist/cjs/transpiler/enumeration/enumeration.cjs +28 -29
  117. package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
  118. package/dist/cjs/transpiler/enumeration/index.cjs +3 -23
  119. package/dist/cjs/transpiler/file/file.cjs +52 -71
  120. package/dist/cjs/transpiler/file/file.cjs.map +1 -1
  121. package/dist/cjs/transpiler/file/fileBrowser.cjs +24 -33
  122. package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
  123. package/dist/cjs/transpiler/file/index.cjs +4 -23
  124. package/dist/cjs/transpiler/gender/gender.cjs +26 -29
  125. package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
  126. package/dist/cjs/transpiler/gender/index.cjs +3 -23
  127. package/dist/cjs/transpiler/index.cjs +19 -35
  128. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +8 -31
  129. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
  130. package/dist/cjs/transpiler/insertion/index.cjs +5 -25
  131. package/dist/cjs/transpiler/insertion/insertion.cjs +34 -51
  132. package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
  133. package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +53 -86
  134. package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
  135. package/dist/cjs/transpiler/markdown/index.cjs +5 -25
  136. package/dist/cjs/transpiler/markdown/markdown.cjs +33 -52
  137. package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
  138. package/dist/cjs/transpiler/nesting/index.cjs +3 -23
  139. package/dist/cjs/transpiler/nesting/nesting.cjs +26 -31
  140. package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
  141. package/dist/cjs/transpiler/translation/index.cjs +3 -23
  142. package/dist/cjs/transpiler/translation/translation.cjs +29 -29
  143. package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
  144. package/dist/cjs/utils/checkIsURLAbsolute.cjs +5 -27
  145. package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
  146. package/dist/cjs/utils/intl.cjs +48 -74
  147. package/dist/cjs/utils/intl.cjs.map +1 -1
  148. package/dist/cjs/utils/isSameKeyPath.cjs +6 -30
  149. package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
  150. package/dist/cjs/utils/isValidReactElement.cjs +12 -27
  151. package/dist/cjs/utils/isValidReactElement.cjs.map +1 -1
  152. package/dist/cjs/utils/localeStorage.cjs +143 -0
  153. package/dist/cjs/utils/localeStorage.cjs.map +1 -0
  154. package/dist/cjs/utils/parseYaml.cjs +185 -55
  155. package/dist/cjs/utils/parseYaml.cjs.map +1 -1
  156. package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs +208 -0
  157. package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs.map +1 -0
  158. package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs +90 -0
  159. package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -0
  160. package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs +43 -0
  161. package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs.map +1 -0
  162. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs +32 -0
  163. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -0
  164. package/dist/esm/deepTransformPlugins/getMaskContent.mjs +26 -0
  165. package/dist/esm/deepTransformPlugins/getMaskContent.mjs.map +1 -0
  166. package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs +41 -0
  167. package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs.map +1 -0
  168. package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs +60 -0
  169. package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -0
  170. package/dist/esm/deepTransformPlugins/index.mjs +10 -0
  171. package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs +105 -0
  172. package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -0
  173. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +57 -67
  174. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
  175. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs +11 -15
  176. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
  177. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs +46 -70
  178. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
  179. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs +22 -44
  180. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
  181. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +19 -32
  182. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
  183. package/dist/esm/dictionaryManipulator/getNodeType.mjs +31 -26
  184. package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
  185. package/dist/esm/dictionaryManipulator/getUnmergedDictionaryByKeyPath.mjs +14 -15
  186. package/dist/esm/dictionaryManipulator/getUnmergedDictionaryByKeyPath.mjs.map +1 -1
  187. package/dist/esm/dictionaryManipulator/index.mjs +15 -11
  188. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +66 -0
  189. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -0
  190. package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs +29 -0
  191. package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs.map +1 -0
  192. package/dist/esm/dictionaryManipulator/orderDictionaries.mjs +46 -0
  193. package/dist/esm/dictionaryManipulator/orderDictionaries.mjs.map +1 -0
  194. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +27 -30
  195. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
  196. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +35 -39
  197. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
  198. package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs +34 -52
  199. package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs.map +1 -1
  200. package/dist/esm/formatters/compact.mjs +21 -11
  201. package/dist/esm/formatters/compact.mjs.map +1 -1
  202. package/dist/esm/formatters/currency.mjs +25 -15
  203. package/dist/esm/formatters/currency.mjs.map +1 -1
  204. package/dist/esm/formatters/date.mjs +53 -44
  205. package/dist/esm/formatters/date.mjs.map +1 -1
  206. package/dist/esm/formatters/index.mjs +10 -9
  207. package/dist/esm/formatters/list.mjs +26 -12
  208. package/dist/esm/formatters/list.mjs.map +1 -1
  209. package/dist/esm/formatters/number.mjs +14 -8
  210. package/dist/esm/formatters/number.mjs.map +1 -1
  211. package/dist/esm/formatters/percentage.mjs +19 -16
  212. package/dist/esm/formatters/percentage.mjs.map +1 -1
  213. package/dist/esm/formatters/relativeTime.mjs +25 -35
  214. package/dist/esm/formatters/relativeTime.mjs.map +1 -1
  215. package/dist/esm/formatters/units.mjs +19 -13
  216. package/dist/esm/formatters/units.mjs.map +1 -1
  217. package/dist/esm/getStorageAttributes.mjs +114 -0
  218. package/dist/esm/getStorageAttributes.mjs.map +1 -0
  219. package/dist/esm/index.mjs +67 -13
  220. package/dist/esm/interpreter/getCondition.mjs +29 -6
  221. package/dist/esm/interpreter/getCondition.mjs.map +1 -1
  222. package/dist/esm/interpreter/getContent/deepTransform.mjs +36 -39
  223. package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
  224. package/dist/esm/interpreter/getContent/getContent.mjs +28 -26
  225. package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -1
  226. package/dist/esm/interpreter/getContent/index.mjs +5 -4
  227. package/dist/esm/interpreter/getContent/plugins.mjs +121 -139
  228. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -1
  229. package/dist/esm/interpreter/getDictionary.mjs +20 -14
  230. package/dist/esm/interpreter/getDictionary.mjs.map +1 -1
  231. package/dist/esm/interpreter/getEnumeration.mjs +67 -17
  232. package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
  233. package/dist/esm/interpreter/getGender.mjs +32 -10
  234. package/dist/esm/interpreter/getGender.mjs.map +1 -1
  235. package/dist/esm/interpreter/getInsertion.mjs +17 -3
  236. package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
  237. package/dist/esm/interpreter/getIntlayer.mjs +10 -13
  238. package/dist/esm/interpreter/getIntlayer.mjs.map +1 -1
  239. package/dist/esm/interpreter/getNesting.mjs +25 -16
  240. package/dist/esm/interpreter/getNesting.mjs.map +1 -1
  241. package/dist/esm/interpreter/getTranslation.mjs +28 -8
  242. package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
  243. package/dist/esm/interpreter/index.mjs +11 -10
  244. package/dist/esm/localization/getBrowserLocale.mjs +139 -0
  245. package/dist/esm/localization/getBrowserLocale.mjs.map +1 -0
  246. package/dist/esm/localization/getHTMLTextDir.mjs +47 -231
  247. package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
  248. package/dist/esm/localization/getLocaleFromPath.mjs +36 -21
  249. package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
  250. package/dist/esm/localization/getLocaleLang.mjs +17 -3
  251. package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
  252. package/dist/esm/localization/getLocaleName.mjs +7 -8
  253. package/dist/esm/localization/getLocaleName.mjs.map +1 -1
  254. package/dist/esm/localization/getLocalizedUrl.mjs +43 -12
  255. package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
  256. package/dist/esm/localization/getMultilingualUrls.mjs +65 -29
  257. package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
  258. package/dist/esm/localization/getPathWithoutLocale.mjs +50 -26
  259. package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
  260. package/dist/esm/localization/index.mjs +7 -21
  261. package/dist/esm/localization/localeDetector.mjs +109 -6
  262. package/dist/esm/localization/localeDetector.mjs.map +1 -1
  263. package/dist/esm/localization/localeMapper.mjs +112 -35
  264. package/dist/esm/localization/localeMapper.mjs.map +1 -1
  265. package/dist/esm/localization/localeResolver.mjs +23 -26
  266. package/dist/esm/localization/localeResolver.mjs.map +1 -1
  267. package/dist/esm/transpiler/condition/condition.mjs +23 -7
  268. package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
  269. package/dist/esm/transpiler/condition/index.mjs +3 -2
  270. package/dist/esm/transpiler/enumeration/enumeration.mjs +25 -7
  271. package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
  272. package/dist/esm/transpiler/enumeration/index.mjs +3 -2
  273. package/dist/esm/transpiler/file/file.mjs +46 -40
  274. package/dist/esm/transpiler/file/file.mjs.map +1 -1
  275. package/dist/esm/transpiler/file/fileBrowser.mjs +22 -9
  276. package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
  277. package/dist/esm/transpiler/file/index.mjs +3 -2
  278. package/dist/esm/transpiler/gender/gender.mjs +23 -7
  279. package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
  280. package/dist/esm/transpiler/gender/index.mjs +3 -2
  281. package/dist/esm/transpiler/index.mjs +11 -8
  282. package/dist/esm/transpiler/insertion/getInsertionValues.mjs +7 -7
  283. package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
  284. package/dist/esm/transpiler/insertion/index.mjs +4 -3
  285. package/dist/esm/transpiler/insertion/insertion.mjs +31 -29
  286. package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
  287. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +52 -61
  288. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
  289. package/dist/esm/transpiler/markdown/index.mjs +4 -3
  290. package/dist/esm/transpiler/markdown/markdown.mjs +29 -29
  291. package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
  292. package/dist/esm/transpiler/nesting/index.mjs +3 -2
  293. package/dist/esm/transpiler/nesting/nesting.mjs +23 -9
  294. package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
  295. package/dist/esm/transpiler/translation/index.mjs +3 -2
  296. package/dist/esm/transpiler/translation/translation.mjs +26 -7
  297. package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
  298. package/dist/esm/utils/checkIsURLAbsolute.mjs +4 -3
  299. package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
  300. package/dist/esm/utils/intl.mjs +44 -49
  301. package/dist/esm/utils/intl.mjs.map +1 -1
  302. package/dist/esm/utils/isSameKeyPath.mjs +5 -6
  303. package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
  304. package/dist/esm/utils/isValidReactElement.mjs +11 -3
  305. package/dist/esm/utils/isValidReactElement.mjs.map +1 -1
  306. package/dist/esm/utils/localeStorage.mjs +139 -0
  307. package/dist/esm/utils/localeStorage.mjs.map +1 -0
  308. package/dist/esm/utils/parseYaml.mjs +184 -31
  309. package/dist/esm/utils/parseYaml.mjs.map +1 -1
  310. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +46 -0
  311. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -0
  312. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +38 -0
  313. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -0
  314. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +30 -0
  315. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -0
  316. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +18 -0
  317. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +1 -0
  318. package/dist/types/deepTransformPlugins/getMaskContent.d.ts +10 -0
  319. package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -0
  320. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +16 -0
  321. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +1 -0
  322. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +8 -0
  323. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -0
  324. package/dist/types/deepTransformPlugins/index.d.ts +9 -0
  325. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +25 -0
  326. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +1 -0
  327. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +6 -3
  328. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +1 -1
  329. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +6 -3
  330. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +1 -1
  331. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +6 -3
  332. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -1
  333. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +6 -2
  334. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -1
  335. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +6 -2
  336. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -1
  337. package/dist/types/dictionaryManipulator/getNodeType.d.ts +6 -3
  338. package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -1
  339. package/dist/types/dictionaryManipulator/getUnmergedDictionaryByKeyPath.d.ts +8 -3
  340. package/dist/types/dictionaryManipulator/getUnmergedDictionaryByKeyPath.d.ts.map +1 -1
  341. package/dist/types/dictionaryManipulator/index.d.ts +14 -11
  342. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +7 -0
  343. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -0
  344. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +8 -0
  345. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +1 -0
  346. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +16 -0
  347. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -0
  348. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +6 -3
  349. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +1 -1
  350. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +6 -3
  351. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +1 -1
  352. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +6 -2
  353. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +1 -1
  354. package/dist/types/formatters/compact.d.ts +8 -3
  355. package/dist/types/formatters/compact.d.ts.map +1 -1
  356. package/dist/types/formatters/currency.d.ts +8 -3
  357. package/dist/types/formatters/currency.d.ts.map +1 -1
  358. package/dist/types/formatters/date.d.ts +8 -3
  359. package/dist/types/formatters/date.d.ts.map +1 -1
  360. package/dist/types/formatters/index.d.ts +9 -9
  361. package/dist/types/formatters/list.d.ts +8 -3
  362. package/dist/types/formatters/list.d.ts.map +1 -1
  363. package/dist/types/formatters/number.d.ts +8 -3
  364. package/dist/types/formatters/number.d.ts.map +1 -1
  365. package/dist/types/formatters/percentage.d.ts +8 -3
  366. package/dist/types/formatters/percentage.d.ts.map +1 -1
  367. package/dist/types/formatters/relativeTime.d.ts +8 -5
  368. package/dist/types/formatters/relativeTime.d.ts.map +1 -1
  369. package/dist/types/formatters/units.d.ts +8 -3
  370. package/dist/types/formatters/units.d.ts.map +1 -1
  371. package/dist/types/getStorageAttributes.d.ts +25 -0
  372. package/dist/types/getStorageAttributes.d.ts.map +1 -0
  373. package/dist/types/index.d.ts +67 -13
  374. package/dist/types/interpreter/getCondition.d.ts +7 -2
  375. package/dist/types/interpreter/getCondition.d.ts.map +1 -1
  376. package/dist/types/interpreter/getContent/deepTransform.d.ts +7 -2
  377. package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -1
  378. package/dist/types/interpreter/getContent/getContent.d.ts +8 -4
  379. package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -1
  380. package/dist/types/interpreter/getContent/index.d.ts +4 -4
  381. package/dist/types/interpreter/getContent/plugins.d.ts +68 -66
  382. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -1
  383. package/dist/types/interpreter/getDictionary.d.ts +8 -4
  384. package/dist/types/interpreter/getDictionary.d.ts.map +1 -1
  385. package/dist/types/interpreter/getEnumeration.d.ts +8 -3
  386. package/dist/types/interpreter/getEnumeration.d.ts.map +1 -1
  387. package/dist/types/interpreter/getGender.d.ts +7 -4
  388. package/dist/types/interpreter/getGender.d.ts.map +1 -1
  389. package/dist/types/interpreter/getInsertion.d.ts +7 -2
  390. package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
  391. package/dist/types/interpreter/getIntlayer.d.ts +7 -5
  392. package/dist/types/interpreter/getIntlayer.d.ts.map +1 -1
  393. package/dist/types/interpreter/getNesting.d.ts +9 -6
  394. package/dist/types/interpreter/getNesting.d.ts.map +1 -1
  395. package/dist/types/interpreter/getTranslation.d.ts +7 -3
  396. package/dist/types/interpreter/getTranslation.d.ts.map +1 -1
  397. package/dist/types/interpreter/index.d.ts +10 -10
  398. package/dist/types/localization/getBrowserLocale.d.ts +35 -0
  399. package/dist/types/localization/getBrowserLocale.d.ts.map +1 -0
  400. package/dist/types/localization/getHTMLTextDir.d.ts +6 -3
  401. package/dist/types/localization/getHTMLTextDir.d.ts.map +1 -1
  402. package/dist/types/localization/getLocaleFromPath.d.ts +7 -2
  403. package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -1
  404. package/dist/types/localization/getLocaleLang.d.ts +7 -2
  405. package/dist/types/localization/getLocaleLang.d.ts.map +1 -1
  406. package/dist/types/localization/getLocaleName.d.ts +6 -2
  407. package/dist/types/localization/getLocaleName.d.ts.map +1 -1
  408. package/dist/types/localization/getLocalizedUrl.d.ts +30 -17
  409. package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -1
  410. package/dist/types/localization/getMultilingualUrls.d.ts +28 -12
  411. package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -1
  412. package/dist/types/localization/getPathWithoutLocale.d.ts +11 -3
  413. package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -1
  414. package/dist/types/localization/index.d.ts +12 -12
  415. package/dist/types/localization/localeDetector.d.ts +7 -2
  416. package/dist/types/localization/localeDetector.d.ts.map +1 -1
  417. package/dist/types/localization/localeMapper.d.ts +23 -19
  418. package/dist/types/localization/localeMapper.d.ts.map +1 -1
  419. package/dist/types/localization/localeResolver.d.ts +7 -2
  420. package/dist/types/localization/localeResolver.d.ts.map +1 -1
  421. package/dist/types/transpiler/condition/condition.d.ts +8 -5
  422. package/dist/types/transpiler/condition/condition.d.ts.map +1 -1
  423. package/dist/types/transpiler/condition/index.d.ts +2 -2
  424. package/dist/types/transpiler/enumeration/enumeration.d.ts +9 -6
  425. package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -1
  426. package/dist/types/transpiler/enumeration/index.d.ts +2 -2
  427. package/dist/types/transpiler/file/file.d.ts +11 -6
  428. package/dist/types/transpiler/file/file.d.ts.map +1 -1
  429. package/dist/types/transpiler/file/fileBrowser.d.ts +7 -2
  430. package/dist/types/transpiler/file/fileBrowser.d.ts.map +1 -1
  431. package/dist/types/transpiler/file/index.d.ts +2 -2
  432. package/dist/types/transpiler/gender/gender.d.ts +9 -6
  433. package/dist/types/transpiler/gender/gender.d.ts.map +1 -1
  434. package/dist/types/transpiler/gender/index.d.ts +2 -2
  435. package/dist/types/transpiler/index.d.ts +11 -9
  436. package/dist/types/transpiler/insertion/getInsertionValues.d.ts +4 -1
  437. package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -1
  438. package/dist/types/transpiler/insertion/index.d.ts +3 -3
  439. package/dist/types/transpiler/insertion/insertion.d.ts +8 -5
  440. package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -1
  441. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts +4 -1
  442. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -1
  443. package/dist/types/transpiler/markdown/index.d.ts +3 -3
  444. package/dist/types/transpiler/markdown/markdown.d.ts +8 -5
  445. package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -1
  446. package/dist/types/transpiler/nesting/index.d.ts +2 -2
  447. package/dist/types/transpiler/nesting/nesting.d.ts +24 -25
  448. package/dist/types/transpiler/nesting/nesting.d.ts.map +1 -1
  449. package/dist/types/transpiler/translation/index.d.ts +2 -2
  450. package/dist/types/transpiler/translation/translation.d.ts +9 -6
  451. package/dist/types/transpiler/translation/translation.d.ts.map +1 -1
  452. package/dist/types/utils/checkIsURLAbsolute.d.ts +4 -1
  453. package/dist/types/utils/checkIsURLAbsolute.d.ts.map +1 -1
  454. package/dist/types/utils/intl.d.ts +9 -10
  455. package/dist/types/utils/intl.d.ts.map +1 -1
  456. package/dist/types/utils/isSameKeyPath.d.ts +6 -2
  457. package/dist/types/utils/isSameKeyPath.d.ts.map +1 -1
  458. package/dist/types/utils/isValidReactElement.d.ts +4 -1
  459. package/dist/types/utils/isValidReactElement.d.ts.map +1 -1
  460. package/dist/types/utils/localeStorage.d.ts +105 -0
  461. package/dist/types/utils/localeStorage.d.ts.map +1 -0
  462. package/dist/types/utils/parseYaml.d.ts +4 -1
  463. package/dist/types/utils/parseYaml.d.ts.map +1 -1
  464. package/package.json +36 -121
  465. package/LICENSE +0 -202
  466. package/dist/cjs/deepTranformPlugins/getFilterTranslationsOnlyContent.cjs +0 -130
  467. package/dist/cjs/deepTranformPlugins/getFilterTranslationsOnlyContent.cjs.map +0 -1
  468. package/dist/cjs/deepTranformPlugins/getFilteredLocalesContent.cjs +0 -62
  469. package/dist/cjs/deepTranformPlugins/getFilteredLocalesContent.cjs.map +0 -1
  470. package/dist/cjs/deepTranformPlugins/getLocalisedContent.cjs +0 -51
  471. package/dist/cjs/deepTranformPlugins/getLocalisedContent.cjs.map +0 -1
  472. package/dist/cjs/deepTranformPlugins/getMaskContent.cjs +0 -49
  473. package/dist/cjs/deepTranformPlugins/getMaskContent.cjs.map +0 -1
  474. package/dist/cjs/deepTranformPlugins/getMissingLocalesContent.cjs +0 -78
  475. package/dist/cjs/deepTranformPlugins/getMissingLocalesContent.cjs.map +0 -1
  476. package/dist/cjs/deepTranformPlugins/getReplacedValuesContent.cjs +0 -82
  477. package/dist/cjs/deepTranformPlugins/getReplacedValuesContent.cjs.map +0 -1
  478. package/dist/cjs/deepTranformPlugins/index.cjs +0 -33
  479. package/dist/cjs/deepTranformPlugins/index.cjs.map +0 -1
  480. package/dist/cjs/dictionaryManipulator/index.cjs.map +0 -1
  481. package/dist/cjs/formatters/index.cjs.map +0 -1
  482. package/dist/cjs/index.cjs.map +0 -1
  483. package/dist/cjs/interpreter/getContent/index.cjs.map +0 -1
  484. package/dist/cjs/interpreter/getIntlayerAsync.cjs +0 -37
  485. package/dist/cjs/interpreter/getIntlayerAsync.cjs.map +0 -1
  486. package/dist/cjs/interpreter/index.cjs.map +0 -1
  487. package/dist/cjs/localization/index.cjs.map +0 -1
  488. package/dist/cjs/localization/localeList.cjs +0 -256
  489. package/dist/cjs/localization/localeList.cjs.map +0 -1
  490. package/dist/cjs/transpiler/condition/index.cjs.map +0 -1
  491. package/dist/cjs/transpiler/enumeration/index.cjs.map +0 -1
  492. package/dist/cjs/transpiler/file/index.cjs.map +0 -1
  493. package/dist/cjs/transpiler/gender/index.cjs.map +0 -1
  494. package/dist/cjs/transpiler/index.cjs.map +0 -1
  495. package/dist/cjs/transpiler/insertion/index.cjs.map +0 -1
  496. package/dist/cjs/transpiler/markdown/index.cjs.map +0 -1
  497. package/dist/cjs/transpiler/nesting/index.cjs.map +0 -1
  498. package/dist/cjs/transpiler/translation/index.cjs.map +0 -1
  499. package/dist/cjs/types/dictionary.cjs +0 -17
  500. package/dist/cjs/types/dictionary.cjs.map +0 -1
  501. package/dist/cjs/types/index.cjs +0 -29
  502. package/dist/cjs/types/index.cjs.map +0 -1
  503. package/dist/cjs/types/intlayer.cjs +0 -35
  504. package/dist/cjs/types/intlayer.cjs.map +0 -1
  505. package/dist/cjs/types/keyPath.cjs +0 -17
  506. package/dist/cjs/types/keyPath.cjs.map +0 -1
  507. package/dist/cjs/types/nodeType.cjs +0 -53
  508. package/dist/cjs/types/nodeType.cjs.map +0 -1
  509. package/dist/cjs/types/translation.cjs +0 -17
  510. package/dist/cjs/types/translation.cjs.map +0 -1
  511. package/dist/esm/deepTranformPlugins/getFilterTranslationsOnlyContent.mjs +0 -95
  512. package/dist/esm/deepTranformPlugins/getFilterTranslationsOnlyContent.mjs.map +0 -1
  513. package/dist/esm/deepTranformPlugins/getFilteredLocalesContent.mjs +0 -40
  514. package/dist/esm/deepTranformPlugins/getFilteredLocalesContent.mjs.map +0 -1
  515. package/dist/esm/deepTranformPlugins/getLocalisedContent.mjs +0 -19
  516. package/dist/esm/deepTranformPlugins/getLocalisedContent.mjs.map +0 -1
  517. package/dist/esm/deepTranformPlugins/getMaskContent.mjs +0 -24
  518. package/dist/esm/deepTranformPlugins/getMaskContent.mjs.map +0 -1
  519. package/dist/esm/deepTranformPlugins/getMissingLocalesContent.mjs +0 -43
  520. package/dist/esm/deepTranformPlugins/getMissingLocalesContent.mjs.map +0 -1
  521. package/dist/esm/deepTranformPlugins/getReplacedValuesContent.mjs +0 -60
  522. package/dist/esm/deepTranformPlugins/getReplacedValuesContent.mjs.map +0 -1
  523. package/dist/esm/deepTranformPlugins/index.mjs +0 -7
  524. package/dist/esm/deepTranformPlugins/index.mjs.map +0 -1
  525. package/dist/esm/dictionaryManipulator/index.mjs.map +0 -1
  526. package/dist/esm/formatters/index.mjs.map +0 -1
  527. package/dist/esm/index.mjs.map +0 -1
  528. package/dist/esm/interpreter/getContent/index.mjs.map +0 -1
  529. package/dist/esm/interpreter/getIntlayerAsync.mjs +0 -13
  530. package/dist/esm/interpreter/getIntlayerAsync.mjs.map +0 -1
  531. package/dist/esm/interpreter/index.mjs.map +0 -1
  532. package/dist/esm/localization/index.mjs.map +0 -1
  533. package/dist/esm/localization/localeList.mjs +0 -232
  534. package/dist/esm/localization/localeList.mjs.map +0 -1
  535. package/dist/esm/transpiler/condition/index.mjs.map +0 -1
  536. package/dist/esm/transpiler/enumeration/index.mjs.map +0 -1
  537. package/dist/esm/transpiler/file/index.mjs.map +0 -1
  538. package/dist/esm/transpiler/gender/index.mjs.map +0 -1
  539. package/dist/esm/transpiler/index.mjs.map +0 -1
  540. package/dist/esm/transpiler/insertion/index.mjs.map +0 -1
  541. package/dist/esm/transpiler/markdown/index.mjs.map +0 -1
  542. package/dist/esm/transpiler/nesting/index.mjs.map +0 -1
  543. package/dist/esm/transpiler/translation/index.mjs.map +0 -1
  544. package/dist/esm/types/dictionary.mjs +0 -1
  545. package/dist/esm/types/dictionary.mjs.map +0 -1
  546. package/dist/esm/types/index.mjs +0 -5
  547. package/dist/esm/types/index.mjs.map +0 -1
  548. package/dist/esm/types/intlayer.mjs +0 -13
  549. package/dist/esm/types/intlayer.mjs.map +0 -1
  550. package/dist/esm/types/keyPath.mjs +0 -1
  551. package/dist/esm/types/keyPath.mjs.map +0 -1
  552. package/dist/esm/types/nodeType.mjs +0 -28
  553. package/dist/esm/types/nodeType.mjs.map +0 -1
  554. package/dist/esm/types/translation.mjs +0 -1
  555. package/dist/esm/types/translation.mjs.map +0 -1
  556. package/dist/types/deepTranformPlugins/getFilterTranslationsOnlyContent.d.ts +0 -13
  557. package/dist/types/deepTranformPlugins/getFilterTranslationsOnlyContent.d.ts.map +0 -1
  558. package/dist/types/deepTranformPlugins/getFilteredLocalesContent.d.ts +0 -5
  559. package/dist/types/deepTranformPlugins/getFilteredLocalesContent.d.ts.map +0 -1
  560. package/dist/types/deepTranformPlugins/getLocalisedContent.d.ts +0 -13
  561. package/dist/types/deepTranformPlugins/getLocalisedContent.d.ts.map +0 -1
  562. package/dist/types/deepTranformPlugins/getMaskContent.d.ts +0 -6
  563. package/dist/types/deepTranformPlugins/getMaskContent.d.ts.map +0 -1
  564. package/dist/types/deepTranformPlugins/getMissingLocalesContent.d.ts +0 -13
  565. package/dist/types/deepTranformPlugins/getMissingLocalesContent.d.ts.map +0 -1
  566. package/dist/types/deepTranformPlugins/getReplacedValuesContent.d.ts +0 -4
  567. package/dist/types/deepTranformPlugins/getReplacedValuesContent.d.ts.map +0 -1
  568. package/dist/types/deepTranformPlugins/index.d.ts +0 -7
  569. package/dist/types/deepTranformPlugins/index.d.ts.map +0 -1
  570. package/dist/types/dictionaryManipulator/index.d.ts.map +0 -1
  571. package/dist/types/formatters/index.d.ts.map +0 -1
  572. package/dist/types/index.d.ts.map +0 -1
  573. package/dist/types/interpreter/getContent/index.d.ts.map +0 -1
  574. package/dist/types/interpreter/getIntlayerAsync.d.ts +0 -13
  575. package/dist/types/interpreter/getIntlayerAsync.d.ts.map +0 -1
  576. package/dist/types/interpreter/index.d.ts.map +0 -1
  577. package/dist/types/localization/index.d.ts.map +0 -1
  578. package/dist/types/localization/localeList.d.ts +0 -3
  579. package/dist/types/localization/localeList.d.ts.map +0 -1
  580. package/dist/types/transpiler/condition/index.d.ts.map +0 -1
  581. package/dist/types/transpiler/enumeration/index.d.ts.map +0 -1
  582. package/dist/types/transpiler/file/index.d.ts.map +0 -1
  583. package/dist/types/transpiler/gender/index.d.ts.map +0 -1
  584. package/dist/types/transpiler/index.d.ts.map +0 -1
  585. package/dist/types/transpiler/insertion/index.d.ts.map +0 -1
  586. package/dist/types/transpiler/markdown/index.d.ts.map +0 -1
  587. package/dist/types/transpiler/nesting/index.d.ts.map +0 -1
  588. package/dist/types/transpiler/translation/index.d.ts.map +0 -1
  589. package/dist/types/types/dictionary.d.ts +0 -307
  590. package/dist/types/types/dictionary.d.ts.map +0 -1
  591. package/dist/types/types/index.d.ts +0 -5
  592. package/dist/types/types/index.d.ts.map +0 -1
  593. package/dist/types/types/intlayer.d.ts +0 -5
  594. package/dist/types/types/intlayer.d.ts.map +0 -1
  595. package/dist/types/types/keyPath.d.ts +0 -47
  596. package/dist/types/types/keyPath.d.ts.map +0 -1
  597. package/dist/types/types/nodeType.d.ts +0 -30
  598. package/dist/types/types/nodeType.d.ts.map +0 -1
  599. package/dist/types/types/translation.d.ts +0 -25
  600. package/dist/types/types/translation.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/transpiler/index.ts"],"sourcesContent":["export * from './condition/index';\nexport * from './enumeration/index';\nexport type * from './file/index'; // Export type only because of file transpiler is based on node js function and block build\nexport * from './gender/index';\nexport * from './insertion/index';\nexport * from './markdown/index';\nexport * from './nesting/index';\nexport * from './translation/index';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,8BAAd;AACA,+BAAc,gCADd;AAGA,+BAAc,2BAHd;AAIA,+BAAc,8BAJd;AAKA,+BAAc,6BALd;AAMA,+BAAc,4BANd;AAOA,+BAAc,gCAPd;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/transpiler/insertion/index.ts"],"sourcesContent":["export * from './insertion';\nexport * from './getInsertionValues';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,8BAAc,wBAAd;AACA,8BAAc,iCADd;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/transpiler/markdown/index.ts"],"sourcesContent":["export * from './markdown';\nexport * from './getMarkdownMetadata';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,uBAAd;AACA,6BAAc,kCADd;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/transpiler/nesting/index.ts"],"sourcesContent":["export * from './nesting';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,4BAAc,sBAAd;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/transpiler/translation/index.ts"],"sourcesContent":["export * from './translation';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gCAAc,0BAAd;","names":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var dictionary_exports = {};
16
- module.exports = __toCommonJS(dictionary_exports);
17
- //# sourceMappingURL=dictionary.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/dictionary.ts"],"sourcesContent":["import type { ConditionContent } from '../transpiler/condition';\nimport type { EnumerationContent } from '../transpiler/enumeration';\nimport type { FileContent } from '../transpiler/file';\nimport type { GenderContent } from '../transpiler/gender';\nimport type { InsertionContent } from '../transpiler/insertion';\nimport type { MarkdownContent } from '../transpiler/markdown';\nimport type { NestedContent } from '../transpiler/nesting';\nimport type { TranslationContent } from '../transpiler/translation';\nimport type {\n IntlayerDictionaryTypesConnector,\n LanguageContent,\n LocalesValues,\n} from './intlayer';\n\n/**\n * Provides a fallback to string type if the generic type T is undefined,\n * otherwise returns T. This is useful for handling cases where no keys are found.\n * Example: StringFallback<undefined> -> string; StringFallback<'key'> -> 'key'\n */\nexport type StringFallback<T> = T extends undefined ? string : T; // If no keys are found, return string to disable error, and accept any string as dictionary key\n\n/**\n * Represents the keys of the IntlayerDictionaryTypesConnector,\n * ensuring they are valid dictionary keys or fallback to string if none exist.\n *\n * Example:\n * ```ts\n * DictionaryKeys -> 'key1' | 'key2'\n * // or if IntlayerDictionaryTypesConnector is not defined,\n * DictionaryKeys -> string\n * ```\n */\nexport type DictionaryKeys = StringFallback<\n keyof IntlayerDictionaryTypesConnector\n>;\n\ntype BaseNode = number | string | boolean | null | undefined;\n\nexport type TypedNode<NodeType = undefined> =\n | TranslationContent<NodeType>\n | EnumerationContent<NodeType>\n | ConditionContent<NodeType>\n | InsertionContent<NodeType>\n | MarkdownContent<NodeType>\n | NestedContent<DictionaryKeys>\n | GenderContent<NodeType>\n | FileContent;\n\ntype FetchableContentNode<NodeType> = (\n args?: any\n) => ContentNode<NodeType> | Promise<ContentNode<NodeType>>;\n\nexport type ContentNode<\n T = undefined,\n FetchableNode = false,\n NodeType = T extends undefined ? BaseNode : T,\n> =\n | NodeType\n | TypedNode<NodeType>\n | ((args?: any) => ContentNode<NodeType>)\n | (FetchableNode extends true ? FetchableContentNode<NodeType> : undefined);\n\n// Utility types (unchanged)\ntype IsArray<T> = T extends any[] ? true : false;\n\ntype ReplaceContentValueArray<T, FetchableNode> = T extends (infer U)[]\n ? // Allow either a *single* typed node returning the entire array\n // or an array of typed nodes (or scalar nodes).\n ContentNode<T, FetchableNode> | ReplaceContentValue<U, FetchableNode>[]\n : never;\n\ntype ReplaceContentValueObject<T, FetchableNode> = {\n [K in keyof T]: ReplaceContentValue<T[K], FetchableNode>;\n};\n\n// Modified: allow a full ContentNode wrapper OR an object shape when T is an object\ntype ReplaceContentValue<\n NodeType,\n FetchableNode = true,\n> = NodeType extends object\n ? IsArray<NodeType> extends true\n ? ReplaceContentValueArray<NodeType, FetchableNode>\n :\n | ContentNode<NodeType, FetchableNode>\n | ReplaceContentValueObject<NodeType, FetchableNode>\n : ContentNode<NodeType, FetchableNode>;\n\nexport type AutoFill = true | string | Partial<LanguageContent<string>>;\n\nexport type LocalDictionaryId = string;\n\nexport type Dictionary<ContentType = undefined, FetchableNode = false> = {\n /**\n * _Auto generated by the intlayer, do not modify it_\n *\n * The schema of the dictionary, used for JSON validation\n */\n $schema?: string;\n /**\n * _Auto generated by the intlayer, do not modify it_\n *\n * For remote dictionaries, the id is the id of the dictionary in the remote server\n */\n id?: string;\n /**\n * _Auto generated by the intlayer, do not modify it_\n *\n * Unique Identifier for the dictionaries. Auto generated by the intlayer, it helps to identify the dictionary and know if it is a local or remote dictionary, and his location.\n */\n localId?: LocalDictionaryId;\n /**\n * _Auto generated by the intlayer, do not modify it_\n *\n * For merged dictionaries, the localIds is the ids of the dictionaries that are merged\n */\n localIds?: LocalDictionaryId[];\n /**\n * The key of the dictionary. If multiple dictionaries have the same key, intlayer will merge them.\n *\n * As convention, use '-' to separate the words in the key.\n *\n * Example:\n * ```json\n * {\n * \"key\": \"about-page-meta\",\n * \"content\": { ... }\n * }\n * ```\n */\n key: string;\n /**\n * The title of the dictionary. Helps to identify the dictionary in the editor, and the CMS.\n *\n * Example:\n * ```json\n * {\n * \"key\": \"about-page-meta\",\n * \"title\": \"About Page\",\n * \"content\": { ... }\n * }\n * ```\n */\n title?: string;\n /**\n * The description of the dictionary. Helps to understand the purpose of the dictionary in the editor, and the CMS.\n * The descrtion is also used as context for translations generation.\n *\n * Example:\n * ```ts\n * {\n * \"key\": \"about-page-meta\",\n * \"description\":[\n * \"This dictionary is manage the metadata of the About Page\",\n * \"Consider good practices for SEO:\",\n * \"- The title should be between 50 and 60 characters\",\n * \"- The description should be between 150 and 160 characters\",\n * ].join('\\n'),\n * \"content\": { ... }\n * }\n * ```\n */\n description?: string;\n /**\n * _Auto generated by the intlayer, do not modify it_\n *\n * The available versions of the remote dictionary. Helps to know the versions of the dictionary that are available.\n */\n versions?: string[];\n /**\n * _Managable on the CMS, do not modify it locally_\n *\n * The version of the remote dictionary. Helps to know the version of the dictionary that is currently used.\n */\n version?: string;\n /**\n * _Auto generated by the intlayer, do not modify it_\n *\n * The file path of the local dictionary. Helps to know from what .content file the dictionary has been generated.\n */\n filePath?: string;\n /**\n * Helps to categorize the dictionaries. The tags can provide more context and instructions for the dictionary.\n *\n * Example:\n * ```json\n * {\n * \"key\": \"about-page-meta\",\n * \"tags\": [\"metadata\",\"about-page\"]\n * }\n * ```\n */\n tags?: string[];\n /**\n * Transform the dictionary in a per-locale dictionary.\n * Each field declared in a per-locale dictionary will be transformed in a translation node.\n * If missing, the dictionary will be treated as a multilingual dictionary.\n * If declared, do not use translation nodes in the content.\n *\n * Example:\n * ```json\n * {\n * \"key\": \"about-page\",\n * \"locale\": \"en\",\n * \"content\": {\n * \"multilingualContent\": \"English content\"\n * }\n * }\n * ```\n */\n locale?: LocalesValues;\n /**\n * Instruction to auto fill the dictionary.\n * Can also be declared globally in the `intlayer.config.ts` file.\n *\n * Example:\n * ```json\n * {\n * \"key\": \"about-page\",\n * \"autoFill\": true\n * }\n * ```\n * ```json\n * {\n * \"key\": \"about-page\",\n * \"autoFill\": \"./aboutPage.content.json\"\n * }\n * ```\n * ```json\n * {\n * \"key\": \"about-page\",\n * \"autoFill\": \"/messages/{{locale}}/{{key}}/{{fileName}}.content.json\"\n * }\n * ```\n * ```json\n * {\n * \"key\": \"about-page\",\n * \"autoFill\": {\n * \"fr\": \"./aboutPage.fr.content.json\",\n * \"es\": \"./aboutPage.es.content.json\"\n * }\n * }\n * ```\n *\n */\n autoFill?: AutoFill;\n /**\n * _Auto generated by the intlayer, do not modify it_\n *\n * Indicates if the dictionary has been auto filled.\n * In the case of conflicts, base dictionaryed will override auto filled dictionary.\n */\n autoFilled?: true;\n /**\n * Indicates the priority of the dictionary.\n * In the case of conflicts, the dictionary with the highest priority will override the other dictionaries.\n */\n priority?: number;\n /**\n * _Managable on the CMS, do not modify it locally_\n *\n * For remote dictionaries, indicates if the dictionary is live.\n *\n * Will need the `importMode` to be \"live\" to be effective in the `intlayer.config.ts` file. Will also need the live server to be running.\n *\n * A live dictionary will be fetched at runtime using the live sync API.\n *\n * If live, the dictionary will by transformed to include fetch functions.\n * If not live, the dictionary will be transformed at build time using \"dynamic\" mode to optimize the number of fetch queries, and load performance.\n *\n * If live but the fetch request fails, the dictionary will return the dynamic value of the dictionary as fallback.\n *\n */\n live?: boolean;\n /**\n * _Auto generated by the intlayer, do not modify it_\n *\n * Indicates the location of the dictionary.\n */\n location?: 'distant' | 'locale';\n /**\n * The content of the dictionary.\n *\n * Example:\n * ```tsx\n * import { t, enu, cond, nest, md, insert, file } from \"intlayer\";\n *\n * export default {\n * key: \"about-page-meta\",\n * content: {\n * stringContent: \"About Page Meta\",\n * numberContent: 123,\n * booleanContent: true,\n * multilingualContent: t({\n * en: \"About Page Meta\",\n * fr: \"Meta de la page About\",\n * es: \"Meta de la página About\",\n * }),\n * conditionalContent: cond({\n * true: \"About Page Meta\",\n * false: \"About Page Meta\",\n * }),\n * insertionContent: insert(\"About Page Meta\"),\n * nestedContent: nest(\"about-page\"),\n * markdownContent: md(\"# About Page Meta\"),\n * fileContent: file(\"./path/to/file.txt\"),\n * jsxContent: <h1>About Page Meta</h1>,\n * },\n *\n * } satisfies Dictionary<Content>;\n * ```\n *\n * ```json\n * {\n * \"key\": \"about-page-meta\",\n * \"content\": {\n * \"stringContent\": \"About Page Meta\",\n * \"numberContent\": 123,\n * \"booleanContent\": true,\n * \"multilingualContent\": {\n * \"nodeType\": \"translation\",\n * \"translation\": {\n * \"en\": \"About Page Meta\",\n * \"fr\": \"Meta de la page About\",\n * \"es\": \"Meta de la página About\",\n * },\n * },\n * \"conditionalContent\": {\n * \"nodeType\": \"condition\",\n * \"condition\": {\n * \"true\": \"About Page Meta\",\n * \"false\": \"About Page Meta\",\n * },\n * },\n * \"insertionContent\": {\n * \"nodeType\": \"insertion\",\n * \"insertion\": \"About Page Meta\",\n * },\n * \"nestedContent\": {\n * \"nodeType\": \"nested\",\n * \"nested\": { \"dictionaryKey\": \"about-page\" },\n * },\n * \"markdownContent\": {\n * \"nodeType\": \"markdown\",\n * \"markdown\": \"# About Page Meta\",\n * },\n * \"fileContent\": {\n * \"nodeType\": \"file\",\n * \"file\": \"./path/to/file.txt\",\n * },\n * }\n * }\n * ```\n */\n content: ContentType extends undefined // Applying the generic to replace ContentValue with Replacement\n ? any\n : ReplaceContentValue<ContentType, FetchableNode> | ContentType;\n};\n\nexport type GetSubPath<T, P> = P extends `${infer K}.${infer Rest}`\n ? K extends keyof T\n ? GetSubPath<T[K], Rest>\n : never\n : P extends keyof T\n ? T[P]\n : T;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var types_exports = {};
17
- module.exports = __toCommonJS(types_exports);
18
- __reExport(types_exports, require('./dictionary.cjs'), module.exports);
19
- __reExport(types_exports, require('./keyPath.cjs'), module.exports);
20
- __reExport(types_exports, require('./nodeType.cjs'), module.exports);
21
- __reExport(types_exports, require('./translation.cjs'), module.exports);
22
- // Annotate the CommonJS export names for ESM import in node:
23
- 0 && (module.exports = {
24
- ...require('./dictionary.cjs'),
25
- ...require('./keyPath.cjs'),
26
- ...require('./nodeType.cjs'),
27
- ...require('./translation.cjs')
28
- });
29
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/index.ts"],"sourcesContent":["export * from './dictionary';\nexport * from './keyPath';\nexport * from './nodeType';\nexport * from './translation';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,yBAAd;AACA,0BAAc,sBADd;AAEA,0BAAc,uBAFd;AAGA,0BAAc,0BAHd;","names":[]}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var intlayer_exports = {};
20
- __export(intlayer_exports, {
21
- IConfigLocales: () => import_intlayer.IConfigLocales,
22
- IntlayerDictionaryTypesConnector: () => import_intlayer.IntlayerDictionaryTypesConnector,
23
- LanguageContent: () => import_intlayer.LanguageContent,
24
- LocalesValues: () => import_intlayer.LocalesValues
25
- });
26
- module.exports = __toCommonJS(intlayer_exports);
27
- var import_intlayer = require("intlayer");
28
- // Annotate the CommonJS export names for ESM import in node:
29
- 0 && (module.exports = {
30
- IConfigLocales,
31
- IntlayerDictionaryTypesConnector,
32
- LanguageContent,
33
- LocalesValues
34
- });
35
- //# sourceMappingURL=intlayer.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/intlayer.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * Reexport the intlayer module with the module augmentation because of typescript error\n */\n\nexport {\n IConfigLocales,\n IntlayerDictionaryTypesConnector,\n LanguageContent,\n LocalesValues,\n} from 'intlayer';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,sBAKO;","names":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var keyPath_exports = {};
16
- module.exports = __toCommonJS(keyPath_exports);
17
- //# sourceMappingURL=keyPath.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/keyPath.ts"],"sourcesContent":["import type { NodeType } from './nodeType';\n\nexport type ObjectNode = {\n type: NodeType.Object;\n key: string;\n};\n\nexport type ArrayNode = {\n type: NodeType.Array;\n key: number;\n};\n\nexport type EnumerationNode = {\n type: NodeType.Enumeration;\n key: string;\n};\n\nexport type TranslationNode = {\n type: NodeType.Translation;\n key: string;\n};\n\nexport type ConditionNode = {\n type: NodeType.Condition;\n key: string;\n};\n\nexport type GenderNode = {\n type: NodeType.Gender;\n key: string;\n};\n\nexport type InsertionNode = {\n type: NodeType.Insertion;\n key?: undefined;\n};\n\nexport type MarkdownNode = {\n type: NodeType.Markdown;\n key?: undefined;\n};\n\nexport type ReactNode = {\n type: NodeType.ReactNode;\n key?: undefined;\n};\n\nexport type NestedNode = {\n type: NodeType.Nested;\n key?: undefined;\n};\n\nexport type FileNode = {\n type: NodeType.File;\n key?: undefined;\n};\n\nexport type KeyPath =\n | ObjectNode\n | ArrayNode\n | TranslationNode\n | EnumerationNode\n | InsertionNode\n | GenderNode\n | MarkdownNode\n | ReactNode\n | ConditionNode\n | NestedNode\n | FileNode;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var nodeType_exports = {};
20
- __export(nodeType_exports, {
21
- NodeType: () => NodeType,
22
- formatNodeType: () => formatNodeType
23
- });
24
- module.exports = __toCommonJS(nodeType_exports);
25
- var NodeType = /* @__PURE__ */ ((NodeType2) => {
26
- NodeType2["Translation"] = "translation";
27
- NodeType2["Enumeration"] = "enumeration";
28
- NodeType2["Condition"] = "condition";
29
- NodeType2["Insertion"] = "insertion";
30
- NodeType2["File"] = "file";
31
- NodeType2["Object"] = "object";
32
- NodeType2["Array"] = "array";
33
- NodeType2["Nested"] = "nested";
34
- NodeType2["ReactNode"] = "reactNode";
35
- NodeType2["Markdown"] = "markdown";
36
- NodeType2["Text"] = "text";
37
- NodeType2["Number"] = "number";
38
- NodeType2["Boolean"] = "boolean";
39
- NodeType2["Gender"] = "gender";
40
- NodeType2["Unknown"] = "unknown";
41
- return NodeType2;
42
- })(NodeType || {});
43
- const formatNodeType = (nodeType, content, additionalAttributes) => ({
44
- ...additionalAttributes,
45
- nodeType,
46
- [nodeType]: content
47
- });
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- NodeType,
51
- formatNodeType
52
- });
53
- //# sourceMappingURL=nodeType.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/nodeType.ts"],"sourcesContent":["export enum NodeType {\n Translation = 'translation',\n Enumeration = 'enumeration',\n Condition = 'condition',\n Insertion = 'insertion',\n File = 'file',\n Object = 'object',\n Array = 'array',\n Nested = 'nested',\n ReactNode = 'reactNode',\n Markdown = 'markdown',\n Text = 'text',\n Number = 'number',\n Boolean = 'boolean',\n Gender = 'gender',\n Unknown = 'unknown',\n}\n\ntype AdditionalAttributesType = {\n [key: string]: any;\n};\n\nexport type TypedNodeModel<\n T extends NodeType,\n Content,\n AdditionalAttributes extends AdditionalAttributesType = {},\n> = {\n nodeType: T | `${T}`;\n} & {\n [K in T]: Content;\n} & AdditionalAttributes;\n\nexport const formatNodeType = <\n T extends NodeType,\n Content = any,\n AdditionalAttributes extends AdditionalAttributesType = {},\n>(\n nodeType: T | `${T}`,\n content: Content,\n additionalAttributes?: { [key: string]: any }\n) =>\n ({\n ...additionalAttributes,\n nodeType,\n [nodeType]: content,\n }) as TypedNodeModel<T, Content, AdditionalAttributes>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,iBAAc;AACd,EAAAA,UAAA,iBAAc;AACd,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,WAAQ;AACR,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,eAAY;AACZ,EAAAA,UAAA,cAAW;AACX,EAAAA,UAAA,UAAO;AACP,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,aAAU;AACV,EAAAA,UAAA,YAAS;AACT,EAAAA,UAAA,aAAU;AAfA,SAAAA;AAAA,GAAA;AAgCL,MAAM,iBAAiB,CAK5B,UACA,SACA,0BAEC;AAAA,EACC,GAAG;AAAA,EACH;AAAA,EACA,CAAC,QAAQ,GAAG;AACd;","names":["NodeType"]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var translation_exports = {};
16
- module.exports = __toCommonJS(translation_exports);
17
- //# sourceMappingURL=translation.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/types/translation.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/config/client';\nimport type { IConfigLocales } from './intlayer';\n\n/**\n * If module augmented, it will return the configured locales such as Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH | ...\n * If not, it will return never\n */\nexport type ConfigLocales = keyof IConfigLocales<unknown>;\n\n/**\n * Record of locales and content\n *\n * const myVar1: TranslationContentState<string> = {\n * \"en\": \"\",\n * \"fr\": \"\"\n * }\n *\n * const myVar2: TranslationContentState<{age: number, name: string}> = {\n * \"en\": {age: 1, name: \"test\"},\n * \"fr\": {age: 1, name: \"test\"}\n * }\n */\nexport type TranslationContentState<Content = unknown> = {\n [locale in LocalesValues]?: Content;\n};\n\nexport type LanguageContent<Content = unknown> =\n keyof IConfigLocales<unknown> extends never\n ? TranslationContentState<Content> // Fall including all locales as optional\n : IConfigLocales<Content>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,95 +0,0 @@
1
- import configuration from "@intlayer/config/built";
2
- import { getTranslation } from "../interpreter/index.mjs";
3
- import { deepTransformNode } from "../interpreter/getContent/deepTransform.mjs";
4
- import { NodeType } from "../types/index.mjs";
5
- const hasTranslationNodes = (node) => {
6
- if (typeof node !== "object" || node === null) {
7
- return false;
8
- }
9
- if (node?.nodeType === NodeType.Translation) {
10
- return true;
11
- }
12
- if (Array.isArray(node)) {
13
- return node.some(hasTranslationNodes);
14
- }
15
- return Object.values(node).some(hasTranslationNodes);
16
- };
17
- const filterTranslationsOnlyPlugin = (locale, fallback) => ({
18
- id: "filter-translations-only-plugin",
19
- canHandle: (node) => {
20
- return typeof node === "object" && node !== null;
21
- },
22
- transform: (node, props, deepTransformNode2) => {
23
- if (typeof node === "object" && node?.nodeType === NodeType.Translation) {
24
- const result = structuredClone(
25
- node[NodeType.Translation]
26
- );
27
- for (const key in result) {
28
- const childProps = {
29
- ...props,
30
- children: result[key],
31
- keyPath: [
32
- ...props.keyPath,
33
- { type: NodeType.Translation, key }
34
- ]
35
- };
36
- result[key] = deepTransformNode2(
37
- result[key],
38
- {
39
- ...childProps,
40
- plugins: [
41
- ...(props.plugins ?? []).filter(
42
- (plugin) => plugin.id !== "filter-translations-only-plugin"
43
- )
44
- ]
45
- }
46
- );
47
- }
48
- return getTranslation(result, locale, fallback);
49
- } else if (typeof node === "object" && node !== null && !Array.isArray(node) && !node?.nodeType) {
50
- const result = {};
51
- for (const key in node) {
52
- if (hasTranslationNodes(node[key])) {
53
- const childProps = {
54
- ...props,
55
- children: node[key],
56
- keyPath: [
57
- ...props.keyPath,
58
- { type: NodeType.Object, key }
59
- ]
60
- };
61
- result[key] = deepTransformNode2(node[key], childProps);
62
- }
63
- }
64
- return result;
65
- } else if (Array.isArray(node)) {
66
- return node.map((child, index) => {
67
- const childProps = {
68
- ...props,
69
- children: child,
70
- keyPath: [
71
- ...props.keyPath,
72
- { type: NodeType.Array, key: index }
73
- ]
74
- };
75
- return deepTransformNode2(child, childProps);
76
- });
77
- }
78
- return "to remove from the object";
79
- }
80
- });
81
- const getFilterTranslationsOnlyContent = (node, locale = configuration?.internationalization.defaultLocale, nodeProps, fallback) => {
82
- const plugins = [
83
- filterTranslationsOnlyPlugin(locale, fallback),
84
- ...nodeProps.plugins ?? []
85
- ];
86
- return deepTransformNode(node, {
87
- ...nodeProps,
88
- plugins
89
- });
90
- };
91
- export {
92
- filterTranslationsOnlyPlugin,
93
- getFilterTranslationsOnlyContent
94
- };
95
- //# sourceMappingURL=getFilterTranslationsOnlyContent.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/deepTranformPlugins/getFilterTranslationsOnlyContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport { getTranslation } from '../interpreter';\nimport { deepTransformNode } from '../interpreter/getContent/deepTransform';\nimport {\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from '../interpreter/getContent/plugins';\nimport { TranslationContent } from '../transpiler';\nimport { KeyPath, NodeType, type ContentNode } from '../types';\n\n/**\n * Helper function to check if a node or its children contain translation nodes\n */\nconst hasTranslationNodes = (node: any): boolean => {\n if (typeof node !== 'object' || node === null) {\n return false;\n }\n\n if (node?.nodeType === NodeType.Translation) {\n return true;\n }\n\n if (Array.isArray(node)) {\n return node.some(hasTranslationNodes);\n }\n\n return Object.values(node).some(hasTranslationNodes);\n};\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const filterTranslationsOnlyPlugin = (\n locale: LocalesValues,\n fallback?: LocalesValues\n): Plugins => ({\n id: 'filter-translations-only-plugin',\n canHandle: (node: ContentNode) => {\n // Only handle objects and arrays, not primitives\n return typeof node === 'object' && node !== null;\n },\n transform: (node: ContentNode, props, deepTransformNode) => {\n if (typeof node === 'object' && node?.nodeType === NodeType.Translation) {\n const result = structuredClone(\n (node as TranslationContent)[NodeType.Translation]\n );\n\n for (const key in result) {\n const childProps = {\n ...props,\n children: result[key as unknown as keyof typeof result],\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Translation, key } as KeyPath,\n ],\n };\n result[key as unknown as keyof typeof result] = deepTransformNode(\n result[key as unknown as keyof typeof result],\n {\n ...childProps,\n plugins: [\n ...(props.plugins ?? ([] as Plugins[])).filter(\n (plugin) => plugin.id !== 'filter-translations-only-plugin'\n ),\n ],\n }\n );\n }\n return getTranslation(result, locale, fallback);\n } else if (\n typeof node === 'object' &&\n node !== null &&\n !Array.isArray(node) &&\n !node?.nodeType\n ) {\n // For regular objects, filter out properties that don't contain translations\n const result: Record<string, any> = {};\n for (const key in node as any) {\n if (hasTranslationNodes(node[key])) {\n const childProps = {\n ...props,\n children: node[key],\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Object, key } as KeyPath,\n ],\n };\n result[key] = deepTransformNode(node[key], childProps);\n }\n }\n return result;\n } else if (Array.isArray(node)) {\n // For arrays, keep all items but transform them\n return node.map((child, index) => {\n const childProps = {\n ...props,\n children: child,\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Array, key: index } as KeyPath,\n ],\n };\n return deepTransformNode(child, childProps);\n });\n }\n\n return 'to remove from the object';\n },\n});\n\n/**\n * Return the content of a node with only the translation plugin.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getFilterTranslationsOnlyContent = <\n T extends ContentNode,\n L extends LocalesValues = Locales,\n>(\n node: T,\n locale: L = configuration?.internationalization.defaultLocale as L,\n nodeProps: NodeProps,\n fallback?: LocalesValues\n) => {\n const plugins: Plugins[] = [\n filterTranslationsOnlyPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAE1B,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAOlC,SAAkB,gBAAkC;AAKpD,MAAM,sBAAsB,CAAC,SAAuB;AAClD,MAAI,OAAO,SAAS,YAAY,SAAS,MAAM;AAC7C,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,aAAa,SAAS,aAAa;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,WAAO,KAAK,KAAK,mBAAmB;AAAA,EACtC;AAEA,SAAO,OAAO,OAAO,IAAI,EAAE,KAAK,mBAAmB;AACrD;AAGO,MAAM,+BAA+B,CAC1C,QACA,cACa;AAAA,EACb,IAAI;AAAA,EACJ,WAAW,CAAC,SAAsB;AAEhC,WAAO,OAAO,SAAS,YAAY,SAAS;AAAA,EAC9C;AAAA,EACA,WAAW,CAAC,MAAmB,OAAOA,uBAAsB;AAC1D,QAAI,OAAO,SAAS,YAAY,MAAM,aAAa,SAAS,aAAa;AACvE,YAAM,SAAS;AAAA,QACZ,KAA4B,SAAS,WAAW;AAAA,MACnD;AAEA,iBAAW,OAAO,QAAQ;AACxB,cAAM,aAAa;AAAA,UACjB,GAAG;AAAA,UACH,UAAU,OAAO,GAAqC;AAAA,UACtD,SAAS;AAAA,YACP,GAAG,MAAM;AAAA,YACT,EAAE,MAAM,SAAS,aAAa,IAAI;AAAA,UACpC;AAAA,QACF;AACA,eAAO,GAAqC,IAAIA;AAAA,UAC9C,OAAO,GAAqC;AAAA,UAC5C;AAAA,YACE,GAAG;AAAA,YACH,SAAS;AAAA,cACP,IAAI,MAAM,WAAY,CAAC,GAAiB;AAAA,gBACtC,CAAC,WAAW,OAAO,OAAO;AAAA,cAC5B;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AACA,aAAO,eAAe,QAAQ,QAAQ,QAAQ;AAAA,IAChD,WACE,OAAO,SAAS,YAChB,SAAS,QACT,CAAC,MAAM,QAAQ,IAAI,KACnB,CAAC,MAAM,UACP;AAEA,YAAM,SAA8B,CAAC;AACrC,iBAAW,OAAO,MAAa;AAC7B,YAAI,oBAAoB,KAAK,GAAG,CAAC,GAAG;AAClC,gBAAM,aAAa;AAAA,YACjB,GAAG;AAAA,YACH,UAAU,KAAK,GAAG;AAAA,YAClB,SAAS;AAAA,cACP,GAAG,MAAM;AAAA,cACT,EAAE,MAAM,SAAS,QAAQ,IAAI;AAAA,YAC/B;AAAA,UACF;AACA,iBAAO,GAAG,IAAIA,mBAAkB,KAAK,GAAG,GAAG,UAAU;AAAA,QACvD;AAAA,MACF;AACA,aAAO;AAAA,IACT,WAAW,MAAM,QAAQ,IAAI,GAAG;AAE9B,aAAO,KAAK,IAAI,CAAC,OAAO,UAAU;AAChC,cAAM,aAAa;AAAA,UACjB,GAAG;AAAA,UACH,UAAU;AAAA,UACV,SAAS;AAAA,YACP,GAAG,MAAM;AAAA,YACT,EAAE,MAAM,SAAS,OAAO,KAAK,MAAM;AAAA,UACrC;AAAA,QACF;AACA,eAAOA,mBAAkB,OAAO,UAAU;AAAA,MAC5C,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AACF;AAQO,MAAM,mCAAmC,CAI9C,MACA,SAAY,eAAe,qBAAqB,eAChD,WACA,aACG;AACH,QAAM,UAAqB;AAAA,IACzB,6BAA6B,QAAQ,QAAQ;AAAA,IAC7C,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,SAAO,kBAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["deepTransformNode"]}
@@ -1,40 +0,0 @@
1
- import {
2
- deepTransformNode
3
- } from "../interpreter/index.mjs";
4
- import { NodeType } from "../types/index.mjs";
5
- const filterTranlationsPlugin = (locales) => ({
6
- id: "filter-translations-plugin",
7
- canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Translation,
8
- transform: (node, props, deepTransformNode2) => {
9
- const translationMap = node.translation;
10
- const filteredTranslationMap = Object.fromEntries(
11
- Object.entries(translationMap).filter(
12
- ([key]) => locales.includes(key)
13
- )
14
- );
15
- return {
16
- ...node,
17
- translation: deepTransformNode2(filteredTranslationMap, {
18
- ...props,
19
- keyPath: [
20
- ...props.keyPath,
21
- { type: NodeType.Object, key: NodeType.Translation }
22
- ]
23
- })
24
- };
25
- }
26
- });
27
- const getFilteredLocalesContent = (node, locale, nodeProps) => {
28
- const plugins = [
29
- filterTranlationsPlugin(locale),
30
- ...nodeProps.plugins ?? []
31
- ];
32
- return deepTransformNode(node, {
33
- ...nodeProps,
34
- plugins
35
- });
36
- };
37
- export {
38
- getFilteredLocalesContent
39
- };
40
- //# sourceMappingURL=getFilteredLocalesContent.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/deepTranformPlugins/getFilteredLocalesContent.ts"],"sourcesContent":["import type { Locales, LocalesValues } from '@intlayer/config/client';\nimport {\n type NodeProps,\n type Plugins,\n deepTransformNode,\n} from '../interpreter';\nimport { type ContentNode, NodeType } from '../types';\n\nconst filterTranlationsPlugin = (\n locales: LocalesValues[] | LocalesValues\n): Plugins => ({\n id: 'filter-translations-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Translation,\n transform: (node, props, deepTransformNode) => {\n const translationMap = node.translation as Record<Locales, string>;\n\n const filteredTranslationMap = Object.fromEntries(\n Object.entries(translationMap).filter(([key]) =>\n locales.includes(key as Locales)\n )\n );\n\n return {\n ...node,\n translation: deepTransformNode(filteredTranslationMap, {\n ...props,\n keyPath: [\n ...props.keyPath,\n { type: NodeType.Object, key: NodeType.Translation },\n ],\n }),\n };\n },\n});\n\nexport const getFilteredLocalesContent = (\n node: ContentNode,\n locale: LocalesValues | LocalesValues[],\n nodeProps: NodeProps\n) => {\n const plugins: Plugins[] = [\n filterTranlationsPlugin(locale),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n });\n};\n"],"mappings":"AACA;AAAA,EAGE;AAAA,OACK;AACP,SAA2B,gBAAgB;AAE3C,MAAM,0BAA0B,CAC9B,aACa;AAAA,EACb,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,SAAS;AAAA,EAC1D,WAAW,CAAC,MAAM,OAAOA,uBAAsB;AAC7C,UAAM,iBAAiB,KAAK;AAE5B,UAAM,yBAAyB,OAAO;AAAA,MACpC,OAAO,QAAQ,cAAc,EAAE;AAAA,QAAO,CAAC,CAAC,GAAG,MACzC,QAAQ,SAAS,GAAc;AAAA,MACjC;AAAA,IACF;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,aAAaA,mBAAkB,wBAAwB;AAAA,QACrD,GAAG;AAAA,QACH,SAAS;AAAA,UACP,GAAG,MAAM;AAAA,UACT,EAAE,MAAM,SAAS,QAAQ,KAAK,SAAS,YAAY;AAAA,QACrD;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEO,MAAM,4BAA4B,CACvC,MACA,QACA,cACG;AACH,QAAM,UAAqB;AAAA,IACzB,wBAAwB,MAAM;AAAA,IAC9B,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,SAAO,kBAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["deepTransformNode"]}
@@ -1,19 +0,0 @@
1
- import configuration from "@intlayer/config/built";
2
- import { deepTransformNode } from "../interpreter/getContent/deepTransform.mjs";
3
- import {
4
- translationPlugin
5
- } from "../interpreter/getContent/plugins.mjs";
6
- const getLocalisedContent = (node, locale = configuration?.internationalization.defaultLocale, nodeProps, fallback) => {
7
- const plugins = [
8
- translationPlugin(locale, fallback),
9
- ...nodeProps.plugins ?? []
10
- ];
11
- return deepTransformNode(node, {
12
- ...nodeProps,
13
- plugins
14
- });
15
- };
16
- export {
17
- getLocalisedContent
18
- };
19
- //# sourceMappingURL=getLocalisedContent.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/deepTranformPlugins/getLocalisedContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport { deepTransformNode } from '../interpreter/getContent/deepTransform';\nimport {\n translationPlugin,\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from '../interpreter/getContent/plugins';\nimport type { ContentNode } from '../types';\n\n/**\n * Transforms a node in a single pass, applying each plugin as needed.\n * In comparison to `getContent`, this function will only apply the translation plugin.\n * It will not transform enumerations, insertions, or other content types.\n *\n * @param node The node to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n */\nexport const getLocalisedContent = <\n T extends ContentNode,\n L extends LocalesValues = Locales,\n>(\n node: T,\n locale: L = configuration?.internationalization.defaultLocale as L,\n nodeProps: NodeProps,\n fallback?: LocalesValues // fallback mean that if field is not translated, it will use the default locale\n) => {\n const plugins: Plugins[] = [\n translationPlugin(locale, fallback),\n ...(nodeProps.plugins ?? []),\n ];\n\n return deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAE1B,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,OAIK;AAWA,MAAM,sBAAsB,CAIjC,MACA,SAAY,eAAe,qBAAqB,eAChD,WACA,aACG;AACH,QAAM,UAAqB;AAAA,IACzB,kBAAkB,QAAQ,QAAQ;AAAA,IAClC,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,SAAO,kBAAkB,MAAM;AAAA,IAC7B,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -1,24 +0,0 @@
1
- import { deepTransformNode } from "../interpreter/index.mjs";
2
- const passTypedNodePlugin = {
3
- id: "pass-typed-node-plugin",
4
- canHandle: (node) => typeof node === "object" && typeof node?.nodeType === "string",
5
- transform: (node, props, deepTransformNode2) => deepTransformNode2(node[node.nodeType], props)
6
- };
7
- const buildMaskPlugin = {
8
- id: "build-mask-plugin",
9
- canHandle: (node) => typeof node === "string" || typeof node === "number",
10
- transform: () => true
11
- };
12
- const getMaskContent = (source) => ({
13
- ...source,
14
- content: deepTransformNode(source.content, {
15
- dictionaryKey: source.key,
16
- keyPath: [],
17
- plugins: [passTypedNodePlugin, buildMaskPlugin]
18
- })
19
- });
20
- export {
21
- buildMaskPlugin,
22
- getMaskContent
23
- };
24
- //# sourceMappingURL=getMaskContent.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/deepTranformPlugins/getMaskContent.ts"],"sourcesContent":["import { deepTransformNode, type Plugins } from '../interpreter';\nimport { type Dictionary } from '../types';\n\nconst passTypedNodePlugin: Plugins = {\n id: 'pass-typed-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' && typeof node?.nodeType === 'string',\n transform: (node, props, deepTransformNode) =>\n deepTransformNode(node[node.nodeType], props),\n};\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const buildMaskPlugin: Plugins = {\n id: 'build-mask-plugin',\n canHandle: (node) => typeof node === 'string' || typeof node === 'number',\n transform: () => true,\n};\n\nexport const getMaskContent = (source: Dictionary): any => ({\n ...source,\n content: deepTransformNode(source.content, {\n dictionaryKey: source.key,\n keyPath: [],\n plugins: [passTypedNodePlugin, buildMaskPlugin],\n }),\n});\n"],"mappings":"AAAA,SAAS,yBAAuC;AAGhD,MAAM,sBAA+B;AAAA,EACnC,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,OAAO,MAAM,aAAa;AAAA,EACxD,WAAW,CAAC,MAAM,OAAOA,uBACvBA,mBAAkB,KAAK,KAAK,QAAQ,GAAG,KAAK;AAChD;AAGO,MAAM,kBAA2B;AAAA,EACtC,IAAI;AAAA,EACJ,WAAW,CAAC,SAAS,OAAO,SAAS,YAAY,OAAO,SAAS;AAAA,EACjE,WAAW,MAAM;AACnB;AAEO,MAAM,iBAAiB,CAAC,YAA6B;AAAA,EAC1D,GAAG;AAAA,EACH,SAAS,kBAAkB,OAAO,SAAS;AAAA,IACzC,eAAe,OAAO;AAAA,IACtB,SAAS,CAAC;AAAA,IACV,SAAS,CAAC,qBAAqB,eAAe;AAAA,EAChD,CAAC;AACH;","names":["deepTransformNode"]}
@@ -1,43 +0,0 @@
1
- import configuration from "@intlayer/config/built";
2
- import { deepTransformNode } from "../interpreter/getContent/deepTransform.mjs";
3
- import { NodeType } from "../types/index.mjs";
4
- const checkMissingLocalesPlugin = (locales, onMissingLocale) => ({
5
- id: "check-missing-locales-plugin",
6
- canHandle: (node) => typeof node === "object" && node?.nodeType === NodeType.Translation,
7
- transform: (node, props, deepTransformNode2) => {
8
- for (const locale of locales) {
9
- if (!node[NodeType.Translation][locale]) {
10
- onMissingLocale(locale);
11
- }
12
- }
13
- const translations = node[NodeType.Translation];
14
- for (const key in translations) {
15
- const child = translations[key];
16
- deepTransformNode2(child, {
17
- ...props,
18
- children: child
19
- });
20
- }
21
- return node;
22
- }
23
- });
24
- const getMissingLocalesContent = (node, locales = configuration?.internationalization.locales, nodeProps) => {
25
- const missingLocales = /* @__PURE__ */ new Set();
26
- const plugins = [
27
- checkMissingLocalesPlugin(
28
- locales,
29
- (locale) => missingLocales.add(locale)
30
- ),
31
- ...nodeProps.plugins ?? []
32
- ];
33
- deepTransformNode(node, {
34
- ...nodeProps,
35
- plugins
36
- });
37
- return Array.from(missingLocales);
38
- };
39
- export {
40
- checkMissingLocalesPlugin,
41
- getMissingLocalesContent
42
- };
43
- //# sourceMappingURL=getMissingLocalesContent.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/deepTranformPlugins/getMissingLocalesContent.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { Locales, LocalesValues } from '@intlayer/config/client';\nimport { deepTransformNode } from '../interpreter/getContent/deepTransform';\nimport {\n type DeepTransformContent,\n type NodeProps,\n type Plugins,\n} from '../interpreter/getContent/plugins';\nimport { TranslationContent } from '../transpiler';\nimport { NodeType, type ContentNode } from '../types';\n\n/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */\nexport const checkMissingLocalesPlugin = (\n locales: Locales[],\n onMissingLocale: (locale: Locales) => void\n): Plugins => ({\n id: 'check-missing-locales-plugin',\n canHandle: (node) =>\n typeof node === 'object' && node?.nodeType === NodeType.Translation,\n transform: (node: TranslationContent, props, deepTransformNode) => {\n for (const locale of locales) {\n if (\n !node[NodeType.Translation][\n locale as keyof (typeof node)[NodeType.Translation]\n ]\n ) {\n onMissingLocale(locale);\n }\n }\n\n // Continue traversal inside the translation values, but avoid re-applying this plugin on the same node\n const translations = node[NodeType.Translation] as Record<string, any>;\n for (const key in translations) {\n const child = translations[key];\n deepTransformNode(child, {\n ...props,\n children: child,\n });\n }\n\n // Return the original node; the return value is ignored by the caller\n return node;\n },\n});\n\n/**\n * Return the content of a node with only the translation plugin.\n *\n * @param node The node to transform.\n * @param locales The locales to check for missing translations.\n */\nexport const getMissingLocalesContent = <T extends ContentNode>(\n node: T,\n locales: LocalesValues[] = configuration?.internationalization.locales,\n nodeProps: NodeProps\n): Locales[] => {\n const missingLocales = new Set<Locales>();\n\n const plugins: Plugins[] = [\n checkMissingLocalesPlugin(locales as Locales[], (locale) =>\n missingLocales.add(locale)\n ),\n ...(nodeProps.plugins ?? []),\n ];\n\n deepTransformNode(node, {\n ...nodeProps,\n plugins,\n }) as DeepTransformContent<T>;\n\n return Array.from(missingLocales);\n};\n"],"mappings":"AAAA,OAAO,mBAAmB;AAE1B,SAAS,yBAAyB;AAOlC,SAAS,gBAAkC;AAGpC,MAAM,4BAA4B,CACvC,SACA,qBACa;AAAA,EACb,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,MAAM,aAAa,SAAS;AAAA,EAC1D,WAAW,CAAC,MAA0B,OAAOA,uBAAsB;AACjE,eAAW,UAAU,SAAS;AAC5B,UACE,CAAC,KAAK,SAAS,WAAW,EACxB,MACF,GACA;AACA,wBAAgB,MAAM;AAAA,MACxB;AAAA,IACF;AAGA,UAAM,eAAe,KAAK,SAAS,WAAW;AAC9C,eAAW,OAAO,cAAc;AAC9B,YAAM,QAAQ,aAAa,GAAG;AAC9B,MAAAA,mBAAkB,OAAO;AAAA,QACvB,GAAG;AAAA,QACH,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAGA,WAAO;AAAA,EACT;AACF;AAQO,MAAM,2BAA2B,CACtC,MACA,UAA2B,eAAe,qBAAqB,SAC/D,cACc;AACd,QAAM,iBAAiB,oBAAI,IAAa;AAExC,QAAM,UAAqB;AAAA,IACzB;AAAA,MAA0B;AAAA,MAAsB,CAAC,WAC/C,eAAe,IAAI,MAAM;AAAA,IAC3B;AAAA,IACA,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,oBAAkB,MAAM;AAAA,IACtB,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AAED,SAAO,MAAM,KAAK,cAAc;AAClC;","names":["deepTransformNode"]}
@@ -1,60 +0,0 @@
1
- import {
2
- deepTransformNode
3
- } from "../interpreter/index.mjs";
4
- const replaceValuesPlugin = (value) => ({
5
- id: "replace-values-plugin",
6
- canHandle: (node) => typeof node === "string" || typeof node === "number" || typeof node === "boolean",
7
- transform: () => value
8
- });
9
- const skipTypedNodePlugin = {
10
- id: "skip-typed-node-plugin",
11
- canHandle: (node) => typeof node === "object" && typeof node?.nodeType === "string",
12
- transform: (node, props, deepTransformNode2) => {
13
- const nodeType = node.nodeType;
14
- const result = structuredClone(
15
- node[nodeType]
16
- );
17
- if (typeof result !== "object" || result === null) {
18
- const transformedResult = deepTransformNode2(result, {
19
- ...props,
20
- children: result,
21
- keyPath: [
22
- ...props.keyPath,
23
- { type: nodeType, key: nodeType }
24
- ]
25
- });
26
- return {
27
- ...node,
28
- [nodeType]: transformedResult
29
- };
30
- }
31
- for (const key in result) {
32
- const childProps = {
33
- ...props,
34
- children: result[key],
35
- keyPath: [...props.keyPath, { type: nodeType, key }]
36
- };
37
- result[key] = deepTransformNode2(
38
- result[key],
39
- childProps
40
- );
41
- }
42
- return { ...node, [nodeType]: result };
43
- }
44
- };
45
- const getReplacedValuesContent = (node, value, nodeProps) => {
46
- const plugins = [
47
- skipTypedNodePlugin,
48
- replaceValuesPlugin(value),
49
- ...nodeProps.plugins ?? []
50
- ];
51
- const JSONNode = JSON.parse(JSON.stringify(node));
52
- return deepTransformNode(JSONNode, {
53
- ...nodeProps,
54
- plugins
55
- });
56
- };
57
- export {
58
- getReplacedValuesContent
59
- };
60
- //# sourceMappingURL=getReplacedValuesContent.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/deepTranformPlugins/getReplacedValuesContent.ts"],"sourcesContent":["import {\n deepTransformNode,\n type NodeProps,\n type Plugins,\n} from '../interpreter';\nimport { KeyPath, NodeType, TypedNode, type ContentNode } from '../types';\n\nconst replaceValuesPlugin = (value: string | number | boolean): Plugins => ({\n id: 'replace-values-plugin',\n canHandle: (node) =>\n typeof node === 'string' ||\n typeof node === 'number' ||\n typeof node === 'boolean',\n transform: () => value,\n});\n\nconst skipTypedNodePlugin: Plugins = {\n id: 'skip-typed-node-plugin',\n canHandle: (node) =>\n typeof node === 'object' && typeof node?.nodeType === 'string',\n transform: (node: TypedNode, props, deepTransformNode) => {\n const nodeType = node.nodeType as NodeType;\n const result = structuredClone(\n node[nodeType as unknown as keyof TypedNode] as any\n );\n\n // If the result is a primitive value (string, number, boolean),\n // we need to transform it directly instead of iterating over its properties\n if (typeof result !== 'object' || result === null) {\n const transformedResult = deepTransformNode(result, {\n ...props,\n children: result,\n keyPath: [\n ...props.keyPath,\n { type: nodeType, key: nodeType } as KeyPath,\n ],\n });\n return {\n ...node,\n [nodeType as unknown as keyof TypedNode]: transformedResult,\n };\n }\n\n // For objects and arrays, iterate over their properties\n for (const key in result) {\n const childProps = {\n ...props,\n children: result[key as unknown as keyof typeof result],\n keyPath: [...props.keyPath, { type: nodeType, key } as KeyPath],\n };\n result[key as unknown as keyof typeof result] = deepTransformNode(\n result[key as unknown as keyof typeof result],\n childProps\n );\n }\n\n return { ...node, [nodeType as unknown as keyof TypedNode]: result };\n },\n};\n\nexport const getReplacedValuesContent = (\n node: ContentNode,\n value: string | number | boolean,\n nodeProps: NodeProps\n) => {\n const plugins: Plugins[] = [\n skipTypedNodePlugin,\n replaceValuesPlugin(value),\n ...(nodeProps.plugins ?? []),\n ];\n\n const JSONNode = JSON.parse(JSON.stringify(node));\n\n return deepTransformNode(JSONNode, {\n ...nodeProps,\n plugins,\n });\n};\n"],"mappings":"AAAA;AAAA,EACE;AAAA,OAGK;AAGP,MAAM,sBAAsB,CAAC,WAA+C;AAAA,EAC1E,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAChB,OAAO,SAAS,YAChB,OAAO,SAAS;AAAA,EAClB,WAAW,MAAM;AACnB;AAEA,MAAM,sBAA+B;AAAA,EACnC,IAAI;AAAA,EACJ,WAAW,CAAC,SACV,OAAO,SAAS,YAAY,OAAO,MAAM,aAAa;AAAA,EACxD,WAAW,CAAC,MAAiB,OAAOA,uBAAsB;AACxD,UAAM,WAAW,KAAK;AACtB,UAAM,SAAS;AAAA,MACb,KAAK,QAAsC;AAAA,IAC7C;AAIA,QAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AACjD,YAAM,oBAAoBA,mBAAkB,QAAQ;AAAA,QAClD,GAAG;AAAA,QACH,UAAU;AAAA,QACV,SAAS;AAAA,UACP,GAAG,MAAM;AAAA,UACT,EAAE,MAAM,UAAU,KAAK,SAAS;AAAA,QAClC;AAAA,MACF,CAAC;AACD,aAAO;AAAA,QACL,GAAG;AAAA,QACH,CAAC,QAAsC,GAAG;AAAA,MAC5C;AAAA,IACF;AAGA,eAAW,OAAO,QAAQ;AACxB,YAAM,aAAa;AAAA,QACjB,GAAG;AAAA,QACH,UAAU,OAAO,GAAqC;AAAA,QACtD,SAAS,CAAC,GAAG,MAAM,SAAS,EAAE,MAAM,UAAU,IAAI,CAAY;AAAA,MAChE;AACA,aAAO,GAAqC,IAAIA;AAAA,QAC9C,OAAO,GAAqC;AAAA,QAC5C;AAAA,MACF;AAAA,IACF;AAEA,WAAO,EAAE,GAAG,MAAM,CAAC,QAAsC,GAAG,OAAO;AAAA,EACrE;AACF;AAEO,MAAM,2BAA2B,CACtC,MACA,OACA,cACG;AACH,QAAM,UAAqB;AAAA,IACzB;AAAA,IACA,oBAAoB,KAAK;AAAA,IACzB,GAAI,UAAU,WAAW,CAAC;AAAA,EAC5B;AAEA,QAAM,WAAW,KAAK,MAAM,KAAK,UAAU,IAAI,CAAC;AAEhD,SAAO,kBAAkB,UAAU;AAAA,IACjC,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;","names":["deepTransformNode"]}
@@ -1,7 +0,0 @@
1
- export * from "./getFilteredLocalesContent.mjs";
2
- export * from "./getFilterTranslationsOnlyContent.mjs";
3
- export * from "./getLocalisedContent.mjs";
4
- export * from "./getMaskContent.mjs";
5
- export * from "./getMissingLocalesContent.mjs";
6
- export * from "./getReplacedValuesContent.mjs";
7
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/deepTranformPlugins/index.ts"],"sourcesContent":["export * from './getFilteredLocalesContent';\nexport * from './getFilterTranslationsOnlyContent';\nexport * from './getLocalisedContent';\nexport * from './getMaskContent';\nexport * from './getMissingLocalesContent';\nexport * from './getReplacedValuesContent';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/index.ts"],"sourcesContent":["export * from './editDictionaryByKeyPath';\nexport * from './getContentNodeByKeyPath';\nexport * from './getDefaultNode';\nexport * from './getEmptyNode';\nexport * from './getNodeChildren';\nexport * from './getNodeType';\nexport * from './getUnmergedDictionaryByKeyPath';\nexport * from './removeContentNodeByKeyPath';\nexport * from './renameContentNodeByKeyPath';\nexport * from './updateNodeChildren';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/formatters/index.ts"],"sourcesContent":["export * from './compact';\nexport * from './currency';\nexport * from './date';\nexport * from './list';\nexport * from './number';\nexport * from './percentage';\nexport * from './relativeTime';\nexport * from './units';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './deepTranformPlugins';\nexport * from './dictionaryManipulator/index';\nexport * from './formatters/index';\nexport * from './interpreter/index';\nexport * from './localization/index';\nexport * from './transpiler/index';\nexport * from './types/index';\nexport * from './utils/checkIsURLAbsolute';\nexport * from './utils/intl';\nexport * from './utils/isSameKeyPath';\nexport * from './utils/isValidReactElement';\nexport * from './utils/parseYaml';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/interpreter/getContent/index.ts"],"sourcesContent":["export * from './deepTransform';\nexport * from './getContent';\nexport * from './plugins';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}