@intlayer/core 8.4.3 → 8.4.5

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 (780) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs +213 -1
  3. package/dist/cjs/deepTransformPlugins/getFilterMissingTranslationsContent.cjs.map +1 -1
  4. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs +95 -1
  5. package/dist/cjs/deepTransformPlugins/getFilterTranslationsOnlyContent.cjs.map +1 -1
  6. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs +46 -1
  7. package/dist/cjs/deepTransformPlugins/getFilteredLocalesContent.cjs.map +1 -1
  8. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs +33 -1
  9. package/dist/cjs/deepTransformPlugins/getLocalizedContent.cjs.map +1 -1
  10. package/dist/cjs/deepTransformPlugins/getMaskContent.cjs +27 -1
  11. package/dist/cjs/deepTransformPlugins/getMaskContent.cjs.map +1 -1
  12. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs +151 -1
  13. package/dist/cjs/deepTransformPlugins/getMissingLocalesContent.cjs.map +1 -1
  14. package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs +87 -1
  15. package/dist/cjs/deepTransformPlugins/getMultilingualDictionary.cjs.map +1 -1
  16. package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs +60 -1
  17. package/dist/cjs/deepTransformPlugins/getReplacedValuesContent.cjs.map +1 -1
  18. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs +123 -1
  19. package/dist/cjs/deepTransformPlugins/getSplittedContent.cjs.map +1 -1
  20. package/dist/cjs/deepTransformPlugins/index.cjs +32 -1
  21. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs +107 -1
  22. package/dist/cjs/deepTransformPlugins/insertContentInDictionary.cjs.map +1 -1
  23. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs +65 -1
  24. package/dist/cjs/dictionaryManipulator/editDictionaryByKeyPath.cjs.map +1 -1
  25. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs +19 -1
  26. package/dist/cjs/dictionaryManipulator/getContentNodeByKeyPath.cjs.map +1 -1
  27. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs +56 -1
  28. package/dist/cjs/dictionaryManipulator/getDefaultNode.cjs.map +1 -1
  29. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs +27 -1
  30. package/dist/cjs/dictionaryManipulator/getEmptyNode.cjs.map +1 -1
  31. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs +24 -1
  32. package/dist/cjs/dictionaryManipulator/getNodeChildren.cjs.map +1 -1
  33. package/dist/cjs/dictionaryManipulator/getNodeType.cjs +55 -1
  34. package/dist/cjs/dictionaryManipulator/getNodeType.cjs.map +1 -1
  35. package/dist/cjs/dictionaryManipulator/index.cjs +27 -1
  36. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs +69 -1
  37. package/dist/cjs/dictionaryManipulator/mergeDictionaries.cjs.map +1 -1
  38. package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs +30 -1
  39. package/dist/cjs/dictionaryManipulator/normalizeDictionary.cjs.map +1 -1
  40. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs +48 -1
  41. package/dist/cjs/dictionaryManipulator/orderDictionaries.cjs.map +1 -1
  42. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs +32 -1
  43. package/dist/cjs/dictionaryManipulator/removeContentNodeByKeyPath.cjs.map +1 -1
  44. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs +40 -1
  45. package/dist/cjs/dictionaryManipulator/renameContentNodeByKeyPath.cjs.map +1 -1
  46. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs +39 -1
  47. package/dist/cjs/dictionaryManipulator/updateNodeChildren.cjs.map +1 -1
  48. package/dist/cjs/formatters/compact.cjs +25 -1
  49. package/dist/cjs/formatters/compact.cjs.map +1 -1
  50. package/dist/cjs/formatters/currency.cjs +29 -1
  51. package/dist/cjs/formatters/currency.cjs.map +1 -1
  52. package/dist/cjs/formatters/date.cjs +60 -1
  53. package/dist/cjs/formatters/date.cjs.map +1 -1
  54. package/dist/cjs/formatters/index.cjs +23 -1
  55. package/dist/cjs/formatters/list.cjs +30 -1
  56. package/dist/cjs/formatters/list.cjs.map +1 -1
  57. package/dist/cjs/formatters/number.cjs +20 -1
  58. package/dist/cjs/formatters/number.cjs.map +1 -1
  59. package/dist/cjs/formatters/percentage.cjs +27 -1
  60. package/dist/cjs/formatters/percentage.cjs.map +1 -1
  61. package/dist/cjs/formatters/relativeTime.cjs +43 -1
  62. package/dist/cjs/formatters/relativeTime.cjs.map +1 -1
  63. package/dist/cjs/formatters/units.cjs +23 -1
  64. package/dist/cjs/formatters/units.cjs.map +1 -1
  65. package/dist/cjs/getStorageAttributes.cjs +134 -1
  66. package/dist/cjs/getStorageAttributes.cjs.map +1 -1
  67. package/dist/cjs/index.cjs +315 -1
  68. package/dist/cjs/interpreter/getCondition.cjs +27 -1
  69. package/dist/cjs/interpreter/getCondition.cjs.map +1 -1
  70. package/dist/cjs/interpreter/getContent/deepTransform.cjs +42 -1
  71. package/dist/cjs/interpreter/getContent/deepTransform.cjs.map +1 -1
  72. package/dist/cjs/interpreter/getContent/getContent.cjs +32 -1
  73. package/dist/cjs/interpreter/getContent/getContent.cjs.map +1 -0
  74. package/dist/cjs/interpreter/getContent/index.cjs +15 -1
  75. package/dist/cjs/interpreter/getContent/plugins.cjs +163 -1
  76. package/dist/cjs/interpreter/getContent/plugins.cjs.map +1 -0
  77. package/dist/cjs/interpreter/getDictionary.cjs +25 -1
  78. package/dist/cjs/interpreter/getDictionary.cjs.map +1 -0
  79. package/dist/cjs/interpreter/getEnumeration.cjs +72 -1
  80. package/dist/cjs/interpreter/getEnumeration.cjs.map +1 -1
  81. package/dist/cjs/interpreter/getGender.cjs +38 -1
  82. package/dist/cjs/interpreter/getGender.cjs.map +1 -1
  83. package/dist/cjs/interpreter/getHTML.cjs +124 -1
  84. package/dist/cjs/interpreter/getHTML.cjs.map +1 -1
  85. package/dist/cjs/interpreter/getInsertion.cjs +22 -1
  86. package/dist/cjs/interpreter/getInsertion.cjs.map +1 -1
  87. package/dist/cjs/interpreter/getIntlayer.cjs +41 -1
  88. package/dist/cjs/interpreter/getIntlayer.cjs.map +1 -0
  89. package/dist/cjs/interpreter/getNesting.cjs +37 -1
  90. package/dist/cjs/interpreter/getNesting.cjs.map +1 -0
  91. package/dist/cjs/interpreter/getTranslation.cjs +112 -1
  92. package/dist/cjs/interpreter/getTranslation.cjs.map +1 -1
  93. package/dist/cjs/interpreter/index.cjs +32 -1
  94. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs +55 -1
  95. package/dist/cjs/interpreter/splitAndJoinInsertion.cjs.map +1 -1
  96. package/dist/cjs/localization/getBrowserLocale.cjs +143 -1
  97. package/dist/cjs/localization/getBrowserLocale.cjs.map +1 -1
  98. package/dist/cjs/localization/getHTMLTextDir.cjs +40 -1
  99. package/dist/cjs/localization/getHTMLTextDir.cjs.map +1 -1
  100. package/dist/cjs/localization/getLocale.cjs +27 -1
  101. package/dist/cjs/localization/getLocale.cjs.map +1 -1
  102. package/dist/cjs/localization/getLocaleFromPath.cjs +36 -1
  103. package/dist/cjs/localization/getLocaleFromPath.cjs.map +1 -1
  104. package/dist/cjs/localization/getLocaleLang.cjs +20 -1
  105. package/dist/cjs/localization/getLocaleLang.cjs.map +1 -1
  106. package/dist/cjs/localization/getLocaleName.cjs +10 -1
  107. package/dist/cjs/localization/getLocaleName.cjs.map +1 -1
  108. package/dist/cjs/localization/getLocalizedUrl.cjs +73 -1
  109. package/dist/cjs/localization/getLocalizedUrl.cjs.map +1 -1
  110. package/dist/cjs/localization/getMultilingualUrls.cjs +46 -1
  111. package/dist/cjs/localization/getMultilingualUrls.cjs.map +1 -1
  112. package/dist/cjs/localization/getPathWithoutLocale.cjs +55 -1
  113. package/dist/cjs/localization/getPathWithoutLocale.cjs.map +1 -1
  114. package/dist/cjs/localization/getPrefix.cjs +73 -1
  115. package/dist/cjs/localization/getPrefix.cjs.map +1 -1
  116. package/dist/cjs/localization/index.cjs +41 -1
  117. package/dist/cjs/localization/localeDetector.cjs +133 -1
  118. package/dist/cjs/localization/localeDetector.cjs.map +1 -1
  119. package/dist/cjs/localization/localeMapper.cjs +124 -1
  120. package/dist/cjs/localization/localeMapper.cjs.map +1 -1
  121. package/dist/cjs/localization/localeResolver.cjs +28 -1
  122. package/dist/cjs/localization/localeResolver.cjs.map +1 -1
  123. package/dist/cjs/localization/rewriteUtils.cjs +110 -1
  124. package/dist/cjs/localization/rewriteUtils.cjs.map +1 -1
  125. package/dist/cjs/localization/validatePrefix.cjs +45 -1
  126. package/dist/cjs/localization/validatePrefix.cjs.map +1 -1
  127. package/dist/cjs/markdown/compiler.cjs +810 -10
  128. package/dist/cjs/markdown/compiler.cjs.map +1 -1
  129. package/dist/cjs/markdown/constants.cjs +328 -1
  130. package/dist/cjs/markdown/constants.cjs.map +1 -1
  131. package/dist/cjs/markdown/index.cjs +126 -1
  132. package/dist/cjs/markdown/parser.cjs +66 -1
  133. package/dist/cjs/markdown/parser.cjs.map +1 -1
  134. package/dist/cjs/markdown/renderer.cjs +61 -1
  135. package/dist/cjs/markdown/renderer.cjs.map +1 -1
  136. package/dist/cjs/markdown/utils.cjs +391 -6
  137. package/dist/cjs/markdown/utils.cjs.map +1 -1
  138. package/dist/cjs/messageFormat/ICU.cjs +334 -1
  139. package/dist/cjs/messageFormat/ICU.cjs.map +1 -1
  140. package/dist/cjs/messageFormat/i18next.cjs +345 -1
  141. package/dist/cjs/messageFormat/i18next.cjs.map +1 -1
  142. package/dist/cjs/messageFormat/index.cjs +11 -1
  143. package/dist/cjs/messageFormat/verify-icu-format.cjs +64 -2
  144. package/dist/cjs/messageFormat/verify-icu-format.cjs.map +1 -1
  145. package/dist/cjs/messageFormat/vue-i18n.cjs +181 -1
  146. package/dist/cjs/messageFormat/vue-i18n.cjs.map +1 -1
  147. package/dist/cjs/transpiler/condition/condition.cjs +26 -1
  148. package/dist/cjs/transpiler/condition/condition.cjs.map +1 -1
  149. package/dist/cjs/transpiler/condition/index.cjs +4 -1
  150. package/dist/cjs/transpiler/enumeration/enumeration.cjs +28 -1
  151. package/dist/cjs/transpiler/enumeration/enumeration.cjs.map +1 -1
  152. package/dist/cjs/transpiler/enumeration/index.cjs +4 -1
  153. package/dist/cjs/transpiler/file/file.cjs +51 -1
  154. package/dist/cjs/transpiler/file/file.cjs.map +1 -1
  155. package/dist/cjs/transpiler/file/fileBrowser.cjs +24 -1
  156. package/dist/cjs/transpiler/file/fileBrowser.cjs.map +1 -1
  157. package/dist/cjs/transpiler/file/index.cjs +5 -1
  158. package/dist/cjs/transpiler/gender/gender.cjs +26 -1
  159. package/dist/cjs/transpiler/gender/gender.cjs.map +1 -1
  160. package/dist/cjs/transpiler/gender/index.cjs +4 -1
  161. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs +45 -1
  162. package/dist/cjs/transpiler/html/getHTMLCustomComponents.cjs.map +1 -0
  163. package/dist/cjs/transpiler/html/html.cjs +44 -1
  164. package/dist/cjs/transpiler/html/html.cjs.map +1 -0
  165. package/dist/cjs/transpiler/html/htmlTags.cjs +116 -1
  166. package/dist/cjs/transpiler/html/htmlTags.cjs.map +1 -1
  167. package/dist/cjs/transpiler/html/index.cjs +9 -1
  168. package/dist/cjs/transpiler/html/validateHTML.cjs +65 -1
  169. package/dist/cjs/transpiler/html/validateHTML.cjs.map +1 -1
  170. package/dist/cjs/transpiler/index.cjs +29 -1
  171. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs +11 -1
  172. package/dist/cjs/transpiler/insertion/getInsertionValues.cjs.map +1 -1
  173. package/dist/cjs/transpiler/insertion/index.cjs +6 -1
  174. package/dist/cjs/transpiler/insertion/insertion.cjs +36 -1
  175. package/dist/cjs/transpiler/insertion/insertion.cjs.map +1 -1
  176. package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs +23 -2
  177. package/dist/cjs/transpiler/markdown/getMarkdownMetadata.cjs.map +1 -1
  178. package/dist/cjs/transpiler/markdown/index.cjs +8 -1
  179. package/dist/cjs/transpiler/markdown/markdown.cjs +62 -1
  180. package/dist/cjs/transpiler/markdown/markdown.cjs.map +1 -1
  181. package/dist/cjs/transpiler/markdown/validateMarkdown.cjs +74 -4
  182. package/dist/cjs/transpiler/markdown/validateMarkdown.cjs.map +1 -1
  183. package/dist/cjs/transpiler/nesting/index.cjs +4 -1
  184. package/dist/cjs/transpiler/nesting/nesting.cjs +27 -1
  185. package/dist/cjs/transpiler/nesting/nesting.cjs.map +1 -1
  186. package/dist/cjs/transpiler/translation/index.cjs +4 -1
  187. package/dist/cjs/transpiler/translation/translation.cjs +29 -1
  188. package/dist/cjs/transpiler/translation/translation.cjs.map +1 -1
  189. package/dist/cjs/utils/checkIsURLAbsolute.cjs +7 -1
  190. package/dist/cjs/utils/checkIsURLAbsolute.cjs.map +1 -1
  191. package/dist/cjs/utils/getCookie.cjs +32 -1
  192. package/dist/cjs/utils/getCookie.cjs.map +1 -1
  193. package/dist/cjs/utils/index.cjs +21 -1
  194. package/dist/cjs/utils/intl.cjs +91 -1
  195. package/dist/cjs/utils/intl.cjs.map +1 -1
  196. package/dist/cjs/utils/isSameKeyPath.cjs +7 -1
  197. package/dist/cjs/utils/isSameKeyPath.cjs.map +1 -1
  198. package/dist/cjs/utils/isValidReactElement.cjs +14 -1
  199. package/dist/cjs/utils/isValidReactElement.cjs.map +1 -1
  200. package/dist/cjs/utils/localeStorage.cjs +140 -1
  201. package/dist/cjs/utils/localeStorage.cjs.map +1 -1
  202. package/dist/cjs/utils/parseYaml.cjs +322 -16
  203. package/dist/cjs/utils/parseYaml.cjs.map +1 -1
  204. package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs +207 -1
  205. package/dist/esm/deepTransformPlugins/getFilterMissingTranslationsContent.mjs.map +1 -1
  206. package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs +89 -1
  207. package/dist/esm/deepTransformPlugins/getFilterTranslationsOnlyContent.mjs.map +1 -1
  208. package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs +42 -1
  209. package/dist/esm/deepTransformPlugins/getFilteredLocalesContent.mjs.map +1 -1
  210. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs +31 -1
  211. package/dist/esm/deepTransformPlugins/getLocalizedContent.mjs.map +1 -1
  212. package/dist/esm/deepTransformPlugins/getMaskContent.mjs +25 -1
  213. package/dist/esm/deepTransformPlugins/getMaskContent.mjs.map +1 -1
  214. package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs +145 -1
  215. package/dist/esm/deepTransformPlugins/getMissingLocalesContent.mjs.map +1 -1
  216. package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs +86 -1
  217. package/dist/esm/deepTransformPlugins/getMultilingualDictionary.mjs.map +1 -1
  218. package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs +59 -1
  219. package/dist/esm/deepTransformPlugins/getReplacedValuesContent.mjs.map +1 -1
  220. package/dist/esm/deepTransformPlugins/getSplittedContent.mjs +119 -1
  221. package/dist/esm/deepTransformPlugins/getSplittedContent.mjs.map +1 -1
  222. package/dist/esm/deepTransformPlugins/index.mjs +12 -1
  223. package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs +104 -1
  224. package/dist/esm/deepTransformPlugins/insertContentInDictionary.mjs.map +1 -1
  225. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs +62 -1
  226. package/dist/esm/dictionaryManipulator/editDictionaryByKeyPath.mjs.map +1 -1
  227. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs +16 -1
  228. package/dist/esm/dictionaryManipulator/getContentNodeByKeyPath.mjs.map +1 -1
  229. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs +53 -1
  230. package/dist/esm/dictionaryManipulator/getDefaultNode.mjs.map +1 -1
  231. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs +24 -1
  232. package/dist/esm/dictionaryManipulator/getEmptyNode.mjs.map +1 -1
  233. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs +21 -1
  234. package/dist/esm/dictionaryManipulator/getNodeChildren.mjs.map +1 -1
  235. package/dist/esm/dictionaryManipulator/getNodeType.mjs +52 -1
  236. package/dist/esm/dictionaryManipulator/getNodeType.mjs.map +1 -1
  237. package/dist/esm/dictionaryManipulator/index.mjs +14 -1
  238. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs +66 -1
  239. package/dist/esm/dictionaryManipulator/mergeDictionaries.mjs.map +1 -1
  240. package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs +28 -1
  241. package/dist/esm/dictionaryManipulator/normalizeDictionary.mjs.map +1 -1
  242. package/dist/esm/dictionaryManipulator/orderDictionaries.mjs +45 -1
  243. package/dist/esm/dictionaryManipulator/orderDictionaries.mjs.map +1 -1
  244. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs +29 -1
  245. package/dist/esm/dictionaryManipulator/removeContentNodeByKeyPath.mjs.map +1 -1
  246. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs +37 -1
  247. package/dist/esm/dictionaryManipulator/renameContentNodeByKeyPath.mjs.map +1 -1
  248. package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs +36 -1
  249. package/dist/esm/dictionaryManipulator/updateNodeChildren.mjs.map +1 -1
  250. package/dist/esm/formatters/compact.mjs +22 -1
  251. package/dist/esm/formatters/compact.mjs.map +1 -1
  252. package/dist/esm/formatters/currency.mjs +26 -1
  253. package/dist/esm/formatters/currency.mjs.map +1 -1
  254. package/dist/esm/formatters/date.mjs +57 -1
  255. package/dist/esm/formatters/date.mjs.map +1 -1
  256. package/dist/esm/formatters/index.mjs +11 -1
  257. package/dist/esm/formatters/list.mjs +27 -1
  258. package/dist/esm/formatters/list.mjs.map +1 -1
  259. package/dist/esm/formatters/number.mjs +17 -1
  260. package/dist/esm/formatters/number.mjs.map +1 -1
  261. package/dist/esm/formatters/percentage.mjs +24 -1
  262. package/dist/esm/formatters/percentage.mjs.map +1 -1
  263. package/dist/esm/formatters/relativeTime.mjs +40 -1
  264. package/dist/esm/formatters/relativeTime.mjs.map +1 -1
  265. package/dist/esm/formatters/units.mjs +20 -1
  266. package/dist/esm/formatters/units.mjs.map +1 -1
  267. package/dist/esm/getStorageAttributes.mjs +132 -1
  268. package/dist/esm/getStorageAttributes.mjs.map +1 -1
  269. package/dist/esm/index.mjs +87 -1
  270. package/dist/esm/interpreter/getCondition.mjs +25 -1
  271. package/dist/esm/interpreter/getCondition.mjs.map +1 -1
  272. package/dist/esm/interpreter/getContent/deepTransform.mjs +39 -1
  273. package/dist/esm/interpreter/getContent/deepTransform.mjs.map +1 -1
  274. package/dist/esm/interpreter/getContent/getContent.mjs +28 -1
  275. package/dist/esm/interpreter/getContent/getContent.mjs.map +1 -0
  276. package/dist/esm/interpreter/getContent/index.mjs +5 -1
  277. package/dist/esm/interpreter/getContent/plugins.mjs +154 -1
  278. package/dist/esm/interpreter/getContent/plugins.mjs.map +1 -0
  279. package/dist/esm/interpreter/getDictionary.mjs +24 -1
  280. package/dist/esm/interpreter/getDictionary.mjs.map +1 -0
  281. package/dist/esm/interpreter/getEnumeration.mjs +69 -1
  282. package/dist/esm/interpreter/getEnumeration.mjs.map +1 -1
  283. package/dist/esm/interpreter/getGender.mjs +36 -1
  284. package/dist/esm/interpreter/getGender.mjs.map +1 -1
  285. package/dist/esm/interpreter/getHTML.mjs +122 -1
  286. package/dist/esm/interpreter/getHTML.mjs.map +1 -1
  287. package/dist/esm/interpreter/getInsertion.mjs +20 -1
  288. package/dist/esm/interpreter/getInsertion.mjs.map +1 -1
  289. package/dist/esm/interpreter/getIntlayer.mjs +37 -1
  290. package/dist/esm/interpreter/getIntlayer.mjs.map +1 -0
  291. package/dist/esm/interpreter/getNesting.mjs +36 -1
  292. package/dist/esm/interpreter/getNesting.mjs.map +1 -0
  293. package/dist/esm/interpreter/getTranslation.mjs +110 -1
  294. package/dist/esm/interpreter/getTranslation.mjs.map +1 -1
  295. package/dist/esm/interpreter/index.mjs +13 -1
  296. package/dist/esm/interpreter/splitAndJoinInsertion.mjs +53 -1
  297. package/dist/esm/interpreter/splitAndJoinInsertion.mjs.map +1 -1
  298. package/dist/esm/localization/getBrowserLocale.mjs +138 -1
  299. package/dist/esm/localization/getBrowserLocale.mjs.map +1 -1
  300. package/dist/esm/localization/getHTMLTextDir.mjs +38 -1
  301. package/dist/esm/localization/getHTMLTextDir.mjs.map +1 -1
  302. package/dist/esm/localization/getLocale.mjs +24 -1
  303. package/dist/esm/localization/getLocale.mjs.map +1 -1
  304. package/dist/esm/localization/getLocaleFromPath.mjs +35 -1
  305. package/dist/esm/localization/getLocaleFromPath.mjs.map +1 -1
  306. package/dist/esm/localization/getLocaleLang.mjs +18 -1
  307. package/dist/esm/localization/getLocaleLang.mjs.map +1 -1
  308. package/dist/esm/localization/getLocaleName.mjs +9 -1
  309. package/dist/esm/localization/getLocaleName.mjs.map +1 -1
  310. package/dist/esm/localization/getLocalizedUrl.mjs +70 -1
  311. package/dist/esm/localization/getLocalizedUrl.mjs.map +1 -1
  312. package/dist/esm/localization/getMultilingualUrls.mjs +45 -1
  313. package/dist/esm/localization/getMultilingualUrls.mjs.map +1 -1
  314. package/dist/esm/localization/getPathWithoutLocale.mjs +52 -1
  315. package/dist/esm/localization/getPathWithoutLocale.mjs.map +1 -1
  316. package/dist/esm/localization/getPrefix.mjs +69 -1
  317. package/dist/esm/localization/getPrefix.mjs.map +1 -1
  318. package/dist/esm/localization/index.mjs +18 -1
  319. package/dist/esm/localization/localeDetector.mjs +131 -1
  320. package/dist/esm/localization/localeDetector.mjs.map +1 -1
  321. package/dist/esm/localization/localeMapper.mjs +119 -1
  322. package/dist/esm/localization/localeMapper.mjs.map +1 -1
  323. package/dist/esm/localization/localeResolver.mjs +25 -1
  324. package/dist/esm/localization/localeResolver.mjs.map +1 -1
  325. package/dist/esm/localization/rewriteUtils.mjs +104 -1
  326. package/dist/esm/localization/rewriteUtils.mjs.map +1 -1
  327. package/dist/esm/localization/validatePrefix.mjs +44 -1
  328. package/dist/esm/localization/validatePrefix.mjs.map +1 -1
  329. package/dist/esm/markdown/compiler.mjs +786 -10
  330. package/dist/esm/markdown/compiler.mjs.map +1 -1
  331. package/dist/esm/markdown/constants.mjs +247 -1
  332. package/dist/esm/markdown/constants.mjs.map +1 -1
  333. package/dist/esm/markdown/index.mjs +10 -1
  334. package/dist/esm/markdown/parser.mjs +65 -1
  335. package/dist/esm/markdown/parser.mjs.map +1 -1
  336. package/dist/esm/markdown/renderer.mjs +59 -1
  337. package/dist/esm/markdown/renderer.mjs.map +1 -1
  338. package/dist/esm/markdown/utils.mjs +361 -6
  339. package/dist/esm/markdown/utils.mjs.map +1 -1
  340. package/dist/esm/messageFormat/ICU.mjs +330 -1
  341. package/dist/esm/messageFormat/ICU.mjs.map +1 -1
  342. package/dist/esm/messageFormat/i18next.mjs +341 -1
  343. package/dist/esm/messageFormat/i18next.mjs.map +1 -1
  344. package/dist/esm/messageFormat/index.mjs +5 -1
  345. package/dist/esm/messageFormat/verify-icu-format.mjs +64 -2
  346. package/dist/esm/messageFormat/verify-icu-format.mjs.map +1 -1
  347. package/dist/esm/messageFormat/vue-i18n.mjs +177 -1
  348. package/dist/esm/messageFormat/vue-i18n.mjs.map +1 -1
  349. package/dist/esm/transpiler/condition/condition.mjs +24 -1
  350. package/dist/esm/transpiler/condition/condition.mjs.map +1 -1
  351. package/dist/esm/transpiler/condition/index.mjs +3 -1
  352. package/dist/esm/transpiler/enumeration/enumeration.mjs +26 -1
  353. package/dist/esm/transpiler/enumeration/enumeration.mjs.map +1 -1
  354. package/dist/esm/transpiler/enumeration/index.mjs +3 -1
  355. package/dist/esm/transpiler/file/file.mjs +48 -1
  356. package/dist/esm/transpiler/file/file.mjs.map +1 -1
  357. package/dist/esm/transpiler/file/fileBrowser.mjs +22 -1
  358. package/dist/esm/transpiler/file/fileBrowser.mjs.map +1 -1
  359. package/dist/esm/transpiler/file/index.mjs +3 -1
  360. package/dist/esm/transpiler/gender/gender.mjs +24 -1
  361. package/dist/esm/transpiler/gender/gender.mjs.map +1 -1
  362. package/dist/esm/transpiler/gender/index.mjs +3 -1
  363. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs +44 -1
  364. package/dist/esm/transpiler/html/getHTMLCustomComponents.mjs.map +1 -0
  365. package/dist/esm/transpiler/html/html.mjs +42 -1
  366. package/dist/esm/transpiler/html/html.mjs.map +1 -0
  367. package/dist/esm/transpiler/html/htmlTags.mjs +114 -1
  368. package/dist/esm/transpiler/html/htmlTags.mjs.map +1 -1
  369. package/dist/esm/transpiler/html/index.mjs +5 -1
  370. package/dist/esm/transpiler/html/validateHTML.mjs +62 -1
  371. package/dist/esm/transpiler/html/validateHTML.mjs.map +1 -1
  372. package/dist/esm/transpiler/index.mjs +15 -1
  373. package/dist/esm/transpiler/insertion/getInsertionValues.mjs +9 -1
  374. package/dist/esm/transpiler/insertion/getInsertionValues.mjs.map +1 -1
  375. package/dist/esm/transpiler/insertion/index.mjs +4 -1
  376. package/dist/esm/transpiler/insertion/insertion.mjs +34 -1
  377. package/dist/esm/transpiler/insertion/insertion.mjs.map +1 -1
  378. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs +22 -2
  379. package/dist/esm/transpiler/markdown/getMarkdownMetadata.mjs.map +1 -1
  380. package/dist/esm/transpiler/markdown/index.mjs +5 -1
  381. package/dist/esm/transpiler/markdown/markdown.mjs +60 -1
  382. package/dist/esm/transpiler/markdown/markdown.mjs.map +1 -1
  383. package/dist/esm/transpiler/markdown/validateMarkdown.mjs +73 -4
  384. package/dist/esm/transpiler/markdown/validateMarkdown.mjs.map +1 -1
  385. package/dist/esm/transpiler/nesting/index.mjs +3 -1
  386. package/dist/esm/transpiler/nesting/nesting.mjs +25 -1
  387. package/dist/esm/transpiler/nesting/nesting.mjs.map +1 -1
  388. package/dist/esm/transpiler/translation/index.mjs +3 -1
  389. package/dist/esm/transpiler/translation/translation.mjs +27 -1
  390. package/dist/esm/transpiler/translation/translation.mjs.map +1 -1
  391. package/dist/esm/utils/checkIsURLAbsolute.mjs +5 -1
  392. package/dist/esm/utils/checkIsURLAbsolute.mjs.map +1 -1
  393. package/dist/esm/utils/getCookie.mjs +30 -1
  394. package/dist/esm/utils/getCookie.mjs.map +1 -1
  395. package/dist/esm/utils/index.mjs +9 -1
  396. package/dist/esm/utils/intl.mjs +86 -1
  397. package/dist/esm/utils/intl.mjs.map +1 -1
  398. package/dist/esm/utils/isSameKeyPath.mjs +5 -1
  399. package/dist/esm/utils/isSameKeyPath.mjs.map +1 -1
  400. package/dist/esm/utils/isValidReactElement.mjs +12 -1
  401. package/dist/esm/utils/isValidReactElement.mjs.map +1 -1
  402. package/dist/esm/utils/localeStorage.mjs +135 -1
  403. package/dist/esm/utils/localeStorage.mjs.map +1 -1
  404. package/dist/esm/utils/parseYaml.mjs +320 -16
  405. package/dist/esm/utils/parseYaml.mjs.map +1 -1
  406. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts +50 -2
  407. package/dist/types/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts.map +1 -0
  408. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts +42 -2
  409. package/dist/types/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts.map +1 -0
  410. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts +34 -2
  411. package/dist/types/deepTransformPlugins/getFilteredLocalesContent.d.ts.map +1 -0
  412. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts +18 -2
  413. package/dist/types/deepTransformPlugins/getLocalizedContent.d.ts.map +1 -0
  414. package/dist/types/deepTransformPlugins/getMaskContent.d.ts +10 -2
  415. package/dist/types/deepTransformPlugins/getMaskContent.d.ts.map +1 -0
  416. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts +19 -2
  417. package/dist/types/deepTransformPlugins/getMissingLocalesContent.d.ts.map +1 -0
  418. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts +32 -2
  419. package/dist/types/deepTransformPlugins/getMultilingualDictionary.d.ts.map +1 -0
  420. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts +8 -2
  421. package/dist/types/deepTransformPlugins/getReplacedValuesContent.d.ts.map +1 -0
  422. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts +43 -2
  423. package/dist/types/deepTransformPlugins/getSplittedContent.d.ts.map +1 -0
  424. package/dist/types/deepTransformPlugins/index.d.ts +10 -10
  425. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts +25 -2
  426. package/dist/types/deepTransformPlugins/insertContentInDictionary.d.ts.map +1 -0
  427. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts +8 -2
  428. package/dist/types/dictionaryManipulator/editDictionaryByKeyPath.d.ts.map +1 -0
  429. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts +9 -2
  430. package/dist/types/dictionaryManipulator/getContentNodeByKeyPath.d.ts.map +1 -0
  431. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts +9 -2
  432. package/dist/types/dictionaryManipulator/getDefaultNode.d.ts.map +1 -0
  433. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts +7 -2
  434. package/dist/types/dictionaryManipulator/getEmptyNode.d.ts.map +1 -0
  435. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts +7 -2
  436. package/dist/types/dictionaryManipulator/getNodeChildren.d.ts.map +1 -0
  437. package/dist/types/dictionaryManipulator/getNodeType.d.ts +8 -2
  438. package/dist/types/dictionaryManipulator/getNodeType.d.ts.map +1 -0
  439. package/dist/types/dictionaryManipulator/index.d.ts +12 -12
  440. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts +7 -2
  441. package/dist/types/dictionaryManipulator/mergeDictionaries.d.ts.map +1 -0
  442. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts +9 -2
  443. package/dist/types/dictionaryManipulator/normalizeDictionary.d.ts.map +1 -0
  444. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts +15 -2
  445. package/dist/types/dictionaryManipulator/orderDictionaries.d.ts.map +1 -0
  446. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts +8 -2
  447. package/dist/types/dictionaryManipulator/removeContentNodeByKeyPath.d.ts.map +1 -0
  448. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts +8 -2
  449. package/dist/types/dictionaryManipulator/renameContentNodeByKeyPath.d.ts.map +1 -0
  450. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts +7 -2
  451. package/dist/types/dictionaryManipulator/updateNodeChildren.d.ts.map +1 -0
  452. package/dist/types/formatters/compact.d.ts +20 -2
  453. package/dist/types/formatters/compact.d.ts.map +1 -0
  454. package/dist/types/formatters/currency.d.ts +20 -2
  455. package/dist/types/formatters/currency.d.ts.map +1 -0
  456. package/dist/types/formatters/date.d.ts +20 -2
  457. package/dist/types/formatters/date.d.ts.map +1 -0
  458. package/dist/types/formatters/index.d.ts +9 -9
  459. package/dist/types/formatters/list.d.ts +30 -2
  460. package/dist/types/formatters/list.d.ts.map +1 -0
  461. package/dist/types/formatters/number.d.ts +18 -2
  462. package/dist/types/formatters/number.d.ts.map +1 -0
  463. package/dist/types/formatters/percentage.d.ts +18 -2
  464. package/dist/types/formatters/percentage.d.ts.map +1 -0
  465. package/dist/types/formatters/relativeTime.d.ts +21 -2
  466. package/dist/types/formatters/relativeTime.d.ts.map +1 -0
  467. package/dist/types/formatters/units.d.ts +16 -2
  468. package/dist/types/formatters/units.d.ts.map +1 -0
  469. package/dist/types/getStorageAttributes.d.ts +29 -2
  470. package/dist/types/getStorageAttributes.d.ts.map +1 -0
  471. package/dist/types/index.d.ts +88 -80
  472. package/dist/types/interpreter/getCondition.d.ts +22 -2
  473. package/dist/types/interpreter/getCondition.d.ts.map +1 -0
  474. package/dist/types/interpreter/getContent/deepTransform.d.ts +12 -2
  475. package/dist/types/interpreter/getContent/deepTransform.d.ts.map +1 -0
  476. package/dist/types/interpreter/getContent/getContent.d.ts +16 -2
  477. package/dist/types/interpreter/getContent/getContent.d.ts.map +1 -0
  478. package/dist/types/interpreter/getContent/index.d.ts +3 -1
  479. package/dist/types/interpreter/getContent/plugins.d.ts +152 -2
  480. package/dist/types/interpreter/getContent/plugins.d.ts.map +1 -0
  481. package/dist/types/interpreter/getDictionary.d.ts +17 -2
  482. package/dist/types/interpreter/getDictionary.d.ts.map +1 -0
  483. package/dist/types/interpreter/getEnumeration.d.ts +58 -2
  484. package/dist/types/interpreter/getEnumeration.d.ts.map +1 -0
  485. package/dist/types/interpreter/getGender.d.ts +1 -1
  486. package/dist/types/interpreter/getGender.d.ts.map +1 -1
  487. package/dist/types/interpreter/getHTML.d.ts +32 -2
  488. package/dist/types/interpreter/getHTML.d.ts.map +1 -0
  489. package/dist/types/interpreter/getInsertion.d.ts +1 -1
  490. package/dist/types/interpreter/getInsertion.d.ts.map +1 -1
  491. package/dist/types/interpreter/getIntlayer.d.ts +8 -2
  492. package/dist/types/interpreter/getIntlayer.d.ts.map +1 -0
  493. package/dist/types/interpreter/getNesting.d.ts +27 -2
  494. package/dist/types/interpreter/getNesting.d.ts.map +1 -0
  495. package/dist/types/interpreter/getTranslation.d.ts +30 -2
  496. package/dist/types/interpreter/getTranslation.d.ts.map +1 -0
  497. package/dist/types/interpreter/index.d.ts +11 -4
  498. package/dist/types/interpreter/splitAndJoinInsertion.d.ts +25 -2
  499. package/dist/types/interpreter/splitAndJoinInsertion.d.ts.map +1 -0
  500. package/dist/types/localization/getBrowserLocale.d.ts +35 -2
  501. package/dist/types/localization/getBrowserLocale.d.ts.map +1 -0
  502. package/dist/types/localization/getHTMLTextDir.d.ts +21 -2
  503. package/dist/types/localization/getHTMLTextDir.d.ts.map +1 -0
  504. package/dist/types/localization/getLocale.d.ts +11 -2
  505. package/dist/types/localization/getLocale.d.ts.map +1 -0
  506. package/dist/types/localization/getLocaleFromPath.d.ts +20 -2
  507. package/dist/types/localization/getLocaleFromPath.d.ts.map +1 -0
  508. package/dist/types/localization/getLocaleLang.d.ts +20 -2
  509. package/dist/types/localization/getLocaleLang.d.ts.map +1 -0
  510. package/dist/types/localization/getLocaleName.d.ts +7 -2
  511. package/dist/types/localization/getLocaleName.d.ts.map +1 -0
  512. package/dist/types/localization/getLocalizedUrl.d.ts +44 -2
  513. package/dist/types/localization/getLocalizedUrl.d.ts.map +1 -0
  514. package/dist/types/localization/getMultilingualUrls.d.ts +42 -2
  515. package/dist/types/localization/getMultilingualUrls.d.ts.map +1 -0
  516. package/dist/types/localization/getPathWithoutLocale.d.ts +31 -2
  517. package/dist/types/localization/getPathWithoutLocale.d.ts.map +1 -0
  518. package/dist/types/localization/getPrefix.d.ts +83 -2
  519. package/dist/types/localization/getPrefix.d.ts.map +1 -0
  520. package/dist/types/localization/index.d.ts +16 -16
  521. package/dist/types/localization/localeDetector.d.ts +18 -2
  522. package/dist/types/localization/localeDetector.d.ts.map +1 -0
  523. package/dist/types/localization/localeMapper.d.ts +92 -2
  524. package/dist/types/localization/localeMapper.d.ts.map +1 -0
  525. package/dist/types/localization/localeResolver.d.ts +12 -2
  526. package/dist/types/localization/localeResolver.d.ts.map +1 -0
  527. package/dist/types/localization/rewriteUtils.d.ts +34 -2
  528. package/dist/types/localization/rewriteUtils.d.ts.map +1 -0
  529. package/dist/types/localization/validatePrefix.d.ts +34 -2
  530. package/dist/types/localization/validatePrefix.d.ts.map +1 -0
  531. package/dist/types/markdown/compiler.d.ts +9 -2
  532. package/dist/types/markdown/compiler.d.ts.map +1 -0
  533. package/dist/types/markdown/constants.d.ts +177 -2
  534. package/dist/types/markdown/constants.d.ts.map +1 -0
  535. package/dist/types/markdown/index.d.ts +10 -10
  536. package/dist/types/markdown/parser.d.ts +16 -2
  537. package/dist/types/markdown/parser.d.ts.map +1 -0
  538. package/dist/types/markdown/renderer.d.ts +22 -2
  539. package/dist/types/markdown/renderer.d.ts.map +1 -0
  540. package/dist/types/markdown/types.d.ts +333 -2
  541. package/dist/types/markdown/types.d.ts.map +1 -0
  542. package/dist/types/markdown/utils.d.ts +140 -2
  543. package/dist/types/markdown/utils.d.ts.map +1 -0
  544. package/dist/types/messageFormat/ICU.d.ts +11 -2
  545. package/dist/types/messageFormat/ICU.d.ts.map +1 -0
  546. package/dist/types/messageFormat/i18next.d.ts +9 -2
  547. package/dist/types/messageFormat/i18next.d.ts.map +1 -0
  548. package/dist/types/messageFormat/index.d.ts +3 -3
  549. package/dist/types/messageFormat/vue-i18n.d.ts +9 -2
  550. package/dist/types/messageFormat/vue-i18n.d.ts.map +1 -0
  551. package/dist/types/transpiler/condition/condition.d.ts +28 -2
  552. package/dist/types/transpiler/condition/condition.d.ts.map +1 -0
  553. package/dist/types/transpiler/condition/index.d.ts +1 -1
  554. package/dist/types/transpiler/enumeration/enumeration.d.ts +40 -2
  555. package/dist/types/transpiler/enumeration/enumeration.d.ts.map +1 -0
  556. package/dist/types/transpiler/enumeration/index.d.ts +1 -1
  557. package/dist/types/transpiler/file/file.d.ts +28 -2
  558. package/dist/types/transpiler/file/file.d.ts.map +1 -0
  559. package/dist/types/transpiler/file/fileBrowser.d.ts +1 -1
  560. package/dist/types/transpiler/file/index.d.ts +1 -1
  561. package/dist/types/transpiler/gender/gender.d.ts +29 -2
  562. package/dist/types/transpiler/gender/gender.d.ts.map +1 -0
  563. package/dist/types/transpiler/gender/index.d.ts +1 -1
  564. package/dist/types/transpiler/html/html.d.ts +25 -2
  565. package/dist/types/transpiler/html/html.d.ts.map +1 -0
  566. package/dist/types/transpiler/html/htmlTags.d.ts +115 -2
  567. package/dist/types/transpiler/html/htmlTags.d.ts.map +1 -0
  568. package/dist/types/transpiler/html/index.d.ts +3 -3
  569. package/dist/types/transpiler/html/validateHTML.d.ts +21 -2
  570. package/dist/types/transpiler/html/validateHTML.d.ts.map +1 -0
  571. package/dist/types/transpiler/index.d.ts +15 -15
  572. package/dist/types/transpiler/insertion/getInsertionValues.d.ts +5 -2
  573. package/dist/types/transpiler/insertion/getInsertionValues.d.ts.map +1 -0
  574. package/dist/types/transpiler/insertion/index.d.ts +2 -2
  575. package/dist/types/transpiler/insertion/insertion.d.ts +23 -2
  576. package/dist/types/transpiler/insertion/insertion.d.ts.map +1 -0
  577. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts +5 -2
  578. package/dist/types/transpiler/markdown/getMarkdownMetadata.d.ts.map +1 -0
  579. package/dist/types/transpiler/markdown/index.d.ts +4 -4
  580. package/dist/types/transpiler/markdown/markdown.d.ts +26 -2
  581. package/dist/types/transpiler/markdown/markdown.d.ts.map +1 -0
  582. package/dist/types/transpiler/markdown/validateMarkdown.d.ts +18 -3
  583. package/dist/types/transpiler/markdown/validateMarkdown.d.ts.map +1 -0
  584. package/dist/types/transpiler/nesting/index.d.ts +1 -1
  585. package/dist/types/transpiler/nesting/nesting.d.ts +49 -2
  586. package/dist/types/transpiler/nesting/nesting.d.ts.map +1 -0
  587. package/dist/types/transpiler/translation/index.d.ts +1 -1
  588. package/dist/types/transpiler/translation/translation.d.ts +33 -2
  589. package/dist/types/transpiler/translation/translation.d.ts.map +1 -0
  590. package/dist/types/utils/checkIsURLAbsolute.d.ts +5 -2
  591. package/dist/types/utils/checkIsURLAbsolute.d.ts.map +1 -0
  592. package/dist/types/utils/getCookie.d.ts +11 -2
  593. package/dist/types/utils/getCookie.d.ts.map +1 -0
  594. package/dist/types/utils/index.d.ts +7 -7
  595. package/dist/types/utils/intl.d.ts +33 -2
  596. package/dist/types/utils/intl.d.ts.map +1 -0
  597. package/dist/types/utils/isSameKeyPath.d.ts +7 -2
  598. package/dist/types/utils/isSameKeyPath.d.ts.map +1 -0
  599. package/dist/types/utils/isValidReactElement.d.ts +12 -2
  600. package/dist/types/utils/isValidReactElement.d.ts.map +1 -0
  601. package/dist/types/utils/localeStorage.d.ts +108 -2
  602. package/dist/types/utils/localeStorage.d.ts.map +1 -0
  603. package/dist/types/utils/parseYaml.d.ts +5 -2
  604. package/dist/types/utils/parseYaml.d.ts.map +1 -0
  605. package/package.json +6 -6
  606. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  607. package/dist/cjs/getContent-DrqM8pqO.cjs +0 -2
  608. package/dist/cjs/getContent-DrqM8pqO.cjs.map +0 -1
  609. package/dist/cjs/html-CZ1N-VL0.cjs +0 -2
  610. package/dist/cjs/html-CZ1N-VL0.cjs.map +0 -1
  611. package/dist/esm/getContent-DKqtIZGL.mjs +0 -2
  612. package/dist/esm/getContent-DKqtIZGL.mjs.map +0 -1
  613. package/dist/esm/html-3bo80xzx.mjs +0 -2
  614. package/dist/esm/html-3bo80xzx.mjs.map +0 -1
  615. package/dist/types/ICU-tA3ZHN5U.d.ts +0 -11
  616. package/dist/types/ICU-tA3ZHN5U.d.ts.map +0 -1
  617. package/dist/types/checkIsURLAbsolute-CTf3JFU6.d.ts +0 -5
  618. package/dist/types/checkIsURLAbsolute-CTf3JFU6.d.ts.map +0 -1
  619. package/dist/types/compact-IHXcM4pT.d.ts +0 -20
  620. package/dist/types/compact-IHXcM4pT.d.ts.map +0 -1
  621. package/dist/types/compiler-DFiAsUdH.d.ts +0 -9
  622. package/dist/types/compiler-DFiAsUdH.d.ts.map +0 -1
  623. package/dist/types/condition-BDUtoh_1.d.ts +0 -28
  624. package/dist/types/condition-BDUtoh_1.d.ts.map +0 -1
  625. package/dist/types/constants-CI_D82B1.d.ts +0 -177
  626. package/dist/types/constants-CI_D82B1.d.ts.map +0 -1
  627. package/dist/types/currency-PbMCnHep.d.ts +0 -20
  628. package/dist/types/currency-PbMCnHep.d.ts.map +0 -1
  629. package/dist/types/date-C-PI8KqU.d.ts +0 -20
  630. package/dist/types/date-C-PI8KqU.d.ts.map +0 -1
  631. package/dist/types/editDictionaryByKeyPath-BYIHcsyf.d.ts +0 -8
  632. package/dist/types/editDictionaryByKeyPath-BYIHcsyf.d.ts.map +0 -1
  633. package/dist/types/enumeration-CtuvB5Zz.d.ts +0 -40
  634. package/dist/types/enumeration-CtuvB5Zz.d.ts.map +0 -1
  635. package/dist/types/file-C3q8xvQb.d.ts +0 -28
  636. package/dist/types/file-C3q8xvQb.d.ts.map +0 -1
  637. package/dist/types/gender-Dd39Ijmf.d.ts +0 -29
  638. package/dist/types/gender-Dd39Ijmf.d.ts.map +0 -1
  639. package/dist/types/getBrowserLocale-RD_Mwv1t.d.ts +0 -35
  640. package/dist/types/getBrowserLocale-RD_Mwv1t.d.ts.map +0 -1
  641. package/dist/types/getContentNodeByKeyPath-B0Tdi5mj.d.ts +0 -9
  642. package/dist/types/getContentNodeByKeyPath-B0Tdi5mj.d.ts.map +0 -1
  643. package/dist/types/getCookie-DPOvVv_h.d.ts +0 -11
  644. package/dist/types/getCookie-DPOvVv_h.d.ts.map +0 -1
  645. package/dist/types/getDefaultNode-DQNsje2D.d.ts +0 -9
  646. package/dist/types/getDefaultNode-DQNsje2D.d.ts.map +0 -1
  647. package/dist/types/getEmptyNode-DW27TTBj.d.ts +0 -7
  648. package/dist/types/getEmptyNode-DW27TTBj.d.ts.map +0 -1
  649. package/dist/types/getFilterMissingTranslationsContent-CDNQqoy1.d.ts +0 -50
  650. package/dist/types/getFilterMissingTranslationsContent-CDNQqoy1.d.ts.map +0 -1
  651. package/dist/types/getFilterTranslationsOnlyContent-D2YgBkHn.d.ts +0 -42
  652. package/dist/types/getFilterTranslationsOnlyContent-D2YgBkHn.d.ts.map +0 -1
  653. package/dist/types/getFilteredLocalesContent-D0GP-uEg.d.ts +0 -34
  654. package/dist/types/getFilteredLocalesContent-D0GP-uEg.d.ts.map +0 -1
  655. package/dist/types/getHTML-CP6OXtdo.d.ts +0 -32
  656. package/dist/types/getHTML-CP6OXtdo.d.ts.map +0 -1
  657. package/dist/types/getHTMLTextDir-4Zh8J3x7.d.ts +0 -21
  658. package/dist/types/getHTMLTextDir-4Zh8J3x7.d.ts.map +0 -1
  659. package/dist/types/getInsertionValues-Cu9IdbuE.d.ts +0 -5
  660. package/dist/types/getInsertionValues-Cu9IdbuE.d.ts.map +0 -1
  661. package/dist/types/getLocale-B9dECUM_.d.ts +0 -11
  662. package/dist/types/getLocale-B9dECUM_.d.ts.map +0 -1
  663. package/dist/types/getLocaleFromPath-621W32QA.d.ts +0 -26
  664. package/dist/types/getLocaleFromPath-621W32QA.d.ts.map +0 -1
  665. package/dist/types/getLocaleLang-Bcan1gS4.d.ts +0 -20
  666. package/dist/types/getLocaleLang-Bcan1gS4.d.ts.map +0 -1
  667. package/dist/types/getLocaleName-CfRAD9Hc.d.ts +0 -7
  668. package/dist/types/getLocaleName-CfRAD9Hc.d.ts.map +0 -1
  669. package/dist/types/getLocalizedContent-DOncZd-0.d.ts +0 -18
  670. package/dist/types/getLocalizedContent-DOncZd-0.d.ts.map +0 -1
  671. package/dist/types/getLocalizedUrl-BbqeA3-W.d.ts +0 -49
  672. package/dist/types/getLocalizedUrl-BbqeA3-W.d.ts.map +0 -1
  673. package/dist/types/getMarkdownMetadata-Bf1S1NQ0.d.ts +0 -5
  674. package/dist/types/getMarkdownMetadata-Bf1S1NQ0.d.ts.map +0 -1
  675. package/dist/types/getMaskContent-BwLFqp7v.d.ts +0 -10
  676. package/dist/types/getMaskContent-BwLFqp7v.d.ts.map +0 -1
  677. package/dist/types/getMissingLocalesContent-BYffYcdx.d.ts +0 -19
  678. package/dist/types/getMissingLocalesContent-BYffYcdx.d.ts.map +0 -1
  679. package/dist/types/getMultilingualDictionary-DO3i1MFs.d.ts +0 -32
  680. package/dist/types/getMultilingualDictionary-DO3i1MFs.d.ts.map +0 -1
  681. package/dist/types/getMultilingualUrls-CUxYYfA4.d.ts +0 -47
  682. package/dist/types/getMultilingualUrls-CUxYYfA4.d.ts.map +0 -1
  683. package/dist/types/getNodeChildren-OT7Liqke.d.ts +0 -7
  684. package/dist/types/getNodeChildren-OT7Liqke.d.ts.map +0 -1
  685. package/dist/types/getNodeType-Cp765I26.d.ts +0 -8
  686. package/dist/types/getNodeType-Cp765I26.d.ts.map +0 -1
  687. package/dist/types/getPathWithoutLocale-B_aIR7O0.d.ts +0 -31
  688. package/dist/types/getPathWithoutLocale-B_aIR7O0.d.ts.map +0 -1
  689. package/dist/types/getPrefix-X9XKkrZD.d.ts +0 -68
  690. package/dist/types/getPrefix-X9XKkrZD.d.ts.map +0 -1
  691. package/dist/types/getReplacedValuesContent-BvL25pdt.d.ts +0 -8
  692. package/dist/types/getReplacedValuesContent-BvL25pdt.d.ts.map +0 -1
  693. package/dist/types/getSplittedContent-YD4JDMfB.d.ts +0 -43
  694. package/dist/types/getSplittedContent-YD4JDMfB.d.ts.map +0 -1
  695. package/dist/types/getStorageAttributes-CIO2xWqQ.d.ts +0 -29
  696. package/dist/types/getStorageAttributes-CIO2xWqQ.d.ts.map +0 -1
  697. package/dist/types/getTranslation-BG2Wg-af.d.ts +0 -30
  698. package/dist/types/getTranslation-BG2Wg-af.d.ts.map +0 -1
  699. package/dist/types/html-Dn6KrpJ3.d.ts +0 -25
  700. package/dist/types/html-Dn6KrpJ3.d.ts.map +0 -1
  701. package/dist/types/htmlTags-YxTtVUx6.d.ts +0 -115
  702. package/dist/types/htmlTags-YxTtVUx6.d.ts.map +0 -1
  703. package/dist/types/i18next-qY0AixrB.d.ts +0 -9
  704. package/dist/types/i18next-qY0AixrB.d.ts.map +0 -1
  705. package/dist/types/index-1CTsSKEn.d.ts +0 -1
  706. package/dist/types/index-B8xF2zGo.d.ts +0 -1
  707. package/dist/types/index-BcsOTSQF.d.ts +0 -1
  708. package/dist/types/index-BnEeKNKW.d.ts +0 -322
  709. package/dist/types/index-BnEeKNKW.d.ts.map +0 -1
  710. package/dist/types/index-Cf8zm5QQ.d.ts +0 -1
  711. package/dist/types/index-CfvILin8.d.ts +0 -1
  712. package/dist/types/index-DK_kKFOF.d.ts +0 -1
  713. package/dist/types/index-DeJa0xZp.d.ts +0 -1
  714. package/dist/types/index-Vlqtiwjx.d.ts +0 -1
  715. package/dist/types/insertContentInDictionary-DZ3UzG4K.d.ts +0 -25
  716. package/dist/types/insertContentInDictionary-DZ3UzG4K.d.ts.map +0 -1
  717. package/dist/types/insertion-M5fwK-29.d.ts +0 -23
  718. package/dist/types/insertion-M5fwK-29.d.ts.map +0 -1
  719. package/dist/types/intl-B2Ap8I5x.d.ts +0 -33
  720. package/dist/types/intl-B2Ap8I5x.d.ts.map +0 -1
  721. package/dist/types/isSameKeyPath-CkH8NdJh.d.ts +0 -7
  722. package/dist/types/isSameKeyPath-CkH8NdJh.d.ts.map +0 -1
  723. package/dist/types/isValidReactElement-BsoJ01oP.d.ts +0 -12
  724. package/dist/types/isValidReactElement-BsoJ01oP.d.ts.map +0 -1
  725. package/dist/types/list-BdjJM2Gx.d.ts +0 -30
  726. package/dist/types/list-BdjJM2Gx.d.ts.map +0 -1
  727. package/dist/types/localeDetector-BWNCQRiZ.d.ts +0 -18
  728. package/dist/types/localeDetector-BWNCQRiZ.d.ts.map +0 -1
  729. package/dist/types/localeMapper-DoAnasqf.d.ts +0 -92
  730. package/dist/types/localeMapper-DoAnasqf.d.ts.map +0 -1
  731. package/dist/types/localeResolver-bb7AWQNX.d.ts +0 -12
  732. package/dist/types/localeResolver-bb7AWQNX.d.ts.map +0 -1
  733. package/dist/types/localeStorage-CZHwY0u3.d.ts +0 -108
  734. package/dist/types/localeStorage-CZHwY0u3.d.ts.map +0 -1
  735. package/dist/types/markdown-MzfikrI1.d.ts +0 -26
  736. package/dist/types/markdown-MzfikrI1.d.ts.map +0 -1
  737. package/dist/types/mergeDictionaries-D6WUMQN5.d.ts +0 -7
  738. package/dist/types/mergeDictionaries-D6WUMQN5.d.ts.map +0 -1
  739. package/dist/types/normalizeDictionary-coviIGTW.d.ts +0 -9
  740. package/dist/types/normalizeDictionary-coviIGTW.d.ts.map +0 -1
  741. package/dist/types/number-C8izkCmU.d.ts +0 -16
  742. package/dist/types/number-C8izkCmU.d.ts.map +0 -1
  743. package/dist/types/orderDictionaries-SSCMY6qG.d.ts +0 -15
  744. package/dist/types/orderDictionaries-SSCMY6qG.d.ts.map +0 -1
  745. package/dist/types/parseYaml-D5gxutvA.d.ts +0 -5
  746. package/dist/types/parseYaml-D5gxutvA.d.ts.map +0 -1
  747. package/dist/types/parser-BVwR6Tjw.d.ts +0 -16
  748. package/dist/types/parser-BVwR6Tjw.d.ts.map +0 -1
  749. package/dist/types/percentage-BqsvW0Zw.d.ts +0 -16
  750. package/dist/types/percentage-BqsvW0Zw.d.ts.map +0 -1
  751. package/dist/types/relativeTime-mJaYEq7H.d.ts +0 -11
  752. package/dist/types/relativeTime-mJaYEq7H.d.ts.map +0 -1
  753. package/dist/types/removeContentNodeByKeyPath-CotCOOsD.d.ts +0 -8
  754. package/dist/types/removeContentNodeByKeyPath-CotCOOsD.d.ts.map +0 -1
  755. package/dist/types/renameContentNodeByKeyPath-BuyH5gOr.d.ts +0 -8
  756. package/dist/types/renameContentNodeByKeyPath-BuyH5gOr.d.ts.map +0 -1
  757. package/dist/types/renderer-C06x2Orf.d.ts +0 -22
  758. package/dist/types/renderer-C06x2Orf.d.ts.map +0 -1
  759. package/dist/types/rewriteUtils-Bd82NiGR.d.ts +0 -34
  760. package/dist/types/rewriteUtils-Bd82NiGR.d.ts.map +0 -1
  761. package/dist/types/splitAndJoinInsertion-bkuLa7o2.d.ts +0 -25
  762. package/dist/types/splitAndJoinInsertion-bkuLa7o2.d.ts.map +0 -1
  763. package/dist/types/translation-CiC-Avxc.d.ts +0 -33
  764. package/dist/types/translation-CiC-Avxc.d.ts.map +0 -1
  765. package/dist/types/types-C2Om0aEM.d.ts +0 -333
  766. package/dist/types/types-C2Om0aEM.d.ts.map +0 -1
  767. package/dist/types/units-CouGqa8j.d.ts +0 -16
  768. package/dist/types/units-CouGqa8j.d.ts.map +0 -1
  769. package/dist/types/updateNodeChildren-B5Tu1UBZ.d.ts +0 -7
  770. package/dist/types/updateNodeChildren-B5Tu1UBZ.d.ts.map +0 -1
  771. package/dist/types/utils-Dcmgh_80.d.ts +0 -140
  772. package/dist/types/utils-Dcmgh_80.d.ts.map +0 -1
  773. package/dist/types/validateHTML-U7UKTtFd.d.ts +0 -21
  774. package/dist/types/validateHTML-U7UKTtFd.d.ts.map +0 -1
  775. package/dist/types/validateMarkdown-BUaTDDIu.d.ts +0 -18
  776. package/dist/types/validateMarkdown-BUaTDDIu.d.ts.map +0 -1
  777. package/dist/types/validatePrefix-Dtmg7QLq.d.ts +0 -38
  778. package/dist/types/validatePrefix-Dtmg7QLq.d.ts.map +0 -1
  779. package/dist/types/vue-i18n-JtUB7N_m.d.ts +0 -9
  780. package/dist/types/vue-i18n-JtUB7N_m.d.ts.map +0 -1
@@ -1,2 +1,56 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);const e=require(`../utils/isValidReactElement.cjs`);let t=require(`@intlayer/types/nodeType`);const n=e=>typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`string`,r=e=>Object.values(t.NodeType).includes(e),i=i=>{if(typeof i==`string`)return t.NodeType.Text;if(n(i)){let e=i.nodeType;return r(e)?e:t.NodeType.Unknown}return Array.isArray(i)?t.NodeType.Array:e.isValidElement(i)?t.NodeType.ReactNode:typeof i==`number`?t.NodeType.Number:typeof i==`boolean`?t.NodeType.Boolean:i&&typeof i==`object`?t.NodeType.Object:i===null?t.NodeType.Null:t.NodeType.Unknown};exports.getNodeType=i;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_utils_isValidReactElement = require('../utils/isValidReactElement.cjs');
4
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
5
+ _intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
6
+
7
+ //#region src/dictionaryManipulator/getNodeType.ts
8
+ /**
9
+ * Type guard to check if content is a TypedNode
10
+ */
11
+ const isTypedNode = (content) => {
12
+ return typeof content === "object" && content !== null && "nodeType" in content && typeof content.nodeType === "string";
13
+ };
14
+ /**
15
+ * Type guard to check if content is a valid NodeType
16
+ */
17
+ const isValidNodeType = (nodeType) => {
18
+ return [
19
+ _intlayer_types_nodeType.TRANSLATION,
20
+ _intlayer_types_nodeType.ENUMERATION,
21
+ _intlayer_types_nodeType.CONDITION,
22
+ _intlayer_types_nodeType.INSERTION,
23
+ _intlayer_types_nodeType.FILE,
24
+ _intlayer_types_nodeType.OBJECT,
25
+ _intlayer_types_nodeType.ARRAY,
26
+ _intlayer_types_nodeType.NESTED,
27
+ _intlayer_types_nodeType.REACT_NODE,
28
+ _intlayer_types_nodeType.MARKDOWN,
29
+ _intlayer_types_nodeType.HTML,
30
+ _intlayer_types_nodeType.TEXT,
31
+ _intlayer_types_nodeType.NUMBER,
32
+ _intlayer_types_nodeType.BOOLEAN,
33
+ _intlayer_types_nodeType.GENDER,
34
+ _intlayer_types_nodeType.NULL,
35
+ _intlayer_types_nodeType.UNKNOWN
36
+ ].includes(nodeType);
37
+ };
38
+ const getNodeType = (content) => {
39
+ if (typeof content === "string") return _intlayer_types_nodeType.TEXT;
40
+ if (isTypedNode(content)) {
41
+ const nodeType = content.nodeType;
42
+ if (isValidNodeType(nodeType)) return nodeType;
43
+ return _intlayer_types_nodeType.UNKNOWN;
44
+ }
45
+ if (Array.isArray(content)) return _intlayer_types_nodeType.ARRAY;
46
+ if (require_utils_isValidReactElement.isValidElement(content)) return _intlayer_types_nodeType.REACT_NODE;
47
+ if (typeof content === "number") return _intlayer_types_nodeType.NUMBER;
48
+ if (typeof content === "boolean") return _intlayer_types_nodeType.BOOLEAN;
49
+ if (content && typeof content === "object") return _intlayer_types_nodeType.OBJECT;
50
+ if (content === null) return _intlayer_types_nodeType.NULL;
51
+ return _intlayer_types_nodeType.UNKNOWN;
52
+ };
53
+
54
+ //#endregion
55
+ exports.getNodeType = getNodeType;
2
56
  //# sourceMappingURL=getNodeType.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getNodeType.cjs","names":["NodeType","isValidElement"],"sources":["../../../src/dictionaryManipulator/getNodeType.ts"],"sourcesContent":["import type { ContentNode, TypedNode } from '@intlayer/types/dictionary';;\nimport { NodeType } from '@intlayer/types/nodeType';\nimport { isValidElement } from '../utils/isValidReactElement';\n\n/**\n * Type guard to check if content is a TypedNode\n */\nconst isTypedNode = (content: unknown): content is TypedNode => {\n return (\n typeof content === 'object' &&\n content !== null &&\n 'nodeType' in content &&\n typeof (content as TypedNode).nodeType === 'string'\n );\n};\n\n/**\n * Type guard to check if content is a valid NodeType\n */\nconst isValidNodeType = (nodeType: string): nodeType is NodeType => {\n return Object.values(NodeType).includes(nodeType as NodeType);\n};\n\nexport const getNodeType = (content: ContentNode): NodeType => {\n if (typeof content === 'string') {\n return NodeType.Text;\n }\n\n if (isTypedNode(content)) {\n const nodeType = content.nodeType;\n if (isValidNodeType(nodeType)) {\n return nodeType;\n }\n // Fallback for unknown node types\n return NodeType.Unknown;\n }\n\n if (Array.isArray(content)) {\n return NodeType.Array;\n }\n\n if (isValidElement(content)) {\n return NodeType.ReactNode;\n }\n\n if (typeof content === 'number') {\n return NodeType.Number;\n }\n\n if (typeof content === 'boolean') {\n return NodeType.Boolean;\n }\n\n if (content && typeof content === 'object') {\n return NodeType.Object;\n }\n\n if (content === null) {\n return NodeType.Null;\n }\n\n return NodeType.Unknown;\n};\n"],"mappings":"kMAOA,MAAM,EAAe,GAEjB,OAAO,GAAY,YACnB,GACA,aAAc,GACd,OAAQ,EAAsB,UAAa,SAOzC,EAAmB,GAChB,OAAO,OAAOA,EAAAA,SAAS,CAAC,SAAS,EAAqB,CAGlD,EAAe,GAAmC,CAC7D,GAAI,OAAO,GAAY,SACrB,OAAOA,EAAAA,SAAS,KAGlB,GAAI,EAAY,EAAQ,CAAE,CACxB,IAAM,EAAW,EAAQ,SAKzB,OAJI,EAAgB,EAAS,CACpB,EAGFA,EAAAA,SAAS,QA2BlB,OAxBI,MAAM,QAAQ,EAAQ,CACjBA,EAAAA,SAAS,MAGdC,EAAAA,eAAe,EAAQ,CAClBD,EAAAA,SAAS,UAGd,OAAO,GAAY,SACdA,EAAAA,SAAS,OAGd,OAAO,GAAY,UACdA,EAAAA,SAAS,QAGd,GAAW,OAAO,GAAY,SACzBA,EAAAA,SAAS,OAGd,IAAY,KACPA,EAAAA,SAAS,KAGXA,EAAAA,SAAS"}
1
+ {"version":3,"file":"getNodeType.cjs","names":["NodeTypes","isValidElement"],"sources":["../../../src/dictionaryManipulator/getNodeType.ts"],"sourcesContent":["import type { ContentNode, TypedNode } from '@intlayer/types/dictionary';\n\nimport type { NodeType } from '@intlayer/types/nodeType';\nimport * as NodeTypes from '@intlayer/types/nodeType';\nimport { isValidElement } from '../utils/isValidReactElement';\n\n/**\n * Type guard to check if content is a TypedNode\n */\nconst isTypedNode = (content: unknown): content is TypedNode => {\n return (\n typeof content === 'object' &&\n content !== null &&\n 'nodeType' in content &&\n typeof (content as TypedNode).nodeType === 'string'\n );\n};\n\n/**\n * Type guard to check if content is a valid NodeType\n */\nconst isValidNodeType = (nodeType: string): nodeType is NodeType => {\n return [\n NodeTypes.TRANSLATION,\n NodeTypes.ENUMERATION,\n NodeTypes.CONDITION,\n NodeTypes.INSERTION,\n NodeTypes.FILE,\n NodeTypes.OBJECT,\n NodeTypes.ARRAY,\n NodeTypes.NESTED,\n NodeTypes.REACT_NODE,\n NodeTypes.MARKDOWN,\n NodeTypes.HTML,\n NodeTypes.TEXT,\n NodeTypes.NUMBER,\n NodeTypes.BOOLEAN,\n NodeTypes.GENDER,\n NodeTypes.NULL,\n NodeTypes.UNKNOWN,\n ].includes(nodeType as NodeType);\n};\n\nexport const getNodeType = (content: ContentNode): NodeType => {\n if (typeof content === 'string') {\n return NodeTypes.TEXT;\n }\n\n if (isTypedNode(content)) {\n const nodeType = content.nodeType;\n if (isValidNodeType(nodeType)) {\n return nodeType;\n }\n // Fallback for unknown node types\n return NodeTypes.UNKNOWN;\n }\n\n if (Array.isArray(content)) {\n return NodeTypes.ARRAY;\n }\n\n if (isValidElement(content)) {\n return NodeTypes.REACT_NODE;\n }\n\n if (typeof content === 'number') {\n return NodeTypes.NUMBER;\n }\n\n if (typeof content === 'boolean') {\n return NodeTypes.BOOLEAN;\n }\n\n if (content && typeof content === 'object') {\n return NodeTypes.OBJECT;\n }\n\n if (content === null) {\n return NodeTypes.NULL;\n }\n\n return NodeTypes.UNKNOWN;\n};\n"],"mappings":";;;;;;;;;;AASA,MAAM,eAAe,YAA2C;AAC9D,QACE,OAAO,YAAY,YACnB,YAAY,QACZ,cAAc,WACd,OAAQ,QAAsB,aAAa;;;;;AAO/C,MAAM,mBAAmB,aAA2C;AAClE,QAAO;EACLA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACVA,yBAAU;EACX,CAAC,SAAS,SAAqB;;AAGlC,MAAa,eAAe,YAAmC;AAC7D,KAAI,OAAO,YAAY,SACrB,QAAOA,yBAAU;AAGnB,KAAI,YAAY,QAAQ,EAAE;EACxB,MAAM,WAAW,QAAQ;AACzB,MAAI,gBAAgB,SAAS,CAC3B,QAAO;AAGT,SAAOA,yBAAU;;AAGnB,KAAI,MAAM,QAAQ,QAAQ,CACxB,QAAOA,yBAAU;AAGnB,KAAIC,iDAAe,QAAQ,CACzB,QAAOD,yBAAU;AAGnB,KAAI,OAAO,YAAY,SACrB,QAAOA,yBAAU;AAGnB,KAAI,OAAO,YAAY,UACrB,QAAOA,yBAAU;AAGnB,KAAI,WAAW,OAAO,YAAY,SAChC,QAAOA,yBAAU;AAGnB,KAAI,YAAY,KACd,QAAOA,yBAAU;AAGnB,QAAOA,yBAAU"}
@@ -1 +1,27 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./editDictionaryByKeyPath.cjs`),t=require(`./getContentNodeByKeyPath.cjs`),n=require(`./getDefaultNode.cjs`),r=require(`./getEmptyNode.cjs`),i=require(`./getNodeChildren.cjs`),a=require(`./getNodeType.cjs`),o=require(`./mergeDictionaries.cjs`),s=require(`./orderDictionaries.cjs`),c=require(`./normalizeDictionary.cjs`),l=require(`./removeContentNodeByKeyPath.cjs`),u=require(`./renameContentNodeByKeyPath.cjs`),d=require(`./updateNodeChildren.cjs`);exports.editDictionaryByKeyPath=e.editDictionaryByKeyPath,exports.getContentNodeByKeyPath=t.getContentNodeByKeyPath,exports.getDefaultNode=n.getDefaultNode,exports.getEmptyNode=r.getEmptyNode,exports.getNodeChildren=i.getNodeChildren,exports.getNodeType=a.getNodeType,exports.mergeDictionaries=o.mergeDictionaries,exports.normalizeDictionaries=c.normalizeDictionaries,exports.normalizeDictionary=c.normalizeDictionary,exports.orderDictionaries=s.orderDictionaries,exports.removeContentNodeByKeyPath=l.removeContentNodeByKeyPath,exports.renameContentNodeByKeyPath=u.renameContentNodeByKeyPath,exports.updateNodeChildren=d.updateNodeChildren;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_dictionaryManipulator_editDictionaryByKeyPath = require('./editDictionaryByKeyPath.cjs');
3
+ const require_dictionaryManipulator_getContentNodeByKeyPath = require('./getContentNodeByKeyPath.cjs');
4
+ const require_dictionaryManipulator_getDefaultNode = require('./getDefaultNode.cjs');
5
+ const require_dictionaryManipulator_getEmptyNode = require('./getEmptyNode.cjs');
6
+ const require_dictionaryManipulator_getNodeChildren = require('./getNodeChildren.cjs');
7
+ const require_dictionaryManipulator_getNodeType = require('./getNodeType.cjs');
8
+ const require_dictionaryManipulator_mergeDictionaries = require('./mergeDictionaries.cjs');
9
+ const require_dictionaryManipulator_orderDictionaries = require('./orderDictionaries.cjs');
10
+ const require_dictionaryManipulator_normalizeDictionary = require('./normalizeDictionary.cjs');
11
+ const require_dictionaryManipulator_removeContentNodeByKeyPath = require('./removeContentNodeByKeyPath.cjs');
12
+ const require_dictionaryManipulator_renameContentNodeByKeyPath = require('./renameContentNodeByKeyPath.cjs');
13
+ const require_dictionaryManipulator_updateNodeChildren = require('./updateNodeChildren.cjs');
14
+
15
+ exports.editDictionaryByKeyPath = require_dictionaryManipulator_editDictionaryByKeyPath.editDictionaryByKeyPath;
16
+ exports.getContentNodeByKeyPath = require_dictionaryManipulator_getContentNodeByKeyPath.getContentNodeByKeyPath;
17
+ exports.getDefaultNode = require_dictionaryManipulator_getDefaultNode.getDefaultNode;
18
+ exports.getEmptyNode = require_dictionaryManipulator_getEmptyNode.getEmptyNode;
19
+ exports.getNodeChildren = require_dictionaryManipulator_getNodeChildren.getNodeChildren;
20
+ exports.getNodeType = require_dictionaryManipulator_getNodeType.getNodeType;
21
+ exports.mergeDictionaries = require_dictionaryManipulator_mergeDictionaries.mergeDictionaries;
22
+ exports.normalizeDictionaries = require_dictionaryManipulator_normalizeDictionary.normalizeDictionaries;
23
+ exports.normalizeDictionary = require_dictionaryManipulator_normalizeDictionary.normalizeDictionary;
24
+ exports.orderDictionaries = require_dictionaryManipulator_orderDictionaries.orderDictionaries;
25
+ exports.removeContentNodeByKeyPath = require_dictionaryManipulator_removeContentNodeByKeyPath.removeContentNodeByKeyPath;
26
+ exports.renameContentNodeByKeyPath = require_dictionaryManipulator_renameContentNodeByKeyPath.renameContentNodeByKeyPath;
27
+ exports.updateNodeChildren = require_dictionaryManipulator_updateNodeChildren.updateNodeChildren;
@@ -1,2 +1,70 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../deepTransformPlugins/getMultilingualDictionary.cjs`),n=require(`./getNodeType.cjs`);let r=require(`@intlayer/config/built`);r=e.t(r);let i=require(`@intlayer/config/logger`);const a=(e,t,a,o,s=[])=>{let c=(0,i.getAppLogger)(r.default);if(e==null||t==null)return;let l=n.getNodeType(e),u=n.getNodeType(t);if(!(l===`unknown`||u===`unknown`)&&l!==u){c([`Error: Dictionary ${(0,i.colorizeKey)(o)} has a multiple content files with type mismatch at path "${s.join(`.`)}": Cannot merge ${l} with ${u} while merging ${a}`],{level:`error`});return}},o=(e,t)=>{if(e==null)return t;if(t==null||typeof e!=`object`||typeof t!=`object`)return e;if(Array.isArray(e)&&Array.isArray(t))return s(e,t);if(typeof e==`object`&&typeof t==`object`){let n={},r=new Set([...Object.keys(e),...Object.keys(t)]);for(let i of r)n[i]=o(e[i],t[i]);return n}return e},s=(e,t)=>{let n=e.every(e=>typeof e!=`object`||!e),r=t.every(e=>typeof e!=`object`||!e);if(n&&r)return t;let i=[],a=Math.max(e.length,t.length);for(let n=0;n<a;n++){let r=e[n],a=t[n];r===void 0&&a===void 0||(r===void 0?i.push(a):a===void 0?i.push(r):typeof r==`object`&&typeof a==`object`&&r!==null&&a!==null?(`key`in r&&`key`in a&&(r.key,a.key),i.push(o(r,a))):i.push(r))}return i},c=e=>{let n=Array.from(new Set(e.filter(e=>e.localId).map(e=>e.localId))),r=e.map(e=>e.key);if(new Set(r).size!==1)throw Error(`All dictionaries must have the same key`);let i=e[0].content;for(let n=1;n<e.length;n++){let r=t.getMultilingualDictionary(e[n]);a(i,r.content,r.localId,r.key,[]),i=o(i,r.content)}return{key:e[0].key,content:i,localIds:n}};exports.mergeDictionaries=c;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_deepTransformPlugins_getMultilingualDictionary = require('../deepTransformPlugins/getMultilingualDictionary.cjs');
4
+ const require_dictionaryManipulator_getNodeType = require('./getNodeType.cjs');
5
+ let _intlayer_config_built = require("@intlayer/config/built");
6
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
7
+ let _intlayer_config_logger = require("@intlayer/config/logger");
8
+
9
+ //#region src/dictionaryManipulator/mergeDictionaries.ts
10
+ const checkTypesMatch = (object1, object2, object2LocalId, dictionaryKey, path = []) => {
11
+ const appLogger = (0, _intlayer_config_logger.getAppLogger)(_intlayer_config_built.default);
12
+ if (object1 === void 0 || object1 === null || object2 === void 0 || object2 === null) return;
13
+ const type1 = require_dictionaryManipulator_getNodeType.getNodeType(object1);
14
+ const type2 = require_dictionaryManipulator_getNodeType.getNodeType(object2);
15
+ if (type1 === "unknown" || type2 === "unknown") return;
16
+ if (type1 !== type2) {
17
+ appLogger([`Error: Dictionary ${(0, _intlayer_config_logger.colorizeKey)(dictionaryKey)} has a multiple content files with type mismatch at path "${path.join(".")}": Cannot merge ${type1} with ${type2} while merging ${object2LocalId}`], { level: "error" });
18
+ return;
19
+ }
20
+ };
21
+ const customMerge = (destination, source) => {
22
+ if (destination === void 0 || destination === null) return source;
23
+ if (source === void 0 || source === null) return destination;
24
+ if (typeof destination !== "object" || typeof source !== "object") return destination;
25
+ if (Array.isArray(destination) && Array.isArray(source)) return arrayMerge(destination, source);
26
+ if (typeof destination === "object" && typeof source === "object") {
27
+ const result = {};
28
+ const allKeys = new Set([...Object.keys(destination), ...Object.keys(source)]);
29
+ for (const key of allKeys) result[key] = customMerge(destination[key], source[key]);
30
+ return result;
31
+ }
32
+ return destination;
33
+ };
34
+ const arrayMerge = (destinationArray, sourceArray) => {
35
+ const destHasOnlyPrimitives = destinationArray.every((item) => typeof item !== "object" || item === null);
36
+ const sourceHasOnlyPrimitives = sourceArray.every((item) => typeof item !== "object" || item === null);
37
+ if (destHasOnlyPrimitives && sourceHasOnlyPrimitives) return sourceArray;
38
+ const result = [];
39
+ const maxLength = Math.max(destinationArray.length, sourceArray.length);
40
+ for (let i = 0; i < maxLength; i++) {
41
+ const destItem = destinationArray[i];
42
+ const sourceItem = sourceArray[i];
43
+ if (destItem === void 0 && sourceItem === void 0) {} else if (destItem === void 0) result.push(sourceItem);
44
+ else if (sourceItem === void 0) result.push(destItem);
45
+ else if (typeof destItem === "object" && typeof sourceItem === "object" && destItem !== null && sourceItem !== null) if ("key" in destItem && "key" in sourceItem && destItem.key === sourceItem.key) result.push(customMerge(destItem, sourceItem));
46
+ else result.push(customMerge(destItem, sourceItem));
47
+ else result.push(destItem);
48
+ }
49
+ return result;
50
+ };
51
+ const mergeDictionaries = (dictionaries) => {
52
+ const localIds = Array.from(new Set(dictionaries.filter((dict) => dict.localId).map((dict) => dict.localId)));
53
+ const dictionariesKeys = dictionaries.map((dict) => dict.key);
54
+ if (new Set(dictionariesKeys).size !== 1) throw new Error("All dictionaries must have the same key");
55
+ let mergedContent = dictionaries[0].content;
56
+ for (let i = 1; i < dictionaries.length; i++) {
57
+ const currentDictionary = require_deepTransformPlugins_getMultilingualDictionary.getMultilingualDictionary(dictionaries[i]);
58
+ checkTypesMatch(mergedContent, currentDictionary.content, currentDictionary.localId, currentDictionary.key, []);
59
+ mergedContent = customMerge(mergedContent, currentDictionary.content);
60
+ }
61
+ return {
62
+ key: dictionaries[0].key,
63
+ content: mergedContent,
64
+ localIds
65
+ };
66
+ };
67
+
68
+ //#endregion
69
+ exports.mergeDictionaries = mergeDictionaries;
2
70
  //# sourceMappingURL=mergeDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeDictionaries.cjs","names":["configuration","getNodeType","getMultilingualDictionary"],"sources":["../../../src/dictionaryManipulator/mergeDictionaries.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport type { ContentNode, Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport { getMultilingualDictionary } from '../deepTransformPlugins';\nimport { getNodeType } from './getNodeType';\n\n// Extended type that includes arrays for internal merge operations\ntype MergeableContent = ContentNode | ContentNode[];\n\nconst checkTypesMatch = (\n object1: ContentNode,\n object2: ContentNode,\n object2LocalId: LocalDictionaryId | undefined,\n dictionaryKey: string,\n path: string[] = []\n): void => {\n const appLogger = getAppLogger(configuration);\n\n // If either side is missing/undefined, allow merge without error\n if (\n object1 === undefined ||\n object1 === null ||\n object2 === undefined ||\n object2 === null\n )\n return;\n\n const type1 = getNodeType(object1);\n const type2 = getNodeType(object2);\n\n // Unknown types are treated as flexible; skip strict mismatch reporting\n if (type1 === 'unknown' || type2 === 'unknown') return;\n\n if (type1 !== type2) {\n appLogger(\n [\n `Error: Dictionary ${colorizeKey(dictionaryKey)} has a multiple content files with type mismatch at path \"${path.join('.')}\": Cannot merge ${type1} with ${type2} while merging ${object2LocalId}`,\n ],\n {\n level: 'error',\n }\n );\n\n return;\n }\n};\n\n// Custom merge function that prefers destination (first dictionary) values\nconst customMerge = (\n destination: ContentNode,\n source: ContentNode\n): MergeableContent => {\n // If destination is undefined/null, use source\n if (destination === undefined || destination === null) {\n return source;\n }\n\n // If source is undefined/null, use destination\n if (source === undefined || source === null) {\n return destination;\n }\n\n // For primitive values, prefer destination (first dictionary)\n if (typeof destination !== 'object' || typeof source !== 'object') {\n return destination;\n }\n\n // For arrays, use our custom array merge\n if (Array.isArray(destination) && Array.isArray(source)) {\n return arrayMerge(\n destination as ContentNode[],\n source as ContentNode[]\n ) as MergeableContent;\n }\n\n // For objects, recursively merge with our custom logic\n if (typeof destination === 'object' && typeof source === 'object') {\n const result: Record<string, MergeableContent> = {};\n const allKeys = new Set([\n ...Object.keys(destination as unknown as Record<string, ContentNode>),\n ...Object.keys(source as unknown as Record<string, ContentNode>),\n ]);\n\n for (const key of allKeys) {\n result[key] = customMerge(\n (destination as unknown as Record<string, ContentNode>)[key],\n (source as unknown as Record<string, ContentNode>)[key]\n );\n }\n\n return result as unknown as MergeableContent;\n }\n\n // Fallback to destination\n return destination;\n};\n\n// Custom array merge strategy that merges arrays by key when present, otherwise by index\nconst arrayMerge = (\n destinationArray: ContentNode[],\n sourceArray: ContentNode[]\n): MergeableContent[] => {\n // Check if both arrays contain only primitives\n const destHasOnlyPrimitives = destinationArray.every(\n (item) => typeof item !== 'object' || item === null\n );\n const sourceHasOnlyPrimitives = sourceArray.every(\n (item) => typeof item !== 'object' || item === null\n );\n\n // If both arrays contain only primitives, use the source array (second dictionary)\n if (destHasOnlyPrimitives && sourceHasOnlyPrimitives) {\n return sourceArray;\n }\n\n // Otherwise, merge by index with object merging logic\n const result: MergeableContent[] = [];\n const maxLength = Math.max(destinationArray.length, sourceArray.length);\n\n for (let i = 0; i < maxLength; i++) {\n const destItem = destinationArray[i];\n const sourceItem = sourceArray[i];\n\n if (destItem === undefined && sourceItem === undefined) {\n } else if (destItem === undefined) {\n // Only source exists, add it\n result.push(sourceItem);\n } else if (sourceItem === undefined) {\n // Only destination exists, add it\n result.push(destItem);\n } else {\n // Both exist, merge them\n if (\n typeof destItem === 'object' &&\n typeof sourceItem === 'object' &&\n destItem !== null &&\n sourceItem !== null\n ) {\n // Check if both objects have a 'key' property for keyed merging\n if (\n 'key' in destItem &&\n 'key' in sourceItem &&\n (destItem as Record<string, string>).key ===\n (sourceItem as Record<string, string>).key\n ) {\n // Merge objects with same key, preferring destination (first dictionary) values\n result.push(customMerge(destItem, sourceItem));\n } else {\n // Merge objects by index, preferring destination (first dictionary) values\n result.push(customMerge(destItem, sourceItem));\n }\n } else {\n // For primitives or non-objects, use destination value (first dictionary)\n result.push(destItem);\n }\n }\n }\n\n return result;\n};\n\nexport const mergeDictionaries = (dictionaries: Dictionary[]): Dictionary => {\n const localIds = Array.from(\n new Set<LocalDictionaryId>(\n dictionaries.filter((dict) => dict.localId).map((dict) => dict.localId!)\n )\n );\n\n const dictionariesKeys = dictionaries.map((dict) => dict.key);\n\n // Check if all dictionaries have the same key\n if (new Set(dictionariesKeys).size !== 1) {\n throw new Error('All dictionaries must have the same key');\n }\n\n let mergedContent: Dictionary['content'] = dictionaries[0].content;\n\n for (let i = 1; i < dictionaries.length; i++) {\n // If the dictionary is a per-locale dictionary, transform it to a partial multilingual dictionary\n const currentDictionary = getMultilingualDictionary(dictionaries[i]);\n\n // Check types before merging\n checkTypesMatch(\n mergedContent,\n currentDictionary.content,\n currentDictionary.localId,\n currentDictionary.key,\n []\n );\n\n mergedContent = customMerge(\n mergedContent,\n currentDictionary.content\n ) as ContentNode;\n }\n\n const mergedDictionary: Dictionary = {\n key: dictionaries[0].key,\n content: mergedContent,\n localIds,\n };\n\n return mergedDictionary;\n};\n"],"mappings":"wSASA,MAAM,GACJ,EACA,EACA,EACA,EACA,EAAiB,EAAE,GACV,CACT,IAAM,GAAA,EAAA,EAAA,cAAyBA,EAAAA,QAAc,CAG7C,GACE,GACY,MACZ,GACY,KAEZ,OAEF,IAAM,EAAQC,EAAAA,YAAY,EAAQ,CAC5B,EAAQA,EAAAA,YAAY,EAAQ,CAG9B,SAAU,WAAa,IAAU,YAEjC,IAAU,EAAO,CACnB,EACE,CACE,sBAAA,EAAA,EAAA,aAAiC,EAAc,CAAC,4DAA4D,EAAK,KAAK,IAAI,CAAC,kBAAkB,EAAM,QAAQ,EAAM,iBAAiB,IACnL,CACD,CACE,MAAO,QACR,CACF,CAED,SAKE,GACJ,EACA,IACqB,CAErB,GAAI,GAA6C,KAC/C,OAAO,EAST,GALI,GAAmC,MAKnC,OAAO,GAAgB,UAAY,OAAO,GAAW,SACvD,OAAO,EAIT,GAAI,MAAM,QAAQ,EAAY,EAAI,MAAM,QAAQ,EAAO,CACrD,OAAO,EACL,EACA,EACD,CAIH,GAAI,OAAO,GAAgB,UAAY,OAAO,GAAW,SAAU,CACjE,IAAM,EAA2C,EAAE,CAC7C,EAAU,IAAI,IAAI,CACtB,GAAG,OAAO,KAAK,EAAsD,CACrE,GAAG,OAAO,KAAK,EAAiD,CACjE,CAAC,CAEF,IAAK,IAAM,KAAO,EAChB,EAAO,GAAO,EACX,EAAuD,GACvD,EAAkD,GACpD,CAGH,OAAO,EAIT,OAAO,GAIH,GACJ,EACA,IACuB,CAEvB,IAAM,EAAwB,EAAiB,MAC5C,GAAS,OAAO,GAAS,WAAY,EACvC,CACK,EAA0B,EAAY,MACzC,GAAS,OAAO,GAAS,WAAY,EACvC,CAGD,GAAI,GAAyB,EAC3B,OAAO,EAIT,IAAM,EAA6B,EAAE,CAC/B,EAAY,KAAK,IAAI,EAAiB,OAAQ,EAAY,OAAO,CAEvE,IAAK,IAAI,EAAI,EAAG,EAAI,EAAW,IAAK,CAClC,IAAM,EAAW,EAAiB,GAC5B,EAAa,EAAY,GAE3B,IAAa,IAAA,IAAa,IAAe,IAAA,KAClC,IAAa,IAAA,GAEtB,EAAO,KAAK,EAAW,CACd,IAAe,IAAA,GAExB,EAAO,KAAK,EAAS,CAInB,OAAO,GAAa,UACpB,OAAO,GAAe,UACtB,IAAa,MACb,IAAe,MAIb,QAAS,GACT,QAAS,IACR,EAAoC,IAClC,EAAsC,KAGzC,EAAO,KAAK,EAAY,EAAU,EAAW,CAAC,EAOhD,EAAO,KAAK,EAAS,EAK3B,OAAO,GAGI,EAAqB,GAA2C,CAC3E,IAAM,EAAW,MAAM,KACrB,IAAI,IACF,EAAa,OAAQ,GAAS,EAAK,QAAQ,CAAC,IAAK,GAAS,EAAK,QAAS,CACzE,CACF,CAEK,EAAmB,EAAa,IAAK,GAAS,EAAK,IAAI,CAG7D,GAAI,IAAI,IAAI,EAAiB,CAAC,OAAS,EACrC,MAAU,MAAM,0CAA0C,CAG5D,IAAI,EAAuC,EAAa,GAAG,QAE3D,IAAK,IAAI,EAAI,EAAG,EAAI,EAAa,OAAQ,IAAK,CAE5C,IAAM,EAAoBC,EAAAA,0BAA0B,EAAa,GAAG,CAGpE,EACE,EACA,EAAkB,QAClB,EAAkB,QAClB,EAAkB,IAClB,EAAE,CACH,CAED,EAAgB,EACd,EACA,EAAkB,QACnB,CASH,MANqC,CACnC,IAAK,EAAa,GAAG,IACrB,QAAS,EACT,WACD"}
1
+ {"version":3,"file":"mergeDictionaries.cjs","names":["configuration","getNodeType","getMultilingualDictionary"],"sources":["../../../src/dictionaryManipulator/mergeDictionaries.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport { colorizeKey, getAppLogger } from '@intlayer/config/logger';\nimport type { ContentNode, Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';\nimport { getMultilingualDictionary } from '../deepTransformPlugins';\nimport { getNodeType } from './getNodeType';\n\n// Extended type that includes arrays for internal merge operations\ntype MergeableContent = ContentNode | ContentNode[];\n\nconst checkTypesMatch = (\n object1: ContentNode,\n object2: ContentNode,\n object2LocalId: LocalDictionaryId | undefined,\n dictionaryKey: string,\n path: string[] = []\n): void => {\n const appLogger = getAppLogger(configuration);\n\n // If either side is missing/undefined, allow merge without error\n if (\n object1 === undefined ||\n object1 === null ||\n object2 === undefined ||\n object2 === null\n )\n return;\n\n const type1 = getNodeType(object1);\n const type2 = getNodeType(object2);\n\n // Unknown types are treated as flexible; skip strict mismatch reporting\n if (type1 === 'unknown' || type2 === 'unknown') return;\n\n if (type1 !== type2) {\n appLogger(\n [\n `Error: Dictionary ${colorizeKey(dictionaryKey)} has a multiple content files with type mismatch at path \"${path.join('.')}\": Cannot merge ${type1} with ${type2} while merging ${object2LocalId}`,\n ],\n {\n level: 'error',\n }\n );\n\n return;\n }\n};\n\n// Custom merge function that prefers destination (first dictionary) values\nconst customMerge = (\n destination: ContentNode,\n source: ContentNode\n): MergeableContent => {\n // If destination is undefined/null, use source\n if (destination === undefined || destination === null) {\n return source;\n }\n\n // If source is undefined/null, use destination\n if (source === undefined || source === null) {\n return destination;\n }\n\n // For primitive values, prefer destination (first dictionary)\n if (typeof destination !== 'object' || typeof source !== 'object') {\n return destination;\n }\n\n // For arrays, use our custom array merge\n if (Array.isArray(destination) && Array.isArray(source)) {\n return arrayMerge(\n destination as ContentNode[],\n source as ContentNode[]\n ) as MergeableContent;\n }\n\n // For objects, recursively merge with our custom logic\n if (typeof destination === 'object' && typeof source === 'object') {\n const result: Record<string, MergeableContent> = {};\n const allKeys = new Set([\n ...Object.keys(destination as unknown as Record<string, ContentNode>),\n ...Object.keys(source as unknown as Record<string, ContentNode>),\n ]);\n\n for (const key of allKeys) {\n result[key] = customMerge(\n (destination as unknown as Record<string, ContentNode>)[key],\n (source as unknown as Record<string, ContentNode>)[key]\n );\n }\n\n return result as unknown as MergeableContent;\n }\n\n // Fallback to destination\n return destination;\n};\n\n// Custom array merge strategy that merges arrays by key when present, otherwise by index\nconst arrayMerge = (\n destinationArray: ContentNode[],\n sourceArray: ContentNode[]\n): MergeableContent[] => {\n // Check if both arrays contain only primitives\n const destHasOnlyPrimitives = destinationArray.every(\n (item) => typeof item !== 'object' || item === null\n );\n const sourceHasOnlyPrimitives = sourceArray.every(\n (item) => typeof item !== 'object' || item === null\n );\n\n // If both arrays contain only primitives, use the source array (second dictionary)\n if (destHasOnlyPrimitives && sourceHasOnlyPrimitives) {\n return sourceArray;\n }\n\n // Otherwise, merge by index with object merging logic\n const result: MergeableContent[] = [];\n const maxLength = Math.max(destinationArray.length, sourceArray.length);\n\n for (let i = 0; i < maxLength; i++) {\n const destItem = destinationArray[i];\n const sourceItem = sourceArray[i];\n\n if (destItem === undefined && sourceItem === undefined) {\n } else if (destItem === undefined) {\n // Only source exists, add it\n result.push(sourceItem);\n } else if (sourceItem === undefined) {\n // Only destination exists, add it\n result.push(destItem);\n } else {\n // Both exist, merge them\n if (\n typeof destItem === 'object' &&\n typeof sourceItem === 'object' &&\n destItem !== null &&\n sourceItem !== null\n ) {\n // Check if both objects have a 'key' property for keyed merging\n if (\n 'key' in destItem &&\n 'key' in sourceItem &&\n (destItem as Record<string, string>).key ===\n (sourceItem as Record<string, string>).key\n ) {\n // Merge objects with same key, preferring destination (first dictionary) values\n result.push(customMerge(destItem, sourceItem));\n } else {\n // Merge objects by index, preferring destination (first dictionary) values\n result.push(customMerge(destItem, sourceItem));\n }\n } else {\n // For primitives or non-objects, use destination value (first dictionary)\n result.push(destItem);\n }\n }\n }\n\n return result;\n};\n\nexport const mergeDictionaries = (dictionaries: Dictionary[]): Dictionary => {\n const localIds = Array.from(\n new Set<LocalDictionaryId>(\n dictionaries.filter((dict) => dict.localId).map((dict) => dict.localId!)\n )\n );\n\n const dictionariesKeys = dictionaries.map((dict) => dict.key);\n\n // Check if all dictionaries have the same key\n if (new Set(dictionariesKeys).size !== 1) {\n throw new Error('All dictionaries must have the same key');\n }\n\n let mergedContent: Dictionary['content'] = dictionaries[0].content;\n\n for (let i = 1; i < dictionaries.length; i++) {\n // If the dictionary is a per-locale dictionary, transform it to a partial multilingual dictionary\n const currentDictionary = getMultilingualDictionary(dictionaries[i]);\n\n // Check types before merging\n checkTypesMatch(\n mergedContent,\n currentDictionary.content,\n currentDictionary.localId,\n currentDictionary.key,\n []\n );\n\n mergedContent = customMerge(\n mergedContent,\n currentDictionary.content\n ) as ContentNode;\n }\n\n const mergedDictionary: Dictionary = {\n key: dictionaries[0].key,\n content: mergedContent,\n localIds,\n };\n\n return mergedDictionary;\n};\n"],"mappings":";;;;;;;;;AASA,MAAM,mBACJ,SACA,SACA,gBACA,eACA,OAAiB,EAAE,KACV;CACT,MAAM,sDAAyBA,+BAAc;AAG7C,KACE,YAAY,UACZ,YAAY,QACZ,YAAY,UACZ,YAAY,KAEZ;CAEF,MAAM,QAAQC,sDAAY,QAAQ;CAClC,MAAM,QAAQA,sDAAY,QAAQ;AAGlC,KAAI,UAAU,aAAa,UAAU,UAAW;AAEhD,KAAI,UAAU,OAAO;AACnB,YACE,CACE,8DAAiC,cAAc,CAAC,4DAA4D,KAAK,KAAK,IAAI,CAAC,kBAAkB,MAAM,QAAQ,MAAM,iBAAiB,iBACnL,EACD,EACE,OAAO,SACR,CACF;AAED;;;AAKJ,MAAM,eACJ,aACA,WACqB;AAErB,KAAI,gBAAgB,UAAa,gBAAgB,KAC/C,QAAO;AAIT,KAAI,WAAW,UAAa,WAAW,KACrC,QAAO;AAIT,KAAI,OAAO,gBAAgB,YAAY,OAAO,WAAW,SACvD,QAAO;AAIT,KAAI,MAAM,QAAQ,YAAY,IAAI,MAAM,QAAQ,OAAO,CACrD,QAAO,WACL,aACA,OACD;AAIH,KAAI,OAAO,gBAAgB,YAAY,OAAO,WAAW,UAAU;EACjE,MAAM,SAA2C,EAAE;EACnD,MAAM,UAAU,IAAI,IAAI,CACtB,GAAG,OAAO,KAAK,YAAsD,EACrE,GAAG,OAAO,KAAK,OAAiD,CACjE,CAAC;AAEF,OAAK,MAAM,OAAO,QAChB,QAAO,OAAO,YACX,YAAuD,MACvD,OAAkD,KACpD;AAGH,SAAO;;AAIT,QAAO;;AAIT,MAAM,cACJ,kBACA,gBACuB;CAEvB,MAAM,wBAAwB,iBAAiB,OAC5C,SAAS,OAAO,SAAS,YAAY,SAAS,KAChD;CACD,MAAM,0BAA0B,YAAY,OACzC,SAAS,OAAO,SAAS,YAAY,SAAS,KAChD;AAGD,KAAI,yBAAyB,wBAC3B,QAAO;CAIT,MAAM,SAA6B,EAAE;CACrC,MAAM,YAAY,KAAK,IAAI,iBAAiB,QAAQ,YAAY,OAAO;AAEvE,MAAK,IAAI,IAAI,GAAG,IAAI,WAAW,KAAK;EAClC,MAAM,WAAW,iBAAiB;EAClC,MAAM,aAAa,YAAY;AAE/B,MAAI,aAAa,UAAa,eAAe,QAAW,YAC7C,aAAa,OAEtB,QAAO,KAAK,WAAW;WACd,eAAe,OAExB,QAAO,KAAK,SAAS;WAInB,OAAO,aAAa,YACpB,OAAO,eAAe,YACtB,aAAa,QACb,eAAe,KAGf,KACE,SAAS,YACT,SAAS,cACR,SAAoC,QAClC,WAAsC,IAGzC,QAAO,KAAK,YAAY,UAAU,WAAW,CAAC;MAG9C,QAAO,KAAK,YAAY,UAAU,WAAW,CAAC;MAIhD,QAAO,KAAK,SAAS;;AAK3B,QAAO;;AAGT,MAAa,qBAAqB,iBAA2C;CAC3E,MAAM,WAAW,MAAM,KACrB,IAAI,IACF,aAAa,QAAQ,SAAS,KAAK,QAAQ,CAAC,KAAK,SAAS,KAAK,QAAS,CACzE,CACF;CAED,MAAM,mBAAmB,aAAa,KAAK,SAAS,KAAK,IAAI;AAG7D,KAAI,IAAI,IAAI,iBAAiB,CAAC,SAAS,EACrC,OAAM,IAAI,MAAM,0CAA0C;CAG5D,IAAI,gBAAuC,aAAa,GAAG;AAE3D,MAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;EAE5C,MAAM,oBAAoBC,iFAA0B,aAAa,GAAG;AAGpE,kBACE,eACA,kBAAkB,SAClB,kBAAkB,SAClB,kBAAkB,KAClB,EAAE,CACH;AAED,kBAAgB,YACd,eACA,kBAAkB,QACnB;;AASH,QANqC;EACnC,KAAK,aAAa,GAAG;EACrB,SAAS;EACT;EACD"}
@@ -1,2 +1,31 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../transpiler/translation/translation.cjs`),t=require(`../deepTransformPlugins/getLocalizedContent.cjs`),n=require(`./orderDictionaries.cjs`),r=(n,r)=>{let{locales:i}=r.internationalization,a=JSON.parse(JSON.stringify(n));if(n.locale)return{...n,locale:void 0,content:e.t({[n.locale]:n.content})};let o=i.reduce((e,n)=>(e[n]=t.getPerLocaleDictionary(a,n).content,e),{});return{...n,content:e.t(o)}},i=(e,t)=>n.orderDictionaries(e,t).map(e=>r(e,t));exports.normalizeDictionaries=i,exports.normalizeDictionary=r;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_transpiler_translation_translation = require('../transpiler/translation/translation.cjs');
3
+ const require_deepTransformPlugins_getLocalizedContent = require('../deepTransformPlugins/getLocalizedContent.cjs');
4
+ const require_dictionaryManipulator_orderDictionaries = require('./orderDictionaries.cjs');
5
+
6
+ //#region src/dictionaryManipulator/normalizeDictionary.ts
7
+ const normalizeDictionary = (dictionary, configuration) => {
8
+ const { locales } = configuration.internationalization;
9
+ const parsedDictionary = JSON.parse(JSON.stringify(dictionary));
10
+ if (dictionary.locale) return {
11
+ ...dictionary,
12
+ locale: void 0,
13
+ content: require_transpiler_translation_translation.t({ [dictionary.locale]: dictionary.content })
14
+ };
15
+ const perLocaleContent = locales.reduce((acc, locale) => {
16
+ acc[locale] = require_deepTransformPlugins_getLocalizedContent.getPerLocaleDictionary(parsedDictionary, locale).content;
17
+ return acc;
18
+ }, {});
19
+ return {
20
+ ...dictionary,
21
+ content: require_transpiler_translation_translation.t(perLocaleContent)
22
+ };
23
+ };
24
+ const normalizeDictionaries = (dictionaries, configuration) => {
25
+ return require_dictionaryManipulator_orderDictionaries.orderDictionaries(dictionaries, configuration).map((dictionary) => normalizeDictionary(dictionary, configuration));
26
+ };
27
+
28
+ //#endregion
29
+ exports.normalizeDictionaries = normalizeDictionaries;
30
+ exports.normalizeDictionary = normalizeDictionary;
2
31
  //# sourceMappingURL=normalizeDictionary.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeDictionary.cjs","names":["t","getPerLocaleDictionary","orderDictionaries"],"sources":["../../../src/dictionaryManipulator/normalizeDictionary.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { getPerLocaleDictionary } from '../deepTransformPlugins';\nimport { t } from '../transpiler/translation';\nimport { orderDictionaries } from './orderDictionaries';\n\nexport const normalizeDictionary = (\n dictionary: Dictionary,\n configuration: IntlayerConfig\n): Dictionary => {\n const { locales } = configuration.internationalization;\n\n const parsedDictionary = JSON.parse(JSON.stringify(dictionary));\n\n // If the dictionary is a per-locale dictionary, transform it to a partial multilingual dictionary\n if (dictionary.locale) {\n return {\n ...dictionary,\n locale: undefined,\n content: t({\n [dictionary.locale]: dictionary.content,\n }),\n };\n }\n\n const perLocaleContent = locales.reduce(\n (acc, locale) => {\n const perLocaleDictionary = getPerLocaleDictionary(\n parsedDictionary,\n locale\n );\n\n acc[locale] = perLocaleDictionary.content;\n return acc;\n },\n {} as Record<Locale, Dictionary['content']>\n );\n\n return {\n ...dictionary,\n content: t(perLocaleContent),\n };\n};\n\nexport const normalizeDictionaries = (\n dictionaries: Dictionary[],\n configuration: IntlayerConfig\n): Dictionary[] => {\n const orderedDictionaries = orderDictionaries(dictionaries, configuration);\n\n const structuredDictionaries = orderedDictionaries.map((dictionary) =>\n normalizeDictionary(dictionary, configuration)\n );\n\n return structuredDictionaries;\n};\n"],"mappings":"kOAOa,GACX,EACA,IACe,CACf,GAAM,CAAE,WAAY,EAAc,qBAE5B,EAAmB,KAAK,MAAM,KAAK,UAAU,EAAW,CAAC,CAG/D,GAAI,EAAW,OACb,MAAO,CACL,GAAG,EACH,OAAQ,IAAA,GACR,QAASA,EAAAA,EAAE,EACR,EAAW,QAAS,EAAW,QACjC,CAAC,CACH,CAGH,IAAM,EAAmB,EAAQ,QAC9B,EAAK,KAMJ,EAAI,GALwBC,EAAAA,uBAC1B,EACA,EACD,CAEiC,QAC3B,GAET,EAAE,CACH,CAED,MAAO,CACL,GAAG,EACH,QAASD,EAAAA,EAAE,EAAiB,CAC7B,EAGU,GACX,EACA,IAE4BE,EAAAA,kBAAkB,EAAc,EAAc,CAEvB,IAAK,GACtD,EAAoB,EAAY,EAAc,CAC/C"}
1
+ {"version":3,"file":"normalizeDictionary.cjs","names":["t","getPerLocaleDictionary","orderDictionaries"],"sources":["../../../src/dictionaryManipulator/normalizeDictionary.ts"],"sourcesContent":["import type { Dictionary } from '@intlayer/types/dictionary';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { getPerLocaleDictionary } from '../deepTransformPlugins';\nimport { t } from '../transpiler/translation';\nimport { orderDictionaries } from './orderDictionaries';\n\nexport const normalizeDictionary = (\n dictionary: Dictionary,\n configuration: IntlayerConfig\n): Dictionary => {\n const { locales } = configuration.internationalization;\n\n const parsedDictionary = JSON.parse(JSON.stringify(dictionary));\n\n // If the dictionary is a per-locale dictionary, transform it to a partial multilingual dictionary\n if (dictionary.locale) {\n return {\n ...dictionary,\n locale: undefined,\n content: t({\n [dictionary.locale]: dictionary.content,\n }),\n };\n }\n\n const perLocaleContent = locales.reduce(\n (acc, locale) => {\n const perLocaleDictionary = getPerLocaleDictionary(\n parsedDictionary,\n locale\n );\n\n acc[locale] = perLocaleDictionary.content;\n return acc;\n },\n {} as Record<Locale, Dictionary['content']>\n );\n\n return {\n ...dictionary,\n content: t(perLocaleContent),\n };\n};\n\nexport const normalizeDictionaries = (\n dictionaries: Dictionary[],\n configuration: IntlayerConfig\n): Dictionary[] => {\n const orderedDictionaries = orderDictionaries(dictionaries, configuration);\n\n const structuredDictionaries = orderedDictionaries.map((dictionary) =>\n normalizeDictionary(dictionary, configuration)\n );\n\n return structuredDictionaries;\n};\n"],"mappings":";;;;;;AAOA,MAAa,uBACX,YACA,kBACe;CACf,MAAM,EAAE,YAAY,cAAc;CAElC,MAAM,mBAAmB,KAAK,MAAM,KAAK,UAAU,WAAW,CAAC;AAG/D,KAAI,WAAW,OACb,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAASA,6CAAE,GACR,WAAW,SAAS,WAAW,SACjC,CAAC;EACH;CAGH,MAAM,mBAAmB,QAAQ,QAC9B,KAAK,WAAW;AAMf,MAAI,UALwBC,wEAC1B,kBACA,OACD,CAEiC;AAClC,SAAO;IAET,EAAE,CACH;AAED,QAAO;EACL,GAAG;EACH,SAASD,6CAAE,iBAAiB;EAC7B;;AAGH,MAAa,yBACX,cACA,kBACiB;AAOjB,QAN4BE,kEAAkB,cAAc,cAAc,CAEvB,KAAK,eACtD,oBAAoB,YAAY,cAAc,CAC/C"}
@@ -1,2 +1,49 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`@intlayer/config/built`);t=e.t(t);const n=(e,n=t.default)=>{let{editor:r}=n,{dictionaryPriorityStrategy:i}=r;if(e.length<=1)return e;let a=e.map((e,t)=>({dictionary:e,index:t})),o=e=>{let t=e.priority??0;return Number.isFinite(t)?t:0},s=e=>{let t=e.location;return t===void 0?2:i===`distant_first`?t===`remote`?0:1:t===`local`?0:1};return a.sort((e,t)=>{let n=e.dictionary.filled?1:0,r=t.dictionary.filled?1:0;if(n!==r)return n-r;let i=o(e.dictionary),a=o(t.dictionary);if(i!==a)return a-i;let c=s(e.dictionary),l=s(t.dictionary);return c===l?e.index-t.index:c-l}),a.map(({dictionary:e})=>e)};exports.orderDictionaries=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_config_built = require("@intlayer/config/built");
4
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
5
+
6
+ //#region src/dictionaryManipulator/orderDictionaries.ts
7
+ /**
8
+ * Orders dictionaries based on the dictionary priority strategy.
9
+ *
10
+ * @param dictionaries - Array of dictionaries to order
11
+ * @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')
12
+ * @returns Ordered array of dictionaries
13
+ */
14
+ const orderDictionaries = (dictionaries, configuration = _intlayer_config_built.default) => {
15
+ const { editor } = configuration;
16
+ const { dictionaryPriorityStrategy } = editor;
17
+ if (dictionaries.length <= 1) return dictionaries;
18
+ const withIndex = dictionaries.map((dictionary, index) => ({
19
+ dictionary,
20
+ index
21
+ }));
22
+ const getPriority = (dictionary) => {
23
+ const p = dictionary.priority ?? 0;
24
+ return Number.isFinite(p) ? p : 0;
25
+ };
26
+ const getLocationWeight = (d) => {
27
+ const location = d.location;
28
+ if (location === void 0) return 2;
29
+ if (dictionaryPriorityStrategy === "distant_first") return location === "remote" ? 0 : 1;
30
+ return location === "local" ? 0 : 1;
31
+ };
32
+ withIndex.sort((a, b) => {
33
+ const aAuto = a.dictionary.filled ? 1 : 0;
34
+ const bAuto = b.dictionary.filled ? 1 : 0;
35
+ if (aAuto !== bAuto) return aAuto - bAuto;
36
+ const aP = getPriority(a.dictionary);
37
+ const bP = getPriority(b.dictionary);
38
+ if (aP !== bP) return bP - aP;
39
+ const aLocation = getLocationWeight(a.dictionary);
40
+ const bLocation = getLocationWeight(b.dictionary);
41
+ if (aLocation !== bLocation) return aLocation - bLocation;
42
+ return a.index - b.index;
43
+ });
44
+ return withIndex.map(({ dictionary }) => dictionary);
45
+ };
46
+
47
+ //#endregion
48
+ exports.orderDictionaries = orderDictionaries;
2
49
  //# sourceMappingURL=orderDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"orderDictionaries.cjs","names":["intlayerConfig"],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":["import intlayerConfig from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\n\n/**\n * Orders dictionaries based on the dictionary priority strategy.\n *\n * @param dictionaries - Array of dictionaries to order\n * @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')\n * @returns Ordered array of dictionaries\n */\nexport const orderDictionaries = (\n dictionaries: Dictionary[],\n configuration = intlayerConfig\n): Dictionary[] => {\n const { editor } = configuration;\n const { dictionaryPriorityStrategy } = editor;\n\n if (dictionaries.length <= 1) {\n return dictionaries;\n }\n\n // Stabilize original indices to preserve relative order for complete ties\n const withIndex = dictionaries.map((dictionary, index) => ({\n dictionary,\n index,\n }));\n\n const getPriority = (dictionary: Dictionary): number => {\n const p = dictionary.priority ?? 0;\n\n return Number.isFinite(p) ? p : 0;\n };\n\n const getLocationWeight = (d: Dictionary): number => {\n const location = d.location;\n\n // undefined location should always be last\n if (location === undefined) {\n return 2;\n }\n\n if (dictionaryPriorityStrategy === 'distant_first') {\n // distant should come first\n return location === 'remote' ? 0 : 1;\n }\n // default: local_first\n return location === 'local' ? 0 : 1;\n };\n\n withIndex.sort((a, b) => {\n // 1) Non-autoFilled before autoFilled (autoFilled have lower precedence)\n const aAuto = a.dictionary.filled ? 1 : 0;\n const bAuto = b.dictionary.filled ? 1 : 0;\n if (aAuto !== bAuto) return aAuto - bAuto; // 0 before 1\n\n // 2) Higher priority first (larger number wins)\n const aP = getPriority(a.dictionary);\n const bP = getPriority(b.dictionary);\n if (aP !== bP) return bP - aP; // descending\n\n // 3) Location according to strategy\n const aLocation = getLocationWeight(a.dictionary);\n const bLocation = getLocationWeight(b.dictionary);\n if (aLocation !== bLocation) return aLocation - bLocation;\n\n // 4) Stable fallback by original index\n return a.index - b.index;\n });\n\n return withIndex.map(({ dictionary }) => dictionary);\n};\n"],"mappings":"6JAUA,MAAa,GACX,EACA,EAAgBA,EAAAA,UACC,CACjB,GAAM,CAAE,UAAW,EACb,CAAE,8BAA+B,EAEvC,GAAI,EAAa,QAAU,EACzB,OAAO,EAIT,IAAM,EAAY,EAAa,KAAK,EAAY,KAAW,CACzD,aACA,QACD,EAAE,CAEG,EAAe,GAAmC,CACtD,IAAM,EAAI,EAAW,UAAY,EAEjC,OAAO,OAAO,SAAS,EAAE,CAAG,EAAI,GAG5B,EAAqB,GAA0B,CACnD,IAAM,EAAW,EAAE,SAYnB,OATI,IAAa,IAAA,GACR,EAGL,IAA+B,gBAE1B,IAAa,SAAW,EAAI,EAG9B,IAAa,QAAU,EAAI,GAuBpC,OApBA,EAAU,MAAM,EAAG,IAAM,CAEvB,IAAM,EAAQ,EAAE,WAAW,OAAS,EAAI,EAClC,EAAQ,EAAE,WAAW,OAAS,EAAI,EACxC,GAAI,IAAU,EAAO,OAAO,EAAQ,EAGpC,IAAM,EAAK,EAAY,EAAE,WAAW,CAC9B,EAAK,EAAY,EAAE,WAAW,CACpC,GAAI,IAAO,EAAI,OAAO,EAAK,EAG3B,IAAM,EAAY,EAAkB,EAAE,WAAW,CAC3C,EAAY,EAAkB,EAAE,WAAW,CAIjD,OAHI,IAAc,EAGX,EAAE,MAAQ,EAAE,MAHiB,EAAY,GAIhD,CAEK,EAAU,KAAK,CAAE,gBAAiB,EAAW"}
1
+ {"version":3,"file":"orderDictionaries.cjs","names":["intlayerConfig"],"sources":["../../../src/dictionaryManipulator/orderDictionaries.ts"],"sourcesContent":["import intlayerConfig from '@intlayer/config/built';\nimport type { Dictionary } from '@intlayer/types/dictionary';\n\n/**\n * Orders dictionaries based on the dictionary priority strategy.\n *\n * @param dictionaries - Array of dictionaries to order\n * @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')\n * @returns Ordered array of dictionaries\n */\nexport const orderDictionaries = (\n dictionaries: Dictionary[],\n configuration = intlayerConfig\n): Dictionary[] => {\n const { editor } = configuration;\n const { dictionaryPriorityStrategy } = editor;\n\n if (dictionaries.length <= 1) {\n return dictionaries;\n }\n\n // Stabilize original indices to preserve relative order for complete ties\n const withIndex = dictionaries.map((dictionary, index) => ({\n dictionary,\n index,\n }));\n\n const getPriority = (dictionary: Dictionary): number => {\n const p = dictionary.priority ?? 0;\n\n return Number.isFinite(p) ? p : 0;\n };\n\n const getLocationWeight = (d: Dictionary): number => {\n const location = d.location;\n\n // undefined location should always be last\n if (location === undefined) {\n return 2;\n }\n\n if (dictionaryPriorityStrategy === 'distant_first') {\n // distant should come first\n return location === 'remote' ? 0 : 1;\n }\n // default: local_first\n return location === 'local' ? 0 : 1;\n };\n\n withIndex.sort((a, b) => {\n // 1) Non-autoFilled before autoFilled (autoFilled have lower precedence)\n const aAuto = a.dictionary.filled ? 1 : 0;\n const bAuto = b.dictionary.filled ? 1 : 0;\n if (aAuto !== bAuto) return aAuto - bAuto; // 0 before 1\n\n // 2) Higher priority first (larger number wins)\n const aP = getPriority(a.dictionary);\n const bP = getPriority(b.dictionary);\n if (aP !== bP) return bP - aP; // descending\n\n // 3) Location according to strategy\n const aLocation = getLocationWeight(a.dictionary);\n const bLocation = getLocationWeight(b.dictionary);\n if (aLocation !== bLocation) return aLocation - bLocation;\n\n // 4) Stable fallback by original index\n return a.index - b.index;\n });\n\n return withIndex.map(({ dictionary }) => dictionary);\n};\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAa,qBACX,cACA,gBAAgBA,mCACC;CACjB,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,+BAA+B;AAEvC,KAAI,aAAa,UAAU,EACzB,QAAO;CAIT,MAAM,YAAY,aAAa,KAAK,YAAY,WAAW;EACzD;EACA;EACD,EAAE;CAEH,MAAM,eAAe,eAAmC;EACtD,MAAM,IAAI,WAAW,YAAY;AAEjC,SAAO,OAAO,SAAS,EAAE,GAAG,IAAI;;CAGlC,MAAM,qBAAqB,MAA0B;EACnD,MAAM,WAAW,EAAE;AAGnB,MAAI,aAAa,OACf,QAAO;AAGT,MAAI,+BAA+B,gBAEjC,QAAO,aAAa,WAAW,IAAI;AAGrC,SAAO,aAAa,UAAU,IAAI;;AAGpC,WAAU,MAAM,GAAG,MAAM;EAEvB,MAAM,QAAQ,EAAE,WAAW,SAAS,IAAI;EACxC,MAAM,QAAQ,EAAE,WAAW,SAAS,IAAI;AACxC,MAAI,UAAU,MAAO,QAAO,QAAQ;EAGpC,MAAM,KAAK,YAAY,EAAE,WAAW;EACpC,MAAM,KAAK,YAAY,EAAE,WAAW;AACpC,MAAI,OAAO,GAAI,QAAO,KAAK;EAG3B,MAAM,YAAY,kBAAkB,EAAE,WAAW;EACjD,MAAM,YAAY,kBAAkB,EAAE,WAAW;AACjD,MAAI,cAAc,UAAW,QAAO,YAAY;AAGhD,SAAO,EAAE,QAAQ,EAAE;GACnB;AAEF,QAAO,UAAU,KAAK,EAAE,iBAAiB,WAAW"}
@@ -1,2 +1,33 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n)=>{let r=t,i=null,a=null;for(let t of n)i=r,(t.type===e.NodeType.Object||t.type===e.NodeType.Array)&&(a=t.key,r=r[t.key]),(t.type===e.NodeType.Translation||t.type===e.NodeType.Enumeration||t.type===e.NodeType.Condition)&&(a=t.type,r=r[t.type][t.key]),(t.type===e.NodeType.Markdown||t.type===e.NodeType.ReactNode||t.type===e.NodeType.HTML||t.type===e.NodeType.Insertion||t.type===e.NodeType.File)&&(a=t.type,r=r[t.type]);return i&&a!==null&&(Array.isArray(i)?i.splice(a,1):delete i[a]),t};exports.removeContentNodeByKeyPath=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
4
+ _intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
5
+
6
+ //#region src/dictionaryManipulator/removeContentNodeByKeyPath.ts
7
+ const removeContentNodeByKeyPath = (dictionaryContent, keyPath) => {
8
+ let currentValue = dictionaryContent;
9
+ let parentValue = null;
10
+ let lastKey = null;
11
+ for (const keyObj of keyPath) {
12
+ parentValue = currentValue;
13
+ if (keyObj.type === _intlayer_types_nodeType.OBJECT || keyObj.type === _intlayer_types_nodeType.ARRAY) {
14
+ lastKey = keyObj.key;
15
+ currentValue = currentValue[keyObj.key];
16
+ }
17
+ if (keyObj.type === _intlayer_types_nodeType.TRANSLATION || keyObj.type === _intlayer_types_nodeType.ENUMERATION || keyObj.type === _intlayer_types_nodeType.CONDITION) {
18
+ lastKey = keyObj.type;
19
+ currentValue = currentValue[keyObj.type][keyObj.key];
20
+ }
21
+ if (keyObj.type === _intlayer_types_nodeType.MARKDOWN || keyObj.type === _intlayer_types_nodeType.REACT_NODE || keyObj.type === _intlayer_types_nodeType.HTML || keyObj.type === _intlayer_types_nodeType.INSERTION || keyObj.type === _intlayer_types_nodeType.FILE) {
22
+ lastKey = keyObj.type;
23
+ currentValue = currentValue[keyObj.type];
24
+ }
25
+ }
26
+ if (parentValue && lastKey !== null) if (Array.isArray(parentValue)) parentValue.splice(lastKey, 1);
27
+ else delete parentValue[lastKey];
28
+ return dictionaryContent;
29
+ };
30
+
31
+ //#endregion
32
+ exports.removeContentNodeByKeyPath = removeContentNodeByKeyPath;
2
33
  //# sourceMappingURL=removeContentNodeByKeyPath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"removeContentNodeByKeyPath.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/removeContentNodeByKeyPath.ts"],"sourcesContent":["import type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const removeContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKey: string | number | null = null;\n\n for (const keyObj of keyPath) {\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n lastKey = keyObj.key;\n currentValue = currentValue[keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Translation ||\n keyObj.type === NodeType.Enumeration ||\n keyObj.type === NodeType.Condition\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type][keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Markdown ||\n keyObj.type === NodeType.ReactNode ||\n keyObj.type === NodeType.HTML ||\n keyObj.type === NodeType.Insertion ||\n keyObj.type === NodeType.File\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type];\n }\n }\n\n if (parentValue && lastKey !== null) {\n if (Array.isArray(parentValue)) {\n parentValue.splice(lastKey as unknown as number, 1);\n } else {\n delete parentValue[lastKey];\n }\n }\n\n return dictionaryContent;\n};\n"],"mappings":"8IAIA,MAAa,GACX,EACA,IACgB,CAChB,IAAI,EAAoB,EACpB,EAAmB,KACnB,EAAkC,KAEtC,IAAK,IAAM,KAAU,EACnB,EAAc,GAEV,EAAO,OAASA,EAAAA,SAAS,QAAU,EAAO,OAASA,EAAAA,SAAS,SAC9D,EAAU,EAAO,IACjB,EAAe,EAAa,EAAO,OAInC,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,MAAM,EAAO,OAIhD,EAAO,OAASA,EAAAA,SAAS,UACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,MACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,QAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,OAYvC,OARI,GAAe,IAAY,OACzB,MAAM,QAAQ,EAAY,CAC5B,EAAY,OAAO,EAA8B,EAAE,CAEnD,OAAO,EAAY,IAIhB"}
1
+ {"version":3,"file":"removeContentNodeByKeyPath.cjs","names":["NodeTypes"],"sources":["../../../src/dictionaryManipulator/removeContentNodeByKeyPath.ts"],"sourcesContent":["import type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\n\nimport * as NodeTypes from '@intlayer/types/nodeType';\n\nexport const removeContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKey: string | number | null = null;\n\n for (const keyObj of keyPath) {\n parentValue = currentValue;\n\n if (keyObj.type === NodeTypes.OBJECT || keyObj.type === NodeTypes.ARRAY) {\n lastKey = keyObj.key;\n currentValue = currentValue[keyObj.key];\n }\n\n if (\n keyObj.type === NodeTypes.TRANSLATION ||\n keyObj.type === NodeTypes.ENUMERATION ||\n keyObj.type === NodeTypes.CONDITION\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type][keyObj.key];\n }\n\n if (\n keyObj.type === NodeTypes.MARKDOWN ||\n keyObj.type === NodeTypes.REACT_NODE ||\n keyObj.type === NodeTypes.HTML ||\n keyObj.type === NodeTypes.INSERTION ||\n keyObj.type === NodeTypes.FILE\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type];\n }\n }\n\n if (parentValue && lastKey !== null) {\n if (Array.isArray(parentValue)) {\n parentValue.splice(lastKey as unknown as number, 1);\n } else {\n delete parentValue[lastKey];\n }\n }\n\n return dictionaryContent;\n};\n"],"mappings":";;;;;;AAKA,MAAa,8BACX,mBACA,YACgB;CAChB,IAAI,eAAoB;CACxB,IAAI,cAAmB;CACvB,IAAI,UAAkC;AAEtC,MAAK,MAAM,UAAU,SAAS;AAC5B,gBAAc;AAEd,MAAI,OAAO,SAASA,yBAAU,UAAU,OAAO,SAASA,yBAAU,OAAO;AACvE,aAAU,OAAO;AACjB,kBAAe,aAAa,OAAO;;AAGrC,MACE,OAAO,SAASA,yBAAU,eAC1B,OAAO,SAASA,yBAAU,eAC1B,OAAO,SAASA,yBAAU,WAC1B;AACA,aAAU,OAAO;AACjB,kBAAe,aAAa,OAAO,MAAM,OAAO;;AAGlD,MACE,OAAO,SAASA,yBAAU,YAC1B,OAAO,SAASA,yBAAU,cAC1B,OAAO,SAASA,yBAAU,QAC1B,OAAO,SAASA,yBAAU,aAC1B,OAAO,SAASA,yBAAU,MAC1B;AACA,aAAU,OAAO;AACjB,kBAAe,aAAa,OAAO;;;AAIvC,KAAI,eAAe,YAAY,KAC7B,KAAI,MAAM,QAAQ,YAAY,CAC5B,aAAY,OAAO,SAA8B,EAAE;KAEnD,QAAO,YAAY;AAIvB,QAAO"}
@@ -1,2 +1,41 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n,r)=>{let i=t,a=null,o=null;for(let t of r)a=i,(t.type===e.NodeType.Object||t.type===e.NodeType.Array)&&(o=t.key,i=i[t.key]),(t.type===e.NodeType.Translation||t.type===e.NodeType.Enumeration||t.type===e.NodeType.Condition)&&(o=t.type,i=i[t.type][t.key]),(t.type===e.NodeType.Markdown||t.type===e.NodeType.ReactNode||t.type===e.NodeType.HTML||t.type===e.NodeType.Insertion||t.type===e.NodeType.File)&&(o=t.type,i=i[t.type]);if(a&&o!==null)if(Array.isArray(a))a[o]=i;else{let e={};for(let t of Object.keys(a))t===o&&n!==void 0?e[n]=i:e[t]=a[t];Object.keys(a).forEach(e=>{delete a[e]}),Object.assign(a,e)}return t};exports.renameContentNodeByKeyPath=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
4
+ _intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
5
+
6
+ //#region src/dictionaryManipulator/renameContentNodeByKeyPath.ts
7
+ const renameContentNodeByKeyPath = (dictionaryContent, newKey, keyPath) => {
8
+ let currentValue = dictionaryContent;
9
+ let parentValue = null;
10
+ let lastKey = null;
11
+ for (const keyObj of keyPath) {
12
+ parentValue = currentValue;
13
+ if (keyObj.type === _intlayer_types_nodeType.OBJECT || keyObj.type === _intlayer_types_nodeType.ARRAY) {
14
+ lastKey = keyObj.key;
15
+ currentValue = currentValue[keyObj.key];
16
+ }
17
+ if (keyObj.type === _intlayer_types_nodeType.TRANSLATION || keyObj.type === _intlayer_types_nodeType.ENUMERATION || keyObj.type === _intlayer_types_nodeType.CONDITION) {
18
+ lastKey = keyObj.type;
19
+ currentValue = currentValue[keyObj.type][keyObj.key];
20
+ }
21
+ if (keyObj.type === _intlayer_types_nodeType.MARKDOWN || keyObj.type === _intlayer_types_nodeType.REACT_NODE || keyObj.type === _intlayer_types_nodeType.HTML || keyObj.type === _intlayer_types_nodeType.INSERTION || keyObj.type === _intlayer_types_nodeType.FILE) {
22
+ lastKey = keyObj.type;
23
+ currentValue = currentValue[keyObj.type];
24
+ }
25
+ }
26
+ if (parentValue && lastKey !== null) if (Array.isArray(parentValue)) parentValue[lastKey] = currentValue;
27
+ else {
28
+ const newParentValue = {};
29
+ for (const key of Object.keys(parentValue)) if (key === lastKey && typeof newKey !== "undefined") newParentValue[newKey] = currentValue;
30
+ else newParentValue[key] = parentValue[key];
31
+ Object.keys(parentValue).forEach((key) => {
32
+ delete parentValue[key];
33
+ });
34
+ Object.assign(parentValue, newParentValue);
35
+ }
36
+ return dictionaryContent;
37
+ };
38
+
39
+ //#endregion
40
+ exports.renameContentNodeByKeyPath = renameContentNodeByKeyPath;
2
41
  //# sourceMappingURL=renameContentNodeByKeyPath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"renameContentNodeByKeyPath.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/renameContentNodeByKeyPath.ts"],"sourcesContent":["import type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const renameContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n newKey: KeyPath['key'],\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKey: string | number | null = null;\n\n for (const keyObj of keyPath) {\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n lastKey = keyObj.key;\n currentValue = currentValue[keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Translation ||\n keyObj.type === NodeType.Enumeration ||\n keyObj.type === NodeType.Condition\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type][keyObj.key];\n }\n\n if (\n keyObj.type === NodeType.Markdown ||\n keyObj.type === NodeType.ReactNode ||\n keyObj.type === NodeType.HTML ||\n keyObj.type === NodeType.Insertion ||\n keyObj.type === NodeType.File\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type];\n }\n }\n\n // Assign the new value to the last key of the parent while preserving the order\n if (parentValue && lastKey !== null) {\n if (Array.isArray(parentValue)) {\n parentValue[lastKey as number] = currentValue;\n } else {\n const newParentValue: any = {};\n for (const key of Object.keys(parentValue)) {\n if (key === lastKey && typeof newKey !== 'undefined') {\n newParentValue[newKey] = currentValue;\n } else {\n newParentValue[key] = parentValue[key];\n }\n }\n // Replace the contents of parentValue with newParentValue\n Object.keys(parentValue).forEach((key) => {\n delete parentValue[key];\n });\n Object.assign(parentValue, newParentValue);\n }\n }\n\n return dictionaryContent;\n};\n"],"mappings":"8IAIA,MAAa,GACX,EACA,EACA,IACgB,CAChB,IAAI,EAAoB,EACpB,EAAmB,KACnB,EAAkC,KAEtC,IAAK,IAAM,KAAU,EACnB,EAAc,GAEV,EAAO,OAASA,EAAAA,SAAS,QAAU,EAAO,OAASA,EAAAA,SAAS,SAC9D,EAAU,EAAO,IACjB,EAAe,EAAa,EAAO,OAInC,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aACzB,EAAO,OAASA,EAAAA,SAAS,aAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,MAAM,EAAO,OAIhD,EAAO,OAASA,EAAAA,SAAS,UACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,MACzB,EAAO,OAASA,EAAAA,SAAS,WACzB,EAAO,OAASA,EAAAA,SAAS,QAEzB,EAAU,EAAO,KACjB,EAAe,EAAa,EAAO,OAKvC,GAAI,GAAe,IAAY,KAC7B,GAAI,MAAM,QAAQ,EAAY,CAC5B,EAAY,GAAqB,MAC5B,CACL,IAAM,EAAsB,EAAE,CAC9B,IAAK,IAAM,KAAO,OAAO,KAAK,EAAY,CACpC,IAAQ,GAAkB,IAAW,OACvC,EAAe,GAAU,EAEzB,EAAe,GAAO,EAAY,GAItC,OAAO,KAAK,EAAY,CAAC,QAAS,GAAQ,CACxC,OAAO,EAAY,IACnB,CACF,OAAO,OAAO,EAAa,EAAe,CAI9C,OAAO"}
1
+ {"version":3,"file":"renameContentNodeByKeyPath.cjs","names":["NodeTypes"],"sources":["../../../src/dictionaryManipulator/renameContentNodeByKeyPath.ts"],"sourcesContent":["import type { ContentNode } from '@intlayer/types/dictionary';\nimport type { KeyPath } from '@intlayer/types/keyPath';\n\nimport * as NodeTypes from '@intlayer/types/nodeType';\n\nexport const renameContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n newKey: KeyPath['key'],\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKey: string | number | null = null;\n\n for (const keyObj of keyPath) {\n parentValue = currentValue;\n\n if (keyObj.type === NodeTypes.OBJECT || keyObj.type === NodeTypes.ARRAY) {\n lastKey = keyObj.key;\n currentValue = currentValue[keyObj.key];\n }\n\n if (\n keyObj.type === NodeTypes.TRANSLATION ||\n keyObj.type === NodeTypes.ENUMERATION ||\n keyObj.type === NodeTypes.CONDITION\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type][keyObj.key];\n }\n\n if (\n keyObj.type === NodeTypes.MARKDOWN ||\n keyObj.type === NodeTypes.REACT_NODE ||\n keyObj.type === NodeTypes.HTML ||\n keyObj.type === NodeTypes.INSERTION ||\n keyObj.type === NodeTypes.FILE\n ) {\n lastKey = keyObj.type;\n currentValue = currentValue[keyObj.type];\n }\n }\n\n // Assign the new value to the last key of the parent while preserving the order\n if (parentValue && lastKey !== null) {\n if (Array.isArray(parentValue)) {\n parentValue[lastKey as number] = currentValue;\n } else {\n const newParentValue: any = {};\n for (const key of Object.keys(parentValue)) {\n if (key === lastKey && typeof newKey !== 'undefined') {\n newParentValue[newKey] = currentValue;\n } else {\n newParentValue[key] = parentValue[key];\n }\n }\n // Replace the contents of parentValue with newParentValue\n Object.keys(parentValue).forEach((key) => {\n delete parentValue[key];\n });\n Object.assign(parentValue, newParentValue);\n }\n }\n\n return dictionaryContent;\n};\n"],"mappings":";;;;;;AAKA,MAAa,8BACX,mBACA,QACA,YACgB;CAChB,IAAI,eAAoB;CACxB,IAAI,cAAmB;CACvB,IAAI,UAAkC;AAEtC,MAAK,MAAM,UAAU,SAAS;AAC5B,gBAAc;AAEd,MAAI,OAAO,SAASA,yBAAU,UAAU,OAAO,SAASA,yBAAU,OAAO;AACvE,aAAU,OAAO;AACjB,kBAAe,aAAa,OAAO;;AAGrC,MACE,OAAO,SAASA,yBAAU,eAC1B,OAAO,SAASA,yBAAU,eAC1B,OAAO,SAASA,yBAAU,WAC1B;AACA,aAAU,OAAO;AACjB,kBAAe,aAAa,OAAO,MAAM,OAAO;;AAGlD,MACE,OAAO,SAASA,yBAAU,YAC1B,OAAO,SAASA,yBAAU,cAC1B,OAAO,SAASA,yBAAU,QAC1B,OAAO,SAASA,yBAAU,aAC1B,OAAO,SAASA,yBAAU,MAC1B;AACA,aAAU,OAAO;AACjB,kBAAe,aAAa,OAAO;;;AAKvC,KAAI,eAAe,YAAY,KAC7B,KAAI,MAAM,QAAQ,YAAY,CAC5B,aAAY,WAAqB;MAC5B;EACL,MAAM,iBAAsB,EAAE;AAC9B,OAAK,MAAM,OAAO,OAAO,KAAK,YAAY,CACxC,KAAI,QAAQ,WAAW,OAAO,WAAW,YACvC,gBAAe,UAAU;MAEzB,gBAAe,OAAO,YAAY;AAItC,SAAO,KAAK,YAAY,CAAC,SAAS,QAAQ;AACxC,UAAO,YAAY;IACnB;AACF,SAAO,OAAO,aAAa,eAAe;;AAI9C,QAAO"}
@@ -1,2 +1,40 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/types/nodeType`);const t=(t,n)=>{if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`)return n;if(typeof t?.nodeType==`string`){let r=t,i=r[r.nodeType];if(r.nodeType===e.NodeType.Translation||r.nodeType===e.NodeType.Enumeration||r.nodeType===e.NodeType.Condition){let e=Object.entries(i).reduce((e,[t])=>(e[t]=n,e),{});return{...r,[r.nodeType]:e}}return r.nodeType===e.NodeType.Nested?r:{...r,[r.nodeType]:n}}return!t||typeof t!=`object`?n:Array.isArray(t)?t.map(()=>n):Object.entries(t).reduce((e,[t])=>({...e,[t]:n}),{})};exports.updateNodeChildren=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
4
+ _intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
5
+
6
+ //#region src/dictionaryManipulator/updateNodeChildren.ts
7
+ const updateNodeChildren = (section, newChildren) => {
8
+ if (typeof section === "string") return newChildren;
9
+ if (typeof section === "number") return newChildren;
10
+ if (typeof section === "boolean") return newChildren;
11
+ if (typeof section?.nodeType === "string") {
12
+ const typedNode = section;
13
+ const content = typedNode[typedNode.nodeType];
14
+ if (typedNode.nodeType === _intlayer_types_nodeType.TRANSLATION || typedNode.nodeType === _intlayer_types_nodeType.ENUMERATION || typedNode.nodeType === _intlayer_types_nodeType.CONDITION) {
15
+ const newContent = Object.entries(content).reduce((acc, [key]) => {
16
+ acc[key] = newChildren;
17
+ return acc;
18
+ }, {});
19
+ return {
20
+ ...typedNode,
21
+ [typedNode.nodeType]: newContent
22
+ };
23
+ }
24
+ if (typedNode.nodeType === _intlayer_types_nodeType.NESTED) return typedNode;
25
+ return {
26
+ ...typedNode,
27
+ [typedNode.nodeType]: newChildren
28
+ };
29
+ }
30
+ if (!section || typeof section !== "object") return newChildren;
31
+ if (Array.isArray(section)) return section.map(() => newChildren);
32
+ return Object.entries(section).reduce((acc, [key]) => ({
33
+ ...acc,
34
+ [key]: newChildren
35
+ }), {});
36
+ };
37
+
38
+ //#endregion
39
+ exports.updateNodeChildren = updateNodeChildren;
2
40
  //# sourceMappingURL=updateNodeChildren.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateNodeChildren.cjs","names":["NodeType"],"sources":["../../../src/dictionaryManipulator/updateNodeChildren.ts"],"sourcesContent":["import type { ContentNode, TypedNode } from '@intlayer/types/dictionary';;\nimport { NodeType } from '@intlayer/types/nodeType';\n\nexport const updateNodeChildren = <\n T extends ContentNode,\n U extends ContentNode,\n>(\n section: T,\n newChildren: U\n): ContentNode => {\n if (typeof section === 'string') {\n return newChildren;\n }\n if (typeof section === 'number') {\n return newChildren;\n }\n if (typeof section === 'boolean') {\n return newChildren;\n }\n if (typeof (section as TypedNode)?.nodeType === 'string') {\n const typedNode = section as TypedNode;\n const content =\n typedNode[typedNode.nodeType as unknown as keyof typeof typedNode];\n\n if (\n typedNode.nodeType === NodeType.Translation ||\n typedNode.nodeType === NodeType.Enumeration ||\n typedNode.nodeType === NodeType.Condition\n ) {\n const newContent = Object.entries(content).reduce(\n (acc, [key]) => {\n acc[key] = newChildren;\n return acc;\n },\n {} as Record<string, ContentNode>\n );\n\n return {\n ...typedNode,\n [typedNode.nodeType]: newContent,\n };\n }\n\n if (typedNode.nodeType === NodeType.Nested) {\n return typedNode;\n }\n\n return {\n ...typedNode,\n [typedNode.nodeType]: newChildren,\n };\n }\n\n if (!section || typeof section !== 'object') {\n return newChildren;\n }\n\n if (Array.isArray(section)) {\n return section.map(() => newChildren) as unknown as ContentNode;\n }\n\n return Object.entries(\n section as unknown as Record<string, ContentNode>\n ).reduce(\n (acc, [key]) => ({\n ...acc,\n [key]: newChildren,\n }),\n {} as Record<string, ContentNode>\n ) as unknown as ContentNode;\n};\n"],"mappings":"8IAGA,MAAa,GAIX,EACA,IACgB,CAOhB,GANI,OAAO,GAAY,UAGnB,OAAO,GAAY,UAGnB,OAAO,GAAY,UACrB,OAAO,EAET,GAAI,OAAQ,GAAuB,UAAa,SAAU,CACxD,IAAM,EAAY,EACZ,EACJ,EAAU,EAAU,UAEtB,GACE,EAAU,WAAaA,EAAAA,SAAS,aAChC,EAAU,WAAaA,EAAAA,SAAS,aAChC,EAAU,WAAaA,EAAAA,SAAS,UAChC,CACA,IAAM,EAAa,OAAO,QAAQ,EAAQ,CAAC,QACxC,EAAK,CAAC,MACL,EAAI,GAAO,EACJ,GAET,EAAE,CACH,CAED,MAAO,CACL,GAAG,GACF,EAAU,UAAW,EACvB,CAOH,OAJI,EAAU,WAAaA,EAAAA,SAAS,OAC3B,EAGF,CACL,GAAG,GACF,EAAU,UAAW,EACvB,CAWH,MARI,CAAC,GAAW,OAAO,GAAY,SAC1B,EAGL,MAAM,QAAQ,EAAQ,CACjB,EAAQ,QAAU,EAAY,CAGhC,OAAO,QACZ,EACD,CAAC,QACC,EAAK,CAAC,MAAU,CACf,GAAG,GACF,GAAM,EACR,EACD,EAAE,CACH"}
1
+ {"version":3,"file":"updateNodeChildren.cjs","names":["NodeTypes"],"sources":["../../../src/dictionaryManipulator/updateNodeChildren.ts"],"sourcesContent":["import type { ContentNode, TypedNode } from '@intlayer/types/dictionary';\n\nimport * as NodeTypes from '@intlayer/types/nodeType';\n\nexport const updateNodeChildren = <\n T extends ContentNode,\n U extends ContentNode,\n>(\n section: T,\n newChildren: U\n): ContentNode => {\n if (typeof section === 'string') {\n return newChildren;\n }\n if (typeof section === 'number') {\n return newChildren;\n }\n if (typeof section === 'boolean') {\n return newChildren;\n }\n if (typeof (section as TypedNode)?.nodeType === 'string') {\n const typedNode = section as TypedNode;\n const content =\n typedNode[typedNode.nodeType as unknown as keyof typeof typedNode];\n\n if (\n typedNode.nodeType === NodeTypes.TRANSLATION ||\n typedNode.nodeType === NodeTypes.ENUMERATION ||\n typedNode.nodeType === NodeTypes.CONDITION\n ) {\n const newContent = Object.entries(content).reduce(\n (acc, [key]) => {\n acc[key] = newChildren;\n return acc;\n },\n {} as Record<string, ContentNode>\n );\n\n return {\n ...typedNode,\n [typedNode.nodeType]: newContent,\n };\n }\n\n if (typedNode.nodeType === NodeTypes.NESTED) {\n return typedNode;\n }\n\n return {\n ...typedNode,\n [typedNode.nodeType]: newChildren,\n };\n }\n\n if (!section || typeof section !== 'object') {\n return newChildren;\n }\n\n if (Array.isArray(section)) {\n return section.map(() => newChildren) as unknown as ContentNode;\n }\n\n return Object.entries(\n section as unknown as Record<string, ContentNode>\n ).reduce(\n (acc, [key]) => ({\n ...acc,\n [key]: newChildren,\n }),\n {} as Record<string, ContentNode>\n ) as unknown as ContentNode;\n};\n"],"mappings":";;;;;;AAIA,MAAa,sBAIX,SACA,gBACgB;AAChB,KAAI,OAAO,YAAY,SACrB,QAAO;AAET,KAAI,OAAO,YAAY,SACrB,QAAO;AAET,KAAI,OAAO,YAAY,UACrB,QAAO;AAET,KAAI,OAAQ,SAAuB,aAAa,UAAU;EACxD,MAAM,YAAY;EAClB,MAAM,UACJ,UAAU,UAAU;AAEtB,MACE,UAAU,aAAaA,yBAAU,eACjC,UAAU,aAAaA,yBAAU,eACjC,UAAU,aAAaA,yBAAU,WACjC;GACA,MAAM,aAAa,OAAO,QAAQ,QAAQ,CAAC,QACxC,KAAK,CAAC,SAAS;AACd,QAAI,OAAO;AACX,WAAO;MAET,EAAE,CACH;AAED,UAAO;IACL,GAAG;KACF,UAAU,WAAW;IACvB;;AAGH,MAAI,UAAU,aAAaA,yBAAU,OACnC,QAAO;AAGT,SAAO;GACL,GAAG;IACF,UAAU,WAAW;GACvB;;AAGH,KAAI,CAAC,WAAW,OAAO,YAAY,SACjC,QAAO;AAGT,KAAI,MAAM,QAAQ,QAAQ,CACxB,QAAO,QAAQ,UAAU,YAAY;AAGvC,QAAO,OAAO,QACZ,QACD,CAAC,QACC,KAAK,CAAC,UAAU;EACf,GAAG;GACF,MAAM;EACR,GACD,EAAE,CACH"}
@@ -1,2 +1,26 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`),t=require(`../utils/intl.cjs`);let n=require(`@intlayer/config/built`);n=e.t(n);const r=(e,r)=>new t.CachedIntl.NumberFormat(r?.locale??n.default?.internationalization?.defaultLocale,{...r,notation:`compact`}).format(Number(e));exports.compact=r;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_utils_intl = require('../utils/intl.cjs');
4
+ let _intlayer_config_built = require("@intlayer/config/built");
5
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
6
+
7
+ //#region src/formatters/compact.ts
8
+ /**
9
+ * Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)
10
+ * based on locale and formatting options.
11
+ *
12
+ * @example
13
+ * compact(1200); // "1.2K"
14
+ *
15
+ * @example
16
+ * compact("1000000", { locale: Locales.FRENCH, compactDisplay: "long" });
17
+ * // "1 million"
18
+ */
19
+ const compact = (value, options) => new require_utils_intl.CachedIntl.NumberFormat(options?.locale ?? _intlayer_config_built.default?.internationalization?.defaultLocale, {
20
+ ...options,
21
+ notation: "compact"
22
+ }).format(Number(value));
23
+
24
+ //#endregion
25
+ exports.compact = compact;
2
26
  //# sourceMappingURL=compact.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"compact.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/compact.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)\n * based on locale and formatting options.\n *\n * @example\n * compact({ value: 1200 }); // \"1.2K\"\n *\n * @example\n * compact({ value: \"1000000\", locale: Locales.FRENCH, compactDisplay: \"long\" });\n * // \"1 million\"\n */\nexport const compact = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n ...options,\n notation: 'compact',\n }\n ).format(Number(value));\n"],"mappings":"4LAeA,MAAa,GACX,EACA,IAEA,IAAIA,EAAAA,WAAW,aACb,GAAS,QAAUC,EAAAA,SAAe,sBAAsB,cACxD,CACE,GAAG,EACH,SAAU,UACX,CACF,CAAC,OAAO,OAAO,EAAM,CAAC"}
1
+ {"version":3,"file":"compact.cjs","names":["CachedIntl","configuration"],"sources":["../../../src/formatters/compact.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport { Intl as CachedIntl } from '../utils/intl';\n\n/**\n * Formats a numeric value using compact notation (e.g., 1K, 1M, 1B)\n * based on locale and formatting options.\n *\n * @example\n * compact(1200); // \"1.2K\"\n *\n * @example\n * compact(\"1000000\", { locale: Locales.FRENCH, compactDisplay: \"long\" });\n * // \"1 million\"\n */\nexport const compact = (\n value: string | number,\n options?: Intl.NumberFormatOptions & { locale?: LocalesValues }\n): string =>\n new CachedIntl.NumberFormat(\n options?.locale ?? configuration?.internationalization?.defaultLocale,\n {\n ...options,\n notation: 'compact',\n }\n ).format(Number(value));\n"],"mappings":";;;;;;;;;;;;;;;;;;AAeA,MAAa,WACX,OACA,YAEA,IAAIA,8BAAW,aACb,SAAS,UAAUC,gCAAe,sBAAsB,eACxD;CACE,GAAG;CACH,UAAU;CACX,CACF,CAAC,OAAO,OAAO,MAAM,CAAC"}